Merge pull request #279 from n4ze3m/next

v1.4.0
This commit is contained in:
Muhammed Nazeem 2024-12-29 13:42:19 +05:30 committed by GitHub
commit e931f7cf35
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
73 changed files with 2484 additions and 156 deletions

BIN
bun.lockb

Binary file not shown.

View File

@ -56,6 +56,7 @@
"rehype-mathjax": "4.0.3", "rehype-mathjax": "4.0.3",
"remark-gfm": "3.0.1", "remark-gfm": "3.0.1",
"remark-math": "5.1.1", "remark-math": "5.1.1",
"tesseract.js": "^5.1.1",
"turndown": "^7.1.3", "turndown": "^7.1.3",
"yt-transcript": "^0.0.2", "yt-transcript": "^0.0.2",
"zustand": "^4.5.0" "zustand": "^4.5.0"

View File

@ -0,0 +1,13 @@
{
"heading": "إعداد Chrome AI",
"status": {
"label": "تمكين أو تعطيل دعم Chrome AI في مساعد الصفحة"
},
"error": {
"browser_not_supported": "هذا الإصدار من Chrome غير مدعوم من نموذج Gemini Nano. يرجى التحديث إلى الإصدار 127 أو أحدث",
"ai_not_supported": "الإعداد chrome://flags/#prompt-api-for-gemini-nano غير مفعل. يرجى تفعيله.",
"ai_not_ready": "Gemini Nano غير جاهز بعد؛ تحتاج إلى التحقق مرة أخرى من إعدادات Chrome.",
"internal_error": "حدث خطأ داخلي. يرجى المحاولة مرة أخرى لاحقاً."
},
"errorDescription": "لاستخدام Chrome AI، تحتاج إلى إصدار متصفح أعلى من 127، وهو متوفر حالياً في قنوات Dev و Canary. بعد تنزيل الإصدار المدعوم، اتبع هذه الخطوات:\n\n1. انتقل إلى `chrome://flags/#prompt-api-for-gemini-nano` واختر \"تمكين\".\n2. انتقل إلى `chrome://flags/#optimization-guide-on-device-model` واختر \"EnabledBypassPrefRequirement\".\n3. انتقل إلى `chrome://components`، ابحث عن \"Optimization Guide On Device Model\"، وانقر على \"التحقق من التحديثات\". سيؤدي هذا إلى تنزيل النموذج. إذا لم تر الإعدادات، كرر الخطوتين 1 و 2 وأعد تشغيل المتصفح."
}

View File

@ -0,0 +1,128 @@
{
"pageAssist": "مساعد الصفحة",
"selectAModel": "اختر نموذجًا",
"save": "حفظ",
"saved": "تم الحفظ",
"cancel": "إلغاء",
"retry": "إعادة المحاولة",
"share": {
"tooltip": {
"share": "مشاركة"
},
"modal": {
"title": "مشاركة رابط المحادثة"
},
"form": {
"defaultValue": {
"name": "مجهول",
"title": "محادثة بدون عنوان"
},
"title": {
"label": "عنوان المحادثة",
"placeholder": "أدخل عنوان المحادثة",
"required": "عنوان المحادثة مطلوب"
},
"name": {
"label": "اسمك",
"placeholder": "أدخل اسمك",
"required": "اسمك مطلوب"
},
"btn": {
"save": "إنشاء رابط",
"saving": "جاري إنشاء الرابط..."
}
},
"notification": {
"successGenerate": "تم نسخ الرابط إلى الحافظة",
"failGenerate": "فشل في إنشاء الرابط"
}
},
"copyToClipboard": "نسخ إلى الحافظة",
"webSearch": "البحث في الويب",
"regenerate": "إعادة التوليد",
"edit": "تعديل",
"delete": "حذف",
"saveAndSubmit": "حفظ وإرسال",
"editMessage": {
"placeholder": "اكتب رسالة..."
},
"submit": "إرسال",
"noData": "لا توجد بيانات",
"noHistory": "لا يوجد سجل محادثات",
"chatWithCurrentPage": "الدردشة مع الصفحة الحالية",
"beta": "تجريبي",
"tts": "قراءة بصوت عالٍ",
"currentChatModelSettings": "إعدادات نموذج المحادثة الحالي",
"modelSettings": {
"label": "إعدادات النموذج",
"description": "تعيين خيارات النموذج عالمياً لجميع المحادثات",
"form": {
"keepAlive": {
"label": "الإبقاء نشطاً",
"help": "يتحكم في المدة التي سيظل فيها النموذج محملاً في الذاكرة بعد الطلب (الافتراضي: 5 دقائق)",
"placeholder": "أدخل مدة البقاء نشطاً (مثال: 5م، 10م، 1س)"
},
"temperature": {
"label": "درجة الحرارة",
"placeholder": "أدخل قيمة درجة الحرارة (مثال: 0.7، 1.0)"
},
"numCtx": {
"label": "عدد السياقات",
"placeholder": "أدخل قيمة عدد السياقات (الافتراضي: 2048)"
},
"numPredict": {
"label": "الحد الأقصى للرموز",
"placeholder": "أدخل قيمة الحد الأقصى للرموز (مثال: 2048، 4096)"
},
"seed": {
"label": "البذرة",
"placeholder": "أدخل قيمة البذرة (مثال: 1234)",
"help": "إمكانية تكرار مخرجات النموذج"
},
"topK": {
"label": "أعلى K",
"placeholder": "أدخل قيمة أعلى K (مثال: 40، 100)"
},
"topP": {
"label": "أعلى P",
"placeholder": "أدخل قيمة أعلى P (مثال: 0.9، 0.95)"
},
"useMMap": {
"label": "استخدام MMap"
},
"numGpu": {
"label": "عدد وحدات معالجة الرسومات",
"placeholder": "أدخل عدد الطبقات لإرسالها إلى وحدة/وحدات معالجة الرسومات"
},
"systemPrompt": {
"label": "موجه النظام المؤقت",
"placeholder": "أدخل موجه النظام",
"help": "هذه طريقة سريعة لتعيين موجه النظام في المحادثة الحالية، والذي سيتجاوز موجه النظام المحدد إذا كان موجوداً."
}
},
"advanced": "المزيد من إعدادات النموذج"
},
"copilot": {
"summary": "تلخيص",
"explain": "شرح",
"rephrase": "إعادة صياغة",
"translate": "ترجمة",
"custom": "مخصص"
},
"citations": "الاقتباسات",
"segmented": {
"ollama": "نماذج Ollama",
"custom": "نماذج مخصصة"
},
"downloadCode": "تنزيل الكود",
"date": {
"pinned": "مثبت",
"today": "اليوم",
"yesterday": "الأمس",
"last7Days": "آخر 7 أيام",
"older": "أقدم"
},
"pin": "تثبيت",
"unpin": "إلغاء التثبيت",
"generationInfo": "معلومات التوليد"
}

View File

@ -0,0 +1,40 @@
{
"addBtn": "إضافة معرفة جديدة",
"columns": {
"title": "العنوان",
"status": "الحالة",
"embeddings": "نموذج التضمين",
"createdAt": "تاريخ الإنشاء",
"action": "الإجراءات"
},
"expandedColumns": {
"name": "الاسم"
},
"confirm": {
"delete": "هل أنت متأكد أنك تريد حذف هذه المعرفة؟"
},
"deleteSuccess": "تم حذف المعرفة بنجاح",
"status": {
"pending": "قيد الانتظار",
"finished": "مكتمل",
"processing": "قيد المعالجة",
"failed": "فشل"
},
"addKnowledge": "إضافة معرفة",
"form": {
"title": {
"label": "عنوان المعرفة",
"placeholder": "أدخل عنوان المعرفة",
"required": "عنوان المعرفة مطلوب"
},
"uploadFile": {
"label": "رفع ملف",
"uploadText": "اسحب وأفلت ملفًا هنا أو انقر للرفع",
"uploadHint": "أنواع الملفات المدعومة: .pdf, .csv, .txt, .md, .docx",
"required": "الملف مطلوب"
},
"submit": "إرسال",
"success": "تمت إضافة المعرفة بنجاح"
},
"noEmbeddingModel": "يرجى إضافة نموذج تضمين من صفحة إعدادات RAG أولاً"
}

View File

@ -0,0 +1,90 @@
{
"settings": "واجهة برمجة التطبيقات المتوافقة مع OpenAI",
"heading": "واجهة برمجة التطبيقات المتوافقة مع OpenAI",
"subheading": "إدارة وتكوين مزودي واجهة برمجة التطبيقات المتوافقة مع OpenAI هنا.",
"addBtn": "إضافة مزود",
"table": {
"name": "اسم المزود",
"baseUrl": "عنوان URL الأساسي",
"actions": "إجراء"
},
"modal": {
"titleAdd": "إضافة مزود جديد",
"name": {
"label": "اسم المزود",
"required": "اسم المزود مطلوب.",
"placeholder": "أدخل اسم المزود"
},
"baseUrl": {
"label": "عنوان URL الأساسي",
"help": "عنوان URL الأساسي لمزود واجهة برمجة التطبيقات OpenAI. مثال (http://localhost:1234/v1)",
"required": "عنوان URL الأساسي مطلوب.",
"placeholder": "أدخل عنوان URL الأساسي"
},
"apiKey": {
"label": "مفتاح API",
"required": "مفتاح API مطلوب.",
"placeholder": "أدخل مفتاح API"
},
"submit": "حفظ",
"update": "تحديث",
"deleteConfirm": "هل أنت متأكد أنك تريد حذف هذا المزود؟",
"model": {
"title": "قائمة النماذج",
"subheading": "يرجى تحديد نماذج المحادثة التي تريد استخدامها مع هذا المزود.",
"success": "تمت إضافة نماذج جديدة بنجاح."
},
"tipLMStudio": "سيقوم Page Assist تلقائيًا بجلب النماذج التي قمت بتحميلها على LM Studio. لست بحاجة إلى إضافتها يدويًا."
},
"addSuccess": "تمت إضافة المزود بنجاح.",
"deleteSuccess": "تم حذف المزود بنجاح.",
"updateSuccess": "تم تحديث المزود بنجاح.",
"delete": "حذف",
"edit": "تعديل",
"newModel": "إضافة نماذج للمزود",
"noNewModel": "بالنسبة لـ LMStudio و Ollama و Llamafile، نقوم بالجلب ديناميكيًا. لا حاجة للإضافة اليدوية.",
"searchModel": "بحث عن نموذج",
"selectAll": "تحديد الكل",
"save": "حفظ",
"saving": "جاري الحفظ...",
"manageModels": {
"columns": {
"name": "اسم النموذج",
"model_type": "نوع النموذج",
"model_id": "معرف النموذج",
"provider": "اسم المزود",
"actions": "إجراء"
},
"tooltip": {
"delete": "حذف"
},
"confirm": {
"delete": "هل أنت متأكد أنك تريد حذف هذا النموذج؟"
},
"modal": {
"title": "إضافة نموذج مخصص",
"form": {
"name": {
"label": "معرف النموذج",
"placeholder": "llama3.2",
"required": "معرف النموذج مطلوب."
},
"provider": {
"label": "المزود",
"placeholder": "اختر المزود",
"required": "المزود مطلوب."
},
"type": {
"label": "نوع النموذج"
}
}
}
},
"noModelFound": "لم يتم العثور على نموذج. تأكد من إضافة المزود الصحيح مع عنوان URL الأساسي ومفتاح API.",
"radio": {
"chat": "نموذج المحادثة",
"embedding": "نموذج التضمين",
"chatInfo": "يستخدم لإكمال المحادثة وتوليد المحادثات",
"embeddingInfo": "يستخدم لـ RAG ومهام البحث الدلالي الأخرى ذات الصلة."
}
}

View File

@ -0,0 +1,28 @@
{
"newChat": "محادثة جديدة",
"selectAPrompt": "اختر موجهاً",
"githubRepository": "مستودع GitHub",
"settings": "الإعدادات",
"sidebarTitle": "سجل المحادثات",
"error": "خطأ",
"somethingWentWrong": "حدث خطأ ما",
"validationSelectModel": "الرجاء اختيار نموذج للمتابعة",
"deleteHistoryConfirmation": "هل أنت متأكد أنك تريد حذف هذا السجل؟",
"editHistoryTitle": "أدخل عنواناً جديداً",
"temporaryChat": "محادثة مؤقتة",
"more": {
"copy": {
"group": "نسخ",
"asText": "نسخ كنص",
"asMarkdown": "نسخ كماركداون",
"success": "تم النسخ إلى الحافظة!"
},
"download": {
"group": "تنزيل",
"text": "ملف نصي (.txt)",
"markdown": "ماركداون (.md)",
"json": "ملف JSON (.json)"
},
"share": "مشاركة"
}
}

View File

@ -0,0 +1,32 @@
{
"ollamaState": {
"searching": "جارٍ البحث عن Ollama الخاص بك 🦙",
"running": "Ollama يعمل 🦙",
"notRunning": "تعذر الاتصال بـ Ollama 🦙",
"connectionError": "يبدو أنك تواجه خطأ في الاتصال. يرجى الرجوع إلى هذا <anchor>الدليل</anchor> لاستكشاف الأخطاء وإصلاحها."
},
"formError": {
"noModel": "الرجاء اختيار نموذج",
"noEmbeddingModel": "الرجاء تعيين نموذج التضمين في صفحة الإعدادات > RAG"
},
"form": {
"textarea": {
"placeholder": "اكتب رسالة..."
},
"webSearch": {
"on": "تشغيل",
"off": "إيقاف"
}
},
"tooltip": {
"searchInternet": "البحث في الإنترنت",
"speechToText": "تحويل الكلام إلى نص",
"uploadImage": "تحميل صورة",
"stopStreaming": "إيقاف البث",
"knowledge": "المعرفة",
"vision": "[تجريبي] محادثة الرؤية"
},
"sendWhenEnter": "إرسال عند الضغط على Enter",
"welcome": "مرحباً! كيف يمكنني مساعدتك اليوم؟",
"useOCR": "استخراج النص من الصورة (OCR)"
}

View File

@ -0,0 +1,358 @@
{
"generalSettings": {
"title": "الإعدادات العامة",
"settings": {
"heading": "إعدادات واجهة المستخدم",
"speechRecognitionLang": {
"label": "لغة التعرف على الكلام",
"placeholder": "اختر لغة"
},
"language": {
"label": "اللغة",
"placeholder": "اختر لغة"
},
"darkMode": {
"label": "تغيير المظهر",
"options": {
"light": "فاتح",
"dark": "داكن"
}
},
"copilotResumeLastChat": {
"label": "استئناف آخر محادثة عند فتح اللوحة الجانبية (كوبيلوت)"
},
"webUIResumeLastChat": {
"label": "استئناف آخر محادثة عند فتح واجهة المستخدم"
},
"hideCurrentChatModelSettings": {
"label": "إخفاء إعدادات نموذج المحادثة الحالي"
},
"restoreLastChatModel": {
"label": "استعادة آخر نموذج مستخدم للمحادثات السابقة"
},
"sendNotificationAfterIndexing": {
"label": "إرسال إشعار بعد الانتهاء من معالجة قاعدة المعرفة"
},
"generateTitle": {
"label": "توليد العنوان باستخدام الذكاء الاصطناعي"
},
"ollamaStatus": {
"label": "تمكين أو تعطيل فحص حالة اتصال أولاما"
}
},
"sidepanelRag": {
"heading": "إعدادات الدردشة مع الموقع",
"ragEnabled": {
"label": "الدردشة مع الموقع باستخدام التضمينات المتجهة"
},
"maxWebsiteContext": {
"label": "حجم محتوى الموقع في الوضع العادي",
"placeholder": "حجم المحتوى (الافتراضي 4028)"
}
},
"webSearch": {
"heading": "إدارة البحث على الإنترنت",
"searchMode": {
"label": "إجراء بحث بسيط على الإنترنت"
},
"provider": {
"label": "محرك البحث",
"placeholder": "اختر محرك بحث"
},
"totalSearchResults": {
"label": "إجمالي نتائج البحث",
"placeholder": "أدخل إجمالي نتائج البحث"
},
"visitSpecificWebsite": {
"label": "زيارة الموقع المذكور في الرسالة"
},
"searxng": {
"url": {
"label": "رابط SearXNG"
}
},
"braveApi": {
"label": "مفتاح واجهة برنامج Brave",
"placeholder": "أدخل مفتاح واجهة برنامج Brave"
},
"googleDomain": {
"label": "نطاق جوجل"
}
},
"system": {
"heading": "إعدادات النظام",
"deleteChatHistory": {
"label": "إعادة تعيين النظام",
"button": "إعادة تعيين الكل",
"confirm": "هل أنت متأكد أنك تريد إجراء إعادة تعيين النظام؟ سيؤدي هذا إلى مسح جميع البيانات ولا يمكن التراجع عنه."
},
"export": {
"label": "تصدير سجل المحادثات وقاعدة المعرفة والإرشادات",
"button": "تصدير البيانات",
"success": "تم التصدير بنجاح"
},
"import": {
"label": "استيراد سجل المحادثات وقاعدة المعرفة والإرشادات",
"button": "استيراد البيانات",
"success": "تم الاستيراد بنجاح",
"error": "خطأ في الاستيراد"
}
},
"tts": {
"heading": "إعدادات تحويل النص إلى كلام",
"ttsEnabled": {
"label": "تمكين تحويل النص إلى كلام"
},
"ttsProvider": {
"label": "مزود خدمة تحويل النص إلى كلام",
"placeholder": "اختر مزود خدمة"
},
"ttsVoice": {
"label": "صوت تحويل النص إلى كلام",
"placeholder": "اختر صوتاً"
},
"ssmlEnabled": {
"label": "تمكين SSML (لغة ترميز توليف الكلام)"
}
}
},
"manageModels": {
"title": "إدارة النماذج",
"addBtn": "إضافة نموذج جديد",
"columns": {
"name": "الاسم",
"digest": "الملخص",
"modifiedAt": "تم التعديل في",
"size": "الحجم",
"actions": "الإجراءات"
},
"expandedColumns": {
"parentModel": "النموذج الأصلي",
"format": "التنسيق",
"family": "العائلة",
"parameterSize": "حجم المعلمة",
"quantizationLevel": "مستوى التكميم"
},
"tooltip": {
"delete": "حذف النموذج",
"repull": "إعادة سحب النموذج"
},
"confirm": {
"delete": "هل أنت متأكد أنك تريد حذف هذا النموذج؟",
"repull": "هل أنت متأكد أنك تريد إعادة سحب هذا النموذج؟"
},
"modal": {
"title": "إضافة نموذج جديد",
"placeholder": "أدخل اسم النموذج",
"pull": "سحب النموذج"
},
"notification": {
"pullModel": "جاري سحب النموذج",
"pullModelDescription": "جاري سحب نموذج {{modelName}}. لمزيد من التفاصيل، تحقق من أيقونة الإضافة.",
"success": "نجاح",
"error": "خطأ",
"successDescription": "تم سحب النموذج بنجاح",
"successDeleteDescription": "تم حذف النموذج بنجاح",
"someError": "حدث خطأ ما. يرجى المحاولة مرة أخرى لاحقاً"
}
},
"managePrompts": {
"title": "إدارة الإرشادات",
"addBtn": "إضافة إرشاد جديد",
"option1": "عادي",
"option2": "RAG",
"questionPrompt": "إرشاد السؤال",
"segmented": {
"custom": "إرشادات مخصصة",
"copilot": "إرشادات كوبيلوت"
},
"columns": {
"title": "العنوان",
"prompt": "الإرشاد",
"type": "نوع الإرشاد",
"actions": "الإجراءات"
},
"systemPrompt": "إرشاد النظام",
"quickPrompt": "إرشاد سريع",
"tooltip": {
"delete": "حذف الإرشاد",
"edit": "تعديل الإرشاد"
},
"confirm": {
"delete": "هل أنت متأكد أنك تريد حذف هذا الإرشاد؟ لا يمكن التراجع عن هذا الإجراء."
},
"modal": {
"addTitle": "إضافة إرشاد جديد",
"editTitle": "تعديل الإرشاد"
},
"form": {
"title": {
"label": "العنوان",
"placeholder": "إرشادي الرائع",
"required": "الرجاء إدخال عنوان"
},
"prompt": {
"label": "الإرشاد",
"placeholder": "أدخل الإرشاد",
"required": "الرجاء إدخال إرشاد",
"help": "يمكنك استخدام {key} كمتغير في إرشادك.",
"missingTextPlaceholder": "المتغير {text} مفقود في الإرشاد. الرجاء إضافته."
},
"isSystem": {
"label": "إرشاد نظام"
},
"btnSave": {
"saving": "جاري إضافة الإرشاد...",
"save": "إضافة الإرشاد"
},
"btnEdit": {
"saving": "جاري تحديث الإرشاد...",
"save": "تحديث الإرشاد"
}
},
"notification": {
"addSuccess": "تمت إضافة الإرشاد",
"addSuccessDesc": "تمت إضافة الإرشاد بنجاح",
"error": "خطأ",
"someError": "حدث خطأ ما. يرجى المحاولة مرة أخرى لاحقاً",
"updatedSuccess": "تم تحديث الإرشاد",
"updatedSuccessDesc": "تم تحديث الإرشاد بنجاح",
"deletedSuccess": "تم حذف الإرشاد",
"deletedSuccessDesc": "تم حذف الإرشاد بنجاح"
}
},
"manageShare": {
"title": "إدارة المشاركة",
"heading": "تكوين رابط مشاركة الصفحة",
"form": {
"url": {
"label": "رابط مشاركة الصفحة",
"placeholder": "أدخل رابط مشاركة الصفحة",
"required": "الرجاء إدخال رابط مشاركة الصفحة!",
"help": "لأسباب تتعلق بالخصوصية، يمكنك استضافة مشاركة الصفحة ذاتياً وتوفير الرابط هنا. <anchor>تعلم المزيد</anchor>."
}
},
"webshare": {
"heading": "مشاركة الويب",
"columns": {
"title": "العنوان",
"url": "الرابط",
"actions": "الإجراءات"
},
"tooltip": {
"delete": "حذف المشاركة"
},
"confirm": {
"delete": "هل أنت متأكد أنك تريد حذف هذه المشاركة؟ لا يمكن التراجع عن هذا الإجراء."
},
"label": "إدارة مشاركة الصفحة",
"description": "تمكين أو تعطيل ميزة مشاركة الصفحة"
},
"notification": {
"pageShareSuccess": "تم تحديث رابط مشاركة الصفحة بنجاح",
"someError": "حدث خطأ ما. يرجى المحاولة مرة أخرى لاحقاً",
"webShareDeleteSuccess": "تم حذف مشاركة الويب بنجاح"
}
},
"ollamaSettings": {
"title": "إعدادات Ollama",
"heading": "تكوين Ollama",
"settings": {
"ollamaUrl": {
"label": "رابط Ollama",
"placeholder": "أدخل رابط Ollama"
},
"advanced": {
"label": "تكوين رابط Ollama المتقدم",
"urlRewriteEnabled": {
"label": "تمكين أو تعطيل رابط المصدر المخصص"
},
"rewriteUrl": {
"label": "رابط المصدر المخصص",
"placeholder": "أدخل رابط المصدر المخصص"
},
"headers": {
"label": "الترويسات المخصصة",
"add": "إضافة ترويسة",
"key": {
"label": "مفتاح الترويسة",
"placeholder": "التفويض"
},
"value": {
"label": "قيمة الترويسة",
"placeholder": "رمز Bearer"
}
},
"help": "إذا كنت تواجه مشاكل في الاتصال مع Ollama في مساعد الصفحة، يمكنك تكوين رابط مصدر مخصص. لمعرفة المزيد حول التكوين، <anchor>انقر هنا</anchor>."
}
}
},
"manageSearch": {
"title": "إدارة البحث في الويب",
"heading": "تكوين البحث في الويب"
},
"about": {
"title": "حول",
"heading": "حول",
"chromeVersion": "إصدار مساعد الصفحة",
"ollamaVersion": "إصدار Ollama",
"support": "يمكنك دعم مشروع مساعد الصفحة من خلال التبرع أو الرعاية عبر المنصات التالية:",
"koFi": "ادعم على Ko-fi",
"githubSponsor": "كن راعياً على GitHub",
"githubRepo": "مستودع GitHub"
},
"manageKnowledge": {
"title": "إدارة المعرفة",
"heading": "تكوين قاعدة المعرفة"
},
"rag": {
"title": "إعدادات RAG",
"ragSettings": {
"label": "إعدادات RAG",
"model": {
"label": "نموذج التضمين",
"required": "الرجاء اختيار نموذج",
"help": "يوصى بشدة باستخدام نماذج التضمين مثل `nomic-embed-text`.",
"placeholder": "اختر نموذجاً"
},
"chunkSize": {
"label": "حجم القطعة",
"placeholder": "أدخل حجم القطعة",
"required": "الرجاء إدخال حجم القطعة"
},
"chunkOverlap": {
"label": "تداخل القطع",
"placeholder": "أدخل تداخل القطع",
"required": "الرجاء إدخال تداخل القطع"
},
"totalFilePerKB": {
"label": "حد رفع الملفات الافتراضي لقاعدة المعرفة",
"placeholder": "أدخل حد رفع الملفات الافتراضي (مثال: 10)",
"required": "الرجاء إدخال حد رفع الملفات الافتراضي"
},
"noOfRetrievedDocs": {
"label": "عدد المستندات المسترجعة",
"placeholder": "أدخل عدد المستندات المسترجعة",
"required": "الرجاء إدخال عدد المستندات المسترجعة"
}
},
"prompt": {
"label": "تكوين إرشاد RAG",
"option1": "عادي",
"option2": "ويب",
"alert": "تكوين إرشاد النظام هنا مهمل. يرجى استخدام قسم إدارة الإرشادات لإضافة أو تعديل الإرشادات. سيتم إزالة هذا القسم في إصدار مستقبلي",
"systemPrompt": "إرشاد النظام",
"systemPromptPlaceholder": "أدخل إرشاد النظام",
"webSearchPrompt": "إرشاد بحث الويب",
"webSearchPromptHelp": "لا تقم بإزالة `{search_results}` من الإرشاد.",
"webSearchPromptError": "الرجاء إدخال إرشاد بحث الويب",
"webSearchPromptPlaceholder": "أدخل إرشاد بحث الويب",
"webSearchFollowUpPrompt": "إرشاد متابعة بحث الويب",
"webSearchFollowUpPromptHelp": "لا تقم بإزالة `{chat_history}` و `{question}` من الإرشاد.",
"webSearchFollowUpPromptError": "الرجاء إدخال إرشاد متابعة بحث الويب!",
"webSearchFollowUpPromptPlaceholder": "إرشاد متابعة بحث الويب الخاص بك"
}
},
"chromeAiSettings": {
"title": "إعدادات Chrome AI"
}}

View File

@ -0,0 +1,7 @@
{
"tooltip": {
"embed": "قد يستغرق تضمين الصفحة بضع دقائق. يرجى الانتظار...",
"clear": "مسح سجل المحادثة",
"history": "سجل المحادثة"
}
}

View File

@ -26,5 +26,6 @@
"knowledge": "Viden" "knowledge": "Viden"
}, },
"sendWhenEnter": "Søg, når Indtast trykkes", "sendWhenEnter": "Søg, når Indtast trykkes",
"welcome": "Hej! Hvordan kan jeg hjælpe dig i dag?" "welcome": "Hej! Hvordan kan jeg hjælpe dig i dag?",
"useOCR": "Udtræk tekst fra billede (OCR)"
} }

View File

@ -26,5 +26,6 @@
"knowledge": "Wissen" "knowledge": "Wissen"
}, },
"sendWhenEnter": "Senden bei Drücken der Eingabetaste", "sendWhenEnter": "Senden bei Drücken der Eingabetaste",
"welcome": "Hallo! Wie kann ich Ihnen heute helfen?" "welcome": "Hallo! Wie kann ich Ihnen heute helfen?",
"useOCR": "Text aus Bild extrahieren (OCR)"
} }

View File

@ -60,11 +60,11 @@
"keepAlive": { "keepAlive": {
"label": "Keep Alive", "label": "Keep Alive",
"help": "controls how long the model will stay loaded into memory following the request (default: 5m)", "help": "controls how long the model will stay loaded into memory following the request (default: 5m)",
"placeholder": "Enter Keep Alive duration (e.g. 5m, 10m, 1h)" "placeholder": "e.g. 5m, 10m, 1h"
}, },
"temperature": { "temperature": {
"label": "Temperature", "label": "Temperature",
"placeholder": "Enter Temperature value (e.g. 0.7, 1.0)" "placeholder": "e.g. 0.7, 1.0"
}, },
"numCtx": { "numCtx": {
"label": "Number of Contexts", "label": "Number of Contexts",
@ -72,24 +72,36 @@
}, },
"numPredict": { "numPredict": {
"label": "Max Tokens (num_predict)", "label": "Max Tokens (num_predict)",
"placeholder": "Enter Max Tokens value (e.g. 2048, 4096)" "placeholder": "e.g. 2048, 4096"
}, },
"seed": { "seed": {
"label": "Seed", "label": "Seed",
"placeholder": "Enter Seed value (e.g. 1234)", "placeholder": "e.g. 1234",
"help": "Reproducibility of the model output" "help": "Reproducibility of the model output"
}, },
"topK": { "topK": {
"label": "Top K", "label": "Top K",
"placeholder": "Enter Top K value (e.g. 40, 100)" "placeholder": "e.g. 40, 100"
}, },
"topP": { "topP": {
"label": "Top P", "label": "Top P",
"placeholder": "Enter Top P value (e.g. 0.9, 0.95)" "placeholder": "e.g. 0.9, 0.95"
}, },
"useMMap": { "useMMap": {
"label": "useMmap" "label": "useMmap"
}, },
"minP": {
"label": "Min P",
"placeholder": "e.g. 0.05"
},
"repeatPenalty": {
"label": "Repeat Penalty",
"placeholder": "e.g. 1.1, 1.2"
},
"repeatLastN": {
"label": "Repeat Last N",
"placeholder": "e.g. 64, 128"
},
"numGpu": { "numGpu": {
"label": "Num GPU", "label": "Num GPU",
"placeholder": "Enter number of layers to send to GPU(s)" "placeholder": "Enter number of layers to send to GPU(s)"
@ -125,4 +137,4 @@
"pin": "Pin", "pin": "Pin",
"unpin": "Unpin", "unpin": "Unpin",
"generationInfo": "Generation Info" "generationInfo": "Generation Info"
} }

View File

@ -27,5 +27,6 @@
"vision": "[Experimental] Vision Chat" "vision": "[Experimental] Vision Chat"
}, },
"sendWhenEnter": "Send when Enter pressed", "sendWhenEnter": "Send when Enter pressed",
"welcome": "Hello! How can I help you today?" "welcome": "Hello! How can I help you today?",
"useOCR": "Extract text from image (OCR)"
} }

View File

@ -113,6 +113,9 @@
}, },
"ssmlEnabled": { "ssmlEnabled": {
"label": "Enable SSML (Speech Synthesis Markup Language)" "label": "Enable SSML (Speech Synthesis Markup Language)"
},
"responseSplitting": {
"label": "Response Splitting"
} }
} }
}, },

View File

@ -26,5 +26,6 @@
"knowledge": "Conocimiento" "knowledge": "Conocimiento"
}, },
"sendWhenEnter": "Enviar cuando presione Enter", "sendWhenEnter": "Enviar cuando presione Enter",
"welcome": "¡Hola! ¿Cómo puedo ayudarte hoy?" "welcome": "¡Hola! ¿Cómo puedo ayudarte hoy?",
"useOCR": "Extraer texto de imagen (OCR)"
} }

View File

@ -26,5 +26,6 @@
"knowledge": "دانش" "knowledge": "دانش"
}, },
"sendWhenEnter": "با فشار دادن Enter ارسال شود", "sendWhenEnter": "با فشار دادن Enter ارسال شود",
"welcome": "سلام! امروز چطور می‌توانم به شما کمک کنم؟" "welcome": "سلام! امروز چطور می‌توانم به شما کمک کنم؟",
"useOCR": "استخراج متن از تصویر (OCR)"
} }

View File

@ -26,5 +26,6 @@
"knowledge": "Connaissance" "knowledge": "Connaissance"
}, },
"sendWhenEnter": "Envoyer en appuyant sur Entrée", "sendWhenEnter": "Envoyer en appuyant sur Entrée",
"welcome": "Bonjour ! Comment puis-je vous aider aujourd'hui ?" "welcome": "Bonjour ! Comment puis-je vous aider aujourd'hui ?",
"useOCR": "Extraire le texte de l'image (OCR)"
} }

View File

@ -26,5 +26,6 @@
"knowledge": "Conoscenza" "knowledge": "Conoscenza"
}, },
"sendWhenEnter": "Invia subito dopo Enter", "sendWhenEnter": "Invia subito dopo Enter",
"welcome": "Ciao! Come posso aiutarti oggi?" "welcome": "Ciao! Come posso aiutarti oggi?",
"useOCR": "Estrai testo dall'immagine (OCR)"
} }

View File

@ -26,5 +26,6 @@
"knowledge": "知識" "knowledge": "知識"
}, },
"sendWhenEnter": "Enterキーを押すと送信", "sendWhenEnter": "Enterキーを押すと送信",
"welcome": "こんにちは!本日はどのようなお手伝いができますか?" "welcome": "こんにちは!本日はどのようなお手伝いができますか?",
"useOCR": "画像からテキストを抽出OCR"
} }

View File

@ -26,5 +26,6 @@
"knowledge": "지식" "knowledge": "지식"
}, },
"sendWhenEnter": "Enter 키를 누르면 전송", "sendWhenEnter": "Enter 키를 누르면 전송",
"welcome": "안녕하세요! 오늘 어떻게 도와드릴까요?" "welcome": "안녕하세요! 오늘 어떻게 도와드릴까요?",
"useOCR": "이미지에서 텍스트 추출 (OCR)"
} }

View File

@ -26,5 +26,6 @@
"knowledge": "അറിവ്" "knowledge": "അറിവ്"
}, },
"sendWhenEnter": "എന്റര്‍ അമര്‍ത്തുമ്പോള്‍ അയയ്ക്കുക", "sendWhenEnter": "എന്റര്‍ അമര്‍ത്തുമ്പോള്‍ അയയ്ക്കുക",
"welcome": "നമസ്കാരം! ഇന്ന് എനിക്ക് നിങ്ങളെ എങ്ങനെ സഹായിക്കാൻ കഴിയും?" "welcome": "നമസ്കാരം! ഇന്ന് എനിക്ക് നിങ്ങളെ എങ്ങനെ സഹായിക്കാൻ കഴിയും?",
"useOCR": "ചിത്രത്തിൽ നിന്ന് ടെക്സ്റ്റ് എടുക്കുക (OCR)"
} }

View File

@ -26,5 +26,6 @@
"knowledge": "Kunnskap" "knowledge": "Kunnskap"
}, },
"sendWhenEnter": "Søk når Enter trykkes", "sendWhenEnter": "Søk når Enter trykkes",
"welcome": "Hei! Hvordan kan jeg hjelpe deg i dag?" "welcome": "Hei! Hvordan kan jeg hjelpe deg i dag?",
"useOCR": "Trekk ut tekst fra bilde (OCR)"
} }

View File

@ -26,5 +26,6 @@
"knowledge": "Conhecimento" "knowledge": "Conhecimento"
}, },
"sendWhenEnter": "Enviar ao pressionar Enter", "sendWhenEnter": "Enviar ao pressionar Enter",
"welcome": "Olá! Como posso ajudar você hoje?" "welcome": "Olá! Como posso ajudar você hoje?",
"useOCR": "Extrair texto da imagem (OCR)"
} }

View File

@ -26,5 +26,6 @@
"knowledge": "Знание" "knowledge": "Знание"
}, },
"sendWhenEnter": "Отправить при нажатии клавиши Enter", "sendWhenEnter": "Отправить при нажатии клавиши Enter",
"welcome": "Здравствуйте! Как я могу помочь вам сегодня?" "welcome": "Здравствуйте! Как я могу помочь вам сегодня?",
"useOCR": "Извлечь текст из изображения (OCR)"
} }

View File

@ -26,5 +26,6 @@
"knowledge": "Kunskap" "knowledge": "Kunskap"
}, },
"sendWhenEnter": "Skicka när Enter trycks", "sendWhenEnter": "Skicka när Enter trycks",
"welcome": "Hej! Hur kan jag hjälpa dig idag?" "welcome": "Hej! Hur kan jag hjälpa dig idag?",
"useOCR": "Extrahera text från bild (OCR)"
} }

View File

@ -26,5 +26,6 @@
"knowledge": "Знання" "knowledge": "Знання"
}, },
"sendWhenEnter": "Надсилати при натисканні Enter", "sendWhenEnter": "Надсилати при натисканні Enter",
"welcome": "Вітаю! Як я можу допомогти вам сьогодні?" "welcome": "Вітаю! Як я можу допомогти вам сьогодні?",
"useOCR": "Витягти текст із зображення (OCR)"
} }

View File

@ -26,5 +26,6 @@
"knowledge": "知识" "knowledge": "知识"
}, },
"sendWhenEnter": "按Enter发送", "sendWhenEnter": "按Enter发送",
"welcome": "你好!今天我能帮你什么?" "welcome": "你好!今天我能帮你什么?",
"useOCR": "从图片中提取文字OCR"
} }

View File

@ -76,7 +76,10 @@ export const CurrentChatModelSettings = ({
numGpu: cUserSettings.numGpu ?? data.numGpu, numGpu: cUserSettings.numGpu ?? data.numGpu,
numPredict: cUserSettings.numPredict ?? data.numPredict, numPredict: cUserSettings.numPredict ?? data.numPredict,
systemPrompt: cUserSettings.systemPrompt ?? tempSystemPrompt, systemPrompt: cUserSettings.systemPrompt ?? tempSystemPrompt,
useMMap: cUserSettings.useMMap ?? data.useMMap useMMap: cUserSettings.useMMap ?? data.useMMap,
minP: cUserSettings.minP ?? data.minP,
repeatLastN: cUserSettings.repeatLastN ?? data.repeatLastN,
repeatPenalty: cUserSettings.repeatPenalty ?? data.repeatPenalty
}) })
return data return data
}, },
@ -199,6 +202,34 @@ export const CurrentChatModelSettings = ({
/> />
</Form.Item> </Form.Item>
<Form.Item
name="minP"
label={t("modelSettings.form.minP.label")}>
<InputNumber
style={{ width: "100%" }}
placeholder={t("modelSettings.form.minP.placeholder")}
/>
</Form.Item>
<Form.Item
name="repeatPenalty"
label={t("modelSettings.form.repeatPenalty.label")}>
<InputNumber
style={{ width: "100%" }}
placeholder={t(
"modelSettings.form.repeatPenalty.placeholder"
)}
/>
</Form.Item>
<Form.Item
name="repeatLastN"
label={t("modelSettings.form.repeatLastN.label")}>
<InputNumber
style={{ width: "100%" }}
placeholder={t(
"modelSettings.form.repeatLastN.placeholder"
)}
/>
</Form.Item>
<Form.Item <Form.Item
name="useMMap" name="useMMap"
label={t("modelSettings.form.useMMap.label")}> label={t("modelSettings.form.useMMap.label")}>
@ -209,7 +240,10 @@ export const CurrentChatModelSettings = ({
} }
]} ]}
/> />
<SaveButton className="w-full text-center inline-flex items-center justify-center" btnType="submit" /> <SaveButton
className="w-full text-center inline-flex items-center justify-center"
btnType="submit"
/>
</Form> </Form>
) : ( ) : (
<Skeleton active /> <Skeleton active />

View File

@ -2,11 +2,11 @@ import { useStorage } from "@plasmohq/storage/hook"
import { import {
BrainCog, BrainCog,
ChevronLeft, ChevronLeft,
ChevronRight,
CogIcon, CogIcon,
ComputerIcon, ComputerIcon,
GithubIcon, GithubIcon,
PanelLeftIcon, PanelLeftIcon,
SquarePen,
ZapIcon ZapIcon
} from "lucide-react" } from "lucide-react"
import { useTranslation } from "react-i18next" import { useTranslation } from "react-i18next"
@ -32,7 +32,9 @@ export const Header: React.FC<Props> = ({
setOpenModelSettings, setOpenModelSettings,
setSidebarOpen setSidebarOpen
}) => { }) => {
const { t } = useTranslation(["option", "common"]) const { t, i18n } = useTranslation(["option", "common"])
const isRTL = i18n?.dir() === "rtl"
const [shareModeEnabled] = useStorage("shareMode", false) const [shareModeEnabled] = useStorage("shareMode", false)
const [hideCurrentChatModelSettings] = useStorage( const [hideCurrentChatModelSettings] = useStorage(
"hideCurrentChatModelSettings", "hideCurrentChatModelSettings",
@ -98,7 +100,11 @@ export const Header: React.FC<Props> = ({
<NavLink <NavLink
to="/" to="/"
className="text-gray-500 items-center dark:text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors"> className="text-gray-500 items-center dark:text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors">
<ChevronLeft className="w-8 h-8" /> {isRTL ? (
<ChevronRight className={`w-8 h-8`} />
) : (
<ChevronLeft className={`w-8 h-8`} />
)}
</NavLink> </NavLink>
</div> </div>
)} )}

View File

@ -37,7 +37,9 @@ export const PlaygroundForm = ({ dropedFile }: Props) => {
textareaRef, textareaRef,
setSelectedQuickPrompt, setSelectedQuickPrompt,
selectedKnowledge, selectedKnowledge,
temporaryChat temporaryChat,
useOCR,
setUseOCR
} = useMessageOption() } = useMessageOption()
const isMobile = () => { const isMobile = () => {
@ -375,6 +377,16 @@ export const PlaygroundForm = ({ dropedFile }: Props) => {
{t("sendWhenEnter")} {t("sendWhenEnter")}
</Checkbox> </Checkbox>
) )
},
{
key: 2,
label: (
<Checkbox
checked={useOCR}
onChange={(e) => setUseOCR(e.target.checked)}>
{t("useOCR")}
</Checkbox>
)
} }
] ]
}}> }}>

View File

@ -122,6 +122,34 @@ export const ModelSettings = () => {
placeholder={t("modelSettings.form.numGpu.placeholder")} placeholder={t("modelSettings.form.numGpu.placeholder")}
/> />
</Form.Item> </Form.Item>
<Form.Item
name="minP"
label={t("modelSettings.form.minP.label")}>
<InputNumber
style={{ width: "100%" }}
placeholder={t("modelSettings.form.minP.placeholder")}
/>
</Form.Item>
<Form.Item
name="repeatPenalty"
label={t("modelSettings.form.repeatPenalty.label")}>
<InputNumber
style={{ width: "100%" }}
placeholder={t(
"modelSettings.form.repeatPenalty.placeholder"
)}
/>
</Form.Item>
<Form.Item
name="repeatLastN"
label={t("modelSettings.form.repeatLastN.label")}>
<InputNumber
style={{ width: "100%" }}
placeholder={t(
"modelSettings.form.repeatLastN.placeholder"
)}
/>
</Form.Item>
<Form.Item <Form.Item
name="useMMap" name="useMMap"
label={t("modelSettings.form.useMMap.label")}> label={t("modelSettings.form.useMMap.label")}>

View File

@ -1,9 +1,10 @@
import { SaveButton } from "@/components/Common/SaveButton" import { SaveButton } from "@/components/Common/SaveButton"
import { getModels, getVoices } from "@/services/elevenlabs"
import { getTTSSettings, setTTSSettings } from "@/services/tts" import { getTTSSettings, setTTSSettings } from "@/services/tts"
import { useWebUI } from "@/store/webui" import { useWebUI } from "@/store/webui"
import { useForm } from "@mantine/form" import { useForm } from "@mantine/form"
import { useQuery } from "@tanstack/react-query" import { useQuery } from "@tanstack/react-query"
import { Select, Skeleton, Switch } from "antd" import { Input, message, Select, Skeleton, Switch } from "antd"
import { useTranslation } from "react-i18next" import { useTranslation } from "react-i18next"
export const TTSModeSettings = ({ hideBorder }: { hideBorder?: boolean }) => { export const TTSModeSettings = ({ hideBorder }: { hideBorder?: boolean }) => {
@ -15,7 +16,11 @@ export const TTSModeSettings = ({ hideBorder }: { hideBorder?: boolean }) => {
ttsEnabled: false, ttsEnabled: false,
ttsProvider: "", ttsProvider: "",
voice: "", voice: "",
ssmlEnabled: false ssmlEnabled: false,
elevenLabsApiKey: "",
elevenLabsVoiceId: "",
elevenLabsModel: "",
responseSplitting: ""
} }
}) })
@ -28,6 +33,27 @@ export const TTSModeSettings = ({ hideBorder }: { hideBorder?: boolean }) => {
} }
}) })
const { data: elevenLabsData } = useQuery({
queryKey: ["fetchElevenLabsData", form.values.elevenLabsApiKey],
queryFn: async () => {
try {
if (
form.values.ttsProvider === "elevenlabs" &&
form.values.elevenLabsApiKey
) {
const voices = await getVoices(form.values.elevenLabsApiKey)
const models = await getModels(form.values.elevenLabsApiKey)
return { voices, models }
}
} catch (e) {
console.log(e)
message.error("Error fetching ElevenLabs data")
}
return null
},
enabled:
form.values.ttsProvider === "elevenlabs" && !!form.values.elevenLabsApiKey
})
if (status === "pending" || status === "error") { if (status === "pending" || status === "error") {
return <Skeleton active /> return <Skeleton active />
} }
@ -72,29 +98,103 @@ export const TTSModeSettings = ({ hideBorder }: { hideBorder?: boolean }) => {
<Select <Select
placeholder={t("generalSettings.tts.ttsProvider.placeholder")} placeholder={t("generalSettings.tts.ttsProvider.placeholder")}
className="w-full mt-4 sm:mt-0 sm:w-[200px]" className="w-full mt-4 sm:mt-0 sm:w-[200px]"
options={[{ label: "Browser TTS", value: "browser" }]} options={[
{ label: "Browser TTS", value: "browser" },
{
label: "ElevenLabs",
value: "elevenlabs"
}
]}
{...form.getInputProps("ttsProvider")} {...form.getInputProps("ttsProvider")}
/> />
</div> </div>
</div> </div>
<div className="flex sm:flex-row flex-col space-y-4 sm:space-y-0 sm:justify-between"> {form.values.ttsProvider === "browser" && (
<span className="text-gray-700 dark:text-neutral-50 "> <div className="flex sm:flex-row flex-col space-y-4 sm:space-y-0 sm:justify-between">
{t("generalSettings.tts.ttsVoice.label")} <span className="text-gray-700 dark:text-neutral-50 ">
</span> {t("generalSettings.tts.ttsVoice.label")}
<div> </span>
<Select <div>
placeholder={t("generalSettings.tts.ttsVoice.placeholder")} <Select
className="w-full mt-4 sm:mt-0 sm:w-[200px]" placeholder={t("generalSettings.tts.ttsVoice.placeholder")}
options={data?.browserTTSVoices?.map( className="w-full mt-4 sm:mt-0 sm:w-[200px]"
(voice) => ({ options={data?.browserTTSVoices?.map((voice) => ({
label: `${voice.voiceName} - ${voice.lang}`.trim(), label: `${voice.voiceName} - ${voice.lang}`.trim(),
value: voice.voiceName value: voice.voiceName
}) }))}
)} {...form.getInputProps("voice")}
{...form.getInputProps("voice")} />
/> </div>
</div> </div>
</div> )}
{form.values.ttsProvider === "elevenlabs" && (
<>
<div className="flex sm:flex-row flex-col space-y-4 sm:space-y-0 sm:justify-between">
<span className="text-gray-700 dark:text-neutral-50">
API Key
</span>
<Input.Password
placeholder="sk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
className=" mt-4 sm:mt-0 !w-[300px] sm:w-[200px]"
required
{...form.getInputProps("elevenLabsApiKey")}
/>
</div>
{elevenLabsData && (
<>
<div className="flex sm:flex-row flex-col space-y-4 sm:space-y-0 sm:justify-between">
<span className="text-gray-700 dark:text-neutral-50">
TTS Voice
</span>
<Select
options={elevenLabsData.voices.map((v) => ({
label: v.name,
value: v.voice_id
}))}
className="w-full mt-4 sm:mt-0 sm:w-[200px]"
placeholder="Select a voice"
{...form.getInputProps("elevenLabsVoiceId")}
/>
</div>
<div className="flex sm:flex-row flex-col space-y-4 sm:space-y-0 sm:justify-between">
<span className="text-gray-700 dark:text-neutral-50">
TTS Model
</span>
<Select
className="w-full mt-4 sm:mt-0 sm:w-[200px]"
placeholder="Select a model"
options={elevenLabsData.models.map((m) => ({
label: m.name,
value: m.model_id
}))}
{...form.getInputProps("elevenLabsModel")}
/>
</div>
<div className="flex sm:flex-row flex-col space-y-4 sm:space-y-0 sm:justify-between">
<span className="text-gray-700 dark:text-neutral-50 ">
{t("generalSettings.tts.responseSplitting.label")}
</span>
<div>
<Select
placeholder={t(
"generalSettings.tts.responseSplitting.placeholder"
)}
className="w-full mt-4 sm:mt-0 sm:w-[200px]"
options={[
{ label: "None", value: "none" },
{ label: "Punctuation", value: "punctuation" },
{ label: "Paragraph", value: "paragraph" }
]}
{...form.getInputProps("responseSplitting")}
/>
</div>
</div>
</>
)}
</>
)}
<div className="flex sm:flex-row flex-col space-y-4 sm:space-y-0 sm:justify-between"> <div className="flex sm:flex-row flex-col space-y-4 sm:space-y-0 sm:justify-between">
<span className="text-gray-700 dark:text-neutral-50 "> <span className="text-gray-700 dark:text-neutral-50 ">
{t("generalSettings.tts.ssmlEnabled.label")} {t("generalSettings.tts.ssmlEnabled.label")}

View File

@ -73,6 +73,7 @@ export const PageAssistSelect: React.FC<SelectProps> = ({
} catch (error) { } catch (error) {
console.error("Error scrolling to selected option:", error) console.error("Error scrolling to selected option:", error)
} }
}, [isOpen, value]) }, [isOpen, value])
useEffect(() => { useEffect(() => {

View File

@ -131,7 +131,9 @@ export const SidepanelForm = ({ dropedFile }: Props) => {
setWebSearch, setWebSearch,
selectedQuickPrompt, selectedQuickPrompt,
setSelectedQuickPrompt, setSelectedQuickPrompt,
speechToTextLanguage speechToTextLanguage,
useOCR,
setUseOCR
} = useMessage() } = useMessage()
React.useEffect(() => { React.useEffect(() => {
@ -414,6 +416,16 @@ export const SidepanelForm = ({ dropedFile }: Props) => {
{t("common:chatWithCurrentPage")} {t("common:chatWithCurrentPage")}
</Checkbox> </Checkbox>
) )
},
{
key: 3,
label: (
<Checkbox
checked={useOCR}
onChange={(e) => setUseOCR(e.target.checked)}>
{t("useOCR")}
</Checkbox>
)
} }
] ]
}}> }}>

View File

@ -1,14 +1,22 @@
import { ChevronLeft } from "lucide-react" import { ChevronLeft, ChevronRight } from "lucide-react"
import { useTranslation } from "react-i18next" import { useTranslation } from "react-i18next"
import { Link } from "react-router-dom" import { Link } from "react-router-dom"
import logoImage from "~/assets/icon.png" import logoImage from "~/assets/icon.png"
export const SidepanelSettingsHeader = () => { export const SidepanelSettingsHeader = () => {
const { t } = useTranslation("common") const { t , i18n} = useTranslation("common")
const isRTL = i18n?.dir() === "rtl"
return ( return (
<div className="flex px-3 justify-start gap-3 bg-white dark:bg-[#171717] border-b border-gray-300 dark:border-gray-700 py-4 items-center"> <div className="flex px-3 justify-start gap-3 bg-white dark:bg-[#171717] border-b border-gray-300 dark:border-gray-700 py-4 items-center">
<Link to="/"> <Link to="/">
<ChevronLeft className="h-5 w-5 text-gray-500 dark:text-gray-400" /> {
isRTL ? (
<ChevronRight className="h-5 w-5 text-gray-500" />
) : (
<ChevronLeft className="h-5 w-5 text-gray-500" />
)
}
</Link> </Link>
<div className="focus:outline-none focus-visible:ring-2 focus-visible:ring-pink-700 flex items-center dark:text-white"> <div className="focus:outline-none focus-visible:ring-2 focus-visible:ring-pink-700 flex items-center dark:text-white">
<img className="h-6 w-auto" src={logoImage} alt={t("pageAssist")} /> <img className="h-6 w-auto" src={logoImage} alt={t("pageAssist")} />

View File

@ -0,0 +1,267 @@
import { getOllamaURL, isOllamaRunning } from "../services/ollama"
import { browser } from "wxt/browser"
import { clearBadge, streamDownload } from "@/utils/pull-ollama"
export default defineBackground({
main() {
let isCopilotRunning: boolean = false
browser.runtime.onMessage.addListener(async (message) => {
if (message.type === "sidepanel") {
await browser.sidebarAction.open()
} else if (message.type === "pull_model") {
const ollamaURL = await getOllamaURL()
const isRunning = await isOllamaRunning()
if (!isRunning) {
setBadgeText({ text: "E" })
setBadgeBackgroundColor({ color: "#FF0000" })
setTitle({ title: "Ollama is not running" })
setTimeout(() => {
clearBadge()
}, 5000)
}
await streamDownload(ollamaURL, message.modelName)
}
})
browser.runtime.onConnect.addListener((port) => {
if (port.name === "pgCopilot") {
isCopilotRunning = true
port.onDisconnect.addListener(() => {
isCopilotRunning = false
})
}
})
if (import.meta.env.BROWSER === "chrome") {
chrome.action.onClicked.addListener((tab) => {
chrome.tabs.create({ url: chrome.runtime.getURL("/options.html") })
})
} else {
browser.browserAction.onClicked.addListener((tab) => {
console.log("browser.browserAction.onClicked.addListener")
browser.tabs.create({ url: browser.runtime.getURL("/options.html") })
})
}
const contextMenuTitle = {
webUi: browser.i18n.getMessage("openOptionToChat"),
sidePanel: browser.i18n.getMessage("openSidePanelToChat")
}
const contextMenuId = {
webUi: "open-web-ui-pa",
sidePanel: "open-side-panel-pa"
}
browser.contextMenus.create({
id: contextMenuId["sidePanel"],
title: contextMenuTitle["sidePanel"],
contexts: ["page", "selection"]
})
browser.contextMenus.create({
id: "summarize-pa",
title: browser.i18n.getMessage("contextSummarize"),
contexts: ["selection"]
})
browser.contextMenus.create({
id: "explain-pa",
title: browser.i18n.getMessage("contextExplain"),
contexts: ["selection"]
})
browser.contextMenus.create({
id: "rephrase-pa",
title: browser.i18n.getMessage("contextRephrase"),
contexts: ["selection"]
})
browser.contextMenus.create({
id: "translate-pg",
title: browser.i18n.getMessage("contextTranslate"),
contexts: ["selection"]
})
browser.contextMenus.create({
id: "custom-pg",
title: browser.i18n.getMessage("contextCustom"),
contexts: ["selection"]
})
if (import.meta.env.BROWSER === "chrome") {
browser.contextMenus.onClicked.addListener(async (info, tab) => {
if (info.menuItemId === "open-side-panel-pa") {
chrome.sidePanel.open({
tabId: tab.id!
})
} else if (info.menuItemId === "open-web-ui-pa") {
browser.tabs.create({
url: browser.runtime.getURL("/options.html")
})
} else if (info.menuItemId === "summarize-pa") {
chrome.sidePanel.open({
tabId: tab.id!
})
// this is a bad method hope somone can fix it :)
setTimeout(async () => {
await browser.runtime.sendMessage({
from: "background",
type: "summary",
text: info.selectionText
})
}, isCopilotRunning ? 0 : 5000)
} else if (info.menuItemId === "rephrase-pa") {
chrome.sidePanel.open({
tabId: tab.id!
})
setTimeout(async () => {
await browser.runtime.sendMessage({
type: "rephrase",
from: "background",
text: info.selectionText
})
}, isCopilotRunning ? 0 : 5000)
} else if (info.menuItemId === "translate-pg") {
chrome.sidePanel.open({
tabId: tab.id!
})
setTimeout(async () => {
await browser.runtime.sendMessage({
type: "translate",
from: "background",
text: info.selectionText
})
}, isCopilotRunning ? 0 : 5000)
} else if (info.menuItemId === "explain-pa") {
chrome.sidePanel.open({
tabId: tab.id!
})
setTimeout(async () => {
await browser.runtime.sendMessage({
type: "explain",
from: "background",
text: info.selectionText
})
}, isCopilotRunning ? 0 : 5000)
} else if (info.menuItemId === "custom-pg") {
chrome.sidePanel.open({
tabId: tab.id!
})
setTimeout(async () => {
await browser.runtime.sendMessage({
type: "custom",
from: "background",
text: info.selectionText
})
}, isCopilotRunning ? 0 : 5000)
}
})
browser.commands.onCommand.addListener((command) => {
switch (command) {
case "execute_side_panel":
chrome.tabs.query(
{ active: true, currentWindow: true },
async (tabs) => {
const tab = tabs[0]
chrome.sidePanel.open({
tabId: tab.id!
})
}
)
break
default:
break
}
})
}
if (import.meta.env.BROWSER === "firefox") {
browser.contextMenus.onClicked.addListener((info, tab) => {
if (info.menuItemId === "open-side-panel-pa") {
browser.sidebarAction.toggle()
} else if (info.menuItemId === "open-web-ui-pa") {
browser.tabs.create({
url: browser.runtime.getURL("/options.html")
})
} else if (info.menuItemId === "summarize-pa") {
if (!isCopilotRunning) {
browser.sidebarAction.toggle()
}
setTimeout(async () => {
await browser.runtime.sendMessage({
from: "background",
type: "summary",
text: info.selectionText
})
}, isCopilotRunning ? 0 : 5000)
} else if (info.menuItemId === "rephrase-pa") {
if (!isCopilotRunning) {
browser.sidebarAction.toggle()
}
setTimeout(async () => {
await browser.runtime.sendMessage({
type: "rephrase",
from: "background",
text: info.selectionText
})
}, isCopilotRunning ? 0 : 5000)
} else if (info.menuItemId === "translate-pg") {
if (!isCopilotRunning) {
browser.sidebarAction.toggle()
}
setTimeout(async () => {
await browser.runtime.sendMessage({
type: "translate",
from: "background",
text: info.selectionText
})
}, isCopilotRunning ? 0 : 5000)
} else if (info.menuItemId === "explain-pa") {
if (!isCopilotRunning) {
browser.sidebarAction.toggle()
}
setTimeout(async () => {
await browser.runtime.sendMessage({
type: "explain",
from: "background",
text: info.selectionText
})
}, isCopilotRunning ? 0 : 5000)
} else if (info.menuItemId === "custom-pg") {
if (!isCopilotRunning) {
browser.sidebarAction.toggle()
}
setTimeout(async () => {
await browser.runtime.sendMessage({
type: "custom",
from: "background",
text: info.selectionText
})
}, isCopilotRunning ? 0 : 5000)
}
})
browser.commands.onCommand.addListener((command) => {
switch (command) {
case "execute_side_panel":
browser.sidebarAction.toggle()
break
default:
break
}
})
}
},
persistent: true
})

View File

@ -0,0 +1,95 @@
export default defineContentScript({
main(ctx) {
const downloadModel = async (modelName: string) => {
const ok = confirm(
`[Page Assist Extension] Do you want to pull the ${modelName} model? This has nothing to do with the huggingface.co website. The model will be pulled locally once you confirm. Make sure Ollama is running.`
)
if (ok) {
alert(
`[Page Assist Extension] Pulling ${modelName} model. For more details, check the extension icon.`
)
await browser.runtime.sendMessage({
type: "pull_model",
modelName
})
return true
}
return false
}
const downloadSVG = `
<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24" width="16" height="16">
<path d="M12 16l-6-6h4V4h4v6h4l-6 6z"/>
<path d="M4 20h16v-2H4v2z"/>
</svg>
`
const injectDownloadButton = (modal: HTMLElement) => {
const copyButton = modal.querySelector(
'button[title="Copy snippet to clipboard"]'
)
if (copyButton && !modal.querySelector(".pageassist-download-button")) {
const downloadButton = copyButton.cloneNode(true) as HTMLElement
downloadButton.classList.add("pageassist-download-button")
downloadButton.querySelector("svg")!.outerHTML = downloadSVG
downloadButton.querySelector("span")!.textContent =
"Pull from Page Assist"
downloadButton.addEventListener("click", async () => {
const preElement = modal.querySelector("pre")
if (preElement) {
let modelCommand = ""
preElement.childNodes.forEach((node) => {
if (node.nodeType === Node.TEXT_NODE) {
modelCommand += node.textContent
} else if (node instanceof HTMLSelectElement) {
modelCommand += node.value
} else if (node instanceof HTMLElement) {
const selectElement = node.querySelector(
"select"
) as HTMLSelectElement
if (selectElement) {
modelCommand += selectElement.value
} else {
modelCommand += node.textContent
}
}
})
modelCommand = modelCommand.trim()
await downloadModel(
modelCommand
?.replaceAll("ollama run", "")
?.replaceAll("ollama pull", "")
?.trim()
)
}
})
const buttonContainer = document.createElement('div')
buttonContainer.classList.add("mb-3")
buttonContainer.style.display = 'flex'
buttonContainer.style.justifyContent = 'flex-end'
buttonContainer.appendChild(downloadButton)
modal.querySelector("pre")!.insertAdjacentElement("afterend", buttonContainer)
}
}
const observer = new MutationObserver((mutations) => {
for (const mutation of mutations) {
mutation.addedNodes.forEach((node) => {
if (node instanceof HTMLElement) {
const modal = node.querySelector(".shadow-alternate") as HTMLElement
if (modal) {
injectDownloadButton(modal)
}
}
})
}
})
observer.observe(document.body, { childList: true, subtree: true })
},
allFrames: true,
matches: ["*://huggingface.co/*"]
})

View File

@ -0,0 +1,57 @@
export default defineContentScript({
main(ctx) {
const downloadModel = async (modelName: string) => {
const ok = confirm(
`[Page Assist Extension] Do you want to pull ${modelName} model? This has nothing to do with Ollama.com website. The model will be pulled locally once you confirm.`
)
if (ok) {
alert(
`[Page Assist Extension] Pulling ${modelName} model. For more details, check the extension icon.`
)
await browser.runtime.sendMessage({
type: "pull_model",
modelName
})
return true
}
return false
}
const downloadSVG = `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="h-5 w-5 pageasssist-icon">
<path stroke-linecap="round" stroke-linejoin="round" d="M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3" />
</svg>
`
const codeDiv = document.querySelectorAll("div.language-none")
for (let i = 0; i < codeDiv.length; i++) {
const button = codeDiv[i].querySelector("button")
const command = codeDiv[i].querySelector("input")
if (button && command) {
const newButton = document.createElement("button")
newButton.innerHTML = downloadSVG
newButton.className = `border-l ${button.className}`
newButton.id = `download-${i}-pageassist`
const modelName = command?.value
.replace("ollama run", "")
.replace("ollama pull", "")
.trim()
newButton.addEventListener("click", () => {
downloadModel(modelName)
})
const span = document.createElement("span")
span.title = "Download model via Page Assist"
span.appendChild(newButton)
if (button.parentNode) {
button.parentNode.appendChild(span)
}
}
}
},
allFrames: true,
matches: ["*://ollama.com/*"],
})

View File

@ -0,0 +1,57 @@
import { QueryClient, QueryClientProvider } from "@tanstack/react-query"
import { MemoryRouter } from "react-router-dom"
import { useEffect, useState } from "react"
const queryClient = new QueryClient()
import { ConfigProvider, Empty, theme } from "antd"
import { StyleProvider } from "@ant-design/cssinjs"
import { useDarkMode } from "~/hooks/useDarkmode"
import { OptionRouting } from "@/routes/firefox-route"
import "~/i18n"
import { useTranslation } from "react-i18next"
import { PageAssistProvider } from "@/components/Common/PageAssistProvider"
function IndexOption() {
const { mode } = useDarkMode()
const { t, i18n } = useTranslation()
const [direction, setDirection] = useState<"ltr" | "rtl">("ltr")
useEffect(() => {
if (i18n.resolvedLanguage) {
document.documentElement.lang = i18n.resolvedLanguage
document.documentElement.dir = i18n.dir(i18n.resolvedLanguage)
setDirection(i18n.dir(i18n.resolvedLanguage))
}
}, [i18n, i18n.resolvedLanguage])
return (
<MemoryRouter>
<ConfigProvider
theme={{
algorithm:
mode === "dark" ? theme.darkAlgorithm : theme.defaultAlgorithm,
token: {
fontFamily: "Arimo"
}
}}
renderEmpty={() => (
<Empty
imageStyle={{
height: 60
}}
description={t("common:noData")}
/>
)}
direction={direction}>
<StyleProvider hashPriority="high">
<QueryClientProvider client={queryClient}>
<PageAssistProvider>
<OptionRouting />
</PageAssistProvider>
</QueryClientProvider>
</StyleProvider>
</ConfigProvider>
</MemoryRouter>
)
}
export default IndexOption

View File

@ -0,0 +1,15 @@
<!doctype html>
<html>
<head>
<title>Page Assist - A Web UI for Local AI Models</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="manifest.type" content="browser_action" />
<meta name="manifest.browser_style" content="false" />
<link href="~/assets/tailwind.css" rel="stylesheet" />
<meta charset="utf-8" />
</head>
<body class="bg-white dark:bg-[#171717]">
<div id="root"></div>
<script type="module" src="./main.tsx"></script>
</body>
</html>

View File

@ -0,0 +1,10 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import IndexOption from './App';
ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>
<IndexOption />
</React.StrictMode>,
);

View File

@ -0,0 +1,54 @@
import { QueryClient, QueryClientProvider } from "@tanstack/react-query"
import { MemoryRouter } from "react-router-dom"
import { useEffect } from "react"
import { SidepanelRouting } from "@/routes/firefox-route"
const queryClient = new QueryClient()
import { ConfigProvider, Empty, theme } from "antd"
import { StyleProvider } from "@ant-design/cssinjs"
import { useDarkMode } from "~/hooks/useDarkmode"
import "~/i18n"
import { useTranslation } from "react-i18next"
import { PageAssistProvider } from "@/components/Common/PageAssistProvider"
function IndexSidepanel() {
const { mode } = useDarkMode()
const { t, i18n } = useTranslation()
useEffect(() => {
if (i18n.resolvedLanguage) {
document.documentElement.lang = i18n.resolvedLanguage;
document.documentElement.dir = i18n.dir(i18n.resolvedLanguage);
}
}, [i18n, i18n.resolvedLanguage]);
return (
<MemoryRouter>
<ConfigProvider
theme={{
algorithm:
mode === "dark" ? theme.darkAlgorithm : theme.defaultAlgorithm,
token: {
fontFamily: "Arimo"
}
}}
renderEmpty={() => (
<Empty
imageStyle={{
height: 60
}}
description={t("common:noData")}
/>
)}>
<StyleProvider hashPriority="high">
<QueryClientProvider client={queryClient}>
<PageAssistProvider>
<SidepanelRouting />
</PageAssistProvider>
</QueryClientProvider>
</StyleProvider>
</ConfigProvider>
</MemoryRouter>
)
}
export default IndexSidepanel

View File

@ -0,0 +1,16 @@
<!doctype html>
<html>
<head>
<title>Page Assist - A Web UI for Local AI Models</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="manifest.type" content="browser_action" />
<meta name="manifest.open_at_install" content="false" />
<meta name="manifest.browser_style" content="false" />
<link href="~/assets/tailwind.css" rel="stylesheet" />
<meta charset="utf-8" />
</head>
<body class="bg-white dark:bg-[#171717]">
<div id="root"></div>
<script type="module" src="./main.tsx"></script>
</body>
</html>

View File

@ -0,0 +1,9 @@
import React from "react"
import ReactDOM from "react-dom/client"
import IndexSidepanel from "./App"
ReactDOM.createRoot(document.getElementById("root")!).render(
<React.StrictMode>
<IndexSidepanel />
</React.StrictMode>
)

View File

@ -5,7 +5,7 @@ const queryClient = new QueryClient()
import { ConfigProvider, Empty, theme } from "antd" import { ConfigProvider, Empty, theme } from "antd"
import { StyleProvider } from "@ant-design/cssinjs" import { StyleProvider } from "@ant-design/cssinjs"
import { useDarkMode } from "~/hooks/useDarkmode" import { useDarkMode } from "~/hooks/useDarkmode"
import { OptionRouting } from "~/routes" import { OptionRouting } from "@/routes/chrome-route"
import "~/i18n" import "~/i18n"
import { useTranslation } from "react-i18next" import { useTranslation } from "react-i18next"
import { PageAssistProvider } from "@/components/Common/PageAssistProvider" import { PageAssistProvider } from "@/components/Common/PageAssistProvider"

View File

@ -1,7 +1,7 @@
import { QueryClient, QueryClientProvider } from "@tanstack/react-query" import { QueryClient, QueryClientProvider } from "@tanstack/react-query"
import { MemoryRouter } from "react-router-dom" import { MemoryRouter } from "react-router-dom"
import { useEffect } from "react" import { useEffect } from "react"
import { SidepanelRouting } from "~/routes" import { SidepanelRouting } from "@/routes/chrome-route"
const queryClient = new QueryClient() const queryClient = new QueryClient()
import { ConfigProvider, Empty, theme } from "antd" import { ConfigProvider, Empty, theme } from "antd"
import { StyleProvider } from "@ant-design/cssinjs" import { StyleProvider } from "@ant-design/cssinjs"

View File

@ -84,7 +84,9 @@ export const useMessage = () => {
selectedQuickPrompt, selectedQuickPrompt,
setSelectedQuickPrompt, setSelectedQuickPrompt,
selectedSystemPrompt, selectedSystemPrompt,
setSelectedSystemPrompt setSelectedSystemPrompt,
useOCR,
setUseOCR
} = useStoreMessage() } = useStoreMessage()
const [speechToTextLanguage, setSpeechToTextLanguage] = useStorage( const [speechToTextLanguage, setSpeechToTextLanguage] = useStorage(
@ -141,7 +143,14 @@ export const useMessage = () => {
currentChatModelSettings?.numPredict ?? currentChatModelSettings?.numPredict ??
userDefaultModelSettings?.numPredict, userDefaultModelSettings?.numPredict,
useMMap: useMMap:
currentChatModelSettings?.useMMap ?? userDefaultModelSettings?.useMMap currentChatModelSettings?.useMMap ?? userDefaultModelSettings?.useMMap,
minP: currentChatModelSettings?.minP ?? userDefaultModelSettings?.minP,
repeatLastN:
currentChatModelSettings?.repeatLastN ??
userDefaultModelSettings?.repeatLastN,
repeatPenalty:
currentChatModelSettings?.repeatPenalty ??
userDefaultModelSettings?.repeatPenalty
}) })
let newMessage: Message[] = [] let newMessage: Message[] = []
@ -276,7 +285,15 @@ export const useMessage = () => {
userDefaultModelSettings?.numPredict, userDefaultModelSettings?.numPredict,
useMMap: useMMap:
currentChatModelSettings?.useMMap ?? currentChatModelSettings?.useMMap ??
userDefaultModelSettings?.useMMap userDefaultModelSettings?.useMMap,
minP:
currentChatModelSettings?.minP ?? userDefaultModelSettings?.minP,
repeatLastN:
currentChatModelSettings?.repeatLastN ??
userDefaultModelSettings?.repeatLastN,
repeatPenalty:
currentChatModelSettings?.repeatPenalty ??
userDefaultModelSettings?.repeatPenalty
}) })
const response = await questionOllama.invoke(promptForQuestion) const response = await questionOllama.invoke(promptForQuestion)
query = response.content.toString() query = response.content.toString()
@ -329,7 +346,7 @@ export const useMessage = () => {
] ]
} }
let humanMessage = humanMessageFormatter({ let humanMessage = await humanMessageFormatter({
content: [ content: [
{ {
text: systemPrompt text: systemPrompt
@ -338,7 +355,8 @@ export const useMessage = () => {
type: "text" type: "text"
} }
], ],
model: selectedModel model: selectedModel,
useOCR
}) })
const applicationChatHistory = generateHistory(history, selectedModel) const applicationChatHistory = generateHistory(history, selectedModel)
@ -489,7 +507,14 @@ export const useMessage = () => {
currentChatModelSettings?.numPredict ?? currentChatModelSettings?.numPredict ??
userDefaultModelSettings?.numPredict, userDefaultModelSettings?.numPredict,
useMMap: useMMap:
currentChatModelSettings?.useMMap ?? userDefaultModelSettings?.useMMap currentChatModelSettings?.useMMap ?? userDefaultModelSettings?.useMMap,
minP: currentChatModelSettings?.minP ?? userDefaultModelSettings?.minP,
repeatLastN:
currentChatModelSettings?.repeatLastN ??
userDefaultModelSettings?.repeatLastN,
repeatPenalty:
currentChatModelSettings?.repeatPenalty ??
userDefaultModelSettings?.repeatPenalty
}) })
let newMessage: Message[] = [] let newMessage: Message[] = []
@ -564,7 +589,7 @@ export const useMessage = () => {
) )
} }
let humanMessage = humanMessageFormatter({ let humanMessage = await humanMessageFormatter({
content: [ content: [
{ {
text: message, text: message,
@ -575,7 +600,8 @@ export const useMessage = () => {
type: "image_url" type: "image_url"
} }
], ],
model: selectedModel model: selectedModel,
useOCR
}) })
let generationInfo: any | undefined = undefined let generationInfo: any | undefined = undefined
@ -725,7 +751,14 @@ export const useMessage = () => {
currentChatModelSettings?.numPredict ?? currentChatModelSettings?.numPredict ??
userDefaultModelSettings?.numPredict, userDefaultModelSettings?.numPredict,
useMMap: useMMap:
currentChatModelSettings?.useMMap ?? userDefaultModelSettings?.useMMap currentChatModelSettings?.useMMap ?? userDefaultModelSettings?.useMMap,
minP: currentChatModelSettings?.minP ?? userDefaultModelSettings?.minP,
repeatLastN:
currentChatModelSettings?.repeatLastN ??
userDefaultModelSettings?.repeatLastN,
repeatPenalty:
currentChatModelSettings?.repeatPenalty ??
userDefaultModelSettings?.repeatPenalty
}) })
let newMessage: Message[] = [] let newMessage: Message[] = []
@ -769,17 +802,18 @@ export const useMessage = () => {
const prompt = await systemPromptForNonRag() const prompt = await systemPromptForNonRag()
const selectedPrompt = await getPromptById(selectedSystemPrompt) const selectedPrompt = await getPromptById(selectedSystemPrompt)
let humanMessage = humanMessageFormatter({ let humanMessage = await humanMessageFormatter({
content: [ content: [
{ {
text: message, text: message,
type: "text" type: "text"
} }
], ],
model: selectedModel model: selectedModel,
useOCR
}) })
if (image.length > 0) { if (image.length > 0) {
humanMessage = humanMessageFormatter({ humanMessage = await humanMessageFormatter({
content: [ content: [
{ {
text: message, text: message,
@ -790,7 +824,8 @@ export const useMessage = () => {
type: "image_url" type: "image_url"
} }
], ],
model: selectedModel model: selectedModel,
useOCR
}) })
} }
@ -955,7 +990,14 @@ export const useMessage = () => {
currentChatModelSettings?.numPredict ?? currentChatModelSettings?.numPredict ??
userDefaultModelSettings?.numPredict, userDefaultModelSettings?.numPredict,
useMMap: useMMap:
currentChatModelSettings?.useMMap ?? userDefaultModelSettings?.useMMap currentChatModelSettings?.useMMap ?? userDefaultModelSettings?.useMMap,
minP: currentChatModelSettings?.minP ?? userDefaultModelSettings?.minP,
repeatLastN:
currentChatModelSettings?.repeatLastN ??
userDefaultModelSettings?.repeatLastN,
repeatPenalty:
currentChatModelSettings?.repeatPenalty ??
userDefaultModelSettings?.repeatPenalty
}) })
let newMessage: Message[] = [] let newMessage: Message[] = []
@ -1037,7 +1079,15 @@ export const useMessage = () => {
userDefaultModelSettings?.numPredict, userDefaultModelSettings?.numPredict,
useMMap: useMMap:
currentChatModelSettings?.useMMap ?? currentChatModelSettings?.useMMap ??
userDefaultModelSettings?.useMMap userDefaultModelSettings?.useMMap,
minP:
currentChatModelSettings?.minP ?? userDefaultModelSettings?.minP,
repeatLastN:
currentChatModelSettings?.repeatLastN ??
userDefaultModelSettings?.repeatLastN,
repeatPenalty:
currentChatModelSettings?.repeatPenalty ??
userDefaultModelSettings?.repeatPenalty
}) })
const response = await questionOllama.invoke(promptForQuestion) const response = await questionOllama.invoke(promptForQuestion)
query = response.content.toString() query = response.content.toString()
@ -1048,17 +1098,18 @@ export const useMessage = () => {
// message = message.trim().replaceAll("\n", " ") // message = message.trim().replaceAll("\n", " ")
let humanMessage = humanMessageFormatter({ let humanMessage = await humanMessageFormatter({
content: [ content: [
{ {
text: message, text: message,
type: "text" type: "text"
} }
], ],
model: selectedModel model: selectedModel,
useOCR
}) })
if (image.length > 0) { if (image.length > 0) {
humanMessage = humanMessageFormatter({ humanMessage = await humanMessageFormatter({
content: [ content: [
{ {
text: message, text: message,
@ -1069,7 +1120,8 @@ export const useMessage = () => {
type: "image_url" type: "image_url"
} }
], ],
model: selectedModel model: selectedModel,
useOCR
}) })
} }
@ -1227,7 +1279,14 @@ export const useMessage = () => {
currentChatModelSettings?.numPredict ?? currentChatModelSettings?.numPredict ??
userDefaultModelSettings?.numPredict, userDefaultModelSettings?.numPredict,
useMMap: useMMap:
currentChatModelSettings?.useMMap ?? userDefaultModelSettings?.useMMap currentChatModelSettings?.useMMap ?? userDefaultModelSettings?.useMMap,
minP: currentChatModelSettings?.minP ?? userDefaultModelSettings?.minP,
repeatLastN:
currentChatModelSettings?.repeatLastN ??
userDefaultModelSettings?.repeatLastN,
repeatPenalty:
currentChatModelSettings?.repeatPenalty ??
userDefaultModelSettings?.repeatPenalty
}) })
let newMessage: Message[] = [] let newMessage: Message[] = []
@ -1270,17 +1329,18 @@ export const useMessage = () => {
try { try {
const prompt = await getPrompt(messageType) const prompt = await getPrompt(messageType)
let humanMessage = humanMessageFormatter({ let humanMessage = await humanMessageFormatter({
content: [ content: [
{ {
text: prompt.replace("{text}", message), text: prompt.replace("{text}", message),
type: "text" type: "text"
} }
], ],
model: selectedModel model: selectedModel,
useOCR
}) })
if (image.length > 0) { if (image.length > 0) {
humanMessage = humanMessageFormatter({ humanMessage = await humanMessageFormatter({
content: [ content: [
{ {
text: prompt.replace("{text}", message), text: prompt.replace("{text}", message),
@ -1291,7 +1351,8 @@ export const useMessage = () => {
type: "image_url" type: "image_url"
} }
], ],
model: selectedModel model: selectedModel,
useOCR
}) })
} }
@ -1590,6 +1651,8 @@ export const useMessage = () => {
selectedSystemPrompt, selectedSystemPrompt,
setSelectedSystemPrompt, setSelectedSystemPrompt,
speechToTextLanguage, speechToTextLanguage,
setSpeechToTextLanguage setSpeechToTextLanguage,
useOCR,
setUseOCR
} }
} }

View File

@ -70,7 +70,9 @@ export const useMessageOption = () => {
selectedKnowledge, selectedKnowledge,
setSelectedKnowledge, setSelectedKnowledge,
temporaryChat, temporaryChat,
setTemporaryChat setTemporaryChat,
useOCR,
setUseOCR
} = useStoreMessageOption() } = useStoreMessageOption()
const currentChatModelSettings = useStoreChatModelSettings() const currentChatModelSettings = useStoreChatModelSettings()
const [selectedModel, setSelectedModel] = useStorage("selectedModel") const [selectedModel, setSelectedModel] = useStorage("selectedModel")
@ -132,7 +134,14 @@ export const useMessageOption = () => {
currentChatModelSettings?.numPredict ?? currentChatModelSettings?.numPredict ??
userDefaultModelSettings?.numPredict, userDefaultModelSettings?.numPredict,
useMMap: useMMap:
currentChatModelSettings?.useMMap ?? userDefaultModelSettings?.useMMap currentChatModelSettings?.useMMap ?? userDefaultModelSettings?.useMMap,
minP: currentChatModelSettings?.minP ?? userDefaultModelSettings?.minP,
repeatLastN:
currentChatModelSettings?.repeatLastN ??
userDefaultModelSettings?.repeatLastN,
repeatPenalty:
currentChatModelSettings?.repeatPenalty ??
userDefaultModelSettings?.repeatPenalty
}) })
let newMessage: Message[] = [] let newMessage: Message[] = []
@ -214,7 +223,15 @@ export const useMessageOption = () => {
userDefaultModelSettings?.numPredict, userDefaultModelSettings?.numPredict,
useMMap: useMMap:
currentChatModelSettings?.useMMap ?? currentChatModelSettings?.useMMap ??
userDefaultModelSettings?.useMMap userDefaultModelSettings?.useMMap,
minP:
currentChatModelSettings?.minP ?? userDefaultModelSettings?.minP,
repeatLastN:
currentChatModelSettings?.repeatLastN ??
userDefaultModelSettings?.repeatLastN,
repeatPenalty:
currentChatModelSettings?.repeatPenalty ??
userDefaultModelSettings?.repeatPenalty
}) })
const response = await questionOllama.invoke(promptForQuestion) const response = await questionOllama.invoke(promptForQuestion)
query = response.content.toString() query = response.content.toString()
@ -225,17 +242,18 @@ export const useMessageOption = () => {
// message = message.trim().replaceAll("\n", " ") // message = message.trim().replaceAll("\n", " ")
let humanMessage = humanMessageFormatter({ let humanMessage = await humanMessageFormatter({
content: [ content: [
{ {
text: message, text: message,
type: "text" type: "text"
} }
], ],
model: selectedModel model: selectedModel,
useOCR: useOCR
}) })
if (image.length > 0) { if (image.length > 0) {
humanMessage = humanMessageFormatter({ humanMessage = await humanMessageFormatter({
content: [ content: [
{ {
text: message, text: message,
@ -246,7 +264,8 @@ export const useMessageOption = () => {
type: "image_url" type: "image_url"
} }
], ],
model: selectedModel model: selectedModel,
useOCR: useOCR
}) })
} }
@ -438,7 +457,14 @@ export const useMessageOption = () => {
currentChatModelSettings?.numPredict ?? currentChatModelSettings?.numPredict ??
userDefaultModelSettings?.numPredict, userDefaultModelSettings?.numPredict,
useMMap: useMMap:
currentChatModelSettings?.useMMap ?? userDefaultModelSettings?.useMMap currentChatModelSettings?.useMMap ?? userDefaultModelSettings?.useMMap,
minP: currentChatModelSettings?.minP ?? userDefaultModelSettings?.minP,
repeatLastN:
currentChatModelSettings?.repeatLastN ??
userDefaultModelSettings?.repeatLastN,
repeatPenalty:
currentChatModelSettings?.repeatPenalty ??
userDefaultModelSettings?.repeatPenalty
}) })
let newMessage: Message[] = [] let newMessage: Message[] = []
@ -482,17 +508,18 @@ export const useMessageOption = () => {
const prompt = await systemPromptForNonRagOption() const prompt = await systemPromptForNonRagOption()
const selectedPrompt = await getPromptById(selectedSystemPrompt) const selectedPrompt = await getPromptById(selectedSystemPrompt)
let humanMessage = humanMessageFormatter({ let humanMessage = await humanMessageFormatter({
content: [ content: [
{ {
text: message, text: message,
type: "text" type: "text"
} }
], ],
model: selectedModel model: selectedModel,
useOCR: useOCR
}) })
if (image.length > 0) { if (image.length > 0) {
humanMessage = humanMessageFormatter({ humanMessage = await humanMessageFormatter({
content: [ content: [
{ {
text: message, text: message,
@ -503,7 +530,8 @@ export const useMessageOption = () => {
type: "image_url" type: "image_url"
} }
], ],
model: selectedModel model: selectedModel,
useOCR: useOCR
}) })
} }
@ -684,7 +712,14 @@ export const useMessageOption = () => {
currentChatModelSettings?.numPredict ?? currentChatModelSettings?.numPredict ??
userDefaultModelSettings?.numPredict, userDefaultModelSettings?.numPredict,
useMMap: useMMap:
currentChatModelSettings?.useMMap ?? userDefaultModelSettings?.useMMap currentChatModelSettings?.useMMap ?? userDefaultModelSettings?.useMMap,
minP: currentChatModelSettings?.minP ?? userDefaultModelSettings?.minP,
repeatLastN:
currentChatModelSettings?.repeatLastN ??
userDefaultModelSettings?.repeatLastN,
repeatPenalty:
currentChatModelSettings?.repeatPenalty ??
userDefaultModelSettings?.repeatPenalty
}) })
let newMessage: Message[] = [] let newMessage: Message[] = []
@ -782,7 +817,15 @@ export const useMessageOption = () => {
userDefaultModelSettings?.numPredict, userDefaultModelSettings?.numPredict,
useMMap: useMMap:
currentChatModelSettings?.useMMap ?? currentChatModelSettings?.useMMap ??
userDefaultModelSettings?.useMMap userDefaultModelSettings?.useMMap,
minP:
currentChatModelSettings?.minP ?? userDefaultModelSettings?.minP,
repeatLastN:
currentChatModelSettings?.repeatLastN ??
userDefaultModelSettings?.repeatLastN,
repeatPenalty:
currentChatModelSettings?.repeatPenalty ??
userDefaultModelSettings?.repeatPenalty
}) })
const response = await questionOllama.invoke(promptForQuestion) const response = await questionOllama.invoke(promptForQuestion)
query = response.content.toString() query = response.content.toString()
@ -802,7 +845,7 @@ export const useMessageOption = () => {
}) })
// message = message.trim().replaceAll("\n", " ") // message = message.trim().replaceAll("\n", " ")
let humanMessage = humanMessageFormatter({ let humanMessage = await humanMessageFormatter({
content: [ content: [
{ {
text: systemPrompt text: systemPrompt
@ -811,7 +854,8 @@ export const useMessageOption = () => {
type: "text" type: "text"
} }
], ],
model: selectedModel model: selectedModel,
useOCR: useOCR
}) })
const applicationChatHistory = generateHistory(history, selectedModel) const applicationChatHistory = generateHistory(history, selectedModel)
@ -1106,6 +1150,8 @@ export const useMessageOption = () => {
setSelectedKnowledge, setSelectedKnowledge,
ttsEnabled, ttsEnabled,
temporaryChat, temporaryChat,
setTemporaryChat setTemporaryChat,
useOCR,
setUseOCR
} }
} }

View File

@ -1,44 +1,101 @@
import { useEffect, useState } from "react" import { useEffect, useState } from "react"
import { notification } from "antd" import { notification } from "antd"
import { getVoice, isSSMLEnabled } from "@/services/tts" import {
getElevenLabsApiKey,
getElevenLabsModel,
getElevenLabsVoiceId,
getTTSProvider,
getVoice,
isSSMLEnabled
} from "@/services/tts"
import { markdownToSSML } from "@/utils/markdown-to-ssml" import { markdownToSSML } from "@/utils/markdown-to-ssml"
type VoiceOptions = { import { generateSpeech } from "@/services/elevenlabs"
import { splitMessageContent } from "@/utils/tts"
export interface VoiceOptions {
utterance: string utterance: string
} }
export const useTTS = () => { export const useTTS = () => {
const [isSpeaking, setIsSpeaking] = useState(false) const [isSpeaking, setIsSpeaking] = useState(false)
const [audioElement, setAudioElement] = useState<HTMLAudioElement | null>(
null
)
const speak = async ({ utterance }: VoiceOptions) => { const speak = async ({ utterance }: VoiceOptions) => {
try { try {
const voice = await getVoice() const voice = await getVoice()
const isSSML = await isSSMLEnabled() const provider = await getTTSProvider()
if (isSSML) {
utterance = markdownToSSML(utterance) if (provider === "browser") {
} const isSSML = await isSSMLEnabled()
if (import.meta.env.BROWSER === "chrome") { if (isSSML) {
chrome.tts.speak(utterance, { utterance = markdownToSSML(utterance)
voiceName: voice,
onEvent(event) {
if (event.type === "start") {
setIsSpeaking(true)
} else if (event.type === "end") {
setIsSpeaking(false)
}
}
})
} else {
// browser tts
window.speechSynthesis.speak(new SpeechSynthesisUtterance(utterance))
window.speechSynthesis.onvoiceschanged = () => {
const voices = window.speechSynthesis.getVoices()
const voice = voices.find((v) => v.name === voice)
const utter = new SpeechSynthesisUtterance(utterance)
utter.voice = voice
window.speechSynthesis.speak(utter)
} }
if (import.meta.env.BROWSER === "chrome") {
chrome.tts.speak(utterance, {
voiceName: voice,
onEvent(event) {
if (event.type === "start") {
setIsSpeaking(true)
} else if (event.type === "end") {
setIsSpeaking(false)
}
}
})
} else {
window.speechSynthesis.speak(new SpeechSynthesisUtterance(utterance))
window.speechSynthesis.onvoiceschanged = () => {
const voices = window.speechSynthesis.getVoices()
const voice = voices.find((v) => v.name === voice)
const utter = new SpeechSynthesisUtterance(utterance)
utter.voice = voice
window.speechSynthesis.speak(utter)
}
}
} else if (provider === "elevenlabs") {
const apiKey = await getElevenLabsApiKey()
const modelId = await getElevenLabsModel()
const voiceId = await getElevenLabsVoiceId()
const sentences = splitMessageContent(utterance)
let nextAudioData: ArrayBuffer | null = null
if (!apiKey || !modelId || !voiceId) {
throw new Error("Missing ElevenLabs configuration")
}
for (let i = 0; i < sentences.length; i++) {
setIsSpeaking(true)
let currentAudioData =
nextAudioData ||
(await generateSpeech(apiKey, sentences[i], voiceId, modelId))
if (i < sentences.length - 1) {
generateSpeech(apiKey, sentences[i + 1], voiceId, modelId)
.then((nextAudioData) => {
nextAudioData = nextAudioData
})
.catch(console.error)
}
const blob = new Blob([currentAudioData], { type: "audio/mpeg" })
const url = URL.createObjectURL(blob)
const audio = new Audio(url)
setAudioElement(audio)
await new Promise((resolve) => {
audio.onended = resolve
audio.play()
})
URL.revokeObjectURL(url)
}
setIsSpeaking(false)
setAudioElement(null)
} }
} catch (error) { } catch (error) {
setIsSpeaking(false)
setAudioElement(null)
notification.error({ notification.error({
message: "Error", message: "Error",
description: "Something went wrong while trying to play the audio" description: "Something went wrong while trying to play the audio"
@ -47,6 +104,14 @@ export const useTTS = () => {
} }
const cancel = () => { const cancel = () => {
if (audioElement) {
audioElement.pause()
audioElement.currentTime = 0
setAudioElement(null)
setIsSpeaking(false)
return
}
if (import.meta.env.BROWSER === "chrome") { if (import.meta.env.BROWSER === "chrome") {
chrome.tts.stop() chrome.tts.stop()
} else { } else {

View File

@ -16,6 +16,7 @@ import { da } from "./lang/da";
import { no } from "./lang/no"; import { no } from "./lang/no";
import { sv } from "./lang/sv"; import { sv } from "./lang/sv";
import { ko } from "./lang/ko"; import { ko } from "./lang/ko";
import { ar } from "./lang/ar"
i18n i18n
@ -43,6 +44,7 @@ i18n
de: de, de: de,
sv: sv, sv: sv,
ko: ko, ko: ko,
ar: ar
}, },
fallbackLng: "en", fallbackLng: "en",
lng: localStorage.getItem("i18nextLng") || "en", lng: localStorage.getItem("i18nextLng") || "en",

19
src/i18n/lang/ar.ts Normal file
View File

@ -0,0 +1,19 @@
import option from "@/assets/locale/ar/option.json";
import playground from "@/assets/locale/ar/playground.json";
import common from "@/assets/locale/ar/common.json";
import sidepanel from "@/assets/locale/ar/sidepanel.json";
import settings from "@/assets/locale/ar/settings.json";
import knowledge from "@/assets/locale/ar/knowledge.json";
import chrome from "@/assets/locale/ar/chrome.json";
import openai from "@/assets/locale/ar/openai.json";
export const ar = {
option,
playground,
common,
sidepanel,
settings,
knowledge,
chrome,
openai
}

View File

@ -63,5 +63,9 @@ export const supportLanguage = [
{ {
value: "ko", value: "ko",
label: "한국어" label: "한국어"
},
{
value: "ar",
label: "العربية"
} }
] ]

View File

@ -95,6 +95,8 @@ export class ChatOllama
topP?: number; topP?: number;
minP?: number;
typicalP?: number; typicalP?: number;
useMLock?: boolean; useMLock?: boolean;
@ -142,6 +144,7 @@ export class ChatOllama
this.tfsZ = fields.tfsZ; this.tfsZ = fields.tfsZ;
this.topK = fields.topK; this.topK = fields.topK;
this.topP = fields.topP; this.topP = fields.topP;
this.minP = fields.minP;
this.typicalP = fields.typicalP; this.typicalP = fields.typicalP;
this.useMLock = fields.useMLock; this.useMLock = fields.useMLock;
this.useMMap = fields.useMMap; this.useMMap = fields.useMMap;
@ -205,6 +208,7 @@ export class ChatOllama
tfs_z: this.tfsZ, tfs_z: this.tfsZ,
top_k: this.topK, top_k: this.topK,
top_p: this.topP, top_p: this.topP,
min_p: this.minP,
typical_p: this.typicalP, typical_p: this.typicalP,
use_mlock: this.useMLock, use_mlock: this.useMLock,
use_mmap: this.useMMap, use_mmap: this.useMMap,

View File

@ -17,7 +17,10 @@ export const pageAssistModel = async ({
seed, seed,
numGpu, numGpu,
numPredict, numPredict,
useMMap useMMap,
minP,
repeatLastN,
repeatPenalty
}: { }: {
model: string model: string
baseUrl: string baseUrl: string
@ -30,6 +33,9 @@ export const pageAssistModel = async ({
numGpu?: number numGpu?: number
numPredict?: number numPredict?: number
useMMap?: boolean useMMap?: boolean
minP?: number
repeatPenalty?: number
repeatLastN?: number
}) => { }) => {
if (model === "chrome::gemini-nano::page-assist") { if (model === "chrome::gemini-nano::page-assist") {
return new ChatChromeAI({ return new ChatChromeAI({
@ -86,6 +92,9 @@ export const pageAssistModel = async ({
model, model,
numGpu, numGpu,
numPredict, numPredict,
useMMap useMMap,
minP: minP,
repeatPenalty: repeatPenalty,
repeatLastN: repeatLastN,
}) })
} }

View File

@ -35,6 +35,7 @@ export interface OllamaInput {
tfsZ?: number tfsZ?: number
topK?: number topK?: number
topP?: number topP?: number
minP?: number
typicalP?: number typicalP?: number
useMLock?: boolean useMLock?: boolean
useMMap?: boolean useMMap?: boolean

Binary file not shown.

View File

@ -0,0 +1,281 @@
var TesseractCore = (() => {
var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;
if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename;
return (
function(TesseractCore) {
TesseractCore = TesseractCore || {};
var b;b||(b=typeof TesseractCore !== 'undefined' ? TesseractCore : {});var aa,ba;b.ready=new Promise(function(a,c){aa=a;ba=c});var ca=Object.assign({},b),da="./this.program",ea=(a,c)=>{throw c;},fa="object"==typeof window,ha="function"==typeof importScripts,ia="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,f="",ja,ka,la,fs,ma,na;
if(ia)f=ha?require("path").dirname(f)+"/":__dirname+"/",na=()=>{ma||(fs=require("fs"),ma=require("path"))},ja=function(a,c){na();a=ma.normalize(a);return fs.readFileSync(a,c?void 0:"utf8")},la=a=>{a=ja(a,!0);a.buffer||(a=new Uint8Array(a));return a},ka=(a,c,d)=>{na();a=ma.normalize(a);fs.readFile(a,function(e,g){e?d(e):c(g.buffer)})},1<process.argv.length&&(da=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),process.on("uncaughtException",function(a){if(!(a instanceof oa))throw a;}),process.on("unhandledRejection",
function(a){throw a;}),ea=(a,c)=>{if(noExitRuntime)throw process.exitCode=a,c;c instanceof oa||pa("exiting due to exception: "+c);process.exit(a)},b.inspect=function(){return"[Emscripten Module object]"};else if(fa||ha)ha?f=self.location.href:"undefined"!=typeof document&&document.currentScript&&(f=document.currentScript.src),_scriptDir&&(f=_scriptDir),0!==f.indexOf("blob:")?f=f.substr(0,f.replace(/[?#].*/,"").lastIndexOf("/")+1):f="",ja=a=>{var c=new XMLHttpRequest;c.open("GET",a,!1);c.send(null);
return c.responseText},ha&&(la=a=>{var c=new XMLHttpRequest;c.open("GET",a,!1);c.responseType="arraybuffer";c.send(null);return new Uint8Array(c.response)}),ka=(a,c,d)=>{var e=new XMLHttpRequest;e.open("GET",a,!0);e.responseType="arraybuffer";e.onload=()=>{200==e.status||0==e.status&&e.response?c(e.response):d()};e.onerror=d;e.send(null)};var qa=b.print||console.log.bind(console),pa=b.printErr||console.warn.bind(console);Object.assign(b,ca);ca=null;b.thisProgram&&(da=b.thisProgram);b.quit&&(ea=b.quit);
var ra=0,sa;b.wasmBinary&&(sa=b.wasmBinary);var noExitRuntime=b.noExitRuntime||!0;"object"!=typeof WebAssembly&&n("no native wasm support detected");var ta,ua=!1,wa="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;
function xa(a,c){for(var d=c+NaN,e=c;a[e]&&!(e>=d);)++e;if(16<e-c&&a.buffer&&wa)return wa.decode(a.subarray(c,e));for(d="";c<e;){var g=a[c++];if(g&128){var h=a[c++]&63;if(192==(g&224))d+=String.fromCharCode((g&31)<<6|h);else{var k=a[c++]&63;g=224==(g&240)?(g&15)<<12|h<<6|k:(g&7)<<18|h<<12|k<<6|a[c++]&63;65536>g?d+=String.fromCharCode(g):(g-=65536,d+=String.fromCharCode(55296|g>>10,56320|g&1023))}}else d+=String.fromCharCode(g)}return d}function q(a){return a?xa(ya,a):""}
function za(a,c,d,e){if(!(0<e))return 0;var g=d;e=d+e-1;for(var h=0;h<a.length;++h){var k=a.charCodeAt(h);if(55296<=k&&57343>=k){var m=a.charCodeAt(++h);k=65536+((k&1023)<<10)|m&1023}if(127>=k){if(d>=e)break;c[d++]=k}else{if(2047>=k){if(d+1>=e)break;c[d++]=192|k>>6}else{if(65535>=k){if(d+2>=e)break;c[d++]=224|k>>12}else{if(d+3>=e)break;c[d++]=240|k>>18;c[d++]=128|k>>12&63}c[d++]=128|k>>6&63}c[d++]=128|k&63}}c[d]=0;return d-g}
function Aa(a){for(var c=0,d=0;d<a.length;++d){var e=a.charCodeAt(d);127>=e?c++:2047>=e?c+=2:55296<=e&&57343>=e?(c+=4,++d):c+=3}return c}var Ba,r,ya,Ca,v,y,Da,Ea;function Fa(){var a=ta.buffer;Ba=a;b.HEAP8=r=new Int8Array(a);b.HEAP16=Ca=new Int16Array(a);b.HEAP32=v=new Int32Array(a);b.HEAPU8=ya=new Uint8Array(a);b.HEAPU16=new Uint16Array(a);b.HEAPU32=y=new Uint32Array(a);b.HEAPF32=Da=new Float32Array(a);b.HEAPF64=Ea=new Float64Array(a)}var Ga,Ha=[],Ia=[],Ka=[],La=!1;
function Ma(){var a=b.preRun.shift();Ha.unshift(a)}var Na=0,Oa=null,Pa=null;function Qa(){Na++;b.monitorRunDependencies&&b.monitorRunDependencies(Na)}function Ra(){Na--;b.monitorRunDependencies&&b.monitorRunDependencies(Na);if(0==Na&&(null!==Oa&&(clearInterval(Oa),Oa=null),Pa)){var a=Pa;Pa=null;a()}}function n(a){if(b.onAbort)b.onAbort(a);a="Aborted("+a+")";pa(a);ua=!0;a=new WebAssembly.RuntimeError(a+". Build with -sASSERTIONS for more info.");ba(a);throw a;}
function Sa(){return z.startsWith("data:application/octet-stream;base64,")}var z;z="tesseract-core-simd.wasm";if(!Sa()){var Ta=z;z=b.locateFile?b.locateFile(Ta,f):f+Ta}function Ua(){var a=z;try{if(a==z&&sa)return new Uint8Array(sa);if(la)return la(a);throw"both async and sync fetching of the wasm failed";}catch(c){n(c)}}
function Va(){if(!sa&&(fa||ha)){if("function"==typeof fetch&&!z.startsWith("file://"))return fetch(z,{credentials:"same-origin"}).then(function(a){if(!a.ok)throw"failed to load wasm binary file at '"+z+"'";return a.arrayBuffer()}).catch(function(){return Ua()});if(ka)return new Promise(function(a,c){ka(z,function(d){a(new Uint8Array(d))},c)})}return Promise.resolve().then(function(){return Ua()})}
var A,C,Wa={627260:a=>{b.TesseractProgress&&b.TesseractProgress(a)},627329:a=>{b.TesseractProgress&&b.TesseractProgress(a)},627398:a=>{b.TesseractProgress&&b.TesseractProgress(a)}};function oa(a){this.name="ExitStatus";this.message="Program terminated with exit("+a+")";this.status=a}function Xa(a){for(;0<a.length;)a.shift()(b)}
function Ya(a,c="i8"){c.endsWith("*")&&(c="*");switch(c){case "i1":return r[a>>0];case "i8":return r[a>>0];case "i16":return Ca[a>>1];case "i32":return v[a>>2];case "i64":return v[a>>2];case "float":return Da[a>>2];case "double":return Ea[a>>3];case "*":return y[a>>2];default:n("invalid type for getValue: "+c)}return null}
function Za(a,c,d="i8"){d.endsWith("*")&&(d="*");switch(d){case "i1":r[a>>0]=c;break;case "i8":r[a>>0]=c;break;case "i16":Ca[a>>1]=c;break;case "i32":v[a>>2]=c;break;case "i64":C=[c>>>0,(A=c,1<=+Math.abs(A)?0<A?(Math.min(+Math.floor(A/4294967296),4294967295)|0)>>>0:~~+Math.ceil((A-+(~~A>>>0))/4294967296)>>>0:0)];v[a>>2]=C[0];v[a+4>>2]=C[1];break;case "float":Da[a>>2]=c;break;case "double":Ea[a>>3]=c;break;case "*":y[a>>2]=c;break;default:n("invalid type for setValue: "+d)}}
function $a(a){this.If=a-24;this.Ih=function(c){y[this.If+4>>2]=c};this.Eh=function(c){y[this.If+8>>2]=c};this.Fh=function(){v[this.If>>2]=0};this.Jg=function(){r[this.If+12>>0]=0};this.Hh=function(){r[this.If+13>>0]=0};this.rg=function(c,d){this.Vf();this.Ih(c);this.Eh(d);this.Fh();this.Jg();this.Hh()};this.Vf=function(){y[this.If+16>>2]=0}}
var ab=0,bb=(a,c)=>{for(var d=0,e=a.length-1;0<=e;e--){var g=a[e];"."===g?a.splice(e,1):".."===g?(a.splice(e,1),d++):d&&(a.splice(e,1),d--)}if(c)for(;d;d--)a.unshift("..");return a},cb=a=>{var c="/"===a.charAt(0),d="/"===a.substr(-1);(a=bb(a.split("/").filter(e=>!!e),!c).join("/"))||c||(a=".");a&&d&&(a+="/");return(c?"/":"")+a},db=a=>{var c=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(a).slice(1);a=c[0];c=c[1];if(!a&&!c)return".";c&&(c=c.substr(0,c.length-1));return a+c},eb=
a=>{if("/"===a)return"/";a=cb(a);a=a.replace(/\/$/,"");var c=a.lastIndexOf("/");return-1===c?a:a.substr(c+1)},fb=(a,c)=>cb(a+"/"+c);function gb(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var a=new Uint8Array(1);return()=>{crypto.getRandomValues(a);return a[0]}}if(ia)try{var c=require("crypto");return()=>c.randomBytes(1)[0]}catch(d){}return()=>n("randomDevice")}
function hb(){for(var a="",c=!1,d=arguments.length-1;-1<=d&&!c;d--){c=0<=d?arguments[d]:D.cwd();if("string"!=typeof c)throw new TypeError("Arguments to path.resolve must be strings");if(!c)return"";a=c+"/"+a;c="/"===c.charAt(0)}a=bb(a.split("/").filter(e=>!!e),!c).join("/");return(c?"/":"")+a||"."}
var ib=(a,c)=>{function d(k){for(var m=0;m<k.length&&""===k[m];m++);for(var t=k.length-1;0<=t&&""===k[t];t--);return m>t?[]:k.slice(m,t-m+1)}a=hb(a).substr(1);c=hb(c).substr(1);a=d(a.split("/"));c=d(c.split("/"));for(var e=Math.min(a.length,c.length),g=e,h=0;h<e;h++)if(a[h]!==c[h]){g=h;break}e=[];for(h=g;h<a.length;h++)e.push("..");e=e.concat(c.slice(g));return e.join("/")};function jb(a,c){var d=Array(Aa(a)+1);a=za(a,d,0,d.length);c&&(d.length=a);return d}var kb=[];
function lb(a,c){kb[a]={input:[],output:[],tg:c};D.gh(a,mb)}
var mb={open:function(a){var c=kb[a.node.rdev];if(!c)throw new D.Jf(43);a.tty=c;a.seekable=!1},close:function(a){a.tty.tg.flush(a.tty)},flush:function(a){a.tty.tg.flush(a.tty)},read:function(a,c,d,e){if(!a.tty||!a.tty.tg.wh)throw new D.Jf(60);for(var g=0,h=0;h<e;h++){try{var k=a.tty.tg.wh(a.tty)}catch(m){throw new D.Jf(29);}if(void 0===k&&0===g)throw new D.Jf(6);if(null===k||void 0===k)break;g++;c[d+h]=k}g&&(a.node.timestamp=Date.now());return g},write:function(a,c,d,e){if(!a.tty||!a.tty.tg.dh)throw new D.Jf(60);
try{for(var g=0;g<e;g++)a.tty.tg.dh(a.tty,c[d+g])}catch(h){throw new D.Jf(29);}e&&(a.node.timestamp=Date.now());return g}},nb={wh:function(a){if(!a.input.length){var c=null;if(ia){var d=Buffer.alloc(256),e=0;try{e=fs.readSync(process.stdin.fd,d,0,256,-1)}catch(g){if(g.toString().includes("EOF"))e=0;else throw g;}0<e?c=d.slice(0,e).toString("utf-8"):c=null}else"undefined"!=typeof window&&"function"==typeof window.prompt?(c=window.prompt("Input: "),null!==c&&(c+="\n")):"function"==typeof readline&&
(c=readline(),null!==c&&(c+="\n"));if(!c)return null;a.input=jb(c,!0)}return a.input.shift()},dh:function(a,c){null===c||10===c?(qa(xa(a.output,0)),a.output=[]):0!=c&&a.output.push(c)},flush:function(a){a.output&&0<a.output.length&&(qa(xa(a.output,0)),a.output=[])}},ob={dh:function(a,c){null===c||10===c?(pa(xa(a.output,0)),a.output=[]):0!=c&&a.output.push(c)},flush:function(a){a.output&&0<a.output.length&&(pa(xa(a.output,0)),a.output=[])}};
function pb(a){a=65536*Math.ceil(a/65536);var c=qb(65536,a);if(!c)return 0;ya.fill(0,c,c+a);return c}
var E={ag:null,Sf:function(){return E.createNode(null,"/",16895,0)},createNode:function(a,c,d,e){if(D.ui(d)||D.isFIFO(d))throw new D.Jf(63);E.ag||(E.ag={dir:{node:{Yf:E.Kf.Yf,Uf:E.Kf.Uf,lookup:E.Kf.lookup,eg:E.Kf.eg,rename:E.Kf.rename,unlink:E.Kf.unlink,rmdir:E.Kf.rmdir,readdir:E.Kf.readdir,symlink:E.Kf.symlink},stream:{Zf:E.Mf.Zf}},file:{node:{Yf:E.Kf.Yf,Uf:E.Kf.Uf},stream:{Zf:E.Mf.Zf,read:E.Mf.read,write:E.Mf.write,vg:E.Mf.vg,lg:E.Mf.lg,sg:E.Mf.sg}},link:{node:{Yf:E.Kf.Yf,Uf:E.Kf.Uf,readlink:E.Kf.readlink},
stream:{}},mh:{node:{Yf:E.Kf.Yf,Uf:E.Kf.Uf},stream:D.Oh}});d=D.createNode(a,c,d,e);D.Tf(d.mode)?(d.Kf=E.ag.dir.node,d.Mf=E.ag.dir.stream,d.Lf={}):D.isFile(d.mode)?(d.Kf=E.ag.file.node,d.Mf=E.ag.file.stream,d.Qf=0,d.Lf=null):D.yg(d.mode)?(d.Kf=E.ag.link.node,d.Mf=E.ag.link.stream):D.Cg(d.mode)&&(d.Kf=E.ag.mh.node,d.Mf=E.ag.mh.stream);d.timestamp=Date.now();a&&(a.Lf[c]=d,a.timestamp=d.timestamp);return d},Oi:function(a){return a.Lf?a.Lf.subarray?a.Lf.subarray(0,a.Qf):new Uint8Array(a.Lf):new Uint8Array(0)},
th:function(a,c){var d=a.Lf?a.Lf.length:0;d>=c||(c=Math.max(c,d*(1048576>d?2:1.125)>>>0),0!=d&&(c=Math.max(c,256)),d=a.Lf,a.Lf=new Uint8Array(c),0<a.Qf&&a.Lf.set(d.subarray(0,a.Qf),0))},Ei:function(a,c){if(a.Qf!=c)if(0==c)a.Lf=null,a.Qf=0;else{var d=a.Lf;a.Lf=new Uint8Array(c);d&&a.Lf.set(d.subarray(0,Math.min(c,a.Qf)));a.Qf=c}},Kf:{Yf:function(a){var c={};c.dev=D.Cg(a.mode)?a.id:1;c.ino=a.id;c.mode=a.mode;c.nlink=1;c.uid=0;c.gid=0;c.rdev=a.rdev;D.Tf(a.mode)?c.size=4096:D.isFile(a.mode)?c.size=a.Qf:
D.yg(a.mode)?c.size=a.link.length:c.size=0;c.atime=new Date(a.timestamp);c.mtime=new Date(a.timestamp);c.ctime=new Date(a.timestamp);c.Lh=4096;c.blocks=Math.ceil(c.size/c.Lh);return c},Uf:function(a,c){void 0!==c.mode&&(a.mode=c.mode);void 0!==c.timestamp&&(a.timestamp=c.timestamp);void 0!==c.size&&E.Ei(a,c.size)},lookup:function(){throw D.Pg[44];},eg:function(a,c,d,e){return E.createNode(a,c,d,e)},rename:function(a,c,d){if(D.Tf(a.mode)){try{var e=D.dg(c,d)}catch(h){}if(e)for(var g in e.Lf)throw new D.Jf(55);
}delete a.parent.Lf[a.name];a.parent.timestamp=Date.now();a.name=d;c.Lf[d]=a;c.timestamp=a.parent.timestamp;a.parent=c},unlink:function(a,c){delete a.Lf[c];a.timestamp=Date.now()},rmdir:function(a,c){var d=D.dg(a,c),e;for(e in d.Lf)throw new D.Jf(55);delete a.Lf[c];a.timestamp=Date.now()},readdir:function(a){var c=[".",".."],d;for(d in a.Lf)a.Lf.hasOwnProperty(d)&&c.push(d);return c},symlink:function(a,c,d){a=E.createNode(a,c,41471,0);a.link=d;return a},readlink:function(a){if(!D.yg(a.mode))throw new D.Jf(28);
return a.link}},Mf:{read:function(a,c,d,e,g){var h=a.node.Lf;if(g>=a.node.Qf)return 0;a=Math.min(a.node.Qf-g,e);if(8<a&&h.subarray)c.set(h.subarray(g,g+a),d);else for(e=0;e<a;e++)c[d+e]=h[g+e];return a},write:function(a,c,d,e,g,h){c.buffer===r.buffer&&(h=!1);if(!e)return 0;a=a.node;a.timestamp=Date.now();if(c.subarray&&(!a.Lf||a.Lf.subarray)){if(h)return a.Lf=c.subarray(d,d+e),a.Qf=e;if(0===a.Qf&&0===g)return a.Lf=c.slice(d,d+e),a.Qf=e;if(g+e<=a.Qf)return a.Lf.set(c.subarray(d,d+e),g),e}E.th(a,g+
e);if(a.Lf.subarray&&c.subarray)a.Lf.set(c.subarray(d,d+e),g);else for(h=0;h<e;h++)a.Lf[g+h]=c[d+h];a.Qf=Math.max(a.Qf,g+e);return e},Zf:function(a,c,d){1===d?c+=a.position:2===d&&D.isFile(a.node.mode)&&(c+=a.node.Qf);if(0>c)throw new D.Jf(28);return c},vg:function(a,c,d){E.th(a.node,c+d);a.node.Qf=Math.max(a.node.Qf,c+d)},lg:function(a,c,d,e,g){if(!D.isFile(a.node.mode))throw new D.Jf(43);a=a.node.Lf;if(g&2||a.buffer!==Ba){if(0<d||d+c<a.length)a.subarray?a=a.subarray(d,d+c):a=Array.prototype.slice.call(a,
d,d+c);d=!0;c=pb(c);if(!c)throw new D.Jf(48);r.set(a,c)}else d=!1,c=a.byteOffset;return{If:c,kh:d}},sg:function(a,c,d,e,g){if(!D.isFile(a.node.mode))throw new D.Jf(43);if(g&2)return 0;E.Mf.write(a,c,0,e,d,!1);return 0}}};function rb(a,c,d){var e="al "+a;ka(a,g=>{g||n('Loading data file "'+a+'" failed (no arrayBuffer).');c(new Uint8Array(g));e&&Ra(e)},()=>{if(d)d();else throw'Loading data file "'+a+'" failed.';});e&&Qa(e)}
var D={root:null,Ag:[],rh:{},streams:[],zi:1,$f:null,qh:"/",Xg:!1,Ah:!0,Jf:null,Pg:{},Wh:null,Gg:0,Pf:(a,c={})=>{a=hb(D.cwd(),a);if(!a)return{path:"",node:null};c=Object.assign({Ng:!0,fh:0},c);if(8<c.fh)throw new D.Jf(32);a=bb(a.split("/").filter(k=>!!k),!1);for(var d=D.root,e="/",g=0;g<a.length;g++){var h=g===a.length-1;if(h&&c.parent)break;d=D.dg(d,a[g]);e=cb(e+"/"+a[g]);D.jg(d)&&(!h||h&&c.Ng)&&(d=d.zg.root);if(!h||c.Xf)for(h=0;D.yg(d.mode);)if(d=D.readlink(e),e=hb(db(e),d),d=D.Pf(e,{fh:c.fh+1}).node,
40<h++)throw new D.Jf(32);}return{path:e,node:d}},fg:a=>{for(var c;;){if(D.Dg(a))return a=a.Sf.Bh,c?"/"!==a[a.length-1]?a+"/"+c:a+c:a;c=c?a.name+"/"+c:a.name;a=a.parent}},Wg:(a,c)=>{for(var d=0,e=0;e<c.length;e++)d=(d<<5)-d+c.charCodeAt(e)|0;return(a+d>>>0)%D.$f.length},yh:a=>{var c=D.Wg(a.parent.id,a.name);a.mg=D.$f[c];D.$f[c]=a},zh:a=>{var c=D.Wg(a.parent.id,a.name);if(D.$f[c]===a)D.$f[c]=a.mg;else for(c=D.$f[c];c;){if(c.mg===a){c.mg=a.mg;break}c=c.mg}},dg:(a,c)=>{var d=D.wi(a);if(d)throw new D.Jf(d,
a);for(d=D.$f[D.Wg(a.id,c)];d;d=d.mg){var e=d.name;if(d.parent.id===a.id&&e===c)return d}return D.lookup(a,c)},createNode:(a,c,d,e)=>{a=new D.Dh(a,c,d,e);D.yh(a);return a},Mg:a=>{D.zh(a)},Dg:a=>a===a.parent,jg:a=>!!a.zg,isFile:a=>32768===(a&61440),Tf:a=>16384===(a&61440),yg:a=>40960===(a&61440),Cg:a=>8192===(a&61440),ui:a=>24576===(a&61440),isFIFO:a=>4096===(a&61440),isSocket:a=>49152===(a&49152),Xh:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},yi:a=>{var c=D.Xh[a];if("undefined"==typeof c)throw Error("Unknown file open mode: "+
a);return c},uh:a=>{var c=["r","w","rw"][a&3];a&512&&(c+="w");return c},ng:(a,c)=>{if(D.Ah)return 0;if(!c.includes("r")||a.mode&292){if(c.includes("w")&&!(a.mode&146)||c.includes("x")&&!(a.mode&73))return 2}else return 2;return 0},wi:a=>{var c=D.ng(a,"x");return c?c:a.Kf.lookup?0:2},bh:(a,c)=>{try{return D.dg(a,c),20}catch(d){}return D.ng(a,"wx")},Eg:(a,c,d)=>{try{var e=D.dg(a,c)}catch(g){return g.Rf}if(a=D.ng(a,"wx"))return a;if(d){if(!D.Tf(e.mode))return 54;if(D.Dg(e)||D.fg(e)===D.cwd())return 10}else if(D.Tf(e.mode))return 31;
return 0},xi:(a,c)=>a?D.yg(a.mode)?32:D.Tf(a.mode)&&("r"!==D.uh(c)||c&512)?31:D.ng(a,D.uh(c)):44,Gh:4096,Ai:(a=0,c=D.Gh)=>{for(;a<=c;a++)if(!D.streams[a])return a;throw new D.Jf(33);},gg:a=>D.streams[a],ph:(a,c,d)=>{D.Bg||(D.Bg=function(){this.Vf={}},D.Bg.prototype={},Object.defineProperties(D.Bg.prototype,{object:{get:function(){return this.node},set:function(e){this.node=e}},flags:{get:function(){return this.Vf.flags},set:function(e){this.Vf.flags=e}},position:{get:function(){return this.Vf.position},
set:function(e){this.Vf.position=e}}}));a=Object.assign(new D.Bg,a);c=D.Ai(c,d);a.fd=c;return D.streams[c]=a},Ph:a=>{D.streams[a]=null},Oh:{open:a=>{a.Mf=D.Yh(a.node.rdev).Mf;a.Mf.open&&a.Mf.open(a)},Zf:()=>{throw new D.Jf(70);}},ah:a=>a>>8,Ri:a=>a&255,kg:(a,c)=>a<<8|c,gh:(a,c)=>{D.rh[a]={Mf:c}},Yh:a=>D.rh[a],vh:a=>{var c=[];for(a=[a];a.length;){var d=a.pop();c.push(d);a.push.apply(a,d.Ag)}return c},Ch:(a,c)=>{function d(k){D.Gg--;return c(k)}function e(k){if(k){if(!e.Vh)return e.Vh=!0,d(k)}else++h>=
g.length&&d(null)}"function"==typeof a&&(c=a,a=!1);D.Gg++;1<D.Gg&&pa("warning: "+D.Gg+" FS.syncfs operations in flight at once, probably just doing extra work");var g=D.vh(D.root.Sf),h=0;g.forEach(k=>{if(!k.type.Ch)return e(null);k.type.Ch(k,a,e)})},Sf:(a,c,d)=>{var e="/"===d,g=!d;if(e&&D.root)throw new D.Jf(10);if(!e&&!g){var h=D.Pf(d,{Ng:!1});d=h.path;h=h.node;if(D.jg(h))throw new D.Jf(10);if(!D.Tf(h.mode))throw new D.Jf(54);}c={type:a,Ui:c,Bh:d,Ag:[]};a=a.Sf(c);a.Sf=c;c.root=a;e?D.root=a:h&&(h.zg=
c,h.Sf&&h.Sf.Ag.push(c));return a},Yi:a=>{a=D.Pf(a,{Ng:!1});if(!D.jg(a.node))throw new D.Jf(28);a=a.node;var c=a.zg,d=D.vh(c);Object.keys(D.$f).forEach(e=>{for(e=D.$f[e];e;){var g=e.mg;d.includes(e.Sf)&&D.Mg(e);e=g}});a.zg=null;a.Sf.Ag.splice(a.Sf.Ag.indexOf(c),1)},lookup:(a,c)=>a.Kf.lookup(a,c),eg:(a,c,d)=>{var e=D.Pf(a,{parent:!0}).node;a=eb(a);if(!a||"."===a||".."===a)throw new D.Jf(28);var g=D.bh(e,a);if(g)throw new D.Jf(g);if(!e.Kf.eg)throw new D.Jf(63);return e.Kf.eg(e,a,c,d)},create:(a,c)=>
D.eg(a,(void 0!==c?c:438)&4095|32768,0),mkdir:(a,c)=>D.eg(a,(void 0!==c?c:511)&1023|16384,0),Si:(a,c)=>{a=a.split("/");for(var d="",e=0;e<a.length;++e)if(a[e]){d+="/"+a[e];try{D.mkdir(d,c)}catch(g){if(20!=g.Rf)throw g;}}},Fg:(a,c,d)=>{"undefined"==typeof d&&(d=c,c=438);return D.eg(a,c|8192,d)},symlink:(a,c)=>{if(!hb(a))throw new D.Jf(44);var d=D.Pf(c,{parent:!0}).node;if(!d)throw new D.Jf(44);c=eb(c);var e=D.bh(d,c);if(e)throw new D.Jf(e);if(!d.Kf.symlink)throw new D.Jf(63);return d.Kf.symlink(d,
c,a)},rename:(a,c)=>{var d=db(a),e=db(c),g=eb(a),h=eb(c);var k=D.Pf(a,{parent:!0});var m=k.node;k=D.Pf(c,{parent:!0});k=k.node;if(!m||!k)throw new D.Jf(44);if(m.Sf!==k.Sf)throw new D.Jf(75);var t=D.dg(m,g);a=ib(a,e);if("."!==a.charAt(0))throw new D.Jf(28);a=ib(c,d);if("."!==a.charAt(0))throw new D.Jf(55);try{var u=D.dg(k,h)}catch(p){}if(t!==u){c=D.Tf(t.mode);if(g=D.Eg(m,g,c))throw new D.Jf(g);if(g=u?D.Eg(k,h,c):D.bh(k,h))throw new D.Jf(g);if(!m.Kf.rename)throw new D.Jf(63);if(D.jg(t)||u&&D.jg(u))throw new D.Jf(10);
if(k!==m&&(g=D.ng(m,"w")))throw new D.Jf(g);D.zh(t);try{m.Kf.rename(t,k,h)}catch(p){throw p;}finally{D.yh(t)}}},rmdir:a=>{var c=D.Pf(a,{parent:!0}).node;a=eb(a);var d=D.dg(c,a),e=D.Eg(c,a,!0);if(e)throw new D.Jf(e);if(!c.Kf.rmdir)throw new D.Jf(63);if(D.jg(d))throw new D.Jf(10);c.Kf.rmdir(c,a);D.Mg(d)},readdir:a=>{a=D.Pf(a,{Xf:!0}).node;if(!a.Kf.readdir)throw new D.Jf(54);return a.Kf.readdir(a)},unlink:a=>{var c=D.Pf(a,{parent:!0}).node;if(!c)throw new D.Jf(44);a=eb(a);var d=D.dg(c,a),e=D.Eg(c,a,
!1);if(e)throw new D.Jf(e);if(!c.Kf.unlink)throw new D.Jf(63);if(D.jg(d))throw new D.Jf(10);c.Kf.unlink(c,a);D.Mg(d)},readlink:a=>{a=D.Pf(a).node;if(!a)throw new D.Jf(44);if(!a.Kf.readlink)throw new D.Jf(28);return hb(D.fg(a.parent),a.Kf.readlink(a))},stat:(a,c)=>{a=D.Pf(a,{Xf:!c}).node;if(!a)throw new D.Jf(44);if(!a.Kf.Yf)throw new D.Jf(63);return a.Kf.Yf(a)},lstat:a=>D.stat(a,!0),chmod:(a,c,d)=>{a="string"==typeof a?D.Pf(a,{Xf:!d}).node:a;if(!a.Kf.Uf)throw new D.Jf(63);a.Kf.Uf(a,{mode:c&4095|a.mode&
-4096,timestamp:Date.now()})},lchmod:(a,c)=>{D.chmod(a,c,!0)},fchmod:(a,c)=>{a=D.gg(a);if(!a)throw new D.Jf(8);D.chmod(a.node,c)},chown:(a,c,d,e)=>{a="string"==typeof a?D.Pf(a,{Xf:!e}).node:a;if(!a.Kf.Uf)throw new D.Jf(63);a.Kf.Uf(a,{timestamp:Date.now()})},lchown:(a,c,d)=>{D.chown(a,c,d,!0)},fchown:(a,c,d)=>{a=D.gg(a);if(!a)throw new D.Jf(8);D.chown(a.node,c,d)},truncate:(a,c)=>{if(0>c)throw new D.Jf(28);a="string"==typeof a?D.Pf(a,{Xf:!0}).node:a;if(!a.Kf.Uf)throw new D.Jf(63);if(D.Tf(a.mode))throw new D.Jf(31);
if(!D.isFile(a.mode))throw new D.Jf(28);var d=D.ng(a,"w");if(d)throw new D.Jf(d);a.Kf.Uf(a,{size:c,timestamp:Date.now()})},Ni:(a,c)=>{a=D.gg(a);if(!a)throw new D.Jf(8);if(0===(a.flags&2097155))throw new D.Jf(28);D.truncate(a.node,c)},Zi:(a,c,d)=>{a=D.Pf(a,{Xf:!0}).node;a.Kf.Uf(a,{timestamp:Math.max(c,d)})},open:(a,c,d)=>{if(""===a)throw new D.Jf(44);c="string"==typeof c?D.yi(c):c;d=c&64?("undefined"==typeof d?438:d)&4095|32768:0;if("object"==typeof a)var e=a;else{a=cb(a);try{e=D.Pf(a,{Xf:!(c&131072)}).node}catch(h){}}var g=
!1;if(c&64)if(e){if(c&128)throw new D.Jf(20);}else e=D.eg(a,d,0),g=!0;if(!e)throw new D.Jf(44);D.Cg(e.mode)&&(c&=-513);if(c&65536&&!D.Tf(e.mode))throw new D.Jf(54);if(!g&&(d=D.xi(e,c)))throw new D.Jf(d);c&512&&!g&&D.truncate(e,0);c&=-131713;e=D.ph({node:e,path:D.fg(e),flags:c,seekable:!0,position:0,Mf:e.Mf,Li:[],error:!1});e.Mf.open&&e.Mf.open(e);!b.logReadFiles||c&1||(D.eh||(D.eh={}),a in D.eh||(D.eh[a]=1));return e},close:a=>{if(D.xg(a))throw new D.Jf(8);a.Vg&&(a.Vg=null);try{a.Mf.close&&a.Mf.close(a)}catch(c){throw c;
}finally{D.Ph(a.fd)}a.fd=null},xg:a=>null===a.fd,Zf:(a,c,d)=>{if(D.xg(a))throw new D.Jf(8);if(!a.seekable||!a.Mf.Zf)throw new D.Jf(70);if(0!=d&&1!=d&&2!=d)throw new D.Jf(28);a.position=a.Mf.Zf(a,c,d);a.Li=[];return a.position},read:(a,c,d,e,g)=>{if(0>e||0>g)throw new D.Jf(28);if(D.xg(a))throw new D.Jf(8);if(1===(a.flags&2097155))throw new D.Jf(8);if(D.Tf(a.node.mode))throw new D.Jf(31);if(!a.Mf.read)throw new D.Jf(28);var h="undefined"!=typeof g;if(!h)g=a.position;else if(!a.seekable)throw new D.Jf(70);
c=a.Mf.read(a,c,d,e,g);h||(a.position+=c);return c},write:(a,c,d,e,g,h)=>{if(0>e||0>g)throw new D.Jf(28);if(D.xg(a))throw new D.Jf(8);if(0===(a.flags&2097155))throw new D.Jf(8);if(D.Tf(a.node.mode))throw new D.Jf(31);if(!a.Mf.write)throw new D.Jf(28);a.seekable&&a.flags&1024&&D.Zf(a,0,2);var k="undefined"!=typeof g;if(!k)g=a.position;else if(!a.seekable)throw new D.Jf(70);c=a.Mf.write(a,c,d,e,g,h);k||(a.position+=c);return c},vg:(a,c,d)=>{if(D.xg(a))throw new D.Jf(8);if(0>c||0>=d)throw new D.Jf(28);
if(0===(a.flags&2097155))throw new D.Jf(8);if(!D.isFile(a.node.mode)&&!D.Tf(a.node.mode))throw new D.Jf(43);if(!a.Mf.vg)throw new D.Jf(138);a.Mf.vg(a,c,d)},lg:(a,c,d,e,g)=>{if(0!==(e&2)&&0===(g&2)&&2!==(a.flags&2097155))throw new D.Jf(2);if(1===(a.flags&2097155))throw new D.Jf(2);if(!a.Mf.lg)throw new D.Jf(43);return a.Mf.lg(a,c,d,e,g)},sg:(a,c,d,e,g)=>a&&a.Mf.sg?a.Mf.sg(a,c,d,e,g):0,Ti:()=>0,Yg:(a,c,d)=>{if(!a.Mf.Yg)throw new D.Jf(59);return a.Mf.Yg(a,c,d)},readFile:(a,c={})=>{c.flags=c.flags||0;
c.encoding=c.encoding||"binary";if("utf8"!==c.encoding&&"binary"!==c.encoding)throw Error('Invalid encoding type "'+c.encoding+'"');var d,e=D.open(a,c.flags);a=D.stat(a).size;var g=new Uint8Array(a);D.read(e,g,0,a,0);"utf8"===c.encoding?d=xa(g,0):"binary"===c.encoding&&(d=g);D.close(e);return d},writeFile:(a,c,d={})=>{d.flags=d.flags||577;a=D.open(a,d.flags,d.mode);if("string"==typeof c){var e=new Uint8Array(Aa(c)+1);c=za(c,e,0,e.length);D.write(a,e,0,c,void 0,d.Nh)}else if(ArrayBuffer.isView(c))D.write(a,
c,0,c.byteLength,void 0,d.Nh);else throw Error("Unsupported data type");D.close(a)},cwd:()=>D.qh,chdir:a=>{a=D.Pf(a,{Xf:!0});if(null===a.node)throw new D.Jf(44);if(!D.Tf(a.node.mode))throw new D.Jf(54);var c=D.ng(a.node,"x");if(c)throw new D.Jf(c);D.qh=a.path},Rh:()=>{D.mkdir("/tmp");D.mkdir("/home");D.mkdir("/home/web_user")},Qh:()=>{D.mkdir("/dev");D.gh(D.kg(1,3),{read:()=>0,write:(c,d,e,g)=>g});D.Fg("/dev/null",D.kg(1,3));lb(D.kg(5,0),nb);lb(D.kg(6,0),ob);D.Fg("/dev/tty",D.kg(5,0));D.Fg("/dev/tty1",
D.kg(6,0));var a=gb();D.Wf("/dev","random",a);D.Wf("/dev","urandom",a);D.mkdir("/dev/shm");D.mkdir("/dev/shm/tmp")},Th:()=>{D.mkdir("/proc");var a=D.mkdir("/proc/self");D.mkdir("/proc/self/fd");D.Sf({Sf:()=>{var c=D.createNode(a,"fd",16895,73);c.Kf={lookup:(d,e)=>{var g=D.gg(+e);if(!g)throw new D.Jf(8);d={parent:null,Sf:{Bh:"fake"},Kf:{readlink:()=>g.path}};return d.parent=d}};return c}},{},"/proc/self/fd")},Uh:()=>{b.stdin?D.Wf("/dev","stdin",b.stdin):D.symlink("/dev/tty","/dev/stdin");b.stdout?
D.Wf("/dev","stdout",null,b.stdout):D.symlink("/dev/tty","/dev/stdout");b.stderr?D.Wf("/dev","stderr",null,b.stderr):D.symlink("/dev/tty1","/dev/stderr");D.open("/dev/stdin",0);D.open("/dev/stdout",1);D.open("/dev/stderr",1)},sh:()=>{D.Jf||(D.Jf=function(a,c){this.node=c;this.Fi=function(d){this.Rf=d};this.Fi(a);this.message="FS error"},D.Jf.prototype=Error(),D.Jf.prototype.constructor=D.Jf,[44].forEach(a=>{D.Pg[a]=new D.Jf(a);D.Pg[a].stack="<generic error, no stack>"}))},Gi:()=>{D.sh();D.$f=Array(4096);
D.Sf(E,{},"/");D.Rh();D.Qh();D.Th();D.Wh={MEMFS:E}},rg:(a,c,d)=>{D.rg.Xg=!0;D.sh();b.stdin=a||b.stdin;b.stdout=c||b.stdout;b.stderr=d||b.stderr;D.Uh()},Vi:()=>{D.rg.Xg=!1;for(var a=0;a<D.streams.length;a++){var c=D.streams[a];c&&D.close(c)}},Qg:(a,c)=>{var d=0;a&&(d|=365);c&&(d|=146);return d},Mi:(a,c)=>{a=D.Kg(a,c);return a.exists?a.object:null},Kg:(a,c)=>{try{var d=D.Pf(a,{Xf:!c});a=d.path}catch(g){}var e={Dg:!1,exists:!1,error:0,name:null,path:null,object:null,Bi:!1,Di:null,Ci:null};try{d=D.Pf(a,
{parent:!0}),e.Bi=!0,e.Di=d.path,e.Ci=d.node,e.name=eb(a),d=D.Pf(a,{Xf:!c}),e.exists=!0,e.path=d.path,e.object=d.node,e.name=d.node.name,e.Dg="/"===d.path}catch(g){e.error=g.Rf}return e},Lg:(a,c)=>{a="string"==typeof a?a:D.fg(a);for(c=c.split("/").reverse();c.length;){var d=c.pop();if(d){var e=cb(a+"/"+d);try{D.mkdir(e)}catch(g){}a=e}}return e},Sh:(a,c,d,e,g)=>{a="string"==typeof a?a:D.fg(a);c=cb(a+"/"+c);return D.create(c,D.Qg(e,g))},wg:(a,c,d,e,g,h)=>{var k=c;a&&(a="string"==typeof a?a:D.fg(a),
k=c?cb(a+"/"+c):a);a=D.Qg(e,g);k=D.create(k,a);if(d){if("string"==typeof d){c=Array(d.length);e=0;for(g=d.length;e<g;++e)c[e]=d.charCodeAt(e);d=c}D.chmod(k,a|146);c=D.open(k,577);D.write(c,d,0,d.length,0,h);D.close(c);D.chmod(k,a)}return k},Wf:(a,c,d,e)=>{a=fb("string"==typeof a?a:D.fg(a),c);c=D.Qg(!!d,!!e);D.Wf.ah||(D.Wf.ah=64);var g=D.kg(D.Wf.ah++,0);D.gh(g,{open:h=>{h.seekable=!1},close:()=>{e&&e.buffer&&e.buffer.length&&e(10)},read:(h,k,m,t)=>{for(var u=0,p=0;p<t;p++){try{var x=d()}catch(N){throw new D.Jf(29);
}if(void 0===x&&0===u)throw new D.Jf(6);if(null===x||void 0===x)break;u++;k[m+p]=x}u&&(h.node.timestamp=Date.now());return u},write:(h,k,m,t)=>{for(var u=0;u<t;u++)try{e(k[m+u])}catch(p){throw new D.Jf(29);}t&&(h.node.timestamp=Date.now());return u}});return D.Fg(a,c,g)},Og:a=>{if(a.Zg||a.vi||a.link||a.Lf)return!0;if("undefined"!=typeof XMLHttpRequest)throw Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");
if(ja)try{a.Lf=jb(ja(a.url),!0),a.Qf=a.Lf.length}catch(c){throw new D.Jf(29);}else throw Error("Cannot load without read() or XMLHttpRequest.");},nh:(a,c,d,e,g)=>{function h(){this.$g=!1;this.Vf=[]}function k(p,x,N,l,w){p=p.node.Lf;if(w>=p.length)return 0;l=Math.min(p.length-w,l);if(p.slice)for(var B=0;B<l;B++)x[N+B]=p[w+B];else for(B=0;B<l;B++)x[N+B]=p.get(w+B);return l}h.prototype.get=function(p){if(!(p>this.length-1||0>p)){var x=p%this.chunkSize;return this.xh(p/this.chunkSize|0)[x]}};h.prototype.Jg=
function(p){this.xh=p};h.prototype.lh=function(){var p=new XMLHttpRequest;p.open("HEAD",d,!1);p.send(null);if(!(200<=p.status&&300>p.status||304===p.status))throw Error("Couldn't load "+d+". Status: "+p.status);var x=Number(p.getResponseHeader("Content-length")),N,l=(N=p.getResponseHeader("Accept-Ranges"))&&"bytes"===N;p=(N=p.getResponseHeader("Content-Encoding"))&&"gzip"===N;var w=1048576;l||(w=x);var B=this;B.Jg(U=>{var va=U*w,Ja=(U+1)*w-1;Ja=Math.min(Ja,x-1);if("undefined"==typeof B.Vf[U]){var Sh=
B.Vf;if(va>Ja)throw Error("invalid range ("+va+", "+Ja+") or no bytes requested!");if(Ja>x-1)throw Error("only "+x+" bytes available! programmer error!");var W=new XMLHttpRequest;W.open("GET",d,!1);x!==w&&W.setRequestHeader("Range","bytes="+va+"-"+Ja);W.responseType="arraybuffer";W.overrideMimeType&&W.overrideMimeType("text/plain; charset=x-user-defined");W.send(null);if(!(200<=W.status&&300>W.status||304===W.status))throw Error("Couldn't load "+d+". Status: "+W.status);va=void 0!==W.response?new Uint8Array(W.response||
[]):jb(W.responseText||"",!0);Sh[U]=va}if("undefined"==typeof B.Vf[U])throw Error("doXHR failed!");return B.Vf[U]});if(p||!x)w=x=1,w=x=this.xh(0).length,qa("LazyFiles on gzip forces download of the whole file when length is accessed");this.Kh=x;this.Jh=w;this.$g=!0};if("undefined"!=typeof XMLHttpRequest){if(!ha)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var m=new h;Object.defineProperties(m,{length:{get:function(){this.$g||
this.lh();return this.Kh}},chunkSize:{get:function(){this.$g||this.lh();return this.Jh}}});m={Zg:!1,Lf:m}}else m={Zg:!1,url:d};var t=D.Sh(a,c,m,e,g);m.Lf?t.Lf=m.Lf:m.url&&(t.Lf=null,t.url=m.url);Object.defineProperties(t,{Qf:{get:function(){return this.Lf.length}}});var u={};Object.keys(t.Mf).forEach(p=>{var x=t.Mf[p];u[p]=function(){D.Og(t);return x.apply(null,arguments)}});u.read=(p,x,N,l,w)=>{D.Og(t);return k(p,x,N,l,w)};u.lg=(p,x,N)=>{D.Og(t);var l=pb(x);if(!l)throw new D.Jf(48);k(p,r,l,x,N);
return{If:l,kh:!0}};t.Mf=u;return t},oh:(a,c,d,e,g,h,k,m,t,u)=>{function p(l){function w(B){u&&u();m||D.wg(a,c,B,e,g,t);h&&h();Ra(N)}sb.Pi(l,x,w,()=>{k&&k();Ra(N)})||w(l)}var x=c?hb(cb(a+"/"+c)):a,N="cp "+x;Qa(N);"string"==typeof d?rb(d,l=>p(l),k):p(d)},indexedDB:()=>window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,ih:()=>"EM_FS_"+window.location.pathname,jh:20,ug:"FILE_DATA",Wi:(a,c,d)=>{c=c||(()=>{});d=d||(()=>{});var e=D.indexedDB();try{var g=e.open(D.ih(),D.jh)}catch(h){return d(h)}g.onupgradeneeded=
()=>{qa("creating db");g.result.createObjectStore(D.ug)};g.onsuccess=()=>{var h=g.result.transaction([D.ug],"readwrite"),k=h.objectStore(D.ug),m=0,t=0,u=a.length;a.forEach(p=>{p=k.put(D.Kg(p).object.Lf,p);p.onsuccess=()=>{m++;m+t==u&&(0==t?c():d())};p.onerror=()=>{t++;m+t==u&&(0==t?c():d())}});h.onerror=d};g.onerror=d},Qi:(a,c,d)=>{c=c||(()=>{});d=d||(()=>{});var e=D.indexedDB();try{var g=e.open(D.ih(),D.jh)}catch(h){return d(h)}g.onupgradeneeded=d;g.onsuccess=()=>{var h=g.result;try{var k=h.transaction([D.ug],
"readonly")}catch(x){d(x);return}var m=k.objectStore(D.ug),t=0,u=0,p=a.length;a.forEach(x=>{var N=m.get(x);N.onsuccess=()=>{D.Kg(x).exists&&D.unlink(x);D.wg(db(x),eb(x),N.result,!0,!0,!0);t++;t+u==p&&(0==u?c():d())};N.onerror=()=>{u++;t+u==p&&(0==u?c():d())}});k.onerror=d};g.onerror=d}};function tb(a,c,d){if("/"===c.charAt(0))return c;if(-100===a)a=D.cwd();else{a=D.gg(a);if(!a)throw new D.Jf(8);a=a.path}if(0==c.length){if(!d)throw new D.Jf(44);return a}return cb(a+"/"+c)}
function ub(a,c,d){try{var e=a(c)}catch(g){if(g&&g.node&&cb(c)!==cb(D.fg(g.node)))return-54;throw g;}v[d>>2]=e.dev;v[d+8>>2]=e.ino;v[d+12>>2]=e.mode;v[d+16>>2]=e.nlink;v[d+20>>2]=e.uid;v[d+24>>2]=e.gid;v[d+28>>2]=e.rdev;C=[e.size>>>0,(A=e.size,1<=+Math.abs(A)?0<A?(Math.min(+Math.floor(A/4294967296),4294967295)|0)>>>0:~~+Math.ceil((A-+(~~A>>>0))/4294967296)>>>0:0)];v[d+40>>2]=C[0];v[d+44>>2]=C[1];v[d+48>>2]=4096;v[d+52>>2]=e.blocks;C=[Math.floor(e.atime.getTime()/1E3)>>>0,(A=Math.floor(e.atime.getTime()/
1E3),1<=+Math.abs(A)?0<A?(Math.min(+Math.floor(A/4294967296),4294967295)|0)>>>0:~~+Math.ceil((A-+(~~A>>>0))/4294967296)>>>0:0)];v[d+56>>2]=C[0];v[d+60>>2]=C[1];v[d+64>>2]=0;C=[Math.floor(e.mtime.getTime()/1E3)>>>0,(A=Math.floor(e.mtime.getTime()/1E3),1<=+Math.abs(A)?0<A?(Math.min(+Math.floor(A/4294967296),4294967295)|0)>>>0:~~+Math.ceil((A-+(~~A>>>0))/4294967296)>>>0:0)];v[d+72>>2]=C[0];v[d+76>>2]=C[1];v[d+80>>2]=0;C=[Math.floor(e.ctime.getTime()/1E3)>>>0,(A=Math.floor(e.ctime.getTime()/1E3),1<=+Math.abs(A)?
0<A?(Math.min(+Math.floor(A/4294967296),4294967295)|0)>>>0:~~+Math.ceil((A-+(~~A>>>0))/4294967296)>>>0:0)];v[d+88>>2]=C[0];v[d+92>>2]=C[1];v[d+96>>2]=0;C=[e.ino>>>0,(A=e.ino,1<=+Math.abs(A)?0<A?(Math.min(+Math.floor(A/4294967296),4294967295)|0)>>>0:~~+Math.ceil((A-+(~~A>>>0))/4294967296)>>>0:0)];v[d+104>>2]=C[0];v[d+108>>2]=C[1];return 0}var vb=void 0;function wb(){vb+=4;return v[vb-4>>2]}function xb(a){a=D.gg(a);if(!a)throw new D.Jf(8);return a}
function yb(a){var c=Aa(a)+1,d=zb(c);d&&za(a,r,d,c);return d}function Ab(a,c,d){function e(t){return(t=t.toTimeString().match(/\(([A-Za-z ]+)\)$/))?t[1]:"GMT"}var g=(new Date).getFullYear(),h=new Date(g,0,1),k=new Date(g,6,1);g=h.getTimezoneOffset();var m=k.getTimezoneOffset();v[a>>2]=60*Math.max(g,m);v[c>>2]=Number(g!=m);a=e(h);c=e(k);a=yb(a);c=yb(c);m<g?(y[d>>2]=a,y[d+4>>2]=c):(y[d>>2]=c,y[d+4>>2]=a)}function Bb(a,c,d){Bb.Mh||(Bb.Mh=!0,Ab(a,c,d))}var Cb=[],Db;
Db=ia?()=>{var a=process.hrtime();return 1E3*a[0]+a[1]/1E6}:()=>performance.now();var Eb={};function Fb(){if(!Gb){var a={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:da||"./this.program"},c;for(c in Eb)void 0===Eb[c]?delete a[c]:a[c]=Eb[c];var d=[];for(c in a)d.push(c+"="+a[c]);Gb=d}return Gb}var Gb;function Hb(a){return 0===a%4&&(0!==a%100||0===a%400)}
var Ib=[31,29,31,30,31,30,31,31,30,31,30,31],Jb=[31,28,31,30,31,30,31,31,30,31,30,31];
function Kb(a,c,d,e){function g(l,w,B){for(l="number"==typeof l?l.toString():l||"";l.length<w;)l=B[0]+l;return l}function h(l,w){return g(l,w,"0")}function k(l,w){function B(va){return 0>va?-1:0<va?1:0}var U;0===(U=B(l.getFullYear()-w.getFullYear()))&&0===(U=B(l.getMonth()-w.getMonth()))&&(U=B(l.getDate()-w.getDate()));return U}function m(l){switch(l.getDay()){case 0:return new Date(l.getFullYear()-1,11,29);case 1:return l;case 2:return new Date(l.getFullYear(),0,3);case 3:return new Date(l.getFullYear(),
0,2);case 4:return new Date(l.getFullYear(),0,1);case 5:return new Date(l.getFullYear()-1,11,31);case 6:return new Date(l.getFullYear()-1,11,30)}}function t(l){var w=l.pg;for(l=new Date((new Date(l.qg+1900,0,1)).getTime());0<w;){var B=l.getMonth(),U=(Hb(l.getFullYear())?Ib:Jb)[B];if(w>U-l.getDate())w-=U-l.getDate()+1,l.setDate(1),11>B?l.setMonth(B+1):(l.setMonth(0),l.setFullYear(l.getFullYear()+1));else{l.setDate(l.getDate()+w);break}}B=new Date(l.getFullYear()+1,0,4);w=m(new Date(l.getFullYear(),
0,4));B=m(B);return 0>=k(w,l)?0>=k(B,l)?l.getFullYear()+1:l.getFullYear():l.getFullYear()-1}var u=v[e+40>>2];e={Ji:v[e>>2],Ii:v[e+4>>2],Hg:v[e+8>>2],hh:v[e+12>>2],Ig:v[e+16>>2],qg:v[e+20>>2],bg:v[e+24>>2],pg:v[e+28>>2],Xi:v[e+32>>2],Hi:v[e+36>>2],Ki:u?q(u):""};d=q(d);u={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d",
"%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var p in u)d=d.replace(new RegExp(p,"g"),u[p]);var x="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),N="January February March April May June July August September October November December".split(" ");u={"%a":function(l){return x[l.bg].substring(0,3)},"%A":function(l){return x[l.bg]},"%b":function(l){return N[l.Ig].substring(0,3)},"%B":function(l){return N[l.Ig]},
"%C":function(l){return h((l.qg+1900)/100|0,2)},"%d":function(l){return h(l.hh,2)},"%e":function(l){return g(l.hh,2," ")},"%g":function(l){return t(l).toString().substring(2)},"%G":function(l){return t(l)},"%H":function(l){return h(l.Hg,2)},"%I":function(l){l=l.Hg;0==l?l=12:12<l&&(l-=12);return h(l,2)},"%j":function(l){for(var w=0,B=0;B<=l.Ig-1;w+=(Hb(l.qg+1900)?Ib:Jb)[B++]);return h(l.hh+w,3)},"%m":function(l){return h(l.Ig+1,2)},"%M":function(l){return h(l.Ii,2)},"%n":function(){return"\n"},"%p":function(l){return 0<=
l.Hg&&12>l.Hg?"AM":"PM"},"%S":function(l){return h(l.Ji,2)},"%t":function(){return"\t"},"%u":function(l){return l.bg||7},"%U":function(l){return h(Math.floor((l.pg+7-l.bg)/7),2)},"%V":function(l){var w=Math.floor((l.pg+7-(l.bg+6)%7)/7);2>=(l.bg+371-l.pg-2)%7&&w++;if(w)53==w&&(B=(l.bg+371-l.pg)%7,4==B||3==B&&Hb(l.qg)||(w=1));else{w=52;var B=(l.bg+7-l.pg-1)%7;(4==B||5==B&&Hb(l.qg%400-1))&&w++}return h(w,2)},"%w":function(l){return l.bg},"%W":function(l){return h(Math.floor((l.pg+7-(l.bg+6)%7)/7),2)},
"%y":function(l){return(l.qg+1900).toString().substring(2)},"%Y":function(l){return l.qg+1900},"%z":function(l){l=l.Hi;var w=0<=l;l=Math.abs(l)/60;return(w?"+":"-")+String("0000"+(l/60*100+l%60)).slice(-4)},"%Z":function(l){return l.Ki},"%%":function(){return"%"}};d=d.replace(/%%/g,"\x00\x00");for(p in u)d.includes(p)&&(d=d.replace(new RegExp(p,"g"),u[p](e)));d=d.replace(/\0\0/g,"%");p=jb(d,!1);if(p.length>c)return 0;r.set(p,a);return p.length-1}var Lb=[];
function Mb(a){var c=Lb[a];c||(a>=Lb.length&&(Lb.length=a+1),Lb[a]=c=Ga.get(a));return c}function Nb(a,c,d,e){a||(a=this);this.parent=a;this.Sf=a.Sf;this.zg=null;this.id=D.zi++;this.name=c;this.mode=d;this.Kf={};this.Mf={};this.rdev=e}
Object.defineProperties(Nb.prototype,{read:{get:function(){return 365===(this.mode&365)},set:function(a){a?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146===(this.mode&146)},set:function(a){a?this.mode|=146:this.mode&=-147}},vi:{get:function(){return D.Tf(this.mode)}},Zg:{get:function(){return D.Cg(this.mode)}}});D.Dh=Nb;D.Gi();var sb;b.FS_createPath=D.Lg;b.FS_createDataFile=D.wg;b.FS_createPreloadedFile=D.oh;b.FS_unlink=D.unlink;b.FS_createLazyFile=D.nh;b.FS_createDevice=D.Wf;
var $b={c:function(a,c,d,e){n("Assertion failed: "+q(a)+", at: "+[c?q(c):"unknown filename",d,e?q(e):"unknown function"])},q:function(a){return zb(a+24)+24},p:function(a,c,d){(new $a(a)).rg(c,d);ab++;throw a;},w:function(a,c,d){vb=d;try{var e=xb(a);switch(c){case 0:var g=wb();return 0>g?-28:D.ph(e,g).fd;case 1:case 2:return 0;case 3:return e.flags;case 4:return g=wb(),e.flags|=g,0;case 5:return g=wb(),Ca[g+0>>1]=2,0;case 6:case 7:return 0;case 16:case 8:return-28;case 9:return v[Ob()>>2]=28,-1;default:return-28}}catch(h){if("undefined"==
typeof D||!(h instanceof D.Jf))throw h;return-h.Rf}},M:function(a,c){try{var d=xb(a);return ub(D.stat,d.path,c)}catch(e){if("undefined"==typeof D||!(e instanceof D.Jf))throw e;return-e.Rf}},J:function(a,c){try{if(0===c)return-28;var d=D.cwd(),e=Aa(d)+1;if(c<e)return-68;za(d,ya,a,c);return e}catch(g){if("undefined"==typeof D||!(g instanceof D.Jf))throw g;return-g.Rf}},U:function(a,c,d){vb=d;try{var e=xb(a);switch(c){case 21509:case 21505:return e.tty?0:-59;case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:return e.tty?
0:-59;case 21519:if(!e.tty)return-59;var g=wb();return v[g>>2]=0;case 21520:return e.tty?-28:-59;case 21531:return g=wb(),D.Yg(e,c,g);case 21523:return e.tty?0:-59;case 21524:return e.tty?0:-59;default:return-28}}catch(h){if("undefined"==typeof D||!(h instanceof D.Jf))throw h;return-h.Rf}},K:function(a,c,d,e){try{c=q(c);var g=e&256;c=tb(a,c,e&4096);return ub(g?D.lstat:D.stat,c,d)}catch(h){if("undefined"==typeof D||!(h instanceof D.Jf))throw h;return-h.Rf}},u:function(a,c,d,e){vb=e;try{c=q(c);c=tb(a,
c);var g=e?wb():0;return D.open(c,d,g).fd}catch(h){if("undefined"==typeof D||!(h instanceof D.Jf))throw h;return-h.Rf}},D:function(a){try{return a=q(a),D.rmdir(a),0}catch(c){if("undefined"==typeof D||!(c instanceof D.Jf))throw c;return-c.Rf}},L:function(a,c){try{return a=q(a),ub(D.stat,a,c)}catch(d){if("undefined"==typeof D||!(d instanceof D.Jf))throw d;return-d.Rf}},E:function(a,c,d){try{return c=q(c),c=tb(a,c),0===d?D.unlink(c):512===d?D.rmdir(c):n("Invalid flags passed to unlinkat"),0}catch(e){if("undefined"==
typeof D||!(e instanceof D.Jf))throw e;return-e.Rf}},o:function(){return Date.now()},V:function(a){do{var c=y[a>>2];a+=4;var d=y[a>>2];a+=4;var e=y[a>>2];a+=4;c=q(c);D.Lg("/",db(c),!0,!0);D.wg(c,null,r.subarray(e,e+d),!0,!0,!0)}while(y[a>>2])},O:function(){return!0},B:function(){throw Infinity;},P:function(a,c){a=new Date(1E3*(y[a>>2]+4294967296*v[a+4>>2]));v[c>>2]=a.getUTCSeconds();v[c+4>>2]=a.getUTCMinutes();v[c+8>>2]=a.getUTCHours();v[c+12>>2]=a.getUTCDate();v[c+16>>2]=a.getUTCMonth();v[c+20>>
2]=a.getUTCFullYear()-1900;v[c+24>>2]=a.getUTCDay();v[c+28>>2]=(a.getTime()-Date.UTC(a.getUTCFullYear(),0,1,0,0,0,0))/864E5|0},Q:function(a,c){a=new Date(1E3*(y[a>>2]+4294967296*v[a+4>>2]));v[c>>2]=a.getSeconds();v[c+4>>2]=a.getMinutes();v[c+8>>2]=a.getHours();v[c+12>>2]=a.getDate();v[c+16>>2]=a.getMonth();v[c+20>>2]=a.getFullYear()-1900;v[c+24>>2]=a.getDay();var d=new Date(a.getFullYear(),0,1);v[c+28>>2]=(a.getTime()-d.getTime())/864E5|0;v[c+36>>2]=-(60*a.getTimezoneOffset());var e=(new Date(a.getFullYear(),
6,1)).getTimezoneOffset();d=d.getTimezoneOffset();v[c+32>>2]=(e!=d&&a.getTimezoneOffset()==Math.min(d,e))|0},R:function(a){var c=new Date(v[a+20>>2]+1900,v[a+16>>2],v[a+12>>2],v[a+8>>2],v[a+4>>2],v[a>>2],0),d=v[a+32>>2],e=c.getTimezoneOffset(),g=new Date(c.getFullYear(),0,1),h=(new Date(c.getFullYear(),6,1)).getTimezoneOffset(),k=g.getTimezoneOffset(),m=Math.min(k,h);0>d?v[a+32>>2]=Number(h!=k&&m==e):0<d!=(m==e)&&(h=Math.max(k,h),c.setTime(c.getTime()+6E4*((0<d?m:h)-e)));v[a+24>>2]=c.getDay();v[a+
28>>2]=(c.getTime()-g.getTime())/864E5|0;v[a>>2]=c.getSeconds();v[a+4>>2]=c.getMinutes();v[a+8>>2]=c.getHours();v[a+12>>2]=c.getDate();v[a+16>>2]=c.getMonth();return c.getTime()/1E3|0},F:function(a,c,d,e,g,h){try{var k=D.gg(e);if(!k)return-8;var m=D.lg(k,a,g,c,d),t=m.If;v[h>>2]=m.kh;return t}catch(u){if("undefined"==typeof D||!(u instanceof D.Jf))throw u;return-u.Rf}},G:function(a,c,d,e,g,h){try{var k=D.gg(g);if(k&&d&2){var m=ya.slice(a,a+c);D.sg(k,m,h,c,e)}}catch(t){if("undefined"==typeof D||!(t instanceof
D.Jf))throw t;return-t.Rf}},S:Bb,n:function(){n("")},t:function(a,c,d){Cb.length=0;var e;for(d>>=2;e=ya[c++];)d+=105!=e&d,Cb.push(105==e?v[d]:Ea[d++>>1]),++d;return Wa[a].apply(null,Cb)},N:Db,T:function(a,c,d){ya.copyWithin(a,c,c+d)},C:function(a){var c=ya.length;a>>>=0;if(2147483648<a)return!1;for(var d=1;4>=d;d*=2){var e=c*(1+.2/d);e=Math.min(e,a+100663296);var g=Math;e=Math.max(a,e);g=g.min.call(g,2147483648,e+(65536-e%65536)%65536);a:{try{ta.grow(g-Ba.byteLength+65535>>>16);Fa();var h=1;break a}catch(k){}h=
void 0}if(h)return!0}return!1},H:function(a,c){var d=0;Fb().forEach(function(e,g){var h=c+d;g=y[a+4*g>>2]=h;for(h=0;h<e.length;++h)r[g++>>0]=e.charCodeAt(h);r[g>>0]=0;d+=e.length+1});return 0},I:function(a,c){var d=Fb();y[a>>2]=d.length;var e=0;d.forEach(function(g){e+=g.length+1});y[c>>2]=e;return 0},m:function(a){if(!noExitRuntime){if(b.onExit)b.onExit(a);ua=!0}ea(a,new oa(a))},s:function(a){try{var c=xb(a);D.close(c);return 0}catch(d){if("undefined"==typeof D||!(d instanceof D.Jf))throw d;return d.Rf}},
v:function(a,c,d,e){try{a:{var g=xb(a);a=c;for(var h=c=0;h<d;h++){var k=y[a>>2],m=y[a+4>>2];a+=8;var t=D.read(g,r,k,m,void 0);if(0>t){var u=-1;break a}c+=t;if(t<m)break}u=c}v[e>>2]=u;return 0}catch(p){if("undefined"==typeof D||!(p instanceof D.Jf))throw p;return p.Rf}},z:function(a,c,d,e,g){try{c=d+2097152>>>0<4194305-!!c?(c>>>0)+4294967296*d:NaN;if(isNaN(c))return 61;var h=xb(a);D.Zf(h,c,e);C=[h.position>>>0,(A=h.position,1<=+Math.abs(A)?0<A?(Math.min(+Math.floor(A/4294967296),4294967295)|0)>>>0:
~~+Math.ceil((A-+(~~A>>>0))/4294967296)>>>0:0)];v[g>>2]=C[0];v[g+4>>2]=C[1];h.Vg&&0===c&&0===e&&(h.Vg=null);return 0}catch(k){if("undefined"==typeof D||!(k instanceof D.Jf))throw k;return k.Rf}},r:function(a,c,d,e){try{a:{var g=xb(a);a=c;for(var h=c=0;h<d;h++){var k=y[a>>2],m=y[a+4>>2];a+=8;var t=D.write(g,r,k,m,void 0);if(0>t){var u=-1;break a}c+=t}u=c}y[e>>2]=u;return 0}catch(p){if("undefined"==typeof D||!(p instanceof D.Jf))throw p;return p.Rf}},a:function(){return ra},e:Pb,h:Qb,d:Rb,j:Sb,k:Tb,
g:Ub,f:Vb,i:Wb,l:Xb,x:Yb,y:Zb,b:function(a){ra=a},W:Kb,A:function(a,c,d,e){return Kb(a,c,d,e)}};
(function(){function a(g){b.asm=g.exports;ta=b.asm.X;Fa();Ga=b.asm.tf;Ia.unshift(b.asm.Y);Ra("wasm-instantiate")}function c(g){a(g.instance)}function d(g){return Va().then(function(h){return WebAssembly.instantiate(h,e)}).then(function(h){return h}).then(g,function(h){pa("failed to asynchronously prepare wasm: "+h);n(h)})}var e={a:$b};Qa("wasm-instantiate");if(b.instantiateWasm)try{return b.instantiateWasm(e,a)}catch(g){return pa("Module.instantiateWasm callback failed with error: "+g),!1}(function(){return sa||
"function"!=typeof WebAssembly.instantiateStreaming||Sa()||z.startsWith("file://")||ia||"function"!=typeof fetch?d(c):fetch(z,{credentials:"same-origin"}).then(function(g){return WebAssembly.instantiateStreaming(g,e).then(c,function(h){pa("wasm streaming compile failed: "+h);pa("falling back to ArrayBuffer instantiation");return d(c)})})})().catch(ba);return{}})();b.___wasm_call_ctors=function(){return(b.___wasm_call_ctors=b.asm.Y).apply(null,arguments)};
var ac=b._emscripten_bind_ParagraphJustification___destroy___0=function(){return(ac=b._emscripten_bind_ParagraphJustification___destroy___0=b.asm.Z).apply(null,arguments)},bc=b._emscripten_bind_BoolPtr___destroy___0=function(){return(bc=b._emscripten_bind_BoolPtr___destroy___0=b.asm._).apply(null,arguments)},cc=b._emscripten_bind_TessResultRenderer_BeginDocument_1=function(){return(cc=b._emscripten_bind_TessResultRenderer_BeginDocument_1=b.asm.$).apply(null,arguments)},dc=b._emscripten_bind_TessResultRenderer_AddImage_1=
function(){return(dc=b._emscripten_bind_TessResultRenderer_AddImage_1=b.asm.aa).apply(null,arguments)},ec=b._emscripten_bind_TessResultRenderer_EndDocument_0=function(){return(ec=b._emscripten_bind_TessResultRenderer_EndDocument_0=b.asm.ba).apply(null,arguments)},fc=b._emscripten_bind_TessResultRenderer_happy_0=function(){return(fc=b._emscripten_bind_TessResultRenderer_happy_0=b.asm.ca).apply(null,arguments)},gc=b._emscripten_bind_TessResultRenderer_file_extension_0=function(){return(gc=b._emscripten_bind_TessResultRenderer_file_extension_0=
b.asm.da).apply(null,arguments)},hc=b._emscripten_bind_TessResultRenderer_title_0=function(){return(hc=b._emscripten_bind_TessResultRenderer_title_0=b.asm.ea).apply(null,arguments)},ic=b._emscripten_bind_TessResultRenderer_imagenum_0=function(){return(ic=b._emscripten_bind_TessResultRenderer_imagenum_0=b.asm.fa).apply(null,arguments)},jc=b._emscripten_bind_TessResultRenderer___destroy___0=function(){return(jc=b._emscripten_bind_TessResultRenderer___destroy___0=b.asm.ga).apply(null,arguments)},kc=
b._emscripten_bind_LongStarPtr___destroy___0=function(){return(kc=b._emscripten_bind_LongStarPtr___destroy___0=b.asm.ha).apply(null,arguments)},lc=b._emscripten_bind_VoidPtr___destroy___0=function(){return(lc=b._emscripten_bind_VoidPtr___destroy___0=b.asm.ia).apply(null,arguments)},mc=b._emscripten_bind_ResultIterator_ResultIterator_1=function(){return(mc=b._emscripten_bind_ResultIterator_ResultIterator_1=b.asm.ja).apply(null,arguments)},nc=b._emscripten_bind_ResultIterator_Begin_0=function(){return(nc=
b._emscripten_bind_ResultIterator_Begin_0=b.asm.ka).apply(null,arguments)},oc=b._emscripten_bind_ResultIterator_RestartParagraph_0=function(){return(oc=b._emscripten_bind_ResultIterator_RestartParagraph_0=b.asm.la).apply(null,arguments)},pc=b._emscripten_bind_ResultIterator_IsWithinFirstTextlineOfParagraph_0=function(){return(pc=b._emscripten_bind_ResultIterator_IsWithinFirstTextlineOfParagraph_0=b.asm.ma).apply(null,arguments)},qc=b._emscripten_bind_ResultIterator_RestartRow_0=function(){return(qc=
b._emscripten_bind_ResultIterator_RestartRow_0=b.asm.na).apply(null,arguments)},rc=b._emscripten_bind_ResultIterator_Next_1=function(){return(rc=b._emscripten_bind_ResultIterator_Next_1=b.asm.oa).apply(null,arguments)},sc=b._emscripten_bind_ResultIterator_IsAtBeginningOf_1=function(){return(sc=b._emscripten_bind_ResultIterator_IsAtBeginningOf_1=b.asm.pa).apply(null,arguments)},tc=b._emscripten_bind_ResultIterator_IsAtFinalElement_2=function(){return(tc=b._emscripten_bind_ResultIterator_IsAtFinalElement_2=
b.asm.qa).apply(null,arguments)},uc=b._emscripten_bind_ResultIterator_Cmp_1=function(){return(uc=b._emscripten_bind_ResultIterator_Cmp_1=b.asm.ra).apply(null,arguments)},vc=b._emscripten_bind_ResultIterator_SetBoundingBoxComponents_2=function(){return(vc=b._emscripten_bind_ResultIterator_SetBoundingBoxComponents_2=b.asm.sa).apply(null,arguments)},wc=b._emscripten_bind_ResultIterator_BoundingBox_5=function(){return(wc=b._emscripten_bind_ResultIterator_BoundingBox_5=b.asm.ta).apply(null,arguments)},
xc=b._emscripten_bind_ResultIterator_BoundingBox_6=function(){return(xc=b._emscripten_bind_ResultIterator_BoundingBox_6=b.asm.ua).apply(null,arguments)},yc=b._emscripten_bind_ResultIterator_BoundingBoxInternal_5=function(){return(yc=b._emscripten_bind_ResultIterator_BoundingBoxInternal_5=b.asm.va).apply(null,arguments)},zc=b._emscripten_bind_ResultIterator_Empty_1=function(){return(zc=b._emscripten_bind_ResultIterator_Empty_1=b.asm.wa).apply(null,arguments)},Ac=b._emscripten_bind_ResultIterator_BlockType_0=
function(){return(Ac=b._emscripten_bind_ResultIterator_BlockType_0=b.asm.xa).apply(null,arguments)},Bc=b._emscripten_bind_ResultIterator_BlockPolygon_0=function(){return(Bc=b._emscripten_bind_ResultIterator_BlockPolygon_0=b.asm.ya).apply(null,arguments)},Cc=b._emscripten_bind_ResultIterator_GetBinaryImage_1=function(){return(Cc=b._emscripten_bind_ResultIterator_GetBinaryImage_1=b.asm.za).apply(null,arguments)},Dc=b._emscripten_bind_ResultIterator_GetImage_5=function(){return(Dc=b._emscripten_bind_ResultIterator_GetImage_5=
b.asm.Aa).apply(null,arguments)},Ec=b._emscripten_bind_ResultIterator_Baseline_5=function(){return(Ec=b._emscripten_bind_ResultIterator_Baseline_5=b.asm.Ba).apply(null,arguments)},Fc=b._emscripten_bind_ResultIterator_Orientation_4=function(){return(Fc=b._emscripten_bind_ResultIterator_Orientation_4=b.asm.Ca).apply(null,arguments)},Gc=b._emscripten_bind_ResultIterator_ParagraphInfo_4=function(){return(Gc=b._emscripten_bind_ResultIterator_ParagraphInfo_4=b.asm.Da).apply(null,arguments)},Hc=b._emscripten_bind_ResultIterator_ParagraphIsLtr_0=
function(){return(Hc=b._emscripten_bind_ResultIterator_ParagraphIsLtr_0=b.asm.Ea).apply(null,arguments)},Ic=b._emscripten_bind_ResultIterator_GetUTF8Text_1=function(){return(Ic=b._emscripten_bind_ResultIterator_GetUTF8Text_1=b.asm.Fa).apply(null,arguments)},Jc=b._emscripten_bind_ResultIterator_SetLineSeparator_1=function(){return(Jc=b._emscripten_bind_ResultIterator_SetLineSeparator_1=b.asm.Ga).apply(null,arguments)},Kc=b._emscripten_bind_ResultIterator_SetParagraphSeparator_1=function(){return(Kc=
b._emscripten_bind_ResultIterator_SetParagraphSeparator_1=b.asm.Ha).apply(null,arguments)},Lc=b._emscripten_bind_ResultIterator_Confidence_1=function(){return(Lc=b._emscripten_bind_ResultIterator_Confidence_1=b.asm.Ia).apply(null,arguments)},Mc=b._emscripten_bind_ResultIterator_WordFontAttributes_8=function(){return(Mc=b._emscripten_bind_ResultIterator_WordFontAttributes_8=b.asm.Ja).apply(null,arguments)},Nc=b._emscripten_bind_ResultIterator_WordRecognitionLanguage_0=function(){return(Nc=b._emscripten_bind_ResultIterator_WordRecognitionLanguage_0=
b.asm.Ka).apply(null,arguments)},Oc=b._emscripten_bind_ResultIterator_WordDirection_0=function(){return(Oc=b._emscripten_bind_ResultIterator_WordDirection_0=b.asm.La).apply(null,arguments)},Pc=b._emscripten_bind_ResultIterator_WordIsFromDictionary_0=function(){return(Pc=b._emscripten_bind_ResultIterator_WordIsFromDictionary_0=b.asm.Ma).apply(null,arguments)},Qc=b._emscripten_bind_ResultIterator_WordIsNumeric_0=function(){return(Qc=b._emscripten_bind_ResultIterator_WordIsNumeric_0=b.asm.Na).apply(null,
arguments)},Rc=b._emscripten_bind_ResultIterator_HasBlamerInfo_0=function(){return(Rc=b._emscripten_bind_ResultIterator_HasBlamerInfo_0=b.asm.Oa).apply(null,arguments)},Sc=b._emscripten_bind_ResultIterator_HasTruthString_0=function(){return(Sc=b._emscripten_bind_ResultIterator_HasTruthString_0=b.asm.Pa).apply(null,arguments)},Tc=b._emscripten_bind_ResultIterator_EquivalentToTruth_1=function(){return(Tc=b._emscripten_bind_ResultIterator_EquivalentToTruth_1=b.asm.Qa).apply(null,arguments)},Uc=b._emscripten_bind_ResultIterator_WordTruthUTF8Text_0=
function(){return(Uc=b._emscripten_bind_ResultIterator_WordTruthUTF8Text_0=b.asm.Ra).apply(null,arguments)},Vc=b._emscripten_bind_ResultIterator_WordNormedUTF8Text_0=function(){return(Vc=b._emscripten_bind_ResultIterator_WordNormedUTF8Text_0=b.asm.Sa).apply(null,arguments)},Wc=b._emscripten_bind_ResultIterator_WordLattice_1=function(){return(Wc=b._emscripten_bind_ResultIterator_WordLattice_1=b.asm.Ta).apply(null,arguments)},Xc=b._emscripten_bind_ResultIterator_SymbolIsSuperscript_0=function(){return(Xc=
b._emscripten_bind_ResultIterator_SymbolIsSuperscript_0=b.asm.Ua).apply(null,arguments)},Yc=b._emscripten_bind_ResultIterator_SymbolIsSubscript_0=function(){return(Yc=b._emscripten_bind_ResultIterator_SymbolIsSubscript_0=b.asm.Va).apply(null,arguments)},Zc=b._emscripten_bind_ResultIterator_SymbolIsDropcap_0=function(){return(Zc=b._emscripten_bind_ResultIterator_SymbolIsDropcap_0=b.asm.Wa).apply(null,arguments)},$c=b._emscripten_bind_ResultIterator___destroy___0=function(){return($c=b._emscripten_bind_ResultIterator___destroy___0=
b.asm.Xa).apply(null,arguments)},ad=b._emscripten_bind_TextlineOrder___destroy___0=function(){return(ad=b._emscripten_bind_TextlineOrder___destroy___0=b.asm.Ya).apply(null,arguments)},bd=b._emscripten_bind_ETEXT_DESC___destroy___0=function(){return(bd=b._emscripten_bind_ETEXT_DESC___destroy___0=b.asm.Za).apply(null,arguments)},cd=b._emscripten_bind_PageIterator_Begin_0=function(){return(cd=b._emscripten_bind_PageIterator_Begin_0=b.asm._a).apply(null,arguments)},dd=b._emscripten_bind_PageIterator_RestartParagraph_0=
function(){return(dd=b._emscripten_bind_PageIterator_RestartParagraph_0=b.asm.$a).apply(null,arguments)},ed=b._emscripten_bind_PageIterator_IsWithinFirstTextlineOfParagraph_0=function(){return(ed=b._emscripten_bind_PageIterator_IsWithinFirstTextlineOfParagraph_0=b.asm.ab).apply(null,arguments)},fd=b._emscripten_bind_PageIterator_RestartRow_0=function(){return(fd=b._emscripten_bind_PageIterator_RestartRow_0=b.asm.bb).apply(null,arguments)},gd=b._emscripten_bind_PageIterator_Next_1=function(){return(gd=
b._emscripten_bind_PageIterator_Next_1=b.asm.cb).apply(null,arguments)},hd=b._emscripten_bind_PageIterator_IsAtBeginningOf_1=function(){return(hd=b._emscripten_bind_PageIterator_IsAtBeginningOf_1=b.asm.db).apply(null,arguments)},jd=b._emscripten_bind_PageIterator_IsAtFinalElement_2=function(){return(jd=b._emscripten_bind_PageIterator_IsAtFinalElement_2=b.asm.eb).apply(null,arguments)},kd=b._emscripten_bind_PageIterator_Cmp_1=function(){return(kd=b._emscripten_bind_PageIterator_Cmp_1=b.asm.fb).apply(null,
arguments)},ld=b._emscripten_bind_PageIterator_SetBoundingBoxComponents_2=function(){return(ld=b._emscripten_bind_PageIterator_SetBoundingBoxComponents_2=b.asm.gb).apply(null,arguments)},md=b._emscripten_bind_PageIterator_BoundingBox_5=function(){return(md=b._emscripten_bind_PageIterator_BoundingBox_5=b.asm.hb).apply(null,arguments)},nd=b._emscripten_bind_PageIterator_BoundingBox_6=function(){return(nd=b._emscripten_bind_PageIterator_BoundingBox_6=b.asm.ib).apply(null,arguments)},od=b._emscripten_bind_PageIterator_BoundingBoxInternal_5=
function(){return(od=b._emscripten_bind_PageIterator_BoundingBoxInternal_5=b.asm.jb).apply(null,arguments)},pd=b._emscripten_bind_PageIterator_Empty_1=function(){return(pd=b._emscripten_bind_PageIterator_Empty_1=b.asm.kb).apply(null,arguments)},qd=b._emscripten_bind_PageIterator_BlockType_0=function(){return(qd=b._emscripten_bind_PageIterator_BlockType_0=b.asm.lb).apply(null,arguments)},rd=b._emscripten_bind_PageIterator_BlockPolygon_0=function(){return(rd=b._emscripten_bind_PageIterator_BlockPolygon_0=
b.asm.mb).apply(null,arguments)},sd=b._emscripten_bind_PageIterator_GetBinaryImage_1=function(){return(sd=b._emscripten_bind_PageIterator_GetBinaryImage_1=b.asm.nb).apply(null,arguments)},td=b._emscripten_bind_PageIterator_GetImage_5=function(){return(td=b._emscripten_bind_PageIterator_GetImage_5=b.asm.ob).apply(null,arguments)},ud=b._emscripten_bind_PageIterator_Baseline_5=function(){return(ud=b._emscripten_bind_PageIterator_Baseline_5=b.asm.pb).apply(null,arguments)},vd=b._emscripten_bind_PageIterator_Orientation_4=
function(){return(vd=b._emscripten_bind_PageIterator_Orientation_4=b.asm.qb).apply(null,arguments)},wd=b._emscripten_bind_PageIterator_ParagraphInfo_4=function(){return(wd=b._emscripten_bind_PageIterator_ParagraphInfo_4=b.asm.rb).apply(null,arguments)},xd=b._emscripten_bind_PageIterator___destroy___0=function(){return(xd=b._emscripten_bind_PageIterator___destroy___0=b.asm.sb).apply(null,arguments)},yd=b._emscripten_bind_WritingDirection___destroy___0=function(){return(yd=b._emscripten_bind_WritingDirection___destroy___0=
b.asm.tb).apply(null,arguments)},zd=b._emscripten_bind_WordChoiceIterator_WordChoiceIterator_1=function(){return(zd=b._emscripten_bind_WordChoiceIterator_WordChoiceIterator_1=b.asm.ub).apply(null,arguments)},Ad=b._emscripten_bind_WordChoiceIterator_Next_0=function(){return(Ad=b._emscripten_bind_WordChoiceIterator_Next_0=b.asm.vb).apply(null,arguments)},Bd=b._emscripten_bind_WordChoiceIterator_GetUTF8Text_0=function(){return(Bd=b._emscripten_bind_WordChoiceIterator_GetUTF8Text_0=b.asm.wb).apply(null,
arguments)},Cd=b._emscripten_bind_WordChoiceIterator_Confidence_0=function(){return(Cd=b._emscripten_bind_WordChoiceIterator_Confidence_0=b.asm.xb).apply(null,arguments)},Dd=b._emscripten_bind_WordChoiceIterator___destroy___0=function(){return(Dd=b._emscripten_bind_WordChoiceIterator___destroy___0=b.asm.yb).apply(null,arguments)},Ed=b._emscripten_bind_Box_get_x_0=function(){return(Ed=b._emscripten_bind_Box_get_x_0=b.asm.zb).apply(null,arguments)},Fd=b._emscripten_bind_Box_get_y_0=function(){return(Fd=
b._emscripten_bind_Box_get_y_0=b.asm.Ab).apply(null,arguments)},Gd=b._emscripten_bind_Box_get_w_0=function(){return(Gd=b._emscripten_bind_Box_get_w_0=b.asm.Bb).apply(null,arguments)},Hd=b._emscripten_bind_Box_get_h_0=function(){return(Hd=b._emscripten_bind_Box_get_h_0=b.asm.Cb).apply(null,arguments)},Id=b._emscripten_bind_Box_get_refcount_0=function(){return(Id=b._emscripten_bind_Box_get_refcount_0=b.asm.Db).apply(null,arguments)},Jd=b._emscripten_bind_Box___destroy___0=function(){return(Jd=b._emscripten_bind_Box___destroy___0=
b.asm.Eb).apply(null,arguments)},Kd=b._emscripten_bind_TessPDFRenderer_TessPDFRenderer_3=function(){return(Kd=b._emscripten_bind_TessPDFRenderer_TessPDFRenderer_3=b.asm.Fb).apply(null,arguments)},Ld=b._emscripten_bind_TessPDFRenderer_BeginDocument_1=function(){return(Ld=b._emscripten_bind_TessPDFRenderer_BeginDocument_1=b.asm.Gb).apply(null,arguments)},Md=b._emscripten_bind_TessPDFRenderer_AddImage_1=function(){return(Md=b._emscripten_bind_TessPDFRenderer_AddImage_1=b.asm.Hb).apply(null,arguments)},
Nd=b._emscripten_bind_TessPDFRenderer_EndDocument_0=function(){return(Nd=b._emscripten_bind_TessPDFRenderer_EndDocument_0=b.asm.Ib).apply(null,arguments)},Od=b._emscripten_bind_TessPDFRenderer_happy_0=function(){return(Od=b._emscripten_bind_TessPDFRenderer_happy_0=b.asm.Jb).apply(null,arguments)},Pd=b._emscripten_bind_TessPDFRenderer_file_extension_0=function(){return(Pd=b._emscripten_bind_TessPDFRenderer_file_extension_0=b.asm.Kb).apply(null,arguments)},Qd=b._emscripten_bind_TessPDFRenderer_title_0=
function(){return(Qd=b._emscripten_bind_TessPDFRenderer_title_0=b.asm.Lb).apply(null,arguments)},Rd=b._emscripten_bind_TessPDFRenderer_imagenum_0=function(){return(Rd=b._emscripten_bind_TessPDFRenderer_imagenum_0=b.asm.Mb).apply(null,arguments)},Sd=b._emscripten_bind_TessPDFRenderer___destroy___0=function(){return(Sd=b._emscripten_bind_TessPDFRenderer___destroy___0=b.asm.Nb).apply(null,arguments)},Td=b._emscripten_bind_PixaPtr___destroy___0=function(){return(Td=b._emscripten_bind_PixaPtr___destroy___0=
b.asm.Ob).apply(null,arguments)},Ud=b._emscripten_bind_FloatPtr___destroy___0=function(){return(Ud=b._emscripten_bind_FloatPtr___destroy___0=b.asm.Pb).apply(null,arguments)},Vd=b._emscripten_bind_ChoiceIterator_ChoiceIterator_1=function(){return(Vd=b._emscripten_bind_ChoiceIterator_ChoiceIterator_1=b.asm.Qb).apply(null,arguments)},Wd=b._emscripten_bind_ChoiceIterator_Next_0=function(){return(Wd=b._emscripten_bind_ChoiceIterator_Next_0=b.asm.Rb).apply(null,arguments)},Xd=b._emscripten_bind_ChoiceIterator_GetUTF8Text_0=
function(){return(Xd=b._emscripten_bind_ChoiceIterator_GetUTF8Text_0=b.asm.Sb).apply(null,arguments)},Yd=b._emscripten_bind_ChoiceIterator_Confidence_0=function(){return(Yd=b._emscripten_bind_ChoiceIterator_Confidence_0=b.asm.Tb).apply(null,arguments)},Zd=b._emscripten_bind_ChoiceIterator___destroy___0=function(){return(Zd=b._emscripten_bind_ChoiceIterator___destroy___0=b.asm.Ub).apply(null,arguments)},$d=b._emscripten_bind_PixPtr___destroy___0=function(){return($d=b._emscripten_bind_PixPtr___destroy___0=
b.asm.Vb).apply(null,arguments)},ae=b._emscripten_bind_UNICHARSET_get_script_from_script_id_1=function(){return(ae=b._emscripten_bind_UNICHARSET_get_script_from_script_id_1=b.asm.Wb).apply(null,arguments)},be=b._emscripten_bind_UNICHARSET_get_script_id_from_name_1=function(){return(be=b._emscripten_bind_UNICHARSET_get_script_id_from_name_1=b.asm.Xb).apply(null,arguments)},ce=b._emscripten_bind_UNICHARSET_get_script_table_size_0=function(){return(ce=b._emscripten_bind_UNICHARSET_get_script_table_size_0=
b.asm.Yb).apply(null,arguments)},de=b._emscripten_bind_UNICHARSET___destroy___0=function(){return(de=b._emscripten_bind_UNICHARSET___destroy___0=b.asm.Zb).apply(null,arguments)},ee=b._emscripten_bind_IntPtr___destroy___0=function(){return(ee=b._emscripten_bind_IntPtr___destroy___0=b.asm._b).apply(null,arguments)},fe=b._emscripten_bind_Orientation___destroy___0=function(){return(fe=b._emscripten_bind_Orientation___destroy___0=b.asm.$b).apply(null,arguments)},ge=b._emscripten_bind_OSBestResult_get_orientation_id_0=
function(){return(ge=b._emscripten_bind_OSBestResult_get_orientation_id_0=b.asm.ac).apply(null,arguments)},he=b._emscripten_bind_OSBestResult_get_script_id_0=function(){return(he=b._emscripten_bind_OSBestResult_get_script_id_0=b.asm.bc).apply(null,arguments)},ie=b._emscripten_bind_OSBestResult_get_sconfidence_0=function(){return(ie=b._emscripten_bind_OSBestResult_get_sconfidence_0=b.asm.cc).apply(null,arguments)},je=b._emscripten_bind_OSBestResult_get_oconfidence_0=function(){return(je=b._emscripten_bind_OSBestResult_get_oconfidence_0=
b.asm.dc).apply(null,arguments)},ke=b._emscripten_bind_OSBestResult___destroy___0=function(){return(ke=b._emscripten_bind_OSBestResult___destroy___0=b.asm.ec).apply(null,arguments)},le=b._emscripten_bind_Boxa_get_n_0=function(){return(le=b._emscripten_bind_Boxa_get_n_0=b.asm.fc).apply(null,arguments)},me=b._emscripten_bind_Boxa_get_nalloc_0=function(){return(me=b._emscripten_bind_Boxa_get_nalloc_0=b.asm.gc).apply(null,arguments)},ne=b._emscripten_bind_Boxa_get_refcount_0=function(){return(ne=b._emscripten_bind_Boxa_get_refcount_0=
b.asm.hc).apply(null,arguments)},oe=b._emscripten_bind_Boxa_get_box_0=function(){return(oe=b._emscripten_bind_Boxa_get_box_0=b.asm.ic).apply(null,arguments)},pe=b._emscripten_bind_Boxa___destroy___0=function(){return(pe=b._emscripten_bind_Boxa___destroy___0=b.asm.jc).apply(null,arguments)},qe=b._emscripten_bind_PixColormap_get_array_0=function(){return(qe=b._emscripten_bind_PixColormap_get_array_0=b.asm.kc).apply(null,arguments)},re=b._emscripten_bind_PixColormap_get_depth_0=function(){return(re=
b._emscripten_bind_PixColormap_get_depth_0=b.asm.lc).apply(null,arguments)},se=b._emscripten_bind_PixColormap_get_nalloc_0=function(){return(se=b._emscripten_bind_PixColormap_get_nalloc_0=b.asm.mc).apply(null,arguments)},te=b._emscripten_bind_PixColormap_get_n_0=function(){return(te=b._emscripten_bind_PixColormap_get_n_0=b.asm.nc).apply(null,arguments)},ue=b._emscripten_bind_PixColormap___destroy___0=function(){return(ue=b._emscripten_bind_PixColormap___destroy___0=b.asm.oc).apply(null,arguments)},
ve=b._emscripten_bind_Pta_get_n_0=function(){return(ve=b._emscripten_bind_Pta_get_n_0=b.asm.pc).apply(null,arguments)},we=b._emscripten_bind_Pta_get_nalloc_0=function(){return(we=b._emscripten_bind_Pta_get_nalloc_0=b.asm.qc).apply(null,arguments)},xe=b._emscripten_bind_Pta_get_refcount_0=function(){return(xe=b._emscripten_bind_Pta_get_refcount_0=b.asm.rc).apply(null,arguments)},ye=b._emscripten_bind_Pta_get_x_0=function(){return(ye=b._emscripten_bind_Pta_get_x_0=b.asm.sc).apply(null,arguments)},ze=
b._emscripten_bind_Pta_get_y_0=function(){return(ze=b._emscripten_bind_Pta_get_y_0=b.asm.tc).apply(null,arguments)},Ae=b._emscripten_bind_Pta___destroy___0=function(){return(Ae=b._emscripten_bind_Pta___destroy___0=b.asm.uc).apply(null,arguments)},Be=b._emscripten_bind_Pix_get_w_0=function(){return(Be=b._emscripten_bind_Pix_get_w_0=b.asm.vc).apply(null,arguments)},Ce=b._emscripten_bind_Pix_get_h_0=function(){return(Ce=b._emscripten_bind_Pix_get_h_0=b.asm.wc).apply(null,arguments)},De=b._emscripten_bind_Pix_get_d_0=
function(){return(De=b._emscripten_bind_Pix_get_d_0=b.asm.xc).apply(null,arguments)},Ee=b._emscripten_bind_Pix_get_spp_0=function(){return(Ee=b._emscripten_bind_Pix_get_spp_0=b.asm.yc).apply(null,arguments)},Fe=b._emscripten_bind_Pix_get_wpl_0=function(){return(Fe=b._emscripten_bind_Pix_get_wpl_0=b.asm.zc).apply(null,arguments)},Ge=b._emscripten_bind_Pix_get_refcount_0=function(){return(Ge=b._emscripten_bind_Pix_get_refcount_0=b.asm.Ac).apply(null,arguments)},He=b._emscripten_bind_Pix_get_xres_0=
function(){return(He=b._emscripten_bind_Pix_get_xres_0=b.asm.Bc).apply(null,arguments)},Ie=b._emscripten_bind_Pix_get_yres_0=function(){return(Ie=b._emscripten_bind_Pix_get_yres_0=b.asm.Cc).apply(null,arguments)},Je=b._emscripten_bind_Pix_get_informat_0=function(){return(Je=b._emscripten_bind_Pix_get_informat_0=b.asm.Dc).apply(null,arguments)},Ke=b._emscripten_bind_Pix_get_special_0=function(){return(Ke=b._emscripten_bind_Pix_get_special_0=b.asm.Ec).apply(null,arguments)},Le=b._emscripten_bind_Pix_get_text_0=
function(){return(Le=b._emscripten_bind_Pix_get_text_0=b.asm.Fc).apply(null,arguments)},Me=b._emscripten_bind_Pix_get_colormap_0=function(){return(Me=b._emscripten_bind_Pix_get_colormap_0=b.asm.Gc).apply(null,arguments)},Ne=b._emscripten_bind_Pix_get_data_0=function(){return(Ne=b._emscripten_bind_Pix_get_data_0=b.asm.Hc).apply(null,arguments)},Oe=b._emscripten_bind_Pix___destroy___0=function(){return(Oe=b._emscripten_bind_Pix___destroy___0=b.asm.Ic).apply(null,arguments)},Pe=b._emscripten_bind_DoublePtr___destroy___0=
function(){return(Pe=b._emscripten_bind_DoublePtr___destroy___0=b.asm.Jc).apply(null,arguments)},Qe=b._emscripten_bind_Dawg___destroy___0=function(){return(Qe=b._emscripten_bind_Dawg___destroy___0=b.asm.Kc).apply(null,arguments)},Re=b._emscripten_bind_BoxPtr___destroy___0=function(){return(Re=b._emscripten_bind_BoxPtr___destroy___0=b.asm.Lc).apply(null,arguments)},Se=b._emscripten_bind_TessBaseAPI_TessBaseAPI_0=function(){return(Se=b._emscripten_bind_TessBaseAPI_TessBaseAPI_0=b.asm.Mc).apply(null,
arguments)},Te=b._emscripten_bind_TessBaseAPI_Version_0=function(){return(Te=b._emscripten_bind_TessBaseAPI_Version_0=b.asm.Nc).apply(null,arguments)},Ue=b._emscripten_bind_TessBaseAPI_SetInputName_1=function(){return(Ue=b._emscripten_bind_TessBaseAPI_SetInputName_1=b.asm.Oc).apply(null,arguments)},Ve=b._emscripten_bind_TessBaseAPI_GetInputName_0=function(){return(Ve=b._emscripten_bind_TessBaseAPI_GetInputName_0=b.asm.Pc).apply(null,arguments)},We=b._emscripten_bind_TessBaseAPI_SetInputImage_1=function(){return(We=
b._emscripten_bind_TessBaseAPI_SetInputImage_1=b.asm.Qc).apply(null,arguments)},Xe=b._emscripten_bind_TessBaseAPI_GetInputImage_0=function(){return(Xe=b._emscripten_bind_TessBaseAPI_GetInputImage_0=b.asm.Rc).apply(null,arguments)},Ye=b._emscripten_bind_TessBaseAPI_GetSourceYResolution_0=function(){return(Ye=b._emscripten_bind_TessBaseAPI_GetSourceYResolution_0=b.asm.Sc).apply(null,arguments)},Ze=b._emscripten_bind_TessBaseAPI_GetDatapath_0=function(){return(Ze=b._emscripten_bind_TessBaseAPI_GetDatapath_0=
b.asm.Tc).apply(null,arguments)},$e=b._emscripten_bind_TessBaseAPI_SetOutputName_1=function(){return($e=b._emscripten_bind_TessBaseAPI_SetOutputName_1=b.asm.Uc).apply(null,arguments)},af=b._emscripten_bind_TessBaseAPI_SetVariable_2=function(){return(af=b._emscripten_bind_TessBaseAPI_SetVariable_2=b.asm.Vc).apply(null,arguments)},bf=b._emscripten_bind_TessBaseAPI_SetDebugVariable_2=function(){return(bf=b._emscripten_bind_TessBaseAPI_SetDebugVariable_2=b.asm.Wc).apply(null,arguments)},cf=b._emscripten_bind_TessBaseAPI_GetIntVariable_2=
function(){return(cf=b._emscripten_bind_TessBaseAPI_GetIntVariable_2=b.asm.Xc).apply(null,arguments)},df=b._emscripten_bind_TessBaseAPI_GetBoolVariable_2=function(){return(df=b._emscripten_bind_TessBaseAPI_GetBoolVariable_2=b.asm.Yc).apply(null,arguments)},ef=b._emscripten_bind_TessBaseAPI_GetDoubleVariable_2=function(){return(ef=b._emscripten_bind_TessBaseAPI_GetDoubleVariable_2=b.asm.Zc).apply(null,arguments)},ff=b._emscripten_bind_TessBaseAPI_GetStringVariable_1=function(){return(ff=b._emscripten_bind_TessBaseAPI_GetStringVariable_1=
b.asm._c).apply(null,arguments)},gf=b._emscripten_bind_TessBaseAPI_SaveParameters_1=function(){return(gf=b._emscripten_bind_TessBaseAPI_SaveParameters_1=b.asm.$c).apply(null,arguments)},hf=b._emscripten_bind_TessBaseAPI_RestoreParameters_1=function(){return(hf=b._emscripten_bind_TessBaseAPI_RestoreParameters_1=b.asm.ad).apply(null,arguments)},jf=b._emscripten_bind_TessBaseAPI_Init_2=function(){return(jf=b._emscripten_bind_TessBaseAPI_Init_2=b.asm.bd).apply(null,arguments)},kf=b._emscripten_bind_TessBaseAPI_Init_3=
function(){return(kf=b._emscripten_bind_TessBaseAPI_Init_3=b.asm.cd).apply(null,arguments)},lf=b._emscripten_bind_TessBaseAPI_Init_4=function(){return(lf=b._emscripten_bind_TessBaseAPI_Init_4=b.asm.dd).apply(null,arguments)},mf=b._emscripten_bind_TessBaseAPI_GetInitLanguagesAsString_0=function(){return(mf=b._emscripten_bind_TessBaseAPI_GetInitLanguagesAsString_0=b.asm.ed).apply(null,arguments)},nf=b._emscripten_bind_TessBaseAPI_InitForAnalysePage_0=function(){return(nf=b._emscripten_bind_TessBaseAPI_InitForAnalysePage_0=
b.asm.fd).apply(null,arguments)},of=b._emscripten_bind_TessBaseAPI_ReadConfigFile_1=function(){return(of=b._emscripten_bind_TessBaseAPI_ReadConfigFile_1=b.asm.gd).apply(null,arguments)},pf=b._emscripten_bind_TessBaseAPI_ReadDebugConfigFile_1=function(){return(pf=b._emscripten_bind_TessBaseAPI_ReadDebugConfigFile_1=b.asm.hd).apply(null,arguments)},qf=b._emscripten_bind_TessBaseAPI_SetPageSegMode_1=function(){return(qf=b._emscripten_bind_TessBaseAPI_SetPageSegMode_1=b.asm.id).apply(null,arguments)},
rf=b._emscripten_bind_TessBaseAPI_GetPageSegMode_0=function(){return(rf=b._emscripten_bind_TessBaseAPI_GetPageSegMode_0=b.asm.jd).apply(null,arguments)},sf=b._emscripten_bind_TessBaseAPI_TesseractRect_7=function(){return(sf=b._emscripten_bind_TessBaseAPI_TesseractRect_7=b.asm.kd).apply(null,arguments)},tf=b._emscripten_bind_TessBaseAPI_ClearAdaptiveClassifier_0=function(){return(tf=b._emscripten_bind_TessBaseAPI_ClearAdaptiveClassifier_0=b.asm.ld).apply(null,arguments)},uf=b._emscripten_bind_TessBaseAPI_SetImage_1=
function(){return(uf=b._emscripten_bind_TessBaseAPI_SetImage_1=b.asm.md).apply(null,arguments)},vf=b._emscripten_bind_TessBaseAPI_SetImage_5=function(){return(vf=b._emscripten_bind_TessBaseAPI_SetImage_5=b.asm.nd).apply(null,arguments)},wf=b._emscripten_bind_TessBaseAPI_SetImageFile_1=function(){return(wf=b._emscripten_bind_TessBaseAPI_SetImageFile_1=b.asm.od).apply(null,arguments)},xf=b._emscripten_bind_TessBaseAPI_SetSourceResolution_1=function(){return(xf=b._emscripten_bind_TessBaseAPI_SetSourceResolution_1=
b.asm.pd).apply(null,arguments)},yf=b._emscripten_bind_TessBaseAPI_SetRectangle_4=function(){return(yf=b._emscripten_bind_TessBaseAPI_SetRectangle_4=b.asm.qd).apply(null,arguments)},zf=b._emscripten_bind_TessBaseAPI_GetThresholdedImage_0=function(){return(zf=b._emscripten_bind_TessBaseAPI_GetThresholdedImage_0=b.asm.rd).apply(null,arguments)},Af=b._emscripten_bind_TessBaseAPI_WriteImage_0=function(){return(Af=b._emscripten_bind_TessBaseAPI_WriteImage_0=b.asm.sd).apply(null,arguments)},Bf=b._emscripten_bind_TessBaseAPI_FindLines_0=
function(){return(Bf=b._emscripten_bind_TessBaseAPI_FindLines_0=b.asm.td).apply(null,arguments)},Cf=b._emscripten_bind_TessBaseAPI_GetGradient_0=function(){return(Cf=b._emscripten_bind_TessBaseAPI_GetGradient_0=b.asm.ud).apply(null,arguments)},Df=b._emscripten_bind_TessBaseAPI_GetRegions_1=function(){return(Df=b._emscripten_bind_TessBaseAPI_GetRegions_1=b.asm.vd).apply(null,arguments)},Ef=b._emscripten_bind_TessBaseAPI_GetTextlines_2=function(){return(Ef=b._emscripten_bind_TessBaseAPI_GetTextlines_2=
b.asm.wd).apply(null,arguments)},Ff=b._emscripten_bind_TessBaseAPI_GetTextlines_5=function(){return(Ff=b._emscripten_bind_TessBaseAPI_GetTextlines_5=b.asm.xd).apply(null,arguments)},Gf=b._emscripten_bind_TessBaseAPI_GetStrips_2=function(){return(Gf=b._emscripten_bind_TessBaseAPI_GetStrips_2=b.asm.yd).apply(null,arguments)},Hf=b._emscripten_bind_TessBaseAPI_GetWords_1=function(){return(Hf=b._emscripten_bind_TessBaseAPI_GetWords_1=b.asm.zd).apply(null,arguments)},If=b._emscripten_bind_TessBaseAPI_GetConnectedComponents_1=
function(){return(If=b._emscripten_bind_TessBaseAPI_GetConnectedComponents_1=b.asm.Ad).apply(null,arguments)},Jf=b._emscripten_bind_TessBaseAPI_GetComponentImages_4=function(){return(Jf=b._emscripten_bind_TessBaseAPI_GetComponentImages_4=b.asm.Bd).apply(null,arguments)},Kf=b._emscripten_bind_TessBaseAPI_GetComponentImages_7=function(){return(Kf=b._emscripten_bind_TessBaseAPI_GetComponentImages_7=b.asm.Cd).apply(null,arguments)},Lf=b._emscripten_bind_TessBaseAPI_GetThresholdedImageScaleFactor_0=function(){return(Lf=
b._emscripten_bind_TessBaseAPI_GetThresholdedImageScaleFactor_0=b.asm.Dd).apply(null,arguments)},Mf=b._emscripten_bind_TessBaseAPI_AnalyseLayout_0=function(){return(Mf=b._emscripten_bind_TessBaseAPI_AnalyseLayout_0=b.asm.Ed).apply(null,arguments)},Nf=b._emscripten_bind_TessBaseAPI_AnalyseLayout_1=function(){return(Nf=b._emscripten_bind_TessBaseAPI_AnalyseLayout_1=b.asm.Fd).apply(null,arguments)},Of=b._emscripten_bind_TessBaseAPI_Recognize_1=function(){return(Of=b._emscripten_bind_TessBaseAPI_Recognize_1=
b.asm.Gd).apply(null,arguments)},Pf=b._emscripten_bind_TessBaseAPI_ProcessPages_4=function(){return(Pf=b._emscripten_bind_TessBaseAPI_ProcessPages_4=b.asm.Hd).apply(null,arguments)},Qf=b._emscripten_bind_TessBaseAPI_ProcessPage_6=function(){return(Qf=b._emscripten_bind_TessBaseAPI_ProcessPage_6=b.asm.Id).apply(null,arguments)},Rf=b._emscripten_bind_TessBaseAPI_GetIterator_0=function(){return(Rf=b._emscripten_bind_TessBaseAPI_GetIterator_0=b.asm.Jd).apply(null,arguments)},Sf=b._emscripten_bind_TessBaseAPI_GetUTF8Text_0=
function(){return(Sf=b._emscripten_bind_TessBaseAPI_GetUTF8Text_0=b.asm.Kd).apply(null,arguments)},Tf=b._emscripten_bind_TessBaseAPI_GetHOCRText_1=function(){return(Tf=b._emscripten_bind_TessBaseAPI_GetHOCRText_1=b.asm.Ld).apply(null,arguments)},Uf=b._emscripten_bind_TessBaseAPI_GetTSVText_1=function(){return(Uf=b._emscripten_bind_TessBaseAPI_GetTSVText_1=b.asm.Md).apply(null,arguments)},Vf=b._emscripten_bind_TessBaseAPI_GetBoxText_1=function(){return(Vf=b._emscripten_bind_TessBaseAPI_GetBoxText_1=
b.asm.Nd).apply(null,arguments)},Wf=b._emscripten_bind_TessBaseAPI_GetUNLVText_0=function(){return(Wf=b._emscripten_bind_TessBaseAPI_GetUNLVText_0=b.asm.Od).apply(null,arguments)},Xf=b._emscripten_bind_TessBaseAPI_GetOsdText_1=function(){return(Xf=b._emscripten_bind_TessBaseAPI_GetOsdText_1=b.asm.Pd).apply(null,arguments)},Yf=b._emscripten_bind_TessBaseAPI_MeanTextConf_0=function(){return(Yf=b._emscripten_bind_TessBaseAPI_MeanTextConf_0=b.asm.Qd).apply(null,arguments)},Zf=b._emscripten_bind_TessBaseAPI_AllWordConfidences_0=
function(){return(Zf=b._emscripten_bind_TessBaseAPI_AllWordConfidences_0=b.asm.Rd).apply(null,arguments)},$f=b._emscripten_bind_TessBaseAPI_AdaptToWordStr_2=function(){return($f=b._emscripten_bind_TessBaseAPI_AdaptToWordStr_2=b.asm.Sd).apply(null,arguments)},ag=b._emscripten_bind_TessBaseAPI_Clear_0=function(){return(ag=b._emscripten_bind_TessBaseAPI_Clear_0=b.asm.Td).apply(null,arguments)},bg=b._emscripten_bind_TessBaseAPI_End_0=function(){return(bg=b._emscripten_bind_TessBaseAPI_End_0=b.asm.Ud).apply(null,
arguments)},cg=b._emscripten_bind_TessBaseAPI_ClearPersistentCache_0=function(){return(cg=b._emscripten_bind_TessBaseAPI_ClearPersistentCache_0=b.asm.Vd).apply(null,arguments)},dg=b._emscripten_bind_TessBaseAPI_IsValidWord_1=function(){return(dg=b._emscripten_bind_TessBaseAPI_IsValidWord_1=b.asm.Wd).apply(null,arguments)},eg=b._emscripten_bind_TessBaseAPI_IsValidCharacter_1=function(){return(eg=b._emscripten_bind_TessBaseAPI_IsValidCharacter_1=b.asm.Xd).apply(null,arguments)},fg=b._emscripten_bind_TessBaseAPI_DetectOS_1=
function(){return(fg=b._emscripten_bind_TessBaseAPI_DetectOS_1=b.asm.Yd).apply(null,arguments)},gg=b._emscripten_bind_TessBaseAPI_GetUnichar_1=function(){return(gg=b._emscripten_bind_TessBaseAPI_GetUnichar_1=b.asm.Zd).apply(null,arguments)},hg=b._emscripten_bind_TessBaseAPI_GetDawg_1=function(){return(hg=b._emscripten_bind_TessBaseAPI_GetDawg_1=b.asm._d).apply(null,arguments)},ig=b._emscripten_bind_TessBaseAPI_NumDawgs_0=function(){return(ig=b._emscripten_bind_TessBaseAPI_NumDawgs_0=b.asm.$d).apply(null,
arguments)},jg=b._emscripten_bind_TessBaseAPI_oem_0=function(){return(jg=b._emscripten_bind_TessBaseAPI_oem_0=b.asm.ae).apply(null,arguments)},kg=b._emscripten_bind_TessBaseAPI___destroy___0=function(){return(kg=b._emscripten_bind_TessBaseAPI___destroy___0=b.asm.be).apply(null,arguments)},lg=b._emscripten_bind_OSResults_OSResults_0=function(){return(lg=b._emscripten_bind_OSResults_OSResults_0=b.asm.ce).apply(null,arguments)},mg=b._emscripten_bind_OSResults_print_scores_0=function(){return(mg=b._emscripten_bind_OSResults_print_scores_0=
b.asm.de).apply(null,arguments)},ng=b._emscripten_bind_OSResults_get_best_result_0=function(){return(ng=b._emscripten_bind_OSResults_get_best_result_0=b.asm.ee).apply(null,arguments)},og=b._emscripten_bind_OSResults_get_unicharset_0=function(){return(og=b._emscripten_bind_OSResults_get_unicharset_0=b.asm.fe).apply(null,arguments)},pg=b._emscripten_bind_OSResults___destroy___0=function(){return(pg=b._emscripten_bind_OSResults___destroy___0=b.asm.ge).apply(null,arguments)},qg=b._emscripten_bind_Pixa_get_n_0=
function(){return(qg=b._emscripten_bind_Pixa_get_n_0=b.asm.he).apply(null,arguments)},rg=b._emscripten_bind_Pixa_get_nalloc_0=function(){return(rg=b._emscripten_bind_Pixa_get_nalloc_0=b.asm.ie).apply(null,arguments)},sg=b._emscripten_bind_Pixa_get_refcount_0=function(){return(sg=b._emscripten_bind_Pixa_get_refcount_0=b.asm.je).apply(null,arguments)},tg=b._emscripten_bind_Pixa_get_pix_0=function(){return(tg=b._emscripten_bind_Pixa_get_pix_0=b.asm.ke).apply(null,arguments)},ug=b._emscripten_bind_Pixa_get_boxa_0=
function(){return(ug=b._emscripten_bind_Pixa_get_boxa_0=b.asm.le).apply(null,arguments)},vg=b._emscripten_bind_Pixa___destroy___0=function(){return(vg=b._emscripten_bind_Pixa___destroy___0=b.asm.me).apply(null,arguments)},wg=b._emscripten_enum_PageIteratorLevel_RIL_BLOCK=function(){return(wg=b._emscripten_enum_PageIteratorLevel_RIL_BLOCK=b.asm.ne).apply(null,arguments)},xg=b._emscripten_enum_PageIteratorLevel_RIL_PARA=function(){return(xg=b._emscripten_enum_PageIteratorLevel_RIL_PARA=b.asm.oe).apply(null,
arguments)},yg=b._emscripten_enum_PageIteratorLevel_RIL_TEXTLINE=function(){return(yg=b._emscripten_enum_PageIteratorLevel_RIL_TEXTLINE=b.asm.pe).apply(null,arguments)},zg=b._emscripten_enum_PageIteratorLevel_RIL_WORD=function(){return(zg=b._emscripten_enum_PageIteratorLevel_RIL_WORD=b.asm.qe).apply(null,arguments)},Ag=b._emscripten_enum_PageIteratorLevel_RIL_SYMBOL=function(){return(Ag=b._emscripten_enum_PageIteratorLevel_RIL_SYMBOL=b.asm.re).apply(null,arguments)},Bg=b._emscripten_enum_OcrEngineMode_OEM_TESSERACT_ONLY=
function(){return(Bg=b._emscripten_enum_OcrEngineMode_OEM_TESSERACT_ONLY=b.asm.se).apply(null,arguments)},Cg=b._emscripten_enum_OcrEngineMode_OEM_LSTM_ONLY=function(){return(Cg=b._emscripten_enum_OcrEngineMode_OEM_LSTM_ONLY=b.asm.te).apply(null,arguments)},Dg=b._emscripten_enum_OcrEngineMode_OEM_TESSERACT_LSTM_COMBINED=function(){return(Dg=b._emscripten_enum_OcrEngineMode_OEM_TESSERACT_LSTM_COMBINED=b.asm.ue).apply(null,arguments)},Eg=b._emscripten_enum_OcrEngineMode_OEM_DEFAULT=function(){return(Eg=
b._emscripten_enum_OcrEngineMode_OEM_DEFAULT=b.asm.ve).apply(null,arguments)},Fg=b._emscripten_enum_OcrEngineMode_OEM_COUNT=function(){return(Fg=b._emscripten_enum_OcrEngineMode_OEM_COUNT=b.asm.we).apply(null,arguments)},Gg=b._emscripten_enum_WritingDirection__WRITING_DIRECTION_LEFT_TO_RIGHT=function(){return(Gg=b._emscripten_enum_WritingDirection__WRITING_DIRECTION_LEFT_TO_RIGHT=b.asm.xe).apply(null,arguments)},Hg=b._emscripten_enum_WritingDirection__WRITING_DIRECTION_RIGHT_TO_LEFT=function(){return(Hg=
b._emscripten_enum_WritingDirection__WRITING_DIRECTION_RIGHT_TO_LEFT=b.asm.ye).apply(null,arguments)},Ig=b._emscripten_enum_WritingDirection__WRITING_DIRECTION_TOP_TO_BOTTOM=function(){return(Ig=b._emscripten_enum_WritingDirection__WRITING_DIRECTION_TOP_TO_BOTTOM=b.asm.ze).apply(null,arguments)},Jg=b._emscripten_enum_PolyBlockType_PT_UNKNOWN=function(){return(Jg=b._emscripten_enum_PolyBlockType_PT_UNKNOWN=b.asm.Ae).apply(null,arguments)},Kg=b._emscripten_enum_PolyBlockType_PT_FLOWING_TEXT=function(){return(Kg=
b._emscripten_enum_PolyBlockType_PT_FLOWING_TEXT=b.asm.Be).apply(null,arguments)},Lg=b._emscripten_enum_PolyBlockType_PT_HEADING_TEXT=function(){return(Lg=b._emscripten_enum_PolyBlockType_PT_HEADING_TEXT=b.asm.Ce).apply(null,arguments)},Mg=b._emscripten_enum_PolyBlockType_PT_PULLOUT_TEXT=function(){return(Mg=b._emscripten_enum_PolyBlockType_PT_PULLOUT_TEXT=b.asm.De).apply(null,arguments)},Ng=b._emscripten_enum_PolyBlockType_PT_EQUATION=function(){return(Ng=b._emscripten_enum_PolyBlockType_PT_EQUATION=
b.asm.Ee).apply(null,arguments)},Og=b._emscripten_enum_PolyBlockType_PT_INLINE_EQUATION=function(){return(Og=b._emscripten_enum_PolyBlockType_PT_INLINE_EQUATION=b.asm.Fe).apply(null,arguments)},Pg=b._emscripten_enum_PolyBlockType_PT_TABLE=function(){return(Pg=b._emscripten_enum_PolyBlockType_PT_TABLE=b.asm.Ge).apply(null,arguments)},Qg=b._emscripten_enum_PolyBlockType_PT_VERTICAL_TEXT=function(){return(Qg=b._emscripten_enum_PolyBlockType_PT_VERTICAL_TEXT=b.asm.He).apply(null,arguments)},Rg=b._emscripten_enum_PolyBlockType_PT_CAPTION_TEXT=
function(){return(Rg=b._emscripten_enum_PolyBlockType_PT_CAPTION_TEXT=b.asm.Ie).apply(null,arguments)},Sg=b._emscripten_enum_PolyBlockType_PT_FLOWING_IMAGE=function(){return(Sg=b._emscripten_enum_PolyBlockType_PT_FLOWING_IMAGE=b.asm.Je).apply(null,arguments)},Tg=b._emscripten_enum_PolyBlockType_PT_HEADING_IMAGE=function(){return(Tg=b._emscripten_enum_PolyBlockType_PT_HEADING_IMAGE=b.asm.Ke).apply(null,arguments)},Ug=b._emscripten_enum_PolyBlockType_PT_PULLOUT_IMAGE=function(){return(Ug=b._emscripten_enum_PolyBlockType_PT_PULLOUT_IMAGE=
b.asm.Le).apply(null,arguments)},Vg=b._emscripten_enum_PolyBlockType_PT_HORZ_LINE=function(){return(Vg=b._emscripten_enum_PolyBlockType_PT_HORZ_LINE=b.asm.Me).apply(null,arguments)},Wg=b._emscripten_enum_PolyBlockType_PT_VERT_LINE=function(){return(Wg=b._emscripten_enum_PolyBlockType_PT_VERT_LINE=b.asm.Ne).apply(null,arguments)},Xg=b._emscripten_enum_PolyBlockType_PT_NOISE=function(){return(Xg=b._emscripten_enum_PolyBlockType_PT_NOISE=b.asm.Oe).apply(null,arguments)},Yg=b._emscripten_enum_PolyBlockType_PT_COUNT=
function(){return(Yg=b._emscripten_enum_PolyBlockType_PT_COUNT=b.asm.Pe).apply(null,arguments)},Zg=b._emscripten_enum_StrongScriptDirection_DIR_NEUTRAL=function(){return(Zg=b._emscripten_enum_StrongScriptDirection_DIR_NEUTRAL=b.asm.Qe).apply(null,arguments)},$g=b._emscripten_enum_StrongScriptDirection_DIR_LEFT_TO_RIGHT=function(){return($g=b._emscripten_enum_StrongScriptDirection_DIR_LEFT_TO_RIGHT=b.asm.Re).apply(null,arguments)},ah=b._emscripten_enum_StrongScriptDirection_DIR_RIGHT_TO_LEFT=function(){return(ah=
b._emscripten_enum_StrongScriptDirection_DIR_RIGHT_TO_LEFT=b.asm.Se).apply(null,arguments)},bh=b._emscripten_enum_StrongScriptDirection_DIR_MIX=function(){return(bh=b._emscripten_enum_StrongScriptDirection_DIR_MIX=b.asm.Te).apply(null,arguments)},ch=b._emscripten_enum_ParagraphJustification__JUSTIFICATION_UNKNOWN=function(){return(ch=b._emscripten_enum_ParagraphJustification__JUSTIFICATION_UNKNOWN=b.asm.Ue).apply(null,arguments)},dh=b._emscripten_enum_ParagraphJustification__JUSTIFICATION_LEFT=function(){return(dh=
b._emscripten_enum_ParagraphJustification__JUSTIFICATION_LEFT=b.asm.Ve).apply(null,arguments)},eh=b._emscripten_enum_ParagraphJustification__JUSTIFICATION_CENTER=function(){return(eh=b._emscripten_enum_ParagraphJustification__JUSTIFICATION_CENTER=b.asm.We).apply(null,arguments)},fh=b._emscripten_enum_ParagraphJustification__JUSTIFICATION_RIGHT=function(){return(fh=b._emscripten_enum_ParagraphJustification__JUSTIFICATION_RIGHT=b.asm.Xe).apply(null,arguments)},gh=b._emscripten_enum_TextlineOrder__TEXTLINE_ORDER_LEFT_TO_RIGHT=
function(){return(gh=b._emscripten_enum_TextlineOrder__TEXTLINE_ORDER_LEFT_TO_RIGHT=b.asm.Ye).apply(null,arguments)},hh=b._emscripten_enum_TextlineOrder__TEXTLINE_ORDER_RIGHT_TO_LEFT=function(){return(hh=b._emscripten_enum_TextlineOrder__TEXTLINE_ORDER_RIGHT_TO_LEFT=b.asm.Ze).apply(null,arguments)},ih=b._emscripten_enum_TextlineOrder__TEXTLINE_ORDER_TOP_TO_BOTTOM=function(){return(ih=b._emscripten_enum_TextlineOrder__TEXTLINE_ORDER_TOP_TO_BOTTOM=b.asm._e).apply(null,arguments)},jh=b._emscripten_enum_Orientation__ORIENTATION_PAGE_UP=
function(){return(jh=b._emscripten_enum_Orientation__ORIENTATION_PAGE_UP=b.asm.$e).apply(null,arguments)},kh=b._emscripten_enum_Orientation__ORIENTATION_PAGE_RIGHT=function(){return(kh=b._emscripten_enum_Orientation__ORIENTATION_PAGE_RIGHT=b.asm.af).apply(null,arguments)},lh=b._emscripten_enum_Orientation__ORIENTATION_PAGE_DOWN=function(){return(lh=b._emscripten_enum_Orientation__ORIENTATION_PAGE_DOWN=b.asm.bf).apply(null,arguments)},mh=b._emscripten_enum_Orientation__ORIENTATION_PAGE_LEFT=function(){return(mh=
b._emscripten_enum_Orientation__ORIENTATION_PAGE_LEFT=b.asm.cf).apply(null,arguments)},nh=b._emscripten_enum_PageSegMode_PSM_OSD_ONLY=function(){return(nh=b._emscripten_enum_PageSegMode_PSM_OSD_ONLY=b.asm.df).apply(null,arguments)},oh=b._emscripten_enum_PageSegMode_PSM_AUTO_OSD=function(){return(oh=b._emscripten_enum_PageSegMode_PSM_AUTO_OSD=b.asm.ef).apply(null,arguments)},ph=b._emscripten_enum_PageSegMode_PSM_AUTO_ONLY=function(){return(ph=b._emscripten_enum_PageSegMode_PSM_AUTO_ONLY=b.asm.ff).apply(null,
arguments)},qh=b._emscripten_enum_PageSegMode_PSM_AUTO=function(){return(qh=b._emscripten_enum_PageSegMode_PSM_AUTO=b.asm.gf).apply(null,arguments)},rh=b._emscripten_enum_PageSegMode_PSM_SINGLE_COLUMN=function(){return(rh=b._emscripten_enum_PageSegMode_PSM_SINGLE_COLUMN=b.asm.hf).apply(null,arguments)},sh=b._emscripten_enum_PageSegMode_PSM_SINGLE_BLOCK_VERT_TEXT=function(){return(sh=b._emscripten_enum_PageSegMode_PSM_SINGLE_BLOCK_VERT_TEXT=b.asm.jf).apply(null,arguments)},th=b._emscripten_enum_PageSegMode_PSM_SINGLE_BLOCK=
function(){return(th=b._emscripten_enum_PageSegMode_PSM_SINGLE_BLOCK=b.asm.kf).apply(null,arguments)},uh=b._emscripten_enum_PageSegMode_PSM_SINGLE_LINE=function(){return(uh=b._emscripten_enum_PageSegMode_PSM_SINGLE_LINE=b.asm.lf).apply(null,arguments)},vh=b._emscripten_enum_PageSegMode_PSM_SINGLE_WORD=function(){return(vh=b._emscripten_enum_PageSegMode_PSM_SINGLE_WORD=b.asm.mf).apply(null,arguments)},wh=b._emscripten_enum_PageSegMode_PSM_CIRCLE_WORD=function(){return(wh=b._emscripten_enum_PageSegMode_PSM_CIRCLE_WORD=
b.asm.nf).apply(null,arguments)},xh=b._emscripten_enum_PageSegMode_PSM_SINGLE_CHAR=function(){return(xh=b._emscripten_enum_PageSegMode_PSM_SINGLE_CHAR=b.asm.of).apply(null,arguments)},yh=b._emscripten_enum_PageSegMode_PSM_SPARSE_TEXT=function(){return(yh=b._emscripten_enum_PageSegMode_PSM_SPARSE_TEXT=b.asm.pf).apply(null,arguments)},zh=b._emscripten_enum_PageSegMode_PSM_SPARSE_TEXT_OSD=function(){return(zh=b._emscripten_enum_PageSegMode_PSM_SPARSE_TEXT_OSD=b.asm.qf).apply(null,arguments)},Ah=b._emscripten_enum_PageSegMode_PSM_RAW_LINE=
function(){return(Ah=b._emscripten_enum_PageSegMode_PSM_RAW_LINE=b.asm.rf).apply(null,arguments)},Bh=b._emscripten_enum_PageSegMode_PSM_COUNT=function(){return(Bh=b._emscripten_enum_PageSegMode_PSM_COUNT=b.asm.sf).apply(null,arguments)};b._pixDestroy=function(){return(b._pixDestroy=b.asm.uf).apply(null,arguments)};b._ptaDestroy=function(){return(b._ptaDestroy=b.asm.vf).apply(null,arguments)};b._pixaDestroy=function(){return(b._pixaDestroy=b.asm.wf).apply(null,arguments)};
b._boxaDestroy=function(){return(b._boxaDestroy=b.asm.xf).apply(null,arguments)};b._pixReadMem=function(){return(b._pixReadMem=b.asm.yf).apply(null,arguments)};var Ob=b.___errno_location=function(){return(Ob=b.___errno_location=b.asm.zf).apply(null,arguments)},Ch=b._free=function(){return(Ch=b._free=b.asm.Af).apply(null,arguments)},zb=b._malloc=function(){return(zb=b._malloc=b.asm.Bf).apply(null,arguments)};b._pixReadHeaderMem=function(){return(b._pixReadHeaderMem=b.asm.Cf).apply(null,arguments)};
var qb=b._emscripten_builtin_memalign=function(){return(qb=b._emscripten_builtin_memalign=b.asm.Df).apply(null,arguments)},F=b._setThrew=function(){return(F=b._setThrew=b.asm.Ef).apply(null,arguments)},Dh=b.stackSave=function(){return(Dh=b.stackSave=b.asm.Ff).apply(null,arguments)},Eh=b.stackRestore=function(){return(Eh=b.stackRestore=b.asm.Gf).apply(null,arguments)};b.___cxa_is_pointer_type=function(){return(b.___cxa_is_pointer_type=b.asm.Hf).apply(null,arguments)};
b.___emscripten_embedded_file_data=600112;function Rb(a,c,d,e){var g=Dh();try{return Mb(a)(c,d,e)}catch(h){Eh(g);if(h!==h+0)throw h;F(1,0)}}function Ub(a,c){var d=Dh();try{Mb(a)(c)}catch(e){Eh(d);if(e!==e+0)throw e;F(1,0)}}function Pb(a,c){var d=Dh();try{return Mb(a)(c)}catch(e){Eh(d);if(e!==e+0)throw e;F(1,0)}}function Wb(a,c,d,e){var g=Dh();try{Mb(a)(c,d,e)}catch(h){Eh(g);if(h!==h+0)throw h;F(1,0)}}function Vb(a,c,d){var e=Dh();try{Mb(a)(c,d)}catch(g){Eh(e);if(g!==g+0)throw g;F(1,0)}}
function Qb(a,c,d){var e=Dh();try{return Mb(a)(c,d)}catch(g){Eh(e);if(g!==g+0)throw g;F(1,0)}}function Sb(a,c,d,e,g){var h=Dh();try{return Mb(a)(c,d,e,g)}catch(k){Eh(h);if(k!==k+0)throw k;F(1,0)}}function Xb(a,c,d,e,g){var h=Dh();try{Mb(a)(c,d,e,g)}catch(k){Eh(h);if(k!==k+0)throw k;F(1,0)}}function Tb(a,c,d,e,g,h){var k=Dh();try{return Mb(a)(c,d,e,g,h)}catch(m){Eh(k);if(m!==m+0)throw m;F(1,0)}}
function Zb(a,c,d,e,g,h,k,m,t,u){var p=Dh();try{Mb(a)(c,d,e,g,h,k,m,t,u)}catch(x){Eh(p);if(x!==x+0)throw x;F(1,0)}}function Yb(a,c,d,e,g,h){var k=Dh();try{Mb(a)(c,d,e,g,h)}catch(m){Eh(k);if(m!==m+0)throw m;F(1,0)}}b.addRunDependency=Qa;b.removeRunDependency=Ra;b.FS_createPath=D.Lg;b.FS_createDataFile=D.wg;b.FS_createPreloadedFile=D.oh;b.FS_createLazyFile=D.nh;b.FS_createDevice=D.Wf;b.FS_unlink=D.unlink;b.setValue=Za;b.getValue=Ya;b.FS=D;var Fh;Pa=function Gh(){Fh||Hh();Fh||(Pa=Gh)};
function Hh(){function a(){if(!Fh&&(Fh=!0,b.calledRun=!0,!ua)){La=!0;b.noFSInit||D.rg.Xg||D.rg();D.Ah=!1;Xa(Ia);aa(b);if(b.onRuntimeInitialized)b.onRuntimeInitialized();if(b.postRun)for("function"==typeof b.postRun&&(b.postRun=[b.postRun]);b.postRun.length;){var c=b.postRun.shift();Ka.unshift(c)}Xa(Ka)}}if(!(0<Na)){if(b.preRun)for("function"==typeof b.preRun&&(b.preRun=[b.preRun]);b.preRun.length;)Ma();Xa(Ha);0<Na||(b.setStatus?(b.setStatus("Running..."),setTimeout(function(){setTimeout(function(){b.setStatus("")},
1);a()},1)):a())}}if(b.preInit)for("function"==typeof b.preInit&&(b.preInit=[b.preInit]);0<b.preInit.length;)b.preInit.pop()();Hh();function G(){}G.prototype=Object.create(G.prototype);G.prototype.constructor=G;G.prototype.Nf=G;G.Of={};b.WrapperObject=G;function Ih(a){return(a||G).Of}b.getCache=Ih;function H(a,c){var d=Ih(c),e=d[a];if(e)return e;e=Object.create((c||G).prototype);e.If=a;return d[a]=e}b.wrapPointer=H;b.castObject=function(a,c){return H(a.If,c)};b.NULL=H(0);
b.destroy=function(a){if(!a.__destroy__)throw"Error: Cannot destroy object. (Did you create it yourself?)";a.__destroy__();delete Ih(a.Nf)[a.If]};b.compare=function(a,c){return a.If===c.If};b.getPointer=function(a){return a.If};b.getClass=function(a){return a.Nf};var Jh=0,Kh=0,Lh=0,Mh=[],Nh=0;function I(){if(Nh){for(var a=0;a<Mh.length;a++)b._free(Mh[a]);Mh.length=0;b._free(Jh);Jh=0;Kh+=Nh;Nh=0}Jh||(Kh+=128,(Jh=b._malloc(Kh))||n());Lh=0}
function J(a){if("string"===typeof a){a=jb(a);var c=r;Jh||n();c=a.length*c.BYTES_PER_ELEMENT;c=c+7&-8;if(Lh+c>=Kh){0<c||n();Nh+=c;var d=b._malloc(c);Mh.push(d)}else d=Jh+Lh,Lh+=c;c=d;d=r;var e=c;switch(d.BYTES_PER_ELEMENT){case 2:e>>=1;break;case 4:e>>=2;break;case 8:e>>=3}for(var g=0;g<a.length;g++)d[e+g]=a[g];return c}return a}function Oh(){throw"cannot construct a ParagraphJustification, no constructor in IDL";}Oh.prototype=Object.create(G.prototype);Oh.prototype.constructor=Oh;
Oh.prototype.Nf=Oh;Oh.Of={};b.ParagraphJustification=Oh;Oh.prototype.__destroy__=function(){ac(this.If)};function Ph(){throw"cannot construct a BoolPtr, no constructor in IDL";}Ph.prototype=Object.create(G.prototype);Ph.prototype.constructor=Ph;Ph.prototype.Nf=Ph;Ph.Of={};b.BoolPtr=Ph;Ph.prototype.__destroy__=function(){bc(this.If)};function K(){throw"cannot construct a TessResultRenderer, no constructor in IDL";}K.prototype=Object.create(G.prototype);K.prototype.constructor=K;K.prototype.Nf=K;
K.Of={};b.TessResultRenderer=K;K.prototype.BeginDocument=function(a){var c=this.If;I();a=a&&"object"===typeof a?a.If:J(a);return!!cc(c,a)};K.prototype.AddImage=function(a){var c=this.If;a&&"object"===typeof a&&(a=a.If);return!!dc(c,a)};K.prototype.EndDocument=function(){return!!ec(this.If)};K.prototype.happy=function(){return!!fc(this.If)};K.prototype.file_extension=function(){return q(gc(this.If))};K.prototype.title=K.prototype.title=function(){return q(hc(this.If))};K.prototype.imagenum=function(){return ic(this.If)};
K.prototype.__destroy__=function(){jc(this.If)};function Qh(){throw"cannot construct a LongStarPtr, no constructor in IDL";}Qh.prototype=Object.create(G.prototype);Qh.prototype.constructor=Qh;Qh.prototype.Nf=Qh;Qh.Of={};b.LongStarPtr=Qh;Qh.prototype.__destroy__=function(){kc(this.If)};function Rh(){throw"cannot construct a VoidPtr, no constructor in IDL";}Rh.prototype=Object.create(G.prototype);Rh.prototype.constructor=Rh;Rh.prototype.Nf=Rh;Rh.Of={};b.VoidPtr=Rh;Rh.prototype.__destroy__=function(){lc(this.If)};
function L(a){a&&"object"===typeof a&&(a=a.If);this.If=mc(a);Ih(L)[this.If]=this}L.prototype=Object.create(G.prototype);L.prototype.constructor=L;L.prototype.Nf=L;L.Of={};b.ResultIterator=L;L.prototype.Begin=function(){nc(this.If)};L.prototype.RestartParagraph=function(){oc(this.If)};L.prototype.IsWithinFirstTextlineOfParagraph=function(){return!!pc(this.If)};L.prototype.RestartRow=function(){qc(this.If)};L.prototype.Next=function(a){var c=this.If;a&&"object"===typeof a&&(a=a.If);return!!rc(c,a)};
L.prototype.IsAtBeginningOf=function(a){var c=this.If;a&&"object"===typeof a&&(a=a.If);return!!sc(c,a)};L.prototype.IsAtFinalElement=function(a,c){var d=this.If;a&&"object"===typeof a&&(a=a.If);c&&"object"===typeof c&&(c=c.If);return!!tc(d,a,c)};L.prototype.Cmp=function(a){var c=this.If;a&&"object"===typeof a&&(a=a.If);return uc(c,a)};L.prototype.SetBoundingBoxComponents=function(a,c){var d=this.If;a&&"object"===typeof a&&(a=a.If);c&&"object"===typeof c&&(c=c.If);vc(d,a,c)};
L.prototype.BoundingBox=function(a,c,d,e,g,h){var k=this.If;a&&"object"===typeof a&&(a=a.If);c&&"object"===typeof c&&(c=c.If);d&&"object"===typeof d&&(d=d.If);e&&"object"===typeof e&&(e=e.If);g&&"object"===typeof g&&(g=g.If);h&&"object"===typeof h&&(h=h.If);return void 0===h?!!wc(k,a,c,d,e,g):!!xc(k,a,c,d,e,g,h)};
L.prototype.BoundingBoxInternal=function(a,c,d,e,g){var h=this.If;a&&"object"===typeof a&&(a=a.If);c&&"object"===typeof c&&(c=c.If);d&&"object"===typeof d&&(d=d.If);e&&"object"===typeof e&&(e=e.If);g&&"object"===typeof g&&(g=g.If);return!!yc(h,a,c,d,e,g)};L.prototype.Empty=function(a){var c=this.If;a&&"object"===typeof a&&(a=a.If);return!!zc(c,a)};L.prototype.BlockType=function(){return Ac(this.If)};L.prototype.BlockPolygon=function(){return H(Bc(this.If),M)};
L.prototype.GetBinaryImage=function(a){var c=this.If;a&&"object"===typeof a&&(a=a.If);return H(Cc(c,a),O)};L.prototype.GetImage=function(a,c,d,e,g){var h=this.If;a&&"object"===typeof a&&(a=a.If);c&&"object"===typeof c&&(c=c.If);d&&"object"===typeof d&&(d=d.If);e&&"object"===typeof e&&(e=e.If);g&&"object"===typeof g&&(g=g.If);return H(Dc(h,a,c,d,e,g),O)};
L.prototype.Baseline=function(a,c,d,e,g){var h=this.If;a&&"object"===typeof a&&(a=a.If);c&&"object"===typeof c&&(c=c.If);d&&"object"===typeof d&&(d=d.If);e&&"object"===typeof e&&(e=e.If);g&&"object"===typeof g&&(g=g.If);return!!Ec(h,a,c,d,e,g)};L.prototype.Orientation=function(a,c,d,e){var g=this.If;a&&"object"===typeof a&&(a=a.If);c&&"object"===typeof c&&(c=c.If);d&&"object"===typeof d&&(d=d.If);e&&"object"===typeof e&&(e=e.If);Fc(g,a,c,d,e)};
L.prototype.ParagraphInfo=function(a,c,d,e){var g=this.If;a&&"object"===typeof a&&(a=a.If);c&&"object"===typeof c&&(c=c.If);d&&"object"===typeof d&&(d=d.If);e&&"object"===typeof e&&(e=e.If);Gc(g,a,c,d,e)};L.prototype.ParagraphIsLtr=function(){return!!Hc(this.If)};L.prototype.GetUTF8Text=function(a){var c=this.If;a&&"object"===typeof a&&(a=a.If);return q(Ic(c,a))};L.prototype.SetLineSeparator=function(a){var c=this.If;I();a=a&&"object"===typeof a?a.If:J(a);Jc(c,a)};
L.prototype.SetParagraphSeparator=function(a){var c=this.If;I();a=a&&"object"===typeof a?a.If:J(a);Kc(c,a)};L.prototype.Confidence=function(a){var c=this.If;a&&"object"===typeof a&&(a=a.If);return Lc(c,a)};
L.prototype.WordFontAttributes=function(a,c,d,e,g,h,k,m){var t=this.If;a&&"object"===typeof a&&(a=a.If);c&&"object"===typeof c&&(c=c.If);d&&"object"===typeof d&&(d=d.If);e&&"object"===typeof e&&(e=e.If);g&&"object"===typeof g&&(g=g.If);h&&"object"===typeof h&&(h=h.If);k&&"object"===typeof k&&(k=k.If);m&&"object"===typeof m&&(m=m.If);return q(Mc(t,a,c,d,e,g,h,k,m))};L.prototype.WordRecognitionLanguage=function(){return q(Nc(this.If))};L.prototype.WordDirection=function(){return Oc(this.If)};
L.prototype.WordIsFromDictionary=function(){return!!Pc(this.If)};L.prototype.WordIsNumeric=function(){return!!Qc(this.If)};L.prototype.HasBlamerInfo=function(){return!!Rc(this.If)};L.prototype.HasTruthString=function(){return!!Sc(this.If)};L.prototype.EquivalentToTruth=function(a){var c=this.If;I();a=a&&"object"===typeof a?a.If:J(a);return!!Tc(c,a)};L.prototype.WordTruthUTF8Text=function(){return q(Uc(this.If))};L.prototype.WordNormedUTF8Text=function(){return q(Vc(this.If))};
L.prototype.WordLattice=function(a){var c=this.If;a&&"object"===typeof a&&(a=a.If);return q(Wc(c,a))};L.prototype.SymbolIsSuperscript=function(){return!!Xc(this.If)};L.prototype.SymbolIsSubscript=function(){return!!Yc(this.If)};L.prototype.SymbolIsDropcap=function(){return!!Zc(this.If)};L.prototype.__destroy__=function(){$c(this.If)};function Th(){throw"cannot construct a TextlineOrder, no constructor in IDL";}Th.prototype=Object.create(G.prototype);Th.prototype.constructor=Th;Th.prototype.Nf=Th;
Th.Of={};b.TextlineOrder=Th;Th.prototype.__destroy__=function(){ad(this.If)};function Uh(){throw"cannot construct a ETEXT_DESC, no constructor in IDL";}Uh.prototype=Object.create(G.prototype);Uh.prototype.constructor=Uh;Uh.prototype.Nf=Uh;Uh.Of={};b.ETEXT_DESC=Uh;Uh.prototype.__destroy__=function(){bd(this.If)};function P(){throw"cannot construct a PageIterator, no constructor in IDL";}P.prototype=Object.create(G.prototype);P.prototype.constructor=P;P.prototype.Nf=P;P.Of={};b.PageIterator=P;
P.prototype.Begin=function(){cd(this.If)};P.prototype.RestartParagraph=function(){dd(this.If)};P.prototype.IsWithinFirstTextlineOfParagraph=function(){return!!ed(this.If)};P.prototype.RestartRow=function(){fd(this.If)};P.prototype.Next=function(a){var c=this.If;a&&"object"===typeof a&&(a=a.If);return!!gd(c,a)};P.prototype.IsAtBeginningOf=function(a){var c=this.If;a&&"object"===typeof a&&(a=a.If);return!!hd(c,a)};
P.prototype.IsAtFinalElement=function(a,c){var d=this.If;a&&"object"===typeof a&&(a=a.If);c&&"object"===typeof c&&(c=c.If);return!!jd(d,a,c)};P.prototype.Cmp=function(a){var c=this.If;a&&"object"===typeof a&&(a=a.If);return kd(c,a)};P.prototype.SetBoundingBoxComponents=function(a,c){var d=this.If;a&&"object"===typeof a&&(a=a.If);c&&"object"===typeof c&&(c=c.If);ld(d,a,c)};
P.prototype.BoundingBox=function(a,c,d,e,g,h){var k=this.If;a&&"object"===typeof a&&(a=a.If);c&&"object"===typeof c&&(c=c.If);d&&"object"===typeof d&&(d=d.If);e&&"object"===typeof e&&(e=e.If);g&&"object"===typeof g&&(g=g.If);h&&"object"===typeof h&&(h=h.If);return void 0===h?!!md(k,a,c,d,e,g):!!nd(k,a,c,d,e,g,h)};
P.prototype.BoundingBoxInternal=function(a,c,d,e,g){var h=this.If;a&&"object"===typeof a&&(a=a.If);c&&"object"===typeof c&&(c=c.If);d&&"object"===typeof d&&(d=d.If);e&&"object"===typeof e&&(e=e.If);g&&"object"===typeof g&&(g=g.If);return!!od(h,a,c,d,e,g)};P.prototype.Empty=function(a){var c=this.If;a&&"object"===typeof a&&(a=a.If);return!!pd(c,a)};P.prototype.BlockType=function(){return qd(this.If)};P.prototype.BlockPolygon=function(){return H(rd(this.If),M)};
P.prototype.GetBinaryImage=function(a){var c=this.If;a&&"object"===typeof a&&(a=a.If);return H(sd(c,a),O)};P.prototype.GetImage=function(a,c,d,e,g){var h=this.If;a&&"object"===typeof a&&(a=a.If);c&&"object"===typeof c&&(c=c.If);d&&"object"===typeof d&&(d=d.If);e&&"object"===typeof e&&(e=e.If);g&&"object"===typeof g&&(g=g.If);return H(td(h,a,c,d,e,g),O)};
P.prototype.Baseline=function(a,c,d,e,g){var h=this.If;a&&"object"===typeof a&&(a=a.If);c&&"object"===typeof c&&(c=c.If);d&&"object"===typeof d&&(d=d.If);e&&"object"===typeof e&&(e=e.If);g&&"object"===typeof g&&(g=g.If);return!!ud(h,a,c,d,e,g)};P.prototype.Orientation=function(a,c,d,e){var g=this.If;a&&"object"===typeof a&&(a=a.If);c&&"object"===typeof c&&(c=c.If);d&&"object"===typeof d&&(d=d.If);e&&"object"===typeof e&&(e=e.If);vd(g,a,c,d,e)};
P.prototype.ParagraphInfo=function(a,c,d,e){var g=this.If;a&&"object"===typeof a&&(a=a.If);c&&"object"===typeof c&&(c=c.If);d&&"object"===typeof d&&(d=d.If);e&&"object"===typeof e&&(e=e.If);wd(g,a,c,d,e)};P.prototype.__destroy__=function(){xd(this.If)};function Vh(){throw"cannot construct a WritingDirection, no constructor in IDL";}Vh.prototype=Object.create(G.prototype);Vh.prototype.constructor=Vh;Vh.prototype.Nf=Vh;Vh.Of={};b.WritingDirection=Vh;Vh.prototype.__destroy__=function(){yd(this.If)};
function Wh(a){a&&"object"===typeof a&&(a=a.If);this.If=zd(a);Ih(Wh)[this.If]=this}Wh.prototype=Object.create(G.prototype);Wh.prototype.constructor=Wh;Wh.prototype.Nf=Wh;Wh.Of={};b.WordChoiceIterator=Wh;Wh.prototype.Next=function(){return!!Ad(this.If)};Wh.prototype.GetUTF8Text=function(){return q(Bd(this.If))};Wh.prototype.Confidence=function(){return Cd(this.If)};Wh.prototype.__destroy__=function(){Dd(this.If)};function Q(){throw"cannot construct a Box, no constructor in IDL";}Q.prototype=Object.create(G.prototype);
Q.prototype.constructor=Q;Q.prototype.Nf=Q;Q.Of={};b.Box=Q;Q.prototype.get_x=Q.prototype.Tg=function(){return Ed(this.If)};Object.defineProperty(Q.prototype,"x",{get:Q.prototype.Tg});Q.prototype.get_y=Q.prototype.Ug=function(){return Fd(this.If)};Object.defineProperty(Q.prototype,"y",{get:Q.prototype.Ug});Q.prototype.get_w=Q.prototype.Sg=function(){return Gd(this.If)};Object.defineProperty(Q.prototype,"w",{get:Q.prototype.Sg});Q.prototype.get_h=Q.prototype.Rg=function(){return Hd(this.If)};
Object.defineProperty(Q.prototype,"h",{get:Q.prototype.Rg});Q.prototype.get_refcount=Q.prototype.cg=function(){return Id(this.If)};Object.defineProperty(Q.prototype,"refcount",{get:Q.prototype.cg});Q.prototype.__destroy__=function(){Jd(this.If)};function R(a,c,d){I();a=a&&"object"===typeof a?a.If:J(a);c=c&&"object"===typeof c?c.If:J(c);d&&"object"===typeof d&&(d=d.If);this.If=Kd(a,c,d);Ih(R)[this.If]=this}R.prototype=Object.create(G.prototype);R.prototype.constructor=R;R.prototype.Nf=R;R.Of={};
b.TessPDFRenderer=R;R.prototype.BeginDocument=function(a){var c=this.If;I();a=a&&"object"===typeof a?a.If:J(a);return!!Ld(c,a)};R.prototype.AddImage=function(a){var c=this.If;a&&"object"===typeof a&&(a=a.If);return!!Md(c,a)};R.prototype.EndDocument=function(){return!!Nd(this.If)};R.prototype.happy=function(){return!!Od(this.If)};R.prototype.file_extension=function(){return q(Pd(this.If))};R.prototype.title=R.prototype.title=function(){return q(Qd(this.If))};R.prototype.imagenum=function(){return Rd(this.If)};
R.prototype.__destroy__=function(){Sd(this.If)};function Xh(){throw"cannot construct a PixaPtr, no constructor in IDL";}Xh.prototype=Object.create(G.prototype);Xh.prototype.constructor=Xh;Xh.prototype.Nf=Xh;Xh.Of={};b.PixaPtr=Xh;Xh.prototype.__destroy__=function(){Td(this.If)};function Yh(){throw"cannot construct a FloatPtr, no constructor in IDL";}Yh.prototype=Object.create(G.prototype);Yh.prototype.constructor=Yh;Yh.prototype.Nf=Yh;Yh.Of={};b.FloatPtr=Yh;Yh.prototype.__destroy__=function(){Ud(this.If)};
function Zh(a){a&&"object"===typeof a&&(a=a.If);this.If=Vd(a);Ih(Zh)[this.If]=this}Zh.prototype=Object.create(G.prototype);Zh.prototype.constructor=Zh;Zh.prototype.Nf=Zh;Zh.Of={};b.ChoiceIterator=Zh;Zh.prototype.Next=function(){return!!Wd(this.If)};Zh.prototype.GetUTF8Text=function(){return q(Xd(this.If))};Zh.prototype.Confidence=function(){return Yd(this.If)};Zh.prototype.__destroy__=function(){Zd(this.If)};function $h(){throw"cannot construct a PixPtr, no constructor in IDL";}$h.prototype=Object.create(G.prototype);
$h.prototype.constructor=$h;$h.prototype.Nf=$h;$h.Of={};b.PixPtr=$h;$h.prototype.__destroy__=function(){$d(this.If)};function ai(){throw"cannot construct a UNICHARSET, no constructor in IDL";}ai.prototype=Object.create(G.prototype);ai.prototype.constructor=ai;ai.prototype.Nf=ai;ai.Of={};b.UNICHARSET=ai;ai.prototype.get_script_from_script_id=function(a){var c=this.If;a&&"object"===typeof a&&(a=a.If);return q(ae(c,a))};
ai.prototype.get_script_id_from_name=function(a){var c=this.If;I();a=a&&"object"===typeof a?a.If:J(a);return be(c,a)};ai.prototype.get_script_table_size=function(){return ce(this.If)};ai.prototype.__destroy__=function(){de(this.If)};function bi(){throw"cannot construct a IntPtr, no constructor in IDL";}bi.prototype=Object.create(G.prototype);bi.prototype.constructor=bi;bi.prototype.Nf=bi;bi.Of={};b.IntPtr=bi;bi.prototype.__destroy__=function(){ee(this.If)};
function ci(){throw"cannot construct a Orientation, no constructor in IDL";}ci.prototype=Object.create(G.prototype);ci.prototype.constructor=ci;ci.prototype.Nf=ci;ci.Of={};b.Orientation=ci;ci.prototype.__destroy__=function(){fe(this.If)};function S(){throw"cannot construct a OSBestResult, no constructor in IDL";}S.prototype=Object.create(G.prototype);S.prototype.constructor=S;S.prototype.Nf=S;S.Of={};b.OSBestResult=S;S.prototype.get_orientation_id=S.prototype.ii=function(){return ge(this.If)};
Object.defineProperty(S.prototype,"orientation_id",{get:S.prototype.ii});S.prototype.get_script_id=S.prototype.li=function(){return he(this.If)};Object.defineProperty(S.prototype,"script_id",{get:S.prototype.li});S.prototype.get_sconfidence=S.prototype.ki=function(){return ie(this.If)};Object.defineProperty(S.prototype,"sconfidence",{get:S.prototype.ki});S.prototype.get_oconfidence=S.prototype.hi=function(){return je(this.If)};Object.defineProperty(S.prototype,"oconfidence",{get:S.prototype.hi});
S.prototype.__destroy__=function(){ke(this.If)};function T(){throw"cannot construct a Boxa, no constructor in IDL";}T.prototype=Object.create(G.prototype);T.prototype.constructor=T;T.prototype.Nf=T;T.Of={};b.Boxa=T;T.prototype.get_n=T.prototype.hg=function(){return le(this.If)};Object.defineProperty(T.prototype,"n",{get:T.prototype.hg});T.prototype.get_nalloc=T.prototype.ig=function(){return me(this.If)};Object.defineProperty(T.prototype,"nalloc",{get:T.prototype.ig});
T.prototype.get_refcount=T.prototype.cg=function(){return ne(this.If)};Object.defineProperty(T.prototype,"refcount",{get:T.prototype.cg});T.prototype.get_box=T.prototype.ai=function(){return H(oe(this.If),di)};Object.defineProperty(T.prototype,"box",{get:T.prototype.ai});T.prototype.__destroy__=function(){pe(this.If)};function V(){throw"cannot construct a PixColormap, no constructor in IDL";}V.prototype=Object.create(G.prototype);V.prototype.constructor=V;V.prototype.Nf=V;V.Of={};b.PixColormap=V;
V.prototype.get_array=V.prototype.Zh=function(){return qe(this.If)};Object.defineProperty(V.prototype,"array",{get:V.prototype.Zh});V.prototype.get_depth=V.prototype.fi=function(){return re(this.If)};Object.defineProperty(V.prototype,"depth",{get:V.prototype.fi});V.prototype.get_nalloc=V.prototype.ig=function(){return se(this.If)};Object.defineProperty(V.prototype,"nalloc",{get:V.prototype.ig});V.prototype.get_n=V.prototype.hg=function(){return te(this.If)};Object.defineProperty(V.prototype,"n",{get:V.prototype.hg});
V.prototype.__destroy__=function(){ue(this.If)};function M(){throw"cannot construct a Pta, no constructor in IDL";}M.prototype=Object.create(G.prototype);M.prototype.constructor=M;M.prototype.Nf=M;M.Of={};b.Pta=M;M.prototype.get_n=M.prototype.hg=function(){return ve(this.If)};Object.defineProperty(M.prototype,"n",{get:M.prototype.hg});M.prototype.get_nalloc=M.prototype.ig=function(){return we(this.If)};Object.defineProperty(M.prototype,"nalloc",{get:M.prototype.ig});
M.prototype.get_refcount=M.prototype.cg=function(){return xe(this.If)};Object.defineProperty(M.prototype,"refcount",{get:M.prototype.cg});M.prototype.get_x=M.prototype.Tg=function(){return H(ye(this.If),Yh)};Object.defineProperty(M.prototype,"x",{get:M.prototype.Tg});M.prototype.get_y=M.prototype.Ug=function(){return H(ze(this.If),Yh)};Object.defineProperty(M.prototype,"y",{get:M.prototype.Ug});M.prototype.__destroy__=function(){Ae(this.If)};
function O(){throw"cannot construct a Pix, no constructor in IDL";}O.prototype=Object.create(G.prototype);O.prototype.constructor=O;O.prototype.Nf=O;O.Of={};b.Pix=O;O.prototype.get_w=O.prototype.Sg=function(){return Be(this.If)};Object.defineProperty(O.prototype,"w",{get:O.prototype.Sg});O.prototype.get_h=O.prototype.Rg=function(){return Ce(this.If)};Object.defineProperty(O.prototype,"h",{get:O.prototype.Rg});O.prototype.get_d=O.prototype.di=function(){return De(this.If)};
Object.defineProperty(O.prototype,"d",{get:O.prototype.di});O.prototype.get_spp=O.prototype.ni=function(){return Ee(this.If)};Object.defineProperty(O.prototype,"spp",{get:O.prototype.ni});O.prototype.get_wpl=O.prototype.ri=function(){return Fe(this.If)};Object.defineProperty(O.prototype,"wpl",{get:O.prototype.ri});O.prototype.get_refcount=O.prototype.cg=function(){return Ge(this.If)};Object.defineProperty(O.prototype,"refcount",{get:O.prototype.cg});O.prototype.get_xres=O.prototype.si=function(){return He(this.If)};
Object.defineProperty(O.prototype,"xres",{get:O.prototype.si});O.prototype.get_yres=O.prototype.ti=function(){return Ie(this.If)};Object.defineProperty(O.prototype,"yres",{get:O.prototype.ti});O.prototype.get_informat=O.prototype.gi=function(){return Je(this.If)};Object.defineProperty(O.prototype,"informat",{get:O.prototype.gi});O.prototype.get_special=O.prototype.mi=function(){return Ke(this.If)};Object.defineProperty(O.prototype,"special",{get:O.prototype.mi});
O.prototype.get_text=O.prototype.oi=function(){return q(Le(this.If))};Object.defineProperty(O.prototype,"text",{get:O.prototype.oi});O.prototype.get_colormap=O.prototype.ci=function(){return H(Me(this.If),V)};Object.defineProperty(O.prototype,"colormap",{get:O.prototype.ci});O.prototype.get_data=O.prototype.ei=function(){return Ne(this.If)};Object.defineProperty(O.prototype,"data",{get:O.prototype.ei});O.prototype.__destroy__=function(){Oe(this.If)};
function ei(){throw"cannot construct a DoublePtr, no constructor in IDL";}ei.prototype=Object.create(G.prototype);ei.prototype.constructor=ei;ei.prototype.Nf=ei;ei.Of={};b.DoublePtr=ei;ei.prototype.__destroy__=function(){Pe(this.If)};function fi(){throw"cannot construct a Dawg, no constructor in IDL";}fi.prototype=Object.create(G.prototype);fi.prototype.constructor=fi;fi.prototype.Nf=fi;fi.Of={};b.Dawg=fi;fi.prototype.__destroy__=function(){Qe(this.If)};
function di(){throw"cannot construct a BoxPtr, no constructor in IDL";}di.prototype=Object.create(G.prototype);di.prototype.constructor=di;di.prototype.Nf=di;di.Of={};b.BoxPtr=di;di.prototype.__destroy__=function(){Re(this.If)};function X(){this.If=Se();Ih(X)[this.If]=this}X.prototype=Object.create(G.prototype);X.prototype.constructor=X;X.prototype.Nf=X;X.Of={};b.TessBaseAPI=X;X.prototype.Version=function(){return q(Te(this.If))};
X.prototype.SetInputName=function(a){var c=this.If;I();a=a&&"object"===typeof a?a.If:J(a);Ue(c,a)};X.prototype.GetInputName=function(){return q(Ve(this.If))};X.prototype.SetInputImage=function(a){var c=this.If;a&&"object"===typeof a&&(a=a.If);We(c,a)};X.prototype.GetInputImage=function(){return H(Xe(this.If),O)};X.prototype.GetSourceYResolution=function(){return Ye(this.If)};X.prototype.GetDatapath=function(){return q(Ze(this.If))};
X.prototype.SetOutputName=function(a){var c=this.If;I();a=a&&"object"===typeof a?a.If:J(a);$e(c,a)};X.prototype.SetVariable=X.prototype.SetVariable=function(a,c){var d=this.If;I();a=a&&"object"===typeof a?a.If:J(a);c=c&&"object"===typeof c?c.If:J(c);return!!af(d,a,c)};X.prototype.SetDebugVariable=function(a,c){var d=this.If;I();a=a&&"object"===typeof a?a.If:J(a);c=c&&"object"===typeof c?c.If:J(c);return!!bf(d,a,c)};
X.prototype.GetIntVariable=function(a,c){var d=this.If;I();a=a&&"object"===typeof a?a.If:J(a);c&&"object"===typeof c&&(c=c.If);return!!cf(d,a,c)};X.prototype.GetBoolVariable=function(a,c){var d=this.If;I();a=a&&"object"===typeof a?a.If:J(a);c&&"object"===typeof c&&(c=c.If);return!!df(d,a,c)};X.prototype.GetDoubleVariable=function(a,c){var d=this.If;I();a=a&&"object"===typeof a?a.If:J(a);c&&"object"===typeof c&&(c=c.If);return!!ef(d,a,c)};
X.prototype.GetStringVariable=function(a){var c=this.If;I();a=a&&"object"===typeof a?a.If:J(a);return q(ff(c,a))};X.prototype.Init=function(a,c,d,e){void 0===d&&void 0!==e&&(d=3);var g=this.If;I();a=a&&"object"===typeof a?a.If:J(a);c=c&&"object"===typeof c?c.If:J(c);e=e&&"object"===typeof e?e.If:J(e);d&&"object"===typeof d&&(d=d.If);return void 0===d&&void 0!==e?lf(g,a,c,3,e):void 0===d?jf(g,a,c):void 0===e?kf(g,a,c,d):lf(g,a,c,d,e)};X.prototype.GetInitLanguagesAsString=function(){return q(mf(this.If))};
X.prototype.InitForAnalysePage=function(){nf(this.If)};X.prototype.SaveParameters=function(){gf(this.If)};X.prototype.RestoreParameters=function(){hf(this.If)};X.prototype.ReadConfigFile=function(a){var c=this.If;I();a=a&&"object"===typeof a?a.If:J(a);of(c,a)};X.prototype.ReadDebugConfigFile=function(a){var c=this.If;I();a=a&&"object"===typeof a?a.If:J(a);pf(c,a)};X.prototype.SetPageSegMode=function(a){var c=this.If;a&&"object"===typeof a&&(a=a.If);qf(c,a)};X.prototype.GetPageSegMode=function(){return rf(this.If)};
X.prototype.TesseractRect=function(a,c,d,e,g,h,k){var m=this.If;a&&"object"===typeof a&&(a=a.If);c&&"object"===typeof c&&(c=c.If);d&&"object"===typeof d&&(d=d.If);e&&"object"===typeof e&&(e=e.If);g&&"object"===typeof g&&(g=g.If);h&&"object"===typeof h&&(h=h.If);k&&"object"===typeof k&&(k=k.If);return q(sf(m,a,c,d,e,g,h,k))};X.prototype.ClearAdaptiveClassifier=function(){tf(this.If)};
X.prototype.SetImage=function(a,c,d,e,g,h=1,k=0){var m=this.If;a&&"object"===typeof a&&(a=a.If);c&&"object"===typeof c&&(c=c.If);d&&"object"===typeof d&&(d=d.If);e&&"object"===typeof e&&(e=e.If);g&&"object"===typeof g&&(g=g.If);void 0===c||null===c?uf(m,a,h,k):vf(m,a,c,d,e,g,h,k)};X.prototype.SetImageFile=function(a=1,c=0){return wf(this.If,a,c)};X.prototype.SetSourceResolution=function(a){var c=this.If;a&&"object"===typeof a&&(a=a.If);xf(c,a)};
X.prototype.SetRectangle=function(a,c,d,e){var g=this.If;a&&"object"===typeof a&&(a=a.If);c&&"object"===typeof c&&(c=c.If);d&&"object"===typeof d&&(d=d.If);e&&"object"===typeof e&&(e=e.If);yf(g,a,c,d,e)};X.prototype.GetThresholdedImage=function(){return H(zf(this.If),O)};X.prototype.WriteImage=function(a){Af(this.If,a)};X.prototype.GetRegions=function(a){var c=this.If;a&&"object"===typeof a&&(a=a.If);return H(Df(c,a),T)};
X.prototype.GetTextlines=function(a,c,d,e,g){var h=this.If;a&&"object"===typeof a&&(a=a.If);c&&"object"===typeof c&&(c=c.If);d&&"object"===typeof d&&(d=d.If);e&&"object"===typeof e&&(e=e.If);g&&"object"===typeof g&&(g=g.If);return void 0===d?H(Ef(h,a,c),T):void 0===e?H(_emscripten_bind_TessBaseAPI_GetTextlines_3(h,a,c,d),T):void 0===g?H(_emscripten_bind_TessBaseAPI_GetTextlines_4(h,a,c,d,e),T):H(Ff(h,a,c,d,e,g),T)};
X.prototype.GetStrips=function(a,c){var d=this.If;a&&"object"===typeof a&&(a=a.If);c&&"object"===typeof c&&(c=c.If);return H(Gf(d,a,c),T)};X.prototype.GetWords=function(a){var c=this.If;a&&"object"===typeof a&&(a=a.If);return H(Hf(c,a),T)};X.prototype.GetConnectedComponents=function(a){var c=this.If;a&&"object"===typeof a&&(a=a.If);return H(If(c,a),T)};
X.prototype.GetComponentImages=function(a,c,d,e,g,h,k){var m=this.If;a&&"object"===typeof a&&(a=a.If);c&&"object"===typeof c&&(c=c.If);d&&"object"===typeof d&&(d=d.If);e&&"object"===typeof e&&(e=e.If);g&&"object"===typeof g&&(g=g.If);h&&"object"===typeof h&&(h=h.If);k&&"object"===typeof k&&(k=k.If);return void 0===g?H(Jf(m,a,c,d,e),T):void 0===h?H(_emscripten_bind_TessBaseAPI_GetComponentImages_5(m,a,c,d,e,g),T):void 0===k?H(_emscripten_bind_TessBaseAPI_GetComponentImages_6(m,a,c,d,e,g,h),T):H(Kf(m,
a,c,d,e,g,h,k),T)};X.prototype.GetThresholdedImageScaleFactor=function(){return Lf(this.If)};X.prototype.AnalyseLayout=function(a){var c=this.If;a&&"object"===typeof a&&(a=a.If);return void 0===a?H(Mf(c),P):H(Nf(c,a),P)};X.prototype.Recognize=function(a){var c=this.If;a&&"object"===typeof a&&(a=a.If);return Of(c,a)};X.prototype.FindLines=function(){return Bf(this.If)};X.prototype.GetGradient=function(){return Cf(this.If)};
X.prototype.ProcessPages=function(a,c,d,e){var g=this.If;I();a=a&&"object"===typeof a?a.If:J(a);c=c&&"object"===typeof c?c.If:J(c);d&&"object"===typeof d&&(d=d.If);e&&"object"===typeof e&&(e=e.If);return!!Pf(g,a,c,d,e)};
X.prototype.ProcessPage=function(a,c,d,e,g,h){var k=this.If;I();a&&"object"===typeof a&&(a=a.If);c&&"object"===typeof c&&(c=c.If);d=d&&"object"===typeof d?d.If:J(d);e=e&&"object"===typeof e?e.If:J(e);g&&"object"===typeof g&&(g=g.If);h&&"object"===typeof h&&(h=h.If);return!!Qf(k,a,c,d,e,g,h)};X.prototype.GetIterator=function(){return H(Rf(this.If),L)};X.prototype.GetUTF8Text=function(){return q(Sf(this.If))};
X.prototype.GetHOCRText=function(a){var c=this.If;a&&"object"===typeof a&&(a=a.If);return q(Tf(c,a))};X.prototype.GetTSVText=function(a){var c=this.If;a&&"object"===typeof a&&(a=a.If);return q(Uf(c,a))};X.prototype.GetBoxText=function(a){var c=this.If;a&&"object"===typeof a&&(a=a.If);return q(Vf(c,a))};X.prototype.GetUNLVText=function(){return q(Wf(this.If))};X.prototype.GetOsdText=function(a){var c=this.If;a&&"object"===typeof a&&(a=a.If);return q(Xf(c,a))};X.prototype.MeanTextConf=function(){return Yf(this.If)};
X.prototype.AllWordConfidences=function(){return H(Zf(this.If),bi)};X.prototype.AdaptToWordStr=function(a,c){var d=this.If;I();a&&"object"===typeof a&&(a=a.If);c=c&&"object"===typeof c?c.If:J(c);return!!$f(d,a,c)};X.prototype.Clear=function(){ag(this.If)};X.prototype.End=function(){bg(this.If)};X.prototype.ClearPersistentCache=function(){cg(this.If)};X.prototype.IsValidWord=function(a){var c=this.If;I();a=a&&"object"===typeof a?a.If:J(a);return dg(c,a)};
X.prototype.IsValidCharacter=function(a){var c=this.If;I();a=a&&"object"===typeof a?a.If:J(a);return!!eg(c,a)};X.prototype.DetectOS=function(a){var c=this.If;a&&"object"===typeof a&&(a=a.If);return!!fg(c,a)};X.prototype.GetUnichar=function(a){var c=this.If;a&&"object"===typeof a&&(a=a.If);return q(gg(c,a))};X.prototype.GetDawg=function(a){var c=this.If;a&&"object"===typeof a&&(a=a.If);return H(hg(c,a),fi)};X.prototype.NumDawgs=function(){return ig(this.If)};X.prototype.oem=function(){return jg(this.If)};
X.prototype.__destroy__=function(){kg(this.If)};function Y(){this.If=lg();Ih(Y)[this.If]=this}Y.prototype=Object.create(G.prototype);Y.prototype.constructor=Y;Y.prototype.Nf=Y;Y.Of={};b.OSResults=Y;Y.prototype.print_scores=function(){mg(this.If)};Y.prototype.get_best_result=Y.prototype.$h=function(){return H(ng(this.If),S)};Object.defineProperty(Y.prototype,"best_result",{get:Y.prototype.$h});Y.prototype.get_unicharset=Y.prototype.pi=function(){return H(og(this.If),ai)};
Object.defineProperty(Y.prototype,"unicharset",{get:Y.prototype.pi});Y.prototype.__destroy__=function(){pg(this.If)};function Z(){throw"cannot construct a Pixa, no constructor in IDL";}Z.prototype=Object.create(G.prototype);Z.prototype.constructor=Z;Z.prototype.Nf=Z;Z.Of={};b.Pixa=Z;Z.prototype.get_n=Z.prototype.hg=function(){return qg(this.If)};Object.defineProperty(Z.prototype,"n",{get:Z.prototype.hg});Z.prototype.get_nalloc=Z.prototype.ig=function(){return rg(this.If)};
Object.defineProperty(Z.prototype,"nalloc",{get:Z.prototype.ig});Z.prototype.get_refcount=Z.prototype.cg=function(){return sg(this.If)};Object.defineProperty(Z.prototype,"refcount",{get:Z.prototype.cg});Z.prototype.get_pix=Z.prototype.ji=function(){return H(tg(this.If),$h)};Object.defineProperty(Z.prototype,"pix",{get:Z.prototype.ji});Z.prototype.get_boxa=Z.prototype.bi=function(){return H(ug(this.If),T)};Object.defineProperty(Z.prototype,"boxa",{get:Z.prototype.bi});Z.prototype.__destroy__=function(){vg(this.If)};
(function(){function a(){b.RIL_BLOCK=wg();b.RIL_PARA=xg();b.RIL_TEXTLINE=yg();b.RIL_WORD=zg();b.RIL_SYMBOL=Ag();b.OEM_TESSERACT_ONLY=Bg();b.OEM_LSTM_ONLY=Cg();b.OEM_TESSERACT_LSTM_COMBINED=Dg();b.OEM_DEFAULT=Eg();b.OEM_COUNT=Fg();b.WRITING_DIRECTION_LEFT_TO_RIGHT=Gg();b.WRITING_DIRECTION_RIGHT_TO_LEFT=Hg();b.WRITING_DIRECTION_TOP_TO_BOTTOM=Ig();b.PT_UNKNOWN=Jg();b.PT_FLOWING_TEXT=Kg();b.PT_HEADING_TEXT=Lg();b.PT_PULLOUT_TEXT=Mg();b.PT_EQUATION=Ng();b.PT_INLINE_EQUATION=Og();b.PT_TABLE=Pg();b.PT_VERTICAL_TEXT=
Qg();b.PT_CAPTION_TEXT=Rg();b.PT_FLOWING_IMAGE=Sg();b.PT_HEADING_IMAGE=Tg();b.PT_PULLOUT_IMAGE=Ug();b.PT_HORZ_LINE=Vg();b.PT_VERT_LINE=Wg();b.PT_NOISE=Xg();b.PT_COUNT=Yg();b.DIR_NEUTRAL=Zg();b.DIR_LEFT_TO_RIGHT=$g();b.DIR_RIGHT_TO_LEFT=ah();b.DIR_MIX=bh();b.JUSTIFICATION_UNKNOWN=ch();b.JUSTIFICATION_LEFT=dh();b.JUSTIFICATION_CENTER=eh();b.JUSTIFICATION_RIGHT=fh();b.TEXTLINE_ORDER_LEFT_TO_RIGHT=gh();b.TEXTLINE_ORDER_RIGHT_TO_LEFT=hh();b.TEXTLINE_ORDER_TOP_TO_BOTTOM=ih();b.ORIENTATION_PAGE_UP=jh();
b.ORIENTATION_PAGE_RIGHT=kh();b.ORIENTATION_PAGE_DOWN=lh();b.ORIENTATION_PAGE_LEFT=mh();b.PSM_OSD_ONLY=nh();b.PSM_AUTO_OSD=oh();b.PSM_AUTO_ONLY=ph();b.PSM_AUTO=qh();b.PSM_SINGLE_COLUMN=rh();b.PSM_SINGLE_BLOCK_VERT_TEXT=sh();b.PSM_SINGLE_BLOCK=th();b.PSM_SINGLE_LINE=uh();b.PSM_SINGLE_WORD=vh();b.PSM_CIRCLE_WORD=wh();b.PSM_SINGLE_CHAR=xh();b.PSM_SPARSE_TEXT=yh();b.PSM_SPARSE_TEXT_OSD=zh();b.PSM_RAW_LINE=Ah();b.PSM_COUNT=Bh()}La?a():Ia.unshift(a)})();
Ph.prototype.getValue=function(a){return!!Ya(this.If+NaN*(a||0))};bi.prototype.getValue=function(a){return Ya(this.If+4*(a||0),"i32")};Yh.prototype.getValue=function(a){return Ya(this.If+4*(a||0),"float")};ei.prototype.getValue=function(a){return Ya(this.If+8*(a||0),"double")};di.prototype.get=Xh.prototype.get=$h.prototype.get=function(a){return Ya(this.If+4*(a||0),"*")};function gi(){this.og={}}gi.prototype.wrap=function(a,c){var d=zb(4);Za(d,0,"i32");return this.og[a]=H(d,c)};
gi.prototype.bool=function(a){return this.wrap(a,Ph)};gi.prototype.i32=function(a){return this.wrap(a,bi)};gi.prototype.f32=function(a){return this.wrap(a,Yh)};gi.prototype.f64=function(a){return this.og[a]=H(zb(8),ei)};gi.prototype.peek=function(){var a={},c;for(c in this.og)a[c]=this.og[c].getValue();return a};gi.prototype.get=function(){var a={},c;for(c in this.og)a[c]=this.og[c].getValue(),Ch(this.og[c].If);return a};
L.prototype.getBoundingBox=function(a){var c=new gi;this.BoundingBox(a,c.i32("x0"),c.i32("y0"),c.i32("x1"),c.i32("y1"));return c.get()};L.prototype.getBaseline=function(a){var c=new gi;a=!!this.Baseline(a,c.i32("x0"),c.i32("y0"),c.i32("x1"),c.i32("y1"));c=c.get();c.has_baseline=a;return c};
L.prototype.getWordFontAttributes=function(){var a=new gi,c=this.WordFontAttributes(a.bool("is_bold"),a.bool("is_italic"),a.bool("is_underlined"),a.bool("is_monospace"),a.bool("is_serif"),a.bool("is_smallcaps"),a.i32("pointsize"),a.i32("font_id"));a=a.get();a.font_name=c;return a};b.pointerHelper=gi;
return TesseractCore.ready
}
);
})();
if (typeof exports === 'object' && typeof module === 'object')
module.exports = TesseractCore;
else if (typeof define === 'function' && define['amd'])
define([], function() { return TesseractCore; });
else if (typeof exports === 'object')
exports["TesseractCore"] = TesseractCore;

Binary file not shown.

3
src/public/ocr/worker.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,28 @@
import { Suspense } from "react"
import { useDarkMode } from "~/hooks/useDarkmode"
import { OptionRoutingChrome, SidepanelRoutingChrome } from "./chrome"
import { PageAssistLoader } from "@/components/Common/PageAssistLoader"
export const OptionRouting = () => {
const { mode } = useDarkMode()
return (
<div className={`${mode === "dark" ? "dark" : "light"} arimo`}>
<Suspense fallback={<PageAssistLoader />}>
<OptionRoutingChrome />
</Suspense>
</div>
)
}
export const SidepanelRouting = () => {
const { mode } = useDarkMode()
return (
<div className={`${mode === "dark" ? "dark" : "light"} arimo`}>
<Suspense fallback={<PageAssistLoader />}>
<SidepanelRoutingChrome />
</Suspense>
</div>
)
}

View File

@ -1,22 +1,15 @@
import { Suspense } from "react" import { Suspense } from "react"
import { useTranslation } from "react-i18next"
import { useDarkMode } from "~/hooks/useDarkmode" import { useDarkMode } from "~/hooks/useDarkmode"
import { OptionRoutingChrome, SidepanelRoutingChrome } from "./chrome"
import { OptionRoutingFirefox, SidepanelRoutingFirefox } from "./firefox" import { OptionRoutingFirefox, SidepanelRoutingFirefox } from "./firefox"
import { PageAssistLoader } from "@/components/Common/PageAssistLoader" import { PageAssistLoader } from "@/components/Common/PageAssistLoader"
export const OptionRouting = () => { export const OptionRouting = () => {
const { mode } = useDarkMode() const { mode } = useDarkMode()
const { i18n } = useTranslation()
return ( return (
<div className={`${mode === "dark" ? "dark" : "light"} arimo`}> <div className={`${mode === "dark" ? "dark" : "light"} arimo`}>
<Suspense fallback={<PageAssistLoader />}> <Suspense fallback={<PageAssistLoader />}>
{import.meta.env.BROWSER === "chrome" ? ( <OptionRoutingFirefox />
<OptionRoutingChrome />
) : (
<OptionRoutingFirefox />
)}
</Suspense> </Suspense>
</div> </div>
) )
@ -24,16 +17,11 @@ export const OptionRouting = () => {
export const SidepanelRouting = () => { export const SidepanelRouting = () => {
const { mode } = useDarkMode() const { mode } = useDarkMode()
const { i18n } = useTranslation()
return ( return (
<div className={`${mode === "dark" ? "dark" : "light"} arimo`}> <div className={`${mode === "dark" ? "dark" : "light"} arimo`}>
<Suspense fallback={<PageAssistLoader />}> <Suspense fallback={<PageAssistLoader />}>
{import.meta.env.BROWSER === "chrome" ? ( <SidepanelRoutingFirefox />
<SidepanelRoutingChrome />
) : (
<SidepanelRoutingFirefox />
)}
</Suspense> </Suspense>
</div> </div>
) )

View File

@ -0,0 +1,49 @@
import axios from 'axios';
export interface Voice {
voice_id: string;
name: string;
}
export interface Model {
model_id: string;
name: string;
}
const BASE_URL = 'https://api.elevenlabs.io/v1';
export const getVoices = async (apiKey: string): Promise<Voice[]> => {
const response = await axios.get(`${BASE_URL}/voices`, {
headers: { 'xi-api-key': apiKey }
});
return response.data.voices;
};
export const getModels = async (apiKey: string): Promise<Model[]> => {
const response = await axios.get(`${BASE_URL}/models`, {
headers: { 'xi-api-key': apiKey }
});
return response.data;
};
export const generateSpeech = async (
apiKey: string,
text: string,
voiceId: string,
modelId: string
): Promise<ArrayBuffer> => {
const response = await axios.post(
`${BASE_URL}/text-to-speech/${voiceId}`,
{
text,
model_id: modelId,
},
{
headers: {
'xi-api-key': apiKey,
'Content-Type': 'application/json',
},
responseType: 'arraybuffer',
}
);
return response.data;
};

View File

@ -32,6 +32,7 @@ type ModelSettings = {
useMLock?: boolean useMLock?: boolean
useMMap?: boolean useMMap?: boolean
vocabOnly?: boolean vocabOnly?: boolean
minP?: number
} }
const keys = [ const keys = [
@ -62,7 +63,8 @@ const keys = [
"typicalP", "typicalP",
"useMLock", "useMLock",
"useMMap", "useMMap",
"vocabOnly" "vocabOnly",
"minP",
] ]
export const getAllModelSettings = async () => { export const getAllModelSettings = async () => {

View File

@ -231,8 +231,8 @@ export const setOllamaURL = async (ollamaURL: string) => {
"http://127.0.0.1:" "http://127.0.0.1:"
) )
} }
await urlRewriteRuntime(cleanUrl(formattedUrl))
await storage.set("ollamaURL", cleanUrl(formattedUrl)) await storage.set("ollamaURL", cleanUrl(formattedUrl))
await urlRewriteRuntime(cleanUrl(formattedUrl))
} }
export const systemPromptForNonRag = async () => { export const systemPromptForNonRag = async () => {

View File

@ -4,7 +4,7 @@ const storage = new Storage()
const DEFAULT_TTS_PROVIDER = "browser" const DEFAULT_TTS_PROVIDER = "browser"
const AVAILABLE_TTS_PROVIDERS = ["browser"] as const const AVAILABLE_TTS_PROVIDERS = ["browser", "elevenlabs"] as const
export const getTTSProvider = async (): Promise< export const getTTSProvider = async (): Promise<
(typeof AVAILABLE_TTS_PROVIDERS)[number] (typeof AVAILABLE_TTS_PROVIDERS)[number]
@ -63,22 +63,78 @@ export const setSSMLEnabled = async (isSSMLEnabled: boolean) => {
await storage.set("isSSMLEnabled", isSSMLEnabled.toString()) await storage.set("isSSMLEnabled", isSSMLEnabled.toString())
} }
export const getElevenLabsApiKey = async () => {
const data = await storage.get("elevenLabsApiKey")
return data
}
export const setElevenLabsApiKey = async (elevenLabsApiKey: string) => {
await storage.set("elevenLabsApiKey", elevenLabsApiKey)
}
export const getElevenLabsVoiceId = async () => {
const data = await storage.get("elevenLabsVoiceId")
return data
}
export const setElevenLabsVoiceId = async (elevenLabsVoiceId: string) => {
await storage.set("elevenLabsVoiceId", elevenLabsVoiceId)
}
export const getElevenLabsModel = async () => {
const data = await storage.get("elevenLabsModel")
return data
}
export const setElevenLabsModel = async (elevenLabsModel: string) => {
await storage.set("elevenLabsModel", elevenLabsModel)
}
export const getResponseSplitting = async () => {
const data = await storage.get("ttsResponseSplitting")
if (!data || data.length === 0 || data === "") {
return "punctuation"
}
return data
}
export const setResponseSplitting = async (responseSplitting: string) => {
await storage.set("ttsResponseSplitting", responseSplitting)
}
export const getTTSSettings = async () => { export const getTTSSettings = async () => {
const [ttsEnabled, ttsProvider, browserTTSVoices, voice, ssmlEnabled] = const [
await Promise.all([ ttsEnabled,
isTTSEnabled(), ttsProvider,
getTTSProvider(), browserTTSVoices,
getBrowserTTSVoices(), voice,
getVoice(), ssmlEnabled,
isSSMLEnabled() elevenLabsApiKey,
]) elevenLabsVoiceId,
elevenLabsModel,
responseSplitting
] = await Promise.all([
isTTSEnabled(),
getTTSProvider(),
getBrowserTTSVoices(),
getVoice(),
isSSMLEnabled(),
getElevenLabsApiKey(),
getElevenLabsVoiceId(),
getElevenLabsModel(),
getResponseSplitting()
])
return { return {
ttsEnabled, ttsEnabled,
ttsProvider, ttsProvider,
browserTTSVoices, browserTTSVoices,
voice, voice,
ssmlEnabled ssmlEnabled,
elevenLabsApiKey,
elevenLabsVoiceId,
elevenLabsModel,
responseSplitting
} }
} }
@ -86,17 +142,29 @@ export const setTTSSettings = async ({
ttsEnabled, ttsEnabled,
ttsProvider, ttsProvider,
voice, voice,
ssmlEnabled ssmlEnabled,
elevenLabsApiKey,
elevenLabsVoiceId,
elevenLabsModel,
responseSplitting
}: { }: {
ttsEnabled: boolean ttsEnabled: boolean
ttsProvider: string ttsProvider: string
voice: string voice: string
ssmlEnabled: boolean ssmlEnabled: boolean
elevenLabsApiKey: string
elevenLabsVoiceId: string
elevenLabsModel: string
responseSplitting: string
}) => { }) => {
await Promise.all([ await Promise.all([
setTTSEnabled(ttsEnabled), setTTSEnabled(ttsEnabled),
setTTSProvider(ttsProvider), setTTSProvider(ttsProvider),
setVoice(voice), setVoice(voice),
setSSMLEnabled(ssmlEnabled) setSSMLEnabled(ssmlEnabled),
setElevenLabsApiKey(elevenLabsApiKey),
setElevenLabsVoiceId(elevenLabsVoiceId),
setElevenLabsModel(elevenLabsModel),
setResponseSplitting(responseSplitting)
]) ])
} }

View File

@ -45,6 +45,9 @@ type State = {
selectedQuickPrompt: string | null selectedQuickPrompt: string | null
setSelectedQuickPrompt: (selectedQuickPrompt: string) => void setSelectedQuickPrompt: (selectedQuickPrompt: string) => void
useOCR: boolean
setUseOCR: (useOCR: boolean) => void
} }
export const useStoreMessage = create<State>((set) => ({ export const useStoreMessage = create<State>((set) => ({
@ -79,5 +82,8 @@ export const useStoreMessage = create<State>((set) => ({
setSelectedSystemPrompt: (selectedSystemPrompt) => setSelectedSystemPrompt: (selectedSystemPrompt) =>
set({ selectedSystemPrompt }), set({ selectedSystemPrompt }),
selectedQuickPrompt: null, selectedQuickPrompt: null,
setSelectedQuickPrompt: (selectedQuickPrompt) => set({ selectedQuickPrompt }) setSelectedQuickPrompt: (selectedQuickPrompt) => set({ selectedQuickPrompt }),
useOCR: false,
setUseOCR: (useOCR) => set({ useOCR })
})) }))

View File

@ -30,6 +30,7 @@ type CurrentChatModelSettings = {
useMMap?: boolean useMMap?: boolean
vocabOnly?: boolean vocabOnly?: boolean
seed?: number seed?: number
minP?: number
setF16KV?: (f16KV: boolean) => void setF16KV?: (f16KV: boolean) => void
setFrequencyPenalty?: (frequencyPenalty: number) => void setFrequencyPenalty?: (frequencyPenalty: number) => void
@ -65,6 +66,8 @@ type CurrentChatModelSettings = {
reset: () => void reset: () => void
systemPrompt?: string systemPrompt?: string
setSystemPrompt: (systemPrompt: string) => void setSystemPrompt: (systemPrompt: string) => void
setMinP: (minP: number) => void
} }
export const useStoreChatModelSettings = create<CurrentChatModelSettings>( export const useStoreChatModelSettings = create<CurrentChatModelSettings>(
@ -103,6 +106,7 @@ export const useStoreChatModelSettings = create<CurrentChatModelSettings>(
seetSeed: (seed: number) => set({ seed }), seetSeed: (seed: number) => set({ seed }),
setX: (key: string, value: any) => set({ [key]: value }), setX: (key: string, value: any) => set({ [key]: value }),
systemPrompt: undefined, systemPrompt: undefined,
setMinP: (minP: number) => set({ minP }),
setSystemPrompt: (systemPrompt: string) => set({ systemPrompt }), setSystemPrompt: (systemPrompt: string) => set({ systemPrompt }),
reset: () => reset: () =>
set({ set({
@ -135,7 +139,8 @@ export const useStoreChatModelSettings = create<CurrentChatModelSettings>(
useMMap: undefined, useMMap: undefined,
vocabOnly: undefined, vocabOnly: undefined,
seed: undefined, seed: undefined,
systemPrompt: undefined systemPrompt: undefined,
minP: undefined,
}) })
}) })
) )

View File

@ -68,6 +68,9 @@ type State = {
temporaryChat: boolean temporaryChat: boolean
setTemporaryChat: (temporaryChat: boolean) => void setTemporaryChat: (temporaryChat: boolean) => void
useOCR: boolean
setUseOCR: (useOCR: boolean) => void
} }
export const useStoreMessageOption = create<State>((set) => ({ export const useStoreMessageOption = create<State>((set) => ({
@ -109,4 +112,7 @@ export const useStoreMessageOption = create<State>((set) => ({
temporaryChat: false, temporaryChat: false,
setTemporaryChat: (temporaryChat) => set({ temporaryChat }), setTemporaryChat: (temporaryChat) => set({ temporaryChat }),
useOCR: false,
setUseOCR: (useOCR) => set({ useOCR }),
})) }))

View File

@ -4,14 +4,33 @@ import { HumanMessage, type MessageContent } from "@langchain/core/messages"
type HumanMessageType = { type HumanMessageType = {
content: MessageContent content: MessageContent
model: string model: string
useOCR: boolean
} }
export const humanMessageFormatter = ({ content, model }: HumanMessageType) => { export const humanMessageFormatter = async ({
content,
model,
useOCR = false
}: HumanMessageType) => {
const isCustom = isCustomModel(model) const isCustom = isCustomModel(model)
if (isCustom) { if (isCustom) {
if (typeof content !== "string") { if (typeof content !== "string") {
if (content.length > 1) { if (content.length > 1) {
if (useOCR) {
//@ts-ignore
const imageUrl = content[1].image_url
const ocrText = await processImageForOCR(imageUrl)
//@ts-ignore
const ocrPROMPT = `${content[0].text}
[IMAGE OCR TEXT]
${ocrText}`
return new HumanMessage({
content: ocrPROMPT
})
}
// this means that we need to reformat the image_url // this means that we need to reformat the image_url
const newContent: MessageContent = [ const newContent: MessageContent = [
{ {
@ -40,6 +59,21 @@ export const humanMessageFormatter = ({ content, model }: HumanMessageType) => {
} }
} }
if (useOCR) {
if (typeof content !== "string" && content.length > 1) {
//@ts-ignore
const ocrText = await processImageForOCR(content[1].image_url)
//@ts-ignore
const ocrPROMPT = `${content[0].text}
[IMAGE OCR TEXT]
${ocrText}`
return new HumanMessage({
content: ocrPROMPT
})
}
}
return new HumanMessage({ return new HumanMessage({
content content
}) })

17
src/utils/ocr.ts Normal file
View File

@ -0,0 +1,17 @@
import { createWorker } from 'tesseract.js';
export async function processImageForOCR(imageData: string): Promise<string> {
const worker = await createWorker('eng-fast', undefined, {
workerPath: "/ocr/worker.min.js",
workerBlobURL: false,
corePath: "/ocr/tesseract-core-simd.js",
errorHandler: e => console.error(e),
langPath: "/ocr/lang"
});
const result = await worker.recognize(imageData);
await worker.terminate();
return result.data.text;
}

112
src/utils/tts.ts Normal file
View File

@ -0,0 +1,112 @@
// inspired from https://github.com/open-webui/open-webui/blob/2299f4843003759290cc6bf823595c6578ee4470/src/lib/utils/index.ts
const CODE_BLOCK_PATTERN = /```[\s\S]*?```/g;
export const sanitizeEmojis = (text: string): string => {
const EMOJI_PATTERN = /[\uD800-\uDBFF][\uDC00-\uDFFF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDE4F]/g;
return text.replace(EMOJI_PATTERN, '');
};
export const sanitizeMarkdown = (text: string): string => {
return text
.replace(/(```[\s\S]*?```)/g, '')
.replace(/^\|.*\|$/gm, '')
.replace(/(?:\*\*|__)(.*?)(?:\*\*|__)/g, '$1')
.replace(/(?:[*_])(.*?)(?:[*_])/g, '$1')
.replace(/~~(.*?)~~/g, '$1')
.replace(/`([^`]+)`/g, '$1')
.replace(/!?\[([^\]]*)\](?:\([^)]+\)|\[[^\]]*\])/g, '$1')
.replace(/^\[[^\]]+\]:\s*.*$/gm, '')
.replace(/^#{1,6}\s+/gm, '')
.replace(/^\s*[-*+]\s+/gm, '')
.replace(/^\s*(?:\d+\.)\s+/gm, '')
.replace(/^\s*>[> ]*/gm, '')
.replace(/^\s*:\s+/gm, '')
.replace(/\[\^[^\]]*\]/g, '')
.replace(/[-*_~]/g, '')
.replace(/\n{2,}/g, '\n');
};
export const sanitizeText = (content: string): string => {
return sanitizeMarkdown(sanitizeEmojis(content.trim()));
};
export const parseTextIntoSentences = (text: string): string[] => {
const codeBlocks: string[] = [];
let blockIndex = 0;
const processedText = text.replace(CODE_BLOCK_PATTERN, (match) => {
const placeholder = `\u0000${blockIndex}\u0000`;
codeBlocks[blockIndex++] = match;
return placeholder;
});
const sentences = processedText.split(/(?<=[.!?])\s+/);
return sentences
.map(sentence =>
sentence.replace(/\u0000(\d+)\u0000/g, (_, idx) => codeBlocks[idx])
)
.map(sanitizeText)
.filter(Boolean);
};
export const parseTextIntoParagraphs = (text: string): string[] => {
const codeBlocks: string[] = [];
let blockIndex = 0;
const processedText = text.replace(CODE_BLOCK_PATTERN, (match) => {
const placeholder = `\u0000${blockIndex}\u0000`;
codeBlocks[blockIndex++] = match;
return placeholder;
});
return processedText
.split(/\n+/)
.map(paragraph =>
paragraph.replace(/\u0000(\d+)\u0000/g, (_, idx) => codeBlocks[idx])
)
.map(sanitizeText)
.filter(Boolean);
};
export const optimizeSentencesForSpeech = (text: string): string[] => {
return parseTextIntoSentences(text).reduce((optimizedTexts, currentText) => {
const lastIndex = optimizedTexts.length - 1;
if (lastIndex >= 0) {
const previousText = optimizedTexts[lastIndex];
const wordCount = previousText.split(/\s+/).length;
const charCount = previousText.length;
if (wordCount < 4 || charCount < 50) {
optimizedTexts[lastIndex] = `${previousText} ${currentText}`;
} else {
optimizedTexts.push(currentText);
}
} else {
optimizedTexts.push(currentText);
}
return optimizedTexts;
}, [] as string[]);
};
export const splitMessageContent = (content: string, splitBy: string = 'punctuation') => {
const messageContentParts: string[] = [];
switch (splitBy) {
case 'punctuation':
messageContentParts.push(...optimizeSentencesForSpeech(content));
break;
case 'paragraph':
messageContentParts.push(...parseTextIntoParagraphs(content));
break;
case 'none':
messageContentParts.push(sanitizeText(content));
break;
default:
}
return messageContentParts;
};

View File

@ -45,12 +45,13 @@ export default defineConfig({
} }
} }
}), }),
entrypointsDir: "entries", entrypointsDir:
process.env.TARGET === "firefox" ? "entries-firefox" : "entries",
srcDir: "src", srcDir: "src",
outDir: "build", outDir: "build",
manifest: { manifest: {
version: "1.3.9", version: "1.4.0",
name: name:
process.env.TARGET === "firefox" process.env.TARGET === "firefox"
? "Page Assist - A Web UI for Local AI Models" ? "Page Assist - A Web UI for Local AI Models"
@ -85,6 +86,12 @@ export default defineConfig({
} }
} }
}, },
content_security_policy:
process.env.TARGET !== "firefox" ?
{
extension_pages:
"script-src 'self' 'wasm-unsafe-eval'; object-src 'self';"
} : undefined,
permissions: permissions:
process.env.TARGET === "firefox" process.env.TARGET === "firefox"
? firefoxMV2Permissions ? firefoxMV2Permissions