PageSourceSearch

https://guruhotel.com/_next/static/immutable/chunks/1lnmwg4olw7ty.js

js guruhotel.com collected 2026-10-03 21:26:18 UTC 525,131 bytes, 556 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,30580,59949,75025,44579,39456,28799,e=>{"use strict";var t=e.i(71645),n=e.i(6311);function r(e){let t=[],r=[];if(!e||"object"!=typeof e)return t.push("Data must be a valid object"),{isValid:!1,errors:t,warnings:r};for(let n of["id","slug","template","tagIds","seo","content","createdAt","updatedAt"])n in e||t.push(`Missing required field: ${n}`);if(e.id&&("string"!=typeof e.id?t.push("ID must be a string"):/^[a-z0-9-]+$/.test(e.id)||t.push("ID must be lowercase, alphanumeric, and use hyphens only (kebab-case)")),e.slug&&("object"==typeof e.slug&&e.slug.en&&e.slug.es?"string"!=typeof e.slug.en||"string"!=typeof e.slug.es?t.push('Slug "en" and "es" must be strings'):(/^[a-z0-9/-]+$/.test(e.slug.en)||t.push("English slug must be lowercase, alphanumeric, and use hyphens/slashes only"),/^[a-z0-9/-]+$/.test(e.slug.es)||t.push("Spanish slug must be lowercase, alphanumeric, and use hyphens/slashes only")):t.push('Slug must be an object with "en" and "es" properties')),void 0===e.category||""===e.category||n.AVAILABLE_CATEGORIES.some(t=>t.value===e.category)||t.push(`Invalid category: ${e.category}. Must be one of: ${n.AVAILABLE_CATEGORIES.map(e=>e.value).join(", ")}`),e.template&&!n.AVAILABLE_TEMPLATES.some(t=>t.value===e.template)&&t.push(`Invalid template: ${e.template}. Must be one of: ${n.AVAILABLE_TEMPLATES.map(e=>e.value).join(", ")}`),e.tagIds)if(Array.isArray(e.tagIds))for(let n of e.tagIds){if("string"!=typeof n){t.push("All tagIds must be strings");break}if(!/^[a-z0-9-]+$/.test(n)){t.push(`Invalid tagId format: ${n}. Must be kebab-case`);break}}else t.push("tagIds must be an array");if(e.seo)if("object"!=typeof e.seo)t.push("SEO must be an object");else for(let n of["en","es"])if(e.seo[n]){let r=e.seo[n];r.title&&r.description||t.push(`SEO ${n} must have title and description`),r.title&&"string"!=typeof r.title&&t.push(`SEO ${n} title must be a string`),r.description&&"string"!=typeof r.description&&t.push(`SEO ${n} description must be a string`)}else t.push(`Missing SEO data for language: ${n}`);if(e.content)if("object"!=typeof e.content)t.push("Content must be an object");else for(let n of["en","es"])if(e.content[n]){let r=e.content[n];for(let e of["title","description","content"])r[e]?"string"!=typeof r[e]&&t.push(`Content ${n} ${e} must be a string`):t.push(`Content ${n} missing required field: ${e}`);if(r.features)if(Array.isArray(r.features))for(let e of r.features)e.icon&&e.title&&e.description||t.push(`Content ${n} feature missing required fields: icon, title, description`),e.icon&&"string"!=typeof e.icon&&t.push(`Content ${n} feature icon must be a string`),e.title&&"string"!=typeof e.title&&t.push(`Content ${n} feature title must be a string`),e.description&&"string"!=typeof e.description&&t.push(`Content ${n} feature description must be a string`);else t.push(`Content ${n} features must be an array`);r.primaryButton&&(r.primaryButton.text&&r.primaryButton.link&&r.primaryButton.variant||t.push(`Content ${n} primaryButton missing required fields: text, link, variant`),r.primaryButton.variant&&!["primary","outline"].includes(r.primaryButton.variant)&&t.push(`Content ${n} primaryButton variant must be 'primary' or 'outline'`)),r.outlineButton&&(r.outlineButton.text&&r.outlineButton.link&&r.outlineButton.variant||t.push(`Content ${n} outlineButton missing required fields: text, link, variant`),r.outlineButton.variant&&!["primary","outline"].includes(r.outlineButton.variant)&&t.push(`Content ${n} outlineButton variant must be 'primary' or 'outline'`))}else t.push(`Missing content for language: ${n}`);return e.createdAt&&("string"!=typeof e.createdAt||isNaN(Date.parse(e.createdAt)))&&t.push("createdAt must be a valid ISO date string"),e.updatedAt&&("string"!=typeof e.updatedAt||isNaN(Date.parse(e.updatedAt)))&&t.push("updatedAt must be a valid ISO date string"),e.featuredImage&&"string"!=typeof e.featuredImage&&t.push("featuredImage must be a string (URL)"),e.icon&&"string"!=typeof e.icon&&t.push("icon must be a string"),{isValid:0===t.length,errors:t,warnings:r}}function i(e){try{let t=JSON.parse(e);return{isValid:!0,data:t}}catch(e){return{isValid:!1,error:e instanceof Error?e.message:"Invalid JSON syntax"}}}e.s(["useLandingPageForm",0,function({initialData:e,isEdit:n=!1}={}){let[o,s]=(0,t.useState)(()=>e||{id:"",slug:{en:"",es:""},category:"",template:"integrations",tagIds:[],featuredImage:"",icon:"Settings",seo:{en:{title:"",description:"",includeInSitemap:!0},es:{title:"",description:"",includeInSitemap:!0}},content:{en:{title:"",description:"",content:"",primaryButton:{text:"",link:"",variant:"primary"},outlineButton:{text:"",link:"",variant:"outline"},features:[],featuresSection:void 0,testimonialsSection:void 0,hero:void 0,testimonials:[],pricing:void 0,faq:void 0,people:void 0,statistics:void 0,gallery:void 0,process:void 0,comparison:void 0,contact:void 0,socialProof:void 0,cta:void 0},es:{title:"",description:"",content:"",primaryButton:{text:"",link:"",variant:"primary"},outlineButton:{text:"",link:"",variant:"outline"},features:[],featuresSection:void 0,testimonialsSection:void 0,hero:void 0,testimonials:[],pricing:void 0,faq:void 0,people:void 0,statistics:void 0,gallery:void 0,process:void 0,comparison:void 0,contact:void 0,socialProof:void 0,cta:void 0}},createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}),[a,l]=(0,t.useState)({icon:"Settings",title:"",description:""}),[c,d]=(0,t.useState)([]),[h,u]=(0,t.useState)(""),[p,f]=(0,t.useState)(""),[m,g]=(0,t.useState)([]),[y,b]=(0,t.useState)([]),[x,v]=(0,t.useState)(""),[w,k]=(0,t.useState)(""),[S,M]=(0,t.useState)(!1),[C,N]=(0,t.useState)(!1),[E,T]=(0,t.useState)(!1);(0,t.useEffect)(()=>{e&&(s(e),d(e.tagIds||[]))},[e]),(0,t.useEffect)(()=>{u(JSON.stringify(o,null,2))},[o]);let O=e=>({integrations:"integraciones","ai-website-builder":"creador-de-sitios-con-ia","booking-engine":"motor-de-reservas","contact-us":"contacto","hotel-website":"sitio-web-hotelero","payments-orchestration":"orquestacion-de-pagos","press-investors":"prensa-inversores",pricing:"precios","privacy-policy":"politica-de-privacidad","terms-and-conditions":"terminos-y-condiciones","what-is-guruhotel":"que-es-guruhotel"})[e]||e,A=(e,t)=>
1{s(n=>({...n,[e]:t,updatedAt:new Date().toISOString()}))},j=async()=>{try{let e=await fetch("/api/tags"),t=e.ok?await e.json():[],n=`You are an expert web developer creating comprehensive landing page content for a hotel technology platform.
2
3Generate a complete JSON structure for a landing page about "${x}".
4
5IMPORTANT RULES:
61. Return ONLY valid JSON, no explanations or markdown
72. Use the exact structure provided below
83. Only include sections that are relevant to the topic and context
94. Use realistic, professional content
105. Ensure both English and Spanish content are provided
116. Use appropriate icons from the available list
127. Include 3-4 relevant features
138. Use proper slugs for the category
149. Make content engaging and conversion-focused
15
16SECTION SELECTION GUIDELINES:
17- ALWAYS include: title, description, content, features, featuresSection
18- Include testimonials ONLY if the topic is about a product/service with customer feedback
19- Include FAQ ONLY if the topic has common questions or concerns
20- Include people ONLY if the topic is about a company, team, or service with human elements
21- Include statistics ONLY if the topic has measurable results or achievements
22- Choose the most appropriate template based on the topic:
23  * "integrations" - for API/software integrations
24  * "product" - for product showcases
25  * "landing" - for comprehensive marketing pages
26  * "service" - for service offerings
27  * "pricing" - for pricing pages
28  * "about" - for company/about pages
29  * "contact" - for contact pages
30
31JSON STRUCTURE (sections marked with * are optional and should only be included if relevant):
32{
33  "id": "unique-kebab-case-id",
34  "slug": {
35    "en": "category/sub-page-slug",
36    "es": "categoria/sub-pagina-slug"
37  },
38  "category": "integrations",
39  "template": "landing",
40  "tagIds": ["tag-id-1", "tag-id-2"],
41  "featuredImage": "https://example.com/image.jpg",
42  "icon": "Settings",
43  "seo": {
44    "en": {
45      "title": "Page Title | GuruHotel",
46      "description": "Page description for SEO",
47      "includeInSitemap": true
48    },
49    "es": {
50      "title": "T\xedtulo de P\xe1gina | GuruHotel",
51      "description": "Descripci\xf3n de p\xe1gina para SEO",
52      "includeInSitemap": true
53    }
54  },
55  "content": {
56    "en": {
57      "title": "Page Title",
58      "description": "Brief description",
59      "content": "<p>Rich HTML content here</p>",
60      "primaryButton": {
61        "text": "Get Started",
62        "link": "/contact-us",
63        "variant": "primary"
64      },
65      "outlineButton": {
66        "text": "Learn More",
67        "link": "/what-is-guruhotel",
68        "variant": "outline"
69      },
70      "featuresSection": {
71        "title": "Key Features",
72        "description": "Discover what makes our solution stand out"
73      },
74      "features": [
75        {
76          "icon": "Settings",
77          "title": "Feature Title",
78          "description": "Feature description"
79        }
80      ],
81      "testimonialsSection": { // * OPTIONAL - only if topic has customer feedback
82        "title": "What Our Customers Say",
83        "description": "Don't just take our word for it. Here's what our customers have to say."
84      },
85      "testimonials": [ // * OPTIONAL - only if topic has customer feedback
86        {
87          "id": "testimonial-1",
88          "name": "John Smith",
89          "role": "Hotel Manager",
90          "company": "Grand Hotel",
91          "content": "This solution has transformed our operations completely.",
92          "rating": 5
93        }
94      ],
95      "faq": { // * OPTIONAL - only if topic has common questions
96        "title": "Frequently Asked Questions",
97        "description": "Find answers to common questions about our product.",
98        "items": [
99          {
100            "id": "faq-1",
101            "question": "How does this work?",
102            "answer": "Our solution integrates seamlessly with your existing systems."
103          }
104        ]
105      },
106      "people": { // * OPTIONAL - only if topic involves team/company
107        "title": "Meet Our Team",
108        "description": "The talented people behind our success.",
109        "members": [
110          {
111            "id": "person-1",
112            "name": "Jane Doe",
113            "role": "Product Manager",
114            "bio": "Expert in hotel technology with 10+ years experience.",
115            "socialLinks": {
116              "linkedin": "https://linkedin.com/in/janedoe",
117              "twitter": "https://twitter.com/janedoe"
118            }
119          }
120        ]
121      },
122      "statistics": { // * OPTIONAL - only if topic has measurable results
123        "title": "Our Impact",
124        "description": "Numbers that speak for themselves.",
125        "items": [
126          {
127            "id": "stat-1",
128            "number": "1000+",
129            "label": "Hotels Served",
130            "icon": "Users"
131          }
132        ]
133      }
134    },
135    "es": {
136      "title": "T\xedtulo de P\xe1gina",
137      "description": "Descripci\xf3n breve",
138      "content": "<p>Contenido HTML rico aqu\xed</p>",
139      "primaryButton": {
140        "text": "Comenzar",
141        "link": "/contacto",
142        "variant": "primary"
143      },
144      "outlineButton": {
145        "text": "Conoce M\xe1s",
146        "link": "/que-es-guruhotel",
147        "variant": "outline"
148      },
149      "featuresSection": {
150        "title": "Caracter\xedsticas Clave",
151        "description": "Descubre qu\xe9 hace que nuestra soluci\xf3n se destaque"
152      },
153      "features": [
154        {
155          "icon": "Settings",
156          "title": "T\xedtulo de Caracter\xedstica",
157          "description": "Descripci\xf3n de caracter\xedstica"
158        }
159      ],
160      "testimonialsSection": { // * OPTIONAL - only if topic has customer feedback
161        "title": "Lo Que Dicen Nuestros Clientes",
162        "description": "No solo tomes nuestra palabra. Esto es lo que dicen nuestros clientes."
163      },
164      "testimonials": [ // * OPTIONAL - only if topic has customer feedback
165        {
166          "id": "testimonial-1",
167          "name": "Juan P\xe9rez",
168          "role": "Gerente de Hotel",
169          "company": "Hotel Grand",
170          "content": "Esta soluci\xf3n ha transformado completamente nuestras operaciones.",
171          "rating": 5
172        }
173      ],
174      "faq": { // * OPTIONAL - only if topic has common questions
175        "title": "Preguntas Frecuentes",
176        "description": "Encuentra respuestas a preguntas comunes sobre nuestro producto.",
177        "items": [
178          {
179            "id": "faq-1",
180            "question": "\xbfC\xf3mo funciona esto?",
181            "answer": "Nuestra soluci\xf3n se integra perfectamente con tus sistemas existentes."
182          }
183        ]
184      },
185      "people": { // * OPTIONAL - only if topic involves team/company
186        "title": "Conoce Nuestro Equipo",
187        "description": "Las personas talentosas detr\xe1s de nuestro \xe9xito.",
188        "members": [
189          {
190            "id": "person-1",
191            "name": "Mar\xeda Garc\xeda",
192            "role": "Gerente de Producto",
193            "bio": "Experta en tecnolog\xeda hotelera con m\xe1s de 10 a\xf1os de experiencia.",
194            "socialLinks": {
195              "linkedin": "https://linkedin.com/in/mariagarcia",
196              "twitter": "https://twitter.com/mariagarcia"
197            }
198          }
199        ]
200      },
201      "statistics": { // * OPTIONAL - only if topic has measurable results
202        "title": "Nuestro Impacto",
203        "description": "N\xfameros que hablan por s\xed solos.",
204        "items": [
205          {
206            "id": "stat-1",
207            "number": "1000+",
208            "label": "Hoteles Atendidos",
209            "icon": "Users"
210          }
211        ]
212      }
213    }
214  },
215  "createdAt": "${new Date().toISOString()}",
216  "updatedAt": "${new Date().toISOString()}"
217}
218
219AVAILABLE CATEGORIES: integrations, ai-website-builder, booking-engine, contact-us, hotel-website, payments-orchestration, press-investors, pricing, privacy-policy, terms-and-conditions, what-is-guruhotel
220
221AVAILABLE TEMPLATES: integrations, product, landing, service, pricing, about, 
221contact
222
223AVAILABLE TAGS: ${t.map(e=>`${e.id} (${e.name.en}/${e.name.es})`).join(", ")}
224
225AVAILABLE ICONS: Settings, Pencil, Users, Shield, Zap, Globe, Heart, Star, CheckCircle, AlertCircle, Info, Mail, Phone, MapPin, Calendar, Clock, DollarSign, TrendingUp, BarChart, PieChart
226
227CONTENT GUIDELINES:
228- Use professional, engaging language
229- Make testimonials sound authentic and specific
230- Create realistic FAQs that address common concerns
231- Include diverse team members with relevant roles
232- Use impressive but believable statistics
233- Ensure all content is relevant to the hotel technology industry
234- Make section titles compelling and action-oriented
235
236EXAMPLES OF WHEN TO INCLUDE/EXCLUDE SECTIONS:
237
238INCLUDE testimonials for:
239- Product integrations (customers using the integration)
240- Service offerings (client success stories)
241- Software solutions (user feedback)
242
243EXCLUDE testimonials for:
244- Technical documentation
245- Company policies (privacy, terms)
246- Simple contact pages
247
248INCLUDE FAQ for:
249- Complex integrations (common setup questions)
250- Product features (how-to questions)
251- Service offerings (pricing, process questions)
252
253EXCLUDE FAQ for:
254- Simple contact pages
255- Basic company information
256- Technical specifications
257
258INCLUDE people for:
259- Company/about pages
260- Service teams
261- Product development teams
262
263EXCLUDE people for:
264- Technical integrations
265- Policy pages
266- Simple contact forms
267
268INCLUDE statistics for:
269- Product performance metrics
270- Company achievements
271- Service results
272
273EXCLUDE statistics for:
274- Contact pages
275- Policy pages
276- Simple informational pages
277
278Remember: Return ONLY the JSON object, no other text.`;k(n)}catch(e){console.error("Error generating AI prompt:",e)}},I=async()=>{T(!0);try{let e=n?`/api/landing-pages/${o.id}`:"/api/landing-pages",t=await fetch(e,{method:n?"PUT":"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)});if(t.ok)alert(n?"Landing page updated successfully!":"Landing page created successfully!"),n||(s(e=>({...e,id:"",slug:{en:"",es:""},category:"",tagIds:[],featuredImage:"",icon:"Settings",seo:{en:{title:"",description:"",includeInSitemap:!0},es:{title:"",description:"",includeInSitemap:!0}},content:{en:{title:"",description:"",content:"",primaryButton:{text:"",link:"",variant:"primary"},outlineButton:{text:"",link:"",variant:"outline"},features:[],hero:void 0,testimonials:[],pricing:void 0,faq:void 0,people:void 0,statistics:void 0,gallery:void 0,process:void 0,comparison:void 0,contact:void 0,socialProof:void 0,cta:void 0},es:{title:"",description:"",content:"",primaryButton:{text:"",link:"",variant:"primary"},outlineButton:{text:"",link:"",variant:"outline"},features:[],hero:void 0,testimonials:[],pricing:void 0,faq:void 0,people:void 0,statistics:void 0,gallery:void 0,process:void 0,comparison:void 0,contact:void 0,socialProof:void 0,cta:void 0}},createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()})),d([]));else{let e=await t.text();alert(`Error: ${e}`)}}catch(e){console.error("Error saving landing page:",e),alert("Error saving landing page")}finally{T(!1)}};return{formData:o,currentFeature:a,selectedTagIds:c,jsonEditorValue:h,jsonError:p,validationErrors:m,validationWarnings:y,aiTopic:x,aiPrompt:w,copied:S,loading:C,saving:E,setFormData:s,setCurrentFeature:l,setSelectedTagIds:d,setJsonEditorValue:u,setJsonError:f,setValidationErrors:g,setValidationWarnings:b,setAiTopic:v,setAiPrompt:k,setCopied:M,setLoading:N,setSaving:T,updateFormData:A,handleCategoryChange:e=>{if(A("category",e),e){let t=O(e);s(n=>({...n,slug:{en:`${e}/`,es:`${t}/`},updatedAt:new Date().toISOString()}))}else s(e=>({...e,slug:{en:"",es:""},updatedAt:new Date().toISOString()}))},handleTagIdsChange:e=>{d(e),A("tagIds",e)},addFeature:e=>{if(!a.title.trim())return;let t={icon:a.icon,title:a.title,description:a.description};s(n=>({...n,content:{...n.content,[e]:{...n.content[e],features:[...n.content[e].features||[],t]}},updatedAt:new Date().toISOString()})),l({icon:"Settings",title:"",description:""})},removeFeature:(e,t)=>{s(n=>({...n,content:{...n.content,[e]:{...n.content[e],features:n.content[e].features.filter((e,n
278)=>n!==t)}},updatedAt:new Date().toISOString()}))},updateFeature:(e,t,n)=>{s(r=>({...r,content:{...r.content,[e]:{...r.content[e],features:r.content[e].features.map((e,r)=>r===t?n:e)}},updatedAt:new Date().toISOString()}))},handleJsonEditorChange:e=>{u(e),f(""),g([]),b([]);let t=i(e);if(!t.isValid)return void f(t.error||"Invalid JSON format");let n=r(t.data);g(n.errors),b(n.warnings),n.isValid?s(t.data):f("Validation failed - see errors below")},handleApplyJsonChanges:()=>{let e=i(h);if(!e.isValid)return void f(e.error||"Invalid JSON format");let t=r(e.data);if(!t.isValid){f("Validation failed - see errors below"),g(t.errors),b(t.warnings);return}s(e.data),f(""),g([]),b([]),alert("JSON changes applied successfully!")},generateAIPrompt:j,saveLandingPage:I,addTestimonial:(e,t)=>{s(n=>({...n,content:{...n.content,[e]:{...n.content[e],testimonials:[...n.content[e].testimonials||[],t]}},updatedAt:new Date().toISOString()}))},removeTestimonial:(e,t)=>{s(n=>({...n,content:{...n.content,[e]:{...n.content[e],testimonials:(n.content[e].testimonials||[]).filter((e,n)=>n!==t)}},updatedAt:new Date().toISOString()}))},updateTestimonial:(e,t,n)=>{s(r=>({...r,content:{...r.content,[e]:{...r.content[e],testimonials:(r.content[e].testimonials||[]).map((e,r)=>r===t?n:e)}},updatedAt:new Date().toISOString()}))},addFAQ:(e,t)=>{s(n=>({...n,content:{...n.content,[e]:{...n.content[e],faq:{...n.content[e].faq,items:[...n.content[e].faq?.items||[],t]}}},updatedAt:new Date().toISOString()}))},removeFAQ:(e,t)=>{s(n=>({...n,content:{...n.content,[e]:{...n.content[e],faq:{...n.content[e].faq,items:(n.content[e].faq?.items||[]).filter((e,n)=>n!==t)}}},updatedAt:new Date().toISOString()}))},updateFAQ:(e,t,n)=>{s(r=>({...r,content:{...r.content,[e]:{...r.content[e],faq:{...r.content[e].faq,items:(r.content[e].faq?.items||[]).map((e,r)=>r===t?n:e)}}},updatedAt:new Date().toISOString()}))},addPerson:(e,t)=>{s(n=>({...n,content:{...n.content,[e]:{...n.content[e],people:{...n.content[e].people,members:[...n.content[e].people?.members||[],t]}}},updatedAt:new Date().toISOString()}))},removePerson:(e,t)=>{s(n=>({...n,content:{...n.content,[e]:{...n.content[e],people:{...n.content[e].people,members:(n.content[e].people?.members||[]).filter((e,n)=>n!==t)}}},updatedAt:new Date().toISOString()}))},updatePerson:(e,t,n)=>{s(r=>({...r,content:{...r.content,[e]:{...r.content[e],people:{...r.content[e].people,members:(r.content[e].people?.members||[]).map((e,r)=>r===t?n:e)}}},updatedAt:new Date().toISOString()}))},addStatistic:(e,t)=>{s(n=>({...n,content:{...n.content,[e]:{...n.content[e],statistics:{...n.content[e].statistics,items:[...n.content[e].statistics?.items||[],t]}}},updatedAt:new Date().toISOString()}))},removeStatistic:(e,t)=>{s(n=>({...n,content:{...n.content,[e]:{...n.content[e],statistics:{...n.content[e].statistics,items:(n.content[e].statistics?.items||[]).filter((e,n)=>n!==t)}}},updatedAt:new Date().toISOString()}))},updateStatistic:(e,t,n)=>{s(r=>({...r,content:{...r.content,[e]:{...r.content[e],statistics:{...r.content[e].statistics,items:(r.content[e].statistics?.items||[]).map((e,r)=>r===t?n:e)}}},updatedAt:new Date().toISOString()}))},getSpanishCategory:O}}],30580);var o=e.i(43476);e.i(92338);var s=e.i(27179),a=e.i(4766),l=e.i(16605),c=e.i(39616),d=e.i(75254);let h=(0,d.default)("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);var u=e.i(61911),p=e.i(98919);let f=(0,d.default)("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);var m=e.i(48256);let g=(0,d.default)("heart",[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]]);var y=e.i(70273),b=e.i(69638),x=e.i(77220),x=x;let v=(0,d.default)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);var w=e.i(68214),w=w;let k=(0,d.default)("phone",[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 
2780 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]]);var S=e.i(46897),M=e.i(87316),C=e.i(3116);let N=(0,d.default)("dollar-sign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]);var E=e.i(25652);let T=(0,d.default)("chart-no-axes-column-increasing",[["path",{d:"M5 21v-6",key:"1hz6c0"}],["path",{d:"M12 21V9",key:"uvy0l4"}],["path",{d:"M19 21V3",key:"11j9sm"}]]),O=(0,d.default)("chart-pie",[["path",{d:"M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z",key:"pzmjnu"}],["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}]]),A=["Settings","Pencil","Users","Shield","Zap","Globe","Heart","Star","CheckCircle","AlertCircle","Info","Mail","Phone","MapPin","Calendar","Clock","DollarSign","TrendingUp","BarChart","PieChart"],j={Settings:c.Settings,Pencil:h,Users:u.Users,Shield:p.Shield,Zap:f,Globe:m.Globe,Heart:g,Star:y.Star,CheckCircle:b.CheckCircle,AlertCircle:x.default,Info:v,Mail:w.default,Phone:k,MapPin:S.MapPin,Calendar:M.Calendar,Clock:C.Clock,DollarSign:N,TrendingUp:E.TrendingUp,BarChart:T,PieChart:O};function I({value:e,onValueChange:n,placeholder:r="Select icon",className:i}){return(0,o.jsxs)(l.Select,{value:e,onValueChange:n,children:[(0,o.jsx)(l.SelectTrigger,{className:`bg-slate-700 border-slate-600 text-white focus:border-yellow-500 ${i||""}`,children:(0,o.jsx)(l.SelectValue,{placeholder:r,children:e&&j[e]&&(0,o.jsxs)("div",{className:"flex items-center gap-2",children:[t.default.createElement(j[e],{size:20}),(0,o.jsx)("span",{children:e})]})})}),(0,o.jsx)(l.SelectContent,{className:"bg-slate-800 border-slate-700",children:A.map(e=>{let n=j[e];return(0,o.jsx)(l.SelectItem,{value:e,className:"text-white hover:bg-slate-700",children:(0,o.jsxs)("div",{className:"flex items-center gap-2",children:[n&&t.default.createElement(n,{size:20}),(0,o.jsx)("span",{children:e})]})},e)})})]})}var D=e.i(40087),R=e.i(37727),L=e.i(52696);function P({selectedTagIds:e,onChange:n,placeholder:r="Select tags..."}){let[i,a]=(0,t.useState)([]),[l,c]=(0,t.useState)(""),[d,h]=(0,t.useState)(!1),[u,p]=(0,t.useState)(!0);(0,t.useEffect)(()=>{(async()=>{try{let e=await (0,L.getAllTags)();a(e)}catch(e){console.error("Error loading tags:",e),a([])}finally{p(!1)}})()},[]);let f=i.filter(t=>e.includes(t.id)),m=i.filter(t=>!e.includes(t.id)&&(t.name.en.toLowerCase().includes(l.toLowerCase())||t.name.es.toLowerCase().includes(l.toLowerCase()))),g=t=>{e.includes(t)||(n([...e,t]),c(""),h(!1))};return(0,o.jsxs)("div",{className:"space-y-2",children:[(0,o.jsx)("div",{className:"flex flex-wrap gap-2",children:f.map(t=>(0,o.jsxs)(D.Badge,{variant:"secondary",className:"bg-blue-600 text-white hover:bg-blue-700",children:[(0,o.jsxs)("div",{className:"flex flex-col",children:[(0,o.jsx)("span",{className:"text-xs",children:t.name.en}),(0,o.jsx)("span",{className:"text-xs opacity-75",children:t.name.es})]}),(0,o.jsx)("button",{onClick:()=>{var r;return r=t.id,void n(e.filter(e=>e!==r))},className:"ml-2 hover:text-red-300",children:(0,o.jsx)(R.X,{className:"w-3 h-3"})})]},t.id))}),(0,o.jsxs)("div",{className:"relative",children:[(0,o.jsx)(s.Input,{value:l,onChange:e=>c(e.target.value),onKeyPress:e=>{("Enter"===e.key||","===e.key)&&(e.preventDefault(),m.length>0&&g(m[0].id))},onFocus:()=>h(!0),placeholder:u?"Loading tags...":r,disabled:u,className:"bg-slate-700 border-slate-600 text-white placeholder:text-slate-400 focus:border-yellow-500 disabled:opacity-50"}),d&&!u&&m.length>0&&(0,o.jsx)("div",{className:"absolute top-full left-0 right-0 z-10 mt-1 bg-slate-800 border border-slate-700 rounded-md shadow-lg max-h-40 overflow-y-auto",children:m.map(e=>(0,o.jsx)("button",{onClick:()=>g(e.id),className:"w-full px-3 py-2 text-left text-slate-300 hover:bg-slate-700 hover:text-white text-sm",children:(0,o.jsxs)("div",{className:"flex justify-between items-center",children:[(0,o.jsxs)("div",{className:"flex flex-col",children:[(0,o.jsx)("span",{children:e.name.en}),(0,o.jsx)("span",{className:"text-xs text-slate-400",children:e.name.es})]}),(0,o.jsxs)("span",{className:"text-xs text-slate-500",children:["(",e.usageCount," uses)"]})]})},e.id))})]})]})}e.s(["LandingPageFormFields",0,function({formData:e,updateFormData:t,handleCategoryChange:r,selectedTagIds:i,handleTagIdsChange:c}){return(0,o.jsxs)("div",{className:"space-y-6",children:[(0,o.jsxs)("div",{children:[(0,o.jsx)(a.Label,{htmlFor:"category",className:"text-slate-300",children:"Category"}),(0,o.jsxs)(l.Select,{value:e.category||"",onValueChange:r,children:[(0,o.jsx)(l.SelectTrigger,{className:"bg-slate-700 border-slate-600 text-white focus:border-yellow-500",children:(0,o.jsx)(l.SelectValue,{placeholder:"Select category"})}),(0,o.jsx)(l.SelectContent,{className:"bg-slate-800 border-slate-700",children:n.AVAILABLE_CATEGORIES.map(e=>(0,o.jsx)(l.SelectItem,{value:e.value,className:"text-white hover:bg-slate-700",children:e.label},e.value))})]})]}),(0,o.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,o.jsxs)("div",{children:[(0,o.jsx)(a.Label,{htmlFor:"slug-en",className:"text-slate-300",children:"Slug (EN)"}),(0,o.jsx)(s.Input,{id:"slug-en",value:e.slug.en,onChange:n=>t("slug",{...e.slug,en:n.target.value}),placeholder:"English slug",className:"bg-slate-700 border-slate-600 text-white placeholder:text-slate-400 focus:border-yellow-500"})]}),(0,o.jsxs)("div",{children:[(0,o.jsx)(a.Label,{htmlFor:"slug-es",className:"text-slate-300",children:"Slug (ES)"}),(0,o.jsx)(s.Input,{id:"slug-es",value:e.slug.es,onChange:n=>t("slug",{...e.slug,es:n.target.value}),placeholder:"Spanish slug",className:"bg-slate-700 border-slate-600 text-white placeholder:text-slate-400 focus:border-yellow-500"})]})]}),(0,o.jsxs)("div",{children:[(0,o.jsx)(a.Label,{htmlFor:"template",className:"text-slate-300",children:"Template"}),(0,o.jsxs)(l.Select,{value:e.template,onValueChange:e=>t("template",e),children:[(0,o.jsx)(l.SelectTrigger,{className:"bg-slate-700 border-slate-600 text-white focus:border-yellow-500",children:(0,o.jsx)(l.SelectValue,{})}),(0,o.jsx)(l.SelectContent,{className:"bg-slate-800 border-slate-700",children:n.AVAILABLE_TEMPLATES.map(e=>(0,o.jsx)(l.SelectItem,{value:e.value,className:"text-white hover:bg-slate-700",children:(0,o.jsxs)("div",{children:[(0,o.jsx)("div",{className:"font-medium",children:e.label}),(0,o.jsx)("div",{className:"text-sm text-slate-400",children:e.description})]})},e.value))})]})]}),(0,o.jsxs)("div",{children:[(0,o.jsx)(a.Label,{htmlFor:"featuredImage",className:"text-slate-300",children:"Featured Image URL"}),(0,o.jsx)(s.Input,{id:"featuredImage",value:e.featuredImage||"",onChange:e=>t("featuredImage",e.target.value),placeholder:"https://example.com/image.jpg",className:"bg-slate-700 border-slate-600 text-white placeholder:text-slate-400 focus:border-yellow-500"})]}),(0,o.jsxs)("div",{children:[(0,o.jsx)(a.Label,{htmlFor:"icon",className:"text-slate-300",children:"Icon"}),(0,o.jsx)(I,{value:e.icon||"Settings",onValueChange:e=>t("icon",e)})]}),(0,o.jsxs)("div",{children:[(0,o.jsx)(a.Label,{className:"text-slate-300",children:"Tags"}),(0,o.jsx)(P,{selectedTagIds:i,onChange:c,placeholder:"Select existing tags... (Manage tags in Tags section)"})]})]})}],59949);var B=e.i(82372),z=e.i(34267),$=t,_=e.i(74080),V=e.i(2239);function F(e){this.content=e}F.prototype={constructor:F,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return -1},get:function(e){var t=this.find(e);return -1==t?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),o=r.content.slice();return -1==i?o.push(n||e,t):(o[i+1]=t,n&&(o[i]=n)),new F(o)},remove:function(e){var t=this.find(e);if(-1==t)return this;var n=this.content.slice();return n.splice(t,2),new F(n)},addToStart:function(e,t){return new F([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new F(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),o=r.find(e);return i.splice(-1==o?i.length:o,0,t,n),new F(i)}
vendor: 5,097 bytes, line 278
278,forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return(e=F.from(e)).size?new F(e.content.concat(this.subtract(e).content)):this},append:function(e){return(e=F.from(e)).size?new F(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=F.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},F.from=function(e){if(e instanceof F)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new F(t)};class H{constructor(e,t){if(this.content=e,this.size=t||0,null==t)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let o=0,s=0;s<t;o++){let a=this.content[o],l=s+a.nodeSize;if(l>e&&!1!==n(a,r+s,i||null,o)&&a.content.size){let i=s+1;a.nodesBetween(Math.max(0,e-i),Math.min(a.content.size,t-i),n,r+i)}s=l}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i="",o=!0;return this.nodesBetween(e,t,(s,a)=>{let l=s.isText?s.text.slice(Math.max(e,a)-a,t-a):s.isLeaf?r?"function"==typeof r?r(s):r:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&l||s.isTextblock)&&n&&(o?o=!1:i+=n),i+=l},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,r=this.content.slice(),i=0;for(t.isText&&t.sameMarkup(n)&&(r[r.length-1]=t.withText(t.text+n.text),i=1);i<e.content.length;i++)r.push(e.content[i]);return new H(r,this.size+e.size)}cut(e,t=this.size){if(0==e&&t==this.size)return this;let n=[],r=0;if(t>e)for(let i=0,o=0;o<t;i++){let s=this.content[i],a=o+s.nodeSize;a>e&&((o<e||a>t)&&(s=s.isText?s.cut(Math.max(0,e-o),Math.min(s.text.length,t-o)):s.cut(Math.max(0,e-o-1),Math.min(s.content.size,t-o-1))),n.push(s),r+=s.nodeSize),o=a}return new H(n,r)}cutByIndex(e,t){return e==t?H.empty:0==e&&t==this.content.length?this:new H(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let r=this.content.slice(),i=this.size+t.nodeSize-n.nodeSize;return r[e]=t,new H(r,i)}addToStart(e){return new H([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new H(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return function e(t,n,r){for(let i=0;;i++){if(i==t.childCount||i==n.childCount)return t.childCount==n.childCount?null:r;let o=t.child(i),s=n.child(i);if(o==s){r+=o.nodeSize;continue}if(!o.sameMarkup(s))return r;if(o.isText&&o.text!=s.text){for(let e=0;o.text[e]==s.text[e];e++)r++;return r}if(o.content.size||s.content.size){let t=e(o.content,s.content,r+1);if(null!=t)return t}r+=o.nodeSize}}(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return function e(t,n,r,i){for(let o=t.childCount,s=n.childCount;;){if(0==o||0==s)return o==s?null:{a:r,b:i};let a=t.child(--o),l=n.child(--s),c=a.nodeSize;if(a==l){r-=c,i-=c;continue}if(!a.sameMarkup(l))return{a:r,b:i};if(a.isText&&a.text!=l.text){let e=0,t=Math.min(a.text.length,l.text.length);for(;e<t&&a.text[a.text.length-e-1]==l.text[l.text.length-e-1];)e++,r--,i--;return{a:r,b:i}}if(a.content.size||l.content.size){let t=e(a.content,l.content,r-1,i-1);if(t)return t}r-=c,i-=c}}(this,e,t,n)}findIndex(e){if(0==e)return U(0,e);if(e==this.size)return U(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=n+this.child(t).nodeSize;if(r>=e){if(r==e)return U(t+1,r);return U(t,n)}n=r}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return H.empty;if(!Array.isArray(t))throw RangeError("Invalid input for Fragment.fromJSON");return new H(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return H.empty;let t,n=0;for(let r=0;r<e.length;r++){let i=e[r];n+=i.nodeSize,r&&i.isText&&e[r-1].sameMarkup(i)?(t||(t=e.slice(0,r)),t[t.length-1]=i.withText(t[t.length-1].text+i.text)):t&&t.push(i)}return new H(t||e,n)}static from(e){if(!e)return H.empty;if(e instanceof H)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new H([e],e.nodeSize);throw RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}H.empty=new H([],0);let q={index:0,offset:0};function U(e,t){return q.index=e,q.offset=t,q}function W(e,t){if(e===t)return!0;
vendor: 6,828 bytes, line 278
278if(!(e&&"object"==typeof e)||!(t&&"object"==typeof t))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!W(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!W(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}class K{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||(t=e.slice(0,r));else{if(i.type.excludes(this.type))return e;!n&&i.type.rank>this.type.rank&&(t||(t=e.slice(0,r)),t.push(this),n=!0),t&&t.push(i)}}return t||(t=e.slice()),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&W(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw RangeError("Invalid input for Mark.fromJSON");let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&0==e.length)return K.none;if(e instanceof K)return[e];let t=e.slice();return t.sort((e,t)=>e.type.rank-t.type.rank),t}}K.none=[];class J extends Error{}class G{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=function e(t,n,r,i){let{index:o,offset:s}=t.findIndex(n),a=t.maybeChild(o);if(s==n||a.isText)return i&&!i.canReplace(o,o,r)?null:t.cut(0,n).append(r).append(t.cut(n));let l=e(a.content,n-s-1,r,a);return l&&t.replaceChild(o,a.copy(l))}(this.content,e+this.openStart,t);return n&&new G(n,this.openStart,this.openEnd)}removeBetween(e,t){return new G(function e(t,n,r){let{index:i,offset:o}=t.findIndex(n),s=t.maybeChild(i),{index:a,offset:l}=t.findIndex(r);if(o==n||s.isText){if(l!=r&&!t.child(a).isText)throw RangeError("Removing non-flat range");return t.cut(0,n).append(t.cut(r))}if(i!=a)throw RangeError("Removing non-flat range");return t.replaceChild(i,s.copy(e(s.content,n-o-1,r-o-1)))}(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return G.empty;let n=t.openStart||0,r=t.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw RangeError("Invalid input for Slice.fromJSON");return new G(H.fromJSON(e,t.content),n,r)}static maxOpen(e,t=!0){let n=0,r=0;for(let r=e.firstChild;r&&!r.isLeaf&&(t||!r.type.spec.isolating);r=r.firstChild)n++;for(let n=e.lastChild;n&&!n.isLeaf&&(t||!n.type.spec.isolating);n=n.lastChild)r++;return new G(e,n,r)}}function X(e,t){if(!t.type.compatibleContent(e.type))throw new J("Cannot join "+t.type.name+" onto "+e.type.name)}function Q(e,t,n){let r=e.node(n);return X(r,t.node(n)),r}function Y(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function Z(e,t,n,r){let i=(t||e).node(n),o=0,s=t?t.index(n):i.childCount;e&&(o=e.index(n),e.depth>n?o++:e.textOffset&&(Y(e.nodeAfter,r),o++));for(let e=o;e<s;e++)Y(i.child(e),r);t&&t.depth==n&&t.textOffset&&Y(t.nodeBefore,r)}function ee(e,t){return e.type.checkContent(t),e.copy(t)}function et(e,t,n){let r=[];return Z(null,e,n,r),e.depth>n&&Y(ee(Q(e,t,n+1),et(e,t,n+1)),r),Z(t,null,n,r),new H(r)}G.empty=new G(H.empty,0,0);class en{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return null==e?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[3*this.resolveDepth(e)]}index(e){return this.path[3*this.resolveDepth(e)+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)}start(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(!(e=this.resolveDepth(e)))throw RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]}after(e){if(!(e=this.resolveDepth(e)))throw RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):0==e?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[3*t],r=0==t?0:this.path[3*t-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(0==e.content.size)return K.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var o=0;o<i.length;o++)!1!==i[o].type.spec.inclusive||r&&i[o].isInSet(r.marks)||(i=i[o--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)!1!==n[i].type.spec.inclusive||r&&n[i].isInSet(r.marks)||(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new es(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw RangeError("Position "+t+" out of range");let n=[],r=0,i=t;for(let t=e;;){let{index:e,offset:o}=t.content.findIndex(i),s=i-o;if(n.push(t,e,r+o),!s||(t=t.child(e)).isText)break;
278i=s-1,r+=o+1}return new en(t,n,i)}static resolveCached(e,t){let n=eo.get(e);if(n)for(let e=0;e<n.elts.length;e++){let r=n.elts[e];if(r.pos==t)return r}else eo.set(e,n=new er);let r=n.elts[n.i]=en.resolve(e,t);return n.i=(n.i+1)%ei,r}}class er{constructor(){this.elts=[],this.i=0}}let ei=12,eo=new WeakMap;class es{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}let ea=Object.create(null);class el{constructor(e,t,n,r=K.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||H.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&W(this.attrs,t||e.defaultAttrs||ea)&&K.sameSet(this.marks,n||K.none)}copy(e=null){return e==this.content?this:new el(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new el(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return G.empty;let r=this.resolve(e),i=this.resolve(t),o=n?0:r.sharedDepth(t),s=r.start(o);return new G(r.node(o).content.cut(r.pos-s,i.pos-s),r.depth-o,i.depth-o)}replace(e,t,n){var r=this.resolve(e),i=this.resolve(t);if(n.openStart>r.depth)throw new J("Inserted content deeper than insertion position");if(r.depth-n.openStart!=i.depth-n.openEnd)throw new J("Inconsistent open depths");return function e(t,n,r,i){let o=t.index(i),s=t.node(i);if(o==n.index(i)&&i<t.depth-r.openStart){let a=e(t,n,r,i+1);return s.copy(s.content.replaceChild(o,a))}if(!r.content.size)return ee(s,et(t,n,i));if(r.openStart||r.openEnd||t.depth!=i||n.depth!=i){let{start:e,end:o}=function(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(H.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}(r,t);return ee(s,function e(t,n,r,i,o){let s=t.depth>o&&Q(t,n,o+1),a=i.depth>o&&Q(r,i,o+1),l=[];return Z(null,t,o,l),s&&a&&n.index(o)==r.index(o)?(X(s,a),Y(ee(s,e(t,n,r,i,o+1)),l)):(s&&Y(ee(s,et(t,n,o+1)),l),Z(n,r,o,l),a&&Y(ee(a,et(r,i,o+1)),l)),Z(i,null,o,l),new H(l)}(t,e,o,n,i))}{let e=t.parent,i=e.content;return ee(e,i.cut(0,t.parentOffset).append(r.content).append(i.cut(n.parentOffset)))}}(r,i,n,0)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(!(t=t.maybeChild(n)))return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(0==e)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return en.resolveCached(this,e)}resolveNoCache(e){return en.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}
278toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),ed(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,n=H.empty,r=0,i=n.childCount){let o=this.contentMatchAt(e).matchFragment(n,r,i),s=o&&o.matchFragment(this.content,t);if(!s||!s.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),o=i&&i.matchFragment(this.content,t);return!!o&&o.validEnd}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=K.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!K.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){let n;if(!t)throw RangeError("Invalid input for Node.fromJSON");if(t.marks){if(!Array.isArray(t.marks))throw RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw RangeError("Invalid text node in JSON");return e.text(t.text,n)}let r=H.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,r,n);return i.type.checkAttrs(i.attrs),i}}el.prototype.text=void 0;class ec extends el{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):ed(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new ec(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new ec(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return 0==e&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function ed(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class eh{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){var n;let r,i=new eu(e,t);if(null==i.next)return eh.empty;let o=function e(t){let n=[];do n.push(function(t){let n=[];do n.push(function(t){let n=function(t){if(t.eat("(")){let n=e(t);return t.eat(")")||t.err("Missing closing paren"),n}if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=(function(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.isInGroup(t)&&i.push(r)}return 0==i.length&&e.err("No node type or group '"+t+"' found"),i})(t,t.next).map(e=>(null==t.inline?t.inline=e.isInline:t.inline!=e.isInline&&t.err("Mixing inline and block content"),{type:"name",value:e}));return t.pos++,1==e.length?e[0]:{type:"choice",exprs:e}}}(t);for(;;)if(t.eat("+"))n={type:"plus",expr:n};else if(t.eat("*"))n={type:"star",expr:n};else if(t.eat("?"))n={type:"opt",expr:n};else if(t.eat("{"))n=function(e,t){let n=ep(e),r=n;return e.eat(",")&&(r="}"!=e.next?ep(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}(t,n);else break;return n}(t));while(t.next&&")"!=t.next&&"|"!=t.next)return 1==n.length?n[0]:{type:"seq",exprs:n}}(t));while(t.eat("|"))return 1==n.length?n[0]:{type:"choice",exprs:n}}(i);i.next&&i.err("Unexpected trailing text");let s=(n=function(e){let t=[[]];return i(function e(t,o){if("choice"==t.type)return t.exprs.reduce((t,n)=>t.concat(e(n,o)),[]);if("seq"==t.type)for(let r=0;;r++){let s=e(t.exprs[r],o);if(r==t.exprs.length-1)return s;i(s,o=n())}else if("star"==t.type){let s=n();return r(o,s),i(e(t.expr,s),s),[r(s)]}else if("plus"==t.type){let s=n();return i(e(t.expr,o),s),i(e(t.expr,s),s),[r(s)]}else if("opt"==t.type)return[r(o)].concat(e(t.expr,o));else if("range"==t.type){let s=o;for(let r=0;r<t.min;r++){let r=n();i(e(t.expr,s),r),s=r}if(-1==t.max)i(e(t.expr,s),s);else for(let o=t.min;o<t.max;o++){let o=n();r(s,o),i(e(t.expr,s),o),s=o}return[r(s)]}else if("name"==t.type)return[r(o,void 0,t.value)];else throw Error("Unknown expr type")}(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}
vendor: 5,571 bytes, line 278
278function i(e,t){e.forEach(e=>e.to=t)}}(o),r=Object.create(null),function e(t){let i=[];t.forEach(e=>{n[e].forEach(({term:e,to:t})=>{let r;if(e){for(let t=0;t<i.length;t++)i[t][0]==e&&(r=i[t][1]);em(n,t).forEach(t=>{r||i.push([e,r=[]]),-1==r.indexOf(t)&&r.push(t)})}})});let o=r[t.join(",")]=new eh(t.indexOf(n.length-1)>-1);for(let t=0;t<i.length;t++){let n=i[t][1].sort(ef);o.next.push({type:i[t][0],next:r[n.join(",")]||e(n)})}return o}(em(n,0)));return function(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,o=[];for(let t=0;t<e.next.length;t++){let{type:n,next:s}=e.next[t];o.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),-1==r.indexOf(s)&&r.push(s)}i&&t.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(s,i),s}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return 0!=this.next.length&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];return function i(o,s){let a=o.matchFragment(e,n);if(a&&(!t||a.validEnd))return H.from(s.map(e=>e.createAndFill()));for(let e=0;e<o.next.length;e++){let{type:t,next:n}=o.next[e];if(!(t.isText||t.hasRequiredAttrs())&&-1==r.indexOf(n)){r.push(n);let e=i(n,s.concat(t));if(e)return e}}return null}(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:o,next:s}=i.next[e];o.isLeaf||o.hasRequiredAttrs()||o.name in t||r.type&&!s.validEnd||(n.push({match:o.contentMatch,type:o,via:r}),t[o.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];return!function t(n){e.push(n);for(let r=0;r<n.next.length;r++)-1==e.indexOf(n.next[r].next)&&t(n.next[r].next)}(this),e.map((t,n)=>{let r=n+(t.validEnd?"*":" ")+" ";for(let n=0;n<t.next.length;n++)r+=(n?", ":"")+t.next[n].type.name+"->"+e.indexOf(t.next[n].next);return r}).join("\n")}}eh.empty=new eh(!0);class eu{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw SyntaxError(e+" (in content expression '"+this.string+"')")}}function ep(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function ef(e,t){return t-e}function em(e,t){let n=[];return function t(r){let i=e[r];if(1==i.length&&!i[0].term)return t(i[0].to);n.push(r);for(let e=0;e<i.length;e++){let{term:r,to:o}=i[e];r||-1!=n.indexOf(o)||t(o)}}(t),n.sort(ef)}function eg(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function ey(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(void 0===i){let t=e[r];if(t.hasDefault)i=t.default;else throw RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function eb(e,t,n,r){for(let r in t)if(!(r in e))throw RangeError(`Unsupported attribute ${r} for ${n} of type ${r}`);for(let n in e){let r=e[n];r.validate&&r.validate(t[n])}}function ex(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new ew(e,r,t[r]);return n}class ev{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=ex(e,n.attrs),this.defaultAttrs=eg(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==e),this.isText="text"==e}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==eh.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:ey(this.attrs,e)}create(e=null,t,n){if(this.isText)throw Error("NodeType.create can't construct text nodes");return new el(this,this.computeAttrs(e),H.from(t),K.setFrom(n))}createChecked(e=null,t,n){return t=H.from(t),this.checkContent(t),new el(this,this.computeAttrs(e),t,K.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),(t=H.from(t)).size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),i=r&&r.fillBefore(H.empty,!0);return i?new el(this,e,t.append(i),K.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);
278if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){eb(this.attrs,e,"node",this.name)}allowsMarkType(e){return null==this.markSet||this.markSet.indexOf(e)>-1}allowsMarks(e){if(null==this.markSet)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){let t;if(null==this.markSet)return e;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:K.none:e}static compile(e,t){let n=Object.create(null);e.forEach((e,r)=>n[e]=new ev(e,t,r));let r=t.spec.topNode||"doc";if(!n[r])throw RangeError("Schema is missing its top node type ('"+r+"')");if(!n.text)throw RangeError("Every schema needs a 'text' type");for(let e in n.text.attrs)throw RangeError("The text node type should not have attributes");return n}}class ew{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate="string"==typeof n.validate?function(e,t,n){let r=n.split("|");return n=>{let i=null===n?"null":typeof n;if(0>r.indexOf(i))throw RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${i}`)}}(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}}class ek{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=ex(e,r.attrs),this.excluded=null;let i=eg(this.attrs);this.instance=i?new K(this,i):null}create(e=null){return!e&&this.instance?this.instance:new K(this,ey(this.attrs,e))}static compile(e,t){let n=Object.create(null),r=0;return e.forEach((e,i)=>n[e]=new ek(e,r++,t,i)),n}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){eb(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class eS{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let n in e)t[n]=e[n];t.nodes=F.from(e.nodes),t.marks=F.from(e.marks||{}),this.nodes=ev.compile(this.spec.nodes,this),this.marks=ek.compile(this.spec.marks,this);let n=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw RangeError(e+" can not be both a node and a mark");let t=this.nodes[e],r=t.spec.content||"",i=t.spec.marks;if(t.contentMatch=n[r]||(n[r]=eh.parse(r,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError("Multiple linebreak nodes defined");if(!t.isInline||!t.isLeaf)throw RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=t}t.markSet="_"==i?null:i?eM(this,i.split(" ")):""!=i&&t.inlineContent?null:[]}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=null==n?[t]:""==n?[]:eM(this,n.split(" "))}this.nodeFromJSON=e=>el.fromJSON(this,e),this.markFromJSON=e=>K.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if("string"==typeof e)e=this.nodeType(e);else if(e instanceof ev){if(e.schema!=this)throw RangeError("Node type from different schema used ("+e.name+")")}else throw RangeError("Invalid node type: "+e);return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new ec(n,n.defaultAttrs,e,K.setFrom(t))}mark(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw RangeError("Unknown node type: "+e);return t}}function eM(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],o=e.marks[i],s=o;if(o)n.push(o);else for(let t in e.marks){let r=e.marks[t];("_"==i||r.spec.group&&r.spec.group.split(" ").indexOf(i)>-1)&&n.push(s=r)}if(!s)throw SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}class eC{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];
278t.forEach(e=>{if(null!=e.tag)this.tags.push(e);else if(null!=e.style){let t=/[^=]*/.exec(e.style)[0];0>n.indexOf(t)&&n.push(t),this.styles.push(e)}}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)})}parse(e,t={}){let n=new ej(this,t,!1);return n.addAll(e,K.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new ej(this,t,!0);return n.addAll(e,K.none,t.from,t.to),G.maxOpen(n.finish())}matchTag(e,t,n){for(let o=n?this.tags.indexOf(n)+1:0;o<this.tags.length;o++){var r,i;let n=this.tags[o];if(r=e,i=n.tag,(r.matches||r.msMatchesSelector||r.webkitMatchesSelector||r.mozMatchesSelector).call(r,i)&&(void 0===n.namespace||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(!1===t)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],o=r.style;if(0==o.indexOf(e)&&(!r.context||n.matchesContext(r.context))&&(!(o.length>e.length)||61==o.charCodeAt(e.length)&&o.slice(e.length+1)==t)){if(r.getAttrs){let e=r.getAttrs(t);if(!1===e)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=null==e.priority?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((null==e.priority?50:e.priority)<n)break}t.splice(r,0,e)}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach(e=>{n(e=eI(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)})}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach(e=>{n(e=eI(e)),e.node||e.ignore||e.mark||(e.node=t)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new eC(e,eC.schemaRules(e)))}}let eN={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},eE={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},eT={ol:!0,ul:!0};function eO(e,t,n){return null!=t?!!t|2*("full"===t):e&&"pre"==e.whitespace?3:-5&n}class eA{constructor(e,t,n,r,i,o){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=o,this.content=[],this.activeMarks=K.none,this.match=i||(4&o?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(H.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let t=this.type.contentMatch,n;return(n=t.findWrapping(e.type))?(this.match=t,n):null}}return this.match.findWrapping(e.type)}finish(e){if(!(1&this.options)){let e=this.content[this.content.length-1],t;e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))&&(e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=e.withText(e.text.slice(0,e.text.length-t[0].length)))}let t=H.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(H.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!eN.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class ej{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r=t.topNode,i,o=eO(null,t.preserveWhitespace,0)|4*!!n;i=r?new eA(r.type,r.attrs,K.none,!0,t.topMatch||r.type.contentMatch,o):n?new eA(null,null,K.none,!0,null,o):new eA(e.schema.topNodeType,null,K.none,!0,null,o),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){3==e.nodeType?this.addTextNode(e,t):1==e.nodeType&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,r=this.top,i=2&r.options?"full":this.localPreserveWS||(1&r.options)>0,{schema:o}=this.parser;if("full"===i||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(i)if("full"===i)n=n.replace(/\r\n?/g,"\n");else if(o.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(o.linebreakReplacement.create())){let e=n.split(/\r?\n|\r/);for(let n=0;n<e.length;n++)n&&this.insertNode(o.linebreakReplacement.create(),t,!0),e[n]&&this.insertNode(o.text(e[n]),t,!/\S/.test(e[n]));n=""}else n=n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=r.content[r.content.length-1],i=e.previousSibling;(!t||i&&"BR"==i.nodeName||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}n&&this.insertNode(o.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let r=this.localPreserveWS,i=this.top;("PRE"==e.tagName||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o=e.nodeName.toLowerCase(),s;eT.hasOwnProperty(o)&&this.parser.normalizeLists&&function(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=1==t.nodeType?t.nodeName.toLowerCase():null;e&&eT.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):"li"==e?n=t:e&&(n=null)}}(e);let a=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(s=this.parser.matchTag(e,this,n));
vendor: 1,318 bytes, line 278
278e:if(a?a.ignore:eE.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,t);else if(!a||a.skip||a.closeParent){a&&a.closeParent?this.open=Math.max(0,this.open-1):a&&a.skip.nodeType&&(e=a.skip);let n,r=this.needsBlock;if(eN.hasOwnProperty(o))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),n=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let s=a&&a.skip?t:this.readStyles(e,t);s&&this.addAll(e,s),n&&this.sync(i),this.needsBlock=r}else{let n=this.readStyles(e,t);n&&this.addElementByRule(e,a,n,!1===a.consuming?s:void 0)}this.localPreserveWS=r}leafFallback(e,t){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"),t)}ignoreFallback(e,t){"BR"!=e.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"),t,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let e=0;e<this.parser.matchedStyles.length;e++){let r=this.parser.matchedStyles[e],i=n.getPropertyValue(r);if(i)for(let e;;){let n=this.parser.matchStyle(r,i,this,e);if(!n)break;if(n.ignore)return null;if(t=n.clearMark?t.filter(e=>!n.clearMark(e)):t.concat(this.parser.schema.marks[n.mark].create(n.attrs)),!1===n.consuming)e=n;else break}}return t}addElementByRule(e,t,n,r){let i,o;
vendor: 4,111 bytes, line 278
278if(t.node)if((o=this.parser.schema.nodes[t.node]).isLeaf)this.insertNode(o.create(t.attrs),n,"BR"==e.nodeName)||this.leafFallback(e,n);else{let e=this.enter(o,t.attrs||null,n,t.preserveWhitespace);e&&(i=!0,n=e)}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let s=this.top;if(o&&o.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e,n,!1));else{let r=e;"string"==typeof t.contentElement?r=e.querySelector(t.contentElement):"function"==typeof t.contentElement?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n),this.findAround(e,r,!1)}i&&this.sync(s)&&this.open--}addAll(e,t,n,r){let i=n||0;for(let o=n?e.childNodes[n]:e.firstChild,s=null==r?null:e.childNodes[r];o!=s;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o,t);this.findAtPoint(e,i)}findPlace(e,t,n){let r,i;for(let t=this.open,o=0;t>=0;t--){let s=this.nodes[t],a=s.findWrapping(e);if(a&&(!r||r.length>a.length+o)&&(r=a,i=s,!a.length))break;if(s.solid){if(n)break;o+=2}}if(!r)return null;this.sync(i);for(let e=0;e<r.length;e++)t=this.enterInner(r[e],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&(t=this.enterInner(e,null,t))}let r=this.findPlace(e,t,n);if(r){this.closeExtra();let t=this.top;t.match&&(t.match=t.match.matchType(e.type));let n=K.none;for(let i of r.concat(e.marks))(t.type?t.type.allowsMarkType(i.type):eD(i.type,e.type))&&(n=i.addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n,r){let i=this.findPlace(e.create(t),n,!1);return i&&(i=this.enterInner(e,t,n,!0,r)),i}enterInner(e,t,n,r=!1,i){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let s=eO(e,i,o.options);4&o.options&&0==o.content.length&&(s|=4);let a=K.none;return n=n.filter(t=>(o.type?!o.type.allowsMarkType(t.type):!eD(t.type,e))||(a=t.addToSet(a),!1)),this.nodes.push(new eA(e,t,a,r,null,s)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;else this.localPreserveWS&&(this.nodes[t].options|=1);return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)null==this.find[t].pos&&1==e.nodeType&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)null==this.find[r].pos&&1==e.nodeType&&e.contains(this.find[r].node)&&t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+ +!r,o=(e,s)=>{for(;e>=0;e--){let a=t[e];if(""==a){if(e==t.length-1||0==e)continue;for(;s>=i;s--)if(o(e-1,s))return!0;return!1}{let e=s>0||0==s&&r?this.nodes[s].type:n&&s>=i?n.node(s-i).type:null;if(!e||e.name!=a&&!e.isInGroup(a))return!1;s--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];
278if(t.isTextblock&&t.defaultAttrs)return t}}}function eI(e){let t={};for(let n in e)t[n]=e[n];return t}function eD(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let o=[],s=e=>{o.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t||0>o.indexOf(i)&&s(i))return!0}};if(s(i.contentMatch))return!0}}class eR{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||(n=eP(t).createDocumentFragment());let r=n,i=[];return e.forEach(e=>{if(i.length||e.marks.length){let n=0,o=0;for(;n<i.length&&o<e.marks.length;){let t=e.marks[o];if(!this.marks[t.type.name]){o++;continue}if(!t.eq(i[n][0])||!1===t.type.spec.spanning)break;n++,o++}for(;n<i.length;)r=i.pop()[1];for(;o<e.marks.length;){let n=e.marks[o++],s=this.serializeMark(n,e.isInline,t);s&&(i.push([n,r]),r.appendChild(s.dom),r=s.contentDOM||s.dom)}}r.appendChild(this.serializeNodeInner(e,t))}),n}serializeNodeInner(e,t){let{dom:n,contentDOM:r}=ez(eP(t),this.nodes[e.type.name](e),null,e.attrs);if(r){if(e.isLeaf)throw RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&ez(eP(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return ez(e,t,n,r)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new eR(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=eL(e.nodes);return t.text||(t.text=e=>e.text),t}static marksFromSchema(e){return eL(e.marks)}}function eL(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function eP(e){return e.document||window.document}let eB=new WeakMap;function ez(e,t,n,r){let i,o,s;if("string"==typeof t)return{dom:e.createTextNode(t)};if(null!=t.nodeType)return{dom:t};if(t.dom&&null!=t.dom.nodeType)return t;let a=t[0],l;if("string"!=typeof a)throw RangeError("Invalid array passed to renderSpec");if(r&&(void 0===(o=eB.get(r))&&eB.set(r,(s=null,!function e(t){if(t&&"object"==typeof t)if(Array.isArray(t))if("string"==typeof t[0])s||(s=[]),s.push(t);else for(let n=0;n<t.length;n++)e(t[n]);else for(let n in t)e(t[n])}(r),o=s)),l=o)&&l.indexOf(t)>-1)throw RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let c=a.indexOf(" ");c>0&&(n=a.slice(0,c),a=a.slice(c+1));let d=n?e.createElementNS(n,a):e.createElement(a),h=t[1],u=1;if(h&&"object"==typeof h&&null==h.nodeType&&!Array.isArray(h)){for(let e in u=2,h)if(null!=h[e]){let t=e.indexOf(" ");t>0?d.setAttributeNS(e.slice(0,t),e.slice(t+1),h[e]):"style"==e&&d.style?d.style.cssText=h[e]:d.setAttribute(e,h[e])}}for(let o=u;o<t.length;o++){let s=t[o];if(0===s){if(o<t.length-1||o>u)throw RangeError("Content hole must be the only child of its parent node");return{dom:d,contentDOM:d}}{let{dom:t,contentDOM:o}=ez(e,s,n,r);if(d.appendChild(t),o){if(i)throw RangeError("Multiple content holes");i=o}}}return{dom:d,contentDOM:i}}class e${constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class e_{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&e_.empty)return e_.empty}recover(e){let t=0,n=65535&e;if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[3*e+2]-this.ranges[3*e+1];return this.ranges[3*n]+t+(e-(65535&e))/65536}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,o=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let a=this.ranges[s]-(this.inverted?r:0);if(a>e)break;let l=this.ranges[s+i],c=this.ranges[s+o],d=a+l;if(e<=d){let i=l?e==a?-1:e==d?1:t:t,o=a+r+(i<0?0:c);if(n)return o;let h=e==(t<0?a:d)?null:s/3+(e-a)*65536,u=e==a?2:e==d?1:4;return(t<0?e!=a:e!=d)&&(u|=8),new e$(o,u,h)}r+=c-l}return n?e+r:new e$(e+r,0,null)}touches(e,t){let n=0,r=65535&t,i=this.inverted?2:1,o=this.inverted?1:2;
vendor: 21,185 bytes, line 278
278for(let t=0;t<this.ranges.length;t+=3){let s=this.ranges[t]-(this.inverted?n:0);if(s>e)break;let a=this.ranges[t+i];if(e<=s+a&&t==3*r)return!0;n+=this.ranges[t+o]-a}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let o=this.ranges[r],s=o-(this.inverted?i:0),a=o+(this.inverted?0:i),l=this.ranges[r+t],c=this.ranges[r+n];e(s,s+l,a,a+c),i+=c-l}}invert(){return new e_(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return 0==e?e_.empty:new e_(e<0?[0,-e,0]:[0,0,e])}}e_.empty=new e_([]);class eV{constructor(e,t,n=0,r=e?e.length:0){this.mirror=t,this.from=n,this.to=r,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(e=0,t=this.maps.length){return new eV(this._maps,this.mirror,e,t)}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),null!=t&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let r=e.getMirror(t);this.appendMap(e._maps[t],null!=r&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e._maps[t].invert(),null!=r&&r>t?n-r-1:void 0)}}invert(){let e=new eV;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let n=this.from;n<this.to;n++){let i=this._maps[n].mapResult(e,t);if(null!=i.recover){let t=this.getMirror(n);if(null!=t&&t>n&&t<this.to){n=t,e=this._maps[t].recover(i.recover);continue}}r|=i.delInfo,e=i.pos}return n?e:new e$(e,r,null)}}let eF=Object.create(null);class eH{getMap(){return e_.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError("Invalid input for Step.fromJSON");let n=eF[t.stepType];if(!n)throw RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in eF)throw RangeError("Duplicate use of step JSON ID "+e);return eF[e]=t,t.prototype.jsonID=e,t}}class eq{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new eq(e,null)}static fail(e){return new eq(null,e)}static fromReplace(e,t,n,r){try{return eq.ok(e.replace(t,n,r))}catch(e){if(e instanceof J)return eq.fail(e.message);throw e}}}function eU(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let o=e.child(i);o.content.size&&(o=o.copy(eU(o.content,t,o))),o.isInline&&(o=t(o,n,i)),r.push(o)}return H.fromArray(r)}class eW extends eH{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new G(eU(t.content,(e,t)=>e.isAtom&&t.type.allowsMarkType(this.mark.type)?e.mark(this.mark.addToSet(e.marks)):e,r),t.openStart,t.openEnd);return eq.fromReplace(e,this.from,this.to,i)}invert(){return new eK(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new eW(t.pos,n.pos,this.mark)}merge(e){return e instanceof eW&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new eW(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw RangeError("Invalid input for AddMarkStep.fromJSON");return new eW(t.from,t.to,e.markFromJSON(t.mark))}}eH.jsonID("addMark",eW);class eK extends eH{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new G(eU(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return eq.fromReplace(e,this.from,this.to,n)}invert(){return new eW(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new eK(t.pos,n.pos,this.mark)}merge(e){return e instanceof eK&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new eK(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw RangeError("Invalid input for RemoveMarkStep.fromJSON");return new eK(t.from,t.to,e.markFromJSON(t.mark))}}eH.jsonID("removeMark",eK);class eJ extends eH{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return eq.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return eq.fromReplace(e,this.pos,this.pos+1,new G(H.from(n),0,+!t.isLeaf))}invert(e){let t=e.nodeAt(this.pos);if(t){let e=this.mark.addToSet(t.marks);if(e.length==t.marks.length){for(let n=0;n<t.marks.length;n++)if(!t.marks[n].isInSet(e))return new eJ(this.pos,t.marks[n]);return new eJ(this.pos,this.mark)}}return new eG(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new eJ(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new eJ(t.pos,e.markFromJSON(t.mark))}}eH.jsonID("addNodeMark",eJ);class eG extends eH{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return eq.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return eq.fromReplace(e,this.pos,this.pos+1,new G(H.from(n),0,+!t.isLeaf))}invert(e){let t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new eJ(this.pos,this.mark):this}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new eG(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new eG(t.pos,e.markFromJSON(t.mark))}}eH.jsonID("removeNodeMark",eG);class eX extends eH{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&eY(e,this.from,this.to)?eq.fail("Structure replace would overwrite content"):eq.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new e_([this.from,this.to-this.from,this.slice.size])}invert(e){return new eX(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deletedAcross&&n.deletedAcross?null:new eX(t.pos,Math.max(t.pos,n.pos),this.slice,this.structure)}merge(e){if(!(e instanceof eX)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart)if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;else{let t=this.slice.size+e.slice.size==0?G.empty:new G(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new eX(e.from,this.to,t,this.structure)}{let t=this.slice.size+e.slice.size==0?G.empty:new G(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new eX(this.from,this.to+(e.to-e.from),t,this.structure)}}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw RangeError("Invalid input for ReplaceStep.fromJSON");return new eX(t.from,t.to,G.fromJSON(e,t.slice),!!t.structure)}}eH.jsonID("replace",eX);class eQ extends eH{constructor(e,t,n,r,i,o,s=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=o,this.structure=s}apply(e){if(this.structure&&(eY(e,this.from,this.gapFrom)||eY(e,this.gapTo,this.to)))return eq.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return eq.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?eq.fromReplace(e,this.from,this.to,n):eq.fail("Content does not fit in gap")}getMap(){return new e_([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new eQ(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),r=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),i=this.to==this.gapTo?n.pos:e.map(this.gapTo,1);return t.deletedAcross&&n.deletedAcross||r<t.pos||i>n.pos?null:new eQ(t.pos,n.pos,r,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to||"number"!=typeof t.gapFrom||"number"!=typeof t.gapTo||"number"!=typeof t.insert)throw RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new eQ(t.from,t.to,t.gapFrom,t.gapTo,G.fromJSON(e,t.slice),t.insert,!!t.structure)}}function eY(e,t,n){let r=e.resolve(t),i=n-t,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let e=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function eZ(e,t,n,r=n.contentMatch,i=!0){let o=e.doc.nodeAt(t),s=[],a=t+1;for(let t=0;t<o.childCount;t++){let l=o.child(t),c=a+l.nodeSize,d=r.matchType(l.type);if(d){r=d;for(let t=0;t<l.marks.length;t++)n.allowsMarkType(l.marks[t].type)||e.step(new eK(a,c,l.marks[t]));if(i&&l.isText&&"pre"!=n.whitespace){let e,t=/\r?\n|\r/g,r;for(;e=t.exec(l.text);)r||(r=new G(H.from(n.schema.text(" ",n.allowedMarks(l.marks))),0,0)),s.push(new eX(a+e.index,a+e.index+e[0].length,r))}}else s.push(new eX(a,c,G.empty));a=c}if(!r.validEnd){let t=r.fillBefore(H.empty,!0);e.replace(a,a,new G(t,0,0))}for(let t=s.length-1;t>=0;t--)e.step(s[t])}function e0(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth,r=0,i=0;;--n){let o=e.$from.node(n),s=e.$from.index(n)+r,a=e.$to.indexAfter(n)-i;if(n<e.depth&&o.canReplace(s,a,t))return n;if(0==n||o.type.spec.isolating||!((0==s||o.canReplace(s,o.childCount))&&(a==o.childCount||o.canReplace(0,a))))break;s&&(r=1),a<o.childCount&&(i=1)}return null}function e1(e,t,n=null,r=e){let i=function(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.contentMatchAt(r).findWrapping(t);if(!o)return null;let s=o.length?o[0]:t;return n.canReplaceWith(r,i,s)?o:null}(e,t),o=i&&function(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.child(r),s=t.contentMatch.findWrapping(o.type);if(!s)return null;let a=(s.length?s[s.length-1]:t).contentMatch;for(let e=r;a&&e<i;e++)a=a.matchType(n.child(e).type);return a&&a.validEnd?s:null}(r,t);return o?i.map(e2).concat({type:t,attrs:n}).concat(o.map(e2)):null}function e2(e){return{type:e,attrs:null}}function e3(e,t,n,r){t.forEach((i,o)=>{if(i.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(i.text);){let i=e.mapping.slice(r).map(n+1+o+s.index);e.replaceWith(i,i+1,t.type.schema.linebreakReplacement.create())}}})}function e5(e,t,n,r){t.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let i=e.mapping.slice(r).map(n+1+o);e.replaceWith(i,i+1,t.type.schema.text("\n"))}})}function e4(e,t,n=1,r){let i=e.resolve(t),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let e=i.depth-1,t=n-2;e>o;e--,t--){let n=i.node(e),o=i.index(e);if(n.type.spec.isolating)return!1;let s=n.content.cutByIndex(o,n.childCount),a=r&&r[t+1];a&&(s=s.replaceChild(0,a.type.create(a.attrs)));let l=r&&r[t]||n;if(!n.canReplace(o+1,n.childCount)||!l.type.validContent(s))return!1}let a=i.indexAfter(o),l=r&&r[0];return i.node(o).canReplaceWith(a,a,l?l.type:i.node(o+1).type)}function e6(e,t){let n=e.resolve(t),r=n.index();return e7(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function e7(e,t){return!!(e&&t&&!e.isLeaf&&function(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let i=0;i<t.childCount;i++){let o=t.child(i),s=o.type==r?e.type.schema.nodes.text:o.type;if(!(n=n.matchType(s))||!e.type.allowsMarks(o.marks))return!1}return n.validEnd}(e,t))}function e9(e,t,n=-1){let r=e.resolve(t);for(let e=r.depth;;e--){let i,o,s=r.index(e);if(e==r.depth?(i=r.nodeBefore,o=r.nodeAfter):n>0?(i=r.node(e+1),s++,o=r.node(e).maybeChild(s)):(i=r.node(e).maybeChild(s-1),o=r.node(e+1)),i&&!i.isTextblock&&e7(i,o)&&r.node(e).canReplace(s,s+1))return t;if(0==e)break;t=n<0?r.before(e):r.after(e)}}function e8(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let e=0;e<n.openStart;e++)i=i.firstChild.content;for(let e=1;e<=(0==n.openStart&&n.size?2:1);e++)for(let t=r.depth;t>=0;t--){let n=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,o=r.index(t)+ +(n>0),s=r.node(t),a=!1;if(1==e)a=s.canReplace(o,o,i);else{let e=s.contentMatchAt(o).findWrapping(i.firstChild.type);a=e&&s.canReplaceWith(o,o,e[0])}if(a)return 0==n?r.pos:n<0?r.before(t+1):r.after(t+1)}return null}function te(e,t,n=t,r=G.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),o=e.resolve(n);return tt(i,o,r)?new eX(t,n,r):new tn(i,o,r).fit()}function tt(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}eH.jsonID("replaceAround",eQ);class tn{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=H.empty;for(let t=0;t<=e.depth;t++){let n=e.node(t);this.frontier.push({type:n.type,match:n.contentMatchAt(e.indexAfter(t))})}for(let t=e.depth;t>0;t--)this.placed=H.from(e.node(t).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(e<0?this.$to:n.doc.resolve(e));if(!r)return null;let i=this.placed,o=n.depth,s=r.depth;for(;o&&s&&1==i.childCount;)i=i.firstChild.content,o--,s--;let a=new G(i,o,s);return e>-1?new eQ(n.pos,e,this.$to.pos,this.$to.end(),a,t):a.size||n.pos!=this.$to.pos?new eX(n.pos,r.pos,a):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<e;n++){let i=t.firstChild;if(t.childCount>1&&(r=0),i.type.spec.isolating&&r<=n){e=n;break}t=i.content}for(let t=1;t<=2;t++)for(let n=1==t?e:this.unplaced.openStart;n>=0;n--){let e=null,r=(n?(e=to(this.unplaced.content,n-1).firstChild).content:this.unplaced.content).firstChild;for(let i=this.depth;i>=0;i--){let{type:o,match:s}=this.frontier[i],a,l=null;if(1==t&&(r?s.matchType(r.type)||(l=s.fillBefore(H.from(r),!1)):e&&o.compatibleContent(e.type)))return{sliceDepth:n,frontierDepth:i,parent:e,inject:l};if(2==t&&r&&(a=s.findWrapping(r.type)))return{sliceDepth:n,frontierDepth:i,parent:e,wrap:a};if(e&&s.matchType(e.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=to(e,t);return!!r.childCount&&!r.firstChild.isLeaf&&(this.unplaced=new G(e,t+1,Math.max(n,r.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=to(e,t);if(r.childCount<=1&&t>0){let i=e.size-t<=t+r.size;this.unplaced=new G(tr(e,t-1,1),t-1,i?t-1:n)}else this.unplaced=new G(tr(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:r,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let e=0;e<i.length;e++)this.openFrontierNode(i[e]);let o=this.unplaced,s=n?n.content:o.content,a=o.openStart-e,l=0,c=[],{match:d,type:h}=this.frontier[t];if(r){for(let e=0;e<r.childCount;e++)c.push(r.child(e));d=d.matchFragment(r)}let u=s.size+e-(o.content.size-o.openEnd);for(;l<s.childCount;){let e=s.child(l),t=d.matchType(e.type);if(!t)break;(++l>1||0==a||e.content.size)&&(d=t,c.push(function e(t,n,r){if(n<=0)return t;let i=t.content;return n>1&&(i=i.replaceChild(0,e(i.firstChild,n-1,1==i.childCount?r-1:0))),n>0&&(i=t.type.contentMatch.fillBefore(i).append(i),r<=0&&(i=i.append(t.type.contentMatch.matchFragment(i).fillBefore(H.empty,!0)))),t.copy(i)}(e.mark(h.allowedMarks(e.marks)),1==l?a:0,l==s.childCount?u:-1)))}let p=l==s.childCount;p||(u=-1),this.placed=ti(this.placed,t,H.from(c)),this.frontier[t].match=d,p&&u<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=s;e<u;e++){let e=t.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),t=e.content}this.unplaced=p?0==e?G.empty:new G(tr(o.content,e-1,1),e-1,u<0?o.openEnd:e-1):new G(tr(o.content,e,l),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return -1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!ts(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return -1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){t:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],i=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),o=ts(e,t,r,n,i);if(o){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],i=ts(e,n,r,t,!0);if(!i||i.childCount)continue t}return{depth:t,fit:o,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=ti(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=ti(this.placed,this.depth,H.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(H.empty,!0);e.childCount&&(this.placed=ti(this.placed,this.frontier.length,e))}}function tr(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(tr(e.firstChild.content,t-1,n)))}function ti(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(ti(e.lastChild.content,t-1,n)))}function to(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function ts(e,t,n,r,i){let o=e.node(t),s=i?e.indexAfter(t):e.index(t);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let a=r.fillBefore(o.content,!0,s);return a&&!function(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}(n,o.content,s)?a:null}function ta(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let i=r;i>=0;i--){let r=e.start(i);if(r<e.pos-(e.depth-i)||t.end(i)>t.pos+(t.depth-i)||e.node(i).type.spec.isolating||t.node(i).type.spec.isolating)break;(r==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==r-1)&&n.push(i)}return n}class tl extends eH{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return eq.fail("No node at attribute step's position");let n=Object.create(null);for(let e in t.attrs)n[e]=t.attrs[e];n[this.attr]=this.value;let r=t.type.create(n,null,t.marks);return eq.fromReplace(e,this.pos,this.pos+1,new G(H.from(r),0,+!t.isLeaf))}getMap(){return e_.empty}invert(e){return new tl(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new tl(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if("number"!=typeof t.pos||"string"!=typeof t.attr)throw RangeError("Invalid input for AttrStep.fromJSON");return new tl(t.pos,t.attr,t.value)}}eH.jsonID("attr",tl);class tc extends eH{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let n in e.attrs)t[n]=e.attrs[n];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return eq.ok(n)}getMap(){return e_.empty}invert(e){return new tc(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if("string"!=typeof t.attr)throw RangeError("Invalid input for DocAttrStep.fromJSON");return new tc(t.attr,t.value)}}eH.jsonID("docAttr",tc);
278let td=class extends Error{};(td=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n}).prototype=Object.create(Error.prototype),td.prototype.constructor=td,td.prototype.name="TransformError";class th{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new eV}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new td(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,t=-1e9;for(let n=0;n<this.mapping.maps.length;n++){let r=this.mapping.maps[n];n&&(e=r.map(e,1),t=r.map(t,-1)),r.forEach((n,r,i,o)=>{e=Math.min(e,i),t=Math.max(t,o)})}return 1e9==e?null:{from:e,to:t}}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=G.empty){let r=te(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new G(H.from(n),0,0))}delete(e,t){return this.replace(e,t,G.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return!function(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),o=e.doc.resolve(n);if(tt(i,o,r))return e.step(new eX(t,n,r));let s=ta(i,o);0==s[s.length-1]&&s.pop();let a=-(i.depth+1);s.unshift(a);for(let e=i.depth,t=i.pos-1;e>0;e--,t--){let n=i.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;s.indexOf(e)>-1?a=e:i.before(e)==t&&s.splice(1,0,-e)}let l=s.indexOf(a),c=[],d=r.openStart;for(let e=r.content,t=0;;t++){let n=e.firstChild;if(c.push(n),t==r.openStart)break;e=n.content}for(let e=d-1;e>=0;e--){var h;let t=c[e],n=(h=t.type).spec.defining||h.spec.definingForContent;if(n&&!t.sameMarkup(i.node(Math.abs(a)-1)))d=e;else if(n||!t.type.isTextblock)break}for(let t=r.openStart;t>=0;t--){let a=(t+d+1)%(r.openStart+1),h=c[a];if(h)for(let t=0;t<s.length;t++){let c=s[(t+l)%s.length],d=!0;c<0&&(d=!1,c=-c);let u=i.node(c-1),p=i.index(c-1);if(u.canReplaceWith(p,p,h.type,h.marks))return e.replace(i.before(c),d?o.after(c):n,new G(function e(t,n,r,i,o){if(n<r){let o=t.firstChild;t=t.replaceChild(0,o.copy(e(o.content,n+1,r,i,o)))}if(n>i){let e=o.contentMatchAt(0),n=e.fillBefore(t).append(t);t=n.append(e.matchFragment(n).fillBefore(H.empty,!0))}return t}(r.content,0,r.openStart,a),a,r.openEnd))}}let u=e.steps.length;for(let a=s.length-1;a>=0&&(e.replace(t,n,r),!(e.steps.length>u));a--){let e=s[a];e<0||(t=i.before(e),n=o.after(e))}}(this,e,t,n),this}replaceRangeWith(e,t,n){var r=e,i=t;if(!n.isInline&&r==i&&this.doc.resolve(r).parent.content.size){let e=function(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(0==r.parentOffset)for(let e=r.depth-1;e>=0;e--){let t=r.index(e);if(r.node(e).canReplaceWith(t,t,n))return r.before(e+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let e=r.depth-1;e>=0;e--){let t=r.indexAfter(e);if(r.node(e).canReplaceWith(t,t,n))return r.after(e+1);if(t<r.node(e).childCount)break}return null}(this.doc,r,n.type);null!=e&&(r=i=e)}return this.replaceRange(r,i,new G(H.from(n),0,0)),this}deleteRange(e,t){return!function(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n),o=ta(r,i);for(let t=0;t<o.length;t++){let n=o[t],s=t==o.length-1;if(s&&0==n||r.node(n).type.contentMatch.validEnd)return e.delete(r.start(n),i.end(n));if(n>0&&(s||r.node(n-1).canReplace(r.index(n-1),i.indexAfter(n-1))))return e.delete(r.before(n),i.after(n))}for(let o=1;o<=r.depth&&o<=i.depth;o++)if(t-r.start(o)==r.depth-o&&n>r.end(o)&&i.end(o)-n!=i.depth-o&&r.start(o-1)==i.start(o-1)&&r.node(o-1).canReplace(r.index(o-1),i.index(o-1)))return e.delete(r.before(o),n);e.delete(t,n)}(this,e,t),this}lift(e,t){return!function(e,t,n){let{$from:r,$to:i,depth:o}=t,s=r.before(o+1),a=i.after(o+1),l=s,c=a,d=H.empty,h=0;for(let e=o,t=!1;e>n;e--)t||r.index(e)>0?(t=!0,d=H.from(r.node(e).copy(d)),h++):l--;let u=H.empty,p=0;for(let e=o,t=!1;e>n;e--)t||i.after(e+1)<i.end(e)?(t=!0,u=H.from(i.node(e).copy(u)),p++):c++;e.step(new eQ(l,c,s,a,new G(d.append(u),h,p),d.size-h,!0))}(this,e,t),this}join(e,t=1){return!function(e,t,n){let r=null,{linebreakReplacement:i}=e.doc.type.schema,o=e.doc.resolve(t-n),s=o.node().type;if(i&&s.inlineContent){let e="pre"==s.whitespace,t=!!s.contentMatch.matchType(i);e&&!t?r=!1:!e&&t&&(r=!0)}let a=e.steps.length;if(!1===r){let r=e.doc.resolve(t+n);e5(e,r.node(),r.before(),a)}s.inlineContent&&eZ(e,t+n-1,s,o.node().contentMatchAt(o.index()),null==r);let l=e.mapping.slice(a),c=l.map(t-n);if(e.step(new eX(c,l.map(t+n,-1),G.empty,!0)),!0===r){let t=e.doc.resolve(c);e3(e,t.node(),t.before(),e.steps.length)}}(this,e,t),this}wrap(e,t){return!function(e,t,n){let r=H.empty;for(let e=n.length-1;e>=0;e--){if(r.size){let t=n[e].type.contentMatch.matchFragment(r);if(!t||!t.validEnd)throw RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=H.from(n[e].type.create(n[e].attrs,r))}let i=t.start,o=t.end;e.step(new eQ(i,o,i,o,new G(r,0,0),n.length,!0))}(this,e,t),this}setBlockType(e,t=e,n,r=null){var i=this;if(!n.isTextblock)throw RangeError("Type given to setBlockType should be a textblock");let o=i.steps.length;return i.doc.nodesBetween(e,t,(e,t)=>{var s,a,l;
278let c,d,h="function"==typeof r?r(e):r;if(e.isTextblock&&!e.hasMarkup(n,h)&&(s=i.doc,a=i.mapping.slice(o).map(t),l=n,d=(c=s.resolve(a)).index(),c.parent.canReplaceWith(d,d+1,l))){let r=null;if(n.schema.linebreakReplacement){let e="pre"==n.whitespace,t=!!n.contentMatch.matchType(n.schema.linebreakReplacement);e&&!t?r=!1:!e&&t&&(r=!0)}!1===r&&e5(i,e,t,o),eZ(i,i.mapping.slice(o).map(t,1),n,void 0,null===r);let s=i.mapping.slice(o),a=s.map(t,1),l=s.map(t+e.nodeSize,1);return i.step(new eQ(a,l,a+1,l-1,new G(H.from(n.create(h,null,e.marks)),0,0),1,!0)),!0===r&&e3(i,e,t,o),!1}}),this}setNodeMarkup(e,t,n=null,r){return!function(e,t,n,r,i){let o=e.doc.nodeAt(t);if(!o)throw RangeError("No node at given position");n||(n=o.type);let s=n.create(r,null,i||o.marks);if(o.isLeaf)return e.replaceWith(t,t+o.nodeSize,s);if(!n.validContent(o.content))throw RangeError("Invalid content for node type "+n.name);e.step(new eQ(t,t+o.nodeSize,t+1,t+o.nodeSize-1,new G(H.from(s),0,0),1,!0))}(this,e,t,n,r),this}setNodeAttribute(e,t,n){return this.step(new tl(e,t,n)),this}setDocAttribute(e,t){return this.step(new tc(e,t)),this}addNodeMark(e,t){return this.step(new eJ(e,t)),this}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw RangeError("No node at position "+e);if(t instanceof K)t.isInSet(n.marks)&&this.step(new eG(e,t));else{let r=n.marks,i,o=[];for(;i=t.isInSet(r);)o.push(new eG(e,i)),r=i.removeFromSet(r);for(let e=o.length-1;e>=0;e--)this.step(o[e])}return this}split(e,t=1,n){return!function(e,t,n=1,r){let i=e.doc.resolve(t),o=H.empty,s=H.empty;for(let e=i.depth,t=i.depth-n,a=n-1;e>t;e--,a--){o=H.from(i.node(e).copy(o));let t=r&&r[a];s=H.from(t?t.type.create(t.attrs,s):i.node(e).copy(s))}e.step(new eX(t,t,new G(o.append(s),n,n),!0))}(this,e,t,n),this}addMark(e,t,n){var r;let i,o,s,a;return r=this,s=[],a=[],r.doc.nodesBetween(e,t,(r,l,c)=>{if(!r.isInline)return;let d=r.marks;if(!n.isInSet(d)&&c.type.allowsMarkType(n.type)){let c=Math.max(l,e),h=Math.min(l+r.nodeSize,t),u=n.addToSet(d);for(let e=0;e<d.length;e++)d[e].isInSet(u)||(i&&i.to==c&&i.mark.eq(d[e])?i.to=h:s.push(i=new eK(c,h,d[e])));o&&o.to==c?o.to=h:a.push(o=new eW(c,h,n))}}),s.forEach(e=>r.step(e)),a.forEach(e=>r.step(e)),this}removeMark(e,t,n){var r;let i,o;return r=this,i=[],o=0,r.doc.nodesBetween(e,t,(r,s)=>{if(!r.isInline)return;o++;let a=null;if(n instanceof ek){let e=r.marks,t;for(;t=n.isInSet(e);)(a||(a=[])).push(t),e=t.removeFromSet(e)}else n?n.isInSet(r.marks)&&(a=[n]):a=r.marks;if(a&&a.length){let n=Math.min(s+r.nodeSize,t);for(let t=0;t<a.length;t++){let r=a[t],l;for(let e=0;e<i.length;e++){let t=i[e];t.step==o-1&&r.eq(i[e].style)&&(l=t)}l?(l.to=n,l.step=o):i.push({style:r,from:Math.max(s,e),to:n,step:o})}}}
vendor: 8,100 bytes, line 278
278),i.forEach(e=>r.step(new eK(e.from,e.to,e.style))),this}clearIncompatible(e,t,n){return eZ(this,e,t,n),this}}let tu=Object.create(null);class tp{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new tf(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=G.empty){let n=t.content.lastChild,r=null;for(let e=0;e<t.openEnd;e++)r=n,n=n.lastChild;let i=e.steps.length,o=this.ranges;for(let s=0;s<o.length;s++){let{$from:a,$to:l}=o[s],c=e.mapping.slice(i);e.replaceRange(c.map(a.pos),c.map(l.pos),s?G.empty:t),0==s&&tM(e,i,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:o,$to:s}=r[i],a=e.mapping.slice(n),l=a.map(o.pos),c=a.map(s.pos);i?e.deleteRange(l,c):(e.replaceRangeWith(l,c,t),tM(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new ty(e):tS(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let r=e.depth-1;r>=0;r--){let i=t<0?tS(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):tS(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(i)return i}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new tw(e.node(0))}static atStart(e){return tS(e,e,0,0,1)||new tw(e)}static atEnd(e){return tS(e,e,e.content.size,e.childCount,-1)||new tw(e)}static fromJSON(e,t){if(!t||!t.type)throw RangeError("Invalid input for Selection.fromJSON");let n=tu[t.type];if(!n)throw RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in tu)throw RangeError("Duplicate use of selection JSON ID "+e);return tu[e]=t,t.prototype.jsonID=e,t}getBookmark(){return ty.between(this.$anchor,this.$head).getBookmark()}}tp.prototype.visible=!0;class tf{constructor(e,t){this.$from=e,this.$to=t}}let tm=!1;function tg(e){tm||e.parent.inlineContent||(tm=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class ty extends tp{constructor(e,t=e){tg(e),tg(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let n=e.resolve(t.map(this.head));if(!n.parent.inlineContent)return tp.near(n);let r=e.resolve(t.map(this.anchor));return new ty(r.parent.inlineContent?r:n,n)}replace(e,t=G.empty){if(super.replace(e,t),t==G.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(e){return e instanceof ty&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new tb(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if("number"!=typeof t.anchor||"number"!=typeof t.head)throw RangeError("Invalid input for TextSelection.fromJSON");return new ty(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(e,t,n){let r=e.pos-t.pos;if((!n||r)&&(n=r>=0?1:-1),!t.parent.inlineContent){let e=tp.findFrom(t,n,!0)||tp.findFrom(t,-n,!0);if(!e)return tp.near(t,n);t=e.$head}return e.parent.inlineContent||(0==r?e=t:(e=(tp.findFrom(e,-n,!0)||tp.findFrom(e,n,!0)).$anchor).pos<t.pos!=r<0&&(e=t)),new ty(e,t)}}tp.jsonID("text",ty);class tb{constructor(e,t){this.anchor=e,this.head=t}map(e){return new tb(e.map(this.anchor),e.map(this.head))}resolve(e){return ty.between(e.resolve(this.anchor),e.resolve(this.head))}}class tx extends tp{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(e,t){let{deleted:n,pos:r}=t.mapResult(this.anchor),i=e.resolve(r);return n?tp.near(i):new tx(i)}content(){return new G(H.from(this.node),0,0)}eq(e){return e instanceof tx&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new tv(this.anchor)}static fromJSON(e,t){if("number"!=typeof t.anchor)throw RangeError("Invalid input for NodeSelection.fromJSON");return new tx(e.resolve(t.anchor))}static create(e,t){return new tx(e.resolve(t))}static isSelectable(e){return!e.isText&&!1!==e.type.spec.selectable}}tx.prototype.visible=!1,tp.jsonID("node",tx);class tv{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:n}=e.mapResult(this.anchor);return t?new tb(n,n):new tv(n)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&tx.isSelectable(n)?new tx(t):tp.near(t)}}class tw extends tp{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=G.empty){if(t==G.empty){e.delete(0,e.doc.content.size);let t=tp.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new tw(e)}map(e){return new tw(e)}eq(e){return e instanceof tw}getBookmark(){return tk}}tp.jsonID("all",tw);let tk={map(){return this},resolve:e=>new tw(e)};function tS(e,t,n,r,i,o=!1){if(t.inlineContent)return ty.create(e,n);for(let s=r-(i>0?0:1);i>0?s<t.childCount:s>=0;s+=i){let r=t.child(s);if(r.isAtom){if(!o&&tx.isSelectable(r))return tx.create(e,n-(i<0?r.nodeSize:0))}else{let t=tS(e,r,n+i,i<0?r.childCount:0,i,o);if(t)return t}n+=r.nodeSize*i}return null}function tM(e,t,n){let r,i=e.steps.length-1;if(i<t)return;let o=e.steps[i];(o instanceof eX||o instanceof eQ)&&(e.mapping.maps[i].forEach((e,t,n,i)=>{null==r&&(r=i)}),e.setSelection(tp.near(e.doc.resolve(r),n)))}class tC extends th{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(1|this.updated)&-3,this.storedMarks=null,this}get selectionSet(){return(1&this.updated)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=2,this}ensureMarks(e){return K.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(2&this.updated)>0}addStep(e,t){super.addStep(e,t),this.updated=-3&this.updated,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||K.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let r=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(null==n&&(n=t),!e)return this.deleteRange(t,n);let i=this.storedMarks;if(!i){let e=this.doc.resolve(t);i=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,i)),this.selection.empty||this.selection.to!=t+e.length||this.setSelection(tp.near(this.selection.$to)),this}}setMeta(e,t){return this.meta["string"==typeof e?e:e.key]=t,this}getMeta(e){return this.meta["string"==typeof e?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function tN(e,t){return t&&e?e.bind(t):e}class tE{constructor(e,t,n){this.name=e,this.init=tN(t.init,n),this.apply=tN(t.apply,n)}}let tT=[new tE("doc",{init:e=>e.doc||e.schema.topNodeType.createAndFill(),apply:e=>e.doc}),new tE("selection",{init:(e,t)=>
278e.selection||tp.atStart(t.doc),apply:e=>e.selection}),new tE("storedMarks",{init:e=>e.storedMarks||null,apply:(e,t,n,r)=>r.selection.$cursor?e.storedMarks:null}),new tE("scrollToSelection",{init:()=>0,apply:(e,t)=>e.scrolledIntoView?t+1:t})];class tO{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=tT.slice(),t&&t.forEach(e=>{if(this.pluginsByKey[e.key])throw RangeError("Adding different instances of a keyed plugin ("+e.key+")");this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new tE(e.key,e.spec.state,e))})}}class tA{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let t=this.config.plugins[n];if(t.spec.filterTransaction&&!t.spec.filterTransaction.call(t,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),r=null;for(;;){let i=!1;for(let o=0;o<this.config.plugins.length;o++){let s=this.config.plugins[o];if(s.spec.appendTransaction){let a=r?r[o].n:0,l=r?r[o].state:this,c=a<t.length&&s.spec.appendTransaction.call(s,a?t.slice(a):t,l,n);if(c&&n.filterTransaction(c,o)){if(c.setMeta("appendedTransaction",e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<o?{state:n,n:t.length}:{state:this,n:0})}t.push(c),n=n.applyInner(c),i=!0}r&&(r[o]={state:n,n:t.length})}}if(!i)return{state:n,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw RangeError("Applying a mismatched transaction");let t=new tA(this.config),n=this.config.fields;for(let r=0;r<n.length;r++){let i=n[r];t[i.name]=i.apply(e,this[i.name],this,t)}return t}get tr(){return new tC(this)}static create(e){let t=new tO(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new tA(t);for(let r=0;r<t.fields.length;r++)n[t.fields[r].name]=t.fields[r].init(e,n);return n}reconfigure(e){let t=new tO(this.schema,e.plugins),n=t.fields,r=new tA(t);for(let t=0;t<n.length;t++){let i=n[t].name;r[i]=this.hasOwnProperty(i)?this[i]:n[t].init(e,r)}return r}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(e=>e.toJSON())),e&&"object"==typeof e)for(let n in e){if("doc"==n||"selection"==n)throw RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],i=r.spec.state;i&&i.toJSON&&(t[n]=i.toJSON.call(r,this[r.key]))}return t}static fromJSON(e,t,n){if(!t)throw RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw RangeError("Required config field 'schema' missing");let r=new tO(e.schema,e.plugins),i=new tA(r);return r.fields.forEach(r=>{if("doc"==r.name)i.doc=el.fromJSON(e.schema,t.doc);else if("selection"==r.name)i.selection=tp.fromJSON(i.doc,t.selection);else if("storedMarks"==r.name)t.storedMarks&&(i.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let o in n){let s=n[o],a=s.spec.state;if(s.key==r.name&&a&&a.fromJSON&&Object.prototype.hasOwnProperty.call(t,o)){i[r.name]=a.fromJSON.call(s,e,t[o],i);return}}i[r.name]=r.init(e,i)}}),i}}class tj{constructor(e){this.spec=e,this.props={},e.props&&function e(t,n,r){for(let i in t){let o=t[i];o instanceof Function?o=o.bind(n):"handleDOMEvents"==i&&(o=e(o,n,{})),r[i]=o}return r}(e.props,this,this.props),this.key=e.key?e.key.key:tD("plugin")}getState(e){return e[this.key]}}let tI=Object.create(null);function tD(e){return e in tI?e+"$"+ ++tI[e]:(tI[e]=0,e+"$")}class tR{constructor(e="key"){this.key=tD(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}let tL=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function tP(e,t){let{$cursor:n}=e.selection;return n&&(t?t.endOfTextblock("backward",e):!(n.parentOffset>0))?n:null}let tB=(e,t,n)=>{let r=tP(e,n);if(!r)return!1;let i=tH(r);if(!i){let n=r.blockRange(),i=n&&e0(n);return null!=i&&(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)}let o=i.nodeBefore;if(t3(e,i,t,-1))return!0;
278if(0==r.parent.content.size&&(tV(o,"end")||tx.isSelectable(o)))for(let n=r.depth;;n--){let s=te(e.doc,r.before(n),r.after(n),G.empty);if(s&&s.slice.size<s.to-s.from){if(t){let n=e.tr.step(s);n.setSelection(tV(o,"end")?tp.findFrom(n.doc.resolve(n.mapping.map(i.pos,-1)),-1):tx.create(n.doc,i.pos-o.nodeSize)),t(n.scrollIntoView())}return!0}if(1==n||r.node(n-1).childCount>1)break}return!!o.isAtom&&i.depth==r.depth-1&&(t&&t(e.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0)},tz=(e,t,n)=>{let r=tP(e,n);if(!r)return!1;let i=tH(r);return!!i&&t_(e,i,t)},t$=(e,t,n)=>{let r=tq(e,n);if(!r)return!1;let i=tK(r);return!!i&&t_(e,i,t)};function t_(e,t,n){let r=t.nodeBefore,i=t.pos-1;for(;!r.isTextblock;i--){if(r.type.spec.isolating)return!1;let e=r.lastChild;if(!e)return!1;r=e}let o=t.nodeAfter,s=t.pos+1;for(;!o.isTextblock;s++){if(o.type.spec.isolating)return!1;let e=o.firstChild;if(!e)return!1;o=e}let a=te(e.doc,i,s,G.empty);if(!a||a.from!=i||a instanceof eX&&a.slice.size>=s-i)return!1;if(n){let t=e.tr.step(a);t.setSelection(ty.create(t.doc,i)),n(t.scrollIntoView())}return!0}function tV(e,t,n=!1){for(let r=e;r;r="start"==t?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)break}return!1}let tF=(e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;o=tH(r)}let s=o&&o.nodeBefore;return!!s&&!!tx.isSelectable(s)&&(t&&t(e.tr.setSelection(tx.create(e.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function tH(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function tq(e,t){let{$cursor:n}=e.selection;return n&&(t?t.endOfTextblock("forward",e):!(n.parentOffset<n.parent.content.size))?n:null}let tU=(e,t,n)=>{let r=tq(e,n);if(!r)return!1;let i=tK(r);if(!i)return!1;let o=i.nodeAfter;if(t3(e,i,t,1))return!0;if(0==r.parent.content.size&&(tV(o,"start")||tx.isSelectable(o))){let n=te(e.doc,r.before(),r.after(),G.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(tV(o,"start")?tp.findFrom(r.doc.resolve(r.mapping.map(i.pos)),1):tx.create(r.doc,r.mapping.map(i.pos))),t(r.scrollIntoView())}return!0}}return!!o.isAtom&&i.depth==r.depth-1&&(t&&t(e.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0)},tW=(e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;o=tK(r)}let s=o&&o.nodeAfter;return!!s&&!!tx.isSelectable(s)&&(t&&t(e.tr.setSelection(tx.create(e.doc,o.pos)).scrollIntoView()),!0)};function tK(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}let tJ=(e,t)=>{let n=e.selection,r=n instanceof tx,i;if(r){if(n.node.isTextblock||!e6(e.doc,n.from))return!1;i=n.from}else if(null==(i=e9(e.doc,n.from,-1)))return!1;if(t){let n=e.tr.join(i);r&&n.setSelection(tx.create(n.doc,i-e.doc.resolve(i).nodeBefore.nodeSize)),t(n.scrollIntoView())}return!0},tG=(e,t)=>{let n=e.selection,r;if(n instanceof tx){if(n.node.isTextblock||!e6(e.doc,n.to))return!1;r=n.to}else if(null==(r=e9(e.doc,n.to,1)))return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},tX=(e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),o=i&&e0(i);return null!=o&&(t&&t(e.tr.lift(i,o).scrollIntoView()),!0)},tQ=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!!n.parent.type.spec.code&&!!n.sameParent(r)&&(t&&t(e.tr.insertText("\n").scrollIntoView()),!0)};function tY(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}let tZ=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),s=tY(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(t){let r=n.after(),i=e.tr.replaceWith(r,r,s.createAndFill());i.setSelection(tp.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0},t0=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof tw||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=tY(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(t){let n=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,s=e.tr.insert(n,o.createAndFill());s.setSelection(ty.create(s.doc,n+1)),t(s.scrollIntoView())}return!0},t1=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(e4(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&e0(r);return null!=i&&(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)},t2=(e,t)=>{let{$from:n,to:r}=e.selection,i,o=n.sharedDepth(r);return 0!=o&&(i=n.before(o),t&&t(e.tr.setSelection(tx.create(e.doc,i))),!0)};function t3(e,t,n,r){let i,o,s,a=t.nodeBefore,l=t.nodeAfter,c,d,h=a.type.spec.isolating||l.type.spec.isolating;if(!h&&(i=t.nodeBefore,o=t.nodeAfter,s=t.index(),i&&o&&i.type.compatibleContent(o.type)&&(!i.content.size&&t.parent.canReplace(s-1,s)?(n&&n(e.tr.delete(t.pos-i.nodeSize,t.pos).scrollIntoView()),!0):!!t.parent.canReplace(s,s+1)&&!!(o.isTextblock||e6(e.doc,t.pos))&&(n&&n(e.tr.join(t.pos).scrollIntoView()),!0))))return!0;let u=!h&&t.parent.canReplace(t.index(),t.index()+1);if(u&&(c=(d=a.contentMatchAt(a.childCount)).findWrapping(l.type))&&d.matchType(c[0]||l.type).validEnd){if(n){let r=t.pos+l.nodeSize,i=H.empty;for(let e=c.length-1;e>=0;e--)i=H.from(c[e].create(null,i));i=H.from(a.copy(i));let o=e.tr.step(new eQ(t.pos-1,r,t.pos,r,new G(i,1,0),c.length,!0)),s=o.doc.resolve(r+2*c.length);s.nodeAfter&&s.nodeAfter.type==a.type&&e6(o.doc,s.pos)&&o.join(s.pos),n(o.scrollIntoView())}return!0}let p=l.type.spec.isolating||r>0&&h?null:tp.findFrom(t,1),f=p&&p.$from.blockRange(p.$to),m=f&&e0(f);if(null!=m&&m>=t.depth)return n&&n(e.tr.lift(f,m).scrollIntoView()),!0;if(u&&tV(l,"start",!0)&&tV(a,"end")){let r=a,i=[];for(;i.push(r),!r.isTextblock;)r=r.lastChild;let o=l,s=1;for(;!o.isTextblock;o=o.firstChild)s++;if(r.canReplace(r.childCount,r.childCount,o.content)){if(n){let r=H.empty;for(let e=i.length-1;e>=0;e--)r=H.from(i[e].copy(r));n(e.tr.step(new eQ(t.pos-i.length,t.pos+l.nodeSize,t.pos+s,t.pos+l.nodeSize-s,new G(r,i.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function t5(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return!!i.node(o).isTextblock&&(n&&n(t.tr.setSelection(ty.create(t.doc,e<0?i.start(o):i.end(o)))),!0)}}let t4=t5(-1),t6=t5(1);function t7(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),a=s&&e1(s,e,t);return!!a&&(r&&r(n.tr.wrap(s,a).scrollIntoView()),!0)}}function t9(e,t=null){return function(n,r){let i=!1;for(let r=0;r<n.selection.ranges.length&&!i;r++){let{$from:{pos:o},$to:{pos:s}}=n.selection.ranges[r];n.doc.nodesBetween(o,s,(r,o)=>{if(i)return!1;if(!(!r.isTextblock||r.hasMarkup(e,t)))if(r.type==e)i=!0;else{let t=n.doc.resolve(o),r=t.index();i=t.parent.canReplaceWith(r,r+1,e)}})}if(!i)return!1;if(r){let i=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:o},$to:{pos:s}}=n.selection.ranges[r];i.setBlockType(o,s,e,t)}r(i.scrollIntoView())}return!0}}function t8(...e){return function(t,n,r){for(let i=0;i<e.length;i++)if(e[i](t,n,r))return!0;return!1}}let ne=t8(tL,tB,tF),nt=t8(tL,tU,tW),nn={Enter:t8(tQ,t0,t1,(e,t)=>{let{$from:n,$to:r}=e.selection;if(e.selection instanceof tx&&e.selection.node.isBlock)return!!n.parentOffset&&!!e4(e.doc,n.pos)&&(t&&t(e.tr.split(n.pos).scrollIntoView()),!0);if(!n.depth)return!1;let i=[],o,s,a=!1,l=!1;for(let e=n.depth;;e--){if(n.node(e).isBlock){let t;a=n.end(e)==n.pos+(n.depth-e),l=n.start(e)==n.pos-(n.depth-e),s=tY(n.node(e-1).contentMatchAt(n.indexAfter(e-1)));i.unshift(t||(a&&s?{type:s}:null)),o=e;break}if(1==e)return!1;i.unshift(null)}let c=e.tr;(e.selection instanceof ty||e.selection instanceof tw)&&c.deleteSelection();let d=c.mapping.map(n.pos),h=e4(c.doc,d,i.length,i);if(h||(i[0]=s?{type:s}:null,h=e4(c.doc,d,i.length,i)),!h)return!1;
278if(c.split(d,i.length,i),!a&&l&&n.node(o).type!=s){let e=c.mapping.map(n.before(o)),t=c.doc.resolve(e);s&&n.node(o-1).canReplaceWith(t.index(),t.index()+1,s)&&c.setNodeMarkup(c.mapping.map(n.before(o)),s)}return t&&t(c.scrollIntoView()),!0}),"Mod-Enter":tZ,Backspace:ne,"Mod-Backspace":ne,"Shift-Backspace":ne,Delete:nt,"Mod-Delete":nt,"Mod-a":(e,t)=>(t&&t(e.tr.setSelection(new tw(e.doc))),!0)},nr={"Ctrl-h":nn.Backspace,"Alt-Backspace":nn["Mod-Backspace"],"Ctrl-d":nn.Delete,"Ctrl-Alt-Backspace":nn["Mod-Delete"],"Alt-Delete":nn["Mod-Delete"],"Alt-d":nn["Mod-Delete"],"Ctrl-a":t4,"Ctrl-e":t6};for(let e in nn)nr[e]=nn[e];function ni(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o);if(!s)return!1;let a=r?n.tr:null;return!!function(e,t,n,r=null){let i=!1,o=t,s=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&0==t.startIndex){if(0==t.$from.index(t.depth-1))return!1;let e=s.resolve(t.start-2);o=new es(e,e,t.depth),t.endIndex<t.parent.childCount&&(t=new es(t.$from,s.resolve(t.$to.end(t.depth)),t.depth)),i=!0}let a=e1(o,n,r,t);return!!a&&(e&&function(e,t,n,r,i){let o=H.empty;for(let e=n.length-1;e>=0;e--)o=H.from(n[e].type.create(n[e].attrs,o));e.step(new eQ(t.start-2*!!r,t.end,t.start,t.end,new G(o,0,0),n.length,!0));let s=0;for(let e=0;e<n.length;e++)n[e].type==i&&(s=e+1);let a=n.length-s,l=t.start+n.length-2*!!r,c=t.parent;for(let n=t.startIndex,r=t.endIndex,i=!0;n<r;n++,i=!1)!i&&e4(e.doc,l,a)&&(e.split(l,a),l+=2*a),l+=c.child(n).nodeSize}(e,t,a,i,n),!0)}(a,s,e,t)&&(r&&r(a.scrollIntoView()),!0)}}function no(e){return function(t,n){let{$from:r,$to:i}=t.selection,o=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==e);return!!o&&(!n||(r.node(o.depth-1).type==e?function(e,t,n,r){let i=e.tr,o=r.end,s=r.$to.end(r.depth);o<s&&(i.step(new eQ(o-1,s,o,s,new G(H.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new es(i.doc.resolve(r.$from.pos),i.doc.resolve(s),r.depth));let a=e0(r);if(null==a)return!1;i.lift(r,a);let l=i.doc.resolve(i.mapping.map(o,-1)-1);return e6(i.doc,l.pos)&&l.nodeBefore.type==l.nodeAfter.type&&i.join(l.pos),t(i.scrollIntoView()),!0}(t,n,e,o):function(e,t,n){let r=e.tr,i=n.parent;for(let e=n.end,t=n.endIndex-1,o=n.startIndex;t>o;t--)e-=i.child(t).nodeSize,r.delete(e-1,e+1);let o=r.doc.resolve(n.start),s=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let a=0==n.startIndex,l=n.endIndex==i.childCount,c=o.node(-1),d=o.index(-1);if(!c.canReplace(d+ +!a,d+1,s.content.append(l?H.empty:H.from(i))))return!1;let h=o.pos,u=h+s.nodeSize;return r.step(new eQ(h-!!a,u+ +!!l,h+1,u-1,new G((a?H.empty:H.from(i.copy(H.empty))).append(l?H.empty:H.from(i.copy(H.empty))),+!a,+!l),+!a)),t(r.scrollIntoView()),!0}(t,n,o)))}}function ns(e){return function(t,n){let{$from:r,$to:i}=t.selection,o=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==e);if(!o)return!1;let s=o.startIndex;if(0==s)return!1;let a=o.parent,l=a.child(s-1);if(l.type!=e)return!1;if(n){let r=l.lastChild&&l.lastChild.type==a.type,i=H.from(r?e.create():null),s=new G(H.from(e.create(null,H.from(a.type.create(null,i)))),r?3:1,0),c=o.start,d=o.end;n(t.tr.step(new eQ(c-(r?3:1),d,c,d,s,1,!0)).scrollIntoView())}return!0}}"u">typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"u">typeof os&&os.platform&&os.platform();let na=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},nl=function(e){let t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t},nc=null,nd=function(e,t,n){let r=nc||(nc=document.createRange());return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},nh=function(){nc=null},nu=function(e,t,n,r){return n&&(nf(e,t,n,r,-1)||nf(e,t,n,r,1))},np=/^(img|br|input|textarea|hr)$/i;function nf(e,t,n,r,i){for(var o;;){if(e==n&&t==r)return!0;if(t==(i<0?0:nm(e))){let n=e.parentNode;if(!n||1!=n.nodeType||ng(e)||np.test(e.nodeName)||"false"==e.contentEditable)return!1;t=na(e)+(i<0?0:1),e=n}else{if(1!=e.nodeType)return!1;let n=e.childNodes[t+(i<0?-1:0)];if(1==n.nodeType&&"false"==n.contentEditable)if(null==(o=n.pmViewDesc)||!o.ignoreForSelection)return!1;else t+=i;else e=n,t=i<0?nm(e):0}}}function nm(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function ng(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}
vendor: 12,380 bytes, line 278
278let ny=function(e){return e.focusNode&&nu(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function nb(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}let nx="u">typeof navigator?navigator:null,nv="u">typeof document?document:null,nw=nx&&nx.userAgent||"",nk=/Edge\/(\d+)/.exec(nw),nS=/MSIE \d/.exec(nw),nM=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(nw),nC=!!(nS||nM||nk),nN=nS?document.documentMode:nM?+nM[1]:nk?+nk[1]:0,nE=!nC&&/gecko\/(\d+)/i.test(nw);nE&&(/Firefox\/(\d+)/.exec(nw)||[0,0])[1];let nT=!nC&&/Chrome\/(\d+)/.exec(nw),nO=!!nT,nA=nT?+nT[1]:0,nj=!nC&&!!nx&&/Apple Computer/.test(nx.vendor),nI=nj&&(/Mobile\/\w+/.test(nw)||!!nx&&nx.maxTouchPoints>2),nD=nI||!!nx&&/Mac/.test(nx.platform),nR=!!nx&&/Win/.test(nx.platform),nL=/Android \d/.test(nw),nP=!!nv&&"webkitFontSmoothing"in nv.documentElement.style,nB=nP?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function nz(e,t){return"number"==typeof e?e:e[t]}function n$(e,t,n){let r=e.someProp("scrollThreshold")||0,i=e.someProp("scrollMargin")||5,o=e.dom.ownerDocument;for(let s=n||e.dom;s;){if(1!=s.nodeType){s=nl(s);continue}let e=s,n=e==o.body,a=n?function(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}(o):function(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}(e),l=0,c=0;if(t.top<a.top+nz(r,"top")?c=-(a.top-t.top+nz(i,"top")):t.bottom>a.bottom-nz(r,"bottom")&&(c=t.bottom-t.top>a.bottom-a.top?t.top+nz(i,"top")-a.top:t.bottom-a.bottom+nz(i,"bottom")),t.left<a.left+nz(r,"left")?l=-(a.left-t.left+nz(i,"left")):t.right>a.right-nz(r,"right")&&(l=t.right-a.right+nz(i,"right")),l||c)if(n)o.defaultView.scrollBy(l,c);else{let n=e.scrollLeft,r=e.scrollTop;c&&(e.scrollTop+=c),l&&(e.scrollLeft+=l);let i=e.scrollLeft-n,o=e.scrollTop-r;t={left:t.left-i,top:t.top-o,right:t.right-i,bottom:t.bottom-o}}let d=n?"fixed":getComputedStyle(s).position;if(/^(fixed|sticky)$/.test(d))break;s="absolute"==d?s.offsetParent:nl(s)}}function n_(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=nl(r));return t}function nV(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:i,left:o}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=o&&(r.scrollLeft=o)}}let nF=null;function nH(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function nq(e){return e.top<e.bottom||e.left<e.right}function nU(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(nq(e))return e}return Array.prototype.find.call(n,nq)||e.getBoundingClientRect()}let nW=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function nK(e,t,n){let{node:r,offset:i,atom:o}=e.docView.domFromPos(t,n<0?-1:1),s=nP||nE;if(3==r.nodeType)if(s&&(nW.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let e=nU(nd(r,i,i),n);if(nE&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let t=nU(nd(r,i-1,i-1),-1);if(t.top==e.top){let n=nU(nd(r,i,i+1),-1);if(n.top!=e.top)return nJ(n,n.left<t.left)}}return e}else{let e=i,t=i,o=n<0?1:-1;return n<0&&!i?(t++,o=-1):n>=0&&i==r.nodeValue.length?(e--,o=1):n<0?e--:t++,nJ(nU(nd(r,e,t),o),o<0)}if(!e.state.doc.resolve(t-(o||0)).parent.inlineContent){if(null==o&&i&&(n<0||i==nm(r))){let e=r.childNodes[i-1];if(1==e.nodeType)return nG(e.getBoundingClientRect(),!1)}if(null==o&&i<nm(r)){let e=r.childNodes[i];if(1==e.nodeType)return nG(e.getBoundingClientRect(),!0)}return nG(r.getBoundingClientRect(),n>=0)}if(null==o&&i&&(n<0||i==nm(r))){let e=r.childNodes[i-1],t=3==e.nodeType?nd(e,nm(e)-!s):1!=e.nodeType||"BR"==e.nodeName&&e.nextSibling?null:e;if(t)return nJ(nU(t,1),!1)}if(null==o&&i<nm(r)){let e=r.childNodes[i];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?3==e.nodeType?nd(e,0,+!s):1==e.nodeType?e:null:null;if(t)return nJ(nU(t,-1),!0)}return nJ(nU(3==r.nodeType?nd(r):r,-n),n>=0)}function nJ(e,t){if(0==e.width)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function nG(e,t){if(0==e.height)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function nX(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}let nQ=/[\u0590-\u08ac]/,nY=null,nZ=null,n0=!1;class n1{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=0,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let r=this.children[t];if(r==e)return n;n+=r.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,n){let r;if(this.contentDOM&&this.contentDOM.contains(1==e.nodeType?e:e.parentNode))if(n<0){let n,r;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart}else{let n,r;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd}if(e==this.dom&&this.contentDOM)r=t>na(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==t)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(null==r&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return(null==r?n>0:r)?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let i=this.getDesc(r),o;if(i&&(!t||i.node))if(!n||!(o=i.nodeDOM)||(1==o.nodeType?o.contains(1==e.nodeType?e:e.parentNode):o==e))return i;else n=!1}}getDesc(e){let t=e.pmViewDesc;for(let e=t;e;e=e.parent)if(e==this)return t}posFromDOM(e,t,n){for(let r=e;r;r=r.parentNode){let i=this.getDesc(r);if(i)return i.localPosFromDOM(e,t,n)}return -1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let r=this.children[t],i=n+r.size;if(n==e&&i!=n){for(;!r.border&&r.children.length;)for(let e=0;e<r.children.length;e++){let t=r.children[e];if(t.size){r=t;break}}return r}if(e<i)return r.descAt(e-n-r.border);n=i}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,r=0;for(let t=0;n<this.children.length;n++){let i=this.children[n],o=t+i.size;if(o>e||i instanceof n9){r=e-t;break}t=o}if(r)return this.children[n].domFromPos(r-this.children[n].border,t);for(let e;n&&!(e=this.children[n-1]).size&&e instanceof n2&&e.side>=0;n--);if(t<=0){let e,r=!0;for(;(e=n?this.children[n-1]:null)&&e.dom.parentNode!=this.contentDOM;n--,r=!1);return e&&t&&r&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?na(e.dom)+1:0}}{let e,r=!0;for(;(e=n<this.children.length?this.children[n]:null)&&e.dom.parentNode!=this.contentDOM;n++,r=!1);return e&&r&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?na(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(0==this.children.length)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,i=-1;for(let o=n,s=0;;s++){let n=this.children[s],a=o+n.size;if(-1==r&&e<=a){let i=o+n.border;if(e>=i&&t<=a-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,i);e=o;for(let t=s;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=na(n.dom)+1;break}e-=n.size}-1==r&&(r=0)}if(r>-1&&(a>t||s==this.children.length-1)){t=a;for(let e=s+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){i=na(n.dom);break}t+=n.size}-1==i&&(i=this.contentDOM.childNodes.length);break}o=a}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return 0==t.size||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(1!=t.nodeType||n==t.childNodes.length)throw RangeError("No node after pos "+e);return t.childNodes[n]}setSelection(e,t,n,r=!1){let i=Math.min(e,t),o=Math.max(e,t);for(let s=0,a=0;s<this.children.length;s++){let l=this.children[s],c=a+l.size;if(i>a&&o<c)return l.setSelection(e-a-l.border,t-a-l.border,n,r);a=c}let s=this.domFromPos(e,e?-1:1),a=t==e?s:this.domFromPos(t,t?-1:1),l=n.root.getSelection(),c=n.domSelectionRange(),d=!1;if((nE||nj)&&e==t){let{node:e,offset:t}=s;if(3==e.nodeType){if((d=!!(t&&"\n"==e.nodeValue[t-1]))&&t==e.nodeValue.length)for(let t=e,n;t;t=t.parentNode){if(n=t.nextSibling){"BR"==n.nodeName&&(s=a={node:n.parentNode,offset:na(n)+1});break}let e=t.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];d=n&&("BR"==n.nodeName||"false"==n.contentEditable)}}if(nE&&c.focusNode&&c.focusNode!=a.node&&1==c.focusNode.nodeType){let e=c.focusNode.childNodes[c.focusOffset];e&&"false"==e.contentEditable&&(r=!0)}if(!(r||d&&nj)&&nu(s.node,s.offset,c.anchorNode,c.anchorOffset)&&nu(a.node,a.offset,c.focusNode,c.focusOffset))return;let h=!1;if((l.extend||e==t)&&!(d&&nE)){l.collapse(s.node,s.offset);try{e!=t&&l.extend(a.node,a.offset),h=!0}catch(e){}}if(!h){if(e>t){let e=s;s=a,a=e}let n=document.createRange();n.setEnd(a.node,a.offset),n.setStart(s.node,s.offset),l.removeAllRanges(),l.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&"selection"!=e.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,r=0;r<this.children.length;r++){let i=this.children[r],o=n+i.size;if(n==o?e<=o&&t>=n:e<o&&t>n){let r=n+i.border,s=o-i.border;if(e>=r&&t<=s){this.dirty=e==n||t==o?2:1,e==r&&t==s&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=3:i.markDirty(e-r,t-r);return}i.dirty=i.dom!=i.contentDOM||i.dom.parentNode!=this.contentDOM||i.children.length?3:2}n=o}this.dirty=2}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=1==e?2:1;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class n2 extends n1{constructor(e,t,n,r){let i,o=t.type.toDOM;if("function"==typeof o&&(o=o(n,()=>i?i.parent?i.parent.posBeforeChild(i):void 0:r)),!t.type.spec.raw){if(1!=o.nodeType){let e=document.createElement("span");e.appendChild(o),o=e}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=t,this.widget=t,i=this}matchesWidget(e){return 0==this.dirty&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return!!t&&t(e)}ignoreMutation(e){return"selection"!=e.type||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class n3 extends n1{constructor(e,t,n,r){super(e,[],t,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return"characterData"===e.type&&e.target.nodeValue==e.oldValue}}class n5 extends n1{constructor(e,t,n,r,i){super(e,[],n,r),this.mark=t,this.spec=i}
278static create(e,t,n,r){let i=r.nodeViews[t.type.name],o=i&&i(t,r,n);return o&&o.dom||(o=eR.renderSpec(document,t.type.spec.toDOM(t,n),null,t.attrs)),new n5(e,t,o.dom,o.contentDOM||o.dom,o)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return 3!=this.dirty&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),0!=this.dirty){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=0}}slice(e,t,n){let r=n5.create(this.parent,this.mark,!0,n),i=this.children,o=this.size;t<o&&(i=rc(i,t,o,n)),e>0&&(i=rc(i,0,e,n));for(let e=0;e<i.length;e++)i[e].parent=r;return r.children=i,r}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class n4 extends n1{constructor(e,t,n,r,i,o,s,a,l){super(e,[],i,o),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=s}static create(e,t,n,r,i,o){let s=i.nodeViews[t.type.name],a,l=s&&s(t,i,()=>a?a.parent?a.parent.posBeforeChild(a):void 0:o,n,r),c=l&&l.dom,d=l&&l.contentDOM;if(t.isText)if(c){if(3!=c.nodeType)throw RangeError("Text must be rendered as a DOM text node")}else c=document.createTextNode(t.text);else if(!c){let e=eR.renderSpec(document,t.type.spec.toDOM(t),null,t.attrs);({dom:c,contentDOM:d}=e)}d||t.isText||"BR"==c.nodeName||(c.hasAttribute("contenteditable")||(c.contentEditable="false"),t.type.spec.draggable&&(c.draggable=!0));let h=c;return(c=ri(c,n,t),l)?a=new n8(e,t,n,r,c,d||null,h,l,i,o+1):t.isText?new n7(e,t,n,r,c,h,i):new n4(e,t,n,r,c,d||null,h,i,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(e.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>H.empty)}else e.contentElement=this.contentDOM;else e.getContent=()=>this.node.content;return e}matchesNode(e,t,n){return 0==this.dirty&&e.eq(this.node)&&ro(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return+!this.node.isLeaf}updateChildren(e,t){let n=this.node.inlineContent,r=t,i=e.composing?this.localCompositionInfo(e,t):null,o=i&&i.pos>-1?i:null,s=i&&i.pos<0,a=new ra(this,o&&o.node,e);(function(e,t,n,r){let i=t.locals(e),o=0;if(0==i.length){for(let n=0;n<e.childCount;n++){let s=e.child(n);r(s,i,t.forChild(o,s),n),o+=s.nodeSize}return}let s=0,a=[],l=null;for(let c=0;;){let d,h,u,p;for(;s<i.length&&i[s].to==o;){let e=i[s++];e.widget&&(d?(h||(h=[d])).push(e):d=e)}if(d)if(h){h.sort(rl);for(let e=0;e<h.length;e++)n(h[e],c,!!l)}else n(d,c,!!l);if(l)p=-1,u=l,l=null;else if(c<e.childCount)p=c,u=e.child(c++);else break;for(let e=0;e<a.length;e++)a[e].to<=o&&a.splice(e--,1);for(;s<i.length&&i[s].from<=o&&i[s].to>o;)a.push(i[s++]);let f=o+u.nodeSize;if(u.isText){let e=f;s<i.length&&i[s].from<e&&(e=i[s].from);for(let t=0;t<a.length;t++)a[t].to<e&&(e=a[t].to);e<f&&(l=u.cut(e-o),u=u.cut(0,e-o),f=e,p=-1)}else for(;s<i.length&&i[s].to<f;)s++;let m=u.isInline&&!u.isLeaf?a.filter(e=>!e.inline):a.slice();r(u,m,t.forChild(o,u),p),o=f}})(this.node,this.innerDeco,(t,i,o)=>{t.spec.marks?a.syncToMarks(t.spec.marks,n,e,i):t.type.side>=0&&!o&&a.syncToMarks(i==this.node.childCount?K.none:this.node.child(i).marks,n,e,i),a.placeWidget(t,e,r)},(t,o,l,c)=>{let d;a.syncToMarks(t.marks,n,e,c),a.findNodeMatch(t,o,l,c)||s&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(d=a.findIndexWithChild(i.node))>-1&&a.updateNodeAt(t,o,l,d,e)||a.updateNextNode(t,o,l,e,c,r)||a.addNode(t,o,l,e,r),r+=t.nodeSize}),a.syncToMarks([],n,e,0),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||2==this.dirty)&&(o&&this.protectLocalComposition(e,o),function e(t,n,r){let i=t.firstChild,o=!1;for(let s=0;s<n.length;s++){let a=n[s],l=a.dom;if(l.parentNode==t){for(;l!=i;)i=rs(i),o=!0;i=i.nextSibling}else o=!0,t.insertBefore(l,i);if(a instanceof n5){let n=i?i.previousSibling:t.lastChild;e(a.contentDOM,a.children,r),i=n?n.nextSibling:t.firstChild}}for(;i;)i=rs(i),o=!0;o&&r.trackWrites==t&&(r.trackWrites=null)}(this.contentDOM,this.children,e),nI&&function(e){if("UL"==e.nodeName||"OL"==e.nodeName){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}(this.dom))}localCompositionInfo(e,t){let{from:n,to:r}=e.state.selection;if(!(e.state.selection instanceof ty)||n<t||r>t+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(!this.node.inlineContent)return{node:i,pos:-1,text:""};{let e=i.nodeValue,o=function(e,t,n,r){for(let i=0,o=0;i<e.childCount&&o<=r;){let s=e.child(i++),a=o;if(o+=s.nodeSize,!s.isText)continue;let l=s.text;for(;i<e.childCount;){let t=e.child(i++);if(o+=t.nodeSize,!t.isText)break;l+=t.text}
278if(o>=n){if(o>=r&&l.slice(r-t.length-a,r-a)==t)return r-t.length;let e=a<r?l.lastIndexOf(t,r-a-1):-1;if(e>=0&&e+t.length+a>=n)return a+e;if(n==r&&l.length>=r+t.length-a&&l.slice(r-a,r-a+t.length)==t)return r}}return -1}(this.node.content,e,n-t,r-t);return o<0?null:{node:i,pos:o,text:e}}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let i=t;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let o=new n3(this,i,t,r);e.input.compositionNodes.push(o),this.children=rc(this.children,n,n+r.length,e,o)}update(e,t,n,r){return 3!=this.dirty&&!!e.sameMarkup(this.node)&&(this.updateInner(e,t,n,r),!0)}updateInner(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0}updateOuterDeco(e){if(ro(e,this.outerDeco))return;let t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=rr(this.dom,this.nodeDOM,rn(this.outerDeco,this.node,t),rn(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function n6(e,t,n,r,i){ri(r,t,e);let o=new n4(void 0,e,t,n,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class n7 extends n4{constructor(e,t,n,r,i,o,s){super(e,t,n,r,i,null,o,s,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,r){return 3!=this.dirty&&(0==this.dirty||!!this.inParent())&&!!e.sameMarkup(this.node)&&(this.updateOuterDeco(t),(0!=this.dirty||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=0,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return"characterData"!=e.type&&"selection"!=e.type}slice(e,t,n){let r=this.node.cut(e,t),i=document.createTextNode(r.text);return new n7(this.parent,r,this.outerDeco,this.innerDeco,i,i,n)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(0==e||t==this.nodeDOM.nodeValue.length)&&(this.dirty=3)}get domAtom(){return!1}isText(e){return this.node.text==e}}class n9 extends n1{parseRule(){return{ignore:!0}}matchesHack(e){return 0==this.dirty&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class n8 extends n4{constructor(e,t,n,r,i,o,s,a,l,c){super(e,t,n,r,i,o,s,l,c),this.spec=a}update(e,t,n,r){if(3==this.dirty)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,t,n);return i&&this.updateInner(e,t,n,r),i}return(!!this.contentDOM||!!e.isLeaf)&&super.update(e,t,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,r){this.spec.setSelection?this.spec.setSelection(e,t,n.root):super.setSelection(e,t,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}let re=function(e){e&&(this.nodeName=e)};re.prototype=Object.create(null);let rt=[new re];function rn(e,t,n){if(0==e.length)return rt;let r=n?rt[0]:new re,i=[r];for(let o=0;o<e.length;o++){let s=e[o].type.attrs;if(s)for(let e in s.nodeName&&i.push(r=new re(s.nodeName)),s){let o=s[e];null!=o&&(n&&1==i.length&&i.push(r=new re(t.isInline?"span":"div")),"class"==e?r.class=(r.class?r.class+" ":"")+o:"style"==e?r.style=(r.style?r.style+";":"")+o:"nodeName"!=e&&(r[e]=o))}}return i}function rr(e,t,n,r){if(n==rt&&r==rt)return t;let i=t;for(let t=0;t<r.length;t++){let o=r[t],s=n[t];if(t){let t;s&&s.nodeName==o.nodeName&&i!=e&&(t=i.parentNode)&&t.nodeName.toLowerCase()==o.nodeName||((t=document.createElement(o.nodeName)).pmIsDeco=!0,t.appendChild(i),s=rt[0]),i=t}!function(e,t,n){for(let r in t)"class"==r||"style"==r||"nodeName"==r||r in n||e.removeAttribute(r);for(let r in n)"class"!=r&&"style"!=r&&"nodeName"!=r&&n[r]!=t[r]&&e.setAttribute(r,n[r]);
278if(t.class!=n.class){let r=t.class?t.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let t=0;t<r.length;t++)-1==i.indexOf(r[t])&&e.classList.remove(r[t]);for(let t=0;t<i.length;t++)-1==r.indexOf(i[t])&&e.classList.add(i[t]);0==e.classList.length&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let n=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,r;for(;r=n.exec(t.style);)e.style.removeProperty(r[1])}n.style&&(e.style.cssText+=n.style)}}(i,s||rt[0],o)}return i}function ri(e,t,n){return rr(e,e,rt,rn(t,n,1!=e.nodeType))}function ro(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function rs(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class ra{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=function(e,t){let n=t,r=n.children.length,i=e.childCount,o=new Map,s=[];n:for(;i>0;){let a;for(;;)if(r){let e=n.children[r-1];if(e instanceof n5)n=e,r=e.children.length;else{a=e,r--;break}}else if(n==t)break n;else r=n.parent.children.indexOf(n),n=n.parent;let l=a.node;if(l){if(l!=e.child(i-1))break;--i,o.set(a,i),s.push(a)}}return{index:i,matched:o,matches:s.reverse()}}(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n,r){let i=0,o=this.stack.length>>1,s=Math.min(o,e.length);for(;i<s&&(i==o-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&!1!==e[i].type.spec.spanning;)i++;for(;i<o;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let i=-1,s=this.top.children.length;r<this.preMatch.index&&(s=Math.min(this.index+3,s));for(let t=this.index;t<s;t++){let n=this.top.children[t];if(n.matchesMark(e[o])&&!this.isLocked(n.dom)){i=t;break}}if(i>-1)i>this.index&&(this.changed=!0,this.destroyBetween(this.index,i)),this.top=this.top.children[this.index];else{let r=n5.create(this.top,e[o],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,o++}}findNodeMatch(e,t,n,r){let i=-1,o;if(r>=this.preMatch.index&&(o=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&o.matchesNode(e,t,n))i=this.top.children.indexOf(o,this.index);else for(let r=this.index,o=Math.min(this.top.children.length,r+5);r<o;r++){let o=this.top.children[r];if(o.matchesNode(e,t,n)&&!this.preMatch.matched.has(o)){i=r;break}}return!(i<0)&&(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(e,t,n,r,i){let o=this.top.children[r];return 3==o.dirty&&o.dom==o.contentDOM&&(o.dirty=2),!!o.update(e,t,n,i)&&(this.destroyBetween(this.index,r),this.index++,!0)}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return -1;if(t==this.top.contentDOM){let t=e.pmViewDesc;if(t){for(let e=this.index;e<this.top.children.length;e++)if(this.top.children[e]==t)return e}return -1}e=t}}updateNextNode(e,t,n,r,i,o){for(let s=this.index;s<this.top.children.length;s++){let a=this.top.children[s];if(a instanceof n4){let l=this.preMatch.matched.get(a);if(null!=l&&l!=i)return!1;let c=a.dom,d,h=this.isLocked(c)&&!(e.isText&&a.node&&a.node.isText&&a.nodeDOM.nodeValue==e.text&&3!=a.dirty&&ro(t,a.outerDeco));if(!h&&a.update(e,t,n,r))return this.destroyBetween(this.index,s),a.dom!=c&&(this.changed=!0),this.index++,!0;if(!h&&(d=this.recreateWrapper(a,e,t,n,r,o)))return this.destroyBetween(this.index,s),this.top.children[this.index]=d,d.contentDOM&&(d.dirty=2,d.updateChildren(r,o+1),d.dirty=0),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,r,i,o){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!ro(n,e.outerDeco)||!r.eq(e.innerDeco))return null;let s=n4.create(this.top,t,n,r,i,o);if(s.contentDOM)for(let t of(s.children=e.children,e.children=[],s.children))t.parent=s;return e.destroy(),s}addNode(e,t,n,r,i){let o=n4.create(this.top,e,t,n,r,i);o.contentDOM&&o.updateChildren(r,i+1),this.top.children.splice(this.index++,0,o),this.changed=!0}placeWidget(e,t,n){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(r&&r.matchesWidget(e)&&(e==r.widget||!r.widget.type.toDOM.parentNode))this.index++;else{let r=new n2(this.top,e,t,n);this.top.children.splice(this.index++,0,r),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof n5;)e=(t=e).children[t.children.length-1];(!e||!(e instanceof n7)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((nj||nO)&&e&&"false"==e.dom.contentEditable&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);"IMG"==e&&(n.className="ProseMirror-separator",n.alt=""),"BR"==e&&(n.className="ProseMirror-trailingBreak");let r=new n9(this.top,[],n,null);t!=this.top?t.children.push(r):t.children.splice(this.index++,0,r),this.changed=!0}}
278isLocked(e){return this.lock&&(e==this.lock||1==e.nodeType&&e.contains(this.lock.parentNode))}}function rl(e,t){return e.type.side-t.type.side}function rc(e,t,n,r,i){let o=[];for(let s=0,a=0;s<e.length;s++){let l=e[s],c=a,d=a+=l.size;c>=n||d<=t?o.push(l):(c<t&&o.push(l.slice(0,t-c,r)),i&&(o.push(i),i=void 0),d>n&&o.push(l.slice(n-c,l.size,r)))}return o}function rd(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),o=i&&0==i.size,s=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a=r.resolve(s),l,c;if(ny(n)){for(l=s;i&&!i.node;)i=i.parent;let e=i.node;if(i&&e.isAtom&&tx.isSelectable(e)&&i.parent&&!(e.isInline&&function(e,t,n){for(let r=0==t,i=t==nm(e);r||i;){if(e==n)return!0;let t=na(e);if(!(e=e.parentNode))return!1;r=r&&0==t,i=i&&t==nm(e)}}(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;c=new tx(s==e?a:r.resolve(e))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let t=s,i=s;for(let r=0;r<n.rangeCount;r++){let o=n.getRangeAt(r);t=Math.min(t,e.docView.posFromDOM(o.startContainer,o.startOffset,1)),i=Math.max(i,e.docView.posFromDOM(o.endContainer,o.endOffset,-1))}if(t<0)return null;[l,s]=i==e.state.selection.anchor?[i,t]:[t,i],a=r.resolve(s)}else l=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(l<0)return null}let d=r.resolve(l);if(!c){let n="pointer"==t||e.state.selection.head<a.pos&&!o?1:-1;c=rx(e,d,a,n)}return c}function rh(e){return e.editable?e.hasFocus():rw(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function ru(e,t=!1){let n=e.state.selection;if(ry(e,n),rh(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&nO){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&nu(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset)){e.input.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)!function(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r="IMG"==n.nodeName;r?t.collapse(n.parentNode,na(n)+1):t.collapse(n,0),!r&&!e.state.selection.visible&&nC&&nN<=11&&(n.disabled=!0,n.disabled=!1)}(e);else{var r;let i,o,s,a,{anchor:l,head:c}=n,d,h;rp&&!(n instanceof ty)&&(n.$from.parent.inlineContent||(d=rf(e,n.from)),n.empty||n.$from.parent.inlineContent||(h=rf(e,n.to))),e.docView.setSelection(l,c,e,t),rp&&(d&&rg(d),h&&rg(h)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&((i=(r=e).dom.ownerDocument).removeEventListener("selectionchange",r.input.hideSelectionGuard),s=(o=r.domSelectionRange()).anchorNode,a=o.anchorOffset,i.addEventListener("selectionchange",r.input.hideSelectionGuard=()=>{(o.anchorNode!=s||o.anchorOffset!=a)&&(i.removeEventListener("selectionchange",r.input.hideSelectionGuard),setTimeout(()=>{(!rh(r)||r.state.selection.visible)&&r.dom.classList.remove("ProseMirror-hideselection")},20))})))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}let rp=nj||nO&&nA<63;function rf(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,o=r?n.childNodes[r-1]:null;if(nj&&i&&"false"==i.contentEditable)return rm(i);if((!i||"false"==i.contentEditable)&&(!o||"false"==o.contentEditable)){if(i)return rm(i);else if(o)return rm(o)}}function rm(e){return e.contentEditable="true",nj&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function rg(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function ry(e,t){if(t instanceof tx){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(rb(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else rb(e)}function rb(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function rx(e,t,n,r){return e.someProp("createSelectionBetween",r=>r(e,t,n))||ty.between(t,n,r)}function rv(e){return(!e.editable||!!e.hasFocus())&&rw(e)}function rw(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(3==t.anchorNode.nodeType?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(3==t.focusNode.nodeType?t.focu
278sNode.parentNode:t.focusNode))}catch(e){return!1}}function rk(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return o&&tp.findFrom(o,t)}function rS(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function rM(e,t,n){let r=e.state.selection;if(r instanceof ty){if(n.indexOf("s")>-1){let{$head:n}=r,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let o=e.state.doc.resolve(n.pos+i.nodeSize*(t<0?-1:1));return rS(e,new ty(r.$anchor,o))}else if(!r.empty)return!1;else if(e.endOfTextblock(t>0?"forward":"backward")){let n=rk(e.state,t);return!!n&&n instanceof tx&&rS(e,n)}else if(!(nD&&n.indexOf("m")>-1)){let n=r.$head,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter,o;if(!i||i.isText)return!1;let s=t<0?n.pos-i.nodeSize:n.pos;return!!(i.isAtom||(o=e.docView.descAt(s))&&!o.contentDOM)&&(tx.isSelectable(i)?rS(e,new tx(t<0?e.state.doc.resolve(n.pos-i.nodeSize):n)):!!nP&&rS(e,new ty(e.state.doc.resolve(t<0?s:s+i.nodeSize))))}}else{if(r instanceof tx&&r.node.isInline)return rS(e,new ty(t>0?r.$to:r.$from));let n=rk(e.state,t);return!!n&&rS(e,n)}}function rC(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function rN(e,t){let n=e.pmViewDesc;return n&&0==n.size&&(t<0||e.nextSibling||"BR"!=e.nodeName)}function rE(e,t){return t<0?function(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,s=!1;for(nE&&1==n.nodeType&&r<rC(n)&&rN(n.childNodes[r],-1)&&(s=!0);;)if(r>0)if(1!=n.nodeType)break;else{let e=n.childNodes[r-1];if(rN(e,-1))i=n,o=--r;else if(3==e.nodeType)r=(n=e).nodeValue.length;else break}else if(rT(n))break;else{let t=n.previousSibling;for(;t&&rN(t,-1);)i=n.parentNode,o=na(t),t=t.previousSibling;if(t)r=rC(n=t);else{if((n=n.parentNode)==e.dom)break;r=0}}s?rO(e,n,r):i&&rO(e,i,o)}(e):function(e){let t,n,r=e.domSelectionRange(),i=r.focusNode,o=r.focusOffset;if(!i)return;let s=rC(i);for(;;)if(o<s){if(1!=i.nodeType)break;if(rN(i.childNodes[o],1))t=i,n=++o;else break}else if(rT(i))break;else{let r=i.nextSibling;for(;r&&rN(r,1);)t=r.parentNode,n=na(r)+1,r=r.nextSibling;if(r)o=0,s=rC(i=r);else{if((i=i.parentNode)==e.dom)break;o=s=0}}t&&rO(e,t,n)}(e)}function rT(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function rO(e,t,n){if(3!=t.nodeType){let e,r;(r=function(e,t){for(;e&&t==e.childNodes.length&&!ng(e);)t=na(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;e=n,t=0}}(t,n))?(t=r,n=0):(e=function(e,t){for(;e&&!t&&!ng(e);)t=na(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;t=(e=n).childNodes.length}}(t,n))&&(t=e,n=e.nodeValue.length)}let r=e.domSelection();if(!r)return;if(ny(r)){let e=document.createRange();e.setEnd(t,n),e.setStart(t,n),r.removeAllRanges(),r.addRange(e)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:i}=e;setTimeout(()=>{e.state==i&&ru(e)},50)}function rA(e,t){let n=e.state.doc.resolve(t);if(!(nO||nR)&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left<r.left?"ltr":"rtl"}if(t<n.end()){let n=e.coordsAtPos(t+1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left>r.left?"ltr":"rtl"}}return"rtl"==getComputedStyle(e.dom).direction?"rtl":"ltr"}function rj(e,t,n){let r=e.state.selection;if(r instanceof ty&&!r.empty||n.indexOf("s")>-1||nD&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=rk(e.state,t);if(n&&n instanceof tx)return rS(e,n)}if(!i.parent.inlineContent){let n=t<0?i:o,s=r instanceof tw?tp.near(n,t):tp.findFrom(n,t);return!!s&&rS(e,s)}return!1}function rI(e,t){if(!(e.state.selection instanceof ty))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let o=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let r=e.state.tr;return t<0?r.delete(n.pos-o.nodeSize,n.pos):r.delete(n.pos,n.pos+o.nodeSize),e.dispatch(r),!0}return!1}function rD(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function rR(e,t){e.someProp("transformCopied",n=>{t=n(t,e)});let n=[],{content:r,openStart:i,openEnd:o}=t;for(;i>1&&o>1&&1==r.childCount&&1==r.firstChild.childCount;){i--,o--;let e=r.firstChild;
278n.push(e.type.name,e.attrs!=e.type.defaultAttrs?e.attrs:null),r=e.content}let s=e.someProp("clipboardSerializer")||eR.fromSchema(e.state.schema),a=rF(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let c=l.firstChild,d,h=0;for(;c&&1==c.nodeType&&(d=r_[c.nodeName.toLowerCase()]);){for(let e=d.length-1;e>=0;e--){let t=a.createElement(d[e]);for(;l.firstChild;)t.appendChild(l.firstChild);l.appendChild(t),h++}c=l.firstChild}return c&&1==c.nodeType&&c.setAttribute("data-pm-slice",`${i} ${o}${h?` -${h}`:""} ${JSON.stringify(n)}`),{dom:l,text:e.someProp("clipboardTextSerializer",n=>n(t,e))||t.content.textBetween(0,t.content.size,"\n\n"),slice:t}}function rL(e,t,n,r,i){let o,s,a=i.parent.type.spec.code;if(!n&&!t)return null;let l=!!t&&(r||a||!n);if(l){if(e.someProp("transformPastedText",n=>{t=n(t,a||r,e)}),a)return s=new G(H.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0),e.someProp("transformPasted",t=>{s=t(s,e,!0)}),s;let n=e.someProp("clipboardTextParser",n=>n(t,i,r,e));if(n)s=n;else{let n=i.marks(),{schema:r}=e.state,s=eR.fromSchema(r);o=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(e=>{let t=o.appendChild(document.createElement("p"));e&&t.appendChild(s.serializeNode(r.text(e,n)))})}}else e.someProp("transformPastedHTML",t=>{n=t(n,e)}),o=function(e){var t;let n,r=/^(\s*<meta [^>]*>)*/.exec(e);r&&(e=e.slice(r[0].length));let i=rF().createElement("div"),o=/<([a-z][^>\s]+)/i.exec(e),s;if((s=o&&r_[o[1].toLowerCase()])&&(e=s.map(e=>"<"+e+">").join("")+e+s.map(e=>"</"+e+">").reverse().join("")),i.innerHTML=(t=e,(n=window.trustedTypes)?(rH||(rH=n.defaultPolicy||n.createPolicy("ProseMirrorClipboard",{createHTML:e=>e})),rH.createHTML(t)):t),s)for(let e=0;e<s.length;e++)i=i.querySelector(s[e])||i;return i}(n),nP&&function(e){let t=e.querySelectorAll(nO?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];1==r.childNodes.length&&" "==r.textContent&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}(o);let c=o&&o.querySelector("[data-pm-slice]"),d=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(d&&d[3])for(let e=+d[3];e>0;e--){let e=o.firstChild;for(;e&&1!=e.nodeType;)e=e.nextSibling;if(!e)break;o=e}if(s||(s=(e.someProp("clipboardParser")||e.someProp("domParser")||eC.fromSchema(e.state.schema)).parseSlice(o,{preserveWhitespace:!!(l||d),context:i,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||rP.test(e.parentNode.nodeName)?null:{ignore:!0}})),d)s=function(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,r;try{r=JSON.parse(t)}catch(t){return e}let{content:i,openStart:o,openEnd:s}=e;for(let e=r.length-2;e>=0;e-=2){let t=n.nodes[r[e]];if(!t||t.hasRequiredAttrs())break;i=H.from(t.create(r[e+1],i)),o++,s++}return new G(i,o,s)}(r$(s,+d[1],+d[2]),d[4]);else if((s=G.maxOpen(function(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.index(n)),i,o=[];if(e.forEach(e=>{if(!o)return;let t=r.findWrapping(e.type),n;if(!t)return o=null;if(n=o.length&&i.length&&function e(t,n,r,i,o){if(o<t.length&&o<n.length&&t[o]==n[o]){let s=e(t,n,r,i.lastChild,o+1);if(s)return i.copy(i.content.replaceChild(i.childCount-1,s));if(i.contentMatchAt(i.childCount).matchType(o==t.length-1?r.type:t[o+1]))return i.copy(i.content.append(H.from(rB(r,t,o+1))))}}(t,i,e,o[o.length-1],0))o[o.length-1]=n;else{o.length&&(o[o.length-1]=function e(t,n){if(0==n)return t;let r=t.content.replaceChild(t.childCount-1,e(t.lastChild,n-1)),i=t.contentMatchAt(t.childCount).fillBefore(H.empty,!0);return t.copy(r.append(i))}(o[o.length-1],i.length));let n=rB(e,t);o.push(n),r=r.matchType(n.type),i=t}}),o)return H.from(o)}return e}(s.content,i),!0)).openStart||s.openEnd){let e=0,t=0;for(let t=s.content.firstChild;e<s.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=s.content.lastChild;t<s.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);s=r$(s,e,t)}return e.someProp("transformPasted",t=>{s=t(s,e,l)}),s}let rP=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function rB(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,H.from(e));return e}
278function rz(e,t,n,r,i,o){let s=t<0?e.firstChild:e.lastChild,a=s.content;return e.childCount>1&&(o=0),i<r-1&&(a=rz(a,t,n,r,i+1,o)),i>=n&&(a=t<0?s.contentMatchAt(0).fillBefore(a,o<=i).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(H.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(a))}function r$(e,t,n){return t<e.openStart&&(e=new G(rz(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new G(rz(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}let r_={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]},rV=null;function rF(){return rV||(rV=document.implementation.createHTMLDocument("title"))}let rH=null,rq={},rU={},rW={touchstart:!0,touchmove:!0};class rK{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function rJ(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function rG(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>rX(e,t))})}function rX(e,t){return e.someProp("handleDOMEvents",n=>{let r=n[t.type];return!!r&&(r(e,t)||t.defaultPrevented)})}function rQ(e){return{left:e.clientX,top:e.clientY}}function rY(e,t,n,r,i){if(-1==r)return!1;let o=e.state.doc.resolve(r);for(let r=o.depth+1;r>0;r--)if(e.someProp(t,t=>r>o.depth?t(e,n,o.nodeAfter,o.before(r),i,!0):t(e,n,o.node(r),o.before(r),i,!1)))return!0;return!1}function rZ(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);"pointer"==n&&r.setMeta("pointer",!0),e.dispatch(r)}rU.keydown=(e,t)=>{if((e.input.shiftKey=16==t.keyCode||t.shiftKey,!r2(e,t))&&(e.input.lastKeyCode=t.keyCode,e.input.lastKeyCodeTime=Date.now(),!nL||!nO||13!=t.keyCode))if(229!=t.keyCode&&e.domObserver.forceFlush(),!nI||13!=t.keyCode||t.ctrlKey||t.altKey||t.metaKey)e.someProp("handleKeyDown",n=>n(e,t))||function(e,t){let n,r=t.keyCode,i=(n="",t.ctrlKey&&(n+="c"),t.metaKey&&(n+="m"),t.altKey&&(n+="a"),t.shiftKey&&(n+="s"),n);if(8==r||nD&&72==r&&"c"==i)return rI(e,-1)||rE(e,-1);if(46==r&&!t.shiftKey||nD&&68==r&&"c"==i)return rI(e,1)||rE(e,1);if(13==r||27==r)return!0;if(37==r||nD&&66==r&&"c"==i){let t=37==r?"ltr"==rA(e,e.state.selection.from)?-1:1:-1;return rM(e,t,i)||rE(e,t)}if(39==r||nD&&70==r&&"c"==i){let t=39==r?"ltr"==rA(e,e.state.selection.from)?1:-1:1;return rM(e,t,i)||rE(e,t)}else if(38==r||nD&&80==r&&"c"==i)return rj(e,-1,i)||rE(e,-1);else if(40==r||nD&&78==r&&"c"==i)return function(e){if(!nj||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&1==t.nodeType&&0==n&&t.firstChild&&"false"==t.firstChild.contentEditable){let n=t.firstChild;rD(e,n,"true"),setTimeout(()=>rD(e,n,"false"),20)}return!1}(e)||rj(e,1,i)||rE(e,1);else if(i==(nD?"m":"c")&&(66==r||73==r||89==r||90==r))return!0;return!1}(e,t)?t.preventDefault():rJ(e,"key");else{let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==t&&(e.someProp("handleKeyDown",t=>t(e,nb(13,"Enter"))),e.input.lastIOSEnter=0)},200)}},rU.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},rU.keypress=(e,t)=>{if(r2(e,t)||!t.charCode||t.ctrlKey&&!t.altKey||nD&&t.metaKey)return;if(e.someProp("handleKeyPress",n=>n(e,t)))return void t.preventDefault();let n=e.state.selection;if(!(n instanceof ty)||!n.$from.sameParent(n.$to)){let r=String.fromCharCode(t.charCode),i=()=>e.state.tr.insertText(r).scrollIntoView();/[\r\n]/.test(r)||e.someProp("handleTextInput",t=>t(e,n.$from.pos,n.$to.pos,r,i))||e.dispatch(i()),t.preventDefault()}};let r0=nD?"metaKey":"ctrlKey";rq.mousedown=(e,t)=>{var n;let r,i;e.input.shiftKey=t.shiftKey;let o=r6(e),s=Date.now(),a="singleClick";
278s-e.input.lastClick.time<500&&(r=(n=e.input.lastClick).x-t.clientX)*r+(i=n.y-t.clientY)*i<100&&!t[r0]&&e.input.lastClick.button==t.button&&("singleClick"==e.input.lastClick.type?a="doubleClick":"doubleClick"==e.input.lastClick.type&&(a="tripleClick")),e.input.lastClick={time:s,x:t.clientX,y:t.clientY,type:a,button:t.button};let l=e.posAtCoords(rQ(t));l&&("singleClick"==a?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new r1(e,l,t,!!o)):("doubleClick"==a?function(e,t,n,r){return rY(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",n=>n(e,t,r))}:function(e,t,n,r){return rY(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",n=>n(e,t,r))||function(e,t,n){if(0!=n.button)return!1;let r=e.state.doc;if(-1==t)return!!r.inlineContent&&(rZ(e,ty.create(r,0,r.content.size),"pointer"),!0);let i=r.resolve(t);for(let t=i.depth+1;t>0;t--){let n=t>i.depth?i.nodeAfter:i.node(t),o=i.before(t);if(n.inlineContent)rZ(e,ty.create(r,o+1,o+1+n.content.size),"pointer");else{if(!tx.isSelectable(n))continue;rZ(e,tx.create(r,o),"pointer")}return!0}}(e,n,r)})(e,l.pos,l.inside,t)?t.preventDefault():rJ(e,"pointer"))};class r1{constructor(e,t,n,r){let i,o;if(this.view=e,this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[r0],this.allowDefault=n.shiftKey,t.inside>-1)i=e.state.doc.nodeAt(t.inside),o=t.inside;else{let n=e.state.doc.resolve(t.pos);i=n.parent,o=n.depth?n.before():0}const s=r?null:n.target,a=s?e.docView.nearestDesc(s,!0):null;this.target=a&&1==a.nodeDOM.nodeType?a.nodeDOM:null;let{selection:l}=e.state;(0==n.button&&i.type.spec.draggable&&!1!==i.type.spec.selectable||l instanceof tx&&l.from<=o&&l.to>o)&&(this.mightDrag={node:i,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&nE&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),rJ(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>ru(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;if(this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(rQ(e))),this.updateAllowDefault(e),this.allowDefault||!t)rJ(this.view,"pointer");else{var n,r,i,o;(n=this.view,r=t.pos,i=t.inside,o=this.selectNode,rY(n,"handleClickOn",r,i,e)||n.someProp("handleClick",t=>t(n,r,e))||(o?function(e,t){if(-1==t)return!1;let n=e.state.selection,r,i;n instanceof tx&&(r=n.node);let o=e.state.doc.resolve(t);for(let e=o.depth+1;e>0;e--){let t=e>o.depth?o.nodeAfter:o.node(e);if(tx.isSelectable(t)){i=r&&n.$from.depth>0&&e>=n.$from.depth&&o.before(n.$from.depth+1)==n.$from.pos?o.before(n.$from.depth):o.before(e);break}}return null!=i&&(rZ(e,tx.create(e.state.doc,i),"pointer"),!0)}(n,i):function(e,t){if(-1==t)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return!!(r&&r.isAtom&&tx.isSelectable(r))&&(rZ(e,new tx(n),"pointer"),!0)}(n,i)))?e.preventDefault():0==e.button&&(this.flushed||nj&&this.mightDrag&&!this.mightDrag.node.isAtom||nO&&!this.view.state.selection.visible&&2>=Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to)))?(rZ(this.view,tp.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):rJ(this.view,"pointer")}}move(e){this.updateAllowDefault(e),rJ(this.view,"pointer"),0==e.buttons&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}function r2(e,t){return!!e.composing||!!(nj&&500>Math.abs(t.timeStamp-e.input.compositionEndedAt))&&(e.input.compositionEndedAt=-2e8,!0)}rq.touchstart=e=>{e.input.lastTouch=Date.now(),r6(e),rJ(e,"pointer")},rq.touchmove=e=>{e.input.lastTouch=Date.now(),rJ(e,"pointer")},rq.contextmenu=e=>r6(e);let r3=nL?5e3:-1;function r5(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>r6(e),t))}function r4(e){let t;for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=((t=document.createEvent("Event")).initEvent("event",!0,!0),t.timeStamp));e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function r6(e,t=!1){if(!nL||!(e.domObserver.flushingSoon>
278=0)){if(e.domObserver.forceFlush(),r4(e),t||e.docView&&e.docView.dirty){let n=rd(e),r=e.state.selection;return n&&!n.eq(r)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}rU.compositionstart=rU.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof ty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(e=>!1===e.type.spec.inclusive)||nO&&nR&&function(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||1!=t.nodeType||n>=t.childNodes.length)return!1;let r=t.childNodes[n];return 1==r.nodeType&&"false"==r.contentEditable}(e)))e.markCursor=e.state.storedMarks||n.marks(),r6(e,!0),e.markCursor=null;else if(r6(e,!t.selection.empty),nE&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&1==n.nodeType&&0!=r;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(3==t.nodeType){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break}n=t,r=-1}}e.input.composing=!0}r5(e,r3)},rU.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,r5(e,20))};let r7=nC&&nN<15||nI&&nB<604;function r9(e,t,n,r,i){let o=rL(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",t=>t(e,i,o||G.empty)))return!0;if(!o)return!1;let s=0==o.openStart&&0==o.openEnd&&1==o.content.childCount?o.content.firstChild:null,a=s?e.state.tr.replaceSelectionWith(s,r):e.state.tr.replaceSelection(o);return e.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function r8(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;let n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}rq.copy=rU.cut=(e,t)=>{let n=e.state.selection,r="cut"==t.type;if(n.empty)return;let i=r7?null:t.clipboardData,{dom:o,text:s}=rR(e,n.content());i?(t.preventDefault(),i.clearData(),i.setData("text/html",o.innerHTML),i.setData("text/plain",s)):function(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}(e,o),r&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},rU.paste=(e,t)=>{if(e.composing&&!nL)return;let n=r7?null:t.clipboardData,r=e.input.shiftKey&&45!=e.input.lastKeyCode;n&&r9(e,r8(n),n.getData("text/html"),r,t)?t.preventDefault():function(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=e.input.shiftKey&&45!=e.input.lastKeyCode;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?r9(e,r.value,null,i,t):r9(e,r.textContent,r.innerHTML,i,t)},50)}(e,t)};class ie{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}}let it=nD?"altKey":"ctrlKey";function ir(e,t){let n=e.someProp("dragCopies",e=>!e(t));return null!=n?n:!t[it]}for(let e in rq.dragstart=(e,t)=>{let n,r=e.input.mouseDown;if(r&&r.done(),!t.dataTransfer)return;let i=e.state.selection,o=i.empty?null:e.posAtCoords(rQ(t));if(o&&o.pos>=i.from&&o.pos<=(i instanceof tx?i.to-1:i.to));else if(r&&r.mightDrag)n=tx.create(e.state.doc,r.mightDrag.pos);else if(t.target&&1==t.target.nodeType){let r=e.docView.nearestDesc(t.target,!0);r&&r.node.type.spec.draggable&&r!=e.docView&&(n=tx.create(e.state.doc,r.posBefore))}
vendor: 4,330 bytes, line 278
278let s=(n||e.state.selection).content(),{dom:a,text:l,slice:c}=rR(e,s);t.dataTransfer.files.length&&nO&&!(nA>120)||t.dataTransfer.clearData(),t.dataTransfer.setData(r7?"Text":"text/html",a.innerHTML),t.dataTransfer.effectAllowed="copyMove",r7||t.dataTransfer.setData("text/plain",l),e.dragging=new ie(c,ir(e,t),n)},rq.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},rU.dragover=rU.dragenter=(e,t)=>t.preventDefault(),rU.drop=(e,t)=>{try{!function(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(rQ(t));if(!r)return;let i=e.state.doc.resolve(r.pos),o=n&&n.slice;o?e.someProp("transformPasted",t=>{o=t(o,e,!1)}):o=rL(e,r8(t.dataTransfer),r7?null:t.dataTransfer.getData("text/html"),!1,i);let s=!!(n&&ir(e,t));if(e.someProp("handleDrop",n=>n(e,t,o||G.empty,s)))return t.preventDefault();if(!o)return;t.preventDefault();let a=o?e8(e.state.doc,i.pos,o):i.pos;null==a&&(a=i.pos);let l=e.state.tr;if(s){let{node:e}=n;e?e.replace(l):l.deleteSelection()}let c=l.mapping.map(a),d=0==o.openStart&&0==o.openEnd&&1==o.content.childCount,h=l.doc;if(d?l.replaceRangeWith(c,c,o.content.firstChild):l.replaceRange(c,c,o),l.doc.eq(h))return;let u=l.doc.resolve(c);if(d&&tx.isSelectable(o.content.firstChild)&&u.nodeAfter&&u.nodeAfter.sameMarkup(o.content.firstChild))l.setSelection(new tx(u));else{let t=l.mapping.map(a);l.mapping.maps[l.mapping.maps.length-1].forEach((e,n,r,i)=>t=i),l.setSelection(rx(e,u,l.doc.resolve(t)))}e.focus(),e.dispatch(l.setMeta("uiEvent","drop"))}(e,t,e.dragging)}finally{e.dragging=null}},rq.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&ru(e)},20))},rq.blur=(e,t)=>{e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),t.relatedTarget&&e.dom.contains(t.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)},rq.beforeinput=(e,t)=>{if(nO&&nL&&"deleteContentBackward"==t.inputType){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=t||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",t=>t(e,nb(8,"Backspace")))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())},50)}},rU)rq[e]=rU[e];function ii(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class io{constructor(e,t){this.toDOM=e,this.spec=t||id,this.side=this.spec.side||0}map(e,t,n,r){let{pos:i,deleted:o}=e.mapResult(t.from+r,this.side<0?-1:1);return o?null:new il(i-n,i-n,this)}valid(){return!0}eq(e){return this==e||e instanceof io&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&ii(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class is{constructor(e,t){this.attrs=e,this.spec=t||id}map(e,t,n,r){let i=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,o=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=o?null:new il(i,o,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof is&&ii(this.attrs,e.attrs)&&ii(this.spec,e.spec)}static is(e){return e.type instanceof is}destroy(){}}class ia{constructor(e,t){this.attrs=e,this.spec=t||id}map(e,t,n,r){let i=e.mapResult(t.from+r,1);if(i.deleted)return null;let o=e.mapResult(t.to+r,-1);return o.deleted||o.pos<=i.pos?null:new il(i.pos-n,o.pos-n,this)}valid(e,t){let{index:n,offset:r}=e.content.findIndex(t.from),i;return r==t.from&&!(i=e.child(n)).isText&&r+i.nodeSize==t.to}eq(e){return this==e||e instanceof ia&&ii(this.attrs,e.attrs)&&ii(this.spec,e.spec)}destroy(){}}class il{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(e,t){return new il(e,t,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,n){return this.type.map(e,this,t,n)}static widget(e,t,n){return new il(e,e,new io(t,n))}static inline(e,t,n,r){return new il(e,t,new is(n,r))}static node(e,t,n,r){return new il(e,t,new ia(n,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof is}get widget(){return this.type instanceof io}}let ic=[],id={};class ih{constructor(e,t){this.local=e.length?e:ic,this.children=t.length?t:ic}
vendor: 5,129 bytes, line 278
278static create(e,t){return t.length?ib(t,e,0,id):iu}find(e,t,n){let r=[];return this.findInner(null==e?0:e,null==t?1e9:t,r,0,n),r}findInner(e,t,n,r,i){for(let o=0;o<this.local.length;o++){let s=this.local[o];s.from<=t&&s.to>=e&&(!i||i(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<t&&this.children[o+1]>e){let s=this.children[o]+1;this.children[o+2].findInner(e-s,t-s,n,r+s,i)}}map(e,t,n){return this==iu||0==e.maps.length?this:this.mapInner(e,t,0,0,n||id)}mapInner(e,t,n,r,i){let o;for(let s=0;s<this.local.length;s++){let a=this.local[s].map(e,n,r);a&&a.type.valid(t,a)?(o||(o=[])).push(a):i.onRemove&&i.onRemove(this.local[s].spec)}return this.children.length?function(e,t,n,r,i,o,s){let a=e.slice();for(let e=0,t=o;e<n.maps.length;e++){let r=0;n.maps[e].forEach((e,n,i,o)=>{let s=o-i-(n-e);for(let i=0;i<a.length;i+=3){let o=a[i+1];if(o<0||e>o+t-r)continue;let l=a[i]+t-r;n>=l?a[i+1]=e<=l?-2:-1:e>=t&&s&&(a[i]+=s,a[i+1]+=s)}r+=s}),t=n.maps[e].map(t,-1)}let l=!1;for(let t=0;t<a.length;t+=3)if(a[t+1]<0){if(-2==a[t+1]){l=!0,a[t+1]=-1;continue}let c=n.map(e[t]+o),d=c-i;if(d<0||d>=r.content.size){l=!0;continue}let h=n.map(e[t+1]+o,-1)-i,{index:u,offset:p}=r.content.findIndex(d),f=r.maybeChild(u);if(f&&p==d&&p+f.nodeSize==h){let r=a[t+2].mapInner(n,f,c+1,e[t]+o+1,s);r!=iu?(a[t]=d,a[t+1]=h,a[t+2]=r):(a[t+1]=-2,l=!0)}else l=!0}if(l){let l=ib(function(e,t,n,r,i,o,s){for(let a=0;a<e.length;a+=3)-1==e[a+1]&&function e(t,o){for(let e=0;e<t.local.length;e++){let a=t.local[e].map(r,i,o);a?n.push(a):s.onRemove&&s.onRemove(t.local[e].spec)}for(let n=0;n<t.children.length;n+=3)e(t.children[n+2],t.children[n]+o+1)}(e[a+2],t[a]+o+1);return n}(a,e,t,n,i,o,s),r,0,s);t=l.local;for(let e=0;e<a.length;e+=3)a[e+1]<0&&(a.splice(e,3),e-=3);for(let e=0,t=0;e<l.children.length;e+=3){let n=l.children[e];for(;t<a.length&&a[t]<n;)t+=3;a.splice(t,0,l.children[e],l.children[e+1],l.children[e+2])}}return new ih(t.sort(ix),a)}(this.children,o||[],e,t,n,r,i):o?new ih(o.sort(ix),ic):iu}add(e,t){return t.length?this==iu?ih.create(e,t):this.addInner(e,t,0):this}addInner(e,t,n){let r,i=0;e.forEach((e,o)=>{let s=o+n,a;if(a=ig(t,e,s)){for(r||(r=this.children.slice());i<r.length&&r[i]<o;)i+=3;r[i]==o?r[i+2]=r[i+2].addInner(e,a,s+1):r.splice(i,0,o,o+e.nodeSize,ib(a,e,s+1,id)),i+=3}});let o=im(i?iy(t):t,-n);for(let t=0;t<o.length;t++)o[t].type.valid(e,o[t])||o.splice(t--,1);return new ih(o.length?this.local.concat(o).sort(ix):this.local,r||this.children)}remove(e){return 0==e.length||this==iu?this:this.removeInner(e,0)}removeInner(e,t){let n=this.children,r=this.local;for(let r=0;r<n.length;r+=3){let i,o=n[r]+t,s=n[r+1]+t;for(let t=0,n;t<e.length;t++)(n=e[t])&&n.from>o&&n.to<s&&(e[t]=null,(i||(i=[])).push(n));if(!i)continue;n==this.children&&(n=this.children.slice());let a=n[r+2].removeInner(i,o+1);a!=iu?n[r+2]=a:(n.splice(r,3),r-=3)}if(r.length){for(let n=0,i;n<e.length;n++)if(i=e[n])for(let e=0;e<r.length;e++)r[e].eq(i,t)&&(r==this.local&&(r=this.local.slice()),r.splice(e--,1))}return n==this.children&&r==this.local?this:r.length||n.length?new ih(r,n):iu}forChild(e,t){let n,r;if(this==iu)return this;if(t.isLeaf)return ih.empty;for(let t=0;t<this.children.length;t+=3)if(this.children[t]>=e){this.children[t]==e&&(n=this.children[t+2]);break}let i=e+1,o=i+t.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<o&&t.to>i&&t.type instanceof is){let e=Math.max(i,t.from)-i,n=Math.min(o,t.to)-i;e<n&&(r||(r=[])).push(t.copy(e,n))}}if(r){let e=new ih(r.sort(ix),ic);return n?new ip([e,n]):e}return n||iu}eq(e){if(this==e)return!0;if(!(e instanceof ih)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return iv(this.localsInner(e))}localsInner(e){if(this==iu)return ic;if(e.inlineContent||!this.local.some(is.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof is||t.push(this.local[e]);return t}forEachSet(e){e(this)}}ih.empty=new ih([],[]),ih.removeOverlap=iv;let iu=ih.empty;class ip{constructor(e){this.members=e}map(e,t){let n=this.members.map(n=>n.map(e,t,id));return ip.from(n)}forChild(e,t){if(t.isLeaf)return ih.empty;let n=[];for(let r=0;r<this.members.length;r++){let i=this.members[r].forChild(e,t);i!=iu&&(i instanceof ip?n=n.concat(i.members):n.push(i))}return ip.from(n)}eq(e){if(!(e instanceof ip)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,n=!0;for(let r=0;r<this.members.length;r++){let i=this.members[r].localsInner(e);if(i.length)if(t){n&&(t=t.slice(),n=!1);for(let e=0;e<i.length;e++)t.push(i[e])}else t=i}return t?iv(n?t:t.sort(ix)):ic}static from(e){switch(e.length){case 0:return iu;case 1:return e[0];default:return new ip(e.every(e=>e instanceof ih)?e:e.reduce((e,t)=>
vendor: 4,095 bytes, line 278
278e.concat(t instanceof ih?t:t.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}}function im(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.push(new il(i.from+t,i.to+t,i.type))}return n}function ig(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let t=0,o;t<e.length;t++)(o=e[t])&&o.from>n&&o.to<r&&((i||(i=[])).push(o),e[t]=null);return i}function iy(e){let t=[];for(let n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function ib(e,t,n,r){let i=[],o=!1;t.forEach((t,s)=>{let a=ig(e,t,s+n);if(a){o=!0;let e=ib(a,t,n+s+1,r);e!=iu&&i.push(s,s+t.nodeSize,e)}});let s=im(o?iy(e):e,-n).sort(ix);for(let e=0;e<s.length;e++)s[e].type.valid(t,s[e])||(r.onRemove&&r.onRemove(s[e].spec),s.splice(e--,1));return s.length||i.length?new ih(s,i):iu}function ix(e,t){return e.from-t.from||e.to-t.to}function iv(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let i=n+1;i<t.length;i++){let o=t[i];if(o.from==r.from){o.to!=r.to&&(t==e&&(t=e.slice()),t[i]=o.copy(o.from,r.to),iw(t,i+1,o.copy(r.to,o.to)));continue}o.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,o.from),iw(t,i,r.copy(o.from,r.to)));break}}return t}function iw(e,t,n){for(;t<e.length&&ix(n,e[t])>0;)t++;e.splice(t,0,n)}function ik(e){let t=[];return e.someProp("decorations",n=>{let r=n(e.state);r&&r!=iu&&t.push(r)}),e.cursorWrapper&&t.push(ih.create(e.state.doc,[e.cursorWrapper.deco])),ip.from(t)}let iS={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},iM=nC&&nN<=11;class iC{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class iN{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new iC,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(t=>{for(let e=0;e<t.length;e++)this.queue.push(t[e]);nC&&nN<=11&&t.some(e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():nj&&e.composing&&t.some(e=>"childList"==e.type&&"TR"==e.target.nodeName)?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),iM&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,iS)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(rv(this.view)){if(this.suppressingSelectionUpdates)return ru(this.view);if(nC&&nN<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();
278if(e.focusNode&&nu(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,n;for(let n=e.focusNode;n;n=nl(n))t.add(n);for(let r=e.anchorNode;r;r=nl(r))if(t.has(r)){n=r;break}let r=n&&this.view.docView.nearestDesc(n);if(r&&r.ignoreMutation({type:"selection",target:3==n.nodeType?n.parentNode:n}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){var e;let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=t.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&rv(t)&&!this.ignoreSelectionChange(r),o=-1,s=-1,a=!1,l=[];if(t.editable)for(let e=0;e<n.length;e++){let t=this.registerMutation(n[e],l);t&&(o=o<0?t.from:Math.min(t.from,o),s=s<0?t.to:Math.max(t.to,s),t.typeOver&&(a=!0))}if(l.some(e=>"BR"==e.nodeName)&&(8==t.input.lastKeyCode||46==t.input.lastKeyCode)){for(let e of l)if("BR"==e.nodeName&&e.parentNode){let t=e.nextSibling;t&&1==t.nodeType&&"false"==t.contentEditable&&e.parentNode.removeChild(e)}}else if(nE&&l.length){let e=l.filter(e=>"BR"==e.nodeName);if(2==e.length){let[t,n]=e;t.parentNode&&t.parentNode.parentNode==n.parentNode?n.remove():t.remove()}else{let{focusNode:n}=this.currentSelection;for(let r of e){let e=r.parentNode;e&&"LI"==e.nodeName&&(!n||function(e,t){for(let n=t.parentNode;n&&n!=e.dom;n=n.parentNode){let t=e.docView.nearestDesc(n,!0);if(t&&t.node.isBlock)return n}return null}(t,n)!=e)&&r.remove()}}}let c=null;o<0&&i&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)<Date.now()-300&&ny(r)&&(c=rd(t))&&c.eq(tp.near(t.state.doc.resolve(0),1))?(t.input.lastFocus=0,ru(t),this.currentSelection.set(r),t.scrollToSelection()):(o>-1||i)&&(o>-1&&(t.docView.markDirty(o,s),e=t,!iE.has(e)&&(iE.set(e,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace))&&(e.requiresGeckoHackNode=nE,iT||(console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),iT=!0))),t.input.badSafariComposition&&(t.input.badSafariComposition=!1,function(e,t){var n;let{focusNode:r,focusOffset:i}=e.domSelectionRange();for(let o of t)if((null==(n=o.parentNode)?void 0:n.nodeName)=="TR"){let t=o.nextSibling;for(;t&&"TD"!=t.nodeName&&"TH"!=t.nodeName;)t=t.nextSibling;if(t){let n=t;for(;;){let e=n.firstChild;if(!e||1!=e.nodeType||"false"==e.contentEditable||/^(BR|IMG)$/.test(e.nodeName))break;n=e}n.insertBefore(o,n.firstChild),r==o&&e.domSelection().collapse(o,i)}else o.parentNode.removeChild(o)}}(t,l)),this.handleDOMChange(o,s,a,l),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(r)||ru(t),this.currentSelection.set(r))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if("attributes"==e.type&&(n==this.view.docView||"contenteditable"==e.attributeName||"style"==e.attributeName&&!e.oldValue&&!e.target.getAttribute("style"))||!n||n.ignoreMutation(e))return null;if("childList"==e.type){for(let n=0;n<e.addedNodes.length;n++){let r=e.addedNodes[n];t.push(r),3==r.nodeType&&(this.lastChangedTextNode=r)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let r=e.previousSibling,i=e.nextSibling;if(nC&&nN<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:o}=e.addedNodes[t];(!n||0>Array.prototype.indexOf.call(e.addedNodes,n))&&(r=n),(!o||0>Array.prototype.indexOf.call(e.addedNodes,o))&&(i=o)}let o=r&&r.parentNode==e.target?na(r)+1:0,s=n.localPosFromDOM(e.target,o,-1),a=i&&i.parentNode==e.target?na(i):e.target.childNodes.length;return{from:s,to:n.localPosFromDOM(e.target,a,1)}}return"attributes"==e.type?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:(this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let iE=new WeakMap,iT=!1;function iO(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,o=t.endOffset,s=e.domAtPos(e.state.selection.anchor);return nu(s.node,s.offset,i,o)&&([n,r,i,o]=[i,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}}function iA(e){let t=e.pmViewDesc;if(t)return t.parseRule();if("BR"==e.nodeName&&e.parentNode){if(nj&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let e=document.createElement("div");return e.appendChild(document.createElement("li")),{skip:e}}else if(e.parentNode.lastChild==e||nj&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if("IMG"==e.nodeName&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}let ij=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;
vendor: 1,432 bytes, line 278
278function iI(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:rx(e,t.resolve(n.anchor),t.resolve(n.head))}function iD(e,t,n){let r=e.depth,i=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,i++}return i}function iR(e){if(2!=e.length)return!1;let t=e.charCodeAt(0),n=e.charCodeAt(1);return t>=56320&&t<=57343&&n>=55296&&n<=56319}class iL{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new rK,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(i_),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):"function"==typeof e?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=iz(this),iB(this),this.nodeViews=i$(this),this.docView=n6(this.state.doc,iP(this),ik(this),this.dom,this),this.domObserver=new iN(this,(e,t,n,r)=>(function(e,t,n,r,i){let o,s,a,l=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=rd(e,t);
278if(n&&!e.state.selection.eq(n)){if(nO&&nL&&13===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",t=>t(e,nb(13,"Enter"))))return;let r=e.state.tr.setSelection(n);"pointer"==t?r.setMeta("pointer",!0):"key"==t&&r.scrollIntoView(),l&&r.setMeta("composition",l),e.dispatch(r)}return}let c=e.state.doc.resolve(t),d=c.sharedDepth(n);t=c.before(d+1),n=e.state.doc.resolve(n).after(d+1);let h=e.state.selection,u=function(e,t,n){let r,{node:i,fromOffset:o,toOffset:s,from:a,to:l}=e.docView.parseRange(t,n),c=e.domSelectionRange(),d=c.anchorNode;if(d&&e.dom.contains(1==d.nodeType?d:d.parentNode)&&(r=[{node:d,offset:c.anchorOffset}],ny(c)||r.push({node:c.focusNode,offset:c.focusOffset})),nO&&8===e.input.lastKeyCode)for(let e=s;e>o;e--){let t=i.childNodes[e-1],n=t.pmViewDesc;if("BR"==t.nodeName&&!n){s=e;break}if(!n||n.size)break}let h=e.state.doc,u=e.someProp("domParser")||eC.fromSchema(e.state.schema),p=h.resolve(a),f=null,m=u.parse(i,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:o,to:s,preserveWhitespace:"pre"!=p.parent.type.whitespace||"full",findPositions:r,ruleFromNode:iA,context:p});if(r&&null!=r[0].pos){let e=r[0].pos,t=r[1]&&r[1].pos;null==t&&(t=e),f={anchor:e+a,head:t+a}}return{doc:m,sel:f,from:a,to:l}}(e,t,n),p=e.state.doc,f=p.slice(u.from,u.to);8===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime?(o=e.state.selection.to,s="end"):(o=e.state.selection.from,s="start"),e.input.lastKeyCode=null;let m=function(e,t,n,r,i){let o=e.findDiffStart(t,n);if(null==o)return null;let{a:s,b:a}=e.findDiffEnd(t,n+e.size,n+t.size);if("end"==i){let e=Math.max(0,o-Math.min(s,a));r-=s+e-o}if(s<o&&e.size<t.size){let e=r<=o&&r>=s?o-r:0;(o-=e)&&o<t.size&&iR(t.textBetween(o-1,o+1))&&(o+=e?1:-1),a=o+(a-s),s=o}else if(a<o){let t=r<=o&&r>=a?o-r:0;(o-=t)&&o<e.size&&iR(e.textBetween(o-1,o+1))&&(o+=t?1:-1),s=o+(s-a),a=o}return{start:o,endA:s,endB:a}}(f.content,u.doc.content,u.from,o,s);if(m&&e.input.domChangeCount++,(nI&&e.input.lastIOSEnter>Date.now()-225||nL)&&i.some(e=>1==e.nodeType&&!ij.test(e.nodeName))&&(!m||m.endA>=m.endB)&&e.someProp("handleKeyDown",t=>t(e,nb(13,"Enter")))){e.input.lastIOSEnter=0;return}if(!m)if(r&&h instanceof ty&&!h.empty&&h.$head.sameParent(h.$anchor)&&!e.composing&&!(u.sel&&u.sel.anchor!=u.sel.head))m={start:h.from,endA:h.to,endB:h.to};else{if(u.sel){let t=iI(e,e.state.doc,u.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);l&&n.setMeta("composition",l),e.dispatch(n)}}return}e.state.selection.from<e.state.selection.to&&m.start==m.endB&&e.state.selection instanceof ty&&(m.start>e.state.selection.from&&m.start<=e.state.selection.from+2&&e.state.selection.from>=u.from?m.start=e.state.selection.from:m.endA<e.state.selection.to&&m.endA>=e.state.selection.to-2&&e.state.selection.to<=u.to&&(m.endB+=e.state.selection.to-m.endA,m.endA=e.state.selection.to)),nC&&nN<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>u.from&&"  "==u.doc.textBetween(m.start-u.from-1,m.start-u.from+1)&&(m.start--,m.endA--,m.endB--);let g=u.doc.resolveNoCache(m.start-u.from),y=u.doc.resolveNoCache(m.endB-u.from),b=p.resolve(m.start),x=g.sameParent(y)&&g.parent.inlineContent&&b.end()>=m.endA;if((nI&&e.input.lastIOSEnter>Date.now()-225&&(!x||i.some(e=>"DIV"==e.nodeName||"P"==e.nodeName))||!x&&g.pos<u.doc.content.size&&(!g.sameParent(y)||!g.parent.inlineContent)&&g.pos<y.pos&&!/\S/.test(u.doc.textBetween(g.pos,y.pos,"","")))&&e.someProp("handleKeyDown",t=>t(e,nb(13,"Enter")))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>m.start&&function(e,t,n,r,i){if(n-t<=i.pos-r.pos||iD(r,!0,!1)<i.pos)return!1;let o=e.resolve(t);if(!r.parent.isTextblock){let e=o.nodeAfter;return null!=e&&n==t+e.nodeSize}if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let s=e.resolve(iD(o,!0,!0));return!(!s.parent.isTextblock||s.pos>n||iD(s,!0,!1)<n)&&r.parent.content.cut(r.parentOffset).eq(s.parent.content)}(p,m.start,m.endA,g,y)&&e.someProp("handleKeyDown",t=>t(e,nb(8,"Backspace")))){nL&&nO&&e.domObserver.suppressSelectionUpdates();return}
vendor: 5,054 bytes, line 278
278nO&&m.endB==m.start&&(e.input.lastChromeDelete=Date.now()),nL&&!x&&g.start()!=y.start()&&0==y.parentOffset&&g.depth==y.depth&&u.sel&&u.sel.anchor==u.sel.head&&u.sel.head==m.endA&&(m.endB-=2,y=u.doc.resolveNoCache(m.endB-u.from),setTimeout(()=>{e.someProp("handleKeyDown",function(t){return t(e,nb(13,"Enter"))})},20));let v=m.start,w=m.endA,k=t=>{let n=t||e.state.tr.replace(v,w,u.doc.slice(m.start-u.from,m.endB-u.from));if(u.sel){let t=iI(e,n.doc,u.sel);t&&!(nO&&e.composing&&t.empty&&(m.start!=m.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==v||t.head==n.mapping.map(w)-1)||nC&&t.empty&&t.head==v)&&n.setSelection(t)}return l&&n.setMeta("composition",l),n.scrollIntoView()};if(x)if(g.pos==y.pos){nC&&nN<=11&&0==g.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>ru(e),20));let t=k(e.state.tr.delete(v,w)),n=p.resolve(m.start).marksAcross(p.resolve(m.endA));n&&t.ensureMarks(n),e.dispatch(t)}else if(m.endA==m.endB&&(a=function(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,i=n,o=r,s,a,l;for(let e=0;e<r.length;e++)i=r[e].removeFromSet(i);for(let e=0;e<n.length;e++)o=n[e].removeFromSet(o);if(1==i.length&&0==o.length)a=i[0],s="add",l=e=>e.mark(a.addToSet(e.marks));else{if(0!=i.length||1!=o.length)return null;a=o[0],s="remove",l=e=>e.mark(a.removeFromSet(e.marks))}let c=[];for(let e=0;e<t.childCount;e++)c.push(l(t.child(e)));if(H.from(c).eq(e))return{mark:a,type:s}}(g.parent.content.cut(g.parentOffset,y.parentOffset),b.parent.content.cut(b.parentOffset,m.endA-b.start())))){let t=k(e.state.tr);"add"==a.type?t.addMark(v,w,a.mark):t.removeMark(v,w,a.mark),e.dispatch(t)}else if(g.parent.child(g.index()).isText&&g.index()==y.index()-!y.textOffset){let t=g.parent.textBetween(g.parentOffset,y.parentOffset),n=()=>k(e.state.tr.insertText(t,v,w));e.someProp("handleTextInput",r=>r(e,v,w,t,n))||e.dispatch(n())}else e.dispatch(k());else e.dispatch(k())})(this,e,t,n,r)),this.domObserver.start(),function(e){for(let t in rq){let n=rq[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{!function(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}(e,t)||rX(e,t)||!e.editable&&t.type in rU||n(e,t)},rW[t]?{passive:!0}:void 0)}nj&&e.dom.addEventListener("input",()=>null),rG(e)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;for(let t in this._props={},e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&rG(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(i_),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let e in this._props)t[e]=this._props[e];for(let n in t.state=this.state,e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){var n,r,i;let o=this.state,s=!1,a=!1;e.storedMarks&&this.composing&&(r4(this),a=!0),this.state=e;let l=o.plugins!=e.plugins||this._props.plugins!=t.plugins;if(l||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=i$(this);(function(e,t){let n=0,r=0;for(let r in e){if(e[r]!=t[r])return!0;n++}for(let e in t)r++;return n!=r})(e,this.nodeViews)&&(this.nodeViews=e,s=!0)}(l||t.handleDOMEvents!=this._props.handleDOMEvents)&&rG(this),this.editable=iz(this),iB(this);let c=ik(this),d=iP(this),h=o.plugins==e.plugins||o.doc.eq(e.doc)?e.scrollToSelection>o.scrollToSelection?"to selection":"preserve":"reset",u=s||!this.docView.matchesNode(e.doc,d,c);(u||!e.selection.eq(o.selection))&&(a=!0);let p="preserve"==h&&a&&null==this.dom.style.overflowAnchor&&function(e){let t,n,r=e.dom.getBoundingClientRect(),i=Math.max(0,r.top);for(let o=(r.left+r.right)/2,s=i+1;s<Math.min(innerHeight,r.bottom);s+=5){let r=e.root.elementFromPoint(o,s);if(!r||r==e.dom||!e.dom.contains(r))continue;let a=r.getBoundingClientRect();if(a.top>=i-20){t=r,n=a.top;break}}return{refDOM:t,refTop:n,stack:n_(e.dom)}}(this);if(a){let t,n,a;this.domObserver.stop();let l=u&&(nC||nO)&&!this.composing&&!o.selection.empty&&!e.selection.empty&&(r=o.selection,i=e.selection,a=Math.min(r.$anchor.sharedDepth(r.head),i.$anchor.sharedDepth(i.head)),r.$anchor.start(a)!=i.$anchor.start(a));if(u){let t=nO?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=function(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=function(e,t){for(;;){if(3==e.nodeType&&t)return e;if(1==e.nodeType&&t>0){if("false"==e.contentEditable)return null;t=nm(e=e.childNodes[t-1])}else{if(!e.parentNode||ng(e))return null;t=na(e),e=e.parentNode}}}(t.focusNode,t.focusOffset),r=function(e,t){for(;;){if(3==e.nodeType&&t<e.nodeValue.length)return e;if(1==e.nodeType&&t<e.childNodes.length){if("false"==e.contentEditable)return null;e=e.childNodes[t],t=0}else{if(!e.parentNode||ng(e))return null;t=na(e)+1,e=e.parentNode}}}(t.focusNode,t.focusOffset);
278if(n&&r&&n!=r){let t=r.pmViewDesc,i=e.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!t||!t.isText(r.nodeValue))return r;if(e.input.compositionNode==r){let e=n.pmViewDesc;if(!(!e||!e.isText(n.nodeValue)))return r}}return n||r}(this)),(s||!this.docView.update(e.doc,d,c,this))&&(this.docView.updateOuterDeco(d),this.docView.destroy(),this.docView=n6(e.doc,d,c,this.dom,this)),!t||this.trackWrites&&this.dom.contains(this.trackWrites)||(l=!0)}l||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&(t=this.docView.domFromPos(this.state.selection.anchor,0),n=this.domSelectionRange(),nu(t.node,t.offset,n.anchorNode,n.anchorOffset)))?ru(this,l):(ry(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(o),(null==(n=this.dragging)?void 0:n.node)&&!o.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,o),"reset"==h?this.dom.scrollTop=0:"to selection"==h?this.scrollToSelection():p&&function({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;nV(n,0==r?0:r-t)}(p)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(e&&this.dom.contains(1==e.nodeType?e:e.parentNode))if(this.someProp("handleScrollToSelection",e=>e(this)));else if(this.state.selection instanceof tx){let t=this.docView.domAfterPos(this.state.selection.from);1==t.nodeType&&n$(this,t.getBoundingClientRect(),e)}else n$(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(e&&e.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}}}updateDraggedNode(e,t){let n=e.node,r=-1;if(this.state.doc.nodeAt(n.from)==n.node)r=n.from;else{let e=n.from+(this.state.doc.content.size-t.doc.content.size);(e>0&&this.state.doc.nodeAt(e))==n.node&&(r=e)}this.dragging=new ie(e.slice,e.move,r<0?void 0:tx.create(this.state.doc,r))}someProp(e,t){let n=this._props&&this._props[e],r;if(null!=n&&(r=t?t(n):n))return r;for(let n=0;n<this.directPlugins.length;n++){let i=this.directPlugins[n].props[e];if(null!=i&&(r=t?t(i):i))return r}let i=this.state.plugins;if(i)for(let n=0;n<i.length;n++){let o=i[n].props[e];if(null!=o&&(r=t?t(o):o))return r}}hasFocus(){if(nC){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if("false"==e.contentEditable)return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&function(e){if(e.setActive)return e.setActive();if(nF)return e.focus(nF);let t=n_(e);e.focus(null==nF?{get preventScroll(){return nF={preventScroll:!0},!0}}:void 0),nF||(nF=!1,nV(t,0))}(this.dom),ru(this),this.domObserver.start()}get root(){let e=this._root;if(null==e){for(let e=this.dom.parentNode;e;e=e.parentNode)if(9==e.nodeType||11==e.nodeType&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e}return e||document}updateRoot(){this._root=null}posAtCoords(e){return function(e,t){var n;let r,i,o=e.dom.ownerDocument,s,a=0,l=function(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(nm(r.offsetNode),r.offset)}}catch(e){}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(nm(r.startContainer),r.startOffset)}}}(o,t.left,t.top);l&&({node:s,offset:a}=l);let c=(e.root.elementFromPoint?e.root:o).elementFromPoint(t.left,t.top);if(!c||!e.dom.contains(1!=c.nodeType?c.parentNode:c)){let n=e.dom.getBoundingClientRect();if(!nH(t,n)||!(c=function e(t,n,r){let i=t.childNodes.length;if(i&&r.top<r.bottom)for(let o=Math.max(0,Math.min(i-1,Math.floor(i*(n.top-r.top)/(r.bottom-r.top))-2)),s=o;;){let r=t.childNodes[s];if(1==r.nodeType){let t=r.getClientRects();for(let i=0;i<t.length;i++){let o=t[i];if(nH(n,o))return e(r,n,o)}}if((s=(s+1)%i)==o)break}return t}(e.dom,t,n)))return null}if(nj)for(let e=c;s&&e;e=nl(e))e.draggable&&(s=void 0);if(c=(r=(n=c).parentNode)&&/^li$/i.test(r.nodeName)&&t.left<n.getBoundingClientRect().left?r:n,s){let n;if(nE&&1==s.nodeType&&(a=Math.min(a,s.childNodes.length))<s.childNodes.length){let e=s.childNodes[a],n;"IMG"==e.nodeName&&(n=e.getBoundingClientRect()).right<=t.left&&n.bottom>t.top&&a++}
278nP&&a&&1==s.nodeType&&1==(n=s.childNodes[a-1]).nodeType&&"false"==n.contentEditable&&n.getBoundingClientRect().top>=t.top&&a--,s==e.dom&&a==s.childNodes.length-1&&1==s.lastChild.nodeType&&t.top>s.lastChild.getBoundingClientRect().bottom?i=e.state.doc.content.size:(0==a||1!=s.nodeType||"BR"!=s.childNodes[a-1].nodeName)&&(i=function(e,t,n,r){let i=-1;for(let n=t,o=!1;n!=e.dom;){let t=e.docView.nearestDesc(n,!0),s;if(!t)return null;if(1==t.dom.nodeType&&(t.node.isBlock&&t.parent||!t.contentDOM)&&((s=t.dom.getBoundingClientRect()).width||s.height)&&(t.node.isBlock&&t.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(t.dom.nodeName)&&(!o&&s.left>r.left||s.top>r.top?i=t.posBefore:(!o&&s.right<r.left||s.bottom<r.top)&&(i=t.posAfter),o=!0),!t.contentDOM&&i<0&&!t.node.isText))return(t.node.isBlock?r.top<(s.top+s.bottom)/2:r.left<(s.left+s.right)/2)?t.posBefore:t.posAfter;n=t.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,-1)}(e,s,a,t))}null==i&&(i=function(e,t,n){let{node:r,offset:i}=function e(t,n){let r,i,o,s=2e8,a,l=0,c=n.top,d=n.top;for(let e=t.firstChild,h=0;e;e=e.nextSibling,h++){let t;if(1==e.nodeType)t=e.getClientRects();else{if(3!=e.nodeType)continue;t=nd(e).getClientRects()}for(let u=0;u<t.length;u++){let p=t[u];if(p.top<=c&&p.bottom>=d){c=Math.max(p.bottom,c),d=Math.min(p.top,d);let t=p.left>n.left?p.left-n.left:p.right<n.left?n.left-p.right:0;if(t<s){o=e,s=t,a=t&&3==o.nodeType?{left:p.right<n.left?p.right:p.left,top:n.top}:n,1==e.nodeType&&t&&(l=h+ +(n.left>=(p.left+p.right)/2));continue}}else p.top>n.top&&!r&&p.left<=n.left&&p.right>=n.left&&(r=e,i={left:Math.max(p.left,Math.min(p.right,n.left)),top:p.top});!o&&(n.left>=p.right&&n.top>=p.top||n.left>=p.left&&n.top>=p.bottom)&&(l=h+1)}}return(!o&&r&&(o=r,a=i,s=0),o&&3==o.nodeType)?function(e,t){let n=e.nodeValue.length,r=document.createRange(),i;for(let o=0;o<n;o++){r.setEnd(e,o+1),r.setStart(e,o);let n=nU(r,1);if(n.top!=n.bottom&&nH(t,n)){i={node:e,offset:o+ +(t.left>=(n.left+n.right)/2)};break}}return r.detach(),i||{node:e,offset:0}}(o,a):!o||s&&1==o.nodeType?{node:t,offset:l}:e(o,a)}(t,n),o=-1;if(1==r.nodeType&&!r.firstChild){let e=r.getBoundingClientRect();o=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,i,o)}(e,c,t));let d=e.docView.nearestDesc(c,!0);return{pos:i,inside:d?d.posAtStart-d.border:-1}}(this,e)}coordsAtPos(e,t=1){return nK(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let r=this.docView.posFromDOM(e,t,n);if(null==r)throw RangeError("DOM position not inside the editor");return r}endOfTextblock(e,t){return function(e,t,n){let r,i;return nY==t&&nZ==n?n0:(nY=t,nZ=n,n0="up"==n||"down"==n?(r=t.selection,i="up"==n?r.$from:r.$to,nX(e,t,()=>{let{node:t}=e.docView.domFromPos(i.pos,"up"==n?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.contentDOM||n.dom;break}t=n.dom.parentNode}let r=nK(e,i.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(1==e.nodeType)t=e.getClientRects();else{if(3!=e.nodeType)continue;t=nd(e,0,e.nodeValue.length).getClientRects()}for(let e=0;e<t.length;e++){let i=t[e];if(i.bottom>i.top+1&&("up"==n?r.top-i.top>(i.bottom-r.top)*2:i.bottom-r.bottom>(r.bottom-i.top)*2))return!1}}return!0})):function(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=i==r.parent.content.size,s=e.domSelection();return s?nQ.test(r.parent.textContent)&&s.modify?nX(e,t,()=>{let{focusNode:t,focusOffset:i,anchorNode:o,anchorOffset:a}=e.domSelectionRange(),l=s.caretBidiLevel;s.modify("move",n,"character");let c=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:d,focusOffset:h}=e.domSelectionRange(),u=d&&!c.contains(1==d.nodeType?d:d.parentNode)||t==d&&i==h;try{s.collapse(o,a),t&&(t!=o||i!=a)&&s.extend&&s.extend(t,i)}catch(e){}return null!=l&&(s.caretBidiLevel=l),u}):"left"==n||"backward"==n?!i:o:r.pos==r.start()||r.pos==r.end()}(e,t,n))}(this,t||this.state,e)}pasteHTML(e,t){return r9(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return r9(this,e,null,!0,t||new ClipboardEvent("paste"))}serializeForClipboard(e){return rR(this,e)}destroy(){if(this.docView){for(let e in this.domObserver.stop(),this.input.eventHandlers)this.dom.removeEventListener(e,this.input.eventHandlers[e]);clearTimeout(this.input.composingTimeout),clearTimeout(this.input.lastIOSEnterFallbackTimeout),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],ik(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,nh()}}get isDestroyed(){return null==this.docView}dispatchEvent(e){!rX(this,e)&&rq[e.type]&&(this.editable||!(e.type in rU))&&rq[e.type](this,e)}domSelectionRange(){let e=this.domSelection();return e?nj&&11===this.root.nodeType&&function(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}(this.dom.ownerDocument)==this.dom&&function(e,t){let n;if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return iO(e,n)}function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",r,!0),n?iO(e,n):null}
278(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function iP(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",n=>{if("function"==typeof n&&(n=n(e.state)),n)for(let e in n)"class"==e?t.class+=" "+n[e]:"style"==e?t.style=(t.style?t.style+";":"")+n[e]:t[e]||"contenteditable"==e||"nodeName"==e||(t[e]=String(n[e]))}),t.translate||(t.translate="no"),[il.node(0,e.state.doc.content.size,t)]}function iB(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:il.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function iz(e){return!e.someProp("editable",t=>!1===t(e.state))}function i$(e){let t=Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function i_(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw RangeError("Plugins passed directly to the view must not have a state component")}iL.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};for(var iV={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},iF={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},iH="u">typeof navigator&&/Mac/.test(navigator.platform),iq="u">typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),iU=0;iU<10;iU++)iV[48+iU]=iV[96+iU]=String(iU);for(var iU=1;iU<=24;iU++)iV[iU+111]="F"+iU;for(var iU=65;iU<=90;iU++)iV[iU]=String.fromCharCode(iU+32),iF[iU]=String.fromCharCode(iU);for(var iW in iV)iF.hasOwnProperty(iW)||(iF[iW]=iV[iW]);let iK="u">typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),iJ="u">typeof navigator&&/Win/.test(navigator.platform);function iG(e,t,n=!0){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n&&t.shiftKey&&(e="Shift-"+e),e}function iX(e){let t=function(e){let t=Object.create(null);for(let n in e)t[function(e){let t,n,r,i,o=e.split(/-(?!$)/),s=o[o.length-1];"Space"==s&&(s=" ");for(let e=0;e<o.length-1;e++){let s=o[e];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else if(/^s(hift)?$/i.test(s))r=!0;else if(/^mod$/i.test(s))iK?i=!0:n=!0;else throw Error("Unrecognized modifier name: "+s)}return t&&(s="Alt-"+s),n&&(s="Ctrl-"+s),i&&(s="Meta-"+s),r&&(s="Shift-"+s),s}(n)]=e[n];return t}(e);return function(e,n){var r;let i=("Esc"==(r=!(iH&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||iq&&n.shiftKey&&n.key&&1==n.key.length||"Unidentified"==n.key)&&n.key||(n.shiftKey?iF:iV)[n.keyCode]||n.key||"Unidentified")&&(r="Escape"),"Del"==r&&(r="Delete"),"Left"==r&&(r="ArrowLeft"),"Up"==r&&(r="ArrowUp"),"Right"==r&&(r="ArrowRight"),"Down"==r&&(r="ArrowDown"),r),o,s=t[iG(i,n)];if(s&&s(e.state,e.dispatch,e))return!0;if(1==i.length&&" "!=i){if(n.shiftKey){let r=t[iG(i,n,!1)];if(r&&r(e.state,e.dispatch,e))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(iJ&&n.ctrlKey&&n.altKey)&&(o=iV[n.keyCode])&&o!=i){let r=t[iG(o,n)];if(r&&r(e.state,e.dispatch,e))return!0}}return!1}}var iQ=Object.defineProperty,iY=(e,t)=>{for(var n in t)iQ(e,n,{get:t[n],enumerable:!0})};function iZ(e){let{state:t,transaction:n}=e,{selection:r}=n,{doc:i}=n,{storedMarks:o}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,o=n.storedMarks,n}}}var i0=class{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){let{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:i}=n,o=this.buildProps(i);return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,(...e)=>{let n=t(...e)(o);return i.getMeta("preventDispatch")||this.hasCustomState||r.dispatch(i),n}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:o}=r,s=[],a=!!e,l=e||i.tr,c=()=>(a||!t||l.getMeta("preventDispatch")||this.hasCustomState||o.dispatch(l),s.every(e=>!0===e)),d={...Object.fromEntries(Object.entries(n).map(([e,n])=>[e,(...e)=>{let r=this.buildProps(l,t),i=n(...e)(r);return s.push(i),d}])),run:c};return d}createCan(e){let{rawCommands:t,state:n}=this,r=e||n.tr,i=this.buildProps(r,!1);return{...Object.fromEntries(Object.entries(t).map(([e,t])=>[e,(...e)=>t(...e)({...i,dispatch:void 0})])),chain:()=>this.createChain(r,!1)}}buildProps(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:o}=r,s={tr:e,editor:r,view:o,state:iZ({state:i,transaction:e}),dispatch:t?()=>void 0:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([e,t])=>[e,(...e)=>t(...e)(s)]))}};return s}},i1={};iY(i1,{blur:()=>i2,clearContent:()=>i3,clearNodes:()=>i5,command:()=>i4,createParagraphNear:()=>i6,cut:()=>i7,deleteCurrentNode:()=>i9,deleteNode:()=>oe,deleteRange:()=>ot,deleteSelection:()=>
278on,enter:()=>or,exitCode:()=>oi,extendMarkRange:()=>ou,first:()=>op,focus:()=>ox,forEach:()=>ov,insertContent:()=>ow,insertContentAt:()=>oC,joinBackward:()=>oT,joinDown:()=>oE,joinForward:()=>oO,joinItemBackward:()=>oA,joinItemForward:()=>oj,joinTextblockBackward:()=>oI,joinTextblockForward:()=>oD,joinUp:()=>oN,keyboardShortcut:()=>oL,lift:()=>oB,liftEmptyBlock:()=>oz,liftListItem:()=>o$,newlineInCode:()=>o_,resetAttributes:()=>oH,scrollIntoView:()=>oq,selectAll:()=>oU,selectNodeBackward:()=>oW,selectNodeForward:()=>oK,selectParentNode:()=>oJ,selectTextblockEnd:()=>oG,selectTextblockStart:()=>oX,setContent:()=>oY,setMark:()=>sS,setMeta:()=>sM,setNode:()=>sC,setNodeSelection:()=>sN,setTextDirection:()=>sE,setTextSelection:()=>sT,sinkListItem:()=>sO,splitBlock:()=>sj,splitListItem:()=>sI,toggleList:()=>sL,toggleMark:()=>sP,toggleNode:()=>sB,toggleWrap:()=>sz,undoInputRule:()=>s$,unsetAllMarks:()=>s_,unsetMark:()=>sV,unsetTextDirection:()=>sF,updateAttributes:()=>sH,wrapIn:()=>sq,wrapInList:()=>sU});var i2=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),null==(n=null==window?void 0:window.getSelection())||n.removeAllRanges())}),!0),i3=(e=!0)=>({commands:t})=>t.setContent("",{emitUpdate:e}),i5=()=>({state:e,tr:t,dispatch:n})=>{let{selection:r}=t,{ranges:i}=r;return!n||(i.forEach(({$from:n,$to:r})=>{e.doc.nodesBetween(n.pos,r.pos,(e,n)=>{if(e.type.isText)return;let{doc:r,mapping:i}=t,o=r.resolve(i.map(n)),s=r.resolve(i.map(n+e.nodeSize)),a=o.blockRange(s);if(!a)return;let l=e0(a);if(e.type.isTextblock){let{defaultType:e}=o.parent.contentMatchAt(o.index());t.setNodeMarkup(a.start,e)}(l||0===l)&&t.lift(a,l)})}),!0)},i4=e=>t=>e(t),i6=()=>({state:e,dispatch:t})=>t0(e,t),i7=(e,t)=>({editor:n,tr:r})=>{let{state:i}=n,o=i.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);let s=r.mapping.map(t);return r.insert(s,o.content),r.setSelection(new ty(r.doc.resolve(Math.max(s-1,0)))),!0},i9=()=>({tr:e,dispatch:t})=>{let{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;let i=e.selection.$anchor;for(let n=i.depth;n>0;n-=1)if(i.node(n).type===r.type){if(t){let t=i.before(n),r=i.after(n);e.delete(t,r).scrollIntoView()}return!0}return!1};function i8(e,t){if("string"==typeof e){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}var oe=e=>({tr:t,state:n,dispatch:r})=>{let i=i8(e,n.schema),o=t.selection.$anchor;for(let e=o.depth;e>0;e-=1)if(o.node(e).type===i){if(r){let n=o.before(e),r=o.after(e);t.delete(n,r).scrollIntoView()}return!0}return!1},ot=e=>({tr:t,dispatch:n})=>{let{from:r,to:i}=e;return n&&t.delete(r,i),!0},on=()=>({state:e,dispatch:t})=>tL(e,t),or=()=>({commands:e})=>e.keyboardShortcut("Enter"),oi=()=>({state:e,dispatch:t})=>tZ(e,t);function oo(e){return"[object RegExp]"===Object.prototype.toString.call(e)}function oa(e,t,n={strict:!0}){let r=Object.keys(t);return!r.length||r.every(r=>n.strict?t[r]===e[r]:oo(t[r])?t[r].test(e[r]):t[r]===e[r])}function ol(e,t,n={}){return e.find(e=>e.type===t&&oa(Object.fromEntries(Object.keys(n).map(t=>[t,e.attrs[t]])),n))}function oc(e,t,n={}){return!!ol(e,t,n)}function od(e,t,n){var r;if(!e||!t)return;let i=e.parent.childAfter(e.parentOffset);if(i.node&&i.node.marks.some(e=>e.type===t)||(i=e.parent.childBefore(e.parentOffset)),!i.node||!i.node.marks.some(e=>e.type===t)||(n=n||(null==(r=i.node.marks[0])?void 0:r.attrs),!ol([...i.node.marks],t,n)))return;let o=i.index,s=e.start()+i.offset,a=o+1,l=s+i.node.nodeSize;for(;o>0&&oc([...e.parent.child(o-1).marks],t,n);)o-=1,s-=e.parent.child(o).nodeSize;for(;a<e.parent.childCount&&oc([...e.parent.child(a).marks],t,n);)l+=e.parent.child(a).nodeSize,a+=1;return{from:s,to:l}}function oh(e,t){if("string"==typeof e){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}var ou=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let o=oh(e,r.schema),{doc:s,selection:a}=n,{$from:l,from:c,to:d}=a;if(i){let e=od(l,o,t);if(e&&e.from<=c&&e.to>=d){let t=ty.create(s,e.from,e.to);n.setSelection(t)}}return!0},op=e=>t=>{let n="function"==typeof e?e(t):e;for(let e=0;e<n.length;e+=1)if(n[e](t))return!0;return!1};function of(e){return e instanceof ty}function om(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function og(e,t=null){if(!t)return null;let n=tp.atStart(e),r=tp.atEnd(e);if("start"===t||!0===t)return n;if("end"===t)return r;let i=n.from,o=r.to;return"all"===t?ty.create(e,om(0,i,o),om(e.content.size,i,o)):ty.create(e,om(t,i,o),om(t,i,o))}function oy(){return"Android"===navigator.platform||/android/i.test(navigator.userAgent)}function ob(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}var ox=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:o})=>{t={scrollIntoView:!0,...t};let s=()=>{(ob()||oy())&&r.dom.focus(),"u">typeof navigator&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&!ob()&&!oy()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{!n.isDestroyed&&(r.focus(),(null==t?void 0:t.scrollIntoView)&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&null===e||!1===e)return!0}catch{return!1}if(o&&null===e&&!of(n.state.selection))return s(),!0;let a=og(i.doc,e)||n.state.selection,l=n.state.selection.eq(a);return o&&(l||i.setSelection(a),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},ov=(e,t)=>n=>e.every((e,r)=>t(e,{...n,index:r})),ow=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),ok=e=>{let t=e.childNodes;for(let n=t.length-1;n>=0;n-=1){let r=t[n];3===r.nodeType&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):1===r.nodeType&&ok(r)}return e};function oS(e){if("u"<typeof window)throw Error("[tiptap error]: there is no window object available, so this function cannot be used");let t=`<body>${e}</body>`;return ok(new window.DOMParser().parseFromString(t,"text/html").body)}
278function oM(e,t,n){if(e instanceof el||e instanceof H)return e;n={slice:!0,parseOptions:{},...n};let r="object"==typeof e&&null!==e,i="string"==typeof e;if(r)try{if(Array.isArray(e)&&e.length>0)return H.fromArray(e.map(e=>t.nodeFromJSON(e)));let r=t.nodeFromJSON(e);return n.errorOnInvalidContent&&r.check(),r}catch(r){if(n.errorOnInvalidContent)throw Error("[tiptap error]: Invalid JSON content",{cause:r});return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",r),oM("",t,n)}if(i){if(n.errorOnInvalidContent){let r=!1,i="",o=new eS({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:e=>(r=!0,i="string"==typeof e?e:e.outerHTML,null)}]}})});if(n.slice?eC.fromSchema(o).parseSlice(oS(e),n.parseOptions):eC.fromSchema(o).parse(oS(e),n.parseOptions),n.errorOnInvalidContent&&r)throw Error("[tiptap error]: Invalid HTML content",{cause:Error(`Invalid element found: ${i}`)})}let r=eC.fromSchema(t);return n.slice?r.parseSlice(oS(e),n.parseOptions).content:r.parse(oS(e),n.parseOptions)}return oM("",t,n)}var oC=(e,t,n)=>({tr:r,dispatch:i,editor:o})=>{var s;if(i){let i,a;n={parseOptions:o.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let l=e=>{o.emit("contentError",{editor:o,error:e,disableCollaboration:()=>{"collaboration"in o.storage&&"object"==typeof o.storage.collaboration&&o.storage.collaboration&&(o.storage.collaboration.isDisabled=!0)}})},c={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!o.options.enableContentCheck&&o.options.emitContentError)try{oM(t,o.schema,{parseOptions:c,errorOnInvalidContent:!0})}catch(e){l(e)}try{i=oM(t,o.schema,{parseOptions:c,errorOnInvalidContent:null!=(s=n.errorOnInvalidContent)?s:o.options.enableContentCheck})}catch(e){return l(e),!1}let{from:d,to:h}="number"==typeof e?{from:e,to:e}:{from:e.from,to:e.to},u=!0,p=!0;if((!("type"in i)?i:[i]).forEach(e=>{e.check(),u=!!u&&e.isText&&0===e.marks.length,p=!!p&&e.isBlock}),d===h&&p){let{parent:e}=r.doc.resolve(d);!e.isTextblock||e.type.spec.code||e.childCount||(d-=1,h+=1)}if(u){if(Array.isArray(t))a=t.map(e=>e.text||"").join("");else if(t instanceof H){let e="";t.forEach(t=>{t.text&&(e+=t.text)}),a=e}else a="object"==typeof t&&t&&t.text?t.text:t;r.insertText(a,d,h)}else{a=i;let e=r.doc.resolve(d),t=e.node(),n=0===e.parentOffset,o=t.isText||t.isTextblock,s=t.content.size>0;n&&o&&s&&(d=Math.max(0,d-1)),r.replaceWith(d,h,a)}n.updateSelection&&function(e,t){let n=e.steps.length-1;if(n<t)return;let r=e.steps[n];if(!(r instanceof eX||r instanceof eQ))return;let i=e.mapping.maps[n],o=0;i.forEach((e,t,n,r)=>{0===o&&(o=r)}),e.setSelection(tp.near(e.doc.resolve(o),-1))}(r,r.steps.length-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:d,text:a}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:d,text:a})}return!0},oN=()=>({state:e,dispatch:t})=>tJ(e,t),oE=()=>({state:e,dispatch:t})=>tG(e,t),oT=()=>({state:e,dispatch:t})=>tB(e,t),oO=()=>({state:e,dispatch:t})=>tU(e,t),oA=()=>({state:e,dispatch:t,tr:n})=>{try{let r=e9(e.doc,e.selection.$from.pos,-1);if(null==r)return!1;return n.join(r,2),t&&t(n),!0}catch{return!1}},oj=()=>({state:e,dispatch:t,tr:n})=>{try{let r=e9(e.doc,e.selection.$from.pos,1);if(null==r)return!1;return n.join(r,2),t&&t(n),!0}catch{return!1}},oI=()=>({state:e,dispatch:t})=>tz(e,t),oD=()=>({state:e,dispatch:t})=>t$(e,t);function oR(){return"u">typeof navigator&&/Mac/.test(navigator.platform)}var oL=e=>({editor:t,view:n,tr:r,dispatch:i})=>{let o=(function(e){let t,n,r,i,o=e.split(/-(?!$)/),s=o[o.length-1];"Space"===s&&(s=" ");for(let e=0;e<o.length-1;e+=1){let s=o[e];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else if(/^s(hift)?$/i.test(s))r=!0;else if(/^mod$/i.test(s))ob()||oR()?i=!0:n=!0;else throw Error(`Unrecognized modifier name: ${s}`)}return t&&(s=`Alt-${s}`),n&&(s=`Ctrl-${s}`),i&&(s=`Meta-${s}`),r&&(s=`Shift-${s}`),s})(e).split(/-(?!$)/),s=o.find(e=>!["Alt","Ctrl","Meta","Shift"].includes(e)),a=new KeyboardEvent("keydown",{key:"Space"
278===s?" ":s,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),l=t.captureTransaction(()=>{n.someProp("handleKeyDown",e=>e(n,a))});return null==l||l.steps.forEach(e=>{let t=e.map(r.mapping);t&&i&&r.maybeStep(t)}),!0};function oP(e,t,n={}){let{from:r,to:i,empty:o}=e.selection,s=t?i8(t,e.schema):null,a=[];e.doc.nodesBetween(r,i,(e,t)=>{if(e.isText)return;let n=Math.max(r,t),o=Math.min(i,t+e.nodeSize);a.push({node:e,from:n,to:o})});let l=i-r,c=a.filter(e=>!s||s.name===e.node.type.name).filter(e=>oa(e.node.attrs,n,{strict:!1}));return o?!!c.length:c.reduce((e,t)=>e+t.to-t.from,0)>=l}var oB=(e,t={})=>({state:n,dispatch:r})=>{let i=i8(e,n.schema);return!!oP(n,i,t)&&tX(n,r)},oz=()=>({state:e,dispatch:t})=>t1(e,t),o$=e=>({state:t,dispatch:n})=>no(i8(e,t.schema))(t,n),o_=()=>({state:e,dispatch:t})=>tQ(e,t);function oV(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function oF(e,t){let n="string"==typeof t?[t]:t;return Object.keys(e).reduce((t,r)=>(n.includes(r)||(t[r]=e[r]),t),{})}var oH=(e,t)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null,a=oV("string"==typeof e?e:e.name,r.schema);if(!a)return!1;"node"===a&&(o=i8(e,r.schema)),"mark"===a&&(s=oh(e,r.schema));let l=!1;return n.selection.ranges.forEach(e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,(e,r)=>{o&&o===e.type&&(l=!0,i&&n.setNodeMarkup(r,void 0,oF(e.attrs,t))),s&&e.marks.length&&e.marks.forEach(o=>{s===o.type&&(l=!0,i&&n.addMark(r,r+e.nodeSize,s.create(oF(o.attrs,t))))})})}),l},oq=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),oU=()=>({tr:e,dispatch:t})=>{if(t){let t=new tw(e.doc);e.setSelection(t)}return!0},oW=()=>({state:e,dispatch:t})=>tF(e,t),oK=()=>({state:e,dispatch:t})=>tW(e,t),oJ=()=>({state:e,dispatch:t})=>t2(e,t),oG=()=>({state:e,dispatch:t})=>t6(e,t),oX=()=>({state:e,dispatch:t})=>t4(e,t);function oQ(e,t,n={},r={}){return oM(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var oY=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:i,tr:o,dispatch:s,commands:a})=>{let{doc:l}=o;if("full"!==r.preserveWhitespace){let a=oQ(e,i.schema,r,{errorOnInvalidContent:null!=t?t:i.options.enableContentCheck});return s&&o.replaceWith(0,l.content.size,a).setMeta("preventUpdate",!n),!0}return s&&o.setMeta("preventUpdate",!n),a.insertContentAt({from:0,to:l.content.size},e,{parseOptions:r,errorOnInvalidContent:null!=t?t:i.options.enableContentCheck})};function oZ(e,t){let n=oh(t,e.schema),{from:r,to:i,empty:o}=e.selection,s=[];o?(e.storedMarks&&s.push(...e.storedMarks),s.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,e=>{s.push(...e.marks)});let a=s.find(e=>e.type.name===n.name);return a?{...a.attrs}:{}}function o0(e,t){let n=new th(e);return t.forEach(e=>{e.steps.forEach(e=>{n.step(e)})}),n}function o1(e,t){let n=[];return e.descendants((e,r)=>{t(e)&&n.push({node:e,pos:r})}),n}function o2(e){return t=>(function(e,t){for(let n=e.depth;n>0;n-=1){let r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}})(t.$from,e)}function o3(e,t,n){return void 0===e.config[t]&&e.parent?o3(e.parent,t,n):"function"==typeof e.config[t]?e.config[t].bind({...n,parent:e.parent?o3(e.parent,t,n):null}):e.config[t]}function o5(e){return e.map(e=>{let t={name:e.name,options:e.options,storage:e.storage},n=o3(e,"addExtensions",t);return n?[e,...o5(n())]:e}).flat(10)}function o4(e,t){let n=eR.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}function o6(e){return"function"==typeof e}function o7(e,t,...n){return o6(e)?t?e.bind(t)(...n):e(...n):e}function o9(e){let t=e.filter(e=>"extension"===e.type);return{baseExtensions:t,nodeExtensions:e.filter(e=>"node"===e.type),markExtensions:e.filter(e=>"mark"===e.type)}}function o8(e){let t=[],{nodeExtensions:n,markExtensions:r}=o9(e),i=[...n,...r],o={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},s=n.filter(e=>"text"!==e.name).map(e=>e.name),a=r.map(e=>e.name),l=[...s,...a];
278return e.forEach(e=>{let n={name:e.name,options:e.options,storage:e.storage,extensions:i},r=o3(e,"addGlobalAttributes",n);r&&r().forEach(e=>{(Array.isArray(e.types)?e.types:"*"===e.types?l:"nodes"===e.types?s:"marks"===e.types?a:[]).forEach(n=>{Object.entries(e.attributes).forEach(([e,r])=>{t.push({type:n,name:e,attribute:{...o,...r}})})})})}),i.forEach(e=>{let n={name:e.name,options:e.options,storage:e.storage},r=o3(e,"addAttributes",n);r&&Object.entries(r()).forEach(([n,r])=>{let i={...o,...r};"function"==typeof(null==i?void 0:i.default)&&(i.default=i.default()),(null==i?void 0:i.isRequired)&&(null==i?void 0:i.default)===void 0&&delete i.default,t.push({type:e.name,name:n,attribute:i})})}),t}function se(e){let t=[],n=function(e){let t=[],n="",r=!1,i=!1,o=0,s=e.length;for(let a=0;a<s;a+=1){let s=e[a];if("'"===s&&!i){r=!r,n+=s;continue}if('"'===s&&!r){i=!i,n+=s;continue}if(!r&&!i){if("("===s){o+=1,n+=s;continue}if(")"===s&&o>0){o-=1,n+=s;continue}if(";"===s&&0===o){t.push(n),n="";continue}}n+=s}return n&&t.push(n),t}(e||""),r=n.length;for(let e=0;e<r;e+=1){let r=n[e],i=r.indexOf(":");if(-1===i)continue;let o=r.slice(0,i).trim(),s=r.slice(i+1).trim();o&&s&&t.push([o,s])}return t}function st(...e){return e.filter(e=>!!e).reduce((e,t)=>{let n={...e};return Object.entries(t).forEach(([e,t])=>{if(!n[e]){n[e]=t;return}if("class"===e){let r=t?String(t).split(" "):[],i=n[e]?n[e].split(" "):[],o=r.filter(e=>!i.includes(e));n[e]=[...i,...o].join(" ")}else if("style"===e){let r=new Map([...se(n[e]),...se(t)]);n[e]=Array.from(r.entries()).map(([e,t])=>`${e}: ${t}`).join("; ")}else n[e]=t}),n},{})}function sn(e,t){return t.filter(t=>t.type===e.type.name).filter(e=>e.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(e.attrs)||{}:{[t.name]:e.attrs[t.name]}).reduce((e,t)=>st(e,t),{})}function sr(e,t){return"style"in e?e:{...e,getAttrs:n=>{let r=e.getAttrs?e.getAttrs(n):e.attrs;if(!1===r)return!1;let i=t.reduce((e,t)=>{var r;let i=t.attribute.parseHTML?t.attribute.parseHTML(n):"string"!=typeof(r=n.getAttribute(t.name))?r:r.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(r):"true"===r||"false"!==r&&r;return null==i?e:{...e,[t.name]:i}},{});return{...r,...i}}}}function si(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>!("attrs"===e&&function(e={}){return 0===Object.keys(e).length&&e.constructor===Object}(t))&&null!=t))}function so(e){var t,n;let r={};return!(null==(t=null==e?void 0:e.attribute)?void 0:t.isRequired)&&"default"in((null==e?void 0:e.attribute)||{})&&(r.default=e.attribute.default),(null==(n=null==e?void 0:e.attribute)?void 0:n.validate)!==void 0&&(r.validate=e.attribute.validate),[e.name,r]}function ss(e){return e.sort((e,t)=>{let n=o3(e,"priority")||100,r=o3(t,"priority")||100;return n>r?-1:+(n<r)})}function sa(e){var t;let n=ss(o5(e)),r=Array.from(new Set((t=n.map(e=>e.name)).filter((e,n)=>t.indexOf(e)!==n)));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(e=>`'${e}'`).join(", ")}]. This can lead to issues.`),n}function sl(e,t,n){let{from:r,to:i}=t,{blockSeparator:o="\n\n",textSerializers:s={}}=n||{},a="";return e.nodesBetween(r,i,(e,n,l,c)=>{var d;e.isBlock&&n>r&&(a+=o);let h=null==s?void 0:s[e.type.name];if(h)return l&&(a+=h({node:e,pos:n,parent:l,index:c,range:t})),!1;e.isText&&(a+=null==(d=null==e?void 0:e.text)?void 0:d.slice(Math.max(r,n)-n,i-n))}),a}function sc(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function sd(e,t){let n=oV("string"==typeof t?t:t.name,e.schema);return"node"===n?function(e,t){let n=i8(t,e.schema),{from:r,to:i}=e.selection,o=[];e.doc.nodesBetween(r,i,e=>{o.push(e)});let s=o.reverse().find(e=>e.type.name===n.name);return s?{...s.attrs}:{}}(e,t):"mark"===n?oZ(e,t):{}}function sh(e){let t,{mapping:n,steps:r}=e,i=[];return n.maps.forEach((e,t)=>{let o=[];if(e.ranges.length)e.forEach((e,t)=>{o.push({from:e,to:t})});else{let{from:e,to:n}=r[t];if(void 0===e||void 0===n)return;o.push({from:e,to:n})}o.forEach(({from:e,to:r})=>{let o=n.slice(t).map(e,-1),s=n.slice(t).map(r),a=n.invert().map(o,-1),l=n.invert().map(s);i.push({oldRange:{from:a,to:l},newRange:{from:o,to:s}})})}),1===(t=function(e,t=JSON.stringify){let n={};return e.filter(e=>{let r=t(e);return!Object.prototype.hasOwnProperty.call(n,r)&&(n[r]=!0)})}
278(i)).length?t:t.filter((e,n)=>!t.filter((e,t)=>t!==n).some(t=>e.oldRange.from>=t.oldRange.from&&e.oldRange.to<=t.oldRange.to&&e.newRange.from>=t.newRange.from&&e.newRange.to<=t.newRange.to))}function su(e,t,n){let r=[];return e===t?n.resolve(e).marks().forEach(t=>{let i=od(n.resolve(e),t.type);i&&r.push({mark:t,...i})}):n.nodesBetween(e,t,(e,t)=>{e&&(null==e?void 0:e.nodeSize)!==void 0&&r.push(...e.marks.map(n=>({from:t,to:t+e.nodeSize,mark:n})))}),r}function sp(e,t){return t.nodes[e]||t.marks[e]||null}function sf(e,t,n){return Object.fromEntries(Object.entries(n).filter(([n])=>{let r=e.find(e=>e.type===t&&e.name===n);return!!r&&r.attribute.keepOnSplit}))}function sm(e,t,n={}){let{empty:r,ranges:i}=e.selection,o=t?oh(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(e=>!o||o.name===e.type.name).find(e=>oa(e.attrs,n,{strict:!1}));let s=0,a=[];if(i.forEach(({$from:t,$to:n})=>{let r=t.pos,i=n.pos;e.doc.nodesBetween(r,i,(e,t)=>{if(o&&e.inlineContent&&!e.type.allowsMarkType(o))return!1;if(!e.isText&&!e.marks.length)return;let n=Math.max(r,t),l=Math.min(i,t+e.nodeSize);s+=l-n,a.push(...e.marks.map(e=>({mark:e,from:n,to:l})))})}),0===s)return!1;let l=a.filter(e=>!o||o.name===e.mark.type.name).filter(e=>oa(e.mark.attrs,n,{strict:!1})).reduce((e,t)=>e+t.to-t.from,0),c=a.filter(e=>!o||e.mark.type!==o&&e.mark.type.excludes(o)).reduce((e,t)=>e+t.to-t.from,0);return(l>0?l+c:l)>=s}function sg(e,t){return Array.isArray(t)?t.some(t=>("string"==typeof t?t:t.name)===e.name):t}function sy(e,t){let{nodeExtensions:n}=o9(t),r=n.find(t=>t.name===e);if(!r)return!1;let i={name:r.name,options:r.options,storage:r.storage},o=o7(o3(r,"group",i));return"string"==typeof o&&o.split(" ").includes("list")}function sb(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if("hardBreak"===e.type.name)return!0;if(e.isText)return/^\s*$/m.test(null!=(r=e.text)?r:"")}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(0===e.content.childCount)return!0;if(t){let r=!0;return e.content.forEach(e=>{!1!==r&&(sb(e,{ignoreWhitespace:n,checkChildren:t})||(r=!1))}),r}return!1}function sx(e){return e instanceof tx}var sv=class e{constructor(e){this.position=e}static fromJSON(t){return new e(t.position)}toJSON(){return{position:this.position}}};function sw(e,t){let n=t.mapping.mapResult(e.position);return{position:new sv(n.pos),mapResult:n}}function sk(e){return new sv(e)}var sS=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{selection:o}=n,{empty:s,ranges:a}=o,l=oh(e,r.schema);if(i)if(s){let e=oZ(r,l);n.addStoredMark(l.create({...e,...t}))}else a.forEach(e=>{let i=e.$from.pos,o=e.$to.pos;r.doc.nodesBetween(i,o,(e,r)=>{let s=Math.max(r,i),a=Math.min(r+e.nodeSize,o);e.marks.find(e=>e.type===l)?e.marks.forEach(e=>{l===e.type&&n.addMark(s,a,l.create({...e.attrs,...t}))}):n.addMark(s,a,l.create(t))})});return function(e,t,n){var r;let{selection:i}=t,o=null;
278if(of(i)&&(o=i.$cursor),o){let t=null!=(r=e.storedMarks)?r:o.marks();return o.parent.type.allowsMarkType(n)&&(!!n.isInSet(t)||!t.some(e=>e.type.excludes(n)))}let{ranges:s}=i;return s.some(({$from:t,$to:r})=>{let i=0===t.depth&&e.doc.inlineContent&&e.doc.type.allowsMarkType(n);return e.doc.nodesBetween(t.pos,r.pos,(e,t,r)=>{if(i)return!1;if(e.isInline){let t=!r||r.type.allowsMarkType(n),o=!!n.isInSet(e.marks)||!e.marks.some(e=>e.type.excludes(n));i=t&&o}return!i}),i})}(r,n,l)},sM=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),sC=(e,t={})=>({state:n,dispatch:r,chain:i})=>{let o,s=i8(e,n.schema);return(n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),s.isTextblock)?i().command(({commands:e})=>!!t9(s,{...o,...t})(n)||e.clearNodes()).command(({state:e})=>t9(s,{...o,...t})(e,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},sN=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,r=om(e,0,n.content.size),i=tx.create(n,r);t.setSelection(i)}return!0},sE=(e,t)=>({tr:n,state:r,dispatch:i})=>{let o,s,{selection:a}=r;return"number"==typeof t?(o=t,s=t):t&&"from"in t&&"to"in t?(o=t.from,s=t.to):(o=a.from,s=a.to),i&&n.doc.nodesBetween(o,s,(t,r)=>{t.isText||n.setNodeMarkup(r,void 0,{...t.attrs,dir:e})}),!0},sT=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,{from:r,to:i}="number"==typeof e?{from:e,to:e}:e,o=ty.atStart(n).from,s=ty.atEnd(n).to,a=om(r,o,s),l=om(i,o,s),c=ty.create(n,a,l);t.setSelection(c)}return!0},sO=e=>({state:t,dispatch:n})=>ns(i8(e,t.schema))(t,n);function sA(e,t){let n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){let r=n.filter(e=>null==t?void 0:t.includes(e.type.name));e.tr.ensureMarks(r)}}var sj=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{let{selection:o,doc:s}=t,{$from:a,$to:l}=o,c=sf(i.extensionManager.attributes,a.node().type.name,a.node().attrs);if(o instanceof tx&&o.node.isBlock)return!!a.parentOffset&&!!e4(s,a.pos)&&(r&&(e&&sA(n,i.extensionManager.splittableMarks),t.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;let d=l.parentOffset===l.parent.content.size,h=0===a.depth?void 0:function(e){for(let t=0;t<e.edgeCount;t+=1){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}(a.node(-1).contentMatchAt(a.indexAfter(-1))),u=d&&h?[{type:h,attrs:c}]:void 0,p=e4(t.doc,t.mapping.map(a.pos),1,u);if(!u&&!p&&e4(t.doc,t.mapping.map(a.pos),1,h?[{type:h}]:void 0)&&(p=!0,u=h?[{type:h,attrs:c}]:void 0),r){if(p&&(o instanceof ty&&t.deleteSelection(),t.split(t.mapping.map(a.pos),1,u),h&&!d&&!a.parentOffset&&a.parent.type!==h)){let e=t.mapping.map(a.before()),n=t.doc.resolve(e);a.node(-1).canReplaceWith(n.index(),n.index()+1,h)&&t.setNodeMarkup(t.mapping.map(a.before()),h)}e&&sA(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return p},sI=(e,t={})=>({tr:n,state:r,dispatch:i,editor:o})=>{var s;let a=i8(e,r.schema),{$from:l,$to:c}=r.selection,d=r.selection.node;if(d&&d.isBlock||l.depth<2||!l.sameParent(c))return!1;let h=l.node(-1);if(h.type!==a)return!1;let u=o.extensionManager.attributes;if(0===l.parent.content.size&&l.node(-1).childCount===l.indexAfter(-1)){if(2===l.depth||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return!1;if(i){let e=H.empty,r=l.index(-1)?1:l.index(-2)?2:3;for(let t=l.depth-r;t>=l.depth-3;t-=1)e=H.from(l.node(t).copy(e));let i=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,o={...sf(u,l.node().type.name,l.node().attrs),...t},c=(null==(s=a.contentMatch.defaultType)?void 0:s.createAndFill(o))||void 0;e=e.append(H.from(a.createAndFill(null,c)||void 0));let d=l.before(l.depth-(r-1));n.replace(d,l.after(-i),new G(e,4-r,0));let h=-1;n.doc.nodesBetween(d,n.doc.content.size,(e,t)=>{if(h>-1)return!1;e.isTextblock&&0===e.content.size&&(h=t+1)}),h>-1&&n.setSelection(ty.near(n.doc.resolve(h))),n.scrollIntoView()}return!0}let p=c.pos===l.end()?h.contentMatchAt(0).defaultType:null,f={...sf(u,h.type.name,h.attrs),...t},m={...sf(u,l.node().type.name,l.node().attrs),...t};n.delete(l.pos,c.pos);let g=p?[{type:a,attrs:f},{type:p,attrs:m}]:[{type:a,attrs:f}];if(!e4(n.doc,l.pos,2))return!1;if(i){let{selection:e,storedMarks:t}=r,{splittableMarks:s}=o.extensionManager,a=t||e.$to.parentOffset&&e.$from.marks();if(n.split(l.pos,2,g).scrollIntoView(),!a||!i)return!0;let c=a.filter(e=>
278s.includes(e.type.name));n.ensureMarks(c)}return!0},sD=(e,t)=>{let n=o2(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(void 0===r)return!0;let i=e.doc.nodeAt(r);return!(n.node.type===(null==i?void 0:i.type)&&e6(e.doc,n.pos))||(e.join(n.pos),!0)},sR=(e,t)=>{let n=o2(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(n.start).after(n.depth);if(void 0===r)return!0;let i=e.doc.nodeAt(r);return!(n.node.type===(null==i?void 0:i.type)&&e6(e.doc,r))||(e.join(r),!0)},sL=(e,t,n,r={})=>({editor:i,tr:o,state:s,dispatch:a,chain:l,commands:c,can:d})=>{let{extensions:h,splittableMarks:u}=i.extensionManager,p=i8(e,s.schema),f=i8(t,s.schema),{selection:m,storedMarks:g}=s,{$from:y,$to:b}=m,x=y.blockRange(b),v=g||m.$to.parentOffset&&m.$from.marks();if(!x)return!1;let w=o2(e=>sy(e.type.name,h))(m);if(x.depth>=1&&w&&x.depth-w.depth<=1){if(w.node.type===p)return c.liftListItem(f);if(sy(w.node.type.name,h)&&p.validContent(w.node.content)&&a)return l().command(()=>(o.setNodeMarkup(w.pos,p),!0)).command(()=>sD(o,p)).command(()=>sR(o,p)).run()}return n&&v&&a?l().command(()=>{let e=d().wrapInList(p,r),t=v.filter(e=>u.includes(e.type.name));return o.ensureMarks(t),!!e||c.clearNodes()}).wrapInList(p,r).command(()=>sD(o,p)).command(()=>sR(o,p)).run():l().command(()=>!!d().wrapInList(p,r)||c.clearNodes()).wrapInList(p,r).command(()=>sD(o,p)).command(()=>sR(o,p)).run()},sP=(e,t={},n={})=>({state:r,commands:i})=>{let{extendEmptyMarkRange:o=!1}=n,s=oh(e,r.schema);return sm(r,s,t)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,t)},sB=(e,t,n={})=>({state:r,commands:i})=>{let o,s=i8(e,r.schema),a=i8(t,r.schema),l=oP(r,s,n);return(r.selection.$anchor.sameParent(r.selection.$head)&&(o=r.selection.$anchor.parent.attrs),l)?i.setNode(a,o):i.setNode(s,{...o,...n})},sz=(e,t={})=>({state:n,commands:r})=>{let i=i8(e,n.schema);return oP(n,i,t)?r.lift(i):r.wrapIn(i,t)},s$=()=>({state:e,dispatch:t})=>{let n=e.plugins;for(let r=0;r<n.length;r+=1){let i,o=n[r];if(o.spec.isInputRules&&(i=o.getState(e))){if(t){let t=e.tr,n=i.transform;for(let e=n.steps.length-1;e>=0;e-=1)t.step(n.steps[e].invert(n.docs[e]));if(i.text){let n=t.doc.resolve(i.from).marks();t.replaceWith(i.from,i.to,e.schema.text(i.text,n))}else t.delete(i.from,i.to)}return!0}}return!1},s_=()=>({tr:e,dispatch:t})=>{let{selection:n}=e,{empty:r,ranges:i}=n;
278return!!r||(t&&i.forEach(t=>{e.removeMark(t.$from.pos,t.$to.pos)}),!0)},sV=(e,t={})=>({tr:n,state:r,dispatch:i})=>{var o;let{extendEmptyMarkRange:s=!1}=t,{selection:a}=n,l=oh(e,r.schema),{$from:c,empty:d,ranges:h}=a;if(!i)return!0;if(d&&s){let{from:e,to:t}=a,r=null==(o=c.marks().find(e=>e.type===l))?void 0:o.attrs,i=od(c,l,r);i&&(e=i.from,t=i.to),n.removeMark(e,t,l)}else h.forEach(e=>{n.removeMark(e.$from.pos,e.$to.pos,l)});return n.removeStoredMark(l),!0},sF=e=>({tr:t,state:n,dispatch:r})=>{let i,o,{selection:s}=n;return"number"==typeof e?(i=e,o=e):e&&"from"in e&&"to"in e?(i=e.from,o=e.to):(i=s.from,o=s.to),r&&t.doc.nodesBetween(i,o,(e,n)=>{if(e.isText)return;let r={...e.attrs};delete r.dir,t.setNodeMarkup(n,void 0,r)}),!0},sH=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null,a=oV("string"==typeof e?e:e.name,r.schema);if(!a)return!1;"node"===a&&(o=i8(e,r.schema)),"mark"===a&&(s=oh(e,r.schema));let l=!1;return n.selection.ranges.forEach(e=>{let a,c,d,h,u=e.$from.pos,p=e.$to.pos;n.selection.empty?r.doc.nodesBetween(u,p,(e,t)=>{o&&o===e.type&&(l=!0,d=Math.max(t,u),h=Math.min(t+e.nodeSize,p),a=t,c=e)}):r.doc.nodesBetween(u,p,(e,r)=>{r<u&&o&&o===e.type&&(l=!0,d=Math.max(r,u),h=Math.min(r+e.nodeSize,p),a=r,c=e),r>=u&&r<=p&&(o&&o===e.type&&(l=!0,i&&n.setNodeMarkup(r,void 0,{...e.attrs,...t})),s&&e.marks.length&&e.marks.forEach(o=>{if(s===o.type&&(l=!0,i)){let i=Math.max(r,u),a=Math.min(r+e.nodeSize,p);n.addMark(i,a,s.create({...o.attrs,...t}))}}))}),c&&(void 0!==a&&i&&n.setNodeMarkup(a,void 0,{...c.attrs,...t}),s&&c.marks.length&&c.marks.forEach(e=>{s===e.type&&i&&n.addMark(d,h,s.create({...e.attrs,...t}))}))}),l},sq=(e,t={})=>({state:n,dispatch:r})=>t7(i8(e,n.schema),t)(n,r),sU=(e,t={})=>({state:n,dispatch:r})=>ni(i8(e,n.schema),t)(n,r),sW=class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){let n=this.callbacks[e];return n&&n.forEach(e=>e.apply(this,t)),this}off(e,t){let n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter(e=>e!==t):delete this.callbacks[e]),this}once(e,t){let n=(...r)=>{this.off(e,n),t.apply(this,r)};return this.on(e,n)}removeAllListeners(){this.callbacks={}}},sK=class{constructor(e){var t;this.find=e.find,this.handler=e.handler,this.undoable=null==(t=e.undoable)||t}};function sJ(e){var t;let{editor:n,from:r,to:i,text:o,rules:s,plugin:a}=e,{view:l}=n;if(l.composing)return!1;let c=l.state.doc.resolve(r);if(c.parent.type.spec.code||(null==(t=c.nodeBefore||c.nodeAfter)?void 0:t.marks.find(e=>e.type.spec.code)))return!1;let d=!1,h=((e,t=500)=>{let n="",r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(e,t,i,o)=>{var s,a;let l=(null==(a=(s=e.type.spec).toText)?void 0:a.call(s,{node:e,pos:t,parent:i,index:o}))||e.textContent||"%leaf%";n+=e.isAtom&&!e.isText?l:l.slice(0,Math.max(0,r-t))}),n})(c)+o;return s.forEach(e=>{if(d)return;let t=((e,t)=>{if(oo(t))return t.exec(e);let n=t(e);if(!n)return null;let r=[n.text];return r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r})(h,e.find);if(!t)return;let s=l.state.tr,c=iZ({state:l.state,transaction:s}),u={from:r-(t[0].length-o.length),to:i}
278,{commands:p,chain:f,can:m}=new i0({editor:n,state:c});null!==e.handler({state:c,range:u,match:t,commands:p,chain:f,can:m})&&s.steps.length&&(e.undoable&&s.setMeta(a,{transform:s,from:r,to:i,text:o}),l.dispatch(s),d=!0)}),d}function sG(e){return"Object"===Object.prototype.toString.call(e).slice(8,-1)&&e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}var sX=class{constructor(e={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...e},this.name=this.config.name}get options(){return{...o7(o3(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...o7(o3(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(e={}){let t=this.extend({...this.config,addOptions:()=>(function e(t,n){let r={...t};return sG(t)&&sG(n)&&Object.keys(n).forEach(i=>{sG(n[i])&&sG(t[i])?r[i]=e(t[i],n[i]):r[i]=n[i]}),r})(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){let t=new this.constructor({...this.config,...e});return t.parent=this,this.child=t,t.name="name"in e?e.name:t.parent.name,t}},sQ=class e extends sX{constructor(){super(...arguments),this.type="mark"}static create(t={}){return new e("function"==typeof t?t():t)}static handleExit({editor:e,mark:t}){let{tr:n}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){let i=r.marks();if(!i.find(e=>(null==e?void 0:e.type.name)===t.name))return!1;let o=i.find(e=>(null==e?void 0:e.type.name)===t.name);return o&&n.removeStoredMark(o),n.insertText(" ",r.pos),e.view.dispatch(n),!0}return!1}configure(e){return super.configure(e)}extend(e){let t="function"==typeof e?e():e;return super.extend(t)}},sY=class{constructor(e){this.find=e.find,this.handler=e.handler}},sZ=null,s0=class{constructor(e,t){this.splittableMarks=[],this.editor=t,this.baseExtensions=e,this.extensions=sa(e),this.schema=function(e,t){var n;let r=o8(e),{nodeExtensions:i,markExtensions:o}=o9(e),s=null==(n=i.find(e=>o3(e,"topNode")))?void 0:n.name;return new eS({topNode:s,nodes:Object.fromEntries(i.map(n=>{let i=r.filter(e=>e.type===n.name),o={name:n.name,options:n.options,storage:n.storage,editor:t},s=si({...e.reduce((e,t)=>{let r=o3(t,"extendNodeSchema",o);return{...e,...r?r(n):{}}},{}),content:o7(o3(n,"content",o)),marks:o7(o3(n,"marks",o)),group:o7(o3(n,"group",o)),inline:o7(o3(n,"inline",o)),atom:o7(o3(n,"atom",o)),selectable:o7(o3(n,"selectable",o)),draggable:o7(o3(n,"draggable",o)),code:o7(o3(n,"code",o)),whitespace:o7(o3(n,"whitespace",o)),linebreakReplacement:o7(o3(n,"linebreakReplacement",o)),defining:o7(o3(n,"defining",o)),isolating:o7(o3(n,"isolating",o)),attrs:Object.fromEntries(i.map(so))}),a=o7(o3(n,"parseHTML",o));a&&(s.parseDOM=a.map(e=>sr(e,i)));let l=o3(n,"renderHTML",o);l&&(s.toDOM=e=>l({node:e,HTMLAttributes:sn(e,i)}));let c=o3(n,"renderText",o);return c&&(s.toText=c),[n.name,s]})),marks:Object.fromEntries(o.map(n=>{let i=r.filter(e=>e.type===n.name),o={name:n.name,options:n.options,storage:n.storage,editor:t},s=si({...e.reduce((e,t)=>{let r=o3(t,"extendMarkSchema",o);return{...e,...r?r(n):{}}},{}),inclusive:o7(o3(n,"inclusive",o)),excludes:o7(o3(n,"excludes",o)),group:o7(o3(n,"group",o)),spanning:o7(o3(n,"spanning",o)),code:o7(o3(n,"code",o)),attrs:Object.fromEntries(i.map(so))}),a=o7(o3(n,"parseHTML",o));a&&(s.parseDOM=a.map(e=>sr(e,i)));let l=o3(n,"renderHTML",o);return l&&(s.toDOM=e=>l({mark:e,HTMLAttributes:sn(e,i)})),[n.name,s]}))})}(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce((e,t)=>{let n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:sp(t.name,this.schema)},r=o3(t,"addCommands",n);return r?{...e,...r()}:e},{})}get plugins(){let{editor:e}=this;return ss([...this.extensions].reverse()).flatMap(t=>{let n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:sp(t.name,this.schema)},r=[],i=o3(t,"addKeyboardShortcuts",n),o={};if("mark"===t.type&&o3(t,"exitable",n)&&(o.ArrowRight=()=>sQ.handleExit({editor:e,mark:t})),i){let t=Object.fromEntries(Object.entries(i()).map(([t,n])=>[t,()=>n({editor:e})]));o={...o,...t}}let s=new tj({props:{handleKeyDown:iX(o)}});r.push(s);let a=o3(t,"addInputRules",n);if(sg(t,e.options.enableInputRules)&&a){let t=a();if(t&&t.length){let n=function(e){let{editor:t,rules:n}=e,r=new tj({state:{init:()=>null,apply(e,i,o){let s=e.getMeta(r);if(s)return s;let a=e.getMeta("applyInputRules");return a&&setTimeout(()=>{let{text:e}=a;"string"==typeof e||(e=o4(H.from(e),o.schema));let{from:i}=a,s=i+e.length;sJ({editor:t,from:i,to:s,text:e,rules:n,plugin:r})}),e.selectionSet||e.docChanged?null:i}},props:{handleTextInput:(e,i,o,s)=>sJ({editor:t,from:i,to:o,text:s,rules:n,plugin:r}),handleDOMEvents:{compositionend:e=>(setTimeout(()=>{let{$cursor:i}=e.state.selection;i&&sJ({editor:t,from:i.pos,to:i.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(e,i){if("Enter"!==i.key)return!1;let{$cursor:o}=e.state.selection;return!!o&&sJ({editor:t,from:o.pos,to:o.pos,text:"\n",rules:n,plugin:r})}},isInputRules:!0});return r}({editor:e,rules:t}),i=Array.isArray(n)?n:[n];r.push(...i)}}let l=o3(t,"addPasteRules",n);if(sg(t,e.options.enablePasteRules)&&l){let t=l();if(t&&t.length){let n=function(e){let t,{editor:n,rules:r}=e,i=null,o=!1,s=!1,a="u">typeof ClipboardEvent?new ClipboardEvent("paste"):null;try{t="u">typeof DragEvent?new DragEvent("drop"):null}catch{t=null}let l=({state:e,from:r,to:i,rule:o,pasteEvt:s})=>{let l=e.tr;if(function(e){let{editor:t,state:n,from:r,to:i,rule:o,pasteEvent:s,dropEvent:a}=e,{commands:l,chain:c,can:d}=new i0({editor:t,state:n}),h=[];return n.doc.nodesBetween(r,i,(e,t)=>{var u,p,f,m,g;if((null==(p=null==(u=e.type)?void 0:u.spec)?void 0:p.code)||!(e.isText||e.isTextblock||e.isInline))return;let y=null!=(g=null!=(m=null==(f=e.content)?void 0:f.size)?m:e.nodeSize)?g:0,b=Math.max(r,t),x=Math.min(i,t+y);b>=x||((e,t,n)=>{if(oo(t))return[...e.matchAll(t)];let r=t(e,n);return r?r.map(t=>{let n=[t.text];return n.index=t.index,n.input=e,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),n.push(t.replaceWith)),n}):[]})(e.isText?e.text||"":e.textBetween(b-t,x-t,void 0,""),o.find,s).forEac
278h(e=>{if(void 0===e.index)return;let t=b+e.index+1,r=t+e[0].length,i={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},u=o.handler({state:n,range:i,match:e,commands:l,chain:c,can:d,pasteEvent:s,dropEvent:a});h.push(u)})}),h.every(e=>null!==e)}({editor:n,state:iZ({state:e,transaction:l}),from:Math.max(r-1,0),to:i.b-1,rule:o,pasteEvent:s,dropEvent:t})&&l.steps.length){try{t="u">typeof DragEvent?new DragEvent("drop"):null}catch{t=null}return a="u">typeof ClipboardEvent?new ClipboardEvent("paste"):null,l}};return r.map(e=>new tj({view(e){let t=t=>{var r;(i=(null==(r=e.dom.parentElement)?void 0:r.contains(t.target))?e.dom.parentElement:null)&&(sZ=n)},r=()=>{sZ&&(sZ=null)};return window.addEventListener("dragstart",t),window.addEventListener("dragend",r),{destroy(){window.removeEventListener("dragstart",t),window.removeEventListener("dragend",r)}}},props:{handleDOMEvents:{drop:(e,n)=>{if(s=i===e.dom.parentElement,t=n,!s){let e=sZ;(null==e?void 0:e.isEditable)&&setTimeout(()=>{let t=e.state.selection;t&&e.commands.deleteRange({from:t.from,to:t.to})},10)}return!1},paste:(e,t)=>{var n;let r=null==(n=t.clipboardData)?void 0:n.getData("text/html");return a=t,o=!!(null==r?void 0:r.includes("data-pm-slice")),!1}}},appendTransaction:(t,n,r)=>{let i=t[0],c="paste"===i.getMeta("uiEvent")&&!o,d="drop"===i.getMeta("uiEvent")&&!s,h=i.getMeta("applyPasteRules"),u=!!h;if(!c&&!d&&!u)return;if(u){var p,f;let t,{text:n}=h;"string"==typeof n||(n=o4(H.from(n),r.schema));let{from:i}=h,o=i+n.length;return l({rule:e,state:r,from:i,to:{b:o},pasteEvt:(p=n,null==(f=(t=new ClipboardEvent("paste",{clipboardData:new DataTransfer})).clipboardData)||f.setData("text/html",p),t)})}let m=n.doc.content.findDiffStart(r.doc.content),g=n.doc.content.findDiffEnd(r.doc.content);if("number"==typeof m&&g&&m!==g.b)return l({rule:e,state:r,from:m,to:g,pasteEvt:a})}}))}({editor:e,rules:t});r.push(...n)}}let c=o3(t,"addProseMirrorPlugins",n);if(c){let e=c();r.push(...e)}return r})}get attributes(){return o8(this.extensions)}get nodeViews(){let{editor:e}=this,{nodeExtensions:t}=o9(this.extensions);return Object.fromEntries(t.filter(e=>!!o3(e,"addNodeView")).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:i8(t.name,this.schema)},i=o3(t,"addNodeView",r);if(!i)return[];let o=i();return o?[t.name,(r,i,s,a,l)=>{let c=sn(r,n);return o({node:r,view:i,getPos:s,decorations:a,innerDecorations:l,editor:e,extension:t,HTMLAttributes:c})}]:[]}))}dispatchTransaction(e){let{editor:t}=this;return ss([...this.extensions].reverse()).reduceRight((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:sp(n.name,this.schema)},i=o3(n,"dispatchTransaction",r);return i?t=>{i.call(r,{transaction:t,next:e})}:e},e)}transformPastedHTML(e){let{editor:t}=this;return ss([...this.extensions]).reduce((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:sp(n.name,this.schema)},i=o3(n,"transformPastedHTML",r);return i?(t,n)=>{let o=e(t,n);return i.call(r,o)}:e},e||(e=>e))}get markViews(){let{editor:e}=this,{markExtensions:t}=o9(this.extensions);return Object.fromEntries(t.filter(e=>!!o3(e,"addMarkView")).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:oh(t.name,this.schema)},i=o3(t,"addMarkView",r);return i?[t.name,(r,o,s)=>{let a=sn(r,n);return i()({mark:r,view:o,inline:s,editor:e,extension:t,HTMLAttributes:a,updateAttributes:t=>{!function(e,t,n={}){let{state:r}=t,{doc:i,tr:o}=r;i.descendants((t,r)=>{let i=o.mapping.map(r),s=o.mapping.map(r)+t.nodeSize,a=null;if(t.marks.forEach(t=>{if(t!==e)return!1;a=t}),!a)return;let l=!1;if(Object.keys(n).forEach(e=>{n[e]!==a.attrs[e]&&(l=!0)}),l){let t=e.type.create({...e.attrs,...n});o.removeMark(i,s,e.type),o.addMark(i,s,t)}}),o.docChanged&&t.view.dispatch(o)}(r,e,t)}})}]:[]}))}setupExtensions(){let e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map(e=>
278[e.name,e.storage])),e.forEach(e=>{var t;let n={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:sp(e.name,this.schema)};"mark"===e.type&&(null==(t=o7(o3(e,"keepOnSplit",n)))||t)&&this.splittableMarks.push(e.name);let r=o3(e,"onBeforeCreate",n),i=o3(e,"onCreate",n),o=o3(e,"onUpdate",n),s=o3(e,"onSelectionUpdate",n),a=o3(e,"onTransaction",n),l=o3(e,"onFocus",n),c=o3(e,"onBlur",n),d=o3(e,"onDestroy",n);r&&this.editor.on("beforeCreate",r),i&&this.editor.on("create",i),o&&this.editor.on("update",o),s&&this.editor.on("selectionUpdate",s),a&&this.editor.on("transaction",a),l&&this.editor.on("focus",l),c&&this.editor.on("blur",c),d&&this.editor.on("destroy",d)})}};s0.resolve=sa,s0.sort=ss,s0.flatten=o5,iY({},{ClipboardTextSerializer:()=>s2,Commands:()=>s3,Delete:()=>s5,Drop:()=>s4,Editable:()=>s6,FocusEvents:()=>s9,Keymap:()=>s8,Paste:()=>ae,Tabindex:()=>at,TextDirection:()=>an,focusEventsPluginKey:()=>s7});var s1=class e extends sX{constructor(){super(...arguments),this.type="extension"}static create(t={}){return new e("function"==typeof t?t():t)}configure(e){return super.configure(e)}extend(e){let t="function"==typeof e?e():e;return super.extend(t)}},s2=s1.create({name:"clipboardTextSerializer",addOptions:()=>({blockSeparator:void 0}),addProseMirrorPlugins(){return[new tj({key:new tR("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{let{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,{ranges:o}=i,s=Math.min(...o.map(e=>e.$from.pos)),a=Math.max(...o.map(e=>e.$to.pos)),l=sc(n);return sl(r,{from:s,to:a},{...void 0!==this.options.blockSeparator?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),s3=s1.create({name:"commands",addCommands:()=>({...i1})}),s5=s1.create({name:"delete",onUpdate({transaction:e,appendedTransactions:t}){var n,r,i;let o=()=>{var n,r,i,o;if(null!=(o=null==(i=null==(r=null==(n=this.editor.options.coreExtensionOptions)?void 0:n.delete)?void 0:r.filterTransaction)?void 0:i.call(r,e))?o:e.getMeta("y-sync$"))return;let s=o0(e.before,[e,...t]);sh(s).forEach(t=>{s.mapping.mapResult(t.oldRange.from).deletedAfter&&s.mapping.mapResult(t.oldRange.to).deletedBefore&&s.before.nodesBetween(t.oldRange.from,t.oldRange.to,(n,r)=>{let i=r+n.nodeSize-2,o=t.oldRange.from<=r&&i<=t.oldRange.to;this.editor.emit("delete",{type:"node",node:n,from:r,to:i,newFrom:s.mapping.map(r),newTo:s.mapping.map(i),deletedRange:t.oldRange,newRange:t.newRange,partial:!o,editor:this.editor,transaction:e,combinedTransform:s})})});let a=s.mapping;s.steps.forEach((t,n)=>{var r,i;if(t instanceof eK){let o=a.slice(n).map(t.from,-1),l=a.slice(n).map(t.to),c=a.invert().map(o,-1),d=a.invert().map(l),h=null==(r=s.doc.nodeAt(o-1))?void 0:r.marks.some(e=>e.eq(t.mark)),u=null==(i=s.doc.nodeAt(l))?void 0:i.marks.some(e=>e.eq(t.mark));this.editor.emit("delete",{type:"mark",mark:t.mark,from:t.from,to:t.to,deletedRange:{from:c,to:d},newRange:{from:o,to:l},partial:!!(u||h),editor:this.editor,transaction:e,combinedTransform:s})}})};null==(i=null==(r=null==(n=this.editor.options.coreExtensionOptions)?void 0:n.delete)?void 0:r.async)||i?setTimeout(o,0):o()}}),s4=s1.create({name:"drop",addProseMirrorPlugins(){return[new tj({key:new tR("tiptapDrop"),props:{handleDrop:(e,t,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),s6=s1.create({name:"editable",addProseMirrorPlugins(){return[new tj({key:new tR("editable"),props:{editable:()=>this.editor.options.editable}})]}}),s7=new tR("focusEvents"),s9=s1.create({name:"focusEvents",addProseMirrorPlugins(){let{editor:e}=this;return[new tj({key:s7,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;let r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;let r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),s8=s1.create({name:"keymap",addKeyboardShortcuts(){let e=()=>this.editor.commands.first(({commands:e})=>[()=>e.undoInputRule(),()=>e.command(({tr:t})=>{let{selection:n,doc:r}=t,{empty:i,$anchor:o}=n,{pos:s,parent:a}=o,l=o.parent.isTextblock&&s>0?t.doc.resolve(s-1):o,c=l.parent.type.spec.isolating,d=o.pos-o.parentOffset,h=c&&1===l.parent.childCount?d===o.pos:tp.atStart(r).from===s;return!!i&&!!a.type.isTextblock&&!a.textContent.length&&!!h&&(!h||"paragraph"!==o.parent.type.name)&&e.clearNodes()}),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:e})=>[()=>e.deleteSelection(),()=>e.deleteCurrentNode(),()=>e.joinForward(),()=>e.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:e})=>[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},i={...n,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return ob()||oR()?i:r},addProseMirrorPlugins(){return[new tj({key:new tR("clearDocument"),appendTransaction:(e,t,n)=>{if(e.some(e=>e.getMeta("composition")))return;let r=e.some(e=>e.docChanged)&&!t.doc.eq(n.doc),i=e.some(e=>e.getMeta("preventClearDocument"));if(!r||i)return;let{empty:o,from:s,to:a}=t.selection,l=tp.atStart(t.doc).from,c=tp.atEnd(t.doc).to;
278if(o||s!==l||a!==c||!sb(n.doc))return;let d=n.tr,h=iZ({state:n,transaction:d}),{commands:u}=new i0({editor:this.editor,state:h});if(u.clearNodes(),d.steps.length)return d}})]}}),ae=s1.create({name:"paste",addProseMirrorPlugins(){return[new tj({key:new tR("tiptapPaste"),props:{handlePaste:(e,t,n)=>{this.editor.emit("paste",{editor:this.editor,event:t,slice:n})}}})]}}),at=s1.create({name:"tabindex",addProseMirrorPlugins(){return[new tj({key:new tR("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),an=s1.create({name:"textDirection",addOptions:()=>({direction:void 0}),addGlobalAttributes(){if(!this.options.direction)return[];let{nodeExtensions:e}=o9(this.extensions);return[{types:e.filter(e=>"text"!==e.name).map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{let t=e.getAttribute("dir");return t&&("ltr"===t||"rtl"===t||"auto"===t)?t:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new tj({key:new tR("textDirection"),props:{attributes:()=>{let e=this.options.direction;return e?{dir:e}:{}}}})]}}),ar=class e{constructor(e,t,n=!1,r=null){this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=e,this.editor=t,this.currentNode=r}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return null!=(e=this.actualDepth)?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let t=this.from,n=this.to;if(this.isBlock){if(0===this.content.size)return void console.error(`You can\u2019t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);t=this.from+1,n=this.to-1}this.editor.commands.insertContentAt({from:t,to:n},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+ +!this.node.isText}get parent(){if(0===this.depth)return null;let t=this.resolvedPos.start(this.resolvedPos.depth-1);return new e(this.resolvedPos.doc.resolve(t),this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new e(t,this.editor)}get after(){let t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new e(t,this.editor)}get children(){let t=[];return this.node.content.forEach((n,r)=>{let i=n.isBlock&&!n.isTextblock,o=n.isAtom&&!n.isText,s=n.isInline,a=this.pos+r+ +!o;if(a<0||a>this.resolvedPos.doc.nodeSize-2)return;let l=this.resolvedPos.doc.resolve(a);if(!i&&!s&&l.depth<=this.depth)return;let c=new e(l,this.editor,i,i||s?n:null);i&&(c.actualDepth=this.depth+1),t.push(c)}),t}get firstChild(){return this.children[0]||null}get lastChild(){let e=this.children;return e[e.length-1]||null}closest(e,t={}){let n=null,r=this.parent;for(;r&&!n;){if(r.node.type.name===e)if(Object.keys(t).length>0){let e=r.node.attrs,n=Object.keys(t);for(let r=0;r<n.length;r+=1){let i=n[r];if(e[i]!==t[i])break}}else n=r;r=r.parent}return n}querySelector(e,t={}){return this.querySelectorAll(e,t,!0)[0]||null}querySelectorAll(e,t={},n=!1){let r=[];if(!this.children||0===this.children.length)return r;let i=Object.keys(t);return this.children.forEach(o=>{n&&r.length>0||(o.node.type.name===e&&i.every(e=>t[e]===o.node.attrs[e])&&r.push(o),n&&r.length>0||(r=r.concat(o.querySelectorAll(e,t,n))))}),r}setAttribute(e){let{tr:t}=this.editor.state;t.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(t)}},ai=`.ProseMirror {
279  position: relative;
280}
281
282.ProseMirror {
283  word-wrap: break-word;
284  white-space: pre-wrap;
285  white-space: break-spaces;
286  -webkit-font-variant-ligatures: none;
287  font-variant-ligatures: none;
288  font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
289}
290
291.ProseMirror [contenteditable="false"] {
292  white-space: normal;
293}
294
295.ProseMirror [contenteditable="false"] [contenteditable="true"] {
296  white-space: pre-wrap;
297}
298
299.ProseMirror pre {
300  white-space: pre-wrap;
301}
302
303img.ProseMirror-separator {
304  display: inline !important;
305  border: none !important;
306  margin: 0 !important;
307  width: 0 !important;
308  height: 0 !important;
309}
310
311.ProseMirror-gapcursor {
312  display: none;
313  pointer-events: none;
314  position: absolute;
315  margin: 0;
316}
317
318.ProseMirror-gapcursor:after {
319  content: "";
320  display: block;
321  position: absolute;
322  top: -2px;
323  width: 20px;
324  border-top: 1px solid black;
325  animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
326}
327
328@keyframes ProseMirror-cursor-blink {
329  to {
330    visibility: hidden;
331  }
332}
333
334.ProseMirror-hideselection *::selection {
335  background: transparent;
336}
337
338.ProseMirror-hideselection *::-moz-selection {
339  background: transparent;
340}
341
342.ProseMirror-hideselection * {
343  caret-color: transparent;
344}
345
346.ProseMirror-focused .ProseMirror-gapcursor {
347  display: block;
348}`,ao=class extends sW{constructor(e={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:"u">typeof document?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:e})=>{throw e},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:sw,createMappablePosition:sk},this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:e,slice:t,moved:n})=>this.options.onDrop(e,t,n)),this.on("paste",({event:e,slice:t})=>this.options.onPaste(e,t)),this.on("delete",this.options.onDelete);const t=this.createDoc(),n=og(t,this.options.autofocus);this.editorState=tA.create({doc:t,schema:this.schema,selection:n||void 0}),this.options.element&&this.mount(this.options.element)}mount(e){if("u"<typeof document)throw Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(e),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(!1!==this.options.autofocus&&null!==this.options.autofocus&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){let e=this.editorView.dom;(null==e?void 0:e.editor)&&delete e.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{"function"==typeof this.css.remove?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(e){console.warn("Failed to remove CSS element:",e)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&"u">typeof document&&(this.css=function(e,t){let n=document.querySelector("style[data-tiptap-style]");if(null!==n)return n;let r=document.createElement("style");return t&&r.setAttribute("nonce",t),r.setAttribute("data-tiptap-style",""),r.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(r),r}(ai,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},this.editorView&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}
348),t&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:e=>{this.editorState=e},dispatch:e=>{this.dispatchTransaction(e)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(e,t)=>{if(this.editorView)return this.editorView[t];if("state"===t)return this.editorState;if(t in e)return Reflect.get(e,t);throw Error(`[tiptap error]: The editor view is not available. Cannot access view['${t}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,t){let n=o6(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(e){if(this.isDestroyed)return;let t=this.state.plugins,n=t;if([].concat(e).forEach(e=>{let t="string"==typeof e?`${e}$`:e.key;n=n.filter(e=>!e.key.startsWith(t))}),t.length===n.length)return;let r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var e,t;let n=[...this.options.enableCoreExtensions?[s6,s2.configure({blockSeparator:null==(t=null==(e=this.options.coreExtensionOptions)?void 0:e.clipboardTextSerializer)?void 0:t.blockSeparator}),s3,s9,s8,at,s4,ae,s5,an.configure({direction:this.options.textDirection})].filter(e=>"object"!=typeof this.options.enableCoreExtensions||!1!==this.options.enableCoreExtensions[e.name]):[],...this.options.extensions].filter(e=>["extension","node","mark"].includes(null==e?void 0:e.type));this.extensionManager=new s0(n,this)}createCommandManager(){this.commandManager=new i0({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=oQ(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(t){if(!(t instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(t.message))throw t;this.emit("contentError",{editor:this,error:t,disableCollaboration:()=>{"collaboration"in this.storage&&"object"==typeof this.storage.collaboration&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(e=>"collaboration"!==e.name),this.createExtensionManager()}}),e=oQ(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return e}createView(e){let{editorProps:t,enableExtensionDispatchTransaction:n}=this.options,r=t.dispatchTransaction||this.dispatchTransaction.bind(this),i=n?this.extensionManager.dispatchTransaction(r):r,o=t.transformPastedHTML,s=this.extensionManager.transformPastedHTML(o);this.editorView=new iL(e,{...t,attributes:{role:"textbox",...null==t?void 0:t.attributes},dispatchTransaction:i,transformPastedHTML:s,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});let a=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(a),this.prependClass(),this.injectCSS(),this.view.dom.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;let t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(e=>{var t;return null==(t=this.capturedTransaction)?void 0:t.step(e)});return}let{state:t,transactions:n}=this.state.applyTransaction(e),r=!this.state.selection.eq(t.selection),i=n.includes(e),o=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:e,nextState:t}),!i)return;
348this.view.updateState(t),this.emit("transaction",{editor:this,transaction:e,appendedTransactions:n.slice(1)}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});let s=n.findLast(e=>e.getMeta("focus")||e.getMeta("blur")),a=null==s?void 0:s.getMeta("focus"),l=null==s?void 0:s.getMeta("blur");a&&this.emit("focus",{editor:this,event:a.event,transaction:s}),l&&this.emit("blur",{editor:this,event:l.event,transaction:s}),e.getMeta("preventUpdate")||!n.some(e=>e.docChanged)||o.doc.eq(t.doc)||this.emit("update",{editor:this,transaction:e,appendedTransactions:n.slice(1)})}getAttributes(e){return sd(this.state,e)}isActive(e,t){let n="string"==typeof e?e:null,r="string"==typeof e?t:e;return function(e,t,n={}){if(!t)return oP(e,null,n)||sm(e,null,n);let r=oV(t,e.schema);return"node"===r?oP(e,t,n):"mark"===r&&sm(e,t,n)}(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return o4(this.state.doc.content,this.schema)}getText(e){var t,n;let r,{blockSeparator:i="\n\n",textSerializers:o={}}=e||{};return t=this.state.doc,n={blockSeparator:i,textSerializers:{...sc(this.schema),...o}},r={from:0,to:t.content.size},sl(t,r,n)}get isEmpty(){return sb(this.state.doc)}destroy(){this.emit("destroy"),this.unmount(),this.removeAllListeners()}get isDestroyed(){var e,t;return null==(t=null==(e=this.editorView)?void 0:e.isDestroyed)||t}$node(e,t){var n;return(null==(n=this.$doc)?void 0:n.querySelector(e,t))||null}$nodes(e,t){var n;return(null==(n=this.$doc)?void 0:n.querySelectorAll(e,t))||null}$pos(e){return new ar(this.state.doc.resolve(e),this)}get $doc(){return this.$pos(0)}};function as(e){return new sK({find:e.find,handler:({state:t,range:n,match:r})=>{let i=o7(e.getAttributes,void 0,r);if(!1===i||null===i)return null;let{tr:o}=t,s=r[r.length-1],a=r[0];if(s){let r=a.search(/\S/),l=n.from+a.indexOf(s),c=l+s.length;if(su(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>l).length)return null;c<n.to&&o.delete(c,n.to),l>n.from&&o.delete(n.from+r,l);let d=n.from+r+s.length;o.addMark(n.from+r,d,e.type.create(i||{})),o.removeStoredMark(e.type)}},undoable:e.undoable})}function aa(e){return new sK({find:e.find,handler:({state:t,range:n,match:r})=>{let i=t.doc.resolve(n.from),o=o7(e.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,o)},undoable:e.undoable})}function al(e){return new sK({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{let o=o7(e.getAttributes,void 0,r)||{},s=t.tr.delete(n.from,n.to),a=s.doc.resolve(n.from).blockRange(),l=a&&e1(a,e.type,o);if(!l)return null;if(s.wrap(a,l),e.keepMarks&&e.editor){let{selection:n,storedMarks:r}=t,{splittableMarks:i}=e.editor.extensionManager,o=r||n.$to.parentOffset&&n.$from.marks();if(o){let e=o.filter(e=>i.includes(e.type.name));s.ensureMarks(e)}}if(e.keepAttributes){let t="bulletList"===e.type.name||"orderedList"===e.type.name?"listItem":"taskList";i().updateAttributes(t,o).run()}let c=s.doc.resolve(n.from-1).nodeBefore;c&&c.type===e.type&&e6(s.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,c))&&s.join(n.from-1)},undoable:e.undoable})}function ac(e){if(!(null==e?void 0:e.trim()))return{};let t={},n=[],r=e.replace(/["']([^"']*)["']/g,e=>(n.push(e),`__QUOTED_${n.length-1}__`)),i=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);i&&(t.class=i.map(e=>e.trim().slice(1)).join(" "));let o=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);o&&(t.id=o[1]),Array.from(r.matchAll(/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g)).forEach(([,e,r])=>{var i;let o=n[parseInt((null==(i=r.match(/__QUOTED_(\d+)__/))?void 0:i[1])||"0",10)];o&&(t[e]=o.slice(1,-1))});let s=r.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,"").replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();return s&&s.split(/\s+/).filter(Boolean).forEach(e=>
348{e.match(/^[a-zA-Z][\w-]*$/)&&(t[e]=!0)}),t}function ad(e){if(!e||0===Object.keys(e).length)return"";let t=[];return e.class&&String(e.class).split(/\s+/).filter(Boolean).forEach(e=>t.push(`.${e}`)),e.id&&t.push(`#${e.id}`),Object.entries(e).forEach(([e,n])=>{"class"!==e&&"id"!==e&&(!0===n?t.push(e):!1!==n&&null!=n&&t.push(`${e}="${String(n)}"`))}),t.join(" ")}function ah(e){let{nodeName:t,name:n,parseAttributes:r=ac,serializeAttributes:i=ad,defaultAttributes:o={},requiredAttributes:s=[],allowedAttributes:a}=e,l=n||t;return{parseMarkdown:(e,n)=>{let r={...o,...e.attributes};return n.createNode(t,r,[])},markdownTokenizer:{name:t,level:"block",start(e){var t;let n=RegExp(`^:::${l}(?:\\s|$)`,"m"),r=null==(t=e.match(n))?void 0:t.index;return void 0!==r?r:-1},tokenize(e,n,i){let o=RegExp(`^:::${l}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),a=e.match(o);if(!a)return;let c=r(a[1]||"");if(!s.find(e=>!(e in c)))return{type:t,raw:a[0],attributes:c}}},renderMarkdown:e=>{let t=i((e=>{if(!a)return e;let t={};return a.forEach(n=>{n in e&&(t[n]=e[n])}),t})(e.attrs||{})),n=t?` {${t}}`:"";return`:::${l}${n} :::`}}}function au(e){let{nodeName:t,name:n,getContent:r,parseAttributes:i=ac,serializeAttributes:o=ad,defaultAttributes:s={},content:a="block",allowedAttributes:l}=e,c=n||t;return{parseMarkdown:(e,n)=>{let i;if(r){let t=r(e);i="string"==typeof t?[{type:"text",text:t}]:t}else i="block"===a?n.parseChildren(e.tokens||[]):n.parseInline(e.tokens||[]);let o={...s,...e.attributes};return n.createNode(t,o,i)},markdownTokenizer:{name:t,level:"block",start(e){var t;let n=RegExp(`^:::${c}`,"m"),r=null==(t=e.match(n))?void 0:t.index;return void 0!==r?r:-1},tokenize(e,n,r){var o;let s=RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),l=e.match(s);if(!l)return;let[d,h=""]=l,u=i(h),p=1,f=d.length,m="",g=/^:::([\w-]*)(\s.*)?/gm,y=e.slice(f);for(g.lastIndex=0;;){let n=g.exec(y);if(null===n)break;let i=n.index,s=n[1];if(null==(o=n[2])||!o.endsWith(":::")){if(s)p+=1;else if(0==(p-=1)){let o=y.slice(0,i);m=o.trim();let s=e.slice(0,f+i+n[0].length),l=[];if(m)if("block"===a)for((l=r.blockTokens(o)).forEach(e=>{e.text&&(!e.tokens||0===e.tokens.length)&&(e.tokens=r.inlineTokens(e.text))});l.length>0;){let e=l[l.length-1];if("paragraph"!==e.type||e.text&&""!==e.text.trim())break;l.pop()}else l=r.inlineTokens(m);return{type:t,raw:s,attributes:u,content:m,tokens:l}}}}}},renderMarkdown:(e,t)=>{let n=o((e=>{if(!l)return e;let t={};return l.forEach(n=>{n in e&&(t[n]=e[n])}),t})(e.attrs||{})),r=n?` {${n}}`:"",i=t.renderChildren(e.content||[],"\n\n");return`:::${c}${r}
349
350${i}
351
352:::`}}}function ap(e){if(!e.trim())return{};let t={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g,r=n.exec(e);for(;null!==r;){let[,i,o,s]=r;t[i]=o||s,r=n.exec(e)}return t}function af(e){return Object.entries(e).filter(([,e])=>null!=e).map(([e,t])=>`${e}="${t}"`).join(" ")}function am(e){let{nodeName:t,name:n,getContent:r,parseAttributes:i=ap,serializeAttributes:o=af,defaultAttributes:s={},selfClosing:a=!1,allowedAttributes:l}=e,c=n||t,d=c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(e,n)=>{let i={...s,...e.attributes};if(a)return n.createNode(t,i);let o=r?r(e):e.content||"";return o?n.createNode(t,i,[n.createTextNode(o)]):n.createNode(t,i,[])},markdownTokenizer:{name:t,level:"inline",start(e){let t=a?RegExp(`\\[${d}\\s*[^\\]]*\\]`):RegExp(`\\[${d}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${d}\\]`),n=e.match(t),r=null==n?void 0:n.index;return void 0!==r?r:-1},tokenize(e,n,r){let o=a?RegExp(`^\\[${d}\\s*([^\\]]*)\\]`):RegExp(`^\\[${d}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${d}\\]`),s=e.match(o);if(!s)return;let l="",c="";if(a){let[,e]=s;c=e}else{let[,e,t]=s;c=e,l=t||""}let h=i(c.trim());return{type:t,raw:s[0],content:l.trim(),attributes:h}}},renderMarkdown:e=>{let t="";r?t=r(e):e.content&&e.content.length>0&&(t=e.content.filter(e=>"text"===e.type).map(e=>e.text).join(""));let n=o((e=>{if(!l)return e;let t={};return l.forEach(n=>{let r="string"==typeof n?n:n.name,i="string"==typeof n?void 0:n.skipIfDefault;if(r in e){let n=e[r];if(void 0!==i&&n===i)return;t[r]=n}}),t})(e.attrs||{})),i=n?` ${n}`:"";return a?`[${c}${i}]`:`[${c}${i}]${t}[/${c}]`}}}function ag(e,t,n){var r,i,o,s;let a=e.split("\n"),l=[],c="",d=0,h=t.baseIndentSize||2;for(;d<a.length;){let e,u=a[d],p=u.match(t.itemPattern);if(!p)if(l.length>0)break;else{if(""!==u.trim())return;d+=1,c=`${c}${u}
353`;continue}let f=t.extractItemData(p),{indentLevel:m,mainContent:g}=f;c=`${c}${u}
354`;let y=[g];for(d+=1;d<a.length;){let e=a[d];if(""===e.trim()){let t=a.slice(d+1).findIndex(e=>""!==e.trim());if(-1===t)break;
354if(((null==(i=null==(r=a[d+1+t].match(/^(\s*)/))?void 0:r[1])?void 0:i.length)||0)>m){y.push(e),c=`${c}${e}
355`,d+=1;continue}break}if(((null==(s=null==(o=e.match(/^(\s*)/))?void 0:o[1])?void 0:s.length)||0)>m)y.push(e),c=`${c}${e}
356`,d+=1;else break}let b=y.slice(1);if(b.length>0){let r=b.map(e=>e.slice(m+h)).join("\n");r.trim()&&(e=t.customNestedParser?t.customNestedParser(r):n.blockTokens(r))}let x=t.createToken(f,e);l.push(x)}if(0!==l.length)return{items:l,raw:c}}function ay(e,t,n,r){if(!e||!Array.isArray(e.content))return"";let i="function"==typeof n?n(r):n,[o,...s]=e.content,a=t.renderChildren([o]),l=[`${i}${a}`];return s&&s.length>0&&s.forEach(e=>{let n=t.renderChildren([e]);if(n){let e=n.split("\n").map(e=>e?t.indent(e):"").join("\n");l.push(e)}}),l.join("\n")}iY({},{createAtomBlockMarkdownSpec:()=>ah,createBlockMarkdownSpec:()=>au,createInlineMarkdownSpec:()=>am,parseAttributes:()=>ac,parseIndentedBlocks:()=>ag,renderNestedMarkdownContent:()=>ay,serializeAttributes:()=>ad});var ab=class e extends sX{constructor(){super(...arguments),this.type="node"}static create(t={}){return new e("function"==typeof t?t():t)}configure(e){return super.configure(e)}extend(e){let t="function"==typeof e?e():e;return super.extend(t)}};function ax(e){return new sY({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{let o=o7(e.getAttributes,void 0,r,i);if(!1===o||null===o)return null;let{tr:s}=t,a=r[r.length-1],l=r[0],c=n.to;if(a){let r=l.search(/\S/),i=n.from+l.indexOf(a),d=i+a.length;if(su(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>i).length)return null;d<n.to&&s.delete(d,n.to),i>n.from&&s.delete(n.from+r,i),c=n.from+r+a.length,s.addMark(n.from+r,c,e.type.create(o||{})),s.removeStoredMark(e.type)}}})}var av=e.i(33309),aw=e.i(30224),ak=({contentComponent:e})=>{let t=(0,V.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getServerSnapshot);return(0,o.jsx)(o.Fragment,{children:Object.values(t)})},aS=class extends $.default.Component{constructor(e){var t;super(e),this.editorContentRef=$.default.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!(null==(t=e.editor)?void 0:t.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){let e=this.props.editor;if(e&&!e.isDestroyed&&e.options.element){let t,n;if(e.contentComponent)return;let r=this.editorContentRef.current;r.append(e.view.dom),e.setOptions({element:r}),t=new Set,n={},e.contentComponent={subscribe:e=>(t.add(e),()=>{t.delete(e)}),getSnapshot:()=>n,getServerSnapshot:()=>n,setRenderer(e,r){n={...n,[e]:_.default.createPortal(r.reactElement,r.element,e)},t.forEach(e=>e())},removeRenderer(e){let r={...n};delete r[e],n=r,t.forEach(e=>e())}},this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=e.contentComponent.subscribe(()=>{this.setState(e=>e.hasContentComponentInitialized?e:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),e.createNodeViews(),this.initialized=!0}}componentWillUnmount(){var e;let t=this.props.editor;if(t){this.initialized=!1,t.isDestroyed||t.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),t.contentComponent=null;try{if(!(null==(e=t.view.dom)?void 0:e.firstChild))return;let n=document.createElement("div");n.append(t.view.dom),t.setOptions({element:n})}catch{}}}render(){let{editor:e,innerRef:t,...n}=this.props;return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("div",{ref:((...e)=>t=>{e.forEach(e=>{"function"==typeof e?e(t):e&&(e.current=t)})})(t,this.editorContentRef),...n}),(null==e?void 0:e.contentComponent)&&(0,o.jsx)(ak,{contentComponent:e.contentComponent})]})}},aM=(0,$.forwardRef)((e,t)=>{let n=$.default.useMemo(()=>Math.floor(0xffffffff*Math.random()).toString(),[e.editor]);return $.default.createElement(aS,{key:n,innerRef:t,...e})}),aC=$.default.memo(aM),aN="u">typeof window?$.useLayoutEffect:$.useEffect,aE=class{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0}
356,this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber||(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber}),this.lastSnapshot}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){let e=()=>{this.transactionNumber+=1,this.subscribers.forEach(e=>e())},t=this.editor;return t.on("transaction",e),()=>{t.off("transaction",e)}}}},aT="u"<typeof window,aO=aT||!!("u">typeof window&&window.next),aA=class e{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(e=>e())}getInitialEditor(){return void 0===this.options.current.immediatelyRender?aT||aO?null:this.createEditor():(this.options.current.immediatelyRender,this.options.current.immediatelyRender)?this.createEditor():null}createEditor(){return new ao({...this.options.current,onBeforeCreate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onBeforeCreate)?void 0:n.call(t,...e)},onBlur:(...e)=>{var t,n;return null==(n=(t=this.options.current).onBlur)?void 0:n.call(t,...e)},onCreate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onCreate)?void 0:n.call(t,...e)},onDestroy:(...e)=>{var t,n;return null==(n=(t=this.options.current).onDestroy)?void 0:n.call(t,...e)},onFocus:(...e)=>{var t,n;return null==(n=(t=this.options.current).onFocus)?void 0:n.call(t,...e)},onSelectionUpdate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onSelectionUpdate)?void 0:n.call(t,...e)},onTransaction:(...e)=>{var t,n;return null==(n=(t=this.options.current).onTransaction)?void 0:n.call(t,...e)},onUpdate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onUpdate)?void 0:n.call(t,...e)},onContentError:(...e)=>{var t,n;return null==(n=(t=this.options.current).onContentError)?void 0:n.call(t,...e)},onDrop:(...e)=>{var t,n;return null==(n=(t=this.options.current).onDrop)?void 0:n.call(t,...e)},onPaste:(...e)=>{var t,n;return null==(n=(t=this.options.current).onPaste)?void 0:n.call(t,...e)},onDelete:(...e)=>{var t,n;return null==(n=(t=this.options.current).onDelete)?void 0:n.call(t,...e)}})}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,t){return Object.keys(e).every(n=>!!["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(n)||("extensions"===n&&e.extensions&&t.extensions?e.extensions.length===t.extensions.length&&e.extensions.every((e,n)=>{var r;return e===(null==(r=t.extensions)?void 0:r[n])}):e[n]===t[n]))}onRender(t){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&0===t.length?e.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(t),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(null===this.previousDeps){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((t,n)=>t===e[n]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){let e=this.instanceId,t=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){t&&t.setOptions(this.options.current);return}t&&!t.isDestroyed&&(t.destroy(),this.instanceId===e&&this.setEditor(null))}
356,1)}};(0,$.createContext)({editor:null}).Consumer;var aj=(0,$.createContext)({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}});$.default.forwardRef((e,t)=>{let{onDragStart:n}=(0,$.useContext)(aj),r=e.as||"div";return(0,o.jsx)(r,{...e,ref:t,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...e.style}})}),$.default.createContext({markViewContentRef:()=>{}});var aI=(e,t)=>{if("slot"===e)return 0;if(e instanceof Function)return e(t);let{children:n,...r}=null!=t?t:{};if("svg"===e)throw Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[e,r,n]},aD=/^\s*>\s$/,aR=ab.create({name:"blockquote",addOptions:()=>({HTMLAttributes:{}}),content:"block+",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML({HTMLAttributes:e}){return aI("blockquote",{...st(this.options.HTMLAttributes,e),children:aI("slot",{})})},parseMarkdown:(e,t)=>t.createNode("blockquote",void 0,t.parseChildren(e.tokens||[])),renderMarkdown:(e,t)=>{if(!e.content)return"";let n=[];return e.content.forEach(e=>{let r=t.renderChildren([e]).split("\n").map(e=>""===e.trim()?">":`> ${e}`);n.push(r.join("\n"))}),n.join(`
357>
358`)},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}}
358,addInputRules(){return[al({find:aD,type:this.type})]}}),aL=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,aP=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,aB=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,az=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,a$=sQ.create({name:"bold",addOptions:()=>({HTMLAttributes:{}}),parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:e=>"normal"!==e.style.fontWeight&&null},{style:"font-weight=400",clearMark:e=>e.type.name===this.name},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return aI("strong",{...st(this.options.HTMLAttributes,e),children:aI("slot",{})})},markdownTokenName:"strong",parseMarkdown:(e,t)=>t.applyMark("bold",t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`**${t.renderChildren(e)}**`,addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}}
358,addInputRules(){return[as({find:aL,type:this.type}),as({find:aB,type:this.type})]},addPasteRules(){return[ax({find:aP,type:this.type}),ax({find:az,type:this.type})]}}),a_=/(^|[^`])`([^`]+)`(?!`)$/,aV=/(^|[^`])`([^`]+)`(?!`)/g,aF=sQ.create({name:"code",addOptions:()=>({HTMLAttributes:{}}),excludes:"_",code:!0,exitable:!0,parseHTML:()=>[{tag:"code"}],renderHTML({HTMLAttributes:e}){return["code",st(this.options.HTMLAttributes,e),0]},markdownTokenName:"codespan",parseMarkdown:(e,t)=>t.applyMark("code",[{type:"text",text:e.text||""}]),renderMarkdown:(e,t)=>e.content?`\`${t.renderChildren(e.content)}\``:"",addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[as({find:a_,type:this.type})]},addPasteRules(){return[ax({find:aV,type:this.type})]}}),aH=/^```([a-z]+)?[\s\n]$/,aq=/^~~~([a-z]+)?[\s\n]$/,aU=ab.create({name:"codeBlock",addOptions:()=>({languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:4,HTMLAttributes:{}}),content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{var t;let{languageClassPrefix:n}=this.options;if(!n)return null;let r=[...(null==(t=e.firstElementChild)?void 0:t.classList)||[]].filter(e=>e.startsWith(n)).map(e=>e.replace(n,""))[0];return r||null},rendered:!1}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({node:e,HTMLAttributes:t}){return["pre",st(this.options.HTMLAttributes,t),["code",{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(e,t)=>{var n,r;return(null==(n=e.raw)?void 0:n.startsWith("```"))===!1&&(null==(r=e.raw)?void 0:r.startsWith("~~~"))===!1&&"indented"!==e.codeBlockStyle?[]:t.createNode("codeBlock",{language:e.lang||null},e.text?[t.createTextNode(e.text)]:[])},renderMarkdown:(e,t)=>{var n;let r=(null==(n=e.attrs)?void 0:n.language)||"";return e.content?[`\`\`\`${r}`,t.renderChildren(e.content),"```"].join("\n"):`\`\`\`${r}
359
360\`\`\``},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{let{empty:e,$anchor:t}=this.editor.state.selection,n=1===t.pos;return!!e&&t.parent.type.name===this.name&&(!!n||!t.parent.textContent.length)&&this.editor.commands.clearNodes()},Tab:({editor:e})=>{var t;if(!this.options.enableTabIndentation)return!1;let n=null!=(t=this.options.tabSize)?t:4,{state:r}=e,{selection:i}=r,{$from:o,empty:s}=i;if(o.parent.type!==this.type)return!1;let a=" ".repeat(n);return s?e.commands.insertContent(a):e.commands.command(({tr:e})=>{let{from:t,to:n}=i,o=r.doc.textBetween(t,n,"\n","\n").split("\n").map(e=>a+e).join("\n");return e.replaceWith(t,n,r.schema.text(o)),!0})},"Shift-Tab":({editor:e})=>{var t;if(!this.options.enableTabIndentation)return!1;let n=null!=(t=this.options.tabSize)?t:4,{state:r}=e,{selection:i}=r,{$from:o,empty:s}=i;return o.parent.type===this.type&&(s?e.commands.command(({tr:e})=>{var t;let{pos:i}=o,s=o.start(),a=o.end(),l=r.doc.textBetween(s,a,"\n","\n").split("\n"),c=0,d=0,h=i-s;for(let e=0;e<l.length;e+=1){if(d+l[e].length>=h){c=e;break}d+=l[e].length+1}let u=Math.min(((null==(t=l[c].match(/^ */))?void 0:t[0])||"").length,n);if(0===u)return!0;let p=s;for(let e=0;e<c;e+=1)p+=l[e].length+1;return e.delete(p,p+u),i-p<=u&&e.setSelection(ty.create(e.doc,p)),!0}):e.commands.command(({tr:e})=>{let{from:t,to:o}=i,s=r.doc.textBetween(t,o,"\n","\n").split("\n").map(e=>{var t;let r=Math.min(((null==(t=e.match(/^ */))?void 0:t[0])||"").length,n);return e.slice(r)}).join("\n");return e.replaceWith(t,o,r.schema.text(s)),!0}))},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;let{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;let o=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith("\n\n");return!!o&&!!s&&e.chain().command(({tr:e})=>(e.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:e})=>
360{if(!this.options.exitOnArrowDown)return!1;let{state:t}=e,{selection:n,doc:r}=t,{$from:i,empty:o}=n;if(!o||i.parent.type!==this.type||i.parentOffset!==i.parent.nodeSize-2)return!1;let s=i.after();return void 0!==s&&(r.nodeAt(s)?e.commands.command(({tr:e})=>(e.setSelection(tp.near(r.resolve(s))),!0)):e.commands.exitCode())}}},addInputRules(){return[aa({find:aH,type:this.type,getAttributes:e=>({language:e[1]})}),aa({find:aq,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new tj({key:new tR("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;let n=t.clipboardData.getData("text/plain"),r=t.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,o=null==i?void 0:i.mode;if(!n||!o)return!1;let{tr:s,schema:a}=e.state,l=a.text(n.replace(/\r\n?/g,"\n"));return s.replaceSelectionWith(this.type.create({language:o},l)),s.selection.$from.parent.type!==this.type&&s.setSelection(ty.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),e.dispatch(s),!0}}})]}}),aW=ab.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,"\n\n"):""}),aK=ab.create({name:"hardBreak",markdownTokenName:"br",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:e}){return["br",st(this.options.HTMLAttributes,e)]},renderText:()=>"\n",renderMarkdown:()=>`  
361`,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{let{selection:e,storedMarks:i}=n;if(e.$from.parent.type.spec.isolating)return!1;let{keepMarks:o}=this.options,{splittableMarks:s}=r.extensionManager,a=i||e.$to.parentOffset&&e.$from.marks();return t().insertContent({type:this.name}).command(({tr:e,dispatch:t})=>{if(t&&a&&o){let t=a.filter(e=>s.includes(e.type.name));e.ensureMarks(t)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),aJ=ab.create({name:"heading",addOptions:()=>({levels:[1,2,3,4,5,6],HTMLAttributes:{}}),content:"inline*",group:"block",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){let n=this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0];return[`h${n}`,st(this.options.HTMLAttributes,t),0]},parseMarkdown:(e,t)=>t.createNode("heading",{level:e.depth||1},t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>{var n;let r=(null==(n=e.attrs)?void 0:n.level)?parseInt(e.attrs.level,10):1,i="#".repeat(r);return e.content?`${i} ${t.renderChildren(e.content)}`:""},addCommands(){return{setHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.setNode(this.name,e),toggleHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,...{[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}}),{})},addInputRules(){return this.options.levels.map(e=>aa({find:RegExp(`^(#{${Math.min(...this.options.levels)},${e}}
361)\\s$`),type:this.type,getAttributes:{level:e}}))}}),aG=ab.create({name:"horizontalRule",addOptions:()=>({HTMLAttributes:{},nextNodeType:"paragraph"}),group:"block",parseHTML:()=>[{tag:"hr"}],renderHTML({HTMLAttributes:e}){return["hr",st(this.options.HTMLAttributes,e)]},markdownTokenName:"hr",parseMarkdown:(e,t)=>t.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!function(e,t){let{selection:n}=e,{$from:r}=n;if(n instanceof tx){let e=r.index();return r.parent.canReplaceWith(e,e+1,t)}let i=r.depth;for(;i>=0;){let e=r.index(i);if(r.node(i).contentMatchAt(e).matchType(t))return!0;i-=1}return!1}(t,t.schema.nodes[this.name]))return!1;let{selection:n}=t,{$to:r}=n,i=e();return sx(n)?i.insertContentAt(r.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:e,tr:t,dispatch:n})=>{if(n){let{$to:n}=t.selection,r=n.end();if(n.nodeAfter)n.nodeAfter.isTextblock?t.setSelection(ty.create(t.doc,n.pos+1)):n.nodeAfter.isBlock?t.setSelection(tx.create(t.doc,n.pos)):t.setSelection(ty.create(t.doc,n.pos));else{let i=e.schema.nodes[this.options.nextNodeType]||n.parent.type.contentMatch.defaultType,o=null==i?void 0:i.create();o&&(t.insert(r,o),t.setSelection(ty.create(t.doc,r+1)))}t.scrollIntoView()}return!0}).run()}}},addInputRules(){var e;return[new sK({find:(e={find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.t
361ype}).find,handler:({state:t,range:n,match:r})=>{let i=o7(e.getAttributes,void 0,r)||{},{tr:o}=t,s=n.from,a=n.to,l=e.type.create(i);if(r[1]){let e=s+r[0].lastIndexOf(r[1]);e>a?e=a:a=e+r[1].length;let t=r[0][r[0].length-1];o.insertText(t,s+r[0].length-1),o.replaceWith(e,a,l)}else if(r[0]){let t=e.type.isInline?s:s-1;o.insert(t,e.type.create(i)).delete(o.mapping.map(s),o.mapping.map(a))}o.scrollIntoView()},undoable:e.undoable})]}}),aX=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,aQ=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,aY=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,aZ=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,a0=sQ.create({name:"italic",addOptions:()=>({HTMLAttributes:{}}),parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:e=>"normal"!==e.style.fontStyle&&null},{style:"font-style=normal",clearMark:e=>e.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:e}){return["em",st(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(e,t)=>t.applyMark("italic",t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`*${t.renderChildren(e)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}}
361,addInputRules(){return[as({find:aX,type:this.type}),as({find:aY,type:this.type})]},addPasteRules(){return[ax({find:aQ,type:this.type}),ax({find:aZ,type:this.type})]}});let a1="numeric",a2="ascii",a3="alpha",a5="asciinumeric",a4="alphanumeric",a6="domain",a7="emoji",a9="whitespace";function a8(e,t,n){for(let r in t[a1]&&(t[a5]=!0,t[a4]=!0),t[a2]&&(t[a5]=!0,t[a3]=!0),t[a5]&&(t[a4]=!0),t[a3]&&(t[a4]=!0),t[a4]&&(t[a6]=!0),t[a7]&&(t[a6]=!0),t){let t=(r in n||(n[r]=[]),n[r]);0>t.indexOf(e)&&t.push(e)}}function le(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}le.groups={},le.prototype={accepts(){return!!this.t},go(e){let t=this.j[e];if(t)return t;for(let t=0;t<this.jr.length;t++){let n=this.jr[t][0],r=this.jr[t][1];if(r&&n.test(e))return r}return this.jd},has(e,t=!1){return t?e in this.j:!!this.go(e)},ta(e,t,n,r){for(let i=0;i<e.length;i++)this.tt(e[i],t,n,r)},tr(e,t,n,r){let i;return r=r||le.groups,t&&t.j?i=t:(i=new le(t),n&&r&&a8(t,n,r)),this.jr.push([e,i]),i},ts(e,t,n,r){let i=this,o=e.length;if(!o)return i;for(let t=0;t<o-1;t++)i=i.tt(e[t]);return i.tt(e[o-1],t,n,r)},tt(e,t,n,r){if(r=r||le.groups,t&&t.j)return this.j[e]=t,t;let i,o=this.go(e);return o?(Object.assign((i=new le).j,o.j),i.jr.push.apply(i.jr,o.jr),i.jd=o.jd,i.t=o.t):i=new le,t&&(r&&(i.t&&"string"==typeof i.t?a8(t,Object.assign(function(e,t){let n={};for(let r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}(i.t,r),n),r):n&&a8(t,n,r)),i.t=t),this.j[e]=i,i}};let lt=(e,t,n,r,i)=>e.ta(t,n,r,i),ln=(e,t,n,r,i)=>e.tr(t,n,r,i),lr=(e,t,n,r,i)=>e.ts(t,n,r,i),li=(e,t,n,r,i)=>e.tt(t,n,r,i),lo="WORD",ls="UWORD",la="ASCIINUMERICAL",ll="ALPHANUMERICAL",lc="LOCALHOST",ld="UTLD",lh="SCHEME",lu="SLASH_SCHEME",lp="OPENBRACE",lf="CLOSEBRACE",lm="OPENBRACKET",lg="CLOSEBRACKET",ly="OPENPAREN",lb="CLOSEPAREN",lx="OPENANGLEBRACKET",lv="CLOSEANGLEBRACKET",lw="FULLWIDTHLEFTPAREN",lk="FULLWIDTHRIGHTPAREN",lS="LEFTCORNERBRACKET",lM="RIGHTCORNERBRACKET",lC="LEFTWHITECORNERBRACKET",lN="RIGHTWHITECORNERBRACKET",lE="FULLWIDTHLESSTHAN",lT="FULLWIDTHGREATERTHAN",lO="AMPERSAND",lA="APOSTROPHE",lj="ASTERISK",lI="BACKSLASH",lD="BACKTICK",lR="CARET",lL="COLON",lP="COMMA",lB="DOLLAR",lz="EQUALS",l$="EXCLAMATION",l_="HYPHEN",lV="PERCENT",lF="PIPE",lH="PLUS",lq="POUND",lU="QUERY",lW="QUOTE",lK="FULLWIDTHMIDDLEDOT",lJ="SEMI",lG="SLASH",lX="TILDE",lQ="UNDERSCORE",lY="EMOJI";var lZ=Object.freeze({__proto__:null,ALPHANUMERICAL:ll,AMPERSAND:lO,APOSTROPHE:lA,ASCIINUMERICAL:la,ASTERISK:lj,AT:"AT",BACKSLASH:lI,BACKTICK:lD,CARET:lR,CLOSEANGLEBRACKET:lv,CLOSEBRACE:lf,CLOSEBRACKET:lg,CLOSEPAREN:lb,COLON:lL,COMMA:lP,DOLLAR:lB,DOT:"DOT",EMOJI:lY,EQUALS:lz,EXCLAMATION:l$,FULLWIDTHGREATERTHAN:lT,FULLWIDTHLEFTPAREN:lw,FULLWIDTHLESSTHAN:lE,FULLWIDTHMIDDLEDOT:lK,FULLWIDTHRIGHTPAREN:lk,HYPHEN:l_,LEFTCORNERBRACKET:lS,LEFTWHITECORNERBRACKET:lC,LOCALHOST:lc,NL:"NL",NUM:"NUM",OPENANGLEBRACKET:lx,OPENBRACE:lp,OPENBRACKET:lm,OPENPAREN:ly,PERCENT:lV,PIPE:lF,PLUS:lH,POUND:lq,QUERY:lU,QUOTE:lW,RIGHTCORNERBRACKET:lM,RIGHTWHITECORNERBRACKET:lN,SCHEME:lh,SEMI:lJ,SLASH:lG,SLASH_SCHEME:lu,SYM:"SYM",TILDE:lX,TLD:"TLD",UNDERSCORE:lQ,UTLD:ld,UWORD:ls,WORD:lo,WS:"WS"});let l0=/[a-z]/,l1=/\p{L}/u,l2=/\p{Emoji}/u,l3=/\d/,l5=/\s/,l4=null,l6=null;function l7(e,t){let n=function(e){let t=[],n=e.length,r=0;for(;r<n;){let i,o=e.charCodeAt(r),s=o<55296||o>56319||r+1===n||(i=e.charCodeAt(r+1))<56320||i>57343?e[r]:e.slice(r,r+2);t.push(s),r+=s.length}return t}(t.replace(/[A-Z]/g,e=>e.toLowerCase())),r=n.length,i=[],o=0,s=0;for(;s<r;){let a=e,l=null,c=0,d=null,h=-1,u=-1;for(;s<r&&(l=a.go(n[s]));)(a=l).accepts()?(h=0,u=0,d=a):h>=0&&(h+=n[s].length,u++),c+=n[s].length,o+=n[s].length,s++;o-=h,s-=u,c-=h,i.push({t:d.t,v:t.slice(o-c,o),s:o-c,e:o})}return i}function l9(e,t,n,r,i){let o,s=t.length;for(let n=0;n<s-1;n++){let s=t[n];e.j[s]?o=e.j[s]:((o=new le(r)).jr=i.slice(),e.j[s]=o),e=o}return(o=new le(n)).jr=i.slice(),e.j[t[s-1]]=o,o}function l8(e){let t=[],n=[],r=0;for(;r<e.length;){let i=0;for(;"0123456789".indexOf(e[r+i])>=0;)i++;if(i>0){t.push(n.join(""));for(let t=parseInt(e.substring(r,r+i),10);t>0;t--)n.pop();r+=i}else n.push(e[r]),r++}return t}let ce={defaultProtocol:"http",events:null,format:cn,formatHref:cn,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};
361function ct(e,t=null){let n=Object.assign({},ce);e&&(n=Object.assign(n,e instanceof ct?e.o:e));let r=n.ignoreTags,i=[];for(let e=0;e<r.length;e++)i.push(r[e].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=i}function cn(e){return e}function cr(e,t){this.t="token",this.v=e,this.tk=t}function ci(e,t){class n extends cr{constructor(t,n){super(t,n),this.t=e}}for(let e in t)n.prototype[e]=t[e];return n.t=e,n}ct.prototype={o:ce,ignoreTags:[],defaultRender:e=>e,check(e){return this.get("validate",e.toString(),e)},get(e,t,n){let r=null!=t,i=this.o[e];return i&&("object"==typeof i?"function"==typeof(i=n.t in i?i[n.t]:ce[e])&&r&&(i=i(t,n)):"function"==typeof i&&r&&(i=i(t,n.t,n))),i},getObj(e,t,n){let r=this.o[e];return"function"==typeof r&&null!=t&&(r=r(t,n.t,n)),r},render(e){let t=e.render(this);return(this.get("render",null,e)||this.defaultRender)(t,e.t,e)}},cr.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){let t=this.toString(),n=e.get("truncate",t,this),r=e.get("format",t,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(e){return e.get("formatHref",this.toHref(e.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=ce.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get("validate",this.toString(),this)},render(e){let t=this.toHref(e.get("defaultProtocol")),n=e.get("formatHref",t,this),r=e.get("tagName",t,this),i=this.toFormattedString(e),o={},s=e.get("className",t,this),a=e.get("target",t,this),l=e.get("rel",t,this),c=e.getObj("attributes",t,this),d=e.getObj("events",t,this);return o.href=n,s&&(o.class=s),a&&(o.target=a),l&&(o.rel=l),c&&Object.assign(o,c),{tagName:r,attributes:o,content:i,eventListeners:d}}};let co=ci("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),cs=ci("text"),ca=ci("nl"),cl=ci("url",{isLink:!0,toHref(e=ce.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){let e=this.tk;return e.length>=2&&e[0].t!==lc&&e[1].t===lL}}),cc=e=>new le(e);function cd(e,t,n){let r=n[0].s,i=n[n.length-1].e;return new e(t.slice(r,i),n)}let ch="u">typeof console&&console&&console.warn||(()=>{}),cu={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function cp(e,t=!1){if(cu.initialized&&ch(`linkifyjs: already initialized - will not register custom scheme "${e}" until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw Error(`linkifyjs: incorrect scheme format.
3621. Must only contain digits, lowercase ASCII letters or "-"
3632. Cannot start or end with "-"
3643. "-" cannot repeat`);cu.customSchemes.push([e,t])}function cf(e){return cu.initialized||function(){cu.scanner=function(e=[]){let t={};le.groups=t;let n=new le;null==l4&&(l4=l8("aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2
364ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2")),null==l6&&(l6=l8("ελ1υ2бг1ел3дети4ею2католик6ом3мÐ
364ºÐ´2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3Õ°Õ¡Õµ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1ì»´2삼성2한국2")),li(n,"'",lA),li(n,"{",lp),li(n,"}",lf),li(n,"[",lm),li(n,"]",lg),li(n,"(",ly),li(n,")",lb),li(n,"<",lx),li(n,">",lv),li(n,"(",lw),li(n,")",lk),li(n,"「",lS),li(n,"」",lM),li(n,"『",lC),li(n,"』",lN),li(n,"<",lE),li(n,">",lT),li(n,"&",lO),li(n,"*",lj),li(n,"@","AT"),li(n,"`",lD),li(n,"^",lR),li(n,":",lL),li(n,",",lP),li(n,"$",lB),li(n,".","DOT"),li(n,"=",lz),li(n,"!",l$),li(n,"-",l_),li(n,"%",lV),li(n,"|",lF),li(n,"+",lH),li(n,"#",lq),li(n,"?",lU),li(n,'"',lW),li(n,"/",lG),li(n,";",lJ),li(n,"~",lX),li(n,"_",lQ),li(n,"\\",lI),li(n,"・",lK);let r=ln(n,l3,"NUM",{[a1]:!0});ln(r,l3,r);let i=ln(r,l0,la,{[a5]:!0}),o=ln(r,l1,ll,{[a4]:!0}),s=ln(n,l0,lo,{[a2]:!0});ln(s,l3,i),ln(s,l0,s),ln(i,l3,i),ln(i,l0,i);let a=ln(n,l1,ls,{[a3]:!0});ln(a,l0),ln(a,l3,o),ln(a,l1,a),ln(o,l3,o),ln(o,l0),ln(o,l1,o);let l=li(n,"\n","NL",{[a9]:!0}),c=li(n,"\r","WS",{[a9]:!0}),d=ln(n,l5,"WS",{[a9]:!0});li(n,"",d),li(c,"\n",l),li(c,"",d),ln(c,l5,d),li(d,"\r"),li(d,"\n"),ln(d,l5,d),li(d,"",d);let h=ln(n,l2,lY,{[a7]:!0});li(h,"#"),ln(h,l2,h),li(h,"️",h);let u=li(h,"‍");li(u,"#"),ln(u,l2,h);let p=[[l0,s],[l3,i]],f=[[l0,null],[l1,a],[l3,o]];for(let e=0;e<l4.length;e++)l9(n,l4[e],"TLD",lo,p);for(let e=0;e<l6.length;e++)l9(n,l6[e],ld,ls,f);a8("TLD",{tld:!0,ascii:!0},t),a8(ld,{utld:!0,alpha:!0},t),l9(n,"file",lh,lo,p),l9(n,"mailto",lh,lo,p),l9(n,"http",lu,lo,p),l9(n,"https",lu,lo,p),l9(n,"ftp",lu,lo,p),l9(n,"ftps",lu,lo,p),a8(lh,{scheme:!0,ascii:!0},t),a8(lu,{slashscheme:!0,ascii:!0},t),e=e.sort((e,t)=>e[0]>t[0]?1:-1);for(let t=0;t<e.length;t++){let r=e[t][0],i=e[t][1]?{scheme:!0}:{slashscheme:!0};r.indexOf("-")>=0?i[a6]=!0:l0.test(r)?l3.test(r)?i[a5]=!0:i[a2]=!0:i[a1]=!0,lr(n,r,r,i)}return lr(n,"localhost",lc,{ascii:!0}),n.jd=new le("SYM"),{start:n,tokens:Object.assign({groups:t},lZ)}}(cu.customSchemes);for(let e=0;e<cu.tokenQueue.length;e++)cu.tokenQueue[e][1]({scanner:cu.scanner});cu.parser=function({groups:e}){let t=e.domain.concat([lO,lj,"AT",lI,lD,lR,lB,lz,l_,"NUM",lV,lF,lH,lq,lG,"SYM",lX,lQ]),n=[lA,lL,lP,"DOT",l$,lV,lU,lW,lJ,lx,lv,lp,lf,lg,lm,ly,lb,lw,lk,lS,lM,lC,lN,lE,lT],r=[lO,lA,lj,lI,lD,lR,lB,lz,l_,lp,lf,lV,lF,lH,lq,lU,lG,"SYM",lX,lQ],i=cc(),o=li(i,lX);lt(o,r,o),lt(o,e.domain,o);let s=cc(),a=cc(),l=cc();lt(i,e.domain,s),lt(i,e.scheme,a),lt(i,e.slashscheme,l),lt(s,r,o),lt(s,e.domain,s);let c=li(s,"AT");li(o,"AT",c),li(a,"AT",c),li(l,"AT",c);let d=li(o,"DOT");lt(d,r,o),lt(d,e.domain,o);let h=cc();lt(c,e.domain,h),lt(h,e.domain,h);let u=li(h,"DOT");lt(u,e.domain,h);let p=cc(co);lt(u,e.tld,p),lt(u,e.utld,p),li(c,lc,p);let f=li(h,l_);li(f,l_,f),lt(f,e.domain,h),lt(p,e.domain,h),li(p,"DOT",u),li(p,l_,f),lt(li(p,lL),e.numeric,co);let m=li(s,l_),g=li(s,"DOT");li(m,l_,m),lt(m,e.domain,s),lt(g,r,o),lt(g,e.domain,s);let y=cc(cl);lt(g,e.tld,y),lt(g,e.utld,y),lt(y,e.domain,s),lt(y,r,o),li(y,"DOT",g),li(y,l_,m),li(y,"AT",c);let b=li(y,lL),x=cc(cl);lt(b,e.numeric,x);let v=cc(cl),w=cc();lt(v,t,v),lt(v,n,w),lt(w,t,v),lt(w,n,w),li(y,lG,v),li(x,lG,v);let k=li(a,lL),S=li(l,lL),M=li(S,lG),C=li(M,lG);lt(a,e.domain,s),li(a,"DOT",g),li(a,l_,m),lt(l,e.domain,s),li(l,"DOT",g),li(l,l_,m),lt(k,e.domain,v),li(k,lG,v),li(k,lU,v),lt(C,e.domain,v),lt(C,t,v),li(C,lG,v);let N=[[lp,lf],[lm,lg],[ly,lb],[lx,lv],[lw,lk],[lS,lM],[lC,lN],[lE,lT]];for(let e=0;e<N.length;e++){let[r,i]=N[e],o=li(v,r);li(w,r,o),li(o,i,v);let s=cc(cl);lt(o,t,s);let a=cc();lt(o,n),lt(s,t,s),lt(s,n,a),lt(a,t,s),lt(a,n,a),li(s,i,v),li(a,i,v)}return li(i,lc,y),li(i,"NL",ca),{start:i,tokens:lZ}
364}(cu.scanner.tokens);for(let e=0;e<cu.pluginQueue.length;e++)cu.pluginQueue[e][1]({scanner:cu.scanner,parser:cu.parser});cu.initialized=!0}(),function(e,t,n){let r=n.length,i=0,o=[],s=[];for(;i<r;){let a=e,l=null,c=null,d=0,h=null,u=-1;for(;i<r&&!(l=a.go(n[i].t));)s.push(n[i++]);for(;i<r&&(c=l||a.go(n[i].t));)l=null,(a=c).accepts()?(u=0,h=a):u>=0&&u++,i++,d++;if(u<0)(i-=d)<r&&(s.push(n[i]),i++);else{s.length>0&&(o.push(cd(cs,t,s)),s=[]),i-=u,d-=u;let e=h.t,r=n.slice(i-d,i);o.push(cd(e,t,r))}}return s.length>0&&o.push(cd(cs,t,s)),o}(cu.parser.start,e,l7(cu.scanner.start,e))}function cm(e,t=null,n=null){if(t&&"object"==typeof t){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}let r=new ct(n),i=cf(e),o=[];for(let e=0;e<i.length;e++){let n=i[e];n.isLink&&(!t||n.t===t)&&r.check(n)&&o.push(n.toFormattedObject(r))}return o}cf.scan=l7;var cg="[\0-   ᠎ -\u2029  ]",cy=new RegExp(cg),cb=RegExp(`${cg}$`),cx=RegExp(cg,"g");function cv(e,t){let n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return t&&t.forEach(e=>{let t="string"==typeof e?e:e.scheme;t&&n.push(t)}),!e||e.replace(cx,"").match(RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var cw=sQ.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(e=>{"string"==typeof e?cp(e):cp(e.scheme,e.optionalSlashes)})},onDestroy(){le.groups={},cu.scanner=null,cu.parser=null,cu.tokenQueue=[],cu.pluginQueue=[],cu.customSchemes=[],cu.initialized=!1},inclusive(){return this.options.autolink},addOptions:()=>({openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(e,t)=>!!cv(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>{let t=/^[a-z][a-z0-9+.-]*:\/\//i.test(e),n=/^[a-z][a-z0-9+.-]*:/i.test(e);if(t||n&&!e.includes("@"))return!0;let r=(e.includes("@")?e.split("@").pop():e).split(/[/?#:]/)[0];return!/^\d{1,3}(\.\d{1,3}){3}$/.test(r)&&!!/\./.test(r)}}),addAttributes(){return{href:{default:null,parseHTML:e=>e.getAttribute("href")},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class},title:{default:null}}},parseHTML(){return[{tag:"a[href]",getAttrs:e=>{let t=e.getAttribute("href");return!!t&&!!this.options.isAllowedUri(t,{defaultValidate:e=>!!cv(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})&&null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:e=>!!cv(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",st(this.options.HTMLAttributes,e),0]:["a",st(this.options.HTMLAttributes,{...e,href:""}),0]},markdownTokenName:"link",parseMarkdown:(e,t)=>t.applyMark("link",t.parseInline(e.tokens||[]),{href:e.href,title:e.title||null}),renderMarkdown:(e,t)=>{var n,r,i,o;let s=null!=(r=null==(n=e.attrs)?void 0:n.href)?r:"",a=null!=(o=null==(i=e.attrs)?void 0:i.title)?o:"",l=t.renderChildren(e);return a?`[${l}](${s} "${a}")`:`[${l}](${s})`},addCommands(){return{setLink:e=>({chain:t})=>{let{href:n}=e;return!!this.options.isAllowedUri(n,{defaultValidate:e=>!!cv(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})&&t().setMark(this.name,e).setMeta("preventAutolink",!0).run()},toggleLink:e=>({chain:t})=>{let{href:n}=e||{};return(!n||!!this.options.isAllowedUri(n,{defaultValidate:e=>!!cv(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}))&&t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[ax({find:e=>{let t=[];if(e){let{protocols:n,defaultProtocol:r}=this.options,i=cm(e).filter(e=>e.isLink&&this.options.isAllowedUri(e.value,{defaultValidate:e=>!!cv(e,n),protocols:n,defaultProtocol:r}));
364i.length&&i.forEach(e=>{this.options.shouldAutoLink(e.value)&&t.push({text:e.value,data:{href:e.href},index:e.start})})}return t},type:this.type,getAttributes:e=>{var t;return{href:null==(t=e.data)?void 0:t.href}}})]},addProseMirrorPlugins(){var e,t,n;let r=[],{protocols:i,defaultProtocol:o}=this.options;return this.options.autolink&&r.push((e={type:this.type,defaultProtocol:this.options.defaultProtocol,validate:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!cv(e,i),protocols:i,defaultProtocol:o}),shouldAutoLink:this.options.shouldAutoLink},new tj({key:new tR("autolink"),appendTransaction:(t,n,r)=>{let i=t.some(e=>e.docChanged)&&!n.doc.eq(r.doc),o=t.some(e=>e.getMeta("preventAutolink"));if(!i||o)return;let{tr:s}=r;if(sh(o0(n.doc,[...t])).forEach(({newRange:t})=>{var n,i;let o,a,l,c=(n=r.doc,i=e=>e.isTextblock,l=[],n.nodesBetween(t.from,t.to,(e,t)=>{i(e)&&l.push({node:e,pos:t})}),l);if(c.length>1)o=c[0],a=r.doc.textBetween(o.pos,o.pos+o.node.nodeSize,void 0," ");else if(c.length){let e=r.doc.textBetween(t.from,t.to," "," ");if(!cb.test(e))return;o=c[0],a=r.doc.textBetween(o.pos,t.to,void 0," ")}if(o&&a){let t=a.split(cy).filter(Boolean);if(t.length<=0)return!1;let n=t[t.length-1],i=o.pos+a.lastIndexOf(n);if(!n)return!1;let l=cf(n).map(t=>t.toObject(e.defaultProtocol));if(!(1===l.length?l[0].isLink:3===l.length&&!!l[1].isLink&&["()","[]"].includes(l[0].value+l[2].value)))return!1;l.filter(e=>e.isLink).map(e=>({...e,from:i+e.start+1,to:i+e.end+1})).filter(e=>!r.schema.marks.code||!r.doc.rangeHasMark(e.from,e.to,r.schema.marks.code)).filter(t=>e.validate(t.value)).filter(t=>e.shouldAutoLink(t.value)).forEach(t=>{su(t.from,t.to,r.doc).some(t=>t.mark.type===e.type)||s.addMark(t.from,t.to,e.type.create({href:t.href}))})}}),s.steps.length)return s}}))),r.push((t={type:this.type,editor:this.editor,openOnClick:"whenNotEditable"===this.options.openOnClick||this.options.openOnClick,enableClickSelection:this.options.enableClickSelection},new tj({key:new tR("handleClickLink"),props:{handleClick:(e,n,r)=>{var i,o;if(0!==r.button||!e.editable)return!1;let s=null;if(r.target instanceof HTMLAnchorElement)s=r.target;else{let e=r.target;if(!e)return!1;let n=t.editor.view.dom;(s=e.closest("a"))&&!n.contains(s)&&(s=null)}if(!s)return!1;let a=!1;if(t.enableClickSelection&&(a=t.editor.commands.extendMarkRange(t.type.name)),t.openOnClick){let n=sd(e.state,t.type.name),r=null!=(i=s.href)?i:n.href,l=null!=(o=s.target)?o:n.target;r&&(window.open(r,l),a=!0)}return a}}}))),this.options.linkOnPaste&&r.push((n={editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink},new tj({key:new tR("handlePasteLink"),props:{handlePaste:(e,t,r)=>{let{shouldAutoLink:i}=n,{state:o}=e,{selection:s}=o,{empty:a}=s;if(a)return!1;let l="";r.content.forEach(e=>{l+=e.textContent});let c=cm(l,{defaultProtocol:n.defaultProtocol}).find(e=>e.isLink&&e.value===l);return!!l&&!!c&&(void 0===i||!!i(c.value))&&n.editor.commands.setMark(n.type,{href:c.href})}}}))),r}}),ck=Object.defineProperty,cS="textStyle",cM=/^\s*([-+*])\s$/,cC=ab.create({name:"bulletList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:e}){return["ul",st(this.options.HTMLAttributes,e),0]},markdownTokenName:"list",parseMarkdown:(e,t)=>"list"!==e.type||e.ordered?[]:{type:"bulletList",content:e.items?t.parseChildren(e.items):[]},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,"\n"):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes("listItem",this.editor.getAttributes(cS)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}}
364,addInputRules(){let e=al({find:cM,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=al({find:cM,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(cS),editor:this.editor})),[e]}}),cN=ab.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:e}){return["li",st(this.options.HTMLAttributes,e),0]},markdownTokenName:"list_item",parseMarkdown:(e,t)=>{if("list_item"!==e.type)return[];let n=[];if(e.tokens&&e.tokens.length>0)if(e.tokens.some(e=>"paragraph"===e.type))n=t.parseChildren(e.tokens);else{let r=e.tokens[0];if(r&&"text"===r.type&&r.tokens&&r.tokens.length>0){if(n=[{type:"paragraph",content:t.parseInline(r.tokens)}],e.tokens.length>1){let r=e.tokens.slice(1),i=t.parseChildren(r);n.push(...i)}}else n=t.parseChildren(e.tokens)}return 0===n.length&&(n=[{type:"paragraph",content:[]}]),{type:"listItem",content:n}},renderMarkdown:(e,t,n)=>ay(e,t,e=>{var t,n;if("bulletList"===e.parentType)return"- ";if("orderedList"===e.parentType){let r=(null==(n=null==(t=e.meta)?void 0:t.parentAttrs)?void 0:n.start)||1;return`${r+e.index}. `}return"- "},n),addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),cE={},cT={findListItemPos:()=>cA,getNextListDepth:()=>cj,handleBackspace:()=>cL,handleDelete:()=>cz,hasListBefore:()=>cI,hasListItemAfter:()=>c$,hasListItemBefore:()=>cD,listItemHasSubList:()=>cR,nextListIsDeeper:()=>cP,nextListIsHigher:()=>cB};for(var cO in cT)ck(cE,cO,{get:cT[cO],enumerable:!0});var cA=(e,t)=>{let{$from:n}=t.selection,r=i8(e,t.schema),i=n.depth,o=n.pos,s=null;for(;i>0&&null===s;)n.node(i).type===r?s=i:(i-=1,o-=1);return null===s?null:{$pos:t.doc.resolve(o),depth:s}},cj=(e,t)=>{let n=cA(e,t);if(!n)return!1;let[,r]=((e,t,n,r=20)=>{let i=e.doc.resolve(n),o=r,s=null;for(;o>0&&null===s;){let e=i.node(o);(null==e?void 0:e.type.name)===t?s=e:o-=1}return[s,o]})(t,e,n.$pos.pos+4);return r},cI=(e,t,n)=>{let{$anchor:r}=e.selection,i=Math.max(0,r.pos-2),o=e.doc.resolve(i).node();return!!o&&!!n.includes(o.type.name)},cD=(e,t)=>{var n;let{$anchor:r}=t.selection,i=t.doc.resolve(r.pos-2);return 0!==i.index()&&(null==(n=i.nodeBefore)?void 0:n.type.name)===e},cR=(e,t,n)=>{if(!n)return!1;let r=i8(e,t.schema),i=!1;return n.descendants(e=>{e.type===r&&(i=!0)}),i},cL=(e,t,n)=>{if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!oP(e.state,t)&&cI(e.state,t,n)){let{$anchor:n}=e.state.selection,r=e.state.doc.resolve(n.before()-1),i=[];r.node().descendants((e,n)=>{e.type.name===t&&i.push({node:e,pos:n})});let o=i.at(-1);if(!o)return!1;let s=e.state.doc.resolve(r.start()+o.pos+1);return e.chain().cut({from:n.start()-1,to:n.end()+1},s.end()).joinForward().run()}if(!oP(e.state,t)||!(e=>{let{$from:t,$to:n}=e.selection;return!(t.parentOffset>0)&&t.pos===n.pos})(e.state))return!1;let r=cA(t,e.state);if(!r)return!1;let i=e.state.doc.resolve(r.$pos.pos-2).node(r.depth),o=cR(t,e.state,i);return cD(t,e.state)&&!o?e.commands.joinItemBackward():e.chain().liftListItem(t).run()},cP=(e,t)=>{let n=cj(e,t),r=cA(e,t);return!!r&&!!n&&n>r.depth},cB=(e,t)=>{let n=cj(e,t),r=cA(e,t);return!!r&&!!n&&n<r.depth},cz=(e,t)=>{if(!oP(e.state,t)||!((e,t)=>{let{$from:n,$to:r,$anchor:i}=e.selection;if(t){let n=o2(e=>e.type.name===t)(e.selection);if(!n)return!1;let r=e.doc.resolve(n.pos+1);return i.pos+1===r.end()}return!(r.parentOffset<r.parent.nodeSize-2)&&n.pos===r.pos})(e.state,t))return!1;let{selection:n}=e.state,{$from:r,$to:i}=n;return!(!n.empty&&r.sameParent(i))&&(cP(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():cB(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward())},c$=(e,t)=>{var n;let{$anchor:r}=t.selection,i=t.doc.resolve(r.pos-r.parentOffset-2);return i.index()!==i.parent.childCount-1&&(null==(n=i.nodeAfter)?void 0:n.type.name)===e},c_=s1.create({name:"listKeymap",addOptions:()=>({listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}),addKeyboardShortcuts(){return{Delete:({editor:e})=>{let t=!1;
364return this.options.listTypes.forEach(({itemName:n})=>{void 0!==e.state.schema.nodes[n]&&cz(e,n)&&(t=!0)}),t},"Mod-Delete":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{void 0!==e.state.schema.nodes[n]&&cz(e,n)&&(t=!0)}),t},Backspace:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{void 0!==e.state.schema.nodes[n]&&cL(e,n,r)&&(t=!0)}),t},"Mod-Backspace":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{void 0!==e.state.schema.nodes[n]&&cL(e,n,r)&&(t=!0)}),t}}}}),cV=/^(\s*)(\d+)\.\s+(.*)$/,cF=/^\s/,cH="textStyle",cq=/^(\d+)\.\s$/,cU=ab.create({name:"orderedList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes:()=>({start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1},type:{default:null,parseHTML:e=>e.getAttribute("type")}}),parseHTML:()=>[{tag:"ol"}],renderHTML({HTMLAttributes:e}){let{start:t,...n}=e;return 1===t?["ol",st(this.options.HTMLAttributes,n),0]:["ol",st(this.options.HTMLAttributes,e),0]},markdownTokenName:"list",parseMarkdown:(e,t)=>{var n;if("list"!==e.type||!e.ordered)return[];let r=e.start||1,i=e.items?(n=e.items,n.map(e=>{if("list_item"!==e.type)return t.parseChildren([e])[0];let n=[];return e.tokens&&e.tokens.length>0&&e.tokens.forEach(e=>{if("paragraph"===e.type||"list"===e.type||"blockquote"===e.type||"code"===e.type)n.push(...t.parseChildren([e]));else if("text"===e.type&&e.tokens){let r=t.parseChildren([e]);n.push({type:"paragraph",content:r})}else{let r=t.parseChildren([e]);r.length>0&&n.push(...r)}}),{type:"listItem",content:n}})):[];return 1!==r?{type:"orderedList",attrs:{start:r},content:i}:{type:"orderedList",content:i}},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,"\n"):"",markdownTokenizer:{name:"orderedList",level:"block",start:e=>{let t=e.match(/^(\s*)(\d+)\.\s+/),n=null==t?void 0:t.index;return void 0!==n?n:-1},tokenize:(e,t,n)=>{var r;let i=e.split("\n"),[o,s]=function(e){let t=[],n=0,r=0;for(;n<e.length;){let i=e[n],o=i.match(cV);if(!o)break;let[,s,a,l]=o,c=s.length,d=l,h=n+1,u=[i];for(;h<e.length;){let t=e[h];if(t.match(cV))break;if(""===t.trim())u.push(t),d+="\n",h+=1;else if(t.match(cF))u.push(t),d+=`
365${t.slice(c+2)}`,h+=1;else break}t.push({indent:c,number:parseInt(a,10),content:d.trim(),raw:u.join("\n")}),r=h,n=h}return[t,r]}(i);if(0===o.length)return;let a=function e(t,n,r){var i;let o=[],s=0;for(;s<t.length;){let a=t[s];if(a.indent===n){let l=a.content.split("\n"),c=(null==(i=l[0])?void 0:i.trim())||"",d=[];c&&d.push({type:"paragraph",raw:c,tokens:r.inlineTokens(c)});let h=l.slice(1).join("\n").trim();if(h){let e=r.blockTokens(h);d.push(...e)}let u=s+1,p=[];for(;u<t.length&&t[u].indent>n;)p.push(t[u]),u+=1;if(p.length>0){let t=Math.min(...p.map(e=>e.indent)),n=e(p,t,r);d.push({type:"list",ordered:!0,start:p[0].number,items:n,raw:p.map(e=>e.raw).join("\n")})}o.push({type:"list_item",raw:a.raw,tokens:d}),s=u}else s+=1}return o}(o,0,n);if(0!==a.length)return{type:"list",ordered:!0,start:(null==(r=o[0])?void 0:r.number)||1,items:a,raw:i.slice(0,s).join("\n")}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes("listItem",this.editor.getAttributes(cH)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=al({find:cq,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=al({find:cq,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(cH)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[e]}}),cW=/^\s*(\[([( |x])?\])\s$/,cK=ab.create({name:"taskItem",addOptions:()=>({nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}),content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes:()=>({checked:{default:!1,keepOnSplit:!1,parseHTML:e=>{let t=e.getAttribute("data-checked");return""===t||"true"===t},renderHTML:e=>({"data-checked":e.checked})}}),parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:e,HTMLAttributes:t}){return["li",st(this.options.HTMLAttributes,t,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:e.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(e,t)=>{let n=[];if(e.tokens&&e.tokens.length>0?n.push(t.createNode("paragraph",{},t.parseInline(e.tokens))):e.text?n.push(t.createNode("paragraph",{},[t.createNode("text",{text:e.text})])):n.push(t.createNode("paragraph",{},[])),e.nestedTokens&&e.nestedTokens.length>0){let r=t.parseChildren(e.nestedTokens);n.push(...r)}return t.createNode("taskItem",{checked:e.checked||!1},n)},renderMarkdown:(e,t)=>{var n;let r=(null==(n=e.attrs)?void 0:n.checked)?"x":" ";return ay(e,t,`- [${r}] `)},addKeyboardShortcuts(){let e={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...e,Tab:()=>this.editor.commands.sinkListItem(this.name)}:e},addNodeView(){return({node:e,HTMLAttributes:t,getPos:n,editor:r})=>{let i=document.createElement("li"),o=document.createElement("label"),s=document.createElement("span"),a=document.createElement("input"),l=document.createElement("div"),c=e=>{var t,n;a.ariaLabel=(null==(n=null==(t=this.options.a11y)?void 0:t.checkboxLabel)?void 0:n.call(t,e,a.checked))||`Task item checkbox for ${e.textContent||"empty task item"}`};c(e),o.contentEditable="false",a.type="checkbox",a.addEventListener("mousedown",e=>e.preventDefault()),a.addEventListener("change",t=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){a.checked=!a.checked;return}let{checked:i}=t.target;r.isEditable&&"function"==typeof n&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:e})=>{let t=n();if("number"!=typeof t)return!1;let r=e.doc.nodeAt(t);return e.setNodeMarkup(t,void 0,{...null==r?void 0:r.attrs,checked:i}),!0}).run(),r.isEditable||!this.options.onReadOnlyChecked||this.options.onReadOnlyChecked(e,i)||(a.checked=!a.checked)}
365),Object.entries(this.options.HTMLAttributes).forEach(([e,t])=>{i.setAttribute(e,t)}),i.dataset.checked=e.attrs.checked,a.checked=e.attrs.checked,o.append(a,s),i.append(o,l),Object.entries(t).forEach(([e,t])=>{i.setAttribute(e,t)});let d=new Set(Object.keys(t));return{dom:i,contentDOM:l,update:e=>{if(e.type!==this.type)return!1;i.dataset.checked=e.attrs.checked,a.checked=e.attrs.checked,c(e);let t=sn(e,r.extensionManager.attributes),n=new Set(Object.keys(t)),o=this.options.HTMLAttributes;return d.forEach(e=>{n.has(e)||(e in o?i.setAttribute(e,o[e]):i.removeAttribute(e))}),Object.entries(t).forEach(([e,t])=>{null==t?e in o?i.setAttribute(e,o[e]):i.removeAttribute(e):i.setAttribute(e,t)}),d=n,!0}}}},addInputRules(){return[al({find:cW,type:this.type,getAttributes:e=>({checked:"x"===e[e.length-1]})})]}}),cJ=ab.create({name:"taskList",addOptions:()=>({itemTypeName:"taskItem",HTMLAttributes:{}}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:e}){return["ul",st(this.options.HTMLAttributes,e,{"data-type":this.name}),0]},parseMarkdown:(e,t)=>t.createNode("taskList",{},t.parseChildren(e.items||[])),renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,"\n"):"",markdownTokenizer:{name:"taskList",level:"block",start(e){var t;let n=null==(t=e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))?void 0:t.index;return void 0!==n?n:-1},tokenize(e,t,n){let r=e=>{let t=ag(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:"x"===e[3].toLowerCase()}),createToken:(e,t)=>({type:"taskItem",raw:"",mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);return t?[{type:"taskList",raw:t.raw,items:t.items}]:n.blockTokens(e)},i=ag(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:"x"===e[3].toLowerCase()}),createToken:(e,t)=>({type:"taskItem",raw:"",mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);if(i)return{type:"taskList",raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});s1.create({name:"listKit",addExtensions(){let e=[];return!1!==this.options.bulletList&&e.push(cC.configure(this.options.bulletList)),!1!==this.options.listItem&&e.push(cN.configure(this.options.listItem)),!1!==this.options.listKeymap&&e.push(c_.configure(this.options.listKeymap)),!1!==this.options.orderedList&&e.push(cU.configure(this.options.orderedList)),!1!==this.options.taskItem&&e.push(cK.configure(this.options.taskItem)),!1!==this.options.taskList&&e.push(cJ.configure(this.options.taskList)),e}});var cG="&nbsp;",cX=ab.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:e}){return["p",st(this.options.HTMLAttributes,e),0]},parseMarkdown:(e,t)=>{let n=e.tokens||[];if(1===n.length&&"image"===n[0].type)return t.parseChildren([n[0]]);let r=t.parseInline(n);return 1===r.length&&"text"===r[0].type&&(r[0].text===cG||" "===r[0].text)?t.createNode("paragraph",void 0,[]):t.createNode("paragraph",void 0,r)},renderMarkdown:(e,t)=>{if(!e)return"";let n=Array.isArray(e.content)?e.content:[];return 0===n.length?cG:t.renderChildren(n)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),cQ=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,cY=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,cZ=sQ.create({name:"strike",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("line-through")&&{}}],renderHTML({HTMLAttributes:e}){return["s",st(this.options.HTMLAttributes,e),0]},markdownTokenName:"del",parseMarkdown:(e,t)=>t.applyMark("strike",t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`~~${t.renderChildren(e)}~~`,addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}}
365,addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[as({find:cQ,type:this.type})]},addPasteRules(){return[ax({find:cY,type:this.type})]}}),c0=ab.create({name:"text",group:"inline",parseMarkdown:e=>({type:"text",text:e.text||""}),renderMarkdown:e=>e.text||""}),c1=sQ.create({name:"underline",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("underline")&&{}}],renderHTML({HTMLAttributes:e}){return["u",st(this.options.HTMLAttributes,e),0]},parseMarkdown(e,t){return t.applyMark(this.name||"underline",t.parseInline(e.tokens||[]))},renderMarkdown:(e,t)=>`++${t.renderChildren(e)}++`,markdownTokenizer:{name:"underline",level:"inline",start:e=>e.indexOf("++"),tokenize(e,t,n){let r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(e);if(!r)return;let i=r[2].trim();return{type:"underline",raw:r[0],text:i,tokens:n.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});function c2(e={}){return new tj({view:t=>new c3(t,e)})}class c3{constructor(e,t){var n;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=null!=(n=t.width)?n:1,this.color=!1===t.color?void 0:t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map(t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){null!=this.cursorPos&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,null==e?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e,t,n=this.editorView.state.doc.resolve(this.cursorPos),r=!n.parent.inlineContent,i,o=this.editorView.dom,s=o.getBoundingClientRect(),a=s.width/o.offsetWidth,l=s.height/o.offsetHeight;if(r){let e=n.nodeBefore,t=n.nodeAfter;if(e||t){let n=this.editorView.nodeDOM(this.cursorPos-(e?e.nodeSize:0));if(n){let r=n.getBoundingClientRect(),o=e?r.bottom:r.top;e&&t&&(o=(o+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let s=this.width/2*l;i={left:r.left,right:r.right,top:o-s,bottom:o+s}}}}if(!i){let e=this.editorView.coordsAtPos(this.cursorPos),t=this.width/2*a;i={left:e.left-t,right:e.left+t,top:e.top,bottom:e.bottom}}let c=this.editorView.dom.offsetParent;if(!this.element&&(this.element=c.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",r),this.element.classList.toggle("prosemirror-dropcursor-inline",!r),c&&(c!=document.body||"static"!=getComputedStyle(c).position)){let n=c.getBoundingClientRect(),r=n.width/c.offsetWidth,i=n.height/c.offsetHeight;e=n.left-c.scrollLeft*r,t=n.top-c.scrollTop*i}else e=-pageXOffset,t=-pageYOffset;this.element.style.left=(i.left-e)/a+"px",this.element.style.top=(i.top-t)/l+"px",this.element.style.width=(i.right-i.left)/a+"px",this.element.style.height=(i.bottom-i.top)/l+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,i="function"==typeof r?r(this.editorView,t,e):r;if(t&&!i){let e=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let t=e8(this.editorView.state.doc,e,this.editorView.dragging.slice);null!=t&&(e=t)}this.setCursor(e),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class c5 extends tp{constructor(e){super(e,e)}map(e,t){let n=e.resolve(t.map(this.head));return c5.valid(n)?new c5(n):tp.near(n)}content(){return G.empty}eq(e){return e instanceof c5&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if("number"!=typeof t.pos)throw RangeError("Invalid input for GapCursor.fromJSON");return new c5(e.resolve(t.pos))}getBookmark(){return new c4(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!function(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(0==n){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n-1);;e=e.lastChild){if(0==e.childCount&&!e.inlineContent||c6(e.type))return!0;
365if(e.inlineContent)return!1}}return!0}(e)||!function(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n);;e=e.firstChild){if(0==e.childCount&&!e.inlineContent||c6(e.type))return!0;if(e.inlineContent)return!1}}return!0}(e))return!1;let n=t.type.spec.allowGapCursor;if(null!=n)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(e,t,n=!1){r:for(;;){if(!n&&c5.valid(e))return e;let r=e.pos,i=null;for(let n=e.depth;;n--){let o=e.node(n);if(t>0?e.indexAfter(n)<o.childCount:e.index(n)>0){i=o.child(t>0?e.indexAfter(n):e.index(n)-1);break}if(0==n)return null;r+=t;let s=e.doc.resolve(r);if(c5.valid(s))return s}for(;;){let o=t>0?i.firstChild:i.lastChild;if(!o){if(i.isAtom&&!i.isText&&!tx.isSelectable(i)){e=e.doc.resolve(r+i.nodeSize*t),n=!1;continue r}break}i=o,r+=t;let s=e.doc.resolve(r);if(c5.valid(s))return s}return null}}}c5.prototype.visible=!1,c5.findFrom=c5.findGapCursorFrom,tp.jsonID("gapcursor",c5);class c4{constructor(e){this.pos=e}map(e){return new c4(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return c5.valid(t)?new c5(t):tp.near(t)}}function c6(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function c7(){return new tj({props:{decorations:dn,createSelectionBetween:(e,t,n)=>t.pos==n.pos&&c5.valid(n)?new c5(n):null,handleClick:de,handleKeyDown:c9,handleDOMEvents:{beforeinput
365:dt}}})}let c9=iX({ArrowLeft:c8("horiz",-1),ArrowRight:c8("horiz",1),ArrowUp:c8("vert",-1),ArrowDown:c8("vert",1)});function c8(e,t){let n="vert"==e?t>0?"down":"up":t>0?"right":"left";return function(e,r,i){let o=e.selection,s=t>0?o.$to:o.$from,a=o.empty;if(o instanceof ty){if(!i.endOfTextblock(n)||0==s.depth)return!1;a=!1,s=e.doc.resolve(t>0?s.after():s.before())}let l=c5.findGapCursorFrom(s,t,a);return!!l&&(r&&r(e.tr.setSelection(new c5(l))),!0)}}function de(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!c5.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return!(i&&i.inside>-1&&tx.isSelectable(e.state.doc.nodeAt(i.inside)))&&(e.dispatch(e.state.tr.setSelection(new c5(r))),!0)}function dt(e,t){if("insertCompositionText"!=t.inputType||!(e.state.selection instanceof c5))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let i=H.empty;for(let e=r.length-1;e>=0;e--)i=H.from(r[e].createAndFill(null,i));let o=e.state.tr.replace(n.pos,n.pos,new G(i,0,0));return o.setSelection(ty.near(o.doc.resolve(n.pos+1))),e.dispatch(o),!1}function dn(e){if(!(e.selection instanceof c5))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",ih.create(e.doc,[il.widget(e.selection.head,t,{key:"gapcursor"})])}var dr=function(){};dr.prototype.append=function(e){return e.length?(e=dr.from(e),!this.length&&e||e.length<200&&this.leafAppend(e)||this.length<200&&e.leafPrepend(this)||this.appendInner(e)):this},dr.prototype.prepend=function(e){return e.length?dr.from(e).append(this):this},dr.prototype.appendInner=function(e){return new ds(this,e)},dr.prototype.slice=function(e,t){return(void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t)?dr.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},dr.prototype.get=function(e){if(!(e<0)&&!(e>=this.length))return this.getInner(e)},dr.prototype.forEach=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},dr.prototype.map=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length);var r=[];return this.forEach(function(t,n){return r.push(e(t,n))},t,n),r},dr.from=function(e){return e instanceof dr?e:e&&e.length?new di(e):dr.empty};var di=function(e){function t(t){e.call(this),this.values=t}t.__proto__=e,t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return 0==e&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i<n;i++)if(!1===e(this.values[i],r+i))return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(!1===e(this.values[i],r+i))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=200)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=200)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(dr);dr.empty=new di([]);var ds=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return t.__proto__=e,t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var i=this.left.length;if(t<i&&!1===this.left.forEachInner(e,t,Math.min(n,i),r)||n>i&&!1===this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i))return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;if(t>i&&!1===this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i)||n<i&&!1===this.left.forEachInvertedInner(e,Math.min(t,i),n,r))return!1},t.prototype.sliceInner=function(e,t){if(0==e&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(dr);class da{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){let n,r,i,o;if(0==this.eventCount)return null;let s=this.items.length;for(;;s--)if(this.items.get(s-1).selection){--s;break}t&&(r=(n=this.remapping(s,this.items.length)).maps.length);let a=e.tr,l=[],c=[];
365return this.items.forEach((e,t)=>{if(!e.step){n||(r=(n=this.remapping(s,t+1)).maps.length),r--,c.push(e);return}if(n){c.push(new dl(e.map));let t=e.step.map(n.slice(r)),i;t&&a.maybeStep(t).doc&&(i=a.mapping.maps[a.mapping.maps.length-1],l.push(new dl(i,void 0,void 0,l.length+c.length))),r--,i&&n.appendMap(i,r)}else a.maybeStep(e.step);if(e.selection)return i=n?e.selection.map(n.slice(r)):e.selection,o=new da(this.items.slice(0,s).append(c.reverse().concat(l)),this.eventCount-1),!1},this.items.length,0),{remaining:o,transform:a,selection:i}}addTransform(e,t,n,r){var i,o;let s,a=[],l=this.eventCount,c=this.items,d=!r&&c.length?c.get(c.length-1):null;for(let n=0;n<e.steps.length;n++){let i=e.steps[n].invert(e.docs[n]),o=new dl(e.mapping.maps[n],i,t),s;(s=d&&d.merge(o))&&(o=s,n?a.pop():c=c.slice(0,c.length-1)),a.push(o),t&&(l++,t=void 0),r||(d=o)}let h=l-n.depth;return h>dd&&(i=c,o=h,i.forEach((e,t)=>{if(e.selection&&0==o--)return s=t,!1}),c=i.slice(s),l-=h),new da(c.append(a),l)}remapping(e,t){let n=new eV;return this.items.forEach((t,r)=>{let i=null!=t.mirrorOffset&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)},e,t),n}addMaps(e){return 0==this.eventCount?this:new da(this.items.append(e.map(e=>new dl(e))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-t),i=e.mapping,o=e.steps.length,s=this.eventCount;this.items.forEach(e=>{e.selection&&s--},r);let a=t;this.items.forEach(t=>{let r=i.getMirror(--a);if(null==r)return;o=Math.min(o,r);let l=i.maps[r];if(t.step){let o=e.steps[r].invert(e.docs[r]),c=t.selection&&t.selection.map(i.slice(a+1,r));c&&s++,n.push(new dl(l,o,c))}else n.push(new dl(l))},r);let l=[];for(let e=t;e<o;e++)l.push(new dl(i.maps[e]));let c=new da(this.items.slice(0,r).append(l).append(n),s);return c.emptyItemCount()>500&&(c=c.compress(this.items.length-n.length)),c}emptyItemCount(){let e=0;return this.items.forEach(t=>{!t.step&&e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),n=t.maps.length,r=[],i=0;return this.items.forEach((o,s)=>{if(s>=e)r.push(o),o.selection&&i++;else if(o.step){let e=o.step.map(t.slice(n)),s=e&&e.getMap();if(n--,s&&t.appendMap(s,n),e){let a=o.selection&&o.selection.map(t.slice(n));a&&i++;let l=new dl(s.invert(),e,a),c,d=r.length-1;(c=r.length&&r[d].merge(l))?r[d]=c:r.push(l)}}else o.map&&n--},this.items.length,0),new da(dr.from(r.reverse()),i)}}da.empty=new da(dr.empty,0);class dl{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new dl(t.getMap().invert(),t,this.selection)}}}class dc{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}}let dd=20;function dh(e){let t=[];for(let n=e.length-1;n>=0&&0==t.length;n--)e[n].forEach((e,n,r,i)=>t.push(r,i));return t}function du(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),o=t.map(e[r+1],-1);i<=o&&n.push(i,o)}return n}let dp=!1,df=null;function dm(e){let t=e.plugins;if(df!=t){dp=!1,df=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){dp=!0;break}}return dp}let dg=new tR("history"),dy=new tR("closeHistory");function db(e={}){return new tj({key:dg,state:{init:()=>new dc(da.empty,da.empty,null,0,-1),apply:(t,n,r)=>(function(e,t,n,r){let i=n.getMeta(dg),o;if(i)return i.historyState;n.getMeta(dy)&&(e=new dc(e.done,e.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(s&&s.getMeta(dg))if(s.getMeta(dg).redo)return new dc(e.done.addTransform(n,void 0,r,dm(t)),e.undone,dh(n.mapping.maps),e.prevTime,e.prevComposition);else return new dc(e.done,e.undone.addTransform(n,void 0,r,dm(t)),null,e.prevTime,e.prevComposition);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))if(o=n.getMeta("rebased"))return new dc(e.done.rebased(n,o),e.undone.rebased(n,o),du(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);else return new dc(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),du(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);{let i=n.getMeta("composition"),o=0==e.prevTime||!s&&e.prevComposition!=i&&(e.prevTime<(n.time||0)-r.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;
365return e.mapping.maps[0].forEach((e,r)=>{for(let i=0;i<t.length;i+=2)e<=t[i+1]&&r>=t[i]&&(n=!0)}),n}(n,e.prevRanges)),a=s?du(e.prevRanges,n.mapping):dh(n.mapping.maps);return new dc(e.done.addTransform(n,o?t.selection.getBookmark():void 0,r,dm(t)),da.empty,a,n.time,null==i?e.prevComposition:i)}})(n,r,t,e)},config:e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r="historyUndo"==n?dv:"historyRedo"==n?dw:null;return!!r&&!!e.editable&&(t.preventDefault(),r(e.state,e.dispatch))}}}})}function dx(e,t){return(n,r)=>{let i=dg.getState(n);if(!i||0==(e?i.undone:i.done).eventCount)return!1;if(r){let o=function(e,t,n){let r=dm(t),i=dg.get(t).spec.config,o=(n?e.undone:e.done).popEvent(t,r);if(!o)return null;let s=o.selection.resolve(o.transform.doc),a=(n?e.done:e.undone).addTransform(o.transform,t.selection.getBookmark(),i,r),l=new dc(n?a:o.remaining,n?o.remaining:a,null,0,-1);return o.transform.setSelection(s).setMeta(dg,{redo:n,historyState:l})}(i,n,e);o&&r(t?o.scrollIntoView():o)}return!0}}let dv=dx(!1,!0),dw=dx(!0,!0);dx(!1,!1),dx(!0,!1),s1.create({name:"characterCount",addOptions:()=>({limit:null,mode:"textSize",textCounter:e=>e.length,wordCounter:e=>e.split(" ").filter(e=>""!==e).length}),addStorage:()=>({characters:()=>0,words:()=>0}),onBeforeCreate(){this.storage.characters=e=>{let t=(null==e?void 0:e.node)||this.editor.state.doc;if("textSize"===((null==e?void 0:e.mode)||this.options.mode)){let e=t.textBetween(0,t.content.size,void 0," ");return this.options.textCounter(e)}return t.nodeSize},this.storage.words=e=>{let t=(null==e?void 0:e.node)||this.editor.state.doc,n=t.textBetween(0,t.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new tj({key:new tR("characterCount"),appendTransaction:(t,n,r)=>{if(e)return;let i=this.options.limit;if(null==i||0===i){e=!0;return}let o=this.storage.characters({node:r.doc});if(o>i){console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);let t=r.tr.deleteRange(0,o-i);return e=!0,t}e=!0},filterTransaction:(e,t)=>{let n=this.options.limit;if(!e.docChanged||0===n||null==n)return!0;let r=this.storage.characters({node:t.doc}),i=this.storage.characters({node:e.doc});if(i<=n||r>n&&i>n&&i<=r)return!0;if(r>n&&i>n&&i>r||!e.getMeta("paste"))return!1;let o=e.selection.$head.pos;return e.deleteRange(o-(i-n),o),!(this.storage.characters({node:e.doc})>n)}})]}});var dk=s1.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:void 0}),addProseMirrorPlugins(){return[c2(this.options)]}});s1.create({name:"focus",addOptions:()=>({className:"has-focus",mode:"all"}),addProseMirrorPlugins(){return[new tj({key:new tR("focus"),props:{decorations:({doc:e,selection:t})=>{let{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,o=[];if(!n||!r)return ih.create(e,[]);let s=0;"deepest"===this.options.mode&&e.descendants((e,t)=>{if(!e.isText){if(!(i>=t&&i<=t+e.nodeSize-1))return!1;s+=1}});let a=0;return e.descendants((e,t)=>!e.isText&&!!(i>=t&&i<=t+e.nodeSize-1)&&((a+=1,"deepest"===this.options.mode&&s-a>0||"shallowest"===this.options.mode&&a>1)?"deepest"===this.options.mode:void o.push(il.node(t,t+e.nodeSize,{class:this.options.className})))),ih.create(e,o)}}})]}});var dS=s1.create({name:"gapCursor",addProseMirrorPlugins:()=>[c7()],extendNodeSchema(e){var t;let n={name:e.name,options:e.options,storage:e.storage};return{allowGapCursor:null!=(t=o7(o3(e,"allowGapCursor",n)))?t:null}}}),dM="placeholder";function dC({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||(null==t?void 0:t.type)===e}s1.create({name:"placeholder",addOptions:()=>({emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:dM,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}),addProseMirrorPlugins(){let e=this.options.dataAttribute?`data-${this.options.dataAttribute.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}`:`data-${dM}`;return[new tj({key:new tR("placeholder"),props:{decorations:({doc:t,selection:n})=>{let r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:i}=n,o=[];if(!r)return null;let s=this.editor.isEmpty;
365return t.descendants((t,n)=>{let r=i>=n&&i<=n+t.nodeSize,a=!t.isLeaf&&sb(t);if((r||!this.options.showOnlyCurrent)&&a){let i=[this.options.emptyNodeClass];s&&i.push(this.options.emptyEditorClass);let a=il.node(n,n+t.nodeSize,{class:i.join(" "),[e]:"function"==typeof this.options.placeholder?this.options.placeholder({editor:this.editor,node:t,pos:n,hasAnchor:r}):this.options.placeholder});o.push(a)}return this.options.includeChildren}),ih.create(t,o)}}})]}}),s1.create({name:"selection",addOptions:()=>({className:"selection"}),addProseMirrorPlugins(){let{editor:e,options:t}=this;return[new tj({key:new tR("selection"),props:{decorations:n=>n.selection.empty||e.isFocused||!e.isEditable||sx(n.selection)||e.view.dragging?null:ih.create(n.doc,[il.inline(n.selection.from,n.selection.to,{class:t.className})])}})]}});var dN=s1.create({name:"trailingNode",addOptions:()=>({node:void 0,notAfter:[]}),addProseMirrorPlugins(){var e;let t=new tR(this.name),n=this.options.node||(null==(e=this.editor.schema.topNodeType.contentMatch.defaultType)?void 0:e.name)||"paragraph",r=Object.entries(this.editor.schema.nodes).map(([,e])=>e).filter(e=>(this.options.notAfter||[]).concat(n).includes(e.name));return[new tj({key:t,appendTransaction:(e,r,i)=>{let{doc:o,tr:s,schema:a}=i,l=t.getState(i),c=o.content.size,d=a.nodes[n];if(l)return s.insert(c,d.create())},state:{init:(e,t)=>!dC({node:t.tr.doc.lastChild,types:r}),apply:(e,t)=>!e.docChanged||e.getMeta("__uniqueIDTransaction")?t:!dC({node:e.doc.lastChild,types:r})}})]}}),dE=s1.create({name:"undoRedo",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:e,dispatch:t})=>dv(e,t),redo:()=>({state:e,dispatch:t})=>dw(e,t)}),addProseMirrorPlugins(){return[db(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),dT=s1.create({name:"starterKit",addExtensions(){var e,t,n,r;let i=[];return!1!==this.options.bold&&i.push(a$.configure(this.options.bold)),!1!==this.options.blockquote&&i.push(aR.configure(this.options.blockquote)),!1!==this.options.bulletList&&i.push(cC.configure(this.options.bulletList)),!1!==this.options.code&&i.push(aF.configure(this.options.code)),!1!==this.options.codeBlock&&i.push(aU.configure(this.options.codeBlock)),!1!==this.options.document&&i.push(aW.configure(this.options.document)),!1!==this.options.dropcursor&&i.push(dk.configure(this.options.dropcursor)),!1!==this.options.gapcursor&&i.push(dS.configure(this.options.gapcursor)),!1!==this.options.hardBreak&&i.push(aK.configure(this.options.hardBreak)),!1!==this.options.heading&&i.push(aJ.configure(this.options.heading)),!1!==this.options.undoRedo&&i.push(dE.configure(this.options.undoRedo)),!1!==this.options.horizontalRule&&i.push(aG.configure(this.options.horizontalRule)),!1!==this.options.italic&&i.push(a0.configure(this.options.italic)),!1!==this.options.listItem&&i.push(cN.configure(this.options.listItem)),!1!==this.options.listKeymap&&i.push(c_.configure(null==(e=this.options)?void 0:e.listKeymap)),!1!==this.options.link&&i.push(cw.configure(null==(t=this.options)?void 0:t.link)),!1!==this.options.orderedList&&i.push(cU.configure(this.options.orderedList)),!1!==this.options.paragraph&&i.push(cX.configure(this.options.paragraph)),!1!==this.options.strike&&i.push(cZ.configure(this.options.strike)),!1!==this.options.text&&i.push(c0.configure(this.options.text)),!1!==this.options.underline&&i.push(c1.configure(null==(n=this.options)?void 0:n.underline)),!1!==this.options.trailingNode&&i.push(dN.configure(null==(r=this.options)?void 0:r.trailingNode)),i}});function dO(e){let{state:t,transaction:n}=e,{selection:r}=n,{doc:i}=n,{storedMarks:o}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,o=n.storedMarks,n}}}class dA{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){let{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:i}=n,o=this.buildProps(i);return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,(...e)=>{let n=t(...e)(o);return i.getMeta("preventDispatch")||this.hasCustomState||r.dispatch(i),n}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:o}=r,s=[],a=!!e,l=e||i.tr,c=()=>(a||!t||l.getMeta("preventDispatch")||this.hasCustomState||o.dispatch(l),s.every(e=>!0===e)),d={...Object.fromEntries(Object.entries(n).map(([e,n])=>[e,(...e)=>{let r=this.buildProps(l,t),i=n(...e)(r);return s.push(i),d}])),run:c};return d}createCan(e){let{rawCommands:t,state:n}=this,r=e||n.tr,i=this.buildProps(r,!1);return{...Object.fromEntries(Object.entries(t).map(([e,t])=>[e,(...e)=>t(...e)({...i,dispatch:void 0})])),chain:()=>this.createChain(r,!1)}}buildProps(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:o}=r,s={tr:e,editor:r,view:o,state:dO({state:i,transaction:e}),dispatch:t?()=>void 0:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([e,t])=>[e,(...e)=>t(...e)(s)]))}};return s}}function dj(e,t,n){return void 0===e.config[t]&&e.parent?dj(e.parent,t,n):"function"==typeof e.config[t]?e.config[t].bind({...n,parent:e.parent?dj(e.parent,t,n):null}):e.config[t]}function dI(e,t){if("string"==typeof e){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}function dD(e,t,...n){return"function"==typeof e?t?e.bind(t)(...n):e(...n):e}function dR(e){return"Object"===Object.prototype.toString.call(e).slice(8,-1)&&e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}class dL{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=dD(dj(this,"addOptions",{name:this.name}))),this.storage=dD(dj(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new dL(e)}configure(e={}){let t=this.extend({...this.config,addOptions:()=>(function e(t,n){let r={...t};
365return dR(t)&&dR(n)&&Object.keys(n).forEach(i=>{dR(n[i])&&dR(t[i])?r[i]=e(t[i],n[i]):r[i]=n[i]}),r})(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){let t=new dL({...this.config,...e});return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=dD(dj(t,"addOptions",{name:t.name})),t.storage=dD(dj(t,"addStorage",{name:t.name,options:t.options})),t}}function dP(e,t,n={strict:!0}){let r=Object.keys(t);return!r.length||r.every(r=>{var i;return n.strict?t[r]===e[r]:(i=t[r],"[object RegExp]"===Object.prototype.toString.call(i))?t[r].test(e[r]):t[r]===e[r]})}function dB(e,t,n={}){return e.find(e=>e.type===t&&dP(Object.fromEntries(Object.keys(n).map(t=>[t,e.attrs[t]])),n))}function dz(e,t,n={}){return!!dB(e,t,n)}function d$(e,t,n){var r;if(!e||!t)return;let i=e.parent.childAfter(e.parentOffset);if(i.node&&i.node.marks.some(e=>e.type===t)||(i=e.parent.childBefore(e.parentOffset)),!i.node||!i.node.marks.some(e=>e.type===t)||(n=n||(null==(r=i.node.marks[0])?void 0:r.attrs),!dB([...i.node.marks],t,n)))return;let o=i.index,s=e.start()+i.offset,a=o+1,l=s+i.node.nodeSize;for(;o>0&&dz([...e.parent.child(o-1).marks],t,n);)o-=1,s-=e.parent.child(o).nodeSize;for(;a<e.parent.childCount&&dz([...e.parent.child(a).marks],t,n);)l+=e.parent.child(a).nodeSize,a+=1;return{from:s,to:l}}function d_(e,t){if("string"==typeof e){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}function dV(e){return e instanceof ty}function dF(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function dH(){return"Android"===navigator.platform||/android/i.test(navigator.userAgent)}function dq(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}dL.create({name:"clipboardTextSerializer",addOptions:()=>({blockSeparator:void 0}),addProseMirrorPlugins(){return[new tj({key:new tR("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{let{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,{ranges:o}=i,s=Math.min(...o.map(e=>e.$from.pos)),a=Math.max(...o.map(e=>e.$to.pos)),l=Object.fromEntries(Object.entries(n.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]));return function(e,t,n){let{from:r,to:i}=t,{blockSeparator:o="\n\n",textSerializers:s={}}=n||{},a="";return e.nodesBetween(r,i,(e,n,l,c)=>{var d;e.isBlock&&n>r&&(a+=o);let h=null==s?void 0:s[e.type.name];if(h)return l&&(a+=h({node:e,pos:n,parent:l,index:c,range:t})),!1;e.isText&&(a+=null==(d=null==e?void 0:e.text)?void 0:d.slice(Math.max(r,n)-n,i-n))}),a}(r,{from:s,to:a},{...void 0!==this.options.blockSeparator?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}});let dU=e=>{let t=e.childNodes;for(let n=t.length-1;n>=0;n-=1){let r=t[n];3===r.nodeType&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):1===r.nodeType&&dU(r)}return e};function dW(e){let t=`<body>${e}</body>`;return dU(new window.DOMParser().parseFromString(t,"text/html").body)}function dK(e,t,n){if(e instanceof el||e instanceof H)return e;n={slice:!0,parseOptions:{},...n};let r="object"==typeof e&&null!==e,i="string"==typeof e;if(r)try{if(Array.isArray(e)&&e.length>0)return H.fromArray(e.map(e=>t.nodeFromJSON(e)));let r=t.nodeFromJSON(e);return n.errorOnInvalidContent&&r.check(),r}catch(r){if(n.errorOnInvalidContent)throw Error("[tiptap error]: Invalid JSON content",{cause:r});return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",r),dK("",t,n)}if(i){if(n.errorOnInvalidContent){let r=!1,i="",o=new eS({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:e=>(r=!0,i="string"==typeof e?e:e.outerHTML,null)}]}})});if(n.slice?eC.fromSchema(o).parseSlice(dW(e),n.parseOptions):eC.fromSchema(o).parse(dW(e),n.parseOptions),n.errorOnInvalidContent&&r)throw Error("[tiptap error]: Invalid HTML content",{cause:Error(`Invalid element found: ${i}`)})}let r=eC.fromSchema(t);return n.slice?r.parseSlice(dW(e),n.parseOptions).content:r.parse(dW(e),n.parseOptions)}return dK("",t,n)}function dJ(){return"u">typeof navigator&&/Mac/.test(navigator.platform)}function dG(e,t,n={}){let{from:r,to:i,empty:o}=e.selection,s=t?dI(t,e.schema):null,a=[];e.doc.nodesBetween(r,i,(e,t)=>{if(e.isText)return;let n=Math.max(r,t),o=Math.min(i,t+e.nodeSize);a.push({node:e,from:n,to:o})});let l=i-r,c=a.filter(e=>
365!s||s.name===e.node.type.name).filter(e=>dP(e.node.attrs,n,{strict:!1}));return o?!!c.length:c.reduce((e,t)=>e+t.to-t.from,0)>=l}function dX(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function dQ(e,t){let n="string"==typeof t?[t]:t;return Object.keys(e).reduce((t,r)=>(n.includes(r)||(t[r]=e[r]),t),{})}function dY(e){return t=>(function(e,t){for(let n=e.depth;n>0;n-=1){let r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}})(t.$from,e)}function dZ(e,t,n){return Object.fromEntries(Object.entries(n).filter(([n])=>{let r=e.find(e=>e.type===t&&e.name===n);return!!r&&r.attribute.keepOnSplit}))}function d0(e,t){let n,{nodeExtensions:r}=(n=t.filter(e=>"extension"===e.type),{baseExtensions:n,nodeExtensions:t.filter(e=>"node"===e.type),markExtensions:t.filter(e=>"mark"===e.type)}),i=r.find(t=>t.name===e);if(!i)return!1;let o={name:i.name,options:i.options,storage:i.storage},s=dD(dj(i,"group",o));return"string"==typeof s&&s.split(" ").includes("list")}function d1(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if("hardBreak"===e.type.name)return!0;if(e.isText)return/^\s*$/m.test(null!=(r=e.text)?r:"")}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(0===e.content.childCount)return!0;if(t){let r=!0;return e.content.forEach(e=>{!1!==r&&(d1(e,{ignoreWhitespace:n,checkChildren:t})||(r=!1))}),r}return!1}function d2(e,t){let n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){let r=n.filter(e=>null==t?void 0:t.includes(e.type.name));e.tr.ensureMarks(r)}}let d3=(e,t)=>{let n=dY(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(void 0===r)return!0;let i=e.doc.nodeAt(r);return!(n.node.type===(null==i?void 0:i.type)&&e6(e.doc,n.pos))||(e.join(n.pos),!0)},d5=(e,t)=>{let n=dY(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(n.start).after(n.depth);if(void 0===r)return!0;let i=e.doc.nodeAt(r);return!(n.node.type===(null==i?void 0:i.type)&&e6(e.doc,r))||(e.join(r),!0)};var d4=Object.freeze({__proto__:null,blur:()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),null==(n=null==window?void 0:window.getSelection())||n.removeAllRanges())}),!0),clearContent:(e=!1)=>({commands:t})=>t.setContent("",e),clearNodes:()=>({state:e,tr:t,dispatch:n})=>{let{selection:r}=t,{ranges:i}=r;return!n||(i.forEach(({$from:n,$to:r})=>{e.doc.nodesBetween(n.pos,r.pos,(e,n)=>{if(e.type.isText)return;let{doc:r,mapping:i}=t,o=r.resolve(i.map(n)),s=r.resolve(i.map(n+e.nodeSize)),a=o.blockRange(s);if(!a)return;let l=e0(a);if(e.type.isTextblock){let{defaultType:e}=o.parent.contentMatchAt(o.index());t.setNodeMarkup(a.start,e)}(l||0===l)&&t.lift(a,l)})}),!0)},command:e=>t=>e(t),createParagraphNear:()=>({state:e,dispatch:t})=>t0(e,t),cut:(e,t)=>({editor:n,tr:r})=>{let{state:i}=n,o=i.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);let s=r.mapping.map(t);return r.insert(s,o.content),r.setSelection(new ty(r.doc.resolve(Math.max(s-1,0)))),!0},deleteCurrentNode:()=>({tr:e,dispatch:t})=>{let{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;let i=e.selection.$anchor;for(let n=i.depth;n>0;n-=1)if(i.node(n).type===r.type){if(t){let t=i.before(n),r=i.after(n);e.delete(t,r).scrollIntoView()}return!0}return!1},deleteNode:e=>({tr:t,state:n,dispatch:r})=>{let i=dI(e,n.schema),o=t.selection.$anchor;for(let e=o.depth;e>0;e-=1)if(o.node(e).type===i){if(r){let n=o.before(e),r=o.after(e);t.delete(n,r).scrollIntoView()}return!0}return!1},deleteRange:e=>({tr:t,dispatch:n})=>{let{from:r,to:i}=e;return n&&t.delete(r,i),!0},deleteSelection:()=>({state:e,dispatch:t})=>tL(e,t),enter:()=>({commands:e})=>e.keyboardShortcut("Enter"),exitCode:()=>({state:e,dispatch:t})=>tZ(e,t),extendMarkRange:(e,t={})=>({tr:n,state:r,dispatch:i})=>{let o=d_(e,r.schema),{doc:s,selection:a}=n,{$from:l,from:c,to:d}=a;if(i){let e=d$(l,o,t);if(e&&e.from<=c&&e.to>=d){let t=ty.create(s,e.from,e.to);n.setSelection(t)}}return!0},first:e=>t=>{let n="function"==typeof e?e(t):e;for(let e=0;e<n.length;e+=1)if(n[e](t))return!0;return!1},focus:(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:o})=>{t={scrollIntoView:!0,...t};let s=()=>{(dq()||dH())&&r.dom.focus(),requestAnimationFrame(()=>{!n.isDestroyed&&(r.focus(),"u">typeof navigator&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&!dq()&&!dH()&&r.dom.focus({preventScroll:!0}))})};if(r.hasFocus()&&null===e||!1===e)return!0;
365if(o&&null===e&&!dV(n.state.selection))return s(),!0;let a=function(e,t=null){if(!t)return null;let n=tp.atStart(e),r=tp.atEnd(e);if("start"===t||!0===t)return n;if("end"===t)return r;let i=n.from,o=r.to;return"all"===t?ty.create(e,dF(0,i,o),dF(e.content.size,i,o)):ty.create(e,dF(t,i,o),dF(t,i,o))}(i.doc,e)||n.state.selection,l=n.state.selection.eq(a);return o&&(l||i.setSelection(a),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},forEach:(e,t)=>n=>e.every((e,r)=>t(e,{...n,index:r})),insertContent:(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),insertContentAt:(e,t,n)=>({tr:r,dispatch:i,editor:o})=>{var s;if(i){let i,a;n={parseOptions:o.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let l=e=>{o.emit("contentError",{editor:o,error:e,disableCollaboration:()=>{o.storage.collaboration&&(o.storage.collaboration.isDisabled=!0)}})},c={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!o.options.enableContentCheck&&o.options.emitContentError)try{dK(t,o.schema,{parseOptions:c,errorOnInvalidContent:!0})}catch(e){l(e)}try{i=dK(t,o.schema,{parseOptions:c,errorOnInvalidContent:null!=(s=n.errorOnInvalidContent)?s:o.options.enableContentCheck})}catch(e){return l(e),!1}let{from:d,to:h}="number"==typeof e?{from:e,to:e}:{from:e.from,to:e.to},u=!0,p=!0;if((!("type"in i)?i:[i]).forEach(e=>{e.check(),u=!!u&&e.isText&&0===e.marks.length,p=!!p&&e.isBlock}),d===h&&p){let{parent:e}=r.doc.resolve(d);!e.isTextblock||e.type.spec.code||e.childCount||(d-=1,h+=1)}if(u){if(Array.isArray(t))a=t.map(e=>e.text||"").join("");else if(t instanceof H){let e="";t.forEach(t=>{t.text&&(e+=t.text)}),a=e}else a="object"==typeof t&&t&&t.text?t.text:t;r.insertText(a,d,h)}else a=i,r.replaceWith(d,h,a);n.updateSelection&&function(e,t){let n=e.steps.length-1;if(n<t)return;let r=e.steps[n];if(!(r instanceof eX||r instanceof eQ))return;let i=e.mapping.maps[n],o=0;i.forEach((e,t,n,r)=>{0===o&&(o=r)}),e.setSelection(tp.near(e.doc.resolve(o),-1))}(r,r.steps.length-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:d,text:a}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:d,text:a})}return!0},joinBackward:()=>({state:e,dispatch:t})=>tB(e,t),joinDown:()=>({state:e,dispatch:t})=>tG(e,t),joinForward:()=>({state:e,dispatch:t})=>tU(e,t),joinItemBackward:()=>({state:e,dispatch:t,tr:n})=>{try{let r=e9(e.doc,e.selection.$from.pos,-1);if(null==r)return!1;return n.join(r,2),t&&t(n),!0}catch{return!1}},joinItemForward:()=>({state:e,dispatch:t,tr:n})=>{try{let r=e9(e.doc,e.selection.$from.pos,1);if(null==r)return!1;return n.join(r,2),t&&t(n),!0}catch{return!1}},joinTextblockBackward:()=>({state:e,dispatch:t})=>tz(e,t),joinTextblockForward:()=>({state:e,dispatch:t})=>t$(e,t),joinUp:()=>({state:e,dispatch:t})=>tJ(e,t),keyboardShortcut:e=>({editor:t,view:n,tr:r,dispatch:i})=>{let o=(function(e){let t,n,r,i,o=e.split(/-(?!$)/),s=o[o.length-1];"Space"===s&&(s=" ");for(let e=0;e<o.length-1;e+=1){let s=o[e];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else if(/^s(hift)?$/i.test(s))r=!0;else if(/^mod$/i.test(s))dq()||dJ()?i=!0:n=!0;else throw Error(`Unrecognized modifier name: ${s}`)}return t&&(s=`Alt-${s}`),n&&(s=`Ctrl-${s}`),i&&(s=`Meta-${s}`),r&&(s=`Shift-${s}`),s})(e).split(/-(?!$)/),s=o.find(e=>!["Alt","Ctrl","Meta","Shift"].includes(e)),a=new KeyboardEvent("keydown",{key:"Space"===s?" ":s,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),l=t.captureTransaction(()=>{n.someProp("handleKeyDown",e=>e(n,a))});return null==l||l.steps.forEach(e=>{let t=e.map(r.mapping);t&&i&&r.maybeStep(t)}),!0},lift:(e,t={})=>({state:n,dispatch:r})=>{let i=dI(e,n.schema);return!!dG(n,i,t)&&tX(n,r)},liftEmptyBlock:()=>({state:e,dispatch:t})=>t1(e,t),liftListItem:e=>({state:t,dispatch:n})=>no(dI(e,t.schema))(t,n),newlineInCode:()=>({state:e,dispatch:t})=>tQ(e,t),resetAttributes:(e,t)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null,a=dX("string"==typeof e?e:e.name,r.schema);return!!a&&("node"===a&&(o=dI(e,r.schema)),"mark"===a&&(s=d_(e,r.schema)),i&&n.selection.ranges.forEac
365h(e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,(e,r)=>{o&&o===e.type&&n.setNodeMarkup(r,void 0,dQ(e.attrs,t)),s&&e.marks.length&&e.marks.forEach(i=>{s===i.type&&n.addMark(r,r+e.nodeSize,s.create(dQ(i.attrs,t)))})})}),!0)},scrollIntoView:()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),selectAll:()=>({tr:e,dispatch:t})=>{if(t){let t=new tw(e.doc);e.setSelection(t)}return!0},selectNodeBackward:()=>({state:e,dispatch:t})=>tF(e,t),selectNodeForward:()=>({state:e,dispatch:t})=>tW(e,t),selectParentNode:()=>({state:e,dispatch:t})=>t2(e,t),selectTextblockEnd:()=>({state:e,dispatch:t})=>t6(e,t),selectTextblockStart:()=>({state:e,dispatch:t})=>t4(e,t),setContent:(e,t=!1,n={},r={})=>({editor:i,tr:o,dispatch:s,commands:a})=>{var l,c;let{doc:d}=o;if("full"!==n.preserveWhitespace){let a=function(e,t,n={},r={}){return dK(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}(e,i.schema,n,{errorOnInvalidContent:null!=(l=r.errorOnInvalidContent)?l:i.options.enableContentCheck});return s&&o.replaceWith(0,d.content.size,a).setMeta("preventUpdate",!t),!0}return s&&o.setMeta("preventUpdate",!t),a.insertContentAt({from:0,to:d.content.size},e,{parseOptions:n,errorOnInvalidContent:null!=(c=r.errorOnInvalidContent)?c:i.options.enableContentCheck})},setMark:(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{selection:o}=n,{empty:s,ranges:a}=o,l=d_(e,r.schema);if(i)if(s){let e=function(e,t){let n=d_(t,e.schema),{from:r,to:i,empty:o}=e.selection,s=[];o?(e.storedMarks&&s.push(...e.storedMarks),s.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,e=>{s.push(...e.marks)});let a=s.find(e=>e.type.name===n.name);return a?{...a.attrs}:{}}(r,l);n.addStoredMark(l.create({...e,...t}))}else a.forEach(e=>{let i=e.$from.pos,o=e.$to.pos;r.doc.nodesBetween(i,o,(e,r)=>{let s=Math.max(r,i),a=Math.min(r+e.nodeSize,o);e.marks.find(e=>e.type===l)?e.marks.forEach(e=>{l===e.type&&n.addMark(s,a,l.create({...e.attrs,...t}))}):n.addMark(s,a,l.create(t))})});return function(e,t,n){var r;let{selection:i}=t,o=null;
365if(dV(i)&&(o=i.$cursor),o){let t=null!=(r=e.storedMarks)?r:o.marks();return!!n.isInSet(t)||!t.some(e=>e.type.excludes(n))}let{ranges:s}=i;return s.some(({$from:t,$to:r})=>{let i=0===t.depth&&e.doc.inlineContent&&e.doc.type.allowsMarkType(n);return e.doc.nodesBetween(t.pos,r.pos,(e,t,r)=>{if(i)return!1;if(e.isInline){let t=!r||r.type.allowsMarkType(n),o=!!n.isInSet(e.marks)||!e.marks.some(e=>e.type.excludes(n));i=t&&o}return!i}),i})}(r,n,l)},setMeta:(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),setNode:(e,t={})=>({state:n,dispatch:r,chain:i})=>{let o,s=dI(e,n.schema);return(n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),s.isTextblock)?i().command(({commands:e})=>!!t9(s,{...o,...t})(n)||e.clearNodes()).command(({state:e})=>t9(s,{...o,...t})(e,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},setNodeSelection:e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,r=dF(e,0,n.content.size),i=tx.create(n,r);t.setSelection(i)}return!0},setTextSelection:e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,{from:r,to:i}="number"==typeof e?{from:e,to:e}:e,o=ty.atStart(n).from,s=ty.atEnd(n).to,a=dF(r,o,s),l=dF(i,o,s),c=ty.create(n,a,l);t.setSelection(c)}return!0},sinkListItem:e=>({state:t,dispatch:n})=>ns(dI(e,t.schema))(t,n),splitBlock:({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{let{selection:o,doc:s}=t,{$from:a,$to:l}=o,c=dZ(i.extensionManager.attributes,a.node().type.name,a.node().attrs);if(o instanceof tx&&o.node.isBlock)return!!a.parentOffset&&!!e4(s,a.pos)&&(r&&(e&&d2(n,i.extensionManager.splittableMarks),t.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;let d=l.parentOffset===l.parent.content.size,h=0===a.depth?void 0:function(e){for(let t=0;t<e.edgeCount;t+=1){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}(a.node(-1).contentMatchAt(a.indexAfter(-1))),u=d&&h?[{type:h,attrs:c}]:void 0,p=e4(t.doc,t.mapping.map(a.pos),1,u);if(!u&&!p&&e4(t.doc,t.mapping.map(a.pos),1,h?[{type:h}]:void 0)&&(p=!0,u=h?[{type:h,attrs:c}]:void 0),r){if(p&&(o instanceof ty&&t.deleteSelection(),t.split(t.mapping.map(a.pos),1,u),h&&!d&&!a.parentOffset&&a.parent.type!==h)){let e=t.mapping.map(a.before()),n=t.doc.resolve(e);a.node(-1).canReplaceWith(n.index(),n.index()+1,h)&&t.setNodeMarkup(t.mapping.map(a.before()),h)}e&&d2(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return p},splitListItem:(e,t={})=>({tr:n,state:r,dispatch:i,editor:o})=>{var s;let a=dI(e,r.schema),{$from:l,$to:c}=r.selection,d=r.selection.node;if(d&&d.isBlock||l.depth<2||!l.sameParent(c))return!1;let h=l.node(-1);if(h.type!==a)return!1;let u=o.extensionManager.attributes;if(0===l.parent.content.size&&l.node(-1).childCount===l.indexAfter(-1)){if(2===l.depth||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return!1;if(i){let e=H.empty,r=l.index(-1)?1:l.index(-2)?2:3;for(let t=l.depth-r;t>=l.depth-3;t-=1)e=H.from(l.node(t).copy(e));let i=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,o={...dZ(u,l.node().type.name,l.node().attrs),...t},c=(null==(s=a.contentMatch.defaultType)?void 0:s.createAndFill(o))||void 0;e=e.append(H.from(a.createAndFill(null,c)||void 0));let d=l.before(l.depth-(r-1));n.replace(d,l.after(-i),new G(e,4-r,0));let h=-1;n.doc.nodesBetween(d,n.doc.content.size,(e,t)=>{if(h>-1)return!1;e.isTextblock&&0===e.content.size&&(h=t+1)}),h>-1&&n.setSelection(ty.near(n.doc.resolve(h))),n.scrollIntoView()}return!0}let p=c.pos===l.end()?h.contentMatchAt(0).defaultType:null,f={...dZ(u,h.type.name,h.attrs),...t},m={...dZ(u,l.node().type.name,l.node().attrs),...t};n.delete(l.pos,c.pos);let g=p?[{type:a,attrs:f},{type:p,attrs:m}]:[{type:a,attrs:f}];if(!e4(n.doc,l.pos,2))return!1;if(i){let{selection:e,storedMarks:t}=r,{splittableMarks:s}=o.extensionManager,a=t||e.$to.parentOffset&&e.$from.marks();if(n.split(l.pos,2,g).scrollIntoView(),!a||!i)return!0;let c=a.filter(e=>s.includes(e.type.name));n.ensureMarks(c)}return!0},toggleList:(e,t,n,r={})=>({editor:i,tr:o,state:s,dispatch:a,chain:l,commands:c,can:d})=>{let{extensions:h,splittableMarks:u}=i.extensionManager,p=dI(e,s.schema),f=dI(t,s.schema),{selection:m,storedMarks:g}=s,{$from:y,$to:b}=m,x=y.blockRange(b),v=g||m.$to.parentOffset&&m.$from.marks();if(!x)return!1;let w=dY(e=>
365d0(e.type.name,h))(m);if(x.depth>=1&&w&&x.depth-w.depth<=1){if(w.node.type===p)return c.liftListItem(f);if(d0(w.node.type.name,h)&&p.validContent(w.node.content)&&a)return l().command(()=>(o.setNodeMarkup(w.pos,p),!0)).command(()=>d3(o,p)).command(()=>d5(o,p)).run()}return n&&v&&a?l().command(()=>{let e=d().wrapInList(p,r),t=v.filter(e=>u.includes(e.type.name));return o.ensureMarks(t),!!e||c.clearNodes()}).wrapInList(p,r).command(()=>d3(o,p)).command(()=>d5(o,p)).run():l().command(()=>!!d().wrapInList(p,r)||c.clearNodes()).wrapInList(p,r).command(()=>d3(o,p)).command(()=>d5(o,p)).run()},toggleMark:(e,t={},n={})=>({state:r,commands:i})=>{let{extendEmptyMarkRange:o=!1}=n,s=d_(e,r.schema);return!function(e,t,n={}){let{empty:r,ranges:i}=e.selection,o=t?d_(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(e=>!o||o.name===e.type.name).find(e=>dP(e.attrs,n,{strict:!1}));let s=0,a=[];if(i.forEach(({$from:t,$to:n})=>{let r=t.pos,i=n.pos;e.doc.nodesBetween(r,i,(e,t)=>{if(!e.isText&&!e.marks.length)return;let n=Math.max(r,t),o=Math.min(i,t+e.nodeSize);s+=o-n,a.push(...e.marks.map(e=>({mark:e,from:n,to:o})))})}),0===s)return!1;let l=a.filter(e=>!o||o.name===e.mark.type.name).filter(e=>dP(e.mark.attrs,n,{strict:!1})).reduce((e,t)=>e+t.to-t.from,0),c=a.filter(e=>!o||e.mark.type!==o&&e.mark.type.excludes(o)).reduce((e,t)=>e+t.to-t.from,0);return(l>0?l+c:l)>=s}(r,s,t)?i.setMark(s,t):i.unsetMark(s,{extendEmptyMarkRange:o})},toggleNode:(e,t,n={})=>({state:r,commands:i})=>{let o,s=dI(e,r.schema),a=dI(t,r.schema),l=dG(r,s,n);return(r.selection.$anchor.sameParent(r.selection.$head)&&(o=r.selection.$anchor.parent.attrs),l)?i.setNode(a,o):i.setNode(s,{...o,...n})},toggleWrap:(e,t={})=>({state:n,commands:r})=>{let i=dI(e,n.schema);return dG(n,i,t)?r.lift(i):r.wrapIn(i,t)},undoInputRule:()=>({state:e,dispatch:t})=>{let n=e.plugins;for(let r=0;r<n.length;r+=1){let i,o=n[r];if(o.spec.isInputRules&&(i=o.getState(e))){if(t){let t=e.tr,n=i.transform;for(let e=n.steps.length-1;e>=0;e-=1)t.step(n.steps[e].invert(n.docs[e]));if(i.text){let n=t.doc.resolve(i.from).marks();t.replaceWith(i.from,i.to,e.schema.text(i.text,n))}else t.delete(i.from,i.to)}return!0}}return!1},unsetAllMarks:()=>({tr:e,dispatch:t})=>{let{selection:n}=e,{empty:r,ranges:i}=n;
365return!!r||(t&&i.forEach(t=>{e.removeMark(t.$from.pos,t.$to.pos)}),!0)},unsetMark:(e,t={})=>({tr:n,state:r,dispatch:i})=>{var o;let{extendEmptyMarkRange:s=!1}=t,{selection:a}=n,l=d_(e,r.schema),{$from:c,empty:d,ranges:h}=a;if(!i)return!0;if(d&&s){let{from:e,to:t}=a,r=null==(o=c.marks().find(e=>e.type===l))?void 0:o.attrs,i=d$(c,l,r);i&&(e=i.from,t=i.to),n.removeMark(e,t,l)}else h.forEach(e=>{n.removeMark(e.$from.pos,e.$to.pos,l)});return n.removeStoredMark(l),!0},updateAttributes:(e,t={})=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null,a=dX("string"==typeof e?e:e.name,r.schema);return!!a&&("node"===a&&(o=dI(e,r.schema)),"mark"===a&&(s=d_(e,r.schema)),i&&n.selection.ranges.forEach(e=>{let i,a,l,c,d=e.$from.pos,h=e.$to.pos;n.selection.empty?r.doc.nodesBetween(d,h,(e,t)=>{o&&o===e.type&&(l=Math.max(t,d),c=Math.min(t+e.nodeSize,h),i=t,a=e)}):r.doc.nodesBetween(d,h,(e,r)=>{r<d&&o&&o===e.type&&(l=Math.max(r,d),c=Math.min(r+e.nodeSize,h),i=r,a=e),r>=d&&r<=h&&(o&&o===e.type&&n.setNodeMarkup(r,void 0,{...e.attrs,...t}),s&&e.marks.length&&e.marks.forEach(i=>{if(s===i.type){let o=Math.max(r,d),a=Math.min(r+e.nodeSize,h);n.addMark(o,a,s.create({...i.attrs,...t}))}}))}),a&&(void 0!==i&&n.setNodeMarkup(i,void 0,{...a.attrs,...t}),s&&a.marks.length&&a.marks.forEach(e=>{s===e.type&&n.addMark(l,c,s.create({...e.attrs,...t}))}))}),!0)},wrapIn:(e,t={})=>({state:n,dispatch:r})=>t7(dI(e,n.schema),t)(n,r),wrapInList:(e,t={})=>({state:n,dispatch:r})=>ni(dI(e,n.schema),t)(n,r)});dL.create({name:"commands",addCommands:()=>({...d4})}),dL.create({name:"drop",addProseMirrorPlugins(){return[new tj({key:new tR("tiptapDrop"),props:{handleDrop:(e,t,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),dL.create({name:"editable",addProseMirrorPlugins(){return[new tj({key:new tR("editable"),props:{editable:()=>this.editor.options.editable}})]}});let d6=new tR("focusEvents");dL.create({name:"focusEvents",addProseMirrorPlugins(){let{editor:e}=this;return[new tj({key:d6,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;let r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;let r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),dL.create({name:"keymap",addKeyboardShortcuts(){let e=()=>this.editor.commands.first(({commands:e})=>[()=>e.undoInputRule(),()=>e.command(({tr:t})=>{let{selection:n,doc:r}=t,{empty:i,$anchor:o}=n,{pos:s,parent:a}=o,l=o.parent.isTextblock&&s>0?t.doc.resolve(s-1):o,c=l.parent.type.spec.isolating,d=o.pos-o.parentOffset,h=c&&1===l.parent.childCount?d===o.pos:tp.atStart(r).from===s;return!!i&&!!a.type.isTextblock&&!a.textContent.length&&!!h&&(!h||"paragraph"!==o.parent.type.name)&&e.clearNodes()}),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:e})=>[()=>e.deleteSelection(),()=>e.deleteCurrentNode(),()=>e.joinForward(),()=>e.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:e})=>[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},i={...n,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return dq()||dJ()?i:r},addProseMirrorPlugins(){return[new tj({key:new tR("clearDocument"),appendTransaction:(e,t,n)=>{if(e.some(e=>e.getMeta("composition")))return;let r=e.some(e=>e.docChanged)&&!t.doc.eq(n.doc),i=e.some(e=>e.getMeta("preventClearDocument"));if(!r||i)return;let{empty:o,from:s,to:a}=t.selection,l=tp.atStart(t.doc).from,c=tp.atEnd(t.doc).to;if(o||s!==l||a!==c||!d1(n.doc))return;let d=n.tr,h=dO({state:n,transaction:d}),{commands:u}=new dA({editor:this.editor,state:h});if(u.clearNodes(),d.steps.length)return d}})]}}),dL.create({name:"paste",addProseMirrorPlugins(){return[new tj({key:new tR("tiptapPaste"),props:{handlePaste:(e,t,n
365)=>{this.editor.emit("paste",{editor:this.editor,event:t,slice:n})}}})]}}),dL.create({name:"tabindex",addProseMirrorPlugins(){return[new tj({key:new tR("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),dL.create({name:"characterCount",addOptions:()=>({limit:null,mode:"textSize",textCounter:e=>e.length,wordCounter:e=>e.split(" ").filter(e=>""!==e).length}),addStorage:()=>({characters:()=>0,words:()=>0}),onBeforeCreate(){this.storage.characters=e=>{let t=(null==e?void 0:e.node)||this.editor.state.doc;if("textSize"===((null==e?void 0:e.mode)||this.options.mode)){let e=t.textBetween(0,t.content.size,void 0," ");return this.options.textCounter(e)}return t.nodeSize},this.storage.words=e=>{let t=(null==e?void 0:e.node)||this.editor.state.doc,n=t.textBetween(0,t.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new tj({key:new tR("characterCount"),appendTransaction:(t,n,r)=>{if(e)return;let i=this.options.limit;if(null==i||0===i){e=!0;return}let o=this.storage.characters({node:r.doc});if(o>i){console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);let t=r.tr.deleteRange(0,o-i);return e=!0,t}e=!0},filterTransaction:(e,t)=>{let n=this.options.limit;if(!e.docChanged||0===n||null==n)return!0;let r=this.storage.characters({node:t.doc}),i=this.storage.characters({node:e.doc});if(i<=n||r>n&&i>n&&i<=r)return!0;if(r>n&&i>n&&i>r||!e.getMeta("paste"))return!1;let o=e.selection.$head.pos;return e.deleteRange(o-(i-n),o),!(this.storage.characters({node:e.doc})>n)}})]}}),dL.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:void 0}),addProseMirrorPlugins(){return[c2(this.options)]}}),dL.create({name:"focus",addOptions:()=>({className:"has-focus",mode:"all"}),addProseMirrorPlugins(){return[new tj({key:new tR("focus"),props:{decorations:({doc:e,selection:t})=>{let{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,o=[];if(!n||!r)return ih.create(e,[]);let s=0;"deepest"===this.options.mode&&e.descendants((e,t)=>{if(!e.isText){if(!(i>=t&&i<=t+e.nodeSize-1))return!1;s+=1}});let a=0;return e.descendants((e,t)=>!e.isText&&!!(i>=t&&i<=t+e.nodeSize-1)&&((a+=1,"deepest"===this.options.mode&&s-a>0||"shallowest"===this.options.mode&&a>1)?"deepest"===this.options.mode:void o.push(il.node(t,t+e.nodeSize,{class:this.options.className})))),ih.create(e,o)}}})]}}),dL.create({name:"gapCursor",addProseMirrorPlugins:()=>[c7()],extendNodeSchema(e){var t;let n={name:e.name,options:e.options,storage:e.storage};return{allowGapCursor:null!=(t=dD(dj(e,"allowGapCursor",n)))?t:null}}});var d7=dL.create({name:"placeholder",addOptions:()=>({emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}),addProseMirrorPlugins(){return[new tj({key:new tR("placeholder"),props:{decorations:({doc:e,selection:t})=>{let n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=t,i=[];if(!n)return null;let o=this.editor.isEmpty;return e.descendants((e,t)=>{let n=r>=t&&r<=t+e.nodeSize,s=!e.isLeaf&&d1(e);if((n||!this.options.showOnlyCurrent)&&s){let r=[this.options.emptyNodeClass];o&&r.push(this.options.emptyEditorClass);let s=il.node(t,t+e.nodeSize,{class:r.join(" "),"data-placeholder":"function"==typeof this.options.placeholder?this.options.placeholder({editor:this.editor,node:e,pos:t,hasAnchor:n}):this.options.placeholder});i.push(s)}return this.options.includeChildren}),ih.create(e,i)}}})]}});function d9({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||(null==t?void 0:t.type)===e}dL.create({name:"selection",addOptions:()=>({className:"selection"}),addProseMirrorPlugins(){let{editor:e,options:t}=this;return[new tj({key:new tR("selection"),props:{decorations:n=>n.selection.empty||e.isFocused||!e.isEditable||n.selection instanceof tx||e.view.dragging?null:ih.create(n.doc,[il.inline(n.selection.from,n.selection.to,{class:t.className})])}})]}}),dL.create({name:"trailingNode",addOptions:()=>({node:"paragraph",notAfter:[]}),addProseMirrorPlugins(){let e=new tR(this.name),t=Object.entries(this.editor.schema.nodes).map(([,e])=>e).filter(e=>(this.options.notAfter||[]).concat(this.options.node).includes(e.name));return[new tj({key:e,appendTransaction:(t,n,r)=>{let{doc:i,tr:o,schema:s}=r,a=e.getState(r),l=i.content.size,c=s.nodes[this.options.node];if(a)return o.insert(l,c.create())}
365,state:{init:(e,n)=>!d9({node:n.tr.doc.lastChild,types:t}),apply:(e,n)=>e.docChanged?!d9({node:e.doc.lastChild,types:t}):n}})]}}),dL.create({name:"undoRedo",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:e,dispatch:t})=>dv(e,t),redo:()=>({state:e,dispatch:t})=>dw(e,t)}),addProseMirrorPlugins(){return[db(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}});let d8=e.i(46562).default;function he(e){return e.value||e.children||[]}function ht({doc:e,name:t,lowlight:n,defaultLanguage:r}){let i=[];return o1(e,e=>e.type.name===t).forEach(e=>{var t;let o=e.pos+1,s=e.node.attrs.language||r,a=n.listLanguages();(function e(t,n=[]){return t.flatMap(t=>{let r=[...n,...t.properties?t.properties.className:[]];return t.children?e(t.children,r):{text:t.value,classes:r}})})(s&&(a.includes(s)||d8.getLanguage(s)||(null==(t=n.registered)?void 0:t.call(n,s)))?he(n.highlight(s,e.node.textContent)):he(n.highlightAuto(e.node.textContent))).forEach(e=>{let t=o+e.text.length;if(e.classes.length){let n=il.inline(o,t,{class:e.classes.join(" ")});i.push(n)}o=t})}),ih.create(e,i)}var hn=aU.extend({addOptions(){var e;return{...null==(e=this.parent)?void 0:e.call(this),lowlight:{},languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:4,HTMLAttributes:{}}},addProseMirrorPlugins(){var e;return[...(null==(e=this.parent)?void 0:e.call(this))||[],function({name:e,lowlight:t,defaultLanguage:n}){if(!["highlight","highlightAuto","listLanguages"].every(e=>"function"==typeof t[e]))throw Error("You should provide an instance of lowlight to use the code-block-lowlight extension");let r=new tj({key:new tR("lowlight"),state:{init:(r,{doc:i})=>ht({doc:i,name:e,lowlight:t,defaultLanguage:n}),apply:(r,i,o,s)=>{let a=o.selection.$head.parent.type.name,l=s.selection.$head.parent.type.name,c=o1(o.doc,t=>t.type.name===e),d=o1(s.doc,t=>t.type.name===e);return r.docChanged&&([a,l].includes(e)||d.length!==c.length||r.steps.some(e=>void 0!==e.from&&void 0!==e.to&&c.some(t=>t.pos>=e.from&&t.pos+t.node.nodeSize<=e.to)))?ht({doc:r.doc,name:e,lowlight:t,defaultLanguage:n}):i.map(r.mapping,r.doc)}},props:{decorations:e=>r.getState(e)}});return r}({name:this.name,lowlight:this.options.lowlight,defaultLanguage:this.options.defaultLanguage})]}});function hr(){}let hi=e.i(53476).default,ho={};class hs{constructor(e){this.options=e,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(e){if(""===e)return;let t=this.stack[this.stack.length-1],n=t.children[t.children.length-1];n&&"text"===n.type?n.value+=e:t.children.push({type:"text",value:e})}startScope(e){this.openNode(String(e))}endScope(){this.closeNode()}__addSublanguage(e,t){let n=this.stack[this.stack.length-1],r=e.root.children;t?n.children.push({type:"element",tagName:"span",properties:{className:[t]},children:r}):n.children.push(...r)}openNode(e){let t=this,n=e.split(".").map(function(e,n){return n?e+"_".repeat(n):t.options.classPrefix+e}),r=this.stack[this.stack.length-1],i={type:"element",tagName:"span",properties:{className:n},children:[]};r.children.push(i),this.stack.push(i)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}var ha=e.i(59570);let hl=(0,d.default)("bold",[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]]),hc=(0,d.default)("italic",[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]]),hd=(0,d.default)("list",[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]]),hh=(0,d.default)("list-ordered",[["path",{d:"M11 5h10",key:"1cz7ny"}],["path",{d:"M11 12h10",key:"1438ji"}],["path",{d:"M11 19h10",key:"11t30w"}],["path",{d:"M4 4h1v5",key:"10yrso"}],["path",{d:"M4 9h2",key:"r1h2o0"}],["path",{d:"M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02",key:"xtkcd5"}]]),hu=(0,d.default)("quote",[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]]),hp=(0,d.default)("heading-1",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"m17 12 3-2v8",key:"1hhhft"}]]),hf=(0,d.default)("heading-2",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1",key:"9jr5yi"}
365]]),hm=(0,d.default)("heading-3",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2",key:"68ncm8"}],["path",{d:"M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2",key:"1ejuhz"}]]),hg=(0,d.default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]),hy=(0,d.default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]),hb=function(){let e=hi.newInstance();return{highlight:t,highlightAuto:function(r,i){let o;hr();let s=(i||ho).subset||n(),a=-1,l=0;for(;++a<s.length;){let n=s[a];if(!e.getLanguage(n))continue;let c=t(n,r,i);c.data&&void 0!==c.data.relevance&&c.data.relevance>l&&(l=c.data.relevance,o=c)}return o||{type:"root",children:[],data:{language:void 0,relevance:l}}},listLanguages:n,register:function(t,n){if("string"==typeof t)hr(),e.registerLanguage(t,n);else{let n;for(n in t)Object.hasOwn(t,n)&&e.registerLanguage(n,t[n])}},registerAlias:function(t,n){if("string"==typeof t)hr(),e.registerAliases("string"==typeof n?n:[...n],{languageName:t});else{let n;for(n in t)if(Object.hasOwn(t,n)){let r=t[n];e.registerAliases("string"==typeof r?r:[...r],{languageName:n})}}},registered:function(t){return!!e.getLanguage(t)}};function t(t,n,r){hr(),hr();let i=r||ho,o="string"==typeof i.prefix?i.prefix:"hljs-";if(!e.getLanguage(t))throw Error("Unknown language: `"+t+"` is not registered");e.configure({__emitter:hs,classPrefix:o});let s=e.highlight(n,{ignoreIllegals:!0,language:t});if(s.errorRaised)throw Error("Could not highlight with `Highlight.js`",{cause:s.errorRaised});let a=s._emitter.root,l=a.data;return l.language=s.language,l.relevance=s.relevance,a}function n(){return e.listLanguages()}}();function hx({content:e,onChange:t,placeholder:n="Start writing..."}){let r=function(e={},t=[]){let n=(0,$.useRef)(e);n.current=e;let[r]=(0,$.useState)(()=>new aA(n)),i=(0,V.useSyncExternalStore)(r.subscribe,r.getEditor,r.getServerSnapshot);return(0,$.useDebugValue)(i),(0,$.useEffect)(r.onRender(t)),!function(e){var t;let[n]=(0,$.useState)(()=>new aE(e.editor)),r=(0,aw.useSyncExternalStoreWithSelector)(n.subscribe,n.getSnapshot,n.getServerSnapshot,e.selector,null!=(t=e.equalityFn)?t:av.default);aN(()=>n.watch(e.editor),[e.editor,n]),(0,$.useDebugValue)(r)}({editor:i,selector:({transactionNumber:t})=>!1===e.shouldRerenderOnTransaction||void 0===e.shouldRerenderOnTransaction?null:e.immediatelyRender&&0===t?0:t+1}),i}({extensions:[dT.configure({codeBlock:!1}),hn.configure({lowlight:hb,defaultLanguage:"html"}),d7.configure({placeholder:n})],content:e,onUpdate:({editor:e})=>{t(e.getHTML())},immediatelyRender:!1});return r?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("style",{dangerouslySetInnerHTML:{__html:`
366          .tiptap-editor .ProseMirror {
367            color: #cbd5e1 !important;
368            background: transparent !important;
369            line-height: 1.7 !important;
370            font-size: 14px !important;
371          }
372
373          /* Headings */
374          .tiptap-editor .ProseMirror h1 {
375            color: #ffffff !important;
376            font-size: 2.25rem !important;
377            font-weight: 700 !important;
378            line-height: 1.2 !important;
379            margin-top: 2rem !important;
380            margin-bottom: 1rem !important;
381            border-bottom: 2px solid #475569 !important;
382            padding-bottom: 0.5rem !important;
383          }
384          .tiptap-editor .ProseMirror h2 {
385            color: #ffffff !important;
386            font-size: 1.875rem !important;
387            font-weight: 600 !important;
388            line-height: 1.3 !important;
389            margin-top: 1.5rem !important;
390            margin-bottom: 0.75rem !important;
391            border-bottom: 1px solid #475569 !important;
392            padding-bottom: 0.25rem !important;
393          }
394          .tiptap-editor .ProseMirror h3 {
395            color: #ffffff !important;
396            font-size: 1.5rem !important;
397            font-weight: 600 !important;
398            line-height: 1.4 !important;
399            margin-top: 1.25rem !important;
400            margin-bottom: 0.5rem !important;
401          }
402          .tiptap-editor .ProseMirror h4 {
403            color: #ffffff !important;
404            font-size: 1.25rem !important;
405            font-weight: 600 !important;
406            line-height: 1.4 !important;
407            margin-top: 1rem !important;
408            margin-bottom: 0.5rem !important;
409          }
410          .tiptap-editor .ProseMirror h5 {
411            color: #ffffff !important;
412            font-size: 1.125rem !important;
413            font-weight: 600 !important;
414            line-height: 1.4 !important;
415            margin-top: 0.75rem !important;
416            margin-bottom: 0.25rem !important;
417          }
418          .tiptap-editor .ProseMirror h6 {
419            color: #ffffff !important;
420            font-size: 1rem !important;
421            font-weight: 600 !important;
422            line-height: 1.4 !important;
423            margin-top: 0.5rem !important;
424            margin-bottom: 0.25rem !important;
425          }
426
427          /* Paragraphs */
428          .tiptap-editor .ProseMirror p {
429            color: #cbd5e1 !important;
430            margin-top: 0 !important;
431            margin-bottom: 1rem !important;
432            line-height: 1.7 !important;
433          }
434
435          /* Strong/Bold */
436          .tiptap-editor .ProseMirror strong {
437            color: #ffffff !important;
438            font-weight: 700 !important;
439          }
440
441          /* Lists */
442          .tiptap-editor .ProseMirror ul,
443          .tiptap-editor .ProseMirror ol {
444            color: #cbd5e1 !important;
445            margin-top: 0 !important;
446            margin-bottom: 1rem !important;
447            padding-left: 1.5rem !important;
448          }
449          .tiptap-editor .ProseMirror li {
450            color: #cbd5e1 !important;
451            margin-bottom: 0.25rem !important;
452            line-height: 1.6 !important;
453          }
454          .tiptap-editor .ProseMirror ul li {
455            list-style-type: disc !important;
456          }
457          .tiptap-editor .ProseMirror ol li {
458            list-style-type: decimal !important;
459          }
460          .tiptap-editor .ProseMirror ul ul,
461          .tiptap-editor .ProseMirror ol ol,
462          .tiptap-editor .ProseMirror ul ol,
463          .tiptap-editor .ProseMirror ol ul {
464            margin-top: 0.25rem !important;
465            margin-bottom: 0.25rem !important;
466          }
467
468          /* Blockquotes */
469          .tiptap-editor .ProseMirror blockquote {
470            color: #cbd5e1 !important;
471            border-left: 4px solid #475569 !important;
472            padding-left: 1rem !important;
473            margin: 1.5rem 0 !important;
474            font-style: italic !important;
475            background: rgba(71, 85, 105, 0.1) !important;
476            padding: 1rem !important;
477            border-radius: 0.375rem !important;
478          }
479
480          /* Links */
481          .tiptap-editor .ProseMirror a {
482            color: #60a5fa !important;
483            text-decoration: underline !important;
484            text-decoration-color: #60a5fa !important;
485            text-underline-offset: 2px !important;
486          }
487          .tiptap-editor .ProseMirror a:hover {
488            color: #93c5fd !important;
489            text-decoration-color: #93c5fd !important;
490          }
491
492          /* Inline Code */
493          .tiptap-editor .ProseMirror code {
494            background: rgba(71, 85, 105, 0.3) !important;
495            color: #f1f5f9 !important;
496            padding: 0.125rem 0.25rem !important;
497            border-radius: 0.25rem !important;
498            font-size: 0.875em !important;
499            font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace !important;
500          }
501
502          /* Code Blocks */
503          .tiptap-editor .ProseMirror pre {
504            background: rgba(15, 23, 42, 0.8) !important;
505            color: #e2e8f0 !important;
506            padding: 1rem !important;
507            border-radius: 0.5rem !important;
508            margin: 1rem 0 !important;
509            border: 1px solid #334155 !important;
510            overflow-x: auto !important;
511            font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace !important;
512            font-size: 0.875rem !important;
513            line-height: 1.5 !important;
514          }
515          .tiptap-editor .ProseMirror pre code {
516            background: transparent !important;
517            color: inherit !important;
518            padding: 0 !important;
519            border-radius: 0 !important;
520            font-size: inherit !important;
521          }
522
523          /* Code Block Language Label */
524          .tiptap-editor .ProseMirror pre[data-language]::before {
525            content: attr(data-language) !important;
526            display: block !important;
527            background: #475569 !important;
528            color: #cbd5e1 !important;
529            padding: 0.25rem 0.5rem !important;
530            margin: -1rem -1rem 1rem -1rem !important;
531            border-radius: 0.5rem 0.5rem 0 0 !important;
532            font-size: 0.75rem !important;
533            font-weight: 600 !important;
534            text-transform: uppercase !important;
535            letter-spacing: 0.05em !important;
536          }
537
538          /* Placeholder */
539          .tiptap-editor .ProseMirror p.is-editor-empty:first-child::before {
540            color: #94a3b8 !important;
541            content: attr(data-placeholder) !important;
542            float: left !important;
543            height: 0 !important;
544            pointer-events: none !important;
545          }
546
547          /* Focus styles */
548          .tiptap-editor .ProseMirror:focus {
549            outline: none !important;
550          }
551
552          /* Selection */
553          .tiptap-editor .ProseMirror ::selection {
554            background: rgba(59, 130, 246, 0.3) !important;
555          }
556        `}}),(0,o.jsxs)("div",{className:"border border-slate-700 rounded-lg bg-slate-800 tiptap-editor",children:[(0,o.jsxs)("div",{className:"border-b border-slate-700 p-2 flex flex-wrap gap-1",children:[(0,o.jsx)(ha.Button,{variant:"outline",size:"sm",onClick:()=>r.chain().focus().toggleBold().run(),className:`border-slate-600 text-slate-300 hover:bg-slate-700 hover:text-white ${r.isActive("bold")?"bg-yellow-500 text-slate-900":""}`,children:(0,o.jsx)(hl,{className:"w-4 h-4"})}),(0,o.jsx)(ha.Button,{variant:"outline",size:"sm",onClick:()=>r.chain().focus().toggleItalic().run(),className:`border-slate-600 text-slate-300 hover:bg-slate-700 hover:text-white ${r.isActive("italic")?"bg-yellow-500 text-slate-900":""}`,children:(0,o.jsx)(hc,{className:"w-4 h-4"})}),(0,o.jsx)(ha.Button,{variant:"outline",size:"sm",onClick:()=>r.chain().focus().toggleCode().run(),className:`border-slate-600 text-slate-300 hover:bg-slate-700 hover:text-white ${r.isActive("code")?"bg-yellow-500 text-slate-900":""}`,children:(0,o.jsx)(hg,{className:"w-4 h-4"})}),(0,o.jsx)(ha.Button,{variant:"outline",size:"sm",onClick:()=>r.chain().focus().toggleCodeBlock().run(),className:`border-slate-600 text-slate-300 hover:bg-slate-700 hover:text-white ${r.isActive("codeBlock")?"bg-yellow-500 text-slate-900":""}`,children:(0,o.jsx)(hy,{className:"w-4 h-4"})}),(0,o.jsx)("div",{className:"w-px h-6 bg-slate-600 mx-1"}),(0,o.jsx)(ha.Button,{variant:"outline",size:"sm",onClick:()=>r.chain().focus().toggleHeading({level:1}).run(),className:`border-slate-600 text-slate-300 hover:bg-slate-700 hover:text-white ${r.isActive("heading",{level:1})?"bg-yellow-500 text-slate-900":""}`,children:(0,o.jsx)(hp,{className:"w-4 h-4"})}),(0,o.jsx)(ha.Button,{variant:"outline",size:"sm",onClick:()=>r.chain().focus().toggleHeading({level:2}).run(),className:`border-slate-600 text-slate-300 hover:bg-slate-700 hover:text-white ${r.isActive("heading",{level:2})?"bg-yellow-500 text-slate-900":""}`,children:(0,o.jsx)(hf,{className:"w-4 h-4"})}),(0,o.jsx)(ha.Button,{variant:"outline",size:"sm",onClick:()=>r.chain().focus().toggleHeading({level:3}).run(),className:`border-slate-600 text-slate-300 hover:bg-slate-700 hover:text-white ${r.isActive("heading",{level:3})?"bg-yellow-500 text-slate-900":""}`,children:(0,o.jsx)(hm,{className:"w-4 h-4"})}),(0,o.jsx)("div",{className:"w-px h-6 bg-slate-600 mx-1"}),(0,o.jsx)(ha.Button,{variant:"outline",size:"sm",onClick:()=>r.chain().focus().toggleBulletList().run(),className:`border-slate-600 text-slate-300 hover:bg-slate-700 hover:text-white ${r.isActive("bulletList")?"bg-yellow-500 text-slate-900":""}`,children:(0,o.jsx)(hd,{className:"w-4 h-4"})}),(0,o.jsx)(ha.Button,{variant:"outline",size:"sm",onClick:()=>r.chain().focus().toggleOrderedList().run(),className:`border-slate-600 text-slate-300 hover:bg-slate-700 hover:text-white ${r.isActive("orderedList")?"bg-yellow-500 text-slate-900":""}`,children:(0,o.jsx)(hh,{className:"w-4 h-4"})}),(0,o.jsx)(ha.Button,{variant:"outline",size:"sm",onClick:()=>r.chain().focus().toggleBlockquote().run(),className:`border-slate-600 text-slate-300 hover:bg-slate-700 hover:text-white ${r.isActive("blockquote")?"bg-yellow-500 text-slate-900":""}`,children:(0,o.jsx)(hu,{className:"w-4 h-4"})})]}),(0,o.jsx)("div",{className:"p-4",children:(0,o.jsx)(aC,{editor:r,className:"prose prose-sm max-w-none focus:outline-none min-h-[200px] prose-invert prose-headings:text-white prose-p:text-slate-300 prose-strong:text-white prose-ul:text-slate-300 prose-ol:text-slate-300 prose-li:text-slate-300 prose-blockquote:text-slate-300 prose-a:text-blue-400 prose-a:no-underline hover:prose-a:underline"})})]})]}):null}hb.register("html",function(e){let t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},i={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(i,{begin:/\(/,end:/\)/}),s=e.inherit(e.APOS_STRING_MODE,{className:"string"}),a=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),l={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:/[\p{L}0-9._:-]+/u,relevance:0}
556,{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[r]},{begin:/'/,end:/'/,contains:[r]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[i,a,s,o,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[i,o,a,s]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},r,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[a]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:l}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}});var hv=e.i(23429),hv=hv,hw=e.i(56909);function hk({currentFeature:e,setCurrentFeature:n,onAddFeature:r,features:i,onRemoveFeature:a,onUpdateFeature:l,language:c}){let d="es"===c,[h,u]=(0,t.useState)(null),[p,f]=(0,t.useState)({icon:"Settings",title:"",description:""}),m=()=>{null!==h&&(l(h,p),u(null),f({icon:"Settings",title:"",description:""}))},g=()=>{u(null),f({icon:"Settings",title:"",description:""})};return(0,o.jsxs)("div",{className:"space-y-4",children:[(0,o.jsxs)("div",{className:"space-y-3",children:[(0,o.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,o.jsx)(I,{value:e.icon,onValueChange:e=>n(t=>({...t,icon:e})),placeholder:d?"Seleccionar icono":"Select icon"}),(0,o.jsx)(s.Input,{placeholder:d?"Título de la característica":"Feature title",value:e.title,onChange:e=>n(t=>({...t,title:e.target.value})),className:"bg-slate-700 border-slate-600 text-white placeholder:text-slate-400 focus:border-yellow-500"})]}),(0,o.jsx)(B.Textarea,{placeholder:d?"Descripción de la característica":"Feature description",value:e.description,onChange:e=>n(t=>({...t,description:e.target.value})),rows:2,className:"bg-slate-700 border-slate-600 text-white placeholder:text-slate-400 focus:border-yellow-500"}),(0,o.jsx)(ha.Button,{onClick:r,className:"bg-yellow-500 hover:bg-yellow-600 text-slate-900 font-semibold",children:d?"Agregar Característica":"Add Feature"})]}),(0,o.jsx)("div",{className:"space-y-2",children:i.map((e,n)=>{let r=j[e.icon];return h===n?(0,o.jsx)("div",{className:"p-3 border border-yellow-500/50 rounded bg-slate-700",children:(0,o.jsxs)("div",{className:"space-y-3",children:[(0,o.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,o.jsx)(I,{value:p.icon,onValueChange:e=>f(t=>({...t,icon:e})),placeholder:d?"Seleccionar icono":"Select icon"}),(0,o.jsx)(s.Input,{placeholder:d?"Título de la característica":"Feature title",value:p.title,onChange:e=>f(t=>({...t,title:e.target.value})),className:"bg-slate-700 border-slate-600 text-white placeholder:text-slate-400 focus:border-yellow-500"})]}),(0,o.jsx)(B.Textarea,{placeholder:d?"Descripción de la característica":"Feature description",value:p.description,onChange:e=>f(t=>({...t,description:e.target.value})),rows:2,className:"bg-slate-700 border-slate-600 text-white placeholder:text-slate-400 focus:border-yellow-500"}),(0,o.jsxs)("div",{className:"flex gap-2",children:[(0,o.jsxs)(ha.Button,{size:"sm",onClick:m,className:"bg-green-600 hover:bg-green-700 text-white",children:[(0,o.jsx)(hw.Save,{className:"w-4 h-4 mr-1"}),d?"Guardar":"Save"]}),(0,o.jsxs)(ha.Button,{size:"sm",variant:"outline",onClick:g,className:"border-slate-600 text-slate-300 hover:bg-slate-700 hover:text-white",children:[(0,o.jsx)(R.X,{className:"w-4 h-4 mr-1"}),d?"Cancelar":"Cancel"]})]})]})},n):(0,o.jsxs)("div",{className:"p-3 border border-slate-600 rounded bg-slate-700",children:[(0,o.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,o.jsx)("div",{className:"text-yellow-500",children:r&&t.default.createElement(r,{size:16})}),(0,o.jsx)("span",{className:"text-sm font-semibold text-white",children:e.title}),(0,o.jsxs)("div",{className:"ml-auto flex gap-1",children:[(0,o.jsx)(ha.Button,{size:"sm",variant:"outline",onClick:()=>{u(n),f({...e})},className:"border-blue-500/50 text-blue-400 hover:bg-blue-500 hover:text-white",children:(0,o.jsx)(hv.default,{className:"w-3 h-3"})}),(0,o.jsx)(ha.Button,{size:"sm",variant:"outline",onClick:()=>a(n),className:"border-red-500/50 text-red-400 hover:bg-red-500 hover:text-white",children:d?"Eliminar":"Remove"})]})]}),(0,o.jsx)("p",{className:"text-sm text-slate-300",children:e.description})]},n)})})]})}var hv=hv;function hS({testimonials:e,onAddTestimonial:n,onRemoveTestimonial:r,onUpdateTestimonial:i,language:a}){let l="es"===a,[c,d]=(0,t.useState)(null),[h,u]=(0,t.useState)({id:"",name:"",role:"",company:"",content:"",avatar:"",rating:5}),[p,f]=(0,t.useState)({id:"",name:"",role:"",company:"",content:"",avatar:"",rating:5}),m=()=>{null!==c&&(i(c,h),d(null),u({id:"",name:"",role:"",company:"",content:"",avatar:"",rating:5}))},g=()=>{d(null),u({id:"",name:"",role:"",company:"",content:"",avatar:"",rating:5})};return(0,o.jsxs)("div",{className:"space-y-4",children:[(0,o.jsxs)("div",{className:"space-y-3",children:[(0,o.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,o.jsx)(s.Input,{placeholder:l?"Nombre completo":"Full name",value:p.name,onChange:e=>f(t=>({...t,name:e.target.value})),className:"bg-slate-700 border-slate-600 text-white placeholder:text-slate-400 focus:border-yellow-500"}),(0,o.jsx)(s.Input,{placeholder:l?"Cargo/Posición":"Role/Position",value:p.role,onChange:e=>f(t=>({...t,role:e.target.value})),className:"bg-slate-700 border-slate-600 text-white placeholder:text-slate-400 focus:border-yellow-500"})]}),(0,o.jsx)(s.Input,{placeholder:l?"Empresa":"Company",value:p.company,onChange:e=>f(t=>({...t,company:e.target.value})),className:"bg-slate-700 border-slate-600 text-white placeholder:text-slate-400 focus:border-yellow-500"}),(0,o.jsx)(s.Input,{placeholder:l?"URL del avatar (opcional)":"Avatar URL (optional)",value:p.avatar||"",onChange:e=>f(t=>({...t,avatar:e.target.value})),className:"bg-slate-700 border-slate-600 text-white placeholder:text-slate-400 focus:border-yellow-500"}),(0,o.jsxs)("div",{className:"flex items-center gap-2",children:[(0,o.jsx)("span",{className:"text-slate-300 text-sm",children:l?"Calificación:":"Rating:"}),(0,o.jsx)("div",{className:"flex gap-1",children:Array.from({length:5},(e,t)=>(0,o.jsx)("button",{onClick:()=>f(e=>({...e,rating:t+1})),className:"focus:outline-none",children:(0,o.jsx)(y.Star,{className:`w-5 h-5 ${t<(p.rating||5)?"text-yellow-400 fill-yellow-400":"text-gray-400"}`})},t))})]}),(0,o.jsx)(B.Textarea,{placeholder:l?"Testimonio":"Testimonial content",value:p.content,onChange:e=>f(t=>({...t,content:e.target.value})),rows:3,className:"bg-slate-700 border-slate-600 text-white placeholder:text-slate-400 focus:border-yellow-500"}),(0,o.jsx)(ha.Button,{onClick:()=>{p.name.trim()&&p.content.trim()&&(n({...p,id:`testimonial-${Date.now()}`}),f({id:"",name:"",role:"",company:"",content:"",avatar:"",rating:5}))},className:"bg-yellow-500 hover:bg-yellow-600 text-slate-900 font-semibold",children:l?"Agregar Testimonio":"Add Testimonial"})]}),(0,o.jsx)("div",{className:"space-y-2",children:e.map((e,t)=>{let n;return c===t?(0,o.jsx)("div",{className:"p-4 border border-yellow-500/50 rounded bg-slate-700",children:(0,o.jsxs)("div",{className:"space-y-3",children:[(0,o.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,o.jsx)(s.Input,{placeholder:l?"Nombre completo":"Full name",value:h.name,onChange:e=>u(t=>({...t,name:e.target.value})),className:"bg-slate-700 border-slate-600 text-white placeholder:text-slate-400 focus:border-yellow-500"}),(0,o.jsx)(s.Input,{placeholder:l?"Cargo/Posición":"Role/Position",value:h.role,onChange:e=>u(t=>({...t,role:e.target.value})),className:"bg-slate-700 border-slate-600 text-white placeholder:text-slate-400 focus:border-yellow-500"})]}),(0,o.jsx)(s.Input,{placeholder:l?"Empresa":"Company",value:h.company,onChange:e=>u(t=>({...t,company:e.target.value})),className:"bg-slate-700 border-slate-600 text-white placeholder:text-slate-400 focus:border-yellow-500"}),(0,o.jsx)(s.Input,{placeholder:l?"URL del avatar (opcional)":"Avatar URL (optional)",value:h.avatar||"",onChange:e=>u(t=>({...t,avatar:e.target.value})),className:"bg-slate-700 border-slate-600 text-white placeholder:text-slate-400 focus:border-yellow-500"}),(0,o.jsxs)("div",{className:"flex items-center gap-2",children:[(0,o.jsx)("span",{className:"text-slate-300 text-sm",children:l?"Calificación:":"Rating:"}),(0,o.jsx)("div",{className:"flex gap-1",children:Array.from({length:5},(e,t)=>(0,o.jsx)("button",{onClick:()=>u(e=>({...e,rating:t+1})),className:"focus:outline-none",children:(0,o.jsx)(y.Star,{className:`w-5 h-5 ${t<(h.rating||5)?"text-yellow-400 fill-yellow-400":"text-gray-400"}`})},t))})]}),(0,o.jsx)(B.Textarea,{placeholder:l?"Testimonio":"Testimonial content",value:h.content,onChange:e=>u(t=>({...t,content:e.target.value})),rows:3,className:"bg-slate-700 border-slate-600 text-white placeholder:text-slate-400 focus:border-yellow-500"}),(0,o.jsxs)("div",{className:"flex gap-2",children:[(0,o.jsxs)(ha.Button,{size:"sm",onClick:m,className:"bg-green-600 hover:bg-green-700 text-white",children:[(0,o.jsx)(hw.Save,{className:"w-4 h-4 mr-1"}),l?"Guardar":"Save"]}),(0,o.jsxs)(ha.Button,{size:"sm",variant:"outline",onClick:g,className:"border-slate-600 text-slate-300 hover:bg-slate-700 hover:text-white",children:[(0,o.jsx)(R.X,{className:"w-4 h-4 mr-1"}),l?"Cancelar":"Cancel"]})]})]})},t):(0,o.jsxs)("div",{className:"p-4 border border-slate-600 rounded bg-slate-700",children:[(0,o.jsxs)("div",{className:"flex items-start gap-3 mb-3",children:[e.avatar&&(0,o.jsx)("img",{src:e.avatar,alt:e.name,className:"w-12 h-12 rounded-full object-cover"}),(0,o.jsxs)("div",{className:"flex-1",children:[(0,o.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,o.jsx)("h4",{className:"text-sm font-semibold text-white",children:e.name}),(0,o.jsxs)("div",{className:"flex gap-1",children:[(0,o.jsx)(ha.Button,{size:"sm",variant:"outline",onClick:()=>{d(t),u({...e})},className:"border-blue-500/50 text-blue-400 hover:bg-blue-500 hover:text-white",children:(0,o.jsx)(hv.default,{className:"w-3 h-3"})}),(0,o.jsx)(ha.Button,{size:"sm",variant:"outline",onClick:()=>r(t),className:"border-red-500/50 text-red-400 hover:bg-red-500 hover:text-white",children:l?"Eliminar":"Remove"})]})]}),(0,o.jsxs)("p",{className:"text-xs text-slate-400 mb-1",children:[e.role," ",e.company&&`at ${e.company}`]}),e.rating&&(0,o.jsx)("div",{className:"flex gap-1 mb-2",children:(n=e.rating,Array.from({length:5},(e,t)=>(0,o.jsx)(y.Star,{className:`w-4 h-4 ${t<n?"text-yellow-400 fill-yellow-400":"text-gray-400"}`},t)))})]})]}),(0,o.jsxs)("p",{className:"text-sm text-slate-300 italic",children:["“",e.content,"”"]})]},t)})})]})}var hv=hv,hM=e.i(3908),hM=hM;function hC({faq:e,onUpdateFAQ:n,language:r}){let i="es"===r,[a,l]=(0,t.useState)(null),[c,d]=(0,t.useState)({id:"",question:"",answer:""}),[h,u]=(0,t.useState)({id:"",question:"",answer:""}),[p,f]=(0,t.useState)(e?.title||""),[m,g]=(0,t.useState)(e?.description||""),y=()=>{null!==a&&e&&(n({title:p,description:m,items:e.items.map((e,t)=>t===a?c:e)}),l(null),d({id:"",question:"",answer:""}))},b=()=>{l(null),d({id:"",question:"",answer:""})},x=()=>{n({title:p,description:m,items:e?.items||[]})};return(0,o.jsxs)("div",{className:"space-y-6",children:[(0,o.jsxs)("div",{className:"space-y-3",children:[(0,o.jsx)(s.Input,{placeholder:i?"Título de la sección FAQ":"FAQ Section Title",value:p,onChange:e=>f(e.target.value),onBlur:x,className:"bg-slate-700 border-slate-600 text-white placeholder:text-slate-400 focus:border-yellow-500"}),(0,o.jsx)(B.Textarea,{placeholder:i?"Descripción de la sección FAQ":"FAQ Section Description",value:m,onChange:e=>g(e.target.value),onBlur:x,rows:2,className:"bg-slate-700 border-slate-600 text-white placeholder:text-slate-400 focus:border-yellow-500"})]}),(0,o.jsxs)("div",{className:"space-y-3",children:[(0,o.jsx)("h4",{className:"text-white font-medium",children:i?"Agregar Nueva Pregunta":"Add New Question"}),(0,o.jsx)(s.Input,{placeholder:i?"Pregunta":"Question",value:h.question,onChange:e=>u(t=>({...t,question:e.target.value})),className:"bg-slate-700 border-slate-600 text-white placeholder:text-slate-400 focus:border-yellow-500"}
556),(0,o.jsx)(B.Textarea,{placeholder:i?"Respuesta":"Answer",value:h.answer,onChange:e=>u(t=>({...t,answer:e.target.value})),rows:3,className:"bg-slate-700 border-slate-600 text-white placeholder:text-slate-400 focus:border-yellow-500"}),(0,o.jsxs)(ha.Button,{onClick:()=>{if(!h.question.trim()||!h.answer.trim())return;let t={...h,id:`faq-${Date.now()}`};n({title:p,description:m,items:[...e?.items||[],t]}),u({id:"",question:"",answer:""})},className:"bg-yellow-500 hover:bg-yellow-600 text-slate-900 font-semibold",children:[(0,o.jsx)(hM.default,{className:"w-4 h-4 mr-2"}),i?"Agregar Pregunta":"Add Question"]})]}),(0,o.jsxs)("div",{className:"space-y-2",children:[(0,o.jsx)("h4",{className:"text-white font-medium",children:i?"Preguntas Existentes":"Existing Questions"}),e?.items.map((t,r)=>a===r?(0,o.jsx)("div",{className:"p-4 border border-yellow-500/50 rounded bg-slate-700",children:(0,o.jsxs)("div",{className:"space-y-3",children:[(0,o.jsx)(s.Input,{placeholder:i?"Pregunta":"Question",value:c.question,onChange:e=>d(t=>({...t,question:e.target.value})),className:"bg-slate-700 border-slate-600 text-white placeholder:text-slate-400 focus:border-yellow-500"}
556),(0,o.jsx)(B.Textarea,{placeholder:i?"Respuesta":"Answer",value:c.answer,onChange:e=>d(t=>({...t,answer:e.target.value})),rows:3,className:"bg-slate-700 border-slate-600 text-white placeholder:text-slate-400 focus:border-yellow-500"}),(0,o.jsxs)("div",{className:"flex gap-2",children:[(0,o.jsxs)(ha.Button,{size:"sm",onClick:y,className:"bg-green-600 hover:bg-green-700 text-white",children:[(0,o.jsx)(hw.Save,{className:"w-4 h-4 mr-1"}),i?"Guardar":"Save"]}),(0,o.jsxs)(ha.Button,{size:"sm",variant:"outline",onClick:b,className:"border-slate-600 text-slate-300 hover:bg-slate-700 hover:text-white",children:[(0,o.jsx)(R.X,{className:"w-4 h-4 mr-1"}),i?"Cancelar":"Cancel"]})]})]})},r):(0,o.jsxs)("div",{className:"p-4 border border-slate-600 rounded bg-slate-700",children:[(0,o.jsxs)("div",{className:"flex items-start justify-between mb-2",children:[(0,o.jsx)("h5",{className:"text-sm font-semibold text-white flex-1 pr-2",children:t.question}),(0,o.jsxs)("div",{className:"flex gap-1",children:[(0,o.jsx)(ha.Button,{size:"sm",variant:"outline",onClick:()=>{l(r),d({...t})},className:"border-blue-500/50 text-blue-400 hover:bg-blue-500 hover:text-white",children:(0,o.jsx)(hv.default,{className:"w-3 h-3"})}),(0,o.jsx)(ha.Button,{size:"sm",variant:"outline",onClick:()=>{e&&n({title:p,description:m,items:e.items.filter((e,t)=>t!==r)})},className:"border-red-500/50 text-red-400 hover:bg-red-500 hover:text-white",children:i?"Eliminar":"Remove"})]})]}),(0,o.jsx)("p",{className:"text-sm text-slate-300",children:t.answer})]},r))]})]})}var hv=hv,hM=hM;let hN=(0,d.default)("linkedin",[["path",{d:"M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z",key:"c2jq9f"}],["rect",{width:"4",height:"12",x:"2",y:"9",key:"mk3on5"}],["circle",{cx:"4",cy:"4",r:"2",key:"bt5ra8"}]]),hE=(0,d.default)("twitter",[["path",{d:"M22 4s-.7 2.1-2 3.4c1.6 10-9.4 17.3-18 11.6 2.2.1 4.4-.6 6-2C3 15.5.5 9.6 3 5c2.2 2.6 5.6 4.1 9 4-.9-4.2 4-6.6 7-3.8 1.1 0 3-1.2 3-1.2z",key:"pff0z6"}]]);var w=w;function hT({teamMembers:e,onAddMember:n,onRemoveMember:r,onUpdateMember:i,language:a}){let l="es"===a,[c,d]=(0,t.useState)(null),[h,u]=(0,t.useState)({id:"",name:"",role:"",bio:"",avatar:"",socialLinks:{linkedin:"",twitter:"",email:""}}),[p,f]=(0,t.useState)({id:"",name:"",role:"",bio:"",avatar:"",socialLinks:{linkedin:"",twitter:"",email:""}}),m=()=>{null!==c&&(i(c,h),d(null),u({id:"",name:"",role:"",bio:"",avatar:"",socialLinks:{linkedin:"",twitter:"",email:""}}))},g=()=>{d(null),u({id:"",name:"",role:"",bio:"",avatar:"",socialLinks:{linkedin:"",twitter:"",email:""}})};return(0,o.jsxs)("div",{className:"space-y-6",children:[(0,o.jsxs)("div",{className:"space-y-3",children:[(0,o.jsx)("h4",{className:"text-white font-medium",children:l?"Agregar Nuevo Miembro":"Add New Member"}),(0,o.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,o.jsx)(s.Input,{placeholder:l?"Nombre completo":"Full name",value:p.name,onChange:e=>f(t=>({...t,name:e.target.value})),className:"bg-slate-700 border-slate-600 text-white placeholder:text-slate-400 focus:border-yellow-500"}),(0,o.jsx)(s.Input,{placeholder:l?"Cargo/Posición":"Role/Position",value:p.role,onChange:e=>f(t=>({...t,role:e.target.value})),className:"bg-slate-700 border-slate-600 text-white placeholder:text-slate-400 focus:border-yellow-500"})]}),(0,o.jsx)(s.Input,{placeholder:l?"URL del avatar (opcional)":"Avatar URL (optional)",value:p.avatar||"",onChange:e=>f(t=>({...t,avatar:e.target.value})),className:"bg-slate-700 border-slate-600 text-white placeholder:text-slate-400 focus:border-yellow-500"}),(0,o.jsx)(B.Textarea,{placeholder:l?"Biografía":"Bio",value:p.bio,onChange:e=>f(t=>({...t,bio:e.target.value})),rows:3,className:"bg-slate-700 border-slate-600 text-white placeholder:text-slate-400 focus:border-yellow-500"}),(0,o.jsxs)("div",{className:"space-y-2",children:[(0,o.jsx)("h5",{className:"text-slate-300 text-sm",children:l?"Enlaces Sociales (opcional)":"Social Links (optional)"}),(0,o.jsxs)("div",{className:"grid grid-cols-3 gap-2",children:[(0,o.jsxs)("div",{className:"flex items-center gap-2",children:[(0,o.jsx)(hN,{className:"w-4 h-4 text-blue-400"}),(0,o.jsx)(s.Input,{placeholder:"LinkedIn",value:p.socialLinks?.linkedin||"",onChange:e=>f(t=>({...t,socialLinks:{...t.socialLinks,linkedin:e.target.value}})),className:"bg-slate-700 border-slate-600 text-white placeholder:text-slate-400 focus:border-yellow-500"})]}),(0,o.jsxs)("div",{className:"flex items-center gap-2",children:[(0,o.jsx)(hE,{className:"w-4 h-4 text-blue-400"}),(0,o.jsx)(s.Input,{placeholder:"Twitter",value:p.socialLinks?.twitter||"",onChange:e=>f(t=>({...t,socialLinks:{...t.socialLinks,twitter:e.target.value}})),className:"bg-slate-700 border-slate-600 text-white placeholder:text-slate-400 focus:border-yellow-500"})]}),(0,o.jsxs)("div",{className:"flex items-center gap-2",children:[(0,o.jsx)(w.default,{className:"w-4 h-4 text-blue-400"}),(0,o.jsx)(s.Input,{placeholder:"Email",value:p.socialLinks?.email||"",onChange:e=>f(t=>({...t,socialLinks:{...t.socialLinks,email:e.target.value}})),className:"bg-slate-700 border-slate-600 text-white placeholder:text-slate-400 focus:border-yellow-500"})]})]})]}),(0,o.jsxs)(ha.Button,{onClick:()=>{p.name.trim()&&p.role.trim()&&(n({...p,id:`member-${Date.now()}`}),f({id:"",name:"",role:"",bio:"",avatar:"",socialLinks:{linkedin:"",twitter:"",email:""}}))},className:"bg-yellow-500 hover:bg-yellow-600 text-slate-900 font-semibold",children:[(0,o.jsx)(hM.default,{className:"w-4 h-4 mr-2"}),l?"Agregar Miembro":"Add Member"]})]}),(0,o.jsxs)("div",{className:"space-y-2",children:[(0,o.jsx)("h4",{className:"text-white font-medium",children:l?"Miembros Existentes":"Existing Members"}),e.map((e,t)=>c===t?(0,o.jsx)("div",{className:"p-4 border border-yellow-500/50 rounded bg-slate-700",children:(0,o.jsxs)("div",{className:"space-y-3",children:[(0,o.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,o.jsx)(s.Input,{placeholder:l?"Nombre completo":"Full name",value:h.name,onChange:e=>u(t=>({...t,name:e.target.value})),className:"bg-slate-700 border-slate-600 text-white placeholder:text-slate-400 focus:border-yellow-500"}),(0,o.jsx)(s.Input,{placeholder:l?"Cargo/Posición":"Role/Position",value:h.role,onChange:e=>u(t=>({...t,role:e.target.value})),className:"bg-slate-700 border-slate-600 text-white placeholder:text-slate-400 focus:border-yellow-500"})]}),(0,o.jsx)(s.Input,{placeholder:l?"URL del avatar (opcional)":"Avatar URL (optional)",value:h.avatar||"",onChange:e=>u(t=>({...t,avatar:e.target.value})),className:"bg-slate-700 border-slate-600 text-white placeholder:text-slate-400 focus:border-yellow-500"}),(0,o.jsx)(B.Textarea,{placeholder:l?"Biografía":"Bio",value:h.bio,onChange:e=>u(t=>({...t,bio:e.target.value})),rows:3,className:"bg-slate-700 border-slate-600 text-white placeholder:text-slate-400 focus:border-yellow-500"}),(0,o.jsxs)("div",{className:"space-y-2",children:[(0,o.jsx)("h5",{className:"text-slate-300 text-sm",children:l?"Enlaces Sociales":"Social Links"}),(0,o.jsxs)("div",{className:"grid grid-cols-3 gap-2",children:[(0,o.jsxs)("div",{className:"flex items-center gap-2",children:[(0,o.jsx)(hN,{className:"w-4 h-4 text-blue-400"}),(0,o.jsx)(s.Input,{placeholder:"LinkedIn",value:h.socialLinks?.linkedin||"",onChange:e=>u(t=>({...t,socialLinks:{...t.socialLinks,linkedin:e.target.value}})),className:"bg-slate-700 border-slate-600 text-white placeholder:text-slate-400 focus:border-yellow-500"})]}),(0,o.jsxs)("div",{className:"flex items-center gap-2",children:[(0,o.jsx)(hE,{className:"w-4 h-4 text-blue-400"}),(0,o.jsx)(s.Input,{placeholder:"Twitter",value:h.socialLinks?.twitter||"",onChange:e=>u(t=>({...t,socialLinks:{...t.socialLinks,twitter:e.target.value}})),className:"bg-slate-700 border-slate-600 text-white placeholder:text-slate-400 focus:border-yellow-500"})]}),(0,o.jsxs)("div",{className:"flex items-center gap-2",children:[(0,o.jsx)(w.default,{className:"w-4 h-4 text-blue-400"}),(0,o.jsx)(s.Input,{placeholder:"Email",value:h.socialLinks?.email||"",onChange:e=>u(t=>({...t,socialLinks:{...t.socialLinks,email:e.target.value}})),className:"bg-slate-700 border-slate-600 text-white placeholder:text-slate-400 focus:border-yellow-500"})]})]})]}),(0,o.jsxs)("div",{className:"flex gap-2",children:[(0,o.jsxs)(ha.Button,{size:"sm",onClick:m,className:"bg-green-600 hover:bg-green-700 text-white",children:[(0,o.jsx)(hw.Save,{className:"w-4 h-4 mr-1"}),l?"Guardar":"Save"]}),(0,o.jsxs)(ha.Button,{size:"sm",variant:"outline",onClick:g,className:"border-slate-600 text-slate-300 hover:bg-slate-700 hover:text-white",children:[(0,o.jsx)(R.X,{className:"w-4 h-4 mr-1"}),l?"Cancelar":"Cancel"]})]})]})},t):(0,o.jsx)("div",{className:"p-4 border border-slate-600 rounded bg-slate-700",children:(0,o.jsxs)("div",{className:"flex items-start gap-3 mb-3",children:[e.avatar&&(0,o.jsx)("img",{src:e.avatar,alt:e.name,className:"w-16 h-16 rounded-full object-cover"}),(0,o.jsxs)("div",{className:"flex-1",children:[(0,o.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,o.jsx)("h5",{className:"text-sm font-semibold text-white",children:e.name}),(0,o.jsxs)("div",{className:"flex gap-1",children:[(0,o.jsx)(ha.Button,{size:"sm",variant:"outline",onClick:()=>{d(t),u({...e})},className:"border-blue-500/50 text-blue-400 hover:bg-blue-500 hover:text-white",children:(0,o.jsx)(hv.default,{className:"w-3 h-3"})}),(0,o.jsx)(ha.Button,{size:"sm",variant:"outline",onClick:()=>{r(t)},className:"border-red-500/50 text-red-400 hover:bg-red-500 hover:text-white",children:l?"Eliminar":"Remove"})]})]}),(0,o.jsx)("p",{className:"text-xs text-slate-400 mb-2",children:e.role}),(0,o.jsx)("p",{className:"text-sm text-slate-300 mb-2",children:e.bio}),(0,o.jsxs)("div",{className:"flex gap-2",children:[e.socialLinks?.linkedin&&(0,o.jsx)("a",{href:e.socialLinks.linkedin,target:"_blank",rel:"noopener noreferrer",className:"text-blue-400 hover:text-blue-300",children:(0,o.jsx)(hN,{className:"w-4 h-4"})}),e.socialLinks?.twitter&&(0,o.jsx)("a",{href:e.socialLinks.twitter,target:"_blank",rel:"noopener noreferrer",className:"text-blue-400 hover:text-blue-300",children:(0,o.jsx)(hE,{className:"w-4 h-4"})}),e.socialLinks?.email&&(0,o.jsx)("a",{href:`mailto:${e.socialLinks.email}`,className:"text-blue-400 hover:text-blue-300",children:(0,o.jsx)(w.default,{className:"w-4 h-4"})})]})]})]})},t))]})]})}var hv=hv,hM=hM;
556function hO({statistics:e,onUpdateStatistics:n,language:r}){let i="es"===r,[a,l]=(0,t.useState)(null),[c,d]=(0,t.useState)({id:"",number:"",label:"",icon:"TrendingUp"}),[h,u]=(0,t.useState)({id:"",number:"",label:"",icon:"TrendingUp"}),[p,f]=(0,t.useState)(e?.title||""),[m,g]=(0,t.useState)(e?.description||""),y=()=>{null!==a&&e&&(n({title:p,description:m,items:e.items.map((e,t)=>t===a?c:e)}),l(null),d({id:"",number:"",label:"",icon:"TrendingUp"}))},b=()=>{l(null),d({id:"",number:"",label:"",icon:"TrendingUp"})},x=()=>{n({title:p,description:m,items:e?.items||[]})};return(0,o.jsxs)("div",{className:"space-y-6",children:[(0,o.jsxs)("div",{className:"space-y-3",children:[(0,o.jsx)(s.Input,{placeholder:i?"Título de la sección de estadísticas":"Statistics Section Title",value:p,onChange:e=>f(e.target.value),onBlur:x,className:"bg-slate-700 border-slate-600 text-white placeholder:text-slate-400 focus:border-yellow-500"}),(0,o.jsx)(s.Input,{placeholder:i?"Descripción de la sección de estadísticas":"Statistics Section Description",value:m,onChange:e=>g(e.target.value),onBlur:x,className:"bg-slate-700 border-slate-600 text-white placeholder:text-slate-400 focus:border-yellow-500"})]}),(0,o.jsxs)("div",{className:"space-y-3",children:[(0,o.jsx)("h4",{className:"text-white font-medium",children:i?"Agregar Nueva Estadística":"Add New Statistic"}),(0,o.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,o.jsx)(s.Input,{placeholder:i?"Número/Valor":"Number/Value",value:h.number,onChange:e=>u(t=>({...t,number:e.target.value})),className:"bg-slate-700 border-slate-600 text-white placeholder:text-slate-400 focus:border-yellow-500"}),(0,o.jsx)(s.Input,{placeholder:i?"Etiqueta":"Label",value:h.label,onChange:e=>u(t=>({...t,label:e.target.value})),className:"bg-slate-700 border-slate-600 text-white placeholder:text-slate-400 focus:border-yellow-500"})]}),(0,o.jsx)(I,{value:h.icon||"TrendingUp",onValueChange:e=>u(t=>({...t,icon:e})),placeholder:i?"Seleccionar icono":"Select icon"}),(0,o.jsxs)(ha.Button,{onClick:()=>{if(!h.number.trim()||!h.label.trim())return;let t={...h,id:`statistic-${Date.now()}`};n({title:p,description:m,items:[...e?.items||[],t]}),u({id:"",number:"",label:"",icon:"TrendingUp"})},className:"bg-yellow-500 hover:bg-yellow-600 text-slate-900 font-semibold",children:[(0,o.jsx)(hM.default,{className:"w-4 h-4 mr-2"}),i?"Agregar Estadística":"Add Statistic"]})]}),(0,o.jsxs)("div",{className:"space-y-2",children:[(0,o.jsx)("h4",{className:"text-white font-medium",children:i?"Estadísticas Existentes":"Existing Statistics"}),e?.items.map((t,r)=>a===r?(0,o.jsx)("div",{className:"p-4 border border-yellow-500/50 rounded bg-slate-700",children:(0,o.jsxs)("div",{className:"space-y-3",children:[(0,o.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,o.jsx)(s.Input,{placeholder:i?"Número/Valor":"Number/Value",value:c.number,onChange:e=>d(t=>({...t,number:e.target.value})),className:"bg-slate-700 border-slate-600 text-white placeholder:text-slate-400 focus:border-yellow-500"}),(0,o.jsx)(s.Input,{placeholder:i?"Etiqueta":"Label",value:c.label,onChange:e=>d(t=>({...t,label:e.target.value})),className:"bg-slate-700 border-slate-600 text-white placeholder:text-slate-400 focus:border-yellow-500"})]}),(0,o.jsx)(I,{value:c.icon||"TrendingUp",onValueChange:e=>d(t=>({...t,icon:e})),placeholder:i?"Seleccionar icono":"Select icon"}),(0,o.jsxs)("div",{className:"flex gap-2",children:[(0,o.jsxs)(ha.Button,{size:"sm",onClick:y,className:"bg-green-600 hover:bg-green-700 text-white",children:[(0,o.jsx)(hw.Save,{className:"w-4 h-4 mr-1"}),i?"Guardar":"Save"]}),(0,o.jsxs)(ha.Button,{size:"sm",variant:"outline",onClick:b,className:"border-slate-600 text-slate-300 hover:bg-slate-700 hover:text-white",children:[(0,o.jsx)(R.X,{className:"w-4 h-4 mr-1"}),i?"Cancelar":"Cancel"]})]})]})},r):(0,o.jsx)("div",{className:"p-4 border border-slate-600 rounded bg-slate-700",children:(0,o.jsxs)("div",{className:"flex items-center justify-between",children:[(0,o.jsxs)("div",{className:"flex items-center gap-3",children:[(0,o.jsx)("div",{className:"w-10 h-10 rounded-full bg-slate-600 flex items-center justify-center",children:(0,o.jsx)("span",{className:"text-lg font-bold text-white",children:t.number})}),(0,o.jsx)("div",{children:(0,o.jsx)("p",{className:"text-sm font-semibold text-white",children:t.label})})]}),(0,o.jsxs)("div",{className:"flex gap-1",children:[(0,o.jsx)(ha.Button,{size:"sm",variant:"outline",onClick:()=>{l(r),d({...t})},className:"border-blue-500/50 text-blue-400 hover:bg-blue-500 hover:text-white",children:(0,o.jsx)(hv.default,{className:"w-3 h-3"})}),(0,o.jsx)(ha.Button,{size:"sm",variant:"outline",onClick:()=>{e&&n({title:p,description:m,items:e.items.filter((e,t)=>
556t!==r)})},className:"border-red-500/50 text-red-400 hover:bg-red-500 hover:text-white",children:i?"Eliminar":"Remove"})]})]})},r))]})]})}e.s(["ContentEditor",0,function({formData:e,updateFormData:t,currentFeature:n,setCurrentFeature:r,addFeature:i,removeFeature:l,updateFeature:c,addTestimonial:d,removeTestimonial:h,updateTestimonial:u,addFAQ:p,removeFAQ:f,updateFAQ:m,addPerson:g,removePerson:y,updatePerson:b,addStatistic:x,removeStatistic:v,updateStatistic:w,language:k}){let S="es"===k,M=e.content[k],C=M.features||[];return(0,o.jsxs)(z.Tabs,{defaultValue:"basic",className:"w-full",children:[(0,o.jsxs)(z.TabsList,{className:"grid w-full grid-cols-6 bg-slate-800 border-slate-700",children:[(0,o.jsx)(z.TabsTrigger,{value:"basic",className:"data-[state=active]:bg-yellow-500 data-[state=active]:text-slate-900 text-slate-300",children:S?"Básico":"Basic"}),(0,o.jsx)(z.TabsTrigger,{value:"features",className:"data-[state=active]:bg-yellow-500 data-[state=active]:text-slate-900 text-slate-300",children:S?"Características":"Features"}),(0,o.jsx)(z.TabsTrigger,{value:"testimonials",className:"data-[state=active]:bg-yellow-500 data-[state=active]:text-slate-900 text-slate-300",children:S?"Testimonios":"Testimonials"}),(0,o.jsx)(z.TabsTrigger,{value:"faq",className:"data-[state=active]:bg-yellow-500 data-[state=active]:text-slate-900 text-slate-300",children:"FAQ"}),(0,o.jsx)(z.TabsTrigger,{value:"people",className:"data-[state=active]:bg-yellow-500 data-[state=active]:text-slate-900 text-slate-300",children:S?"Personas":"People"}),(0,o.jsx)(z.TabsTrigger,{value:"stats",className:"data-[state=active]:bg-yellow-500 data-[state=active]:text-slate-900 text-slate-300",children:S?"Estadísticas":"Statistics"})]}),(0,o.jsxs)(z.TabsContent,{value:"basic",className:"mt-6 space-y-6",children:[(0,o.jsxs)("div",{children:[(0,o.jsx)(a.Label,{htmlFor:`title-${k}`,className:"text-slate-300",children:S?"Título":"Title"}),(0,o.jsx)(s.Input,{id:`title-${k}`,value:M.title,onChange:n=>t("content",{...e.content,[k]:{...M,title:n.target.value}}),placeholder:S?"Título de la página":"Page title",className:"bg-slate-700 border-slate-600 text-white placeholder:text-slate-400 focus:border-yellow-500"})]}),(0,o.jsxs)("div",{children:[(0,o.jsx)(a.Label,{htmlFor:`description-${k}`,className:"text-slate-300",children:S?"Descripción":"Description"}),(0,o.jsx)(B.Textarea,{id:`description-${k}`,value:M.description,onChange:n=>t("content",{...e.content,[k]:{...M,description:n.target.value}}),placeholder:S?"Descripción de la página":"Page description",rows:3,className:"bg-slate-700 border-slate-600 text-white placeholder:text-slate-400 focus:border-yellow-500"})]}),(0,o.jsxs)("div",{children:[(0,o.jsx)(a.Label,{className:"text-slate-300",children:S?"Contenido":"Content"}),(0,o.jsx)(hx,{content:M.content,onChange:n=>t("content",{...e.content,[k]:{...M,content:n}})})]}),(0,o.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,o.jsxs)("div",{children:[(0,o.jsx)(a.Label,{className:"text-slate-300",children:S?"Botón Principal":"Primary Button"}),(0,o.jsxs)("div",{className:"space-y-2",children:[(0,o.jsx)(s.Input,{placeholder:S?"Texto del botón":"Button text",value:M.primaryButton?.text||"",onChange:n=>t("content",{...e.content,[k]:{...M,primaryButton:{...M.primaryButton,text:n.target.value,variant:"primary"}}}),className:"bg-slate-700 border-slate-600 text-white placeholder:text-slate-400 focus:border-yellow-500"}),(0,o.jsx)(s.Input,{placeholder:S?"Enlace del botón":"Button link",value:M.primaryButton?.link||"",onChange:n=>t("content",{...e.content,[k]:{...M,primaryButton:{...M.primaryButton,link:n.target.value,variant:"primary"}}}),className:"bg-slate-700 border-slate-600 text-white placeholder:text-slate-400 focus:border-yellow-500"})]})]}),(0,o.jsxs)("div",{children:[(0,o.jsx)(a.Label,{className:"text-slate-300",children:S?"Botón Secundario":"Outline Button"}),(0,o.jsxs)("div",{className:"space-y-2",children:[(0,o.jsx)(s.Input,{placeholder:S?"Texto del botón":"Button text",value:M.outlineButton?.text||"",onChange:n=>t("content",{...e.content,[k]:{...M,outlineButton:{...M.outlineButton,text:n.target.value,variant:"outline"}}}),className:"bg-slate-700 border-slate-600 text-white placeholder:text-slate-400 focus:border-yellow-500"}),(0,o.jsx)(s.Input,{placeholder:S?"Enlace del botón":"Button link",value:M.outlineButton?.link||"",onChange:n=>t("content",{...e.content,[k]:{...M,outlineButton:{...M.outlineButton,link:n.target.value,variant:"outline"}}}),className:"bg-slate-700 border-slate-600 text-white placeholder:text-slate-400 focus:border-yellow-500"})]})]})]})]}),(0,o.jsxs)(z.TabsContent,{value:"features",className:"mt-6 space-y-6",children:[(0,o.jsxs)("div",{children:[(0,o.jsx)(a.Label,{className:"text-slate-300",children:S?"Título de Sección de Características":"Features Section Title"}),(0,o.jsx)(s.Input,{value:M.featuresSection?.title||"",onChange:n=>t("content",{...e.content,[k]:{...M,featuresSection:{...M.featuresSection,title:n.target.value,description:M.featuresSection?.description||""}}}),placeholder:S?"Título de la sección de características":"Features section title",className:"bg-slate-700 border-slate-600 text-white placeholder:text-slate-400 focus:border-yellow-500"})]}),(0,o.jsxs)("div",{children:[(0,o.jsx)(a.Label,{className:"text-slate-300",children:S?"Descripción de Sección de Características":"Features Section Description"}),(0,o.jsx)(B.Textarea,{value:M.featuresSection?.description||"",onChange:n=>t("content",{...e.content,[k]:{...M,featuresSection:{...M.featuresSection,title:M.featuresSection?.title||"",description:n.target.value}}}),placeholder:S?"Descripción de la sección de características":"Features section description",rows:2,className:"bg-slate-700 border-slate-600 text-white placeholder:text-slate-400 focus:border-yellow-500"})]}),(0,o.jsxs)("div",{children:[(0,o.jsx)(a.Label,{className:"text-slate-300",children:S?"Características":"Features"}),(0,o.jsx)(hk,{currentFeature:n,setCurrentFeature:r,onAddFeature:()=>i(k),features:C,onRemoveFeature:e=>l(k,e),onUpdateFeature:(e,t)=>
556c(k,e,t),language:k})]})]}),(0,o.jsxs)(z.TabsContent,{value:"testimonials",className:"mt-6 space-y-6",children:[(0,o.jsxs)("div",{children:[(0,o.jsx)(a.Label,{className:"text-slate-300",children:S?"Título de Sección de Testimonios":"Testimonials Section Title"}),(0,o.jsx)(s.Input,{value:M.testimonialsSection?.title||"",onChange:n=>t("content",{...e.content,[k]:{...M,testimonialsSection:{...M.testimonialsSection,title:n.target.value,description:M.testimonialsSection?.description||""}}}),placeholder:S?"Título de la sección de testimonios":"Testimonials section title",className:"bg-slate-700 border-slate-600 text-white placeholder:text-slate-400 focus:border-yellow-500"})]}),(0,o.jsxs)("div",{children:[(0,o.jsx)(a.Label,{className:"text-slate-300",children:S?"Descripción de Sección de Testimonios":"Testimonials Section Description"}),(0,o.jsx)(B.Textarea,{value:M.testimonialsSection?.description||"",onChange:n=>t("content",{...e.content,[k]:{...M,testimonialsSection:{...M.testimonialsSection,title:M.testimonialsSection?.title||"",description:n.target.value}}}),placeholder:S?"Descripción de la sección de testimonios":"Testimonials section description",rows:2,className:"bg-slate-700 border-slate-600 text-white placeholder:text-slate-400 focus:border-yellow-500"})]}),(0,o.jsxs)("div",{children:[(0,o.jsx)(a.Label,{className:"text-slate-300",children:S?"Testimonios":"Testimonials"}),(0,o.jsx)(hS,{testimonials:M.testimonials||[],onAddTestimonial:e=>d(k,e),onRemoveTestimonial:e=>h(k,e),onUpdateTestimonial:(e,t)=>u(k,e,t),language:k})]})]}),(0,o.jsx)(z.TabsContent,{value:"faq",className:"mt-6",children:(0,o.jsx)(hC,{faq:M.faq,onUpdateFAQ:n=>t("content",{...e.content,[k]:{...M,faq:n}}),language:k})}),(0,o.jsx)(z.TabsContent,{value:"people",className:"mt-6",children:(0,o.jsx)(hT,{teamMembers:M.people?.members||[],onAddMember:e=>g(k,e),onRemoveMember:e=>y(k,e),onUpdateMember:(e,t)=>b(k,e,t),language:k})}),(0,o.jsx)(z.TabsContent,{value:"stats",className:"mt-6",children:(0,o.jsx)(hO,{statistics:M.statistics,onUpdateStatistics:n=>t("content",{...e.content,[k]:{...M,statistics:n}}),language:k})})]})}],75025);var hA=e.i(20807);e.s(["SeoEditor",0,function({formData:e,updateFormData:t,language:n}){let r="es"===n,i=e.seo[n];return(0,o.jsxs)("div",{className:"space-y-6",children:[(0,o.jsxs)("div",{children:[(0,o.jsx)(a.Label,{htmlFor:`seo-title-${n}`,className:"text-slate-300",children:r?"Título SEO":"SEO Title"}),(0,o.jsx)(s.Input,{id:`seo-title-${n}`,value:i.title,onChange:r=>t("seo",{...e.seo,[n]:{...i,title:r.target.value}}),placeholder:r?"Título para SEO":"SEO title",className:"bg-slate-700 border-slate-600 text-white placeholder:text-slate-400 focus:border-yellow-500"})]}),(0,o.jsxs)("div",{children:[(0,o.jsx)(a.Label,{htmlFor:`seo-description-${n}`,className:"text-slate-300",children:r?"Descripción SEO":"SEO Description"}),(0,o.jsx)(s.Input,{id:`seo-description-${n}`,value:i.description,onChange:r=>t("seo",{...e.seo,[n]:{...i,description:r.target.value}}),placeholder:r?"Descripción para SEO":"SEO description",className:"bg-slate-700 border-slate-600 text-white placeholder:text-slate-400 focus:border-yellow-500"})]}),(0,o.jsxs)("div",{className:"flex items-center justify-between",children:[(0,o.jsx)(a.Label,{htmlFor:`include-sitemap-${n}`,className:"text-slate-300",children:r?"Incluir en Sitemap":"Include in Sitemap"}),(0,o.jsx)(hA.Switch,{id:`include-sitemap-${n}`,checked:!1!==i.includeInSitemap,onCheckedChange:r=>t("seo",{...e.seo,[n]:{...i,includeInSitemap:r}}),className:"data-[state=checked]:bg-yellow-500"})]})]})}],44579);var hj=e.i(41571);e.s(["JsonEditor",0,function({value:e,onChange:t,onApply:n,error:r,validationErrors:i,validationWarnings:s,disabled:a=!1}){return(0,o.jsxs)(hj.Card,{className:"bg-slate-800 border-slate-700",children:[(0,o.jsx)(hj.CardHeader,{children:(0,o.jsx)(hj.CardTitle,{className:"text-white",children:"JSON Editor"})}),(0,o.jsxs)(hj.CardContent,{className:"space-y-4",children:[(0,o.jsx)(B.Textarea,{value:e,onChange:e=>t(e.target.value),placeholder:"Edit JSON directly...",rows:20,className:"bg-slate-700 border-slate-600 text-white placeholder:text-slate-400 focus:border-yellow-500 font-mono text-sm"}),r&&(0,o.jsxs)("div",{className:"p-3 bg-red-900/20 border border-red-500/50 rounded text-red-400 text-sm",children:[(0,o.jsx)("strong",{children:"Error:"})," ",r]}),i.length>0&&(0,o.jsxs)("div",{className:"p-3 bg-red-900/20 border border-red-500/50 rounded text-red-400 text-sm",children:[(0,o.jsx)("strong",{children:"Validation Errors:"}),(0,o.jsx)("ul",{className:"mt-2 list-disc list-inside",children:i.map((e,t)=>(0,o.jsx)("li",{children:e},t))})]}),s.length>0&&(0,o.jsxs)("div",{className:"p-3 bg-yellow-900/20 border border-yellow-500/50 rounded text-yellow-400 text-sm",children:[(0,o.jsx)("strong",{children:"Validation Warnings:"}),(0,o.jsx)("ul",{className:"mt-2 list-disc list-inside",children:s.map((e,t)=>(0,o.jsx)("li",{children:e},t))})]}),(0,o.jsx)(ha.Button,{onClick:n,disabled:a||!!r||i.length>0,className:"bg-yellow-500 hover:bg-yellow-600 text-slate-900 font-semibold disabled:opacity-50",children:"Apply Changes"})]})]})}],39456);var hI=e.i(74886),hD=e.i(83086);e.s(["AiPromptGenerator",0,function({topic:e,onTopicChange:t,prompt:n,onGenerate:r,copied:i,onCopy:a}){return(0,o.jsxs)(hj.Card,{className:"bg-slate-800 border-slate-700",children:[(0,o.jsx)(hj.CardHeader,{children:(0,o.jsxs)(hj.CardTitle,{className:"text-white flex items-center gap-2",children:[(0,o.jsx)(hD.Sparkles,{className:"w-5 h-5 text-yellow-500"}),"AI Prompt Generator"]})}),(0,o.jsxs)(hj.CardContent,{className:"space-y-4",children:[(0,o.jsx)("div",{children:(0,o.jsx)(s.Input,{placeholder:"Enter topic for AI prompt (e.g., 'Hotel Booking System Integration')",value:e,onCh
556ange:e=>t(e.target.value),className:"bg-slate-700 border-slate-600 text-white placeholder:text-slate-400 focus:border-yellow-500"})}),(0,o.jsx)(ha.Button,{onClick:r,disabled:!e.trim(),className:"bg-yellow-500 hover:bg-yellow-600 text-slate-900 font-semibold disabled:opacity-50",children:"Generate AI Prompt"}),n&&(0,o.jsxs)("div",{className:"space-y-2",children:[(0,o.jsx)(B.Textarea,{value:n,readOnly:!0,rows:10,className:"bg-slate-700 border-slate-600 text-white font-mono text-sm"}),(0,o.jsxs)(ha.Button,{onClick:a,variant:"outline",className:"border-slate-600 text-slate-300 hover:bg-slate-700 hover:text-white",children:[(0,o.jsx)(hI.Copy,{className:"w-4 h-4 mr-2"}),i?"Copied!":"Copy Prompt"]})]})]})]})}],28799)},77220,68214,e=>{"use strict";var t=e.i(75254);let n=(0,t.default)("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);e.s(["default",0,n],77220);let r=(0,t.default)("mail",[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]);e.s(["default",0,r],68214)},74886,e=>{"use strict";let t=(0,e.i(75254).default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);e.s(["Copy",0,t],74886)},39616,61911,e=>{"use strict";var t=e.i(75254);let n=(0,t.default)("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);e.s(["Settings",0,n],39616);let r=(0,t.default)("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]);e.s(["Users",0,r],61911)},55838,(e,t,n)=>{"use strict";var r=e.r(71645),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=r.useState,s=r.useEffect,a=r.useLayoutEffect,l=r.useDebugValue;function c(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch(e){return!0}}var d="u"<typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=o({inst:{value:n,getSnapshot:t}}),i=r[0].inst,d=r[1];return a(function(){i.value=n,i.getSnapshot=t,c(i)&&d({inst:i})},[e,n,t]),s(function(){return c(i)&&d({inst:i}),e(function(){c(i)&&d({inst:i})})},[e]),l(n),n};n.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:d},2239,(e,t,n)=>{"use strict";e.i(47167),t.exports=e.r(55838)},33309,(e,t,n)=>{"use strict";t.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(i=r;0!=i--;)if(!e(t[i],n[i]))return!1;return!0}if(t instanceof Map&&n instanceof Map){if(t.size!==n.size)return!1;for(i of t.entries())if(!n.has(i[0]))return!1;for(i of t.entries())if(!e(i[1],n.get(i[0])))return!1;return!0}if(t instanceof Set&&n instanceof Set){if(t.size!==n.size)return!1;for(i of t.entries())if(!n.has(i[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(n)){if((r=t.length)!=n.length)return!1;for(i=r;0!=i--;)if(t[i]!==n[i])return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(o=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(i=r;0!=i--;)if(!Object.prototype.hasOwnProperty.call(n,o[i]))return!1;for(i=r;0!=i--;){var r,i,o,s=o[i];if(("_owner"!==s||!t.$$typeof)&&!e(t[s],n[s]))return!1}return!0}return t!=t&&n!=n}},52822,(e,t,n)=>{"use strict";var r=e.r(71645),i=e.r(2239),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},s=i.useSyncExternalStore,a=r.useRef,l=r.useEffect,c=r.useMemo,d=r.useDebugValue;n.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var h=a(null);if(null===h.current){var u={hasValue:!1,value:null};h.current=u}else u=h.current;var p=s(e,(h=c(function(){function e(e){if(!l){if(l=!0,s=e,e=r(e),void 0!==i&&u.hasValue){var t=u.value;if(i(t,e))return a=t}return a=e}if(t=a,o(s,e))return t;var n=r(e);return void 0!==i&&i(t,n)?(s=e,t):(s=e,a=n)}var s,a,l=!1,c=void 0===n?null:n;return[function(){return e(t())},null===c?void 0:function(){return e(c())}]},[t,n,r,i]))[0],h[1]);return l(function(){u.hasValue=!0,u.value=p},[p]),d(p),p}},30224,(e,t,n)=>{"use strict";e.i(47167),t.exports=e.r(52822)},46562,(e,t,n)=>
556{class r{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function i(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function o(e,...t){let n=Object.create(null);for(let t in e)n[t]=e[t];return t.forEach(function(e){for(let t in e)n[t]=e[t]}),n}class s{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=i(e)}openNode(e){if(!e.scope)return;let t=((e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){let n=e.split(".");return[`${t}${n.shift()}`,...n.map((e,t)=>`${e}${"_".repeat(t+1)}`)].join(" ")}return`${t}${e}`})(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){e.scope&&(this.buffer+="</span>")}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}let a=(e={})=>{let t={children:[]};return Object.assign(t,e),t};class l{constructor(){this.rootNode=a(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let t=a({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(t=>this._walk(e,t)),e.closeNode(t)),e}static _collapse(e){"string"==typeof e||e.children&&(e.children.every(e=>"string"==typeof e)?e.children=[e.children.join("")]:e.children.forEach(e=>{l._collapse(e)}))}}class c extends l{constructor(e){super(),this.options=e}addText(e){""!==e&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){let n=e.root;t&&(n.scope=`language:${t}`),this.add(n)}toHTML(){return new s(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function d(e){return e?"string"==typeof e?e:e.source:null}function h(e){return f("(?=",e,")")}function u(e){return f("(?:",e,")*")}function p(e){return f("(?:",e,")?")}function f(...e){return e.map(e=>d(e)).join("")}function m(...e){let t;return"("+(("object"==typeof(t=e[e.length-1])&&t.constructor===Object?(e.splice(e.length-1,1),t):{}).capture?"":"?:")+e.map(e=>d(e)).join("|")+")"}function g(e){return RegExp(e.toString()+"|").exec("").length-1}let y=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function b(e,{joinWith:t}){let n=0;return e.map(e=>{let t=n+=1,r=d(e),i="";for(;r.length>0;){let e=y.exec(r);if(!e){i+=r;break}i+=r.substring(0,e.index),r=r.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?i+="\\"+String(Number(e[1])+t):(i+=e[0],"("===e[0]&&n++)}return i}).map(e=>`(${e})`).join(t)}let x="[a-zA-Z]\\w*",v="[a-zA-Z_]\\w*",w="\\b\\d+(\\.\\d+)?",k="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",S="\\b(0b[01]+)",M={begin:"\\\\[\\s\\S]",relevance:0},C=function(e,t,n={}){let r=o({scope:"comment",begin:e,end:t,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});
556let i=m("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:f(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},N=C("//","$"),E=C("/\\*","\\*/"),T=C("#","$");var O=Object.freeze({__proto__:null,APOS_STRING_MODE:{scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[M]},BACKSLASH_ESCAPE:M,BINARY_NUMBER_MODE:{scope:"number",begin:S,relevance:0},BINARY_NUMBER_RE:S,COMMENT:C,C_BLOCK_COMMENT_MODE:E,C_LINE_COMMENT_MODE:N,C_NUMBER_MODE:{scope:"number",begin:k,relevance:0},C_NUMBER_RE:k,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})},HASH_COMMENT_MODE:T,IDENT_RE:x,MATCH_NOTHING_RE:/\b\B/,METHOD_GUARD:{begin:"\\.\\s*"+v,relevance:0},NUMBER_MODE:{scope:"number",begin:w,relevance:0},NUMBER_RE:w,PHRASAL_WORDS_MODE:{begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},QUOTE_STRING_MODE:{scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[M]},REGEXP_MODE:{scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[M,{begin:/\[/,end:/\]/,relevance:0,contains:[M]}]},RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=f(t,/.*\b/,e.binary,/\b.*/)),o({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{0!==e.index&&t.ignoreMatch()}},e)},TITLE_MODE:{scope:"title",begin:x,relevance:0},UNDERSCORE_IDENT_RE:v,UNDERSCORE_TITLE_MODE:{scope:"title",begin:v,relevance:0}});function A(e,t){"."===e.input[e.index-1]&&t.ignoreMatch()}function j(e,t){void 0!==e.className&&(e.scope=e.className,delete e.className)}function I(e,t){!t||e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=A,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,void 0===e.relevance&&(e.relevance=0))}function D(e,t){Array.isArray(e.illegal)&&(e.illegal=m(...e.illegal))}function R(e,t){if(e.match){if(e.begin||e.end)throw Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function L(e,t){void 0===e.relevance&&(e.relevance=1)}let P=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw Error("beforeMatch cannot be used with starts");let n=Object.assign({},e);Object.keys(e).forEach(t=>{delete e[t]}),e.keywords=n.keywords,e.begin=f(n.beforeMatch,h(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},B=["of","and","for","in","not","or","if","then","parent","list","value"],z={},$=e=>{console.error(e)},_=(e,...t)=>{console.log(`WARN: ${e}`,...t)},V=(e,t)=>{z[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),z[`${e}/${t}`]=!0)},F=Error();function H(e,t,{key:n}){let r=0,i=e[n],o={},s={};for(let e=1;e<=t.length;e++)s[e+r]=i[e],o[e+r]=!0,r+=g(t[e-1]);e[n]=s,e[n]._emit=o,e[n]._multi=!0}function q(e){if(e.scope&&"object"==typeof e.scope&&null!==e.scope&&(e.beginScope=e.scope,delete e.scope),"string"==typeof e.beginScope&&(e.beginScope={_wrap:e.beginScope}),"string"==typeof e.endScope&&(e.endScope={_wrap:e.endScope}),Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw $("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),F;if("object"!=typeof e.beginScope||null===e.beginScope)throw $("beginScope must be object"),F;H(e,e.begin,{key:"beginScope"}),e.begin=b(e.begin,{joinWith:""})}if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw $("skip, excludeEnd, returnEnd not compatible with endScope: {}"),F;if("object"!=typeof e.endScope||null===e.endScope)throw $("endScope must be object"),F;H(e,e.end,{key:"endScope"}),e.end=b(e.end,{joinWith:""})}}class U extends Error{constructor(e,t){super(e),this.name="HTMLInjectionError",this.html=t}}let W=Symbol("nomatch"),K=function(e){let t=Object.create(null),n=Object.create(null),s=[],a=!0,l="Could not find the language '{}', did you forget to load/include a language module?",y={disableAutodetect:!0,name:"Plain text",contains:[]},x={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:c};function v(e){return x.noHighlightRe.test(e)}function w(e,t,n){let r="",i="";"object"==typeof t?(r=e,n=t.ignoreIllegals,i=t.language):(V("10.7.0","highlight(lang, code, ...args) has been deprecated."),V("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),i=e,r=t),void 0===n&&(n=!0);let o={code:r,language:i};z("before:highlight",o);
556let s=o.result?o.result:k(o.language,o.code,n);return s.code=o.code,z("after:highlight",s),s}function k(e,n,s,c){let h=Object.create(null);function u(){if(!T.keywords)return void A.addText(_);let e=0;T.keywordPatternRe.lastIndex=0;let t=T.keywordPatternRe.exec(_),n="";for(;t;){n+=_.substring(e,t.index);let r=M.case_insensitive?t[0].toLowerCase():t[0],i=T.keywords[r];if(i){let[e,o]=i;if(A.addText(n),n="",h[r]=(h[r]||0)+1,h[r]<=7&&(V+=o),e.startsWith("_"))n+=t[0];else{let n=M.classNameAliases[e]||e;f(t[0],n)}}else n+=t[0];e=T.keywordPatternRe.lastIndex,t=T.keywordPatternRe.exec(_)}n+=_.substring(e),A.addText(n)}function p(){null!=T.subLanguage?function(){if(""===_)return;let e=null;if("string"==typeof T.subLanguage){if(!t[T.subLanguage])return A.addText(_);e=k(T.subLanguage,_,!0,O[T.subLanguage]),O[T.subLanguage]=e._top}else e=S(_,T.subLanguage.length?T.subLanguage:null);T.relevance>0&&(V+=e.relevance),A.__addSublanguage(e._emitter,e.language)}():u(),_=""}function f(e,t){""!==e&&(A.startScope(t),A.addText(e),A.endScope())}function m(e,t){let n=1,r=t.length-1;for(;n<=r;){if(!e._emit[n]){n++;continue}let r=M.classNameAliases[e[n]]||e[n],i=t[n];r?f(i,r):(_=i,u(),_=""),n++}}function y(e,t){return e.scope&&"string"==typeof e.scope&&A.openNode(M.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(f(_,M.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),_=""):e.beginScope._multi&&(m(e.beginScope,t),_="")),T=Object.create(e,{parent:{value:T}})}let v={};function w(t,i){let o=i&&i[0];if(_+=t,null==o)return p(),0;if("begin"===v.type&&"end"===i.type&&v.index===i.index&&""===o){if(_+=n.slice(i.index,i.index+1),!a){let t=Error(`0 width match regex (${e})`);throw t.languageName=e,t.badRule=v.rule,t}return 1}if(v=i,"begin"===i.type){let e=i[0],t=i.rule,n=new r(t);for(let r of[t.__beforeBegin,t["on:begin"]])if(r&&(r(i,n),n.isMatchIgnored))return 0===T.matcher.regexIndex?(_+=e[0],1):(U=!0,0);return t.skip?_+=e:(t.excludeBegin&&(_+=e),p(),t.returnBegin||t.excludeBegin||(_=e)),y(t,i),t.returnBegin?0:e.length}if("illegal"!==i.type||s){if("end"===i.type){let e=function(e){let t=e[0],i=n.substring(e.index),o=function e(t,n,i){var o;let s,a=(o=t.endRe,(s=o&&o.exec(i))&&0===s.index);if(a){if(t["on:end"]){let e=new r(t);t["on:end"](n,e),e.isMatchIgnored&&(a=!1)}if(a){for(;t.endsParent&&t.parent;)t=t.parent;return t}}if(t.endsWithParent)return e(t.parent,n,i)}(T,e,i);if(!o)return W;let s=T;T.endScope&&T.endScope._wrap?(p(),f(t,T.endScope._wrap)):T.endScope&&T.endScope._multi?(p(),m(T.endScope,e)):s.skip?_+=t:(s.returnEnd||s.excludeEnd||(_+=t),p(),s.excludeEnd&&(_=t));do T.scope&&A.closeNode(),T.skip||T.subLanguage||(V+=T.relevance),T=T.parent;while(T!==o.parent)return o.starts&&y(o.starts,e),s.returnEnd?0:t.length}(i);if(e!==W)return e}}else{let e=Error('Illegal lexeme "'+o+'" for mode "'+(T.scope||"<unnamed>")+'"');throw e.mode=T,e}if("illegal"===i.type&&""===o)return _+="\n",1;if(H>1e5&&H>3*i.index)throw Error("potential infinite loop, way more iterations than matches");return _+=o,o.length}let M=E(e);if(!M)throw $(l.replace("{}",e)),Error('Unknown language: "'+e+'"');let C=function(e){function t(t,n){return RegExp(d(t),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(n?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=g(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);let e=this.regexes.map(e=>e[1]);this.matcherRe=t(b(e,{joinWith:"|"}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;let t=this.matcherRe.exec(e);if(!t)return null;let n=t.findIndex((e,t)=>t>0&&void 0!==e),r=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,r)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];let t=new n;return this.rules.slice(e).forEach(([e,n])=>t.addRule(e,n)),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),"begin"===t.type&&this.count++}exec(e){let t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let n=t.exec(e);if(this.resumingScanAtSamePosition())if(n&&n.index===this.lastIndex);else{let t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw Error("ERR: contains `self` is not supported at the top-level of a language.  See documentation.");return e.classNameAliases=o(e.classNameAliases||{}),function n(i,s){let a;if(i.isCompiled)return i;
556[j,R,q,P].forEach(e=>e(i,s)),e.compilerExtensions.forEach(e=>e(i,s)),i.__beforeBegin=null,[I,D,L].forEach(e=>e(i,s)),i.isCompiled=!0;let l=null;return"object"==typeof i.keywords&&i.keywords.$pattern&&(i.keywords=Object.assign({},i.keywords),l=i.keywords.$pattern,delete i.keywords.$pattern),l=l||/\w+/,i.keywords&&(i.keywords=function e(t,n,r="keyword"){let i=Object.create(null);return"string"==typeof t?o(r,t.split(" ")):Array.isArray(t)?o(r,t):Object.keys(t).forEach(function(r){Object.assign(i,e(t[r],n,r))}),i;function o(e,t){n&&(t=t.map(e=>e.toLowerCase())),t.forEach(function(t){var n,r,o;let s=t.split("|");i[s[0]]=[e,(n=s[0],(r=s[1])?Number(r):+(o=n,!B.includes(o.toLowerCase())))]})}}(i.keywords,e.case_insensitive)),i.keywordPatternRe=t(l,!0),s&&(i.begin||(i.begin=/\B|\b/),i.beginRe=t(i.begin),i.end||i.endsWithParent||(i.end=/\B|\b/),i.end&&(i.endRe=t(i.end)),i.terminatorEnd=d(i.end)||"",i.endsWithParent&&s.terminatorEnd&&(i.terminatorEnd+=(i.end?"|":"")+s.terminatorEnd)),i.illegal&&(i.illegalRe=t(i.illegal)),i.contains||(i.contains=[]),i.contains=[].concat(...i.contains.map(function(e){var t;return((t="self"===e?i:e).variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(e){return o(t,{variants:null},e)})),t.cachedVariants)?t.cachedVariants:!function e(t){return!!t&&(t.endsWithParent||e(t.starts))}(t)?Object.isFrozen(t)?o(t):t:o(t,{starts:t.starts?o(t.starts):null})})),i.contains.forEach(function(e){n(e,i)}),i.starts&&n(i.starts,s),a=new r,i.contains.forEach(e=>a.addRule(e.begin,{rule:e,type:"begin"})),i.terminatorEnd&&a.addRule(i.terminatorEnd,{type:"end"}),i.illegal&&a.addRule(i.illegal,{type:"illegal"}),i.matcher=a,i}(e)}(M),N="",T=c||C,O={},A=new x.__emitter(x),z=[];for(let e=T;e!==M;e=e.parent)e.scope&&z.unshift(e.scope);z.forEach(e=>A.openNode(e));let _="",V=0,F=0,H=0,U=!1;try{if(M.__emitTokens)M.__emitTokens(n,A);else{for(T.matcher.considerAll();;){H++,U?U=!1:T.matcher.considerAll(),T.matcher.lastIndex=F;let e=T.matcher.exec(n);if(!e)break;let t=n.substring(F,e.index),r=w(t,e);F=e.index+r}w(n.substring(F))}return A.finalize(),N=A.toHTML(),{language:e,value:N,relevance:V,illegal:!1,_emitter:A,_top:T}}catch(t){if(t.message&&t.message.includes("Illegal"))return{language:e,value:i(n),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:F,context:n.slice(F-100,F+100),mode:t.mode,resultSoFar:N},_emitter:A};if(a)return{language:e,value:i(n),illegal:!1,relevance:0,errorRaised:t,_emitter:A,_top:T};throw t}}function S(e,n){let r;n=n||x.languages||Object.keys(t);let o=((r={value:i(e),illegal:!1,relevance:0,_top:y,_emitter:new x.__emitter(x)})._emitter.addText(e),r),s=n.filter(E).filter(A).map(t=>k(t,e,!1));s.unshift(o);let[a,l]=s.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(E(e.language).supersetOf===t.language)return 1;else if(E(t.language).supersetOf===e.language)return -1}return 0});return a.secondBest=l,a}function M(e){var t;let r,i=function(e){let t=e.className+" ";t+=e.parentNode?e.parentNode.className:"";let n=x.languageDetectRe.exec(t);if(n){let t=E(n[1]);return t||(_(l.replace("{}",n[1])),_("Falling back to no-highlight mode for this block.",e)),t?n[1]:"no-highlight"}return t.split(/\s+/).find(e=>v(e)||E(e))}(e);if(v(i))return;if(z("before:highlightElement",{el:e,language:i}),e.dataset.highlighted)return void console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e);if(e.children.length>
5560&&(x.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(e)),x.throwUnescapedHTML))throw new U("One of your code blocks includes unescaped HTML.",e.innerHTML);let o=e.textContent,s=i?w(o,{language:i,ignoreIllegals:!0}):S(o);e.innerHTML=s.value,e.dataset.highlighted="yes",t=s.language,r=i&&n[i]||t,e.classList.add("hljs"),e.classList.add(`language-${r}`),e.result={language:s.language,re:s.relevance,relevance:s.relevance},s.secondBest&&(e.secondBest={language:s.secondBest.language,relevance:s.secondBest.relevance}),z("after:highlightElement",{el:e,result:s,text:o})}let C=!1;function N(){if("loading"===document.readyState){C||window.addEventListener("DOMContentLoaded",function(){N()},!1),C=!0;return}document.querySelectorAll(x.cssSelector).forEach(M)}function E(e){return t[e=(e||"").toLowerCase()]||t[n[e]]}function T(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach(e=>{n[e.toLowerCase()]=t})}function A(e){let t=E(e);return t&&!t.disableAutodetect}function z(e,t){s.forEach(function(n){n[e]&&n[e](t)})}for(let r in Object.assign(e,{highlight:w,highlightAuto:S,highlightAll:N,highlightElement:M,highlightBlock:function(e){return V("10.7.0","highlightBlock will be removed entirely in v12.0"),V("10.7.0","Please use highlightElement now."),M(e)},configure:function(e){x=o(x,e)},initHighlighting:()=>{N(),V("10.6.0","initHighlighting() deprecated.  Use highlightAll() now.")},initHighlightingOnLoad:function(){N(),V("10.6.0","initHighlightingOnLoad() deprecated.  Use highlightAll() now.")},registerLanguage:function(n,r){let i=null;try{i=r(e)}catch(e){if($("Language definition for '{}' could not be registered.".replace("{}",n)),a)$(e);else throw e;i=y}i.name||(i.name=n),t[n]=i,i.rawDefinition=r.bind(null,e),i.aliases&&T(i.aliases,{languageName:n})},unregisterLanguage:function(e){for(let r of(delete t[e],Object.keys(n)))n[r]===e&&delete n[r]},listLanguages:function(){return Object.keys(t)},getLanguage:E,registerAliases:T,autoDetection:A,inherit:o,addPlugin:function(e){var t;(t=e)["before:highlightBlock"]&&!t["before:highlightElement"]&&(t["before:highlightElement"]=e=>{t["before:highlightBlock"](Object.assign({block:e.el},e))}),t["after:highlightBlock"]&&!t["after:highlightElement"]&&(t["after:highlightElement"]=e=>{t["after:highlightBlock"](Object.assign({block:e.el},e))}),s.push(e)},removePlugin:function(e){let t=s.indexOf(e);-1!==t&&s.splice(t,1)}}),e.debugMode=function(){a=!1},e.safeMode=function(){a=!0},e.versionString="11.11.1",e.regex={concat:f,lookahead:h,either:m,optional:p,anyNumberOfTimes:u},O)"object"==typeof O[r]&&function e(t){return t instanceof Map?t.clear=t.delete=t.set=function(){throw Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=function(){throw Error("set is read-only")}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach(n=>{let r=t[n],i=typeof r;"object"!==i&&"function"!==i||Object.isFrozen(r)||e(r)}),t}(O[r]);return Object.assign(e,O),e},J=K({});J.newInstance=()=>K({}),t.exports=J,J.HighlightJS=J,J.default=J},53476,(e,t,n)=>{class r{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function i(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function o(e,...t){let n=Object.create(null);for(let t in e)n[t]=e[t];return t.forEach(function(e){for(let t in e)n[t]=e[t]}),n}class s{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=i(e)}openNode(e){if(!e.scope)return;let t=((e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){let n=e.split(".");return[`${t}${n.shift()}`,...n.map((e,t)=>`${e}${"_".repeat(t+1)}`)].join(" ")}return`${t}${e}`})(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){e.scope&&(this.buffer+="</span>")}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}let a=(e={})=>{let t={children:[]};return Object.assign(t,e),t};class l{constructor(){this.rootNode=a(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let t=a({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e.openNode(t),t.children.forEac
556h(t=>this._walk(e,t)),e.closeNode(t)),e}static _collapse(e){"string"==typeof e||e.children&&(e.children.every(e=>"string"==typeof e)?e.children=[e.children.join("")]:e.children.forEach(e=>{l._collapse(e)}))}}class c extends l{constructor(e){super(),this.options=e}addText(e){""!==e&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){let n=e.root;t&&(n.scope=`language:${t}`),this.add(n)}toHTML(){return new s(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function d(e){return e?"string"==typeof e?e:e.source:null}function h(e){return f("(?=",e,")")}function u(e){return f("(?:",e,")*")}function p(e){return f("(?:",e,")?")}function f(...e){return e.map(e=>d(e)).join("")}function m(...e){let t;return"("+(("object"==typeof(t=e[e.length-1])&&t.constructor===Object?(e.splice(e.length-1,1),t):{}).capture?"":"?:")+e.map(e=>d(e)).join("|")+")"}function g(e){return RegExp(e.toString()+"|").exec("").length-1}let y=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function b(e,{joinWith:t}){let n=0;return e.map(e=>{let t=n+=1,r=d(e),i="";for(;r.length>0;){let e=y.exec(r);if(!e){i+=r;break}i+=r.substring(0,e.index),r=r.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?i+="\\"+String(Number(e[1])+t):(i+=e[0],"("===e[0]&&n++)}return i}).map(e=>`(${e})`).join(t)}let x="[a-zA-Z]\\w*",v="[a-zA-Z_]\\w*",w="\\b\\d+(\\.\\d+)?",k="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",S="\\b(0b[01]+)",M={begin:"\\\\[\\s\\S]",relevance:0},C=function(e,t,n={}){let r=o({scope:"comment",begin:e,end:t,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});
556let i=m("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:f(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},N=C("//","$"),E=C("/\\*","\\*/"),T=C("#","$");var O=Object.freeze({__proto__:null,APOS_STRING_MODE:{scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[M]},BACKSLASH_ESCAPE:M,BINARY_NUMBER_MODE:{scope:"number",begin:S,relevance:0},BINARY_NUMBER_RE:S,COMMENT:C,C_BLOCK_COMMENT_MODE:E,C_LINE_COMMENT_MODE:N,C_NUMBER_MODE:{scope:"number",begin:k,relevance:0},C_NUMBER_RE:k,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})},HASH_COMMENT_MODE:T,IDENT_RE:x,MATCH_NOTHING_RE:/\b\B/,METHOD_GUARD:{begin:"\\.\\s*"+v,relevance:0},NUMBER_MODE:{scope:"number",begin:w,relevance:0},NUMBER_RE:w,PHRASAL_WORDS_MODE:{begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},QUOTE_STRING_MODE:{scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[M]},REGEXP_MODE:{scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[M,{begin:/\[/,end:/\]/,relevance:0,contains:[M]}]},RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=f(t,/.*\b/,e.binary,/\b.*/)),o({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{0!==e.index&&t.ignoreMatch()}},e)},TITLE_MODE:{scope:"title",begin:x,relevance:0},UNDERSCORE_IDENT_RE:v,UNDERSCORE_TITLE_MODE:{scope:"title",begin:v,relevance:0}});function A(e,t){"."===e.input[e.index-1]&&t.ignoreMatch()}function j(e,t){void 0!==e.className&&(e.scope=e.className,delete e.className)}function I(e,t){!t||e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=A,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,void 0===e.relevance&&(e.relevance=0))}function D(e,t){Array.isArray(e.illegal)&&(e.illegal=m(...e.illegal))}function R(e,t){if(e.match){if(e.begin||e.end)throw Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function L(e,t){void 0===e.relevance&&(e.relevance=1)}let P=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw Error("beforeMatch cannot be used with starts");let n=Object.assign({},e);Object.keys(e).forEach(t=>{delete e[t]}),e.keywords=n.keywords,e.begin=f(n.beforeMatch,h(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},B=["of","and","for","in","not","or","if","then","parent","list","value"],z={},$=e=>{console.error(e)},_=(e,...t)=>{console.log(`WARN: ${e}`,...t)},V=(e,t)=>{z[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),z[`${e}/${t}`]=!0)},F=Error();function H(e,t,{key:n}){let r=0,i=e[n],o={},s={};for(let e=1;e<=t.length;e++)s[e+r]=i[e],o[e+r]=!0,r+=g(t[e-1]);e[n]=s,e[n]._emit=o,e[n]._multi=!0}function q(e){if(e.scope&&"object"==typeof e.scope&&null!==e.scope&&(e.beginScope=e.scope,delete e.scope),"string"==typeof e.beginScope&&(e.beginScope={_wrap:e.beginScope}),"string"==typeof e.endScope&&(e.endScope={_wrap:e.endScope}),Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw $("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),F;if("object"!=typeof e.beginScope||null===e.beginScope)throw $("beginScope must be object"),F;H(e,e.begin,{key:"beginScope"}),e.begin=b(e.begin,{joinWith:""})}if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw $("skip, excludeEnd, returnEnd not compatible with endScope: {}"),F;if("object"!=typeof e.endScope||null===e.endScope)throw $("endScope must be object"),F;H(e,e.end,{key:"endScope"}),e.end=b(e.end,{joinWith:""})}}class U extends Error{constructor(e,t){super(e),this.name="HTMLInjectionError",this.html=t}}let W=Symbol("nomatch"),K=function(e){let t=Object.create(null),n=Object.create(null),s=[],a=!0,l="Could not find the language '{}', did you forget to load/include a language module?",y={disableAutodetect:!0,name:"Plain text",contains:[]},x={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:c};function v(e){return x.noHighlightRe.test(e)}function w(e,t,n){let r="",i="";"object"==typeof t?(r=e,n=t.ignoreIllegals,i=t.language):(V("10.7.0","highlight(lang, code, ...args) has been deprecated."),V("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),i=e,r=t),void 0===n&&(n=!0);let o={code:r,language:i};z("before:highlight",o);
556let s=o.result?o.result:k(o.language,o.code,n);return s.code=o.code,z("after:highlight",s),s}function k(e,n,s,c){let h=Object.create(null);function u(){if(!T.keywords)return void A.addText(_);let e=0;T.keywordPatternRe.lastIndex=0;let t=T.keywordPatternRe.exec(_),n="";for(;t;){n+=_.substring(e,t.index);let r=M.case_insensitive?t[0].toLowerCase():t[0],i=T.keywords[r];if(i){let[e,o]=i;if(A.addText(n),n="",h[r]=(h[r]||0)+1,h[r]<=7&&(V+=o),e.startsWith("_"))n+=t[0];else{let n=M.classNameAliases[e]||e;f(t[0],n)}}else n+=t[0];e=T.keywordPatternRe.lastIndex,t=T.keywordPatternRe.exec(_)}n+=_.substring(e),A.addText(n)}function p(){null!=T.subLanguage?function(){if(""===_)return;let e=null;if("string"==typeof T.subLanguage){if(!t[T.subLanguage])return A.addText(_);e=k(T.subLanguage,_,!0,O[T.subLanguage]),O[T.subLanguage]=e._top}else e=S(_,T.subLanguage.length?T.subLanguage:null);T.relevance>0&&(V+=e.relevance),A.__addSublanguage(e._emitter,e.language)}():u(),_=""}function f(e,t){""!==e&&(A.startScope(t),A.addText(e),A.endScope())}function m(e,t){let n=1,r=t.length-1;for(;n<=r;){if(!e._emit[n]){n++;continue}let r=M.classNameAliases[e[n]]||e[n],i=t[n];r?f(i,r):(_=i,u(),_=""),n++}}function y(e,t){return e.scope&&"string"==typeof e.scope&&A.openNode(M.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(f(_,M.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),_=""):e.beginScope._multi&&(m(e.beginScope,t),_="")),T=Object.create(e,{parent:{value:T}})}let v={};function w(t,i){let o=i&&i[0];if(_+=t,null==o)return p(),0;if("begin"===v.type&&"end"===i.type&&v.index===i.index&&""===o){if(_+=n.slice(i.index,i.index+1),!a){let t=Error(`0 width match regex (${e})`);throw t.languageName=e,t.badRule=v.rule,t}return 1}if(v=i,"begin"===i.type){let e=i[0],t=i.rule,n=new r(t);for(let r of[t.__beforeBegin,t["on:begin"]])if(r&&(r(i,n),n.isMatchIgnored))return 0===T.matcher.regexIndex?(_+=e[0],1):(U=!0,0);return t.skip?_+=e:(t.excludeBegin&&(_+=e),p(),t.returnBegin||t.excludeBegin||(_=e)),y(t,i),t.returnBegin?0:e.length}if("illegal"!==i.type||s){if("end"===i.type){let e=function(e){let t=e[0],i=n.substring(e.index),o=function e(t,n,i){var o;let s,a=(o=t.endRe,(s=o&&o.exec(i))&&0===s.index);if(a){if(t["on:end"]){let e=new r(t);t["on:end"](n,e),e.isMatchIgnored&&(a=!1)}if(a){for(;t.endsParent&&t.parent;)t=t.parent;return t}}if(t.endsWithParent)return e(t.parent,n,i)}(T,e,i);if(!o)return W;let s=T;T.endScope&&T.endScope._wrap?(p(),f(t,T.endScope._wrap)):T.endScope&&T.endScope._multi?(p(),m(T.endScope,e)):s.skip?_+=t:(s.returnEnd||s.excludeEnd||(_+=t),p(),s.excludeEnd&&(_=t));do T.scope&&A.closeNode(),T.skip||T.subLanguage||(V+=T.relevance),T=T.parent;while(T!==o.parent)return o.starts&&y(o.starts,e),s.returnEnd?0:t.length}(i);if(e!==W)return e}}else{let e=Error('Illegal lexeme "'+o+'" for mode "'+(T.scope||"<unnamed>")+'"');throw e.mode=T,e}if("illegal"===i.type&&""===o)return _+="\n",1;if(H>1e5&&H>3*i.index)throw Error("potential infinite loop, way more iterations than matches");return _+=o,o.length}let M=E(e);if(!M)throw $(l.replace("{}",e)),Error('Unknown language: "'+e+'"');let C=function(e){function t(t,n){return RegExp(d(t),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(n?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=g(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);let e=this.regexes.map(e=>e[1]);this.matcherRe=t(b(e,{joinWith:"|"}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;let t=this.matcherRe.exec(e);if(!t)return null;let n=t.findIndex((e,t)=>t>0&&void 0!==e),r=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,r)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];let t=new n;return this.rules.slice(e).forEach(([e,n])=>t.addRule(e,n)),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),"begin"===t.type&&this.count++}exec(e){let t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let n=t.exec(e);if(this.resumingScanAtSamePosition())if(n&&n.index===this.lastIndex);else{let t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw Error("ERR: contains `self` is not supported at the top-level of a language.  See documentation.");return e.classNameAliases=o(e.classNameAliases||{}),function n(i,s){let a;if(i.isCompiled)return i;
556[j,R,q,P].forEach(e=>e(i,s)),e.compilerExtensions.forEach(e=>e(i,s)),i.__beforeBegin=null,[I,D,L].forEach(e=>e(i,s)),i.isCompiled=!0;let l=null;return"object"==typeof i.keywords&&i.keywords.$pattern&&(i.keywords=Object.assign({},i.keywords),l=i.keywords.$pattern,delete i.keywords.$pattern),l=l||/\w+/,i.keywords&&(i.keywords=function e(t,n,r="keyword"){let i=Object.create(null);return"string"==typeof t?o(r,t.split(" ")):Array.isArray(t)?o(r,t):Object.keys(t).forEach(function(r){Object.assign(i,e(t[r],n,r))}),i;function o(e,t){n&&(t=t.map(e=>e.toLowerCase())),t.forEach(function(t){var n,r,o;let s=t.split("|");i[s[0]]=[e,(n=s[0],(r=s[1])?Number(r):+(o=n,!B.includes(o.toLowerCase())))]})}}(i.keywords,e.case_insensitive)),i.keywordPatternRe=t(l,!0),s&&(i.begin||(i.begin=/\B|\b/),i.beginRe=t(i.begin),i.end||i.endsWithParent||(i.end=/\B|\b/),i.end&&(i.endRe=t(i.end)),i.terminatorEnd=d(i.end)||"",i.endsWithParent&&s.terminatorEnd&&(i.terminatorEnd+=(i.end?"|":"")+s.terminatorEnd)),i.illegal&&(i.illegalRe=t(i.illegal)),i.contains||(i.contains=[]),i.contains=[].concat(...i.contains.map(function(e){var t;return((t="self"===e?i:e).variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(e){return o(t,{variants:null},e)})),t.cachedVariants)?t.cachedVariants:!function e(t){return!!t&&(t.endsWithParent||e(t.starts))}(t)?Object.isFrozen(t)?o(t):t:o(t,{starts:t.starts?o(t.starts):null})})),i.contains.forEach(function(e){n(e,i)}),i.starts&&n(i.starts,s),a=new r,i.contains.forEach(e=>a.addRule(e.begin,{rule:e,type:"begin"})),i.terminatorEnd&&a.addRule(i.terminatorEnd,{type:"end"}),i.illegal&&a.addRule(i.illegal,{type:"illegal"}),i.matcher=a,i}(e)}(M),N="",T=c||C,O={},A=new x.__emitter(x),z=[];for(let e=T;e!==M;e=e.parent)e.scope&&z.unshift(e.scope);z.forEach(e=>A.openNode(e));let _="",V=0,F=0,H=0,U=!1;try{if(M.__emitTokens)M.__emitTokens(n,A);else{for(T.matcher.considerAll();;){H++,U?U=!1:T.matcher.considerAll(),T.matcher.lastIndex=F;let e=T.matcher.exec(n);if(!e)break;let t=n.substring(F,e.index),r=w(t,e);F=e.index+r}w(n.substring(F))}return A.finalize(),N=A.toHTML(),{language:e,value:N,relevance:V,illegal:!1,_emitter:A,_top:T}}catch(t){if(t.message&&t.message.includes("Illegal"))return{language:e,value:i(n),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:F,context:n.slice(F-100,F+100),mode:t.mode,resultSoFar:N},_emitter:A};if(a)return{language:e,value:i(n),illegal:!1,relevance:0,errorRaised:t,_emitter:A,_top:T};throw t}}function S(e,n){let r;n=n||x.languages||Object.keys(t);let o=((r={value:i(e),illegal:!1,relevance:0,_top:y,_emitter:new x.__emitter(x)})._emitter.addText(e),r),s=n.filter(E).filter(A).map(t=>k(t,e,!1));s.unshift(o);let[a,l]=s.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(E(e.language).supersetOf===t.language)return 1;else if(E(t.language).supersetOf===e.language)return -1}return 0});return a.secondBest=l,a}function M(e){var t;let r,i=function(e){let t=e.className+" ";t+=e.parentNode?e.parentNode.className:"";let n=x.languageDetectRe.exec(t);if(n){let t=E(n[1]);return t||(_(l.replace("{}",n[1])),_("Falling back to no-highlight mode for this block.",e)),t?n[1]:"no-highlight"}return t.split(/\s+/).find(e=>v(e)||E(e))}(e);if(v(i))return;if(z("before:highlightElement",{el:e,language:i}),e.dataset.highlighted)return void console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e);if(e.children.length>
5560&&(x.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(e)),x.throwUnescapedHTML))throw new U("One of your code blocks includes unescaped HTML.",e.innerHTML);let o=e.textContent,s=i?w(o,{language:i,ignoreIllegals:!0}):S(o);e.innerHTML=s.value,e.dataset.highlighted="yes",t=s.language,r=i&&n[i]||t,e.classList.add("hljs"),e.classList.add(`language-${r}`),e.result={language:s.language,re:s.relevance,relevance:s.relevance},s.secondBest&&(e.secondBest={language:s.secondBest.language,relevance:s.secondBest.relevance}),z("after:highlightElement",{el:e,result:s,text:o})}let C=!1;function N(){if("loading"===document.readyState){C||window.addEventListener("DOMContentLoaded",function(){N()},!1),C=!0;return}document.querySelectorAll(x.cssSelector).forEach(M)}function E(e){return t[e=(e||"").toLowerCase()]||t[n[e]]}function T(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach(e=>{n[e.toLowerCase()]=t})}function A(e){let t=E(e);return t&&!t.disableAutodetect}function z(e,t){s.forEach(function(n){n[e]&&n[e](t)})}for(let r in Object.assign(e,{highlight:w,highlightAuto:S,highlightAll:N,highlightElement:M,highlightBlock:function(e){return V("10.7.0","highlightBlock will be removed entirely in v12.0"),V("10.7.0","Please use highlightElement now."),M(e)},configure:function(e){x=o(x,e)},initHighlighting:()=>{N(),V("10.6.0","initHighlighting() deprecated.  Use highlightAll() now.")},initHighlightingOnLoad:function(){N(),V("10.6.0","initHighlightingOnLoad() deprecated.  Use highlightAll() now.")},registerLanguage:function(n,r){let i=null;try{i=r(e)}catch(e){if($("Language definition for '{}' could not be registered.".replace("{}",n)),a)$(e);else throw e;i=y}i.name||(i.name=n),t[n]=i,i.rawDefinition=r.bind(null,e),i.aliases&&T(i.aliases,{languageName:n})},unregisterLanguage:function(e){for(let r of(delete t[e],Object.keys(n)))n[r]===e&&delete n[r]},listLanguages:function(){return Object.keys(t)},getLanguage:E,registerAliases:T,autoDetection:A,inherit:o,addPlugin:function(e){var t;(t=e)["before:highlightBlock"]&&!t["before:highlightElement"]&&(t["before:highlightElement"]=e=>{t["before:highlightBlock"](Object.assign({block:e.el},e))}),t["after:highlightBlock"]&&!t["after:highlightElement"]&&(t["after:highlightElement"]=e=>{t["after:highlightBlock"](Object.assign({block:e.el},e))}),s.push(e)},removePlugin:function(e){let t=s.indexOf(e);-1!==t&&s.splice(t,1)}}),e.debugMode=function(){a=!1},e.safeMode=function(){a=!0},e.versionString="11.11.1",e.regex={concat:f,lookahead:h,either:m,optional:p,anyNumberOfTimes:u},O)"object"==typeof O[r]&&function e(t){return t instanceof Map?t.clear=t.delete=t.set=function(){throw Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=function(){throw Error("set is read-only")}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach(n=>{let r=t[n],i=typeof r;"object"!==i&&"function"!==i||Object.isFrozen(r)||e(r)}),t}(O[r]);return Object.assign(e,O),e},J=K({});J.newInstance=()=>K({}),t.exports=J,J.HighlightJS=J,J.default=J}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.