aiex-cli 0.1.1-beta.4 → 0.1.1-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +9 -30
- package/dist/default-prompts.json +4 -0
- package/dist/{generate-drizzle-schema-BZ2FvHyR.mjs → generate-drizzle-schema-DAeXmyrZ.mjs} +50 -31
- package/dist/index.mjs +1 -1
- package/dist/web/assets/{AISettings-CRumcTjo.js → AISettings-DI8JKzb4.js} +23 -23
- package/dist/web/assets/JsonSchemaEditor-JYjm5q34.js +570 -0
- package/dist/web/assets/index-C2XZlABi.css +2 -0
- package/dist/web/assets/{index-CaO28Qd9.js → index-CuCVFoOf.js} +38 -38
- package/dist/web/assets/{object-utils-DsuRi0p9.js → schemaNaming-COq_SZOU.js} +1 -1
- package/dist/web/index.html +3 -3
- package/dist/{zh-CN-BAGJklRp.mjs → zh-CN-CJiDMnGe.mjs} +0 -13
- package/package.json +1 -1
- package/dist/web/assets/JsonSchemaEditor-3RNZpMrN.js +0 -570
- package/dist/web/assets/index-BPjoJ1T3.css +0 -2
package/dist/cli.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as
|
|
1
|
+
import { A as seedConfig, C as CORRECTION_SYSTEM_PROMPT, D as PLACEHOLDER_TEXT, E as PLACEHOLDER_SCHEMA, M as name, N as package_default, O as buildCorrectionUserPrompt, P as version, S as DEFAULT_MINERU_CONFIG, T as EVIDENCE_INSTRUCTIONS, _ as doctorDiagnosticsSeverityRows, a as recognizeImageText, b as DEFAULT_LITEPARSE_CONFIG, c as t, d as writeAIConfig, f as AIConfigSchema, h as toSnakeCase, j as description, k as createConfig, l as getDefaultAIConfig, m as parseJsonSchema, n as collectDoctorDiagnostics, o as shouldUseImageOcrFallback, p as JsonSchemaDefinitionSchema, r as createMigrationConfig, s as initI18n, t as generateDrizzleSchema, u as readAIConfig, v as doctorDiagnosticsTableRows, w as DEFAULT_PROMPT_CONFIG, x as DEFAULT_MINERU_API_CONFIG, y as formatDoctorDiagnosticsJson } from "./generate-drizzle-schema-DAeXmyrZ.mjs";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import fs from "node:fs/promises";
|
|
4
4
|
import os from "node:os";
|
|
@@ -1513,12 +1513,6 @@ function validateExtractedData(schema, data) {
|
|
|
1513
1513
|
|
|
1514
1514
|
//#endregion
|
|
1515
1515
|
//#region src/domain/extraction/evidence-schema.ts
|
|
1516
|
-
const EVIDENCE_INSTRUCTIONS = `Evidence requirements:
|
|
1517
|
-
- Also return a top-level "_evidence" object.
|
|
1518
|
-
- For each top-level scalar field you extracted from the text, include "_evidence.<field>.quote".
|
|
1519
|
-
- The quote must be an exact contiguous substring copied from the input text.
|
|
1520
|
-
- Do not invent offsets. Only provide quotes.
|
|
1521
|
-
- If no exact quote supports a field, omit that field from "_evidence".`;
|
|
1522
1516
|
function isRecord$1(value) {
|
|
1523
1517
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1524
1518
|
}
|
|
@@ -1863,29 +1857,14 @@ async function extractStructuredData(input) {
|
|
|
1863
1857
|
lastError = errorMsg;
|
|
1864
1858
|
if (attempt < maxAttempts) {
|
|
1865
1859
|
const invalidJson = data !== void 0 ? JSON.stringify(canLocateEvidence ? stripEvidence(data).data : data, null, 2) : result ? result.text : "";
|
|
1866
|
-
systemPrompt =
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
[Original Text]
|
|
1875
|
-
${text$1 || "Data is contained in the attached file."}
|
|
1876
|
-
|
|
1877
|
-
[JSON Schema Definition]
|
|
1878
|
-
${JSON.stringify(schemaToExtractionOutputSchema(schema), null, 2)}
|
|
1879
|
-
|
|
1880
|
-
[Previously Generated Invalid JSON]
|
|
1881
|
-
${invalidJson}
|
|
1882
|
-
|
|
1883
|
-
[Validation Error Details]
|
|
1884
|
-
${errorMsg}
|
|
1885
|
-
|
|
1886
|
-
${canLocateEvidence ? EVIDENCE_INSTRUCTIONS : ""}
|
|
1887
|
-
|
|
1888
|
-
Please output the corrected JSON object now:`;
|
|
1860
|
+
systemPrompt = CORRECTION_SYSTEM_PROMPT;
|
|
1861
|
+
userPrompt = buildCorrectionUserPrompt({
|
|
1862
|
+
text: text$1,
|
|
1863
|
+
schema: schemaToExtractionOutputSchema(schema),
|
|
1864
|
+
invalidJson,
|
|
1865
|
+
error: errorMsg,
|
|
1866
|
+
includeEvidenceInstructions: canLocateEvidence
|
|
1867
|
+
});
|
|
1889
1868
|
}
|
|
1890
1869
|
}
|
|
1891
1870
|
return {
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
{
|
|
2
|
+
"systemTemplate": "You are a professional data extraction assistant. Your task is to extract structured data from text and return a JSON object based on the data structure definition provided below.\n\n{schema}\n\nExtraction requirements:\n1. Extract strictly according to the field names and types defined in the structure\n2. If the text lacks information for a field, set that field to null\n3. Do not add fields that do not exist in the structure definition\n4. Maintain data accuracy and completeness",
|
|
3
|
+
"userTemplate": "Please extract data from the following text:\n{text}"
|
|
4
|
+
}
|
|
@@ -11,7 +11,7 @@ import { z } from "zod";
|
|
|
11
11
|
|
|
12
12
|
//#region package.json
|
|
13
13
|
var name = "aiex-cli";
|
|
14
|
-
var version = "0.1.1-beta.
|
|
14
|
+
var version = "0.1.1-beta.6";
|
|
15
15
|
var description = "JSON Schema → SQLite with AI-powered data extraction";
|
|
16
16
|
var package_default = {
|
|
17
17
|
name,
|
|
@@ -147,6 +147,53 @@ function seedConfig(config = createConfig()) {
|
|
|
147
147
|
if (!config.has("version")) config.set("version", version);
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
+
//#endregion
|
|
151
|
+
//#region assets/default-prompts.json
|
|
152
|
+
var systemTemplate = "You are a professional data extraction assistant. Your task is to extract structured data from text and return a JSON object based on the data structure definition provided below.\n\n{schema}\n\nExtraction requirements:\n1. Extract strictly according to the field names and types defined in the structure\n2. If the text lacks information for a field, set that field to null\n3. Do not add fields that do not exist in the structure definition\n4. Maintain data accuracy and completeness";
|
|
153
|
+
var userTemplate = "Please extract data from the following text:\n{text}";
|
|
154
|
+
|
|
155
|
+
//#endregion
|
|
156
|
+
//#region src/domain/ai/prompts.ts
|
|
157
|
+
const PLACEHOLDER_SCHEMA = "{schema}";
|
|
158
|
+
const PLACEHOLDER_TEXT = "{text}";
|
|
159
|
+
const DEFAULT_EXTRACTION_SYSTEM_TEMPLATE = systemTemplate;
|
|
160
|
+
const DEFAULT_EXTRACTION_USER_TEMPLATE = userTemplate;
|
|
161
|
+
const DEFAULT_PROMPT_CONFIG = {
|
|
162
|
+
systemTemplate: DEFAULT_EXTRACTION_SYSTEM_TEMPLATE,
|
|
163
|
+
userTemplate: DEFAULT_EXTRACTION_USER_TEMPLATE
|
|
164
|
+
};
|
|
165
|
+
const EVIDENCE_INSTRUCTIONS = `Evidence requirements:
|
|
166
|
+
- Also return a top-level "_evidence" object.
|
|
167
|
+
- For each top-level scalar field you extracted from the text, include "_evidence.<field>.quote".
|
|
168
|
+
- The quote must be an exact contiguous substring copied from the input text.
|
|
169
|
+
- Do not invent offsets. Only provide quotes.
|
|
170
|
+
- If no exact quote supports a field, omit that field from "_evidence".`;
|
|
171
|
+
const CORRECTION_SYSTEM_PROMPT = `You are a precise data correction assistant. Your task is to correct validation errors in a previously generated JSON object to make it comply with the provided JSON Schema.
|
|
172
|
+
|
|
173
|
+
CRITICAL RULES:
|
|
174
|
+
1. Only correct the fields that failed validation.
|
|
175
|
+
2. Preserve all other correctly extracted fields and their values exactly.
|
|
176
|
+
3. Return ONLY the corrected JSON object. No explanations, no markdown blocks other than JSON.`;
|
|
177
|
+
function buildCorrectionUserPrompt(input) {
|
|
178
|
+
return `The JSON data you generated previously failed validation. Please correct it.
|
|
179
|
+
|
|
180
|
+
[Original Text]
|
|
181
|
+
${input.text || "Data is contained in the attached file."}
|
|
182
|
+
|
|
183
|
+
[JSON Schema Definition]
|
|
184
|
+
${JSON.stringify(input.schema, null, 2)}
|
|
185
|
+
|
|
186
|
+
[Previously Generated Invalid JSON]
|
|
187
|
+
${input.invalidJson}
|
|
188
|
+
|
|
189
|
+
[Validation Error Details]
|
|
190
|
+
${input.error}
|
|
191
|
+
|
|
192
|
+
${input.includeEvidenceInstructions ? EVIDENCE_INSTRUCTIONS : ""}
|
|
193
|
+
|
|
194
|
+
Please output the corrected JSON object now:`;
|
|
195
|
+
}
|
|
196
|
+
|
|
150
197
|
//#endregion
|
|
151
198
|
//#region src/domain/ai/types.ts
|
|
152
199
|
const PDF_CONVERTER_KINDS = [
|
|
@@ -156,8 +203,6 @@ const PDF_CONVERTER_KINDS = [
|
|
|
156
203
|
"mineru_api",
|
|
157
204
|
"external"
|
|
158
205
|
];
|
|
159
|
-
const PLACEHOLDER_SCHEMA = "{schema}";
|
|
160
|
-
const PLACEHOLDER_TEXT = "{text}";
|
|
161
206
|
const DEFAULT_MODELS = [{
|
|
162
207
|
name: "qwen-plus",
|
|
163
208
|
capabilities: {
|
|
@@ -177,19 +222,6 @@ const DEFAULT_PROVIDER_CONFIG = {
|
|
|
177
222
|
models: [...DEFAULT_MODELS],
|
|
178
223
|
timeout: 300
|
|
179
224
|
};
|
|
180
|
-
const DEFAULT_PROMPT_CONFIG = {
|
|
181
|
-
systemTemplate: `You are a professional data extraction assistant. Your task is to extract structured data from text and return a JSON object based on the data structure definition provided below.
|
|
182
|
-
|
|
183
|
-
{schema}
|
|
184
|
-
|
|
185
|
-
Extraction requirements:
|
|
186
|
-
1. Extract strictly according to the field names and types defined in the structure
|
|
187
|
-
2. If the text lacks information for a field, set that field to null
|
|
188
|
-
3. Do not add fields that do not exist in the structure definition
|
|
189
|
-
4. Maintain data accuracy and completeness`,
|
|
190
|
-
userTemplate: `Please extract data from the following text:
|
|
191
|
-
{text}`
|
|
192
|
-
};
|
|
193
225
|
const DEFAULT_EXTRACTION_CONFIG = { outputDir: ".aiex/extracted" };
|
|
194
226
|
const DEFAULT_MINERU_CONFIG = {
|
|
195
227
|
command: "mineru",
|
|
@@ -1288,19 +1320,6 @@ const en = {
|
|
|
1288
1320
|
},
|
|
1289
1321
|
ocrFallbackOptions: { localAuto: "Vision model or local OCR" }
|
|
1290
1322
|
},
|
|
1291
|
-
prompt: {
|
|
1292
|
-
defaultSystem: `You are a professional data extraction assistant. Your task is to extract structured data from text and return a JSON object based on the data structure definition provided below.
|
|
1293
|
-
|
|
1294
|
-
{schema}
|
|
1295
|
-
|
|
1296
|
-
Extraction requirements:
|
|
1297
|
-
1. Extract data strictly according to the field names and types defined in the structure
|
|
1298
|
-
2. If a field's information is missing from the text, set that field to null
|
|
1299
|
-
3. Do not add fields that are not in the structure definition
|
|
1300
|
-
4. Maintain data accuracy and completeness`,
|
|
1301
|
-
defaultUser: `Please extract data from the following text:
|
|
1302
|
-
{text}`
|
|
1303
|
-
},
|
|
1304
1323
|
fields: {
|
|
1305
1324
|
config: "Fields Config",
|
|
1306
1325
|
fewShotExamples: "Few-Shot Examples",
|
|
@@ -1357,7 +1376,7 @@ async function initI18n(lng) {
|
|
|
1357
1376
|
fallbackLng: "en",
|
|
1358
1377
|
resources: {
|
|
1359
1378
|
"en": { translation: en },
|
|
1360
|
-
"zh-CN": { translation: await import("./zh-CN-
|
|
1379
|
+
"zh-CN": { translation: await import("./zh-CN-CJiDMnGe.mjs").then((m) => m.zhCN) }
|
|
1361
1380
|
},
|
|
1362
1381
|
interpolation: { escapeValue: false },
|
|
1363
1382
|
returnNull: false
|
|
@@ -1788,4 +1807,4 @@ function generateDrizzleSchema(result) {
|
|
|
1788
1807
|
}
|
|
1789
1808
|
|
|
1790
1809
|
//#endregion
|
|
1791
|
-
export {
|
|
1810
|
+
export { seedConfig as A, CORRECTION_SYSTEM_PROMPT as C, PLACEHOLDER_TEXT as D, PLACEHOLDER_SCHEMA as E, name as M, package_default as N, buildCorrectionUserPrompt as O, version as P, DEFAULT_MINERU_CONFIG as S, EVIDENCE_INSTRUCTIONS as T, doctorDiagnosticsSeverityRows as _, recognizeImageText as a, DEFAULT_LITEPARSE_CONFIG as b, t as c, writeAIConfig as d, AIConfigSchema as f, buildDoctorDiagnostics as g, toSnakeCase as h, generateDrizzleConfig as i, description as j, createConfig as k, getDefaultAIConfig as l, parseJsonSchema as m, collectDoctorDiagnostics as n, shouldUseImageOcrFallback as o, JsonSchemaDefinitionSchema as p, createMigrationConfig as r, initI18n as s, generateDrizzleSchema as t, readAIConfig as u, doctorDiagnosticsTableRows as v, DEFAULT_PROMPT_CONFIG as w, DEFAULT_MINERU_API_CONFIG as x, formatDoctorDiagnosticsJson as y };
|
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { _ as doctorDiagnosticsSeverityRows, g as buildDoctorDiagnostics, i as generateDrizzleConfig, m as parseJsonSchema, n as collectDoctorDiagnostics, p as JsonSchemaDefinitionSchema, r as createMigrationConfig, t as generateDrizzleSchema, v as doctorDiagnosticsTableRows, y as formatDoctorDiagnosticsJson } from "./generate-drizzle-schema-
|
|
1
|
+
import { _ as doctorDiagnosticsSeverityRows, g as buildDoctorDiagnostics, i as generateDrizzleConfig, m as parseJsonSchema, n as collectDoctorDiagnostics, p as JsonSchemaDefinitionSchema, r as createMigrationConfig, t as generateDrizzleSchema, v as doctorDiagnosticsTableRows, y as formatDoctorDiagnosticsJson } from "./generate-drizzle-schema-DAeXmyrZ.mjs";
|
|
2
2
|
|
|
3
3
|
export { JsonSchemaDefinitionSchema, buildDoctorDiagnostics, collectDoctorDiagnostics, createMigrationConfig, doctorDiagnosticsSeverityRows, doctorDiagnosticsTableRows, formatDoctorDiagnosticsJson, generateDrizzleConfig, generateDrizzleSchema, parseJsonSchema };
|
|
@@ -1,5 +1,14 @@
|
|
|
1
|
-
import{A as e,At as t,C as n,D as r,Gt as i,H as a,I as o,J as s,K as c,L as l,O as u,S as d,T as f,W as p,X as m,_ as h,d as g,et as _,fn as v,gt as y,hn as b,ht as x,kt as S,lt as C,n as ee,o as w,on as T,q as E,r as D,rn as O,rt as k,tt as A,u as j,vt as te,w as M,x as N,y as P,yt as F,zt as I}from"./vue-i18n-Du42D0vb.js";import{i as L,n as R,r as z,s as B,t as ne}from"./dialog-CnZ7jH1l.js";import{g as re,i as ie,l as ae,m as V,n as oe,s as
|
|
2
|
-
|
|
1
|
+
import{A as e,At as t,C as n,D as r,Gt as i,H as a,I as o,J as s,K as c,L as l,O as u,S as d,T as f,W as p,X as m,_ as h,d as g,et as _,fn as v,gt as y,hn as b,ht as x,kt as S,lt as C,n as ee,o as w,on as T,q as E,r as D,rn as O,rt as k,tt as A,u as j,vt as te,w as M,x as N,y as P,yt as F,zt as I}from"./vue-i18n-Du42D0vb.js";import{i as L,n as R,r as z,s as B,t as ne}from"./dialog-CnZ7jH1l.js";import{g as re,i as ie,l as ae,m as V,n as oe,s as se,y as H}from"./api-client-CpqFbcyH.js";import{a as U,i as W,n as G,r as K,s as q,t as J}from"./textarea-DMpqBhjw.js";var ce={systemTemplate:`You are a professional data extraction assistant. Your task is to extract structured data from text and return a JSON object based on the data structure definition provided below.
|
|
2
|
+
|
|
3
|
+
{schema}
|
|
4
|
+
|
|
5
|
+
Extraction requirements:
|
|
6
|
+
1. Extract strictly according to the field names and types defined in the structure
|
|
7
|
+
2. If the text lacks information for a field, set that field to null
|
|
8
|
+
3. Do not add fields that do not exist in the structure definition
|
|
9
|
+
4. Maintain data accuracy and completeness`,userTemplate:`Please extract data from the following text:
|
|
10
|
+
{text}`},Y={class:`grid h-full min-h-0 min-w-0 grid-cols-[280px_minmax(0,1fr)] bg-background`},le={class:`flex min-h-0 flex-col border-r border-border bg-card`},ue={class:`min-h-0 flex-1 overflow-y-auto p-2`},de=[`onClick`],fe={class:`flex min-h-0 flex-col bg-background`},pe={class:`mx-auto flex max-w-5xl flex-col gap-8`},me=e({__name:`AnchorLayout`,props:o({anchors:{},bottomSpacer:{default:192}},{activeKey:{default:``},activeKeyModifiers:{}}),emits:[`update:activeKey`],setup(e){let t=e,n=_(e,`activeKey`),r=C(null);function i(e){let t=r.value;return t?Array.from(t.querySelectorAll(`[data-anchor-section]`)).find(t=>t.dataset.anchorSection===e)??null:null}function a(e){n.value=e;let t=r.value,a=i(e);if(!t||!a)return;let o=t.getBoundingClientRect(),s=a.getBoundingClientRect();t.scrollTo({top:Math.max(0,s.top-o.top+t.scrollTop-16),behavior:`smooth`})}function o(){let e=r.value;if(!e||t.anchors.length===0)return;if(e.scrollTop+e.clientHeight>=e.scrollHeight-2){n.value=t.anchors[t.anchors.length-1]?.key??``;return}let a=e.scrollTop+80,o=t.anchors[0]?.key??``,s=e.getBoundingClientRect().top;for(let n of t.anchors){let t=i(n.key);t&&t.getBoundingClientRect().top-s+e.scrollTop<=a&&(o=n.key)}n.value=o}return(t,i)=>(p(),f(`div`,Y,[d(`section`,le,[E(t.$slots,`sidebar-header`),d(`nav`,ue,[(p(!0),f(P,null,c(e.anchors,e=>(p(),f(`button`,{key:e.key,class:y([`mb-1 flex w-full items-center gap-2 rounded-md px-3 py-2 text-left text-sm transition-colors last:mb-0`,n.value===e.key?`bg-primary text-primary-foreground`:`text-foreground hover:bg-secondary`]),onClick:t=>a(e.key)},[e.icon?(p(),f(`i`,{key:0,class:y([`text-xs`,e.icon])},null,2)):M(``,!0),d(`span`,null,F(e.label),1)],10,de))),128))])]),d(`section`,fe,[E(t.$slots,`header`),d(`div`,{ref_key:`contentRef`,ref:r,class:`min-h-0 flex-1 overflow-auto p-4`,onScroll:o},[d(`div`,pe,[E(t.$slots,`default`),d(`div`,{class:`shrink-0`,style:te({height:`${e.bottomSpacer}px`}),"aria-hidden":`true`},null,4)])],544)])]))}}),X={name:`MinusIcon`,extends:w};function Z(e){return ve(e)||_e(e)||ge(e)||he()}function he(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
11
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ge(e,t){if(e){if(typeof e==`string`)return ye(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ye(e,t):void 0}}function _e(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function ve(e){if(Array.isArray(e))return ye(e)}function ye(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function be(e,t,n,r,i,a){return p(),f(`svg`,l({width:`14`,height:`14`,viewBox:`0 0 14 14`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},e.pti()),Z(t[0]||=[d(`path`,{d:`M13.2222 7.77778H0.777778C0.571498 7.77778 0.373667 7.69584 0.227806 7.54998C0.0819442 7.40412 0 7.20629 0 7.00001C0 6.79373 0.0819442 6.5959 0.227806 6.45003C0.373667 6.30417 0.571498 6.22223 0.777778 6.22223H13.2222C13.4285 6.22223 13.6263 6.30417 13.7722 6.45003C13.9181 6.5959 14 6.79373 14 7.00001C14 7.20629 13.9181 7.40412 13.7722 7.54998C13.6263 7.69584 13.4285 7.77778 13.2222 7.77778Z`,fill:`currentColor`},null,-1)]),16)}X.render=be;var xe=j.extend({name:`checkbox`,style:`
|
|
3
12
|
.p-checkbox {
|
|
4
13
|
position: relative;
|
|
5
14
|
display: inline-flex;
|
|
@@ -138,10 +147,10 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
138
147
|
width: dt('checkbox.icon.lg.size');
|
|
139
148
|
height: dt('checkbox.icon.lg.size');
|
|
140
149
|
}
|
|
141
|
-
`,classes:{root:function(e){var t=e.instance,n=e.props;return[`p-checkbox p-component`,{"p-checkbox-checked":t.checked,"p-disabled":n.disabled,"p-invalid":t.$pcCheckboxGroup?t.$pcCheckboxGroup.$invalid:t.$invalid,"p-variant-filled":t.$variant===`filled`,"p-checkbox-sm p-inputfield-sm":n.size===`small`,"p-checkbox-lg p-inputfield-lg":n.size===`large`}]},box:`p-checkbox-box`,input:`p-checkbox-input`,icon:`p-checkbox-icon`}}),
|
|
142
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
143
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
144
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
150
|
+
`,classes:{root:function(e){var t=e.instance,n=e.props;return[`p-checkbox p-component`,{"p-checkbox-checked":t.checked,"p-disabled":n.disabled,"p-invalid":t.$pcCheckboxGroup?t.$pcCheckboxGroup.$invalid:t.$invalid,"p-variant-filled":t.$variant===`filled`,"p-checkbox-sm p-inputfield-sm":n.size===`small`,"p-checkbox-lg p-inputfield-lg":n.size===`large`}]},box:`p-checkbox-box`,input:`p-checkbox-input`,icon:`p-checkbox-icon`}}),Se={name:`BaseCheckbox`,extends:U,props:{value:null,binary:Boolean,indeterminate:{type:Boolean,default:!1},trueValue:{type:null,default:!0},falseValue:{type:null,default:!1},readonly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},tabindex:{type:Number,default:null},inputId:{type:String,default:null},inputClass:{type:[String,Object],default:null},inputStyle:{type:Object,default:null},ariaLabelledby:{type:String,default:null},ariaLabel:{type:String,default:null}},style:xe,provide:function(){return{$pcCheckbox:this,$parentInstance:this}}};function Q(e){"@babel/helpers - typeof";return Q=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Q(e)}function Ce(e,t,n){return(t=we(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function we(e){var t=Te(e,`string`);return Q(t)==`symbol`?t:t+``}function Te(e,t){if(Q(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Q(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Ee(e){return Ae(e)||ke(e)||Oe(e)||De()}function De(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
151
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Oe(e,t){if(e){if(typeof e==`string`)return je(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?je(e,t):void 0}}function ke(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function Ae(e){if(Array.isArray(e))return je(e)}function je(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var $={name:`Checkbox`,extends:Se,inheritAttrs:!1,emits:[`change`,`focus`,`blur`,`update:indeterminate`],inject:{$pcCheckboxGroup:{default:void 0}},data:function(){return{d_indeterminate:this.indeterminate}},watch:{indeterminate:function(e){this.d_indeterminate=e,this.updateIndeterminate()}},mounted:function(){this.updateIndeterminate()},updated:function(){this.updateIndeterminate()},methods:{getPTOptions:function(e){return(e===`root`?this.ptmi:this.ptm)(e,{context:{checked:this.checked,indeterminate:this.d_indeterminate,disabled:this.disabled}})},onChange:function(e){var t=this;if(!this.disabled&&!this.readonly){var n=this.$pcCheckboxGroup?this.$pcCheckboxGroup.d_value:this.d_value,r=this.binary?this.d_indeterminate?this.trueValue:this.checked?this.falseValue:this.trueValue:this.checked||this.d_indeterminate?n.filter(function(e){return!v(e,t.value)}):n?[].concat(Ee(n),[this.value]):[this.value];this.d_indeterminate&&(this.d_indeterminate=!1,this.$emit(`update:indeterminate`,this.d_indeterminate)),this.$pcCheckboxGroup?this.$pcCheckboxGroup.writeValue(r,e):this.writeValue(r,e),this.$emit(`change`,e)}},onFocus:function(e){this.$emit(`focus`,e)},onBlur:function(e){var t,n;this.$emit(`blur`,e),(t=(n=this.formField).onBlur)==null||t.call(n,e)},updateIndeterminate:function(){this.$refs.input&&(this.$refs.input.indeterminate=this.d_indeterminate)}},computed:{groupName:function(){return this.$pcCheckboxGroup?this.$pcCheckboxGroup.groupName:this.$formName},checked:function(){var e=this.$pcCheckboxGroup?this.$pcCheckboxGroup.d_value:this.d_value;return this.d_indeterminate?!1:this.binary?e===this.trueValue:b(this.value,e)},dataP:function(){return T(Ce({invalid:this.$invalid,checked:this.checked,disabled:this.disabled,filled:this.$variant===`filled`},this.size,this.size))}},components:{CheckIcon:q,MinusIcon:X}},Me=[`data-p-checked`,`data-p-indeterminate`,`data-p-disabled`,`data-p`],Ne=[`id`,`value`,`name`,`checked`,`tabindex`,`disabled`,`readonly`,`required`,`aria-labelledby`,`aria-label`,`aria-invalid`],Pe=[`data-p`];function Fe(e,t,r,i,a,o){var c=s(`CheckIcon`),u=s(`MinusIcon`);return p(),f(`div`,l({class:e.cx(`root`)},o.getPTOptions(`root`),{"data-p-checked":o.checked,"data-p-indeterminate":a.d_indeterminate||void 0,"data-p-disabled":e.disabled,"data-p":o.dataP}),[d(`input`,l({ref:`input`,id:e.inputId,type:`checkbox`,class:[e.cx(`input`),e.inputClass],style:e.inputStyle,value:e.value,name:o.groupName,checked:o.checked,tabindex:e.tabindex,disabled:e.disabled,readonly:e.readonly,required:e.required,"aria-labelledby":e.ariaLabelledby,"aria-label":e.ariaLabel,"aria-invalid":e.invalid||void 0,onFocus:t[0]||=function(){return o.onFocus&&o.onFocus.apply(o,arguments)},onBlur:t[1]||=function(){return o.onBlur&&o.onBlur.apply(o,arguments)},onChange:t[2]||=function(){return o.onChange&&o.onChange.apply(o,arguments)}},o.getPTOptions(`input`)),null,16,Ne),d(`div`,l({class:e.cx(`box`)},o.getPTOptions(`box`),{"data-p":o.dataP}),[E(e.$slots,`icon`,{checked:o.checked,indeterminate:a.d_indeterminate,class:y(e.cx(`icon`)),dataP:o.dataP},function(){return[o.checked?(p(),n(c,l({key:0,class:e.cx(`icon`)},o.getPTOptions(`icon`),{"data-p":o.dataP}),null,16,[`class`,`data-p`])):a.d_indeterminate?(p(),n(u,l({key:1,class:e.cx(`icon`)},o.getPTOptions(`icon`),{"data-p":o.dataP}),null,16,[`class`,`data-p`])):M(``,!0)]})],16,Pe)],16,Me)}$.render=Fe;var Ie={name:`EyeIcon`,extends:w};function Le(e){return Ve(e)||Be(e)||ze(e)||Re()}function Re(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
152
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ze(e,t){if(e){if(typeof e==`string`)return He(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?He(e,t):void 0}}function Be(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function Ve(e){if(Array.isArray(e))return He(e)}function He(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ue(e,t,n,r,i,a){return p(),f(`svg`,l({width:`14`,height:`14`,viewBox:`0 0 14 14`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},e.pti()),Le(t[0]||=[d(`path`,{"fill-rule":`evenodd`,"clip-rule":`evenodd`,d:`M0.0535499 7.25213C0.208567 7.59162 2.40413 12.4 7 12.4C11.5959 12.4 13.7914 7.59162 13.9465 7.25213C13.9487 7.2471 13.9506 7.24304 13.952 7.24001C13.9837 7.16396 14 7.08239 14 7.00001C14 6.91762 13.9837 6.83605 13.952 6.76001C13.9506 6.75697 13.9487 6.75292 13.9465 6.74788C13.7914 6.4084 11.5959 1.60001 7 1.60001C2.40413 1.60001 0.208567 6.40839 0.0535499 6.74788C0.0512519 6.75292 0.0494023 6.75697 0.048 6.76001C0.0163137 6.83605 0 6.91762 0 7.00001C0 7.08239 0.0163137 7.16396 0.048 7.24001C0.0494023 7.24304 0.0512519 7.2471 0.0535499 7.25213ZM7 11.2C3.664 11.2 1.736 7.92001 1.264 7.00001C1.736 6.08001 3.664 2.80001 7 2.80001C10.336 2.80001 12.264 6.08001 12.736 7.00001C12.264 7.92001 10.336 11.2 7 11.2ZM5.55551 9.16182C5.98308 9.44751 6.48576 9.6 7 9.6C7.68891 9.59789 8.349 9.32328 8.83614 8.83614C9.32328 8.349 9.59789 7.68891 9.59999 7C9.59999 6.48576 9.44751 5.98308 9.16182 5.55551C8.87612 5.12794 8.47006 4.7947 7.99497 4.59791C7.51988 4.40112 6.99711 4.34963 6.49276 4.44995C5.98841 4.55027 5.52513 4.7979 5.16152 5.16152C4.7979 5.52513 4.55027 5.98841 4.44995 6.49276C4.34963 6.99711 4.40112 7.51988 4.59791 7.99497C4.7947 8.47006 5.12794 8.87612 5.55551 9.16182ZM6.2222 5.83594C6.45243 5.6821 6.7231 5.6 7 5.6C7.37065 5.6021 7.72553 5.75027 7.98762 6.01237C8.24972 6.27446 8.39789 6.62934 8.4 7C8.4 7.27689 8.31789 7.54756 8.16405 7.77779C8.01022 8.00802 7.79157 8.18746 7.53575 8.29343C7.27994 8.39939 6.99844 8.42711 6.72687 8.37309C6.4553 8.31908 6.20584 8.18574 6.01005 7.98994C5.81425 7.79415 5.68091 7.54469 5.6269 7.27312C5.57288 7.00155 5.6006 6.72006 5.70656 6.46424C5.81253 6.20842 5.99197 5.98977 6.2222 5.83594Z`,fill:`currentColor`},null,-1)]),16)}Ie.render=Ue;var We={name:`EyeSlashIcon`,extends:w};function Ge(e){return Ye(e)||Je(e)||qe(e)||Ke()}function Ke(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
153
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qe(e,t){if(e){if(typeof e==`string`)return Xe(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Xe(e,t):void 0}}function Je(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function Ye(e){if(Array.isArray(e))return Xe(e)}function Xe(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ze(e,t,n,r,i,a){return p(),f(`svg`,l({width:`14`,height:`14`,viewBox:`0 0 14 14`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},e.pti()),Ge(t[0]||=[d(`path`,{"fill-rule":`evenodd`,"clip-rule":`evenodd`,d:`M13.9414 6.74792C13.9437 6.75295 13.9455 6.757 13.9469 6.76003C13.982 6.8394 14.0001 6.9252 14.0001 7.01195C14.0001 7.0987 13.982 7.1845 13.9469 7.26386C13.6004 8.00059 13.1711 8.69549 12.6674 9.33515C12.6115 9.4071 12.54 9.46538 12.4582 9.50556C12.3765 9.54574 12.2866 9.56678 12.1955 9.56707C12.0834 9.56671 11.9737 9.53496 11.8788 9.47541C11.7838 9.41586 11.7074 9.3309 11.6583 9.23015C11.6092 9.12941 11.5893 9.01691 11.6008 8.90543C11.6124 8.79394 11.6549 8.68793 11.7237 8.5994C12.1065 8.09726 12.4437 7.56199 12.7313 6.99995C12.2595 6.08027 10.3402 2.8014 6.99732 2.8014C6.63723 2.80218 6.27816 2.83969 5.92569 2.91336C5.77666 2.93304 5.62568 2.89606 5.50263 2.80972C5.37958 2.72337 5.29344 2.59398 5.26125 2.44714C5.22907 2.30031 5.2532 2.14674 5.32885 2.01685C5.40451 1.88696 5.52618 1.79021 5.66978 1.74576C6.10574 1.64961 6.55089 1.60134 6.99732 1.60181C11.5916 1.60181 13.7864 6.40856 13.9414 6.74792ZM2.20333 1.61685C2.35871 1.61411 2.5091 1.67179 2.6228 1.77774L12.2195 11.3744C12.3318 11.4869 12.3949 11.6393 12.3949 11.7983C12.3949 11.9572 12.3318 12.1097 12.2195 12.2221C12.107 12.3345 11.9546 12.3976 11.7956 12.3976C11.6367 12.3976 11.4842 12.3345 11.3718 12.2221L10.5081 11.3584C9.46549 12.0426 8.24432 12.4042 6.99729 12.3981C2.403 12.3981 0.208197 7.59135 0.0532336 7.25198C0.0509364 7.24694 0.0490875 7.2429 0.0476856 7.23986C0.0162332 7.16518 3.05176e-05 7.08497 3.05176e-05 7.00394C3.05176e-05 6.92291 0.0162332 6.8427 0.0476856 6.76802C0.631261 5.47831 1.46902 4.31959 2.51084 3.36119L1.77509 2.62545C1.66914 2.51175 1.61146 2.36136 1.61421 2.20597C1.61695 2.05059 1.6799 1.90233 1.78979 1.79244C1.89968 1.68254 2.04794 1.6196 2.20333 1.61685ZM7.45314 8.35147L5.68574 6.57609V6.5361C5.5872 6.78938 5.56498 7.06597 5.62183 7.33173C5.67868 7.59749 5.8121 7.84078 6.00563 8.03158C6.19567 8.21043 6.43052 8.33458 6.68533 8.39089C6.94014 8.44721 7.20543 8.43359 7.45314 8.35147ZM1.26327 6.99994C1.7351 7.91163 3.64645 11.1985 6.99729 11.1985C7.9267 11.2048 8.8408 10.9618 9.64438 10.4947L8.35682 9.20718C7.86027 9.51441 7.27449 9.64491 6.69448 9.57752C6.11446 9.51014 5.57421 9.24881 5.16131 8.83592C4.74842 8.42303 4.4871 7.88277 4.41971 7.30276C4.35232 6.72274 4.48282 6.13697 4.79005 5.64041L3.35855 4.2089C2.4954 5.00336 1.78523 5.94935 1.26327 6.99994Z`,fill:`currentColor`},null,-1)]),16)}We.render=Ze;var Qe=j.extend({name:`password`,style:`
|
|
145
154
|
.p-password {
|
|
146
155
|
display: inline-flex;
|
|
147
156
|
position: relative;
|
|
@@ -239,26 +248,17 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
239
248
|
padding-inline-end: calc((dt('form.field.padding.x') * 3) + calc(dt('icon.size') * 2));
|
|
240
249
|
}
|
|
241
250
|
|
|
242
|
-
`,classes:{root:function(e){var t=e.instance;return[`p-password p-component p-inputwrapper`,{"p-inputwrapper-filled":t.$filled,"p-inputwrapper-focus":t.focused,"p-password-fluid":t.$fluid}]},pcInputText:`p-password-input`,maskIcon:`p-password-toggle-mask-icon p-password-mask-icon`,unmaskIcon:`p-password-toggle-mask-icon p-password-unmask-icon`,clearIcon:`p-password-clear-icon`,overlay:`p-password-overlay p-component`,content:`p-password-content`,meter:`p-password-meter`,meterLabel:function(e){var t=e.instance;return`p-password-meter-label ${t.meter?`p-password-meter-`+t.meter.strength:``}`},meterText:`p-password-meter-text`},inlineStyles:{root:function(e){return{position:e.props.appendTo===`self`?`relative`:void 0}}}}),Qe={name:`BasePassword`,extends:W,props:{promptLabel:{type:String,default:null},mediumRegex:{type:[String,RegExp],default:`^(((?=.*[a-z])(?=.*[A-Z]))|((?=.*[a-z])(?=.*[0-9]))|((?=.*[A-Z])(?=.*[0-9])))(?=.{6,})`},strongRegex:{type:[String,RegExp],default:`^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.{8,})`},weakLabel:{type:String,default:null},mediumLabel:{type:String,default:null},strongLabel:{type:String,default:null},feedback:{type:Boolean,default:!0},appendTo:{type:[String,Object],default:`body`},toggleMask:{type:Boolean,default:!1},hideIcon:{type:String,default:void 0},maskIcon:{type:String,default:void 0},showIcon:{type:String,default:void 0},unmaskIcon:{type:String,default:void 0},showClear:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},placeholder:{type:String,default:null},required:{type:Boolean,default:!1},inputId:{type:String,default:null},inputClass:{type:[String,Object],default:null},inputStyle:{type:Object,default:null},inputProps:{type:null,default:null},panelId:{type:String,default:null},panelClass:{type:[String,Object],default:null},panelStyle:{type:Object,default:null},panelProps:{type:null,default:null},overlayId:{type:String,default:null},overlayClass:{type:[String,Object],default:null},overlayStyle:{type:Object,default:null},overlayProps:{type:null,default:null},ariaLabelledby:{type:String,default:null},ariaLabel:{type:String,default:null},autofocus:{type:Boolean,default:null}},style:Ze,provide:function(){return{$pcPassword:this,$parentInstance:this}}};function $e(e){"@babel/helpers - typeof";return $e=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},$e(e)}function et(e,t,n){return(t=tt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tt(e){var t=nt(e,`string`);return $e(t)==`symbol`?t:t+``}function nt(e,t){if($e(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if($e(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var rt={name:`Password`,extends:Qe,inheritAttrs:!1,emits:[`change`,`focus`,`blur`,`invalid`],inject:{$pcFluid:{default:null}},data:function(){return{overlayVisible:!1,meter:null,infoText:null,focused:!1,unmasked:!1}},mediumCheckRegExp:null,strongCheckRegExp:null,resizeListener:null,scrollHandler:null,overlay:null,mounted:function(){this.infoText=this.promptText,this.mediumCheckRegExp=new RegExp(this.mediumRegex),this.strongCheckRegExp=new RegExp(this.strongRegex)},beforeUnmount:function(){this.unbindResizeListener(),this.scrollHandler&&=(this.scrollHandler.destroy(),null),this.overlay&&=(B.clear(this.overlay),null)},methods:{onOverlayEnter:function(e){B.set(`overlay`,e,this.$primevue.config.zIndex.overlay),I(e,{position:`absolute`,top:`0`}),this.alignOverlay(),this.bindScrollListener(),this.bindResizeListener(),this.$attrSelector&&e.setAttribute(this.$attrSelector,``)},onOverlayLeave:function(){this.unbindScrollListener(),this.unbindResizeListener(),this.overlay=null},onOverlayAfterLeave:function(e){B.clear(e)},alignOverlay:function(){this.appendTo===`self`?t(this.overlay,this.$refs.input.$el):(this.overlay.style.minWidth=O(this.$refs.input.$el)+`px`,S(this.overlay,this.$refs.input.$el))},testStrength:function(e){var t=0;return this.strongCheckRegExp.test(e)?t=3:this.mediumCheckRegExp.test(e)?t=2:e.length&&(t=1),t},onInput:function(e){this.writeValue(e.target.value,e),this.$emit(`change`,e)},onFocus:function(e){this.focused=!0,this.feedback&&(this.setPasswordMeter(this.d_value),this.overlayVisible=!0),this.$emit(`focus`,e)},onBlur:function(e){this.focused=!1,this.feedback&&(this.overlayVisible=!1),this.$emit(`blur`,e)},onKeyUp:function(e){if(this.feedback){var t=e.target.value,n=this.checkPasswordStrength(t),r=n.meter,i=n.label;if(this.meter=r,this.infoText=i,e.code===`Escape`){this.overlayVisible&&=!1;return}this.overlayVisible||=!0}},setPasswordMeter:function(){if(!this.d_value){this.meter=null,this.infoText=this.promptText;return}var e=this.checkPasswordStrength(this.d_value),t=e.meter,n=e.label;this.meter=t,this.infoText=n,this.overlayVisible||=!0},checkPasswordStrength:function(e){var t=null,n=null;switch(this.testStrength(e)){case 1:t=this.weakText,n={strength:`weak`,width:`33.33%`};break;case 2:t=this.mediumText,n={strength:`medium`,width:`66.66%`};break;case 3:t=this.strongText,n={strength:`strong`,width:`100%`};break;default:t=this.promptText,n=null;break}return{label:t,meter:n}},onInvalid:function(e){this.$emit(`invalid`,e)},bindScrollListener:function(){var e=this;this.scrollHandler||=new L(this.$refs.input.$el,function(){e.overlayVisible&&=!1}),this.scrollHandler.bindScrollListener()},unbindScrollListener:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener:function(){var e=this;this.resizeListener||(this.resizeListener=function(){e.overlayVisible&&!i()&&(e.overlayVisible=!1)},window.addEventListener(`resize`,this.resizeListener))},unbindResizeListener:function(){this.resizeListener&&=(window.removeEventListener(`resize`,this.resizeListener),null)},overlayRef:function(e){this.overlay=e},onMaskToggle:function(){this.unmasked=!this.unmasked},onClearClick:function(e){this.writeValue(null,{})},onOverlayClick:function(e){q.emit(`overlay-click`,{originalEvent:e,target:this.$el})}},computed:{inputType:function(){return this.unmasked?`text`:`password`},weakText:function(){return this.weakLabel||this.$primevue.config.locale.weak},mediumText:function(){return this.mediumLabel||this.$primevue.config.locale.medium},strongText:function(){return this.strongLabel||this.$primevue.config.locale.strong},promptText:function(){return this.promptLabel||this.$primevue.config.locale.passwordPrompt},isClearIconVisible:function(){return this.showClear&&this.$filled&&!this.disabled},overlayUniqueId:function(){return this.$id+`_overlay`},containerDataP:function(){return T({fluid:this.$fluid})},meterDataP:function(){return T(et({},this.meter?.strength,this.meter?.strength))},overlayDataP:function(){return T(et({},`portal-`+this.appendTo,`portal-`+this.appendTo))}},components:{InputText:G,Portal:R,EyeSlashIcon:Ue,EyeIcon:Fe,TimesIcon:z}};function it(e){"@babel/helpers - typeof";return it=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},it(e)}function at(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ot(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?at(Object(n),!0).forEach(function(t){st(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):at(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function st(e,t,n){return(t=ct(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ct(e){var t=lt(e,`string`);return it(t)==`symbol`?t:t+``}function lt(e,t){if(it(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(it(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var ut=[`data-p`],dt=[`id`,`data-p`],ft=[`data-p`];function pt(e,t,r,i,a,o){var c=s(`InputText`),h=s(`TimesIcon`),_=s(`Portal`);return p(),f(`div`,l({class:e.cx(`root`),style:e.sx(`root`),"data-p":o.containerDataP},e.ptmi(`root`)),[u(c,l({ref:`input`,id:e.inputId,type:o.inputType,class:[e.cx(`pcInputText`),e.inputClass],style:e.inputStyle,defaultValue:e.d_value,name:e.$formName,"aria-labelledby":e.ariaLabelledby,"aria-label":e.ariaLabel,"aria-expanded":a.overlayVisible,"aria-controls":a.overlayVisible?e.overlayProps&&e.overlayProps.id||e.overlayId||e.panelProps&&e.panelProps.id||e.panelId||o.overlayUniqueId:void 0,"aria-haspopup":e.feedback,placeholder:e.placeholder,required:e.required,fluid:e.fluid,disabled:e.disabled,variant:e.variant,invalid:e.invalid,size:e.size,autofocus:e.autofocus,onInput:o.onInput,onFocus:o.onFocus,onBlur:o.onBlur,onKeyup:o.onKeyUp,onInvalid:o.onInvalid},e.inputProps,{"data-p-has-e-icon":e.toggleMask,pt:e.ptm(`pcInputText`),unstyled:e.unstyled}),null,16,`id.type.class.style.defaultValue.name.aria-labelledby.aria-label.aria-expanded.aria-controls.aria-haspopup.placeholder.required.fluid.disabled.variant.invalid.size.autofocus.onInput.onFocus.onBlur.onKeyup.onInvalid.data-p-has-e-icon.pt.unstyled`.split(`.`)),e.toggleMask&&a.unmasked?E(e.$slots,e.$slots.maskicon?`maskicon`:`hideicon`,l({key:0,toggleCallback:o.onMaskToggle,class:[e.cx(`maskIcon`),e.maskIcon]},e.ptm(`maskIcon`)),function(){return[(p(),n(m(e.maskIcon?`i`:`EyeSlashIcon`),l({class:[e.cx(`maskIcon`),e.maskIcon],onClick:o.onMaskToggle},e.ptm(`maskIcon`)),null,16,[`class`,`onClick`]))]}):M(``,!0),e.toggleMask&&!a.unmasked?E(e.$slots,e.$slots.unmaskicon?`unmaskicon`:`showicon`,l({key:1,toggleCallback:o.onMaskToggle,class:[e.cx(`unmaskIcon`)]},e.ptm(`unmaskIcon`)),function(){return[(p(),n(m(e.unmaskIcon?`i`:`EyeIcon`),l({class:[e.cx(`unmaskIcon`),e.unmaskIcon],onClick:o.onMaskToggle},e.ptm(`unmaskIcon`)),null,16,[`class`,`onClick`]))]}):M(``,!0),o.isClearIconVisible?E(e.$slots,`clearicon`,l({key:2,class:e.cx(`clearIcon`),clearCallback:o.onClearClick},e.ptm(`clearIcon`)),function(){return[u(h,l({class:[e.cx(`clearIcon`)],onClick:o.onClearClick},e.ptm(`clearIcon`)),null,16,[`class`,`onClick`])]}):M(``,!0),d(`span`,l({class:`p-hidden-accessible`,"aria-live":`polite`},e.ptm(`hiddenAccesible`),{"data-p-hidden-accessible":!0}),F(a.infoText),17),u(_,{appendTo:e.appendTo},{default:k(function(){return[u(g,l({name:`p-anchored-overlay`,onEnter:o.onOverlayEnter,onLeave:o.onOverlayLeave,onAfterLeave:o.onOverlayAfterLeave},e.ptm(`transition`)),{default:k(function(){return[a.overlayVisible?(p(),f(`div`,l({key:0,ref:o.overlayRef,id:e.overlayId||e.panelId||o.overlayUniqueId,class:[e.cx(`overlay`),e.panelClass,e.overlayClass],style:[e.overlayStyle,e.panelStyle],onClick:t[0]||=function(){return o.onOverlayClick&&o.onOverlayClick.apply(o,arguments)},"data-p":o.overlayDataP,role:`dialog`,"aria-live":`polite`},ot(ot(ot({},e.panelProps),e.overlayProps),e.ptm(`overlay`))),[E(e.$slots,`header`),E(e.$slots,`content`,{},function(){return[d(`div`,l({class:e.cx(`content`)},e.ptm(`content`)),[d(`div`,l({class:e.cx(`meter`)},e.ptm(`meter`)),[d(`div`,l({class:e.cx(`meterLabel`),style:{width:a.meter?a.meter.width:``},"data-p":o.meterDataP},e.ptm(`meterLabel`)),null,16,ft)],16),d(`div`,l({class:e.cx(`meterText`)},e.ptm(`meterText`)),F(a.infoText),17)],16)]}),E(e.$slots,`footer`)],16,dt)):M(``,!0)]}),_:3},16,[`onEnter`,`onLeave`,`onAfterLeave`])]}),_:3},8,[`appendTo`])],16,ut)}rt.render=pt;var mt={class:`space-y-6`},ht={class:`text-sm font-semibold mb-3 text-foreground`},gt={class:`space-y-3`},_t={class:`flex items-center gap-2`},vt={for:`lf-enabled`,class:`text-sm cursor-pointer`},yt={key:0,class:`space-y-3 pl-6 border-l-2 border-border`},bt={class:`flex flex-col gap-1`},xt={class:`text-xs text-muted-foreground`},St={class:`flex flex-col gap-1`},Ct={class:`text-xs text-muted-foreground`},wt={class:`flex flex-col gap-1`},Tt={class:`text-xs text-muted-foreground`},Et={class:`text-sm font-semibold mb-3 text-foreground`},Dt={class:`space-y-3`},Ot={class:`flex items-center gap-2`},kt={for:`webhook-enabled`,class:`text-sm cursor-pointer`},At={key:0,class:`space-y-3 pl-6 border-l-2 border-border`},jt={class:`flex flex-col gap-1`},Mt={class:`text-xs text-muted-foreground`},Nt={class:`flex flex-col gap-1`},Pt={class:`text-xs text-muted-foreground`},Ft={class:`text-xs text-muted-foreground`},It={class:`text-sm font-semibold mb-3 text-foreground`},Lt={class:`space-y-3`},Rt={class:`flex items-center gap-2`},zt={for:`notion-enabled`,class:`text-sm cursor-pointer`},Bt={key:0,class:`space-y-3 pl-6 border-l-2 border-border`},Vt={class:`flex flex-col gap-1`},Ht={class:`text-xs text-muted-foreground`},Ut={class:`flex flex-col gap-1`},Wt={class:`text-xs text-muted-foreground`},Gt={class:`flex flex-col gap-1`},Kt={class:`text-xs text-muted-foreground`},qt={class:`flex items-center gap-2`},Jt={key:0,class:`text-xs text-green-600`},Yt={class:`rounded border border-border`},Xt={key:0,class:`space-y-3 border-t border-border p-3`},Zt={class:`flex flex-col gap-1`},Qt={class:`text-xs text-muted-foreground`},$t={class:`flex flex-col gap-1`},en={class:`flex items-center justify-between gap-2`},tn={class:`text-xs text-muted-foreground`},nn={key:0,class:`text-xs text-muted-foreground`},rn={key:0,class:`text-xs text-red-500 mt-1`},an={class:`text-xs text-muted-foreground p-2 rounded border border-border`},on=e({__name:`IntegrationSettings`,props:o({schemas:{}},{langfuseEnabled:{type:Boolean,required:!0},langfuseEnabledModifiers:{},langfusePublicKey:{required:!0},langfusePublicKeyModifiers:{},langfuseSecretKey:{required:!0},langfuseSecretKeyModifiers:{},langfuseHost:{required:!0},langfuseHostModifiers:{},webhookEnabled:{type:Boolean,required:!0},webhookEnabledModifiers:{},webhookUrl:{required:!0},webhookUrlModifiers:{},webhookSecret:{required:!0},webhookSecretModifiers:{},notionEnabled:{type:Boolean,required:!0},notionEnabledModifiers:{},notionToken:{required:!0},notionTokenModifiers:{},notionSchemas:{required:!0},notionSchemasModifiers:{},selectedNotionSchema:{required:!0},selectedNotionSchemaModifiers:{},notionDatabaseId:{required:!0},notionDatabaseIdModifiers:{},notionTitleProperty:{required:!0},notionTitlePropertyModifiers:{},notionFieldMap:{required:!0},notionFieldMapModifiers:{},notionProperties:{required:!0},notionPropertiesModifiers:{},notionSchemaFields:{required:!0},notionSchemaFieldsModifiers:{},notionAdvancedOpen:{type:Boolean,required:!0},notionAdvancedOpenModifiers:{}}),emits:[`update:langfuseEnabled`,`update:langfusePublicKey`,`update:langfuseSecretKey`,`update:langfuseHost`,`update:webhookEnabled`,`update:webhookUrl`,`update:webhookSecret`,`update:notionEnabled`,`update:notionToken`,`update:notionSchemas`,`update:selectedNotionSchema`,`update:notionDatabaseId`,`update:notionTitleProperty`,`update:notionFieldMap`,`update:notionProperties`,`update:notionSchemaFields`,`update:notionAdvancedOpen`],setup(e,{expose:t}){let n=e,r=_(e,`langfuseEnabled`),i=_(e,`langfusePublicKey`),a=_(e,`langfuseSecretKey`),o=_(e,`langfuseHost`),s=_(e,`webhookEnabled`),c=_(e,`webhookUrl`),l=_(e,`webhookSecret`),m=_(e,`notionEnabled`),h=_(e,`notionToken`),g=_(e,`notionSchemas`),v=_(e,`selectedNotionSchema`),b=_(e,`notionDatabaseId`),S=_(e,`notionTitleProperty`),w=_(e,`notionFieldMap`),T=_(e,`notionProperties`),E=_(e,`notionSchemaFields`),O=_(e,`notionAdvancedOpen`),{t:k}=ee(),j=C(!1),te=N(()=>n.schemas.map(e=>e.replace(`.json`,``))),P=N(()=>{let e=w.value.trim();if(!e)return``;try{let t=JSON.parse(e);if(!t||typeof t!=`object`||Array.isArray(t))return k(`app.fieldMapObject`);for(let[e,n]of Object.entries(t))if(typeof n!=`string`)return k(`app.fieldMapString`,{key:e});return``}catch{return k(`app.fieldMapValidJson`)}}),I=N(()=>{try{return Object.keys(R()??{}).length}catch{return 0}}),L=N(()=>T.value.length===0?``:E.value.length===0?k(`app.notionPropertiesLoaded`,{count:T.value.length}):k(`app.notionFieldsMapped`,{count:I.value,total:E.value.length}));function R(){if(!w.value.trim())return;let e=JSON.parse(w.value),t=Object.fromEntries(Object.entries(e).map(([e,t])=>[e,typeof t==`string`?t.trim():``]).filter(([e,t])=>!!e&&!!t));return Object.keys(t).length>0?t:void 0}function z(e){if(!e?.properties||typeof e.properties!=`object`)return[];let t=[];function n(e,r=``){for(let[i,a]of Object.entries(e)){let e=r?`${r}.${i}`:i;if(a?.type===`object`&&a?.properties&&typeof a.properties==`object`){n(a.properties,e);continue}a?.type===`array`&&a?.items?.type===`object`||t.push(e)}}return n(e.properties),t}function B(e){let t={};for(let n of E.value)t[n]=e?.[n]??``;for(let[n,r]of Object.entries(e??{}))n in t||(t[n]=r);return Object.keys(t).length>0?JSON.stringify(t,null,2):``}function ne(e=v.value){if(!e||P.value)return;let t=b.value.trim(),n=S.value.trim(),r=R();if(!t){let t={...g.value};delete t[e],g.value=t;return}g.value={...g.value,[e]:{databaseId:t,titleProperty:n||void 0,fieldMap:r}}}function re(){let e=v.value?g.value[v.value]:void 0;b.value=e?.databaseId??``,S.value=e?.titleProperty??``,w.value=B(e?.fieldMap),T.value=[]}A(te,e=>{!v.value&&e.length>0&&(v.value=e[0])},{immediate:!0}),A(v,(e,t)=>{t&&ne(t),ie()});async function ie(){let e=v.value;if(E.value=[],!e){re();return}try{E.value=z(await H(`${e}.json`))}catch{E.value=[]}re()}t({persistSelectedNotionSchema:ne,loadSelectedNotionSchemaFields:ie,notionFieldMapError:P});async function V(){if(!v.value){U.error(k(`app.toastSelectSchema`));return}if(!h.value.trim()){U.error(k(`app.toastEnterToken`));return}if(!b.value.trim()){U.error(k(`app.toastEnterDatabaseId`));return}if(P.value){U.error(P.value);return}j.value=!0;try{let e=await ae({token:h.value,databaseId:b.value,schemaName:v.value});(e.dataSourceId||e.databaseId)&&(b.value=e.dataSourceId??e.databaseId??``),!S.value&&e.titleProperty&&(S.value=e.titleProperty);let t=R()??{},n={...e.suggestedFieldMap??{},...t};w.value=Object.keys(n).length>0?JSON.stringify(n,null,2):``,T.value=e.properties??[],ne(),U.success(k(`app.notionConnected`,{count:T.value.length}))}catch(e){U.error(e instanceof Error?e.message:k(`app.notionConnectionFailed`))}finally{j.value=!1}}return(e,t)=>(p(),f(`div`,mt,[d(`section`,null,[d(`h3`,ht,F(e.$t(`app.langfuseTracing`)),1),d(`div`,gt,[d(`div`,_t,[u(x($),{modelValue:r.value,"onUpdate:modelValue":t[0]||=e=>r.value=e,binary:!0,"input-id":`lf-enabled`},null,8,[`modelValue`]),d(`label`,vt,F(e.$t(`app.enabled`)),1)]),r.value?(p(),f(`div`,yt,[d(`div`,bt,[d(`label`,xt,F(e.$t(`app.secretKey`)),1),u(x(rt),{modelValue:a.value,"onUpdate:modelValue":t[1]||=e=>a.value=e,feedback:!1,"toggle-mask":``,size:`small`,placeholder:`sk-lf-...`,"input-class":`w-full`},null,8,[`modelValue`])]),d(`div`,St,[d(`label`,Ct,F(e.$t(`app.publicKey`)),1),u(x(G),{modelValue:i.value,"onUpdate:modelValue":t[2]||=e=>i.value=e,size:`small`,placeholder:`pk-lf-...`},null,8,[`modelValue`])]),d(`div`,wt,[d(`label`,Tt,F(e.$t(`app.host`)),1),u(x(G),{modelValue:o.value,"onUpdate:modelValue":t[3]||=e=>o.value=e,size:`small`,placeholder:`https://us.cloud.langfuse.com`},null,8,[`modelValue`])])])):M(``,!0)])]),d(`section`,null,[d(`h3`,Et,F(e.$t(`app.webhookNotification`)),1),d(`div`,Dt,[d(`div`,Ot,[u(x($),{modelValue:s.value,"onUpdate:modelValue":t[4]||=e=>s.value=e,binary:!0,"input-id":`webhook-enabled`},null,8,[`modelValue`]),d(`label`,kt,F(e.$t(`app.enabled`)),1)]),s.value?(p(),f(`div`,At,[d(`div`,jt,[d(`label`,Mt,F(e.$t(`app.webhookUrl`)),1),u(x(G),{modelValue:c.value,"onUpdate:modelValue":t[5]||=e=>c.value=e,size:`small`,placeholder:`http://localhost:8080/webhook`,class:`w-full`},null,8,[`modelValue`])]),d(`div`,Nt,[d(`label`,Pt,F(e.$t(`app.webhookSecret`)),1),u(x(rt),{modelValue:l.value,"onUpdate:modelValue":t[6]||=e=>l.value=e,feedback:!1,"toggle-mask":``,size:`small`,placeholder:`webhook-secret-key`,"input-class":`w-full`},null,8,[`modelValue`])]),d(`div`,Ft,F(e.$t(`app.webhookHelp`)),1)])):M(``,!0)])]),d(`section`,null,[d(`h3`,It,F(e.$t(`app.notionExport`)),1),d(`div`,Lt,[d(`div`,Rt,[u(x($),{modelValue:m.value,"onUpdate:modelValue":t[7]||=e=>m.value=e,binary:!0,"input-id":`notion-enabled`},null,8,[`modelValue`]),d(`label`,zt,F(e.$t(`app.enabled`)),1)]),m.value?(p(),f(`div`,Bt,[d(`div`,Vt,[d(`label`,Ht,F(e.$t(`app.integrationToken`)),1),u(x(rt),{modelValue:h.value,"onUpdate:modelValue":t[8]||=e=>h.value=e,feedback:!1,"toggle-mask":``,size:`small`,placeholder:`secret_...`,"input-class":`w-full`},null,8,[`modelValue`])]),d(`div`,Ut,[d(`label`,Wt,F(e.$t(`app.schemaBinding`)),1),u(x(K),{modelValue:v.value,"onUpdate:modelValue":t[9]||=e=>v.value=e,options:te.value,size:`small`,placeholder:e.$t(`app.selectSchema`),disabled:te.value.length===0},null,8,[`modelValue`,`options`,`placeholder`,`disabled`])]),d(`div`,Gt,[d(`label`,Kt,F(e.$t(`app.databaseUrl`)),1),u(x(G),{modelValue:b.value,"onUpdate:modelValue":t[10]||=e=>b.value=e,size:`small`,placeholder:`https://www.notion.so/... or xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`},null,8,[`modelValue`])]),d(`div`,qt,[u(x(D),{label:e.$t(`app.connectAndMap`),icon:`pi pi-bolt`,severity:`secondary`,size:`small`,loading:j.value,disabled:!v.value||!h.value.trim()||!b.value.trim()||!!P.value,onClick:V},null,8,[`label`,`loading`,`disabled`]),L.value?(p(),f(`span`,Jt,F(L.value),1)):M(``,!0)]),d(`div`,Yt,[d(`button`,{type:`button`,class:`w-full flex items-center justify-between gap-2 px-3 py-2 text-left text-xs text-muted-foreground hover:bg-secondary`,onClick:t[11]||=e=>O.value=!O.value},[d(`span`,null,F(e.$t(`app.advancedMapping`)),1),d(`i`,{class:y([O.value?`pi pi-chevron-up`:`pi pi-chevron-down`,`text-[10px]`])},null,2)]),O.value?(p(),f(`div`,Xt,[d(`div`,Zt,[d(`label`,Qt,F(e.$t(`app.titleProperty`)),1),u(x(G),{modelValue:S.value,"onUpdate:modelValue":t[12]||=e=>S.value=e,size:`small`,placeholder:e.$t(`app.titleProperty`)},null,8,[`modelValue`,`placeholder`])]),d(`div`,$t,[d(`div`,en,[d(`label`,tn,F(e.$t(`app.fieldMapJson`)),1),E.value.length>0?(p(),f(`span`,nn,F(e.$t(`app.fieldsMapped`,{count:I.value,total:E.value.length})),1)):M(``,!0)]),u(x(Y),{modelValue:w.value,"onUpdate:modelValue":t[13]||=e=>w.value=e,rows:`5`,"auto-resize":``,class:`text-xs font-mono`,placeholder:`{
|
|
251
|
+
`,classes:{root:function(e){var t=e.instance;return[`p-password p-component p-inputwrapper`,{"p-inputwrapper-filled":t.$filled,"p-inputwrapper-focus":t.focused,"p-password-fluid":t.$fluid}]},pcInputText:`p-password-input`,maskIcon:`p-password-toggle-mask-icon p-password-mask-icon`,unmaskIcon:`p-password-toggle-mask-icon p-password-unmask-icon`,clearIcon:`p-password-clear-icon`,overlay:`p-password-overlay p-component`,content:`p-password-content`,meter:`p-password-meter`,meterLabel:function(e){var t=e.instance;return`p-password-meter-label ${t.meter?`p-password-meter-`+t.meter.strength:``}`},meterText:`p-password-meter-text`},inlineStyles:{root:function(e){return{position:e.props.appendTo===`self`?`relative`:void 0}}}}),$e={name:`BasePassword`,extends:U,props:{promptLabel:{type:String,default:null},mediumRegex:{type:[String,RegExp],default:`^(((?=.*[a-z])(?=.*[A-Z]))|((?=.*[a-z])(?=.*[0-9]))|((?=.*[A-Z])(?=.*[0-9])))(?=.{6,})`},strongRegex:{type:[String,RegExp],default:`^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.{8,})`},weakLabel:{type:String,default:null},mediumLabel:{type:String,default:null},strongLabel:{type:String,default:null},feedback:{type:Boolean,default:!0},appendTo:{type:[String,Object],default:`body`},toggleMask:{type:Boolean,default:!1},hideIcon:{type:String,default:void 0},maskIcon:{type:String,default:void 0},showIcon:{type:String,default:void 0},unmaskIcon:{type:String,default:void 0},showClear:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},placeholder:{type:String,default:null},required:{type:Boolean,default:!1},inputId:{type:String,default:null},inputClass:{type:[String,Object],default:null},inputStyle:{type:Object,default:null},inputProps:{type:null,default:null},panelId:{type:String,default:null},panelClass:{type:[String,Object],default:null},panelStyle:{type:Object,default:null},panelProps:{type:null,default:null},overlayId:{type:String,default:null},overlayClass:{type:[String,Object],default:null},overlayStyle:{type:Object,default:null},overlayProps:{type:null,default:null},ariaLabelledby:{type:String,default:null},ariaLabel:{type:String,default:null},autofocus:{type:Boolean,default:null}},style:Qe,provide:function(){return{$pcPassword:this,$parentInstance:this}}};function et(e){"@babel/helpers - typeof";return et=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},et(e)}function tt(e,t,n){return(t=nt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nt(e){var t=rt(e,`string`);return et(t)==`symbol`?t:t+``}function rt(e,t){if(et(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(et(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var it={name:`Password`,extends:$e,inheritAttrs:!1,emits:[`change`,`focus`,`blur`,`invalid`],inject:{$pcFluid:{default:null}},data:function(){return{overlayVisible:!1,meter:null,infoText:null,focused:!1,unmasked:!1}},mediumCheckRegExp:null,strongCheckRegExp:null,resizeListener:null,scrollHandler:null,overlay:null,mounted:function(){this.infoText=this.promptText,this.mediumCheckRegExp=new RegExp(this.mediumRegex),this.strongCheckRegExp=new RegExp(this.strongRegex)},beforeUnmount:function(){this.unbindResizeListener(),this.scrollHandler&&=(this.scrollHandler.destroy(),null),this.overlay&&=(B.clear(this.overlay),null)},methods:{onOverlayEnter:function(e){B.set(`overlay`,e,this.$primevue.config.zIndex.overlay),I(e,{position:`absolute`,top:`0`}),this.alignOverlay(),this.bindScrollListener(),this.bindResizeListener(),this.$attrSelector&&e.setAttribute(this.$attrSelector,``)},onOverlayLeave:function(){this.unbindScrollListener(),this.unbindResizeListener(),this.overlay=null},onOverlayAfterLeave:function(e){B.clear(e)},alignOverlay:function(){this.appendTo===`self`?t(this.overlay,this.$refs.input.$el):(this.overlay.style.minWidth=O(this.$refs.input.$el)+`px`,S(this.overlay,this.$refs.input.$el))},testStrength:function(e){var t=0;return this.strongCheckRegExp.test(e)?t=3:this.mediumCheckRegExp.test(e)?t=2:e.length&&(t=1),t},onInput:function(e){this.writeValue(e.target.value,e),this.$emit(`change`,e)},onFocus:function(e){this.focused=!0,this.feedback&&(this.setPasswordMeter(this.d_value),this.overlayVisible=!0),this.$emit(`focus`,e)},onBlur:function(e){this.focused=!1,this.feedback&&(this.overlayVisible=!1),this.$emit(`blur`,e)},onKeyUp:function(e){if(this.feedback){var t=e.target.value,n=this.checkPasswordStrength(t),r=n.meter,i=n.label;if(this.meter=r,this.infoText=i,e.code===`Escape`){this.overlayVisible&&=!1;return}this.overlayVisible||=!0}},setPasswordMeter:function(){if(!this.d_value){this.meter=null,this.infoText=this.promptText;return}var e=this.checkPasswordStrength(this.d_value),t=e.meter,n=e.label;this.meter=t,this.infoText=n,this.overlayVisible||=!0},checkPasswordStrength:function(e){var t=null,n=null;switch(this.testStrength(e)){case 1:t=this.weakText,n={strength:`weak`,width:`33.33%`};break;case 2:t=this.mediumText,n={strength:`medium`,width:`66.66%`};break;case 3:t=this.strongText,n={strength:`strong`,width:`100%`};break;default:t=this.promptText,n=null;break}return{label:t,meter:n}},onInvalid:function(e){this.$emit(`invalid`,e)},bindScrollListener:function(){var e=this;this.scrollHandler||=new L(this.$refs.input.$el,function(){e.overlayVisible&&=!1}),this.scrollHandler.bindScrollListener()},unbindScrollListener:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener:function(){var e=this;this.resizeListener||(this.resizeListener=function(){e.overlayVisible&&!i()&&(e.overlayVisible=!1)},window.addEventListener(`resize`,this.resizeListener))},unbindResizeListener:function(){this.resizeListener&&=(window.removeEventListener(`resize`,this.resizeListener),null)},overlayRef:function(e){this.overlay=e},onMaskToggle:function(){this.unmasked=!this.unmasked},onClearClick:function(e){this.writeValue(null,{})},onOverlayClick:function(e){K.emit(`overlay-click`,{originalEvent:e,target:this.$el})}},computed:{inputType:function(){return this.unmasked?`text`:`password`},weakText:function(){return this.weakLabel||this.$primevue.config.locale.weak},mediumText:function(){return this.mediumLabel||this.$primevue.config.locale.medium},strongText:function(){return this.strongLabel||this.$primevue.config.locale.strong},promptText:function(){return this.promptLabel||this.$primevue.config.locale.passwordPrompt},isClearIconVisible:function(){return this.showClear&&this.$filled&&!this.disabled},overlayUniqueId:function(){return this.$id+`_overlay`},containerDataP:function(){return T({fluid:this.$fluid})},meterDataP:function(){return T(tt({},this.meter?.strength,this.meter?.strength))},overlayDataP:function(){return T(tt({},`portal-`+this.appendTo,`portal-`+this.appendTo))}},components:{InputText:W,Portal:R,EyeSlashIcon:We,EyeIcon:Ie,TimesIcon:z}};function at(e){"@babel/helpers - typeof";return at=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},at(e)}function ot(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function st(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?ot(Object(n),!0).forEach(function(t){ct(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ot(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ct(e,t,n){return(t=lt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lt(e){var t=ut(e,`string`);return at(t)==`symbol`?t:t+``}function ut(e,t){if(at(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(at(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var dt=[`data-p`],ft=[`id`,`data-p`],pt=[`data-p`];function mt(e,t,r,i,a,o){var c=s(`InputText`),h=s(`TimesIcon`),_=s(`Portal`);return p(),f(`div`,l({class:e.cx(`root`),style:e.sx(`root`),"data-p":o.containerDataP},e.ptmi(`root`)),[u(c,l({ref:`input`,id:e.inputId,type:o.inputType,class:[e.cx(`pcInputText`),e.inputClass],style:e.inputStyle,defaultValue:e.d_value,name:e.$formName,"aria-labelledby":e.ariaLabelledby,"aria-label":e.ariaLabel,"aria-expanded":a.overlayVisible,"aria-controls":a.overlayVisible?e.overlayProps&&e.overlayProps.id||e.overlayId||e.panelProps&&e.panelProps.id||e.panelId||o.overlayUniqueId:void 0,"aria-haspopup":e.feedback,placeholder:e.placeholder,required:e.required,fluid:e.fluid,disabled:e.disabled,variant:e.variant,invalid:e.invalid,size:e.size,autofocus:e.autofocus,onInput:o.onInput,onFocus:o.onFocus,onBlur:o.onBlur,onKeyup:o.onKeyUp,onInvalid:o.onInvalid},e.inputProps,{"data-p-has-e-icon":e.toggleMask,pt:e.ptm(`pcInputText`),unstyled:e.unstyled}),null,16,`id.type.class.style.defaultValue.name.aria-labelledby.aria-label.aria-expanded.aria-controls.aria-haspopup.placeholder.required.fluid.disabled.variant.invalid.size.autofocus.onInput.onFocus.onBlur.onKeyup.onInvalid.data-p-has-e-icon.pt.unstyled`.split(`.`)),e.toggleMask&&a.unmasked?E(e.$slots,e.$slots.maskicon?`maskicon`:`hideicon`,l({key:0,toggleCallback:o.onMaskToggle,class:[e.cx(`maskIcon`),e.maskIcon]},e.ptm(`maskIcon`)),function(){return[(p(),n(m(e.maskIcon?`i`:`EyeSlashIcon`),l({class:[e.cx(`maskIcon`),e.maskIcon],onClick:o.onMaskToggle},e.ptm(`maskIcon`)),null,16,[`class`,`onClick`]))]}):M(``,!0),e.toggleMask&&!a.unmasked?E(e.$slots,e.$slots.unmaskicon?`unmaskicon`:`showicon`,l({key:1,toggleCallback:o.onMaskToggle,class:[e.cx(`unmaskIcon`)]},e.ptm(`unmaskIcon`)),function(){return[(p(),n(m(e.unmaskIcon?`i`:`EyeIcon`),l({class:[e.cx(`unmaskIcon`),e.unmaskIcon],onClick:o.onMaskToggle},e.ptm(`unmaskIcon`)),null,16,[`class`,`onClick`]))]}):M(``,!0),o.isClearIconVisible?E(e.$slots,`clearicon`,l({key:2,class:e.cx(`clearIcon`),clearCallback:o.onClearClick},e.ptm(`clearIcon`)),function(){return[u(h,l({class:[e.cx(`clearIcon`)],onClick:o.onClearClick},e.ptm(`clearIcon`)),null,16,[`class`,`onClick`])]}):M(``,!0),d(`span`,l({class:`p-hidden-accessible`,"aria-live":`polite`},e.ptm(`hiddenAccesible`),{"data-p-hidden-accessible":!0}),F(a.infoText),17),u(_,{appendTo:e.appendTo},{default:k(function(){return[u(g,l({name:`p-anchored-overlay`,onEnter:o.onOverlayEnter,onLeave:o.onOverlayLeave,onAfterLeave:o.onOverlayAfterLeave},e.ptm(`transition`)),{default:k(function(){return[a.overlayVisible?(p(),f(`div`,l({key:0,ref:o.overlayRef,id:e.overlayId||e.panelId||o.overlayUniqueId,class:[e.cx(`overlay`),e.panelClass,e.overlayClass],style:[e.overlayStyle,e.panelStyle],onClick:t[0]||=function(){return o.onOverlayClick&&o.onOverlayClick.apply(o,arguments)},"data-p":o.overlayDataP,role:`dialog`,"aria-live":`polite`},st(st(st({},e.panelProps),e.overlayProps),e.ptm(`overlay`))),[E(e.$slots,`header`),E(e.$slots,`content`,{},function(){return[d(`div`,l({class:e.cx(`content`)},e.ptm(`content`)),[d(`div`,l({class:e.cx(`meter`)},e.ptm(`meter`)),[d(`div`,l({class:e.cx(`meterLabel`),style:{width:a.meter?a.meter.width:``},"data-p":o.meterDataP},e.ptm(`meterLabel`)),null,16,pt)],16),d(`div`,l({class:e.cx(`meterText`)},e.ptm(`meterText`)),F(a.infoText),17)],16)]}),E(e.$slots,`footer`)],16,ft)):M(``,!0)]}),_:3},16,[`onEnter`,`onLeave`,`onAfterLeave`])]}),_:3},8,[`appendTo`])],16,dt)}it.render=mt;var ht={class:`space-y-6`},gt={class:`text-sm font-semibold mb-3 text-foreground`},_t={class:`space-y-3`},vt={class:`flex items-center gap-2`},yt={for:`lf-enabled`,class:`text-sm cursor-pointer`},bt={key:0,class:`space-y-3 pl-6 border-l-2 border-border`},xt={class:`flex flex-col gap-1`},St={class:`text-xs text-muted-foreground`},Ct={class:`flex flex-col gap-1`},wt={class:`text-xs text-muted-foreground`},Tt={class:`flex flex-col gap-1`},Et={class:`text-xs text-muted-foreground`},Dt={class:`text-sm font-semibold mb-3 text-foreground`},Ot={class:`space-y-3`},kt={class:`flex items-center gap-2`},At={for:`webhook-enabled`,class:`text-sm cursor-pointer`},jt={key:0,class:`space-y-3 pl-6 border-l-2 border-border`},Mt={class:`flex flex-col gap-1`},Nt={class:`text-xs text-muted-foreground`},Pt={class:`flex flex-col gap-1`},Ft={class:`text-xs text-muted-foreground`},It={class:`text-xs text-muted-foreground`},Lt={class:`text-sm font-semibold mb-3 text-foreground`},Rt={class:`space-y-3`},zt={class:`flex items-center gap-2`},Bt={for:`notion-enabled`,class:`text-sm cursor-pointer`},Vt={key:0,class:`space-y-3 pl-6 border-l-2 border-border`},Ht={class:`flex flex-col gap-1`},Ut={class:`text-xs text-muted-foreground`},Wt={class:`flex flex-col gap-1`},Gt={class:`text-xs text-muted-foreground`},Kt={class:`flex flex-col gap-1`},qt={class:`text-xs text-muted-foreground`},Jt={class:`flex items-center gap-2`},Yt={key:0,class:`text-xs text-green-600`},Xt={class:`rounded border border-border`},Zt={key:0,class:`space-y-3 border-t border-border p-3`},Qt={class:`flex flex-col gap-1`},$t={class:`text-xs text-muted-foreground`},en={class:`flex flex-col gap-1`},tn={class:`flex items-center justify-between gap-2`},nn={class:`text-xs text-muted-foreground`},rn={key:0,class:`text-xs text-muted-foreground`},an={key:0,class:`text-xs text-red-500 mt-1`},on={class:`text-xs text-muted-foreground p-2 rounded border border-border`},sn=e({__name:`IntegrationSettings`,props:o({schemas:{}},{langfuseEnabled:{type:Boolean,required:!0},langfuseEnabledModifiers:{},langfusePublicKey:{required:!0},langfusePublicKeyModifiers:{},langfuseSecretKey:{required:!0},langfuseSecretKeyModifiers:{},langfuseHost:{required:!0},langfuseHostModifiers:{},webhookEnabled:{type:Boolean,required:!0},webhookEnabledModifiers:{},webhookUrl:{required:!0},webhookUrlModifiers:{},webhookSecret:{required:!0},webhookSecretModifiers:{},notionEnabled:{type:Boolean,required:!0},notionEnabledModifiers:{},notionToken:{required:!0},notionTokenModifiers:{},notionSchemas:{required:!0},notionSchemasModifiers:{},selectedNotionSchema:{required:!0},selectedNotionSchemaModifiers:{},notionDatabaseId:{required:!0},notionDatabaseIdModifiers:{},notionTitleProperty:{required:!0},notionTitlePropertyModifiers:{},notionFieldMap:{required:!0},notionFieldMapModifiers:{},notionProperties:{required:!0},notionPropertiesModifiers:{},notionSchemaFields:{required:!0},notionSchemaFieldsModifiers:{},notionAdvancedOpen:{type:Boolean,required:!0},notionAdvancedOpenModifiers:{}}),emits:[`update:langfuseEnabled`,`update:langfusePublicKey`,`update:langfuseSecretKey`,`update:langfuseHost`,`update:webhookEnabled`,`update:webhookUrl`,`update:webhookSecret`,`update:notionEnabled`,`update:notionToken`,`update:notionSchemas`,`update:selectedNotionSchema`,`update:notionDatabaseId`,`update:notionTitleProperty`,`update:notionFieldMap`,`update:notionProperties`,`update:notionSchemaFields`,`update:notionAdvancedOpen`],setup(e,{expose:t}){let n=e,r=_(e,`langfuseEnabled`),i=_(e,`langfusePublicKey`),a=_(e,`langfuseSecretKey`),o=_(e,`langfuseHost`),s=_(e,`webhookEnabled`),c=_(e,`webhookUrl`),l=_(e,`webhookSecret`),m=_(e,`notionEnabled`),h=_(e,`notionToken`),g=_(e,`notionSchemas`),v=_(e,`selectedNotionSchema`),b=_(e,`notionDatabaseId`),S=_(e,`notionTitleProperty`),w=_(e,`notionFieldMap`),T=_(e,`notionProperties`),E=_(e,`notionSchemaFields`),O=_(e,`notionAdvancedOpen`),{t:k}=ee(),j=C(!1),te=N(()=>n.schemas.map(e=>e.replace(`.json`,``))),P=N(()=>{let e=w.value.trim();if(!e)return``;try{let t=JSON.parse(e);if(!t||typeof t!=`object`||Array.isArray(t))return k(`app.fieldMapObject`);for(let[e,n]of Object.entries(t))if(typeof n!=`string`)return k(`app.fieldMapString`,{key:e});return``}catch{return k(`app.fieldMapValidJson`)}}),I=N(()=>{try{return Object.keys(R()??{}).length}catch{return 0}}),L=N(()=>T.value.length===0?``:E.value.length===0?k(`app.notionPropertiesLoaded`,{count:T.value.length}):k(`app.notionFieldsMapped`,{count:I.value,total:E.value.length}));function R(){if(!w.value.trim())return;let e=JSON.parse(w.value),t=Object.fromEntries(Object.entries(e).map(([e,t])=>[e,typeof t==`string`?t.trim():``]).filter(([e,t])=>!!e&&!!t));return Object.keys(t).length>0?t:void 0}function z(e){if(!e?.properties||typeof e.properties!=`object`)return[];let t=[];function n(e,r=``){for(let[i,a]of Object.entries(e)){let e=r?`${r}.${i}`:i;if(a?.type===`object`&&a?.properties&&typeof a.properties==`object`){n(a.properties,e);continue}a?.type===`array`&&a?.items?.type===`object`||t.push(e)}}return n(e.properties),t}function B(e){let t={};for(let n of E.value)t[n]=e?.[n]??``;for(let[n,r]of Object.entries(e??{}))n in t||(t[n]=r);return Object.keys(t).length>0?JSON.stringify(t,null,2):``}function ne(e=v.value){if(!e||P.value)return;let t=b.value.trim(),n=S.value.trim(),r=R();if(!t){let t={...g.value};delete t[e],g.value=t;return}g.value={...g.value,[e]:{databaseId:t,titleProperty:n||void 0,fieldMap:r}}}function re(){let e=v.value?g.value[v.value]:void 0;b.value=e?.databaseId??``,S.value=e?.titleProperty??``,w.value=B(e?.fieldMap),T.value=[]}A(te,e=>{!v.value&&e.length>0&&(v.value=e[0])},{immediate:!0}),A(v,(e,t)=>{t&&ne(t),ie()});async function ie(){let e=v.value;if(E.value=[],!e){re();return}try{E.value=z(await se(`${e}.json`))}catch{E.value=[]}re()}t({persistSelectedNotionSchema:ne,loadSelectedNotionSchemaFields:ie,notionFieldMapError:P});async function V(){if(!v.value){H.error(k(`app.toastSelectSchema`));return}if(!h.value.trim()){H.error(k(`app.toastEnterToken`));return}if(!b.value.trim()){H.error(k(`app.toastEnterDatabaseId`));return}if(P.value){H.error(P.value);return}j.value=!0;try{let e=await ae({token:h.value,databaseId:b.value,schemaName:v.value});(e.dataSourceId||e.databaseId)&&(b.value=e.dataSourceId??e.databaseId??``),!S.value&&e.titleProperty&&(S.value=e.titleProperty);let t=R()??{},n={...e.suggestedFieldMap??{},...t};w.value=Object.keys(n).length>0?JSON.stringify(n,null,2):``,T.value=e.properties??[],ne(),H.success(k(`app.notionConnected`,{count:T.value.length}))}catch(e){H.error(e instanceof Error?e.message:k(`app.notionConnectionFailed`))}finally{j.value=!1}}return(e,t)=>(p(),f(`div`,ht,[d(`section`,null,[d(`h3`,gt,F(e.$t(`app.langfuseTracing`)),1),d(`div`,_t,[d(`div`,vt,[u(x($),{modelValue:r.value,"onUpdate:modelValue":t[0]||=e=>r.value=e,binary:!0,"input-id":`lf-enabled`},null,8,[`modelValue`]),d(`label`,yt,F(e.$t(`app.enabled`)),1)]),r.value?(p(),f(`div`,bt,[d(`div`,xt,[d(`label`,St,F(e.$t(`app.secretKey`)),1),u(x(it),{modelValue:a.value,"onUpdate:modelValue":t[1]||=e=>a.value=e,feedback:!1,"toggle-mask":``,size:`small`,placeholder:`sk-lf-...`,"input-class":`w-full`},null,8,[`modelValue`])]),d(`div`,Ct,[d(`label`,wt,F(e.$t(`app.publicKey`)),1),u(x(W),{modelValue:i.value,"onUpdate:modelValue":t[2]||=e=>i.value=e,size:`small`,placeholder:`pk-lf-...`},null,8,[`modelValue`])]),d(`div`,Tt,[d(`label`,Et,F(e.$t(`app.host`)),1),u(x(W),{modelValue:o.value,"onUpdate:modelValue":t[3]||=e=>o.value=e,size:`small`,placeholder:`https://us.cloud.langfuse.com`},null,8,[`modelValue`])])])):M(``,!0)])]),d(`section`,null,[d(`h3`,Dt,F(e.$t(`app.webhookNotification`)),1),d(`div`,Ot,[d(`div`,kt,[u(x($),{modelValue:s.value,"onUpdate:modelValue":t[4]||=e=>s.value=e,binary:!0,"input-id":`webhook-enabled`},null,8,[`modelValue`]),d(`label`,At,F(e.$t(`app.enabled`)),1)]),s.value?(p(),f(`div`,jt,[d(`div`,Mt,[d(`label`,Nt,F(e.$t(`app.webhookUrl`)),1),u(x(W),{modelValue:c.value,"onUpdate:modelValue":t[5]||=e=>c.value=e,size:`small`,placeholder:`http://localhost:8080/webhook`,class:`w-full`},null,8,[`modelValue`])]),d(`div`,Pt,[d(`label`,Ft,F(e.$t(`app.webhookSecret`)),1),u(x(it),{modelValue:l.value,"onUpdate:modelValue":t[6]||=e=>l.value=e,feedback:!1,"toggle-mask":``,size:`small`,placeholder:`webhook-secret-key`,"input-class":`w-full`},null,8,[`modelValue`])]),d(`div`,It,F(e.$t(`app.webhookHelp`)),1)])):M(``,!0)])]),d(`section`,null,[d(`h3`,Lt,F(e.$t(`app.notionExport`)),1),d(`div`,Rt,[d(`div`,zt,[u(x($),{modelValue:m.value,"onUpdate:modelValue":t[7]||=e=>m.value=e,binary:!0,"input-id":`notion-enabled`},null,8,[`modelValue`]),d(`label`,Bt,F(e.$t(`app.enabled`)),1)]),m.value?(p(),f(`div`,Vt,[d(`div`,Ht,[d(`label`,Ut,F(e.$t(`app.integrationToken`)),1),u(x(it),{modelValue:h.value,"onUpdate:modelValue":t[8]||=e=>h.value=e,feedback:!1,"toggle-mask":``,size:`small`,placeholder:`secret_...`,"input-class":`w-full`},null,8,[`modelValue`])]),d(`div`,Wt,[d(`label`,Gt,F(e.$t(`app.schemaBinding`)),1),u(x(G),{modelValue:v.value,"onUpdate:modelValue":t[9]||=e=>v.value=e,options:te.value,size:`small`,placeholder:e.$t(`app.selectSchema`),disabled:te.value.length===0},null,8,[`modelValue`,`options`,`placeholder`,`disabled`])]),d(`div`,Kt,[d(`label`,qt,F(e.$t(`app.databaseUrl`)),1),u(x(W),{modelValue:b.value,"onUpdate:modelValue":t[10]||=e=>b.value=e,size:`small`,placeholder:`https://www.notion.so/... or xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`},null,8,[`modelValue`])]),d(`div`,Jt,[u(x(D),{label:e.$t(`app.connectAndMap`),icon:`pi pi-bolt`,severity:`secondary`,size:`small`,loading:j.value,disabled:!v.value||!h.value.trim()||!b.value.trim()||!!P.value,onClick:V},null,8,[`label`,`loading`,`disabled`]),L.value?(p(),f(`span`,Yt,F(L.value),1)):M(``,!0)]),d(`div`,Xt,[d(`button`,{type:`button`,class:`w-full flex items-center justify-between gap-2 px-3 py-2 text-left text-xs text-muted-foreground hover:bg-secondary`,onClick:t[11]||=e=>O.value=!O.value},[d(`span`,null,F(e.$t(`app.advancedMapping`)),1),d(`i`,{class:y([O.value?`pi pi-chevron-up`:`pi pi-chevron-down`,`text-[10px]`])},null,2)]),O.value?(p(),f(`div`,Zt,[d(`div`,Qt,[d(`label`,$t,F(e.$t(`app.titleProperty`)),1),u(x(W),{modelValue:S.value,"onUpdate:modelValue":t[12]||=e=>S.value=e,size:`small`,placeholder:e.$t(`app.titleProperty`)},null,8,[`modelValue`,`placeholder`])]),d(`div`,en,[d(`div`,tn,[d(`label`,nn,F(e.$t(`app.fieldMapJson`)),1),E.value.length>0?(p(),f(`span`,rn,F(e.$t(`app.fieldsMapped`,{count:I.value,total:E.value.length})),1)):M(``,!0)]),u(x(J),{modelValue:w.value,"onUpdate:modelValue":t[13]||=e=>w.value=e,rows:`5`,"auto-resize":``,class:`text-xs font-mono`,placeholder:`{
|
|
243
252
|
"invoiceNo": "Invoice No",
|
|
244
253
|
"issuedAt": "Issued At"
|
|
245
|
-
}`},null,8,[`modelValue`]),P.value?(p(),f(`p`,
|
|
254
|
+
}`},null,8,[`modelValue`]),P.value?(p(),f(`p`,an,F(P.value),1)):M(``,!0)]),d(`div`,on,F(e.$t(`app.notionMappingHint`)),1)])):M(``,!0)])])):M(``,!0)])])]))}}),cn={class:`space-y-6`},ln={class:`text-sm font-semibold mb-3 text-foreground`},un={class:`space-y-3`},dn={class:`flex flex-col gap-1`},fn={class:`text-xs text-muted-foreground`},pn={key:0,class:`space-y-3 pl-6 border-l-2 border-border`},mn={class:`flex items-center gap-2`},hn={for:`liteparse-ocr-enabled`,class:`text-sm cursor-pointer`},gn={class:`flex flex-col gap-1`},_n={class:`text-xs text-muted-foreground`},vn={class:`flex flex-col gap-1`},yn={class:`text-xs text-muted-foreground`},bn={class:`flex flex-col gap-1`},xn={class:`text-xs text-muted-foreground`},Sn={class:`text-xs text-muted-foreground p-2 rounded border border-border`},Cn={key:1,class:`space-y-3 pl-6 border-l-2 border-border`},wn={class:`flex flex-col gap-1`},Tn={class:`text-xs text-muted-foreground`},En={class:`flex flex-col gap-1`},Dn={class:`text-xs text-muted-foreground`},On={class:`flex flex-col gap-1`},kn={class:`text-xs text-muted-foreground`},An={class:`flex items-center gap-2`},jn={for:`mineru-fallback`,class:`text-sm cursor-pointer`},Mn={class:`text-xs text-muted-foreground p-2 rounded border border-border`},Nn={key:2,class:`space-y-3 pl-6 border-l-2 border-border`},Pn={class:`flex flex-col gap-1`},Fn={class:`text-xs text-muted-foreground`},In={class:`flex flex-col gap-1`},Ln={class:`text-xs text-muted-foreground`},Rn={class:`flex flex-col gap-1`},zn={class:`text-xs text-muted-foreground`},Bn={class:`flex items-center gap-2`},Vn={for:`mineru-api-is-ocr`,class:`text-sm cursor-pointer`},Hn={class:`flex items-center gap-2`},Un={for:`mineru-api-enable-formula`,class:`text-sm cursor-pointer`},Wn={class:`flex items-center gap-2`},Gn={for:`mineru-api-enable-table`,class:`text-sm cursor-pointer`},Kn={key:3,class:`space-y-3 pl-6 border-l-2 border-border`},qn={class:`flex flex-col gap-1`},Jn={class:`text-xs text-muted-foreground`},Yn={class:`flex flex-col gap-1`},Xn={class:`text-xs text-muted-foreground`},Zn={class:`flex flex-col gap-1`},Qn={class:`text-xs text-muted-foreground`},$n={class:`text-xs text-muted-foreground p-2 rounded border border-border`},er=e({__name:`PdfSettings`,props:{pdfConverter:{required:!0},pdfConverterModifiers:{},liteparseOcrEnabled:{type:Boolean,required:!0},liteparseOcrEnabledModifiers:{},liteparseOcrLanguage:{required:!0},liteparseOcrLanguageModifiers:{},liteparseTessdataPath:{required:!0},liteparseTessdataPathModifiers:{},liteparseOcrServerUrl:{required:!0},liteparseOcrServerUrlModifiers:{},mineruCommand:{required:!0},mineruCommandModifiers:{},mineruArgs:{required:!0},mineruArgsModifiers:{},mineruTimeout:{required:!0},mineruTimeoutModifiers:{},mineruFallbackToUnpdf:{type:Boolean,required:!0},mineruFallbackToUnpdfModifiers:{},mineruApiToken:{required:!0},mineruApiTokenModifiers:{},mineruApiBaseUrl:{required:!0},mineruApiBaseUrlModifiers:{},mineruApiModel:{required:!0},mineruApiModelModifiers:{},mineruApiIsOcr:{type:Boolean,required:!0},mineruApiIsOcrModifiers:{},mineruApiEnableFormula:{type:Boolean,required:!0},mineruApiEnableFormulaModifiers:{},mineruApiEnableTable:{type:Boolean,required:!0},mineruApiEnableTableModifiers:{},externalCommand:{required:!0},externalCommandModifiers:{},externalArgs:{required:!0},externalArgsModifiers:{},externalTimeout:{required:!0},externalTimeoutModifiers:{}},emits:[`update:pdfConverter`,`update:liteparseOcrEnabled`,`update:liteparseOcrLanguage`,`update:liteparseTessdataPath`,`update:liteparseOcrServerUrl`,`update:mineruCommand`,`update:mineruArgs`,`update:mineruTimeout`,`update:mineruFallbackToUnpdf`,`update:mineruApiToken`,`update:mineruApiBaseUrl`,`update:mineruApiModel`,`update:mineruApiIsOcr`,`update:mineruApiEnableFormula`,`update:mineruApiEnableTable`,`update:externalCommand`,`update:externalArgs`,`update:externalTimeout`],setup(e){let t=_(e,`pdfConverter`),n=_(e,`liteparseOcrEnabled`),i=_(e,`liteparseOcrLanguage`),a=_(e,`liteparseTessdataPath`),o=_(e,`liteparseOcrServerUrl`),s=_(e,`mineruCommand`),c=_(e,`mineruArgs`),l=_(e,`mineruTimeout`),m=_(e,`mineruFallbackToUnpdf`),h=_(e,`mineruApiToken`),g=_(e,`mineruApiBaseUrl`),v=_(e,`mineruApiModel`),y=_(e,`mineruApiIsOcr`),b=_(e,`mineruApiEnableFormula`),S=_(e,`mineruApiEnableTable`),C=_(e,`externalCommand`),w=_(e,`externalArgs`),T=_(e,`externalTimeout`),{t:E}=ee(),D=N(()=>[{label:E(`app.pdfConverterUnpdf`),value:`unpdf`},{label:E(`app.pdfConverterLiteparse`),value:`liteparse`},{label:E(`app.pdfConverterMineru`),value:`mineru`},{label:E(`app.pdfConverterMineruApi`),value:`mineru_api`},{label:E(`app.pdfConverterExternal`),value:`external`}]);return(e,_)=>(p(),f(`div`,cn,[d(`section`,null,[d(`h3`,ln,F(e.$t(`app.pdfConversion`)),1),d(`div`,un,[d(`div`,dn,[d(`label`,fn,F(e.$t(`app.converter`)),1),u(x(G),{modelValue:t.value,"onUpdate:modelValue":_[0]||=e=>t.value=e,options:D.value,"option-label":`label`,"option-value":`value`,size:`small`},null,8,[`modelValue`,`options`])]),t.value===`liteparse`?(p(),f(`div`,pn,[d(`div`,mn,[u(x($),{modelValue:n.value,"onUpdate:modelValue":_[1]||=e=>n.value=e,binary:!0,"input-id":`liteparse-ocr-enabled`},null,8,[`modelValue`]),d(`label`,hn,F(e.$t(`app.liteparseOcrEnabled`)),1)]),d(`div`,gn,[d(`label`,_n,F(e.$t(`app.liteparseOcrLanguage`)),1),u(x(W),{modelValue:i.value,"onUpdate:modelValue":_[2]||=e=>i.value=e,size:`small`,placeholder:`eng`},null,8,[`modelValue`])]),d(`div`,vn,[d(`label`,yn,F(e.$t(`app.liteparseTessdataPath`)),1),u(x(W),{modelValue:a.value,"onUpdate:modelValue":_[3]||=e=>a.value=e,size:`small`,placeholder:`/path/to/tessdata`},null,8,[`modelValue`])]),d(`div`,bn,[d(`label`,xn,F(e.$t(`app.liteparseOcrServerUrl`)),1),u(x(W),{modelValue:o.value,"onUpdate:modelValue":_[4]||=e=>o.value=e,size:`small`,placeholder:`http://localhost:8080`},null,8,[`modelValue`])]),d(`div`,Sn,F(e.$t(`app.liteparseOcrHint`)),1)])):M(``,!0),t.value===`mineru`?(p(),f(`div`,Cn,[d(`div`,wn,[d(`label`,Tn,F(e.$t(`app.command`)),1),u(x(W),{modelValue:s.value,"onUpdate:modelValue":_[5]||=e=>s.value=e,size:`small`,placeholder:`mineru`},null,8,[`modelValue`])]),d(`div`,En,[d(`label`,Dn,F(e.$t(`app.arguments`)),1),u(x(J),{modelValue:c.value,"onUpdate:modelValue":_[6]||=e=>c.value=e,rows:`4`,"auto-resize":``,class:`text-xs font-mono`},null,8,[`modelValue`])]),d(`div`,On,[d(`label`,kn,F(e.$t(`app.timeoutLabel`)),1),u(x(W),{value:String(l.value),type:`number`,size:`small`,placeholder:`600`,min:1,onInput:_[7]||=e=>l.value=Number(e.target.value)||600},null,8,[`value`])]),d(`div`,An,[u(x($),{modelValue:m.value,"onUpdate:modelValue":_[8]||=e=>m.value=e,binary:!0,"input-id":`mineru-fallback`},null,8,[`modelValue`]),d(`label`,jn,F(e.$t(`app.fallbackToBuiltin`)),1)]),d(`div`,Mn,[r(F(e.$t(`app.placeholders`))+`: `,1),_[18]||=d(`code`,{class:`bg-secondary px-1 rounded`},`{input}`,-1),_[19]||=r(`, `,-1),_[20]||=d(`code`,{class:`bg-secondary px-1 rounded`},`{outputDir}`,-1),_[21]||=r(`, `,-1),_[22]||=d(`code`,{class:`bg-secondary px-1 rounded`},`{basename}`,-1)])])):M(``,!0),t.value===`mineru_api`?(p(),f(`div`,Nn,[d(`div`,Pn,[d(`label`,Fn,F(e.$t(`app.mineruApiTokenLabel`)),1),u(x(it),{modelValue:h.value,"onUpdate:modelValue":_[9]||=e=>h.value=e,feedback:!1,"toggle-mask":``,size:`small`,placeholder:e.$t(`app.mineruApiTokenPlaceholder`),"input-class":`w-full`},null,8,[`modelValue`,`placeholder`])]),d(`div`,In,[d(`label`,Ln,F(e.$t(`app.mineruApiBaseUrlLabel`)),1),u(x(W),{modelValue:g.value,"onUpdate:modelValue":_[10]||=e=>g.value=e,size:`small`,placeholder:`https://mineru.net/api/v4`},null,8,[`modelValue`])]),d(`div`,Rn,[d(`label`,zn,F(e.$t(`app.mineruApiModelLabel`)),1),u(x(G),{modelValue:v.value,"onUpdate:modelValue":_[11]||=e=>v.value=e,options:[{label:`vlm (Recommended)`,value:`vlm`},{label:`pipeline (Layout + OCR)`,value:`pipeline`}],"option-label":`label`,"option-value":`value`,size:`small`},null,8,[`modelValue`])]),d(`div`,Bn,[u(x($),{modelValue:y.value,"onUpdate:modelValue":_[12]||=e=>y.value=e,binary:!0,"input-id":`mineru-api-is-ocr`},null,8,[`modelValue`]),d(`label`,Vn,F(e.$t(`app.mineruApiIsOcrLabel`)),1)]),d(`div`,Hn,[u(x($),{modelValue:b.value,"onUpdate:modelValue":_[13]||=e=>b.value=e,binary:!0,"input-id":`mineru-api-enable-formula`},null,8,[`modelValue`]),d(`label`,Un,F(e.$t(`app.mineruApiEnableFormulaLabel`)),1)]),d(`div`,Wn,[u(x($),{modelValue:S.value,"onUpdate:modelValue":_[14]||=e=>S.value=e,binary:!0,"input-id":`mineru-api-enable-table`},null,8,[`modelValue`]),d(`label`,Gn,F(e.$t(`app.mineruApiEnableTableLabel`)),1)])])):M(``,!0),t.value===`external`?(p(),f(`div`,Kn,[d(`div`,qn,[d(`label`,Jn,F(e.$t(`app.command`)),1),u(x(W),{modelValue:C.value,"onUpdate:modelValue":_[15]||=e=>C.value=e,size:`small`,placeholder:`pdf2markdown`},null,8,[`modelValue`])]),d(`div`,Yn,[d(`label`,Xn,F(e.$t(`app.arguments`)),1),u(x(J),{modelValue:w.value,"onUpdate:modelValue":_[16]||=e=>w.value=e,rows:`4`,"auto-resize":``,class:`text-xs font-mono`,placeholder:`-i
|
|
246
255
|
{input}
|
|
247
256
|
-o
|
|
248
|
-
{outputDir}/{basename}.md`},null,8,[`modelValue`])]),d(`div`,
|
|
249
|
-
|
|
250
|
-
{schema}
|
|
251
|
-
|
|
252
|
-
Extraction requirements:
|
|
253
|
-
1. Extract data strictly according to the field names and types defined in the structure
|
|
254
|
-
2. If a field's information is missing from the text, set that field to null
|
|
255
|
-
3. Do not add fields that are not in the structure definition
|
|
256
|
-
4. Maintain data accuracy and completeness`,Ur=`Please extract data from the following text:
|
|
257
|
-
{text}`,Wr=e({__name:`AISettings`,props:o({schemas:{},embedded:{type:Boolean,default:!1}},{visible:{type:Boolean,default:!1},visibleModifiers:{}}),emits:[`update:visible`],setup(e){let t=e,r=_(e,`visible`),{t:i}=ee(),o=C(!1),s=C(!1),c=C(`provider`),l=N(()=>c.value===`documents`?i(`app.settingsDocuments`):c.value===`integrations`?i(`app.settingsIntegrations`):c.value===`prompts`?i(`app.settingsPrompts`):i(`app.settingsProvider`)),h=N(()=>[{key:`provider`,label:i(`app.settingsProvider`),icon:`pi pi-server`},{key:`documents`,label:i(`app.settingsDocuments`),icon:`pi pi-file`},{key:`integrations`,label:i(`app.settingsIntegrations`),icon:`pi pi-send`},{key:`prompts`,label:i(`app.settingsPrompts`),icon:`pi pi-comment`}]),g=C(``),v=C(``),b=C(300),S=C([]),w=C(``),T=C(``),E=C(`unpdf`),O=C(!1),A=C(`eng`),j=C(``),P=C(``),I=C(`mineru`),L=C(`-p
|
|
257
|
+
{outputDir}/{basename}.md`},null,8,[`modelValue`])]),d(`div`,Zn,[d(`label`,Qn,F(e.$t(`app.timeoutLabel`)),1),u(x(W),{value:String(T.value),type:`number`,size:`small`,placeholder:`600`,min:1,onInput:_[17]||=e=>T.value=Number(e.target.value)||600},null,8,[`value`])]),d(`div`,$n,[r(F(e.$t(`app.placeholders`))+`: `,1),_[23]||=d(`code`,{class:`bg-secondary px-1 rounded`},`{input}`,-1),_[24]||=r(`, `,-1),_[25]||=d(`code`,{class:`bg-secondary px-1 rounded`},`{outputDir}`,-1),_[26]||=r(`, `,-1),_[27]||=d(`code`,{class:`bg-secondary px-1 rounded`},`{basename}`,-1),r(`. `+F(e.$t(`app.externalHint`)),1)])])):M(``,!0)])])]))}}),tr={class:`space-y-6`},nr={class:`text-sm font-semibold mb-3 text-foreground`},rr={class:`space-y-3`},ir={class:`flex flex-col gap-1`},ar={class:`text-xs text-muted-foreground`},or={key:0,class:`text-xs text-red-500 mt-1`},sr={class:`flex flex-col gap-1`},cr={class:`text-xs text-muted-foreground`},lr={key:0,class:`text-xs text-red-500 mt-1`},ur={class:`text-xs text-muted-foreground p-2 rounded border border-border`},dr=e({__name:`PromptSettings`,props:{systemTemplate:{required:!0},systemTemplateModifiers:{},userTemplate:{required:!0},userTemplateModifiers:{}},emits:[`update:systemTemplate`,`update:userTemplate`],setup(e,{expose:t}){let n=_(e,`systemTemplate`),r=_(e,`userTemplate`),{t:i}=ee(),a=N(()=>n.value.includes(`{schema}`)?``:i(`app.systemPromptValidation`)),o=N(()=>r.value.includes(`{text}`)?``:i(`app.userPromptValidation`));return t({systemSchemaError:a,userSchemaError:o}),(e,t)=>(p(),f(`div`,tr,[d(`section`,null,[d(`h3`,nr,F(e.$t(`app.promptTemplates`)),1),d(`div`,rr,[d(`div`,ir,[d(`label`,ar,F(e.$t(`app.systemPrompt`)),1),u(x(J),{modelValue:n.value,"onUpdate:modelValue":t[0]||=e=>n.value=e,rows:`6`,"auto-resize":``,class:`text-xs font-mono`},null,8,[`modelValue`]),a.value?(p(),f(`p`,or,F(a.value),1)):M(``,!0)]),d(`div`,sr,[d(`label`,cr,F(e.$t(`app.userPromptTemplate`)),1),u(x(J),{modelValue:r.value,"onUpdate:modelValue":t[1]||=e=>r.value=e,rows:`6`,"auto-resize":``,class:`text-xs font-mono`},null,8,[`modelValue`]),o.value?(p(),f(`p`,lr,F(o.value),1)):M(``,!0)]),d(`div`,ur,F(e.$t(`app.promptPlaceholderHint`)),1)])])]))}}),fr={class:`space-y-6`},pr={class:`text-sm font-semibold mb-3 text-foreground`},mr={class:`space-y-3`},hr={class:`flex flex-col gap-1`},gr={class:`text-xs text-muted-foreground`},_r={class:`flex flex-col gap-1`},vr={class:`text-xs text-muted-foreground`},yr={class:`flex flex-col gap-1`},br={class:`text-xs text-muted-foreground`},xr={class:`text-sm font-semibold mb-3 text-foreground`},Sr={class:`space-y-2`},Cr={class:`text-sm font-mono flex-1`},wr={key:0,class:`flex flex-col gap-2 px-3 py-2 rounded border border-border bg-card`},Tr={class:`flex items-center gap-2`},Er={class:`flex items-center gap-4 text-xs`},Dr={class:`flex items-center gap-1.5 cursor-pointer`},Or={class:`flex items-center gap-1.5 cursor-pointer`},kr={key:0,class:`text-muted-foreground ml-auto`},Ar=e({__name:`ProviderSettings`,props:{baseURL:{required:!0},baseURLModifiers:{},apiKey:{required:!0},apiKeyModifiers:{},timeout:{required:!0},timeoutModifiers:{},models:{required:!0},modelsModifiers:{}},emits:[`update:baseURL`,`update:apiKey`,`update:timeout`,`update:models`],setup(e){let t=_(e,`baseURL`),i=_(e,`apiKey`),a=_(e,`timeout`),o=_(e,`models`),s=C(!1),l=C(``),m=C({vision:!1,structuredOutput:!1}),g=C(`manual`);function v(){g.value=`manual`,m.value={vision:!1,structuredOutput:!1},l.value&&V(l.value).then(e=>{e&&(m.value={...e},g.value=`registry`)})}function b(){l.value&&(o.value.push({name:l.value,capabilities:{...m.value}}),ee())}function S(){ee()}function ee(){l.value=``,m.value={vision:!1,structuredOutput:!1},g.value=`manual`,s.value=!1}function w(e){o.value.splice(e,1)}return(e,_)=>(p(),f(`div`,fr,[d(`section`,null,[d(`h3`,pr,F(e.$t(`app.provider`)),1),d(`div`,mr,[d(`div`,hr,[d(`label`,gr,F(e.$t(`app.baseUrl`)),1),u(x(W),{modelValue:t.value,"onUpdate:modelValue":_[0]||=e=>t.value=e,size:`small`,placeholder:`https://dashscope.aliyuncs.com/compatible-mode/v1`},null,8,[`modelValue`])]),d(`div`,_r,[d(`label`,vr,F(e.$t(`app.apiKey`)),1),u(x(it),{modelValue:i.value,"onUpdate:modelValue":_[1]||=e=>i.value=e,feedback:!1,"toggle-mask":``,size:`small`,placeholder:`sk-xxx`,"input-class":`w-full`},null,8,[`modelValue`])]),d(`div`,yr,[d(`label`,br,F(e.$t(`app.timeoutLabel`)),1),u(x(W),{value:String(a.value),type:`number`,size:`small`,placeholder:`300`,min:1,onInput:_[2]||=e=>a.value=Number(e.target.value)||300},null,8,[`value`])])])]),d(`section`,null,[d(`h3`,xr,F(e.$t(`app.models`)),1),d(`div`,Sr,[(p(!0),f(P,null,c(o.value,(t,n)=>(p(),f(`div`,{key:n,class:`flex items-center gap-2 px-3 py-2 rounded border border-border bg-card`},[d(`code`,Cr,F(t.name),1),d(`span`,{class:y([`inline-flex items-center gap-1 text-xs px-1.5 py-0.5 rounded`,t.capabilities.structuredOutput?`bg-green-500/10 text-green-600`:`bg-yellow-500/10 text-yellow-600`])},[d(`i`,{class:y([t.capabilities.structuredOutput?`pi pi-check-circle`:`pi pi-exclamation-triangle`,`text-[10px]`])},null,2),r(` `+F(t.capabilities.structuredOutput?e.$t(`app.structuredOutput`):e.$t(`app.textOnlyOutput`)),1)],2),d(`span`,{class:y([`inline-flex items-center gap-1 text-xs px-1.5 py-0.5 rounded`,t.capabilities.vision?`bg-green-500/10 text-green-600`:`bg-red-500/10 text-red-600`])},[d(`i`,{class:y([t.capabilities.vision?`pi pi-check-circle`:`pi pi-times-circle`,`text-[10px]`])},null,2),r(` `+F(t.capabilities.vision?e.$t(`app.visionSupported`):e.$t(`app.visionUnsupported`)),1)],2),u(x(D),{icon:`pi pi-times`,severity:`danger`,text:``,size:`small`,onClick:e=>w(n)},null,8,[`onClick`])]))),128)),s.value?(p(),f(`div`,wr,[d(`div`,Tr,[u(x(W),{modelValue:l.value,"onUpdate:modelValue":_[3]||=e=>l.value=e,size:`small`,placeholder:e.$t(`app.modelName`),class:`flex-1 font-mono`,onInput:v,onKeyup:h(b,[`enter`])},null,8,[`modelValue`,`placeholder`]),u(x(D),{icon:`pi pi-check`,severity:`success`,text:``,size:`small`,disabled:!l.value,onClick:b},null,8,[`disabled`]),u(x(D),{icon:`pi pi-times`,severity:`secondary`,text:``,size:`small`,onClick:S})]),d(`div`,Er,[d(`label`,Dr,[u(x($),{modelValue:m.value.structuredOutput,"onUpdate:modelValue":_[4]||=e=>m.value.structuredOutput=e,binary:!0,"input-id":`add-so`},null,8,[`modelValue`]),d(`span`,{class:y(m.value.structuredOutput?`text-green-600`:`text-muted-foreground`)},F(e.$t(`app.structuredOutput`)),3)]),d(`label`,Or,[u(x($),{modelValue:m.value.vision,"onUpdate:modelValue":_[5]||=e=>m.value.vision=e,binary:!0,"input-id":`add-vision`},null,8,[`modelValue`]),d(`span`,{class:y(m.value.vision?`text-green-600`:`text-muted-foreground`)},F(e.$t(`app.visionSupported`)),3)]),g.value===`registry`?(p(),f(`span`,kr,[_[7]||=d(`i`,{class:`pi pi-database mr-0.5`},null,-1),r(F(e.$t(`app.modelCapsRegistry`)),1)])):M(``,!0)])])):(p(),n(x(D),{key:1,label:e.$t(`app.addModel`),icon:`pi pi-plus`,severity:`secondary`,text:``,size:`small`,onClick:_[6]||=e=>s.value=!0},null,8,[`label`]))])])]))}}),jr={key:0,class:`flex items-center justify-center py-8`},Mr={class:`border-b border-border p-4`},Nr={class:`m-0 text-lg font-semibold text-foreground`},Pr={class:`mt-1 text-xs text-muted-foreground`},Fr={class:`flex items-center justify-between gap-3 border-b border-border bg-card p-4`},Ir={class:`m-0 text-lg font-semibold text-foreground`},Lr={"data-anchor-section":`provider`},Rr={"data-anchor-section":`documents`},zr={"data-anchor-section":`integrations`},Br={"data-anchor-section":`prompts`},Vr={key:2,class:`space-y-6`},Hr={key:3,class:`mt-6 flex justify-end gap-2`},Ur=e({__name:`AISettings`,props:o({schemas:{},embedded:{type:Boolean,default:!1}},{visible:{type:Boolean,default:!1},visibleModifiers:{}}),emits:[`update:visible`],setup(e){let t=e,r=_(e,`visible`),{t:i}=ee(),o=C(!1),s=C(!1),c=C(`provider`),l=N(()=>c.value===`documents`?i(`app.settingsDocuments`):c.value===`integrations`?i(`app.settingsIntegrations`):c.value===`prompts`?i(`app.settingsPrompts`):i(`app.settingsProvider`)),h=N(()=>[{key:`provider`,label:i(`app.settingsProvider`),icon:`pi pi-server`},{key:`documents`,label:i(`app.settingsDocuments`),icon:`pi pi-file`},{key:`integrations`,label:i(`app.settingsIntegrations`),icon:`pi pi-send`},{key:`prompts`,label:i(`app.settingsPrompts`),icon:`pi pi-comment`}]),g=C(``),v=C(``),b=C(300),S=C([]),w=C(``),T=C(``),E=C(`unpdf`),O=C(!1),A=C(`eng`),j=C(``),P=C(``),I=C(`mineru`),L=C(`-p
|
|
258
258
|
{input}
|
|
259
259
|
-o
|
|
260
|
-
{outputDir}`),R=C(600),z=C(!0),B=C(``),ae=C(`https://mineru.net/api/v4`),V=C(`vlm`),
|
|
261
|
-
`),R.value=e.pdf?.mineru?.timeout??600,z.value=e.pdf?.mineru?.fallbackToUnpdf??!0,
|
|
262
|
-
`),
|
|
263
|
-
`).map(e=>e.trim()).filter(Boolean),timeout:R.value,fallbackToUnpdf:z.value}:void 0,mineruApi:{token:B.value.trim(),baseURL:ae.value.trim()||void 0,modelVersion:V.value.trim()||void 0,isOcr:
|
|
264
|
-
`).map(e=>e.trim()).filter(Boolean),timeout:
|
|
260
|
+
{outputDir}`),R=C(600),z=C(!0),B=C(``),ae=C(`https://mineru.net/api/v4`),V=C(`vlm`),se=C(!0),U=C(!0),W=C(!0),G=C(``),K=C(``),q=C(600),J=C(!1),Y=C(``),le=C(``),ue=C(``),de=C(!1),fe=C(``),pe=C(``),X=C(!1),Z=C(``),he=C({}),ge=C(``),_e=C(``),ve=C(``),ye=C(``),be=C([]),xe=C([]),Se=C(!1),Q=C(null),Ce=C(null),we=N(()=>{let e=Q.value?.systemSchemaError||``,t=Q.value?.userSchemaError||``,n=Ce.value?.notionFieldMapError||``;return!e&&!t&&!n&&!o.value&&S.value.length>0&&(!X.value||!!Z.value.trim())&&(E.value!==`mineru`||!!I.value.trim())&&(E.value!==`mineru_api`||!!B.value.trim())&&(E.value!==`external`||!!G.value.trim())}),Te=ce.systemTemplate,Ee=ce.userTemplate;async function De(){o.value=!0;try{let e=await ie();g.value=e.provider?.baseURL??``,v.value=e.provider?.apiKey??``,b.value=e.provider?.timeout??300,S.value=e.provider?.models??[],w.value=e.prompt?.systemTemplate??Te,T.value=e.prompt?.userTemplate??Ee,E.value=oe.includes(e.pdf?.converter)?e.pdf?.converter:`unpdf`,O.value=e.pdf?.liteparse?.ocrEnabled??!1,A.value=e.pdf?.liteparse?.ocrLanguage??`eng`,j.value=e.pdf?.liteparse?.tessdataPath??``,P.value=e.pdf?.liteparse?.ocrServerUrl??``,B.value=e.pdf?.mineruApi?.token??``,ae.value=e.pdf?.mineruApi?.baseURL??`https://mineru.net/api/v4`,V.value=e.pdf?.mineruApi?.modelVersion??`vlm`,se.value=e.pdf?.mineruApi?.isOcr??!0,U.value=e.pdf?.mineruApi?.enableFormula??!0,W.value=e.pdf?.mineruApi?.enableTable??!0,I.value=e.pdf?.mineru?.command??`mineru`,L.value=(e.pdf?.mineru?.args??[`-p`,`{input}`,`-o`,`{outputDir}`]).join(`
|
|
261
|
+
`),R.value=e.pdf?.mineru?.timeout??600,z.value=e.pdf?.mineru?.fallbackToUnpdf??!0,G.value=e.pdf?.external?.command??``,K.value=(e.pdf?.external?.args??[]).join(`
|
|
262
|
+
`),q.value=e.pdf?.external?.timeout??600,J.value=!!e.langfuse,Y.value=e.langfuse?.publicKey??``,le.value=e.langfuse?.secretKey??``,ue.value=e.langfuse?.host??``,de.value=!!e.webhook?.enabled,fe.value=e.webhook?.url??``,pe.value=e.webhook?.secret??``,X.value=!!e.notion?.enabled,Z.value=e.notion?.token??``,he.value=e.notion?.schemas??{},await Ce.value?.loadSelectedNotionSchemaFields()}catch{v.value=``,S.value=[],w.value=Te,T.value=Ee}finally{o.value=!1}}async function Oe(){if(we.value){s.value=!0;try{Ce.value?.persistSelectedNotionSchema(),await re({provider:{baseURL:g.value,apiKey:v.value,timeout:b.value,models:S.value},prompt:{systemTemplate:w.value,userTemplate:T.value},extraction:{outputDir:`.aiex/extracted`},pdf:{converter:E.value,liteparse:{ocrEnabled:O.value,ocrLanguage:A.value.trim()||`eng`,tessdataPath:j.value.trim()||void 0,ocrServerUrl:P.value.trim()||void 0},mineru:I.value.trim()?{command:I.value,args:L.value.split(`
|
|
263
|
+
`).map(e=>e.trim()).filter(Boolean),timeout:R.value,fallbackToUnpdf:z.value}:void 0,mineruApi:{token:B.value.trim(),baseURL:ae.value.trim()||void 0,modelVersion:V.value.trim()||void 0,isOcr:se.value,enableFormula:U.value,enableTable:W.value},external:G.value.trim()?{command:G.value,args:K.value.split(`
|
|
264
|
+
`).map(e=>e.trim()).filter(Boolean),timeout:q.value}:void 0},langfuse:J.value?{publicKey:Y.value,secretKey:le.value,host:ue.value||void 0}:void 0,notion:{enabled:X.value,token:Z.value,schemas:he.value},webhook:{enabled:de.value,url:fe.value.trim(),secret:pe.value.trim()||void 0}}),t.embedded||(r.value=!1),H.success(i(`app.settingsSaved`))}catch(e){H.error(e.message||i(`app.toastSaveFailed`))}finally{s.value=!1}}}return a(()=>{De()}),(t,i)=>(p(),n(m(e.embedded?`section`:x(ne)),{visible:r.value,"onUpdate:visible":i[84]||=e=>r.value=e,modal:``,header:t.$t(`app.aiSettings`),style:te(e.embedded?void 0:{width:`680px`}),draggable:!1,class:y(e.embedded?`flex h-full min-h-0 flex-col bg-background`:void 0)},{default:k(()=>[o.value?(p(),f(`div`,jr,[...i[85]||=[d(`i`,{class:`pi pi-spin pi-spinner text-xl`},null,-1)]])):e.embedded?(p(),n(me,{key:1,"active-key":c.value,"onUpdate:activeKey":i[41]||=e=>c.value=e,anchors:h.value},{"sidebar-header":k(()=>[d(`div`,Mr,[d(`h2`,Nr,F(t.$t(`app.settings`)),1),d(`p`,Pr,F(t.$t(`app.settingsSubtitle`)),1)])]),header:k(()=>[d(`div`,Fr,[d(`h2`,Ir,F(l.value),1),u(x(D),{label:t.$t(`app.save`),icon:`pi pi-check`,loading:s.value,disabled:!we.value,size:`small`,onClick:Oe},null,8,[`label`,`loading`,`disabled`])])]),default:k(()=>[d(`section`,Lr,[u(Ar,{"base-u-r-l":g.value,"onUpdate:baseURL":i[0]||=e=>g.value=e,"api-key":v.value,"onUpdate:apiKey":i[1]||=e=>v.value=e,timeout:b.value,"onUpdate:timeout":i[2]||=e=>b.value=e,models:S.value,"onUpdate:models":i[3]||=e=>S.value=e},null,8,[`base-u-r-l`,`api-key`,`timeout`,`models`])]),d(`section`,Rr,[u(er,{"pdf-converter":E.value,"onUpdate:pdfConverter":i[4]||=e=>E.value=e,"liteparse-ocr-enabled":O.value,"onUpdate:liteparseOcrEnabled":i[5]||=e=>O.value=e,"liteparse-ocr-language":A.value,"onUpdate:liteparseOcrLanguage":i[6]||=e=>A.value=e,"liteparse-tessdata-path":j.value,"onUpdate:liteparseTessdataPath":i[7]||=e=>j.value=e,"liteparse-ocr-server-url":P.value,"onUpdate:liteparseOcrServerUrl":i[8]||=e=>P.value=e,"mineru-command":I.value,"onUpdate:mineruCommand":i[9]||=e=>I.value=e,"mineru-args":L.value,"onUpdate:mineruArgs":i[10]||=e=>L.value=e,"mineru-timeout":R.value,"onUpdate:mineruTimeout":i[11]||=e=>R.value=e,"mineru-fallback-to-unpdf":z.value,"onUpdate:mineruFallbackToUnpdf":i[12]||=e=>z.value=e,"mineru-api-token":B.value,"onUpdate:mineruApiToken":i[13]||=e=>B.value=e,"mineru-api-base-url":ae.value,"onUpdate:mineruApiBaseUrl":i[14]||=e=>ae.value=e,"mineru-api-model":V.value,"onUpdate:mineruApiModel":i[15]||=e=>V.value=e,"mineru-api-is-ocr":se.value,"onUpdate:mineruApiIsOcr":i[16]||=e=>se.value=e,"mineru-api-enable-formula":U.value,"onUpdate:mineruApiEnableFormula":i[17]||=e=>U.value=e,"mineru-api-enable-table":W.value,"onUpdate:mineruApiEnableTable":i[18]||=e=>W.value=e,"external-command":G.value,"onUpdate:externalCommand":i[19]||=e=>G.value=e,"external-args":K.value,"onUpdate:externalArgs":i[20]||=e=>K.value=e,"external-timeout":q.value,"onUpdate:externalTimeout":i[21]||=e=>q.value=e},null,8,[`pdf-converter`,`liteparse-ocr-enabled`,`liteparse-ocr-language`,`liteparse-tessdata-path`,`liteparse-ocr-server-url`,`mineru-command`,`mineru-args`,`mineru-timeout`,`mineru-fallback-to-unpdf`,`mineru-api-token`,`mineru-api-base-url`,`mineru-api-model`,`mineru-api-is-ocr`,`mineru-api-enable-formula`,`mineru-api-enable-table`,`external-command`,`external-args`,`external-timeout`])]),d(`section`,zr,[u(sn,{ref_key:`integrationSettingsRef`,ref:Ce,schemas:e.schemas,"langfuse-enabled":J.value,"onUpdate:langfuseEnabled":i[22]||=e=>J.value=e,"langfuse-public-key":Y.value,"onUpdate:langfusePublicKey":i[23]||=e=>Y.value=e,"langfuse-secret-key":le.value,"onUpdate:langfuseSecretKey":i[24]||=e=>le.value=e,"langfuse-host":ue.value,"onUpdate:langfuseHost":i[25]||=e=>ue.value=e,"webhook-enabled":de.value,"onUpdate:webhookEnabled":i[26]||=e=>de.value=e,"webhook-url":fe.value,"onUpdate:webhookUrl":i[27]||=e=>fe.value=e,"webhook-secret":pe.value,"onUpdate:webhookSecret":i[28]||=e=>pe.value=e,"notion-enabled":X.value,"onUpdate:notionEnabled":i[29]||=e=>X.value=e,"notion-token":Z.value,"onUpdate:notionToken":i[30]||=e=>Z.value=e,"notion-schemas":he.value,"onUpdate:notionSchemas":i[31]||=e=>he.value=e,"selected-notion-schema":ge.value,"onUpdate:selectedNotionSchema":i[32]||=e=>ge.value=e,"notion-database-id":_e.value,"onUpdate:notionDatabaseId":i[33]||=e=>_e.value=e,"notion-title-property":ve.value,"onUpdate:notionTitleProperty":i[34]||=e=>ve.value=e,"notion-field-map":ye.value,"onUpdate:notionFieldMap":i[35]||=e=>ye.value=e,"notion-properties":be.value,"onUpdate:notionProperties":i[36]||=e=>be.value=e,"notion-schema-fields":xe.value,"onUpdate:notionSchemaFields":i[37]||=e=>xe.value=e,"notion-advanced-open":Se.value,"onUpdate:notionAdvancedOpen":i[38]||=e=>Se.value=e},null,8,[`schemas`,`langfuse-enabled`,`langfuse-public-key`,`langfuse-secret-key`,`langfuse-host`,`webhook-enabled`,`webhook-url`,`webhook-secret`,`notion-enabled`,`notion-token`,`notion-schemas`,`selected-notion-schema`,`notion-database-id`,`notion-title-property`,`notion-field-map`,`notion-properties`,`notion-schema-fields`,`notion-advanced-open`])]),d(`section`,Br,[u(dr,{ref_key:`promptSettingsRef`,ref:Q,"system-template":w.value,"onUpdate:systemTemplate":i[39]||=e=>w.value=e,"user-template":T.value,"onUpdate:userTemplate":i[40]||=e=>T.value=e},null,8,[`system-template`,`user-template`])])]),_:1},8,[`active-key`,`anchors`])):(p(),f(`div`,Vr,[u(Ar,{"base-u-r-l":g.value,"onUpdate:baseURL":i[42]||=e=>g.value=e,"api-key":v.value,"onUpdate:apiKey":i[43]||=e=>v.value=e,timeout:b.value,"onUpdate:timeout":i[44]||=e=>b.value=e,models:S.value,"onUpdate:models":i[45]||=e=>S.value=e},null,8,[`base-u-r-l`,`api-key`,`timeout`,`models`]),u(er,{"pdf-converter":E.value,"onUpdate:pdfConverter":i[46]||=e=>E.value=e,"liteparse-ocr-enabled":O.value,"onUpdate:liteparseOcrEnabled":i[47]||=e=>O.value=e,"liteparse-ocr-language":A.value,"onUpdate:liteparseOcrLanguage":i[48]||=e=>A.value=e,"liteparse-tessdata-path":j.value,"onUpdate:liteparseTessdataPath":i[49]||=e=>j.value=e,"liteparse-ocr-server-url":P.value,"onUpdate:liteparseOcrServerUrl":i[50]||=e=>P.value=e,"mineru-command":I.value,"onUpdate:mineruCommand":i[51]||=e=>I.value=e,"mineru-args":L.value,"onUpdate:mineruArgs":i[52]||=e=>L.value=e,"mineru-timeout":R.value,"onUpdate:mineruTimeout":i[53]||=e=>R.value=e,"mineru-fallback-to-unpdf":z.value,"onUpdate:mineruFallbackToUnpdf":i[54]||=e=>z.value=e,"mineru-api-token":B.value,"onUpdate:mineruApiToken":i[55]||=e=>B.value=e,"mineru-api-base-url":ae.value,"onUpdate:mineruApiBaseUrl":i[56]||=e=>ae.value=e,"mineru-api-model":V.value,"onUpdate:mineruApiModel":i[57]||=e=>V.value=e,"mineru-api-is-ocr":se.value,"onUpdate:mineruApiIsOcr":i[58]||=e=>se.value=e,"mineru-api-enable-formula":U.value,"onUpdate:mineruApiEnableFormula":i[59]||=e=>U.value=e,"mineru-api-enable-table":W.value,"onUpdate:mineruApiEnableTable":i[60]||=e=>W.value=e,"external-command":G.value,"onUpdate:externalCommand":i[61]||=e=>G.value=e,"external-args":K.value,"onUpdate:externalArgs":i[62]||=e=>K.value=e,"external-timeout":q.value,"onUpdate:externalTimeout":i[63]||=e=>q.value=e},null,8,[`pdf-converter`,`liteparse-ocr-enabled`,`liteparse-ocr-language`,`liteparse-tessdata-path`,`liteparse-ocr-server-url`,`mineru-command`,`mineru-args`,`mineru-timeout`,`mineru-fallback-to-unpdf`,`mineru-api-token`,`mineru-api-base-url`,`mineru-api-model`,`mineru-api-is-ocr`,`mineru-api-enable-formula`,`mineru-api-enable-table`,`external-command`,`external-args`,`external-timeout`]),u(sn,{ref_key:`integrationSettingsRef`,ref:Ce,schemas:e.schemas,"langfuse-enabled":J.value,"onUpdate:langfuseEnabled":i[64]||=e=>J.value=e,"langfuse-public-key":Y.value,"onUpdate:langfusePublicKey":i[65]||=e=>Y.value=e,"langfuse-secret-key":le.value,"onUpdate:langfuseSecretKey":i[66]||=e=>le.value=e,"langfuse-host":ue.value,"onUpdate:langfuseHost":i[67]||=e=>ue.value=e,"webhook-enabled":de.value,"onUpdate:webhookEnabled":i[68]||=e=>de.value=e,"webhook-url":fe.value,"onUpdate:webhookUrl":i[69]||=e=>fe.value=e,"webhook-secret":pe.value,"onUpdate:webhookSecret":i[70]||=e=>pe.value=e,"notion-enabled":X.value,"onUpdate:notionEnabled":i[71]||=e=>X.value=e,"notion-token":Z.value,"onUpdate:notionToken":i[72]||=e=>Z.value=e,"notion-schemas":he.value,"onUpdate:notionSchemas":i[73]||=e=>he.value=e,"selected-notion-schema":ge.value,"onUpdate:selectedNotionSchema":i[74]||=e=>ge.value=e,"notion-database-id":_e.value,"onUpdate:notionDatabaseId":i[75]||=e=>_e.value=e,"notion-title-property":ve.value,"onUpdate:notionTitleProperty":i[76]||=e=>ve.value=e,"notion-field-map":ye.value,"onUpdate:notionFieldMap":i[77]||=e=>ye.value=e,"notion-properties":be.value,"onUpdate:notionProperties":i[78]||=e=>be.value=e,"notion-schema-fields":xe.value,"onUpdate:notionSchemaFields":i[79]||=e=>xe.value=e,"notion-advanced-open":Se.value,"onUpdate:notionAdvancedOpen":i[80]||=e=>Se.value=e},null,8,[`schemas`,`langfuse-enabled`,`langfuse-public-key`,`langfuse-secret-key`,`langfuse-host`,`webhook-enabled`,`webhook-url`,`webhook-secret`,`notion-enabled`,`notion-token`,`notion-schemas`,`selected-notion-schema`,`notion-database-id`,`notion-title-property`,`notion-field-map`,`notion-properties`,`notion-schema-fields`,`notion-advanced-open`]),u(dr,{ref_key:`promptSettingsRef`,ref:Q,"system-template":w.value,"onUpdate:systemTemplate":i[81]||=e=>w.value=e,"user-template":T.value,"onUpdate:userTemplate":i[82]||=e=>T.value=e},null,8,[`system-template`,`user-template`])])),e.embedded?M(``,!0):(p(),f(`div`,Hr,[u(x(D),{label:t.$t(`app.cancel`),severity:`secondary`,text:``,onClick:i[83]||=e=>r.value=!1},null,8,[`label`]),u(x(D),{label:t.$t(`app.save`),icon:`pi pi-check`,loading:s.value,disabled:!we.value,onClick:Oe},null,8,[`label`,`loading`,`disabled`])]))]),_:1},40,[`visible`,`header`,`style`,`class`]))}});export{Ur as default};
|