This commit is contained in:
2026-05-06 10:56:02 +03:00
parent 661bf461f9
commit 17266730fc
11 changed files with 562 additions and 1024 deletions
@@ -8,8 +8,8 @@ using System.Text.Json;
namespace Api.Controllers; namespace Api.Controllers;
[ApiController] [ApiController]
[Route("api/rag")] [Route("api/cv-matcher")]
[EnableRateLimiting("rag")] [EnableRateLimiting("cv-matcher")]
public sealed class RagController : ControllerBase public sealed class RagController : ControllerBase
{ {
private readonly IHttpClientFactory _httpClientFactory; private readonly IHttpClientFactory _httpClientFactory;
@@ -26,7 +26,7 @@ public sealed class RagController : ControllerBase
_logger = logger; _logger = logger;
} }
[HttpPost("cv")] [HttpPost("upload")]
[RequestSizeLimit(8 * 1024 * 1024)] [RequestSizeLimit(8 * 1024 * 1024)]
[ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status400BadRequest)] [ProducesResponseType(StatusCodes.Status400BadRequest)]
+1 -1
View File
@@ -164,7 +164,7 @@ try
}); });
// Policy: CV matcher, expensive because it calls AI APIs. // Policy: CV matcher, expensive because it calls AI APIs.
options.AddPolicy("rag", httpContext => options.AddPolicy("cv-matcher", httpContext =>
{ {
var ip = httpContext.Connection.RemoteIpAddress?.ToString() ?? "unknown"; var ip = httpContext.Connection.RemoteIpAddress?.ToString() ?? "unknown";
return RateLimitPartition.GetFixedWindowLimiter( return RateLimitPartition.GetFixedWindowLimiter(
-9
View File
@@ -1,9 +0,0 @@
namespace Api.Settings;
public sealed class OpenAiSettings
{
public string ApiKey { get; set; } = string.Empty;
public string ChatModel { get; set; } = "gpt-4o-mini";
public string EmbeddingModel { get; set; } = "text-embedding-3-small";
public int TimeoutSeconds { get; set; } = 60;
}
-11
View File
@@ -1,11 +0,0 @@
namespace Api.Settings;
public sealed class RagSettings
{
public int MaxPdfSizeMb { get; set; } = 5;
public int ChunkSize { get; set; } = 900;
public int ChunkOverlap { get; set; } = 150;
public int CvTtlMinutes { get; set; } = 60;
public int MaxJobTextChars { get; set; } = 20000;
public int TopK { get; set; } = 6;
}
+3 -13
View File
@@ -76,18 +76,8 @@
"FromEmail": "", "FromEmail": "",
"SubjectPrefix": "[File Download]" "SubjectPrefix": "[File Download]"
}, },
"OpenAI": { "CvMatcherApi": {
"ApiKey": "", "BaseUrl": "",
"ChatModel": "gpt-4o-mini", "InternalApiKey": ""
"EmbeddingModel": "text-embedding-3-small",
"TimeoutSeconds": 60
},
"Rag": {
"MaxPdfSizeMb": 5,
"ChunkSize": 900,
"ChunkOverlap": 150,
"CvTtlMinutes": 60,
"MaxJobTextChars": 20000,
"TopK": 6
} }
} }
-4
View File
@@ -105,9 +105,5 @@
"ToEmail": "", "ToEmail": "",
"FromEmail": "", "FromEmail": "",
"SubjectPrefix": "[File Download]" "SubjectPrefix": "[File Download]"
},
"CvMatcherApi": {
"BaseUrl": "",
"InternalApiKey": ""
} }
} }
+48
View File
@@ -6,6 +6,54 @@
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS> <DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<RootNamespace>Api</RootNamespace> <RootNamespace>Api</RootNamespace>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<Content Remove="C:\Users\Gelu\.nuget\packages\microsoft.codeanalysis.workspaces.msbuild\4.14.0\contentFiles\any\any\BuildHost-net472\cs\System.CommandLine.resources.dll" />
<Content Remove="C:\Users\Gelu\.nuget\packages\microsoft.codeanalysis.workspaces.msbuild\4.14.0\contentFiles\any\any\BuildHost-net472\de\System.CommandLine.resources.dll" />
<Content Remove="C:\Users\Gelu\.nuget\packages\microsoft.codeanalysis.workspaces.msbuild\4.14.0\contentFiles\any\any\BuildHost-net472\es\System.CommandLine.resources.dll" />
<Content Remove="C:\Users\Gelu\.nuget\packages\microsoft.codeanalysis.workspaces.msbuild\4.14.0\contentFiles\any\any\BuildHost-net472\fr\System.CommandLine.resources.dll" />
<Content Remove="C:\Users\Gelu\.nuget\packages\microsoft.codeanalysis.workspaces.msbuild\4.14.0\contentFiles\any\any\BuildHost-net472\it\System.CommandLine.resources.dll" />
<Content Remove="C:\Users\Gelu\.nuget\packages\microsoft.codeanalysis.workspaces.msbuild\4.14.0\contentFiles\any\any\BuildHost-net472\ja\System.CommandLine.resources.dll" />
<Content Remove="C:\Users\Gelu\.nuget\packages\microsoft.codeanalysis.workspaces.msbuild\4.14.0\contentFiles\any\any\BuildHost-net472\ko\System.CommandLine.resources.dll" />
<Content Remove="C:\Users\Gelu\.nuget\packages\microsoft.codeanalysis.workspaces.msbuild\4.14.0\contentFiles\any\any\BuildHost-net472\Microsoft.Build.Locator.dll" />
<Content Remove="C:\Users\Gelu\.nuget\packages\microsoft.codeanalysis.workspaces.msbuild\4.14.0\contentFiles\any\any\BuildHost-net472\Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost.exe" />
<Content Remove="C:\Users\Gelu\.nuget\packages\microsoft.codeanalysis.workspaces.msbuild\4.14.0\contentFiles\any\any\BuildHost-net472\Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost.exe.config" />
<Content Remove="C:\Users\Gelu\.nuget\packages\microsoft.codeanalysis.workspaces.msbuild\4.14.0\contentFiles\any\any\BuildHost-net472\Microsoft.IO.Redist.dll" />
<Content Remove="C:\Users\Gelu\.nuget\packages\microsoft.codeanalysis.workspaces.msbuild\4.14.0\contentFiles\any\any\BuildHost-net472\Newtonsoft.Json.dll" />
<Content Remove="C:\Users\Gelu\.nuget\packages\microsoft.codeanalysis.workspaces.msbuild\4.14.0\contentFiles\any\any\BuildHost-net472\pl\System.CommandLine.resources.dll" />
<Content Remove="C:\Users\Gelu\.nuget\packages\microsoft.codeanalysis.workspaces.msbuild\4.14.0\contentFiles\any\any\BuildHost-net472\pt-BR\System.CommandLine.resources.dll" />
<Content Remove="C:\Users\Gelu\.nuget\packages\microsoft.codeanalysis.workspaces.msbuild\4.14.0\contentFiles\any\any\BuildHost-net472\ru\System.CommandLine.resources.dll" />
<Content Remove="C:\Users\Gelu\.nuget\packages\microsoft.codeanalysis.workspaces.msbuild\4.14.0\contentFiles\any\any\BuildHost-net472\System.Buffers.dll" />
<Content Remove="C:\Users\Gelu\.nuget\packages\microsoft.codeanalysis.workspaces.msbuild\4.14.0\contentFiles\any\any\BuildHost-net472\System.Collections.Immutable.dll" />
<Content Remove="C:\Users\Gelu\.nuget\packages\microsoft.codeanalysis.workspaces.msbuild\4.14.0\contentFiles\any\any\BuildHost-net472\System.CommandLine.dll" />
<Content Remove="C:\Users\Gelu\.nuget\packages\microsoft.codeanalysis.workspaces.msbuild\4.14.0\contentFiles\any\any\BuildHost-net472\System.Memory.dll" />
<Content Remove="C:\Users\Gelu\.nuget\packages\microsoft.codeanalysis.workspaces.msbuild\4.14.0\contentFiles\any\any\BuildHost-net472\System.Numerics.Vectors.dll" />
<Content Remove="C:\Users\Gelu\.nuget\packages\microsoft.codeanalysis.workspaces.msbuild\4.14.0\contentFiles\any\any\BuildHost-net472\System.Runtime.CompilerServices.Unsafe.dll" />
<Content Remove="C:\Users\Gelu\.nuget\packages\microsoft.codeanalysis.workspaces.msbuild\4.14.0\contentFiles\any\any\BuildHost-net472\System.Threading.Tasks.Extensions.dll" />
<Content Remove="C:\Users\Gelu\.nuget\packages\microsoft.codeanalysis.workspaces.msbuild\4.14.0\contentFiles\any\any\BuildHost-net472\tr\System.CommandLine.resources.dll" />
<Content Remove="C:\Users\Gelu\.nuget\packages\microsoft.codeanalysis.workspaces.msbuild\4.14.0\contentFiles\any\any\BuildHost-net472\zh-Hans\System.CommandLine.resources.dll" />
<Content Remove="C:\Users\Gelu\.nuget\packages\microsoft.codeanalysis.workspaces.msbuild\4.14.0\contentFiles\any\any\BuildHost-net472\zh-Hant\System.CommandLine.resources.dll" />
<Content Remove="C:\Users\Gelu\.nuget\packages\microsoft.codeanalysis.workspaces.msbuild\4.14.0\contentFiles\any\any\BuildHost-netcore\cs\System.CommandLine.resources.dll" />
<Content Remove="C:\Users\Gelu\.nuget\packages\microsoft.codeanalysis.workspaces.msbuild\4.14.0\contentFiles\any\any\BuildHost-netcore\de\System.CommandLine.resources.dll" />
<Content Remove="C:\Users\Gelu\.nuget\packages\microsoft.codeanalysis.workspaces.msbuild\4.14.0\contentFiles\any\any\BuildHost-netcore\es\System.CommandLine.resources.dll" />
<Content Remove="C:\Users\Gelu\.nuget\packages\microsoft.codeanalysis.workspaces.msbuild\4.14.0\contentFiles\any\any\BuildHost-netcore\fr\System.CommandLine.resources.dll" />
<Content Remove="C:\Users\Gelu\.nuget\packages\microsoft.codeanalysis.workspaces.msbuild\4.14.0\contentFiles\any\any\BuildHost-netcore\it\System.CommandLine.resources.dll" />
<Content Remove="C:\Users\Gelu\.nuget\packages\microsoft.codeanalysis.workspaces.msbuild\4.14.0\contentFiles\any\any\BuildHost-netcore\ja\System.CommandLine.resources.dll" />
<Content Remove="C:\Users\Gelu\.nuget\packages\microsoft.codeanalysis.workspaces.msbuild\4.14.0\contentFiles\any\any\BuildHost-netcore\ko\System.CommandLine.resources.dll" />
<Content Remove="C:\Users\Gelu\.nuget\packages\microsoft.codeanalysis.workspaces.msbuild\4.14.0\contentFiles\any\any\BuildHost-netcore\Microsoft.Build.Locator.dll" />
<Content Remove="C:\Users\Gelu\.nuget\packages\microsoft.codeanalysis.workspaces.msbuild\4.14.0\contentFiles\any\any\BuildHost-netcore\Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost.deps.json" />
<Content Remove="C:\Users\Gelu\.nuget\packages\microsoft.codeanalysis.workspaces.msbuild\4.14.0\contentFiles\any\any\BuildHost-netcore\Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost.dll" />
<Content Remove="C:\Users\Gelu\.nuget\packages\microsoft.codeanalysis.workspaces.msbuild\4.14.0\contentFiles\any\any\BuildHost-netcore\Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost.dll.config" />
<Content Remove="C:\Users\Gelu\.nuget\packages\microsoft.codeanalysis.workspaces.msbuild\4.14.0\contentFiles\any\any\BuildHost-netcore\Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost.runtimeconfig.json" />
<Content Remove="C:\Users\Gelu\.nuget\packages\microsoft.codeanalysis.workspaces.msbuild\4.14.0\contentFiles\any\any\BuildHost-netcore\Newtonsoft.Json.dll" />
<Content Remove="C:\Users\Gelu\.nuget\packages\microsoft.codeanalysis.workspaces.msbuild\4.14.0\contentFiles\any\any\BuildHost-netcore\pl\System.CommandLine.resources.dll" />
<Content Remove="C:\Users\Gelu\.nuget\packages\microsoft.codeanalysis.workspaces.msbuild\4.14.0\contentFiles\any\any\BuildHost-netcore\pt-BR\System.CommandLine.resources.dll" />
<Content Remove="C:\Users\Gelu\.nuget\packages\microsoft.codeanalysis.workspaces.msbuild\4.14.0\contentFiles\any\any\BuildHost-netcore\ru\System.CommandLine.resources.dll" />
<Content Remove="C:\Users\Gelu\.nuget\packages\microsoft.codeanalysis.workspaces.msbuild\4.14.0\contentFiles\any\any\BuildHost-netcore\System.Collections.Immutable.dll" />
<Content Remove="C:\Users\Gelu\.nuget\packages\microsoft.codeanalysis.workspaces.msbuild\4.14.0\contentFiles\any\any\BuildHost-netcore\System.CommandLine.dll" />
<Content Remove="C:\Users\Gelu\.nuget\packages\microsoft.codeanalysis.workspaces.msbuild\4.14.0\contentFiles\any\any\BuildHost-netcore\tr\System.CommandLine.resources.dll" />
<Content Remove="C:\Users\Gelu\.nuget\packages\microsoft.codeanalysis.workspaces.msbuild\4.14.0\contentFiles\any\any\BuildHost-netcore\zh-Hans\System.CommandLine.resources.dll" />
<Content Remove="C:\Users\Gelu\.nuget\packages\microsoft.codeanalysis.workspaces.msbuild\4.14.0\contentFiles\any\any\BuildHost-netcore\zh-Hant\System.CommandLine.resources.dll" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Azure.Extensions.AspNetCore.Configuration.Secrets" Version="1.5.1" /> <PackageReference Include="Azure.Extensions.AspNetCore.Configuration.Secrets" Version="1.5.1" />
+1 -1
View File
@@ -194,6 +194,6 @@
<a href="#" id="cookieManage" class="cookie-manage btn btn-dark btn-sm shadow" style="display:none;" data-i18n="cookies.settings">Cookie settings</a> <a href="#" id="cookieManage" class="cookie-manage btn btn-dark btn-sm shadow" style="display:none;" data-i18n="cookies.settings">Cookie settings</a>
<script src="/js/vendor/jquery-1.12.4.min.js"></script> <script src="/js/vendor/jquery-1.12.4.min.js"></script>
<script src="/js/bootstrap.min.js"></script> <script src="/js/bootstrap.min.js"></script>
<script src="/js/myai.js"></script> <script src="/js/main.js"></script>
</body> </body>
</html> </html>
+1 -1
View File
@@ -194,6 +194,6 @@
<a href="#" id="cookieManage" class="cookie-manage btn btn-dark btn-sm shadow" style="display:none;" data-i18n="cookies.settings">Cookie settings</a> <a href="#" id="cookieManage" class="cookie-manage btn btn-dark btn-sm shadow" style="display:none;" data-i18n="cookies.settings">Cookie settings</a>
<script src="/js/vendor/jquery-1.12.4.min.js"></script> <script src="/js/vendor/jquery-1.12.4.min.js"></script>
<script src="/js/bootstrap.min.js"></script> <script src="/js/bootstrap.min.js"></script>
<script src="/js/myai.js"></script> <script src="/js/main.js"></script>
</body> </body>
</html> </html>
+504 -460
View File
@@ -1,490 +1,534 @@
var translations = {
ro: {
'brand.tagline': 'Romania dezvoltare applicatii',
'nav.products': 'Produse', 'nav.services': 'Servicii', 'nav.contact': 'Contactati-ne',
'hero.eyebrow': 'Portofoliu software easySoft',
'hero.title': 'Software pentru cabinete dentare, gestiune de stocuri si salvare sigura a datelor.',
'hero.text': 'Aplicatii practice construite pentru fluxuri reale de lucru: managementul pacientilor, contabilitate si gestiune, plus backup automatizat pentru fisiere importante.',
'hero.ctaPrimary': 'Vezi produsele', 'hero.ctaSecondary': 'Contactati-ne',
'hero.metric1': 'aplicații software', 'hero.metric2': 'ani experiență în dezvoltare', 'hero.metric3': 'instalări active',
'hero.cardLabel': 'Portofoliu software', 'hero.badge1': 'cabinete dentare', 'hero.badge2': 'gestiune si contabilitate', 'hero.badge3': 'salvare automata',
'products.eyebrow': 'Produse', 'products.title': 'Aplicatii software pentru activitati de zi cu zi', 'products.text': 'Portofoliul actual include aplicatii pentru cabinete stomatologice, operatiuni comerciale si protectia datelor.',
'products.easydent.title': 'Soft pentru cabinete stomatologice',
'products.easydent.desc': 'easyDent este un program destinat cabinetelor stomatologice si clinicilor dentare. Puteti urmari pacienti, plati, interventii, pacienti restantieri si profitul pe perioade de timp.',
'products.easydent.feature1': 'Planificarea pacientilor intr-o sectiune simplu de utilizat', 'products.easydent.feature2': 'Imagini dentare, istoric pe dinte si poze atasate pacientilor', 'products.easydent.feature3': 'Raport lunar CNAS si configurare pe specializari',
'products.easyerp.title': 'Soft de contabilitate si gestiunea stocurilor',
'products.easyerp.desc': 'easyERP este un program client-server, bazat pe SQL, compus din module pentru diferite divizii ale companiei: gestiune, contabilitate, facturare, livrari, comenzi si promotii.',
'products.easyerp.feature1': 'Receptie de marfa, inventar si cautare rapida in nomenclatoare', 'products.easyerp.feature2': 'Control pe roluri si drepturi de acces pe module', 'products.easyerp.feature3': 'Documente comerciale si rapoarte operationale',
'products.easybackup.title': 'Utilitar pentru salvarea fisierelor',
'products.easybackup.desc': 'easyBackup salveaza fisiere in directoare partajate sau pe servere FTP, cu job-uri recurente sau simple, monitorizare in timp si optiuni de compresie si notificare.',
'products.easybackup.feature1': 'Definire job-uri recurente sau simple', 'products.easybackup.feature2': 'Scanare directoare cu excluderi si filtre', 'products.easybackup.feature3': 'Compresie, parola si notificari prin e-mail',
'products.download': 'Descarca',
'services.eyebrow': 'Servicii', 'services.title': 'Servicii software si consultanta IT',
'services.db.title': 'Proiectare baze de date', 'services.db.text': 'Organizati mai bine informatiile si obtineti rapoartele de care aveti nevoie.',
'services.it.title': 'Consultanta IT', 'services.it.text': 'Analizam ofertele disponibile si alegem sistemul informatic potrivit pentru activitatea dumneavoastra.',
'services.dev.title': 'Dezvoltare software', 'services.dev.text': 'Construim aplicatii adaptate fluxului real de lucru, nu invers.',
'about.eyebrow': 'easySoft', 'about.title': 'Solutii software construite pentru lucru real',
'about.text1': 'Portofoliul easySoft acopera activitati esentiale pentru cabinete stomatologice, evidenta comerciala si protectia fisierelor importante.',
'about.text2': 'Aplicatiile sunt gandite pentru utilizare practica, implementare rapida si acces clar la informatiile care conteaza in activitatea zilnica.',
'about.point1Title': 'Implementare practica', 'about.point1Text': 'Produse software orientate spre utilizare zilnica.',
'about.point2Title': 'Fluxuri clare', 'about.point2Text': 'Planificare, evidenta, facturare, rapoarte si backup in functii usor de urmarit.',
'about.point3Title': 'Suport comercial direct', 'about.point3Text': 'Pentru prezentare, oferta sau implementare, puteti lua legatura direct cu easySoft.',
'contact.eyebrow': 'Contactati-ne', 'contact.title': 'Discutam despre nevoile tale software',
'contact.text': 'easySoft Romania dezvoltare applicatii. Pentru prezentari, detalii comerciale sau implementare, folositi datele de mai jos.',
'contact.personLabel': 'Persoana de contact', 'contact.addressLabel': 'Adresa', 'contact.phoneLabel': 'Telefon', 'contact.webLabel': 'Website',
'contact.form.name': 'Nume', 'contact.form.email': 'Email', 'contact.form.message': 'Mesaj', 'contact.form.send': 'Trimite mesaj',
'contact.form.yourname': 'Numele dumneavoastra', 'contact.form.youremail': 'nume@companie.ro', 'contact.form.yourmessage': 'Spuneti-ne ce produs sau serviciu va intereseaza.',
'contact.form.success': 'Va multumim pentru mesaj.', 'contact.form.submissionfailed': 'A aparut o eroare la transmiterea mesajului.', 'contact.form.verificationfailed': 'A aparut o eroare la verificare Captcha.',
'footer.backToTop': 'Inapoi sus',
'cookie.text': 'Folosim cookie-uri pentru a imbunatati experienta pe site, a analiza traficul si a personaliza continutul. Puteti accepta toate cookie-urile sau doar cele necesare.',
'cookie.privacy': 'Politica de confidentialitate',
'cookie.reject': 'Respinge',
'cookie.necessary': 'Doar necesare',
'cookie.accept': 'Accepta analitice',
'footer.rights': 'Toate drepturile rezervate'
},
en: {
'brand.tagline': 'Romania software development',
'nav.products': 'Products', 'nav.services': 'Services', 'nav.contact': 'Contact us',
'hero.eyebrow': 'easySoft software portfolio',
'hero.title': 'Software for dental offices, stock management and secure data backup.',
'hero.text': 'Practical applications built for real workflows: patient management, accounting and inventory, plus automated backup for critical files.',
'hero.ctaPrimary': 'View products', 'hero.ctaSecondary': 'Contact us',
'hero.metric1': 'software solutions', 'hero.metric2': 'years experience in software development', 'hero.metric3': 'active installations',
'hero.cardLabel': 'Software portfolio', 'hero.badge1': 'dental offices', 'hero.badge2': 'inventory and accounting', 'hero.badge3': 'automatic backup',
'products.eyebrow': 'Products', 'products.title': 'Software applications for daily operations', 'products.text': 'The current portfolio includes applications for dental offices, business operations and data protection.',
'products.easydent.title': 'Software for dental offices',
'products.easydent.desc': 'easyDent is built for dental offices and clinics. It helps track patients, payments, interventions, outstanding balances and profit over time.',
'products.easydent.feature1': 'Simple patient scheduling section', 'products.easydent.feature2': 'Dental images, tooth history and attached patient photos', 'products.easydent.feature3': 'Monthly reports and specialization-based setup',
'products.easyerp.title': 'Accounting and stock management software',
'products.easyerp.desc': 'easyERP is a client-server SQL-based application with modules for company divisions: inventory, accounting, invoicing, deliveries, orders and promotions.',
'products.easyerp.feature1': 'Receiving merchandise, inventory and fast search', 'products.easyerp.feature2': 'Role-based permissions for modules', 'products.easyerp.feature3': 'Commercial documents and operational reports',
'products.easybackup.title': 'File backup utility',
'products.easybackup.desc': 'easyBackup saves files to shared folders or FTP servers using recurring or one-time jobs, change tracking, compression and notifications.',
'products.easybackup.feature1': 'Recurring or one-time backup jobs', 'products.easybackup.feature2': 'Directory scanning with exclusions and filters', 'products.easybackup.feature3': 'Compression, password protection and email alerts',
'products.download': 'Download',
'services.eyebrow': 'Services', 'services.title': 'Software services and IT consulting',
'services.db.title': 'Database design', 'services.db.text': 'Organize information better and get the reports you actually need.',
'services.it.title': 'IT consulting', 'services.it.text': 'We review available systems and help choose the right software solution.',
'services.dev.title': 'Software development', 'services.dev.text': 'We build applications around the real workflow, not the other way around.',
'about.eyebrow': 'easySoft', 'about.title': 'Software solutions built for real work',
'about.text1': 'The easySoft portfolio covers essential workflows for dental offices, commercial operations and protection of important files.',
'about.text2': 'The applications are built for practical use, fast implementation and clear access to the information that matters every day.',
'about.point1Title': 'Practical implementation', 'about.point1Text': 'Software products focused on daily use.',
'about.point2Title': 'Clear workflows', 'about.point2Text': 'Scheduling, records, invoicing, reports and backup in functions that are easy to follow.',
'about.point3Title': 'Direct commercial support', 'about.point3Text': 'For presentation, pricing or implementation, you can contact easySoft directly.',
'contact.eyebrow': 'Contact us', 'contact.title': 'Lets discuss your software needs',
'contact.text': 'easySoft Romania software development. For product presentations, commercial details or implementation, use the contact details below.',
'contact.personLabel': 'Contact person', 'contact.addressLabel': 'Address', 'contact.phoneLabel': 'Phone', 'contact.webLabel': 'Website',
'contact.form.name': 'Name', 'contact.form.email': 'Email', 'contact.form.message': 'Message', 'contact.form.send': 'Send message',
'contact.form.yourname': 'Your name', 'contact.form.youremail': 'name@company.com', 'contact.form.yourmessage': 'Let us know how we can help you.',
'contact.form.success': 'Thank you for your message.', 'contact.form.submissionfailed': 'Failed to send the message.', 'contact.form.verificationfailed': 'Captcha verification failed.',
'footer.backToTop': 'Back to top',
'cookie.text': 'We use cookies to enhance your experience, analyze traffic and personalize content. You can accept all cookies or just the necessary ones.',
'cookie.privacy': 'Privacy policy',
'cookie.reject': 'Reject',
'cookie.necessary': 'Necessary only',
'cookie.accept': 'Accept analytics',
'footer.rights': 'All rights reserved'
}
};
function updateLegalLinks(lang) {
$('.legal-link').each(function () {
var $link = $(this);
if (lang === 'ro') {
$link.attr('href', $link.attr('data-ro-href'));
$link.text($link.attr('data-ro-text'));
} else {
$link.attr('href', $link.attr('data-en-href'));
$link.text($link.attr('data-en-text'));
}
});
}
function applyLanguage(lang) {
var dict = translations[lang] || translations.en;
$('[data-i18n]').each(function () {
var key = $(this).data('i18n');
if (!key) return;
// Handle special attributes like [placeholder]
var match = key.match(/^\[(.*?)\](.*)$/);
if (match) {
var attr = match[1]; // e.g. "placeholder"
var realKey = match[2]; // e.g. "contact.form.message"
if (dict[realKey]) {
$(this).attr(attr, dict[realKey]);
}
} else {
if (dict[key]) {
$(this).text(dict[key]);
}
}
});
updateLegalLinks(lang);
$('html').attr('lang', lang);
localStorage.setItem('easysoft-language', lang);
$('.lang-flag').each(function () {
var isActive = $(this).data('lang') === lang;
$(this).attr('aria-pressed', isActive ? 'true' : 'false');
$(this).toggleClass('is-active', isActive);
});
}
function detectLanguage() {
var saved = localStorage.getItem('easysoft-language');
if (saved && translations[saved]) {
return saved;
}
var browserLang = ((navigator.languages && navigator.languages[0]) || navigator.language || navigator.userLanguage || 'en').toLowerCase();
if (browserLang.indexOf('ro') === 0) {
return 'ro';
}
return 'en';
}
function closeMobileMenu() {
$('#mainNav').removeClass('is-open');
$('#menuToggle').attr('aria-expanded', 'false');
}
function initCarousels() {
$('[data-carousel]').each(function () {
var $carousel = $(this);
var $slides = $carousel.find('.carousel-slide');
var $dotsWrap = $carousel.find('.carousel-dots');
var index = 0;
var timer = null;
function renderDots() {
$dotsWrap.empty();
$slides.each(function (i) {
var $dot = $('<button>', {
type: 'button',
class: 'carousel-dot' + (i === index ? ' active' : ''),
'aria-label': 'Go to slide ' + (i + 1)
});
$dot.on('click', function () {
show(i);
restartAutoPlay();
});
$dotsWrap.append($dot);
});
}
function show(i) {
index = (i + $slides.length) % $slides.length;
$slides.removeClass('active').eq(index).addClass('active');
$dotsWrap.find('.carousel-dot').removeClass('active').eq(index).addClass('active');
}
function restartAutoPlay() {
if (timer) {
window.clearInterval(timer);
}
timer = window.setInterval(function () {
show(index + 1);
}, 5000);
}
$carousel.find('.prev').on('click', function () {
show(index - 1);
restartAutoPlay();
});
$carousel.find('.next').on('click', function () {
show(index + 1);
restartAutoPlay();
});
renderDots();
show(0);
restartAutoPlay();
});
}
(function ($) { (function ($) {
"use strict"; "use strict";
var reCaptchaSiteKey; // To be initialized from the backend API
var gTagManagerId; // Google Tag Manager ID from backend
var gMapKey; // To be initialized from the backend API
const CONSENT_KEY = "cookie_consent";
applyLanguage(detectLanguage()); var reCaptchaSiteKey = null;
var gTagManagerId = null;
var CONSENT_KEY = "myai_cookie_consent";
var LANG_KEY = "myai_lang";
$('.lang-flag').on('click', function () { var i18n = {
applyLanguage($(this).data('lang')); en: {
}); "brand.subtitle": "AI engineering showcase",
"nav.demos": "Demos",
"nav.contact": "Contact",
"nav.navigator": "Navigator",
"nav.matcher": "Matcher",
"home.eyebrow": "Applied AI lab",
"home.title": "Production-minded AI demos, not generic chatbot wrappers.",
"home.text": "MyAi.ro is a technical showcase for practical AI systems: document understanding, retrieval, matching, automation and decision support.",
"home.openCv": "Open CV Matcher",
"home.step1": "CV.pdf",
"home.step2": "skills, projects, experience",
"home.step3": "relevant CV context",
"home.step4": "job match + gaps",
"home.navigator": "Navigator",
"home.selectDemo": "Select an AI demo",
"home.selectText": "Our first steps in AI integrations.",
"tag.available": "Available",
"tag.next": "Next",
"demo.cv.title": "CV Matcher",
"demo.cv.text": "Upload a CV PDF, provide a job link or description, extract RAG context and generate a match score with strengths and gaps.",
"demo.open": "Open demo →",
"demo.rag.title": "RAG Playground",
"demo.rag.text": "Experiment with chunk size, retrieval count and source context transparency.",
"demo.agent.title": "Agent Automation",
"demo.agent.text": "Job discovery, filtering, ranking and notification workflows.",
"contact.title": "Discuss an AI integration or custom software project",
"contact.text": "Fill in the form fields and will contact you.",
"contact.person": "Contact person",
"contact.phone": "Phone",
"form.name": "Name",
"form.namePlaceholder": "Your name",
"form.email": "Email",
"form.emailPlaceholder": "name@company.com",
"form.message": "Message",
"form.messagePlaceholder": "Tell me what you want to build.",
"form.send": "Send message",
"form.thanks": "Thank you for your message.",
"form.captchaFailed": "Captcha verification failed.",
"form.failed": "Failed to send the message.",
"footer.rights": "All rights reserved",
"footer.top": "Back to top",
"legal.terms": "Terms",
"legal.privacy": "Privacy",
"legal.cookies": "Cookies",
"status.sending": "Sending...",
"cookies.title": "Cookies",
"cookies.text": "We use necessary cookies and, with your consent, analytics through Google Tag Manager.",
"cookies.policy": "Privacy policy",
"cookies.reject": "Reject",
"cookies.necessary": "Necessary only",
"cookies.accept": "Accept analytics",
"cookies.settings": "Cookie settings",
"cv.brand": "CV Matcher",
"cv.eyebrow": "AI CV Matcher",
"cv.title": "Upload your CV, add a job link, and see how well they match.",
"cv.text": "The backend should extract text from the PDF, create RAG context from your CV, retrieve relevant experience for the job, then score strengths, gaps and next actions.",
"cv.try": "Try matcher",
"cv.back": "Back to navigator",
"cv.step1": "PDF text extraction",
"cv.step2": "CV chunking + embeddings",
"cv.step3": "Job URL/description parsing",
"cv.step4": "Match score + evidence",
"cv.input": "Input",
"cv.details": "CV and job details",
"cv.upload": "Upload CV PDF",
"cv.fileHint": "PDF only, max size handled by backend",
"cv.jobLink": "Job link",
"cv.jobDescription": "Or paste job description",
"cv.jobPlaceholder": "Paste the job description if the page cannot be crawled.",
"cv.gdpr": "I agree that my CV is processed and stred.",
"cv.submit": "Extract CV and match job",
"cv.result": "Result",
"cv.analysis": "Match analysis",
"cv.empty": "Upload a CV and provide a job link or description to generate a result.",
"cv.contactTitle": "Want this adapted for your workflow?",
"cv.contactText": "This form uses the existing template contact API endpoint.",
"cv.noFile": "Please upload a CV PDF.",
"cv.noJob": "Add a job link or paste a job description.",
"cv.noConsent": "GDPR consent is required.",
"cv.processing": "Processing...",
"cv.extracting": "Extracting CV and matching job...",
"cv.processingLong": "Processing CV PDF and job input. Backend endpoints must be available.",
"cv.cvFailed": "CV extraction failed",
"cv.matchFailed": "Job matching failed",
"cv.completed": "Match completed.",
"cv.backendMissing": "The frontend is ready, but the backend endpoints /api/cv-matcher/upload and /api/cv-matcher/match-job must be implemented.",
"cv.noSummary": "No summary returned.",
"cv.noItems": "No items returned.",
"cv.strengths": "Strengths",
"cv.gaps": "Gaps",
"cv.evidence": "Retrieved CV evidence"
},
ro: {
"brand.subtitle": "prezentare inginerie AI",
"nav.demos": "Demo-uri",
"nav.contact": "Contact",
"nav.navigator": "Navigator",
"nav.matcher": "Matcher",
"home.eyebrow": "Laborator AI aplicat",
"home.title": "Demo-uri AI orientate spre producție, nu simple wrapper-e de chatbot.",
"home.text": "MyAi.ro este o prezentare tehnică pentru sisteme AI practice: înțelegere documente, retrieval, potrivire, automatizare și suport decizional.",
"home.openCv": "Deschide CV Matcher",
"home.step1": "CV.pdf",
"home.step2": "competențe, proiecte, experiență",
"home.step3": "context relevant din CV",
"home.step4": "potrivire job + lipsuri",
"home.navigator": "Navigator",
"home.selectDemo": "Alege un demo AI",
"home.selectText": "Primele noastre projecte",
"tag.available": "Disponibil",
"tag.next": "Urmează",
"demo.cv.title": "CV Matcher",
"demo.cv.text": "Încarcă un CV PDF, adaugă un link sau o descriere de job, extrage context RAG și generează un scor de potrivire cu puncte forte și lipsuri.",
"demo.open": "Deschide demo →",
"demo.rag.title": "RAG Playground",
"demo.rag.text": "Experimentează cu dimensiunea chunk-urilor, numărul de rezultate și transparența surselor.",
"demo.agent.title": "Automatizare cu agenți",
"demo.agent.text": "Fluxuri pentru descoperire joburi, filtrare, ranking și notificări.",
"contact.title": "Discută o integrare AI sau un proiect software custom",
"contact.text": "Complecteaza formularul si te vom contacta.",
"contact.person": "Persoană de contact",
"contact.phone": "Telefon",
"form.name": "Nume",
"form.namePlaceholder": "Numele tău",
"form.email": "Email",
"form.emailPlaceholder": "nume@companie.ro",
"form.message": "Mesaj",
"form.messagePlaceholder": "Spune-mi ce vrei să construiești.",
"form.send": "Trimite mesajul",
"form.thanks": "Mulțumesc pentru mesaj.",
"form.captchaFailed": "Verificarea Captcha a eșuat.",
"form.failed": "Mesajul nu a putut fi trimis.",
"footer.rights": "Toate drepturile rezervate",
"footer.top": "Înapoi sus",
"legal.terms": "Termeni",
"legal.privacy": "Confidențialitate",
"legal.cookies": "Cookies",
"status.sending": "Se trimite...",
"cookies.title": "Cookies",
"cookies.text": "Folosim cookies necesare și, cu acordul tău, analytics prin Google Tag Manager.",
"cookies.policy": "Politica de confidențialitate",
"cookies.reject": "Respinge",
"cookies.necessary": "Doar necesare",
"cookies.accept": "Accept analytics",
"cookies.settings": "Setări cookies",
"cv.brand": "CV Matcher",
"cv.eyebrow": "AI CV Matcher",
"cv.title": "Încarcă CV-ul, adaugă un link de job și vezi cât de bine se potrivesc.",
"cv.text": "Backend-ul ar trebui să extragă textul din PDF, să creeze context RAG din CV, să recupereze experiența relevantă pentru job, apoi să calculeze punctele forte, lipsurile și pașii următori.",
"cv.try": "Încearcă matcherul",
"cv.back": "Înapoi la navigator",
"cv.step1": "Extragere text PDF",
"cv.step2": "Chunking CV + embeddings",
"cv.step3": "Parsare URL/descriere job",
"cv.step4": "Scor potrivire + dovezi",
"cv.input": "Date de intrare",
"cv.details": "CV și detalii job",
"cv.upload": "Încarcă CV PDF",
"cv.fileHint": "Doar PDF, limita de mărime este gestionată de backend",
"cv.jobLink": "Link job",
"cv.jobDescription": "Sau lipește descrierea jobului",
"cv.jobPlaceholder": "Lipește descrierea jobului dacă pagina nu poate fi citită automat.",
"cv.gdpr": "Sunt de acord ca CV-ul meu să fie procesat si stocat.",
"cv.submit": "Extrage CV și compară jobul",
"cv.result": "Rezultat",
"cv.analysis": "Analiză potrivire",
"cv.empty": "Încarcă un CV și adaugă un link sau o descriere de job pentru a genera rezultatul.",
"cv.contactTitle": "Vrei să adaptezi asta pentru workflow-ul tău?",
"cv.contactText": "Formularul folosește endpoint-ul existent de contact din template.",
"cv.noFile": "Te rog încarcă un CV PDF.",
"cv.noJob": "Adaugă un link de job sau lipește descrierea jobului.",
"cv.noConsent": "Consimțământul GDPR este obligatoriu.",
"cv.processing": "Se procesează...",
"cv.extracting": "Se extrage CV-ul și se compară jobul...",
"cv.processingLong": "Se procesează PDF-ul și informațiile despre job. Endpoint-urile backend trebuie să fie disponibile.",
"cv.cvFailed": "Extragerea CV-ului a eșuat",
"cv.matchFailed": "Matching-ul jobului a eșuat",
"cv.completed": "Matching finalizat.",
"cv.backendMissing": "Frontend-ul este pregătit, dar endpoint-urile backend /api/cv-matcher/upload și /api/cv-matcher/match-job trebuie implementate.",
"cv.noSummary": "Nu a fost returnat niciun sumar.",
"cv.noItems": "Nu au fost returnate elemente.",
"cv.strengths": "Puncte forte",
"cv.gaps": "Lipsuri",
"cv.evidence": "Dovezi recuperate din CV"
}
};
$('#menuToggle').on('click', function () { function browserLang() {
var $nav = $('#mainNav'); return ((navigator.language || navigator.userLanguage || 'en').toLowerCase().indexOf('ro') === 0) ? 'ro' : 'en';
var open = !$nav.hasClass('is-open'); }
$nav.toggleClass('is-open', open);
$(this).attr('aria-expanded', open ? 'true' : 'false');
});
$('.nav a').on('click', function () { function currentLang() {
closeMobileMenu(); return localStorage.getItem(LANG_KEY) || browserLang();
}); }
$('#year').text(new Date().getFullYear()); function t(key) {
var lang = currentLang();
return (i18n[lang] && i18n[lang][key]) || i18n.en[key] || key;
}
/*-------------------------- function updateLegalLinks(lang) {
API health check $('[data-legal]').each(function () {
---------------------------- */ var page = $(this).data('legal');
// Checks the backend API live endpoint and updates #api-status if present. $(this).attr('href', '/legal/' + page + '-' + lang + '.html');
function checkApiLive() { });
var $statusEl = $('#api-status'); }
return $.ajax({
url: '/api/health/live',
method: 'GET',
dataType: 'json',
timeout: 5000
}).done(function (data) {
var status = (data && data.status) ? data.status : 'unknown';
if ($statusEl.length) {
$statusEl.text('API: ' + status).removeClass('text-danger').addClass('text-success');
} else {
console.log('API live status:', status);
}
}).fail(function (jqXHR, textStatus, errorThrown) {
if ($statusEl.length) {
$statusEl.text('API: offline').removeClass('text-success').addClass('text-danger');
}
console.error('API health check failed:', textStatus, errorThrown);
});
}
/*-------------------------- function applyLanguage(lang) {
reCaptcha localStorage.setItem(LANG_KEY, lang);
---------------------------- */ document.documentElement.lang = lang;
function getRecaptchaWebKey() { updateLegalLinks(lang);
return $.get("/api/contact", function (res) { $('[data-i18n]').each(function () {
reCaptchaSiteKey = res; $(this).text(t($(this).data('i18n')));
if (reCaptchaSiteKey) { });
var script = document.createElement('script'); $('[data-i18n-placeholder]').each(function () {
script.setAttribute('src', "https://www.google.com/recaptcha/api.js?render=" + reCaptchaSiteKey); $(this).attr('placeholder', t($(this).data('i18n-placeholder')));
document.head.appendChild(script); });
} $('.lang-flag').attr('aria-pressed', 'false');
}); $('.lang-flag[data-lang="' + lang + '"]').attr('aria-pressed', 'true');
} }
/*-------------------------- $('#year').text(new Date().getFullYear());
Google Tag Manager ID applyLanguage(currentLang());
---------------------------- */ $('.lang-flag').on('click', function () {
function getGoogleTagManagerId() { applyLanguage($(this).data('lang'));
return $.get("/api/google/tagmanager", function (res) { });
gTagManagerId = res;
});
}
/*-------------------------- $('#menuToggle').on('click', function () {
Google Maps Key var $nav = $('#mainNav');
---------------------------- */ var open = !$nav.hasClass('is-open');
function getGMapKey() { $nav.toggleClass('is-open', open);
return $.get("/api/google/maps", function (res) { $(this).attr('aria-expanded', open ? 'true' : 'false');
gMapKey = res; });
if (gMapKey) { $('.nav a').on('click', function () {
var script = document.createElement('script'); $('#mainNav').removeClass('is-open');
script.setAttribute('src', "https://maps.googleapis.com/maps/api/js?key=" + gMapKey); $('#menuToggle').attr('aria-expanded', 'false');
document.body.appendChild(script); });
var script = document.createElement('script');
script.setAttribute('src', "js/mapcode.js");
document.body.appendChild(script);
}
});
}
/*-------------------------- function checkApiLive() {
Load Google Tag Manager script with the retrieved ID var $statusEl = $('#api-status');
---------------------------- */ return $.ajax({
function loadGoogleTagManager() { url: '/api/health/live',
if (window.__gtm_loaded) return; method: 'GET',
dataType: 'json',
timeout: 5000
}).done(function (data) {
var status = (data && data.status) ? data.status : 'unknown';
if ($statusEl.length) {
$statusEl.text('API: ' + status).removeClass('text-danger').addClass('text-success');
} else {
console.log('API live status:', status);
}
}).fail(function (jqXHR, textStatus, errorThrown) {
if ($statusEl.length) {
$statusEl.text('API: offline').removeClass('text-success').addClass('text-danger');
}
console.error('API health check failed:', textStatus, errorThrown);
});
}
function getRecaptchaWebKey() {
return $.get('/api/contact').done(function (res) {
reCaptchaSiteKey = res;
if (reCaptchaSiteKey && !window.__recaptcha_loaded) {
window.__recaptcha_loaded = true;
var script = document.createElement('script');
script.setAttribute('src', 'https://www.google.com/recaptcha/api.js?render=' + reCaptchaSiteKey);
document.head.appendChild(script);
}
}).fail(function () {
console.warn('Could not load reCaptcha site key from /api/contact');
});
}
var script = document.createElement('script'); function getGoogleTagManagerId() {
script.async = true; return $.get('/api/google/tagmanager').done(function (res) {
script.src = "https://www.googletagmanager.com/gtm/js?id=" + gTagManagerId; gTagManagerId = res;
document.head.appendChild(script); }).fail(function () {
console.warn('Could not load Google Tag Manager id from /api/google/tagmanager');
});
}
// Initialize dataLayer function loadGoogleTagManager() {
window.dataLayer = window.dataLayer || []; if (window.__gtm_loaded || !gTagManagerId) return;
window.dataLayer.push({ window.__gtm_loaded = true;
'gtm.start': new Date().getTime(), window.dataLayer = window.dataLayer || [];
event: 'gtm.js' window.dataLayer.push({
}); 'gtm.start': new Date().getTime(),
} event: 'gtm.js'
});
var script = document.createElement('script');
script.async = true;
script.src = 'https://www.googletagmanager.com/gtm/js?id=' + gTagManagerId;
document.head.appendChild(script);
}
/*-------------------------- function getConsent() {
Load consent cookie data try {
---------------------------- */ return JSON.parse(localStorage.getItem(CONSENT_KEY));
function loadConsent() { } catch (e) {
var consent = getConsent(); return null;
}
}
if (!consent) { function setConsent(consent) {
showBanner(); localStorage.setItem(CONSENT_KEY, JSON.stringify(consent));
} else { }
applyConsent(consent);
showManage();
}
}
/*-------------------------- function applyConsent(consent) {
Preloader if (consent && consent.analytics === true) loadGoogleTagManager();
---------------------------- */ }
$(window).on('load', async function () {
var pre_loader = $('#preloader')
try {
await Promise.all([
checkApiLive(),
getRecaptchaWebKey(),
getGoogleTagManagerId(),
getGMapKey()
]).then(loadConsent);
} catch (e) { function showBanner() {
console.error("Startup API error", e); $('#cookieBanner').fadeIn(200);
} }
pre_loader.fadeOut('slow', function () {
$(this).remove();
});
});
/*-------------------------- function hideBanner() {
contact-from $('#cookieBanner').fadeOut(200);
---------------------------- */ }
$("#contactForm").on("submit", function (event) {
if (event.isDefaultPrevented()) {
// handle the invalid form...
formError();
submitMSG(false, "Did you fill in the form properly?");
} else {
// everything looks good!
event.preventDefault();
submitForm();
}
});
function submitForm() {
var loader = $('#contactLoader')
var button = $("#submit");
loader.css("display", "flex"); // show overlay function showManage() {
button.prop("disabled", true); $('#cookieManage').show();
$("#msgSubmit").text(""); }
grecaptcha.ready(function () { $('#cookieReject, #cookieNecessary').on('click', function () {
grecaptcha.execute(reCaptchaSiteKey, { action: 'contact' }) setConsent({
.then(function (token) { necessary: true,
// Initiate Variables With Form Content analytics: false,
var message = { ts: new Date().toISOString()
Name: $("#name").val(), });
Email: $("#email").val(), hideBanner();
Subject: '[Contact request]', showManage();
Message: $("#message").val(), });
CaptchaToken: token $('#cookieAccept').on('click', function () {
}; var consent = {
necessary: true,
analytics: true,
ts: new Date().toISOString()
};
setConsent(consent);
applyConsent(consent);
hideBanner();
showManage();
});
$('#cookieManage').on('click', function (e) {
e.preventDefault();
showBanner();
});
$.ajax({ function initConsent() {
type: "POST", var consent = getConsent();
url: "/api/contact", if (!consent) showBanner();
data: JSON.stringify(message), else {
contentType: "application/json; charset=utf-8", applyConsent(consent);
dataType: "json", showManage();
success: function (resp) { }
if (resp && resp.ok === true) { }
formSuccess()
} else {
var dict = translations[detectLanguage()] || translations.en;
submitMSG(false, dict['contact.form.verificationfailed']);
}
},
error: function () {
var dict = translations[detectLanguage()] || translations.en;
submitMSG(false, dict['contact.form.submissionfailed']);
}
}).always(function () {
loader.hide();
button.prop("disabled", false);
});
});
});
}
function formSuccess() { function submitMSG(valid, msg) {
$("#contactForm")[0].reset(); $('#msgSubmit').removeClass().addClass(valid ? 'form-message text-success' : 'form-message text-danger').text(msg);
var dict = translations[detectLanguage()] || translations.en; }
submitMSG(true, dict['contact.form.success'])
}
function formError() { function formSuccess() {
$("#contactForm").removeClass().addClass('shake animated').one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function () { $('#contactForm')[0].reset();
$(this).removeClass(); submitMSG(true, t('form.thanks'));
}); }
}
function submitMSG(valid, msg) { function formError() {
if (valid) { $('#contactForm').removeClass().addClass('contact-form shake').one('animationend', function () {
var msgClasses = "text-center tada animated text-success"; $(this).removeClass('shake');
} else { });
var msgClasses = "text-center text-danger"; }
}
$("#msgSubmit").removeClass().addClass(msgClasses).text(msg); $('#contactForm').on('submit', function (event) {
} event.preventDefault();
var loader = $('#contactLoader'),
button = $('#submit');
loader.css('display', 'flex');
button.prop('disabled', true);
$('#msgSubmit').text('');
function postContact(token) {
var message = {
Name: $('#name').val(),
Email: $('#email').val(),
Subject: '[MyAi.ro contact request]',
Message: $('#message').val(),
CaptchaToken: token || ''
};
$.ajax({
type: 'POST',
url: '/api/contact',
data: JSON.stringify(message),
contentType: 'application/json; charset=utf-8',
dataType: 'json'
}).done(function (resp) {
if (resp && resp.ok === true) formSuccess();
else submitMSG(false, t('form.captchaFailed'));
}).fail(function () {
submitMSG(false, t('form.failed'));
formError();
}).always(function () {
loader.hide();
button.prop('disabled', false);
});
}
if (window.grecaptcha && reCaptchaSiteKey) {
grecaptcha.ready(function () {
grecaptcha.execute(reCaptchaSiteKey, {
action: 'contact'
}).then(postContact);
});
} else {
postContact('');
}
});
$('#cvFile').on('change', function () {
var file = this.files && this.files[0];
$('#cvFileName').text(file ? file.name : t('cv.fileHint'));
});
$('#cvMatcherForm').on('submit', async function (event) {
event.preventDefault();
var file = $('#cvFile')[0] && $('#cvFile')[0].files[0];
var jobUrl = $('#jobUrl').val();
var jobDescription = $('#jobDescription').val();
var consent = $('#gdprConsent').is(':checked');
var $msg = $('#matcherMsg'),
$button = $('#matchSubmit'),
$result = $('#matchResult');
if (!file) {
$msg.removeClass().addClass('form-message text-danger').text(t('cv.noFile'));
return;
}
if (!jobUrl && !jobDescription) {
$msg.removeClass().addClass('form-message text-danger').text(t('cv.noJob'));
return;
}
if (!consent) {
$msg.removeClass().addClass('form-message text-danger').text(t('cv.noConsent'));
return;
}
$button.prop('disabled', true).text(t('cv.processing'));
$msg.removeClass().addClass('form-message').text(t('cv.extracting'));
$result.html('<div class="empty-result">' + escapeHtml(t('cv.processingLong')) + '</div>');
/*-------------------------- if (window.grecaptcha && reCaptchaSiteKey) {
cookie consent grecaptcha.ready(function () {
---------------------------- */ grecaptcha.execute(reCaptchaSiteKey, {
function getConsent() { action: 'contact'
try { }).then(postCv);
return JSON.parse(localStorage.getItem(CONSENT_KEY)); });
} catch { } else {
return null; postCv('');
} }
} function postCv(token) {
try {
var formData = new FormData();
formData.append('cv', file);
formData.append('gdprConsent', String(consent));
var cvResponse = await fetch('/api/cv-matcher/upload', {
method: 'POST',
body: formData
});
if (!cvResponse.ok) throw new Error(t('cv.cvFailed'));
var cvData = await cvResponse.json();
var matchResponse = await fetch('/api/cv-matcher/match-job', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
cvDocumentId: cvData.documentId || cvData.cvDocumentId,
jobUrl: jobUrl,
jobDescription: jobDescription,
gdprConsent: consent
})
});
if (!matchResponse.ok) throw new Error(t('cv.matchFailed'));
var match = await matchResponse.json();
renderMatchResult(match);
$msg.removeClass().addClass('form-message text-success').text(t('cv.completed'));
} catch (err) {
console.error(err);
$msg.removeClass().addClass('form-message text-danger').text(err.message || t('cv.matchFailed'));
$result.html('<div class="empty-result">' + escapeHtml(t('cv.backendMissing')) + '</div>');
} finally {
$button.prop('disabled', false).text(t('cv.submit'));
}
}
function setConsent(consent) { });
localStorage.setItem(CONSENT_KEY, JSON.stringify(consent));
}
function showBanner() { $("#cookieBanner").fadeIn(200); } function renderMatchResult(match) {
function hideBanner() { $("#cookieBanner").fadeOut(200); } var score = match.score || match.matchScore || 0;
function showManage() { $("#cookieManage").show(); } var summary = match.summary || t('cv.noSummary');
function applyConsent(consent) { var strengths = match.strengths || [];
if (consent && consent.analytics === true) { var gaps = match.gaps || match.missingSkills || [];
loadGoogleTagManager(); var evidence = match.evidence || match.retrievedChunks || [];
}
}
// Actions function list(items) {
$("#cookieReject, #cookieNecessary").on("click", function () { if (!items || !items.length) return '<p class="empty-result">' + escapeHtml(t('cv.noItems')) + '</p>';
setConsent({ necessary: true, analytics: false, ts: new Date().toISOString() }); return '<ul class="result-list">' + items.map(function (x) {
hideBanner(); var text = typeof x === 'string' ? x : (x.text || x.title || JSON.stringify(x));
showManage(); return '<li>' + escapeHtml(text) + '</li>';
location.reload(true); }).join('') + '</ul>';
}); }
$('#matchResult').html('<div class="score-badge">' + Number(score).toFixed(0) + '%</div><p>' + escapeHtml(summary) + '</p><h3>' + t('cv.strengths') + '</h3>' + list(strengths) + '<h3>' + t('cv.gaps') + '</h3>' + list(gaps) + '<h3>' + t('cv.evidence') + '</h3>' + list(evidence));
}
$("#cookieAccept").on("click", function () { function escapeHtml(value) {
setConsent({ necessary: true, analytics: true, ts: new Date().toISOString() }); return String(value).replace(/[&<>'"]/g, function (char) {
hideBanner(); return ({
showManage(); '&': '&amp;',
applyConsent(getConsent()); '<': '&lt;',
location.reload(true); '>': '&gt;',
}); "'": '&#39;',
'"': '&quot;'
$("#cookieManage").on("click", function (e) { })[char];
e.preventDefault(); });
showBanner(); }
}); $(window).on('load', function () {
$.when(checkApiLive(), getRecaptchaWebKey(), getGoogleTagManagerId()).always(initConsent);
initCarousels(); });
})(jQuery); })(jQuery);
-520
View File
@@ -1,520 +0,0 @@
(function ($) {
"use strict";
var reCaptchaSiteKey = null;
var gTagManagerId = null;
var CONSENT_KEY = "myai_cookie_consent";
var LANG_KEY = "myai_lang";
var i18n = {
en: {
"brand.subtitle": "AI engineering showcase",
"nav.demos": "Demos",
"nav.contact": "Contact",
"nav.navigator": "Navigator",
"nav.matcher": "Matcher",
"home.eyebrow": "Applied AI lab",
"home.title": "Production-minded AI demos, not generic chatbot wrappers.",
"home.text": "MyAi.ro is a technical showcase for practical AI systems: document understanding, retrieval, matching, automation and decision support.",
"home.openCv": "Open CV Matcher",
"home.step1": "CV.pdf",
"home.step2": "skills, projects, experience",
"home.step3": "relevant CV context",
"home.step4": "job match + gaps",
"home.navigator": "Navigator",
"home.selectDemo": "Select an AI demo",
"home.selectText": "Our first steps in AI integrations.",
"tag.available": "Available",
"tag.next": "Next",
"demo.cv.title": "CV Matcher",
"demo.cv.text": "Upload a CV PDF, provide a job link or description, extract RAG context and generate a match score with strengths and gaps.",
"demo.open": "Open demo →",
"demo.rag.title": "RAG Playground",
"demo.rag.text": "Experiment with chunk size, retrieval count and source context transparency.",
"demo.agent.title": "Agent Automation",
"demo.agent.text": "Job discovery, filtering, ranking and notification workflows.",
"contact.title": "Discuss an AI integration or custom software project",
"contact.text": "Fill in the form fields and will contact you.",
"contact.person": "Contact person",
"contact.phone": "Phone",
"form.name": "Name",
"form.namePlaceholder": "Your name",
"form.email": "Email",
"form.emailPlaceholder": "name@company.com",
"form.message": "Message",
"form.messagePlaceholder": "Tell me what you want to build.",
"form.send": "Send message",
"form.thanks": "Thank you for your message.",
"form.captchaFailed": "Captcha verification failed.",
"form.failed": "Failed to send the message.",
"footer.rights": "All rights reserved",
"footer.top": "Back to top",
"legal.terms": "Terms",
"legal.privacy": "Privacy",
"legal.cookies": "Cookies",
"status.sending": "Sending...",
"cookies.title": "Cookies",
"cookies.text": "We use necessary cookies and, with your consent, analytics through Google Tag Manager.",
"cookies.policy": "Privacy policy",
"cookies.reject": "Reject",
"cookies.necessary": "Necessary only",
"cookies.accept": "Accept analytics",
"cookies.settings": "Cookie settings",
"cv.brand": "CV Matcher",
"cv.eyebrow": "AI CV Matcher",
"cv.title": "Upload your CV, add a job link, and see how well they match.",
"cv.text": "The backend should extract text from the PDF, create RAG context from your CV, retrieve relevant experience for the job, then score strengths, gaps and next actions.",
"cv.try": "Try matcher",
"cv.back": "Back to navigator",
"cv.step1": "PDF text extraction",
"cv.step2": "CV chunking + embeddings",
"cv.step3": "Job URL/description parsing",
"cv.step4": "Match score + evidence",
"cv.input": "Input",
"cv.details": "CV and job details",
"cv.upload": "Upload CV PDF",
"cv.fileHint": "PDF only, max size handled by backend",
"cv.jobLink": "Job link",
"cv.jobDescription": "Or paste job description",
"cv.jobPlaceholder": "Paste the job description if the page cannot be crawled.",
"cv.gdpr": "I agree that my CV is processed and stred.",
"cv.submit": "Extract CV and match job",
"cv.result": "Result",
"cv.analysis": "Match analysis",
"cv.empty": "Upload a CV and provide a job link or description to generate a result.",
"cv.contactTitle": "Want this adapted for your workflow?",
"cv.contactText": "This form uses the existing template contact API endpoint.",
"cv.noFile": "Please upload a CV PDF.",
"cv.noJob": "Add a job link or paste a job description.",
"cv.noConsent": "GDPR consent is required.",
"cv.processing": "Processing...",
"cv.extracting": "Extracting CV and matching job...",
"cv.processingLong": "Processing CV PDF and job input. Backend endpoints must be available.",
"cv.cvFailed": "CV extraction failed",
"cv.matchFailed": "Job matching failed",
"cv.completed": "Match completed.",
"cv.backendMissing": "The frontend is ready, but the backend endpoints /api/rag/cv and /api/rag/match-job must be implemented.",
"cv.noSummary": "No summary returned.",
"cv.noItems": "No items returned.",
"cv.strengths": "Strengths",
"cv.gaps": "Gaps",
"cv.evidence": "Retrieved CV evidence"
},
ro: {
"brand.subtitle": "prezentare inginerie AI",
"nav.demos": "Demo-uri",
"nav.contact": "Contact",
"nav.navigator": "Navigator",
"nav.matcher": "Matcher",
"home.eyebrow": "Laborator AI aplicat",
"home.title": "Demo-uri AI orientate spre producție, nu simple wrapper-e de chatbot.",
"home.text": "MyAi.ro este o prezentare tehnică pentru sisteme AI practice: înțelegere documente, retrieval, potrivire, automatizare și suport decizional.",
"home.openCv": "Deschide CV Matcher",
"home.step1": "CV.pdf",
"home.step2": "competențe, proiecte, experiență",
"home.step3": "context relevant din CV",
"home.step4": "potrivire job + lipsuri",
"home.navigator": "Navigator",
"home.selectDemo": "Alege un demo AI",
"home.selectText": "Primele noastre projecte",
"tag.available": "Disponibil",
"tag.next": "Urmează",
"demo.cv.title": "CV Matcher",
"demo.cv.text": "Încarcă un CV PDF, adaugă un link sau o descriere de job, extrage context RAG și generează un scor de potrivire cu puncte forte și lipsuri.",
"demo.open": "Deschide demo →",
"demo.rag.title": "RAG Playground",
"demo.rag.text": "Experimentează cu dimensiunea chunk-urilor, numărul de rezultate și transparența surselor.",
"demo.agent.title": "Automatizare cu agenți",
"demo.agent.text": "Fluxuri pentru descoperire joburi, filtrare, ranking și notificări.",
"contact.title": "Discută o integrare AI sau un proiect software custom",
"contact.text": "Complecteaza formularul si te vom contacta.",
"contact.person": "Persoană de contact",
"contact.phone": "Telefon",
"form.name": "Nume",
"form.namePlaceholder": "Numele tău",
"form.email": "Email",
"form.emailPlaceholder": "nume@companie.ro",
"form.message": "Mesaj",
"form.messagePlaceholder": "Spune-mi ce vrei să construiești.",
"form.send": "Trimite mesajul",
"form.thanks": "Mulțumesc pentru mesaj.",
"form.captchaFailed": "Verificarea Captcha a eșuat.",
"form.failed": "Mesajul nu a putut fi trimis.",
"footer.rights": "Toate drepturile rezervate",
"footer.top": "Înapoi sus",
"legal.terms": "Termeni",
"legal.privacy": "Confidențialitate",
"legal.cookies": "Cookies",
"status.sending": "Se trimite...",
"cookies.title": "Cookies",
"cookies.text": "Folosim cookies necesare și, cu acordul tău, analytics prin Google Tag Manager.",
"cookies.policy": "Politica de confidențialitate",
"cookies.reject": "Respinge",
"cookies.necessary": "Doar necesare",
"cookies.accept": "Accept analytics",
"cookies.settings": "Setări cookies",
"cv.brand": "CV Matcher",
"cv.eyebrow": "AI CV Matcher",
"cv.title": "Încarcă CV-ul, adaugă un link de job și vezi cât de bine se potrivesc.",
"cv.text": "Backend-ul ar trebui să extragă textul din PDF, să creeze context RAG din CV, să recupereze experiența relevantă pentru job, apoi să calculeze punctele forte, lipsurile și pașii următori.",
"cv.try": "Încearcă matcherul",
"cv.back": "Înapoi la navigator",
"cv.step1": "Extragere text PDF",
"cv.step2": "Chunking CV + embeddings",
"cv.step3": "Parsare URL/descriere job",
"cv.step4": "Scor potrivire + dovezi",
"cv.input": "Date de intrare",
"cv.details": "CV și detalii job",
"cv.upload": "Încarcă CV PDF",
"cv.fileHint": "Doar PDF, limita de mărime este gestionată de backend",
"cv.jobLink": "Link job",
"cv.jobDescription": "Sau lipește descrierea jobului",
"cv.jobPlaceholder": "Lipește descrierea jobului dacă pagina nu poate fi citită automat.",
"cv.gdpr": "Sunt de acord ca CV-ul meu să fie procesat si stocat.",
"cv.submit": "Extrage CV și compară jobul",
"cv.result": "Rezultat",
"cv.analysis": "Analiză potrivire",
"cv.empty": "Încarcă un CV și adaugă un link sau o descriere de job pentru a genera rezultatul.",
"cv.contactTitle": "Vrei să adaptezi asta pentru workflow-ul tău?",
"cv.contactText": "Formularul folosește endpoint-ul existent de contact din template.",
"cv.noFile": "Te rog încarcă un CV PDF.",
"cv.noJob": "Adaugă un link de job sau lipește descrierea jobului.",
"cv.noConsent": "Consimțământul GDPR este obligatoriu.",
"cv.processing": "Se procesează...",
"cv.extracting": "Se extrage CV-ul și se compară jobul...",
"cv.processingLong": "Se procesează PDF-ul și informațiile despre job. Endpoint-urile backend trebuie să fie disponibile.",
"cv.cvFailed": "Extragerea CV-ului a eșuat",
"cv.matchFailed": "Matching-ul jobului a eșuat",
"cv.completed": "Matching finalizat.",
"cv.backendMissing": "Frontend-ul este pregătit, dar endpoint-urile backend /api/rag/cv și /api/rag/match-job trebuie implementate.",
"cv.noSummary": "Nu a fost returnat niciun sumar.",
"cv.noItems": "Nu au fost returnate elemente.",
"cv.strengths": "Puncte forte",
"cv.gaps": "Lipsuri",
"cv.evidence": "Dovezi recuperate din CV"
}
};
function browserLang() {
return ((navigator.language || navigator.userLanguage || 'en').toLowerCase().indexOf('ro') === 0) ? 'ro' : 'en';
}
function currentLang() {
return localStorage.getItem(LANG_KEY) || browserLang();
}
function t(key) {
var lang = currentLang();
return (i18n[lang] && i18n[lang][key]) || i18n.en[key] || key;
}
function updateLegalLinks(lang) {
$('[data-legal]').each(function () {
var page = $(this).data('legal');
$(this).attr('href', '/legal/' + page + '-' + lang + '.html');
});
}
function applyLanguage(lang) {
localStorage.setItem(LANG_KEY, lang);
document.documentElement.lang = lang;
updateLegalLinks(lang);
$('[data-i18n]').each(function () {
$(this).text(t($(this).data('i18n')));
});
$('[data-i18n-placeholder]').each(function () {
$(this).attr('placeholder', t($(this).data('i18n-placeholder')));
});
$('.lang-flag').attr('aria-pressed', 'false');
$('.lang-flag[data-lang="' + lang + '"]').attr('aria-pressed', 'true');
}
$('#year').text(new Date().getFullYear());
applyLanguage(currentLang());
$('.lang-flag').on('click', function () {
applyLanguage($(this).data('lang'));
});
$('#menuToggle').on('click', function () {
var $nav = $('#mainNav');
var open = !$nav.hasClass('is-open');
$nav.toggleClass('is-open', open);
$(this).attr('aria-expanded', open ? 'true' : 'false');
});
$('.nav a').on('click', function () {
$('#mainNav').removeClass('is-open');
$('#menuToggle').attr('aria-expanded', 'false');
});
function checkApiLive() {
var $statusEl = $('#api-status');
return $.ajax({
url: '/api/health/live',
method: 'GET',
dataType: 'json',
timeout: 5000
}).done(function (data) {
var status = (data && data.status) ? data.status : 'unknown';
if ($statusEl.length) {
$statusEl.text('API: ' + status).removeClass('text-danger').addClass('text-success');
} else {
console.log('API live status:', status);
}
}).fail(function (jqXHR, textStatus, errorThrown) {
if ($statusEl.length) {
$statusEl.text('API: offline').removeClass('text-success').addClass('text-danger');
}
console.error('API health check failed:', textStatus, errorThrown);
});
}
function getRecaptchaWebKey() {
return $.get('/api/contact').done(function (res) {
reCaptchaSiteKey = res;
if (reCaptchaSiteKey && !window.__recaptcha_loaded) {
window.__recaptcha_loaded = true;
var script = document.createElement('script');
script.setAttribute('src', 'https://www.google.com/recaptcha/api.js?render=' + reCaptchaSiteKey);
document.head.appendChild(script);
}
}).fail(function () {
console.warn('Could not load reCaptcha site key from /api/contact');
});
}
function getGoogleTagManagerId() {
return $.get('/api/google/tagmanager').done(function (res) {
gTagManagerId = res;
}).fail(function () {
console.warn('Could not load Google Tag Manager id from /api/google/tagmanager');
});
}
function loadGoogleTagManager() {
if (window.__gtm_loaded || !gTagManagerId) return;
window.__gtm_loaded = true;
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
'gtm.start': new Date().getTime(),
event: 'gtm.js'
});
var script = document.createElement('script');
script.async = true;
script.src = 'https://www.googletagmanager.com/gtm/js?id=' + gTagManagerId;
document.head.appendChild(script);
}
function getConsent() {
try {
return JSON.parse(localStorage.getItem(CONSENT_KEY));
} catch (e) {
return null;
}
}
function setConsent(consent) {
localStorage.setItem(CONSENT_KEY, JSON.stringify(consent));
}
function applyConsent(consent) {
if (consent && consent.analytics === true) loadGoogleTagManager();
}
function showBanner() {
$('#cookieBanner').fadeIn(200);
}
function hideBanner() {
$('#cookieBanner').fadeOut(200);
}
function showManage() {
$('#cookieManage').show();
}
$('#cookieReject, #cookieNecessary').on('click', function () {
setConsent({
necessary: true,
analytics: false,
ts: new Date().toISOString()
});
hideBanner();
showManage();
});
$('#cookieAccept').on('click', function () {
var consent = {
necessary: true,
analytics: true,
ts: new Date().toISOString()
};
setConsent(consent);
applyConsent(consent);
hideBanner();
showManage();
});
$('#cookieManage').on('click', function (e) {
e.preventDefault();
showBanner();
});
function initConsent() {
var consent = getConsent();
if (!consent) showBanner();
else {
applyConsent(consent);
showManage();
}
}
function submitMSG(valid, msg) {
$('#msgSubmit').removeClass().addClass(valid ? 'form-message text-success' : 'form-message text-danger').text(msg);
}
function formSuccess() {
$('#contactForm')[0].reset();
submitMSG(true, t('form.thanks'));
}
function formError() {
$('#contactForm').removeClass().addClass('contact-form shake').one('animationend', function () {
$(this).removeClass('shake');
});
}
$('#contactForm').on('submit', function (event) {
event.preventDefault();
var loader = $('#contactLoader'),
button = $('#submit');
loader.css('display', 'flex');
button.prop('disabled', true);
$('#msgSubmit').text('');
function postContact(token) {
var message = {
Name: $('#name').val(),
Email: $('#email').val(),
Subject: '[MyAi.ro contact request]',
Message: $('#message').val(),
CaptchaToken: token || ''
};
$.ajax({
type: 'POST',
url: '/api/contact',
data: JSON.stringify(message),
contentType: 'application/json; charset=utf-8',
dataType: 'json'
}).done(function (resp) {
if (resp && resp.ok === true) formSuccess();
else submitMSG(false, t('form.captchaFailed'));
}).fail(function () {
submitMSG(false, t('form.failed'));
formError();
}).always(function () {
loader.hide();
button.prop('disabled', false);
});
}
if (window.grecaptcha && reCaptchaSiteKey) {
grecaptcha.ready(function () {
grecaptcha.execute(reCaptchaSiteKey, {
action: 'contact'
}).then(postContact);
});
} else {
postContact('');
}
});
$('#cvFile').on('change', function () {
var file = this.files && this.files[0];
$('#cvFileName').text(file ? file.name : t('cv.fileHint'));
});
$('#cvMatcherForm').on('submit', async function (event) {
event.preventDefault();
var file = $('#cvFile')[0] && $('#cvFile')[0].files[0];
var jobUrl = $('#jobUrl').val();
var jobDescription = $('#jobDescription').val();
var consent = $('#gdprConsent').is(':checked');
var $msg = $('#matcherMsg'),
$button = $('#matchSubmit'),
$result = $('#matchResult');
if (!file) {
$msg.removeClass().addClass('form-message text-danger').text(t('cv.noFile'));
return;
}
if (!jobUrl && !jobDescription) {
$msg.removeClass().addClass('form-message text-danger').text(t('cv.noJob'));
return;
}
if (!consent) {
$msg.removeClass().addClass('form-message text-danger').text(t('cv.noConsent'));
return;
}
$button.prop('disabled', true).text(t('cv.processing'));
$msg.removeClass().addClass('form-message').text(t('cv.extracting'));
$result.html('<div class="empty-result">' + escapeHtml(t('cv.processingLong')) + '</div>');
try {
var formData = new FormData();
formData.append('cv', file);
formData.append('gdprConsent', String(consent));
var cvResponse = await fetch('/api/rag/cv', {
method: 'POST',
body: formData
});
if (!cvResponse.ok) throw new Error(t('cv.cvFailed'));
var cvData = await cvResponse.json();
var matchResponse = await fetch('/api/rag/match-job', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
cvDocumentId: cvData.documentId || cvData.cvDocumentId,
jobUrl: jobUrl,
jobDescription: jobDescription,
gdprConsent: consent
})
});
if (!matchResponse.ok) throw new Error(t('cv.matchFailed'));
var match = await matchResponse.json();
renderMatchResult(match);
$msg.removeClass().addClass('form-message text-success').text(t('cv.completed'));
} catch (err) {
console.error(err);
$msg.removeClass().addClass('form-message text-danger').text(err.message || t('cv.matchFailed'));
$result.html('<div class="empty-result">' + escapeHtml(t('cv.backendMissing')) + '</div>');
} finally {
$button.prop('disabled', false).text(t('cv.submit'));
}
});
function renderMatchResult(match) {
var score = match.score || match.matchScore || 0;
var summary = match.summary || t('cv.noSummary');
var strengths = match.strengths || [];
var gaps = match.gaps || match.missingSkills || [];
var evidence = match.evidence || match.retrievedChunks || [];
function list(items) {
if (!items || !items.length) return '<p class="empty-result">' + escapeHtml(t('cv.noItems')) + '</p>';
return '<ul class="result-list">' + items.map(function (x) {
var text = typeof x === 'string' ? x : (x.text || x.title || JSON.stringify(x));
return '<li>' + escapeHtml(text) + '</li>';
}).join('') + '</ul>';
}
$('#matchResult').html('<div class="score-badge">' + Number(score).toFixed(0) + '%</div><p>' + escapeHtml(summary) + '</p><h3>' + t('cv.strengths') + '</h3>' + list(strengths) + '<h3>' + t('cv.gaps') + '</h3>' + list(gaps) + '<h3>' + t('cv.evidence') + '</h3>' + list(evidence));
}
function escapeHtml(value) {
return String(value).replace(/[&<>'"]/g, function (char) {
return ({
'&': '&amp;',
'<': '&lt;',
'>': '&gt;',
"'": '&#39;',
'"': '&quot;'
})[char];
});
}
$(window).on('load', function () {
$.when(checkApiLive(), getRecaptchaWebKey(), getGoogleTagManagerId()).always(initConsent);
});
})(jQuery);