aiex-cli 0.0.1-beta.5 → 0.0.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/README.md +2 -2
- package/dist/cli.mjs +198 -311
- package/dist/core/schema-sqlite/migrate-helper.mjs +14 -5
- package/dist/{doctor-Cd_N16iC.mjs → doctor-BTfByg-I.mjs} +2 -2
- package/dist/index.mjs +1 -1
- package/dist/web/assets/AISettings-D_AFhorO.js +334 -0
- package/dist/web/assets/DataBrowser-DZT0kGQE.css +1 -0
- package/dist/web/assets/DataBrowser-rznfVRaV.js +3 -0
- package/dist/web/assets/JsonSchemaEditor-C9iyQs7N.js +929 -0
- package/dist/web/assets/api-client-Dsg4WOM9.js +1 -0
- package/dist/web/assets/button-kTMweGMc.js +927 -0
- package/dist/web/assets/chunk-DtRyYLXJ.js +1 -0
- package/dist/web/assets/{cssMode-BloHqzZF.js → cssMode-DAbG0CMn.js} +1 -1
- package/dist/web/assets/dialog-CWuu7WjI.js +108 -0
- package/dist/web/assets/{editor.api-BG499EJF.js → editor.api-DLXGyrN1.js} +1 -1
- package/dist/web/assets/{editor.main-BhEWG0_P.js → editor.main-BqhfoHxy.js} +2 -2
- package/dist/web/assets/{freemarker2-DOHaFATh.js → freemarker2-B9_5ct2b.js} +1 -1
- package/dist/web/assets/{handlebars-BIFWety9.js → handlebars-TY59WcoQ.js} +1 -1
- package/dist/web/assets/{html-YGaqGZNd.js → html-CLULsh27.js} +1 -1
- package/dist/web/assets/{htmlMode-Bu3PyHjq.js → htmlMode-BvG7RNbU.js} +1 -1
- package/dist/web/assets/index-BRvFRL-3.js +882 -0
- package/dist/web/assets/index-DDFnprdM.css +2 -0
- package/dist/web/assets/{javascript-N0gZqDK0.js → javascript-DHrLp6gu.js} +1 -1
- package/dist/web/assets/{jsonMode-z5YscjcG.js → jsonMode-DBDhdzl1.js} +1 -1
- package/dist/web/assets/lib-C30cIFrm.js +1 -0
- package/dist/web/assets/{liquid-BHfNNVLs.js → liquid-tGeb-nqF.js} +1 -1
- package/dist/web/assets/{mdx-Dqu2t0et.js → mdx-Cmdz78VU.js} +1 -1
- package/dist/web/assets/{monaco.contribution-ByQ3yI-W.js → monaco.contribution-CroYPUF5.js} +2 -2
- package/dist/web/assets/overlayeventbus-AtOpmI6n.js +80 -0
- package/dist/web/assets/{python-icfse9Ji.js → python-Dmfz4iDE.js} +1 -1
- package/dist/web/assets/{razor-DwVkryG9.js → razor-BJicZHJs.js} +1 -1
- package/dist/web/assets/table-schema-mJrrf9qw.js +2 -0
- package/dist/web/assets/{tsMode-CLrI3bdf.js → tsMode-DYqTyE66.js} +1 -1
- package/dist/web/assets/{typescript-BzuZVF7m.js → typescript-DLnTe9Hf.js} +1 -1
- package/dist/web/assets/{xml-Cr85kdqA.js → xml-BIYqLORk.js} +1 -1
- package/dist/web/assets/{yaml-D3RbJnnO.js → yaml-BjmulkMX.js} +1 -1
- package/dist/web/index.html +8 -4
- package/package.json +1 -1
- package/src/core/schema-sqlite/migrate-helper.ts +9 -4
- package/dist/web/assets/chunk-BEqpzyXh.js +0 -1
- package/dist/web/assets/index-DTABZIZZ.css +0 -2
- package/dist/web/assets/index-DVc9DeYI.js +0 -3266
- /package/dist/web/assets/{abap-Cry0R76c.js → abap-DrZwwXZX.js} +0 -0
- /package/dist/web/assets/{apex-xqbJ58nJ.js → apex-CrCz0btt.js} +0 -0
- /package/dist/web/assets/{azcli-D7JTNGKs.js → azcli-BapzKHay.js} +0 -0
- /package/dist/web/assets/{bat-Cuq6hn0K.js → bat-C_NRAiA1.js} +0 -0
- /package/dist/web/assets/{bicep-eTuQjz9F.js → bicep-C7pp2CNk.js} +0 -0
- /package/dist/web/assets/{cameligo-DKgCRl36.js → cameligo-BhhK9vxZ.js} +0 -0
- /package/dist/web/assets/{clojure-B_aTBtVh.js → clojure-D0ujmUyE.js} +0 -0
- /package/dist/web/assets/{coffee-BWAYpIPu.js → coffee-DHEl7Jbb.js} +0 -0
- /package/dist/web/assets/{cpp-BduBQE8d.js → cpp-Iil-3nzZ.js} +0 -0
- /package/dist/web/assets/{csharp-CMqOVYKK.js → csharp-Dh0Ee7SY.js} +0 -0
- /package/dist/web/assets/{csp-6cGliXw2.js → csp-mwzjw0JL.js} +0 -0
- /package/dist/web/assets/{css-CHnKqS9Q.js → css-COIa8ZTR.js} +0 -0
- /package/dist/web/assets/{cypher-DMzZBj2L.js → cypher-GVc17FC4.js} +0 -0
- /package/dist/web/assets/{dart-7hYfJ1Dv.js → dart-phiCaE7_.js} +0 -0
- /package/dist/web/assets/{dockerfile-BflvjnJW.js → dockerfile-BMaDhdim.js} +0 -0
- /package/dist/web/assets/{ecl-BEt6xb2p.js → ecl-Cj47kvqp.js} +0 -0
- /package/dist/web/assets/{elixir-CnrQCt6o.js → elixir-DBbstcE1.js} +0 -0
- /package/dist/web/assets/{flow9-CfLCoUuB.js → flow9-ChHb1adO.js} +0 -0
- /package/dist/web/assets/{fsharp-BQqR9uQ6.js → fsharp-CMk2OIJN.js} +0 -0
- /package/dist/web/assets/{go-C3AlMVwy.js → go-BrMkuJg0.js} +0 -0
- /package/dist/web/assets/{graphql-O_-hDldf.js → graphql-PSR1UKGv.js} +0 -0
- /package/dist/web/assets/{hcl-BQQD6Mtj.js → hcl-DAQrbDOW.js} +0 -0
- /package/dist/web/assets/{ini-Bf0RDfP_.js → ini-0TG5BxW0.js} +0 -0
- /package/dist/web/assets/{java-nqX2KEDD.js → java-rgorz17v.js} +0 -0
- /package/dist/web/assets/{julia-B6P9U5er.js → julia-C8VMdHm8.js} +0 -0
- /package/dist/web/assets/{kotlin-B-LRk09-.js → kotlin-CllWo3gX.js} +0 -0
- /package/dist/web/assets/{less-CEaIdW1f.js → less-Cgca25AP.js} +0 -0
- /package/dist/web/assets/{lexon-Qv4pvFSW.js → lexon-D0GHdBaw.js} +0 -0
- /package/dist/web/assets/{lua-CFpyR7YN.js → lua-DmRsNG-P.js} +0 -0
- /package/dist/web/assets/{m3-CvKhVPQn.js → m3-BgL5dNKT.js} +0 -0
- /package/dist/web/assets/{markdown-qldG3Vc4.js → markdown-BuJfycGS.js} +0 -0
- /package/dist/web/assets/{mips-0D8PRyHq.js → mips-C9m_93PR.js} +0 -0
- /package/dist/web/assets/{msdax-DwZXSC5M.js → msdax-CpFHC9OI.js} +0 -0
- /package/dist/web/assets/{mysql-BWq85KY4.js → mysql-qFvltsqN.js} +0 -0
- /package/dist/web/assets/{objective-c-D653JUMG.js → objective-c-Bnmr858J.js} +0 -0
- /package/dist/web/assets/{pascal-rWjRDdnR.js → pascal-WP0_D5AO.js} +0 -0
- /package/dist/web/assets/{pascaligo-Db8EehaF.js → pascaligo-Blom4Rij.js} +0 -0
- /package/dist/web/assets/{perl-C68oq8-D.js → perl-B-vk8g64.js} +0 -0
- /package/dist/web/assets/{pgsql-BXeHe33s.js → pgsql-Cgvz6v67.js} +0 -0
- /package/dist/web/assets/{php-CDVsAbfl.js → php-8a3Lrw9m.js} +0 -0
- /package/dist/web/assets/{pla-DnryFT0q.js → pla-DuFqEZ8V.js} +0 -0
- /package/dist/web/assets/{postiats-CDg_4Ev-.js → postiats-DkLtSgkp.js} +0 -0
- /package/dist/web/assets/{powerquery-CWPi8ROz.js → powerquery-BJ1aNepW.js} +0 -0
- /package/dist/web/assets/{powershell-C5A0QX3-.js → powershell-rE98k687.js} +0 -0
- /package/dist/web/assets/{preload-helper-DSXbuxSR.js → preload-helper-DWTEM3RW.js} +0 -0
- /package/dist/web/assets/{protobuf-Cgt-BQbL.js → protobuf-CUheFacr.js} +0 -0
- /package/dist/web/assets/{pug-RPYJC9QB.js → pug-LDcAMD8w.js} +0 -0
- /package/dist/web/assets/{qsharp-BZ3S7fu_.js → qsharp-IHfqKOfK.js} +0 -0
- /package/dist/web/assets/{r-CN875f1X.js → r-D-QApv87.js} +0 -0
- /package/dist/web/assets/{redis-BLesvTwR.js → redis-SXdDyWR9.js} +0 -0
- /package/dist/web/assets/{redshift-Byf_0XqD.js → redshift-Y6lsCryn.js} +0 -0
- /package/dist/web/assets/{restructuredtext-DYg_6BiZ.js → restructuredtext-edObr9a8.js} +0 -0
- /package/dist/web/assets/{ruby-C4OkxbC-.js → ruby-CNnUfF-8.js} +0 -0
- /package/dist/web/assets/{rust-xAoaEFMh.js → rust-IHUZWzBr.js} +0 -0
- /package/dist/web/assets/{sb-C8dHOW_y.js → sb-DrUvY44N.js} +0 -0
- /package/dist/web/assets/{scala-Spx0wP1o.js → scala-B4hbXGLM.js} +0 -0
- /package/dist/web/assets/{scheme-D2mZlAUz.js → scheme-BGrd12j3.js} +0 -0
- /package/dist/web/assets/{scss-DDCn3Ylu.js → scss-x5G1ES4U.js} +0 -0
- /package/dist/web/assets/{shell-M6px0EWn.js → shell-DOehe2Y8.js} +0 -0
- /package/dist/web/assets/{solidity-DUWMJi-f.js → solidity-BeRvcwWV.js} +0 -0
- /package/dist/web/assets/{sophia-DwJbUG-2.js → sophia-DZbkUNjy.js} +0 -0
- /package/dist/web/assets/{sparql-ClQxbRPI.js → sparql-B7_oi5-h.js} +0 -0
- /package/dist/web/assets/{sql-BQdjW7Vy.js → sql-CTlsFWVE.js} +0 -0
- /package/dist/web/assets/{st-BpISyZ_v.js → st-DJVEJdPE.js} +0 -0
- /package/dist/web/assets/{swift-CMbl5gM4.js → swift-CwhT3fYa.js} +0 -0
- /package/dist/web/assets/{systemverilog-jx2Xs7uO.js → systemverilog-BQN63pkN.js} +0 -0
- /package/dist/web/assets/{tcl-GIGnfs89.js → tcl-DqwfpskA.js} +0 -0
- /package/dist/web/assets/{twig-Bc0mxc_m.js → twig-BiyenUgc.js} +0 -0
- /package/dist/web/assets/{typespec-CEioAsEm.js → typespec-CWOJribt.js} +0 -0
- /package/dist/web/assets/{vb-BPk67J-d.js → vb-Cq5F87m3.js} +0 -0
- /package/dist/web/assets/{wgsl-DOnyt8_J.js → wgsl-BAvW2lVr.js} +0 -0
|
@@ -6,6 +6,13 @@ import fs from "node:fs/promises";
|
|
|
6
6
|
import Database from "better-sqlite3";
|
|
7
7
|
import * as esbuild from "esbuild";
|
|
8
8
|
|
|
9
|
+
//#region src/core/schema-sqlite/migration-name.ts
|
|
10
|
+
function sanitizeMigrationName(name) {
|
|
11
|
+
if (!name) return void 0;
|
|
12
|
+
return name.trim().toLowerCase().replace(/[^a-z0-9_\s-]/g, "_").replace(/[\s-]+/g, "_").replace(/_+/g, "_").replace(/^_+|_+$/g, "") || void 0;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
9
16
|
//#region src/core/schema-sqlite/migrate-helper.ts
|
|
10
17
|
const require = createRequire(import.meta.url);
|
|
11
18
|
const __filename = fileURLToPath(import.meta.url);
|
|
@@ -64,7 +71,7 @@ async function loadPrevSnapshot(migrationsPath) {
|
|
|
64
71
|
return null;
|
|
65
72
|
}
|
|
66
73
|
}
|
|
67
|
-
async function saveSnapshot(migrationsPath, snapshot) {
|
|
74
|
+
async function saveSnapshot(migrationsPath, snapshot, migrationName) {
|
|
68
75
|
const metaPath = path.join(migrationsPath, "meta");
|
|
69
76
|
await fs.mkdir(metaPath, { recursive: true });
|
|
70
77
|
const journalPath = path.join(metaPath, "_journal.json");
|
|
@@ -79,7 +86,8 @@ async function saveSnapshot(migrationsPath, snapshot) {
|
|
|
79
86
|
};
|
|
80
87
|
}
|
|
81
88
|
const idx = journal.entries.length + 1;
|
|
82
|
-
const
|
|
89
|
+
const suffix = sanitizeMigrationName(migrationName) || snapshot.id.replace(/-/g, "_").substring(0, 8);
|
|
90
|
+
const tag = `${String(idx).padStart(4, "0")}_${suffix}`;
|
|
83
91
|
const snapshotPath = path.join(metaPath, `${tag}_snapshot.json`);
|
|
84
92
|
await fs.writeFile(snapshotPath, JSON.stringify(snapshot, null, 2));
|
|
85
93
|
journal.entries.push({
|
|
@@ -145,8 +153,9 @@ async function main() {
|
|
|
145
153
|
const schemaPath = args[0];
|
|
146
154
|
const migrationsPath = args[1];
|
|
147
155
|
const dbPath = args[2];
|
|
156
|
+
const migrationName = args[3];
|
|
148
157
|
if (!schemaPath || !migrationsPath || !dbPath) {
|
|
149
|
-
console.error("Usage: migrate-helper.ts <schemaPath> <migrationsPath> <dbPath>");
|
|
158
|
+
console.error("Usage: migrate-helper.ts <schemaPath> <migrationsPath> <dbPath> [migrationName]");
|
|
150
159
|
process.exit(1);
|
|
151
160
|
}
|
|
152
161
|
try {
|
|
@@ -165,7 +174,7 @@ async function main() {
|
|
|
165
174
|
return;
|
|
166
175
|
}
|
|
167
176
|
applyMigrationWithTransaction(dbPath, sqlStatements);
|
|
168
|
-
const tag = await saveSnapshot(migrationsPath, currentSnapshot);
|
|
177
|
+
const tag = await saveSnapshot(migrationsPath, currentSnapshot, migrationName);
|
|
169
178
|
await saveMigrationFile(migrationsPath, tag, sqlStatements);
|
|
170
179
|
console.log(JSON.stringify({
|
|
171
180
|
success: true,
|
|
@@ -184,7 +193,7 @@ async function main() {
|
|
|
184
193
|
process.exit(1);
|
|
185
194
|
}
|
|
186
195
|
}
|
|
187
|
-
main();
|
|
196
|
+
if (process.argv[1] && __filename === path.resolve(process.argv[1])) main();
|
|
188
197
|
|
|
189
198
|
//#endregion
|
|
190
199
|
export { };
|
|
@@ -103,7 +103,7 @@ function generateRelationDefinitions(relations, reverseRelations) {
|
|
|
103
103
|
if (needsMany) imports.push("many");
|
|
104
104
|
const importStr = imports.join(", ");
|
|
105
105
|
const relDefs = [];
|
|
106
|
-
for (const rel of childRels) relDefs.push(` ${rel.name}: one(${rel.toTable}, {\n fields: [${rel.fromColumn}],\n references: [
|
|
106
|
+
for (const rel of childRels) relDefs.push(` ${rel.name}: one(${rel.toTable}, {\n fields: [${rel.fromTable}.${rel.fromColumn}],\n references: [${rel.toTable}.${rel.toColumn}],\n })`);
|
|
107
107
|
for (const rel of parentRels) if (rel.type === "has-many") relDefs.push(` ${rel.name}: many(${rel.toTable})`);
|
|
108
108
|
else relDefs.push(` ${rel.name}: one(${rel.toTable})`);
|
|
109
109
|
definitions.push(`export const ${tableName}Relations = relations(${tableName}, ({ ${importStr} }) => ({\n${relDefs.join(",\n")}\n}))`);
|
|
@@ -411,7 +411,7 @@ function generateDrizzleConfig() {
|
|
|
411
411
|
//#endregion
|
|
412
412
|
//#region package.json
|
|
413
413
|
var name = "aiex-cli";
|
|
414
|
-
var version = "0.0.1-beta.
|
|
414
|
+
var version = "0.0.1-beta.6";
|
|
415
415
|
var description = "JSON Schema → SQLite with AI-powered data extraction";
|
|
416
416
|
var package_default = {
|
|
417
417
|
name,
|
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { C as doctorDiagnosticsTableRows, S as buildDoctorDiagnostics, _ as generateDrizzleConfig, g as createMigrationConfig, t as collectDoctorDiagnostics, v as JsonSchemaDefinitionSchema, w as formatDoctorDiagnosticsJson, x as generateDrizzleSchema, y as parseJsonSchema } from "./doctor-
|
|
1
|
+
import { C as doctorDiagnosticsTableRows, S as buildDoctorDiagnostics, _ as generateDrizzleConfig, g as createMigrationConfig, t as collectDoctorDiagnostics, v as JsonSchemaDefinitionSchema, w as formatDoctorDiagnosticsJson, x as generateDrizzleSchema, y as parseJsonSchema } from "./doctor-BTfByg-I.mjs";
|
|
2
2
|
|
|
3
3
|
export { JsonSchemaDefinitionSchema, buildDoctorDiagnostics, collectDoctorDiagnostics, createMigrationConfig, doctorDiagnosticsTableRows, formatDoctorDiagnosticsJson, generateDrizzleConfig, generateDrizzleSchema, parseJsonSchema };
|
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
import{B as e,D as t,Dt as n,Et as r,G as i,Ht as a,It as o,P as s,S as c,T as l,U as u,V as d,W as f,Z as ee,b as p,c as m,en as h,et as g,fn as _,ft as v,g as te,gt as y,i as b,l as x,ln as S,m as ne,pt as C,q as w,rn as T,st as E,t as D,v as O,w as k,x as A,y as j,z as re}from"./button-kTMweGMc.js";import{a as M,i as ie,n as N,r as P,t as ae}from"./dialog-CWuu7WjI.js";import{n as oe}from"./lib-C30cIFrm.js";import{c as se,n as ce,s as le}from"./api-client-Dsg4WOM9.js";import{a as F,n as I,r as L,t as ue}from"./overlayeventbus-AtOpmI6n.js";var R={name:`MinusIcon`,extends:b};function de(e){return he(e)||me(e)||pe(e)||fe()}function fe(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
2
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pe(e,t){if(e){if(typeof e==`string`)return z(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)?z(e,t):void 0}}function me(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function he(e){if(Array.isArray(e))return z(e)}function z(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 ge(e,t,n,r,i,a){return d(),c(`svg`,s({width:`14`,height:`14`,viewBox:`0 0 14 14`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},e.pti()),de(t[0]||=[j(`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)}R.render=ge;var _e=m.extend({name:`checkbox`,style:`
|
|
3
|
+
.p-checkbox {
|
|
4
|
+
position: relative;
|
|
5
|
+
display: inline-flex;
|
|
6
|
+
user-select: none;
|
|
7
|
+
vertical-align: bottom;
|
|
8
|
+
width: dt('checkbox.width');
|
|
9
|
+
height: dt('checkbox.height');
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.p-checkbox-input {
|
|
13
|
+
cursor: pointer;
|
|
14
|
+
appearance: none;
|
|
15
|
+
position: absolute;
|
|
16
|
+
inset-block-start: 0;
|
|
17
|
+
inset-inline-start: 0;
|
|
18
|
+
width: 100%;
|
|
19
|
+
height: 100%;
|
|
20
|
+
padding: 0;
|
|
21
|
+
margin: 0;
|
|
22
|
+
opacity: 0;
|
|
23
|
+
z-index: 1;
|
|
24
|
+
outline: 0 none;
|
|
25
|
+
border: 1px solid transparent;
|
|
26
|
+
border-radius: dt('checkbox.border.radius');
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.p-checkbox-box {
|
|
30
|
+
display: flex;
|
|
31
|
+
justify-content: center;
|
|
32
|
+
align-items: center;
|
|
33
|
+
border-radius: dt('checkbox.border.radius');
|
|
34
|
+
border: 1px solid dt('checkbox.border.color');
|
|
35
|
+
background: dt('checkbox.background');
|
|
36
|
+
width: dt('checkbox.width');
|
|
37
|
+
height: dt('checkbox.height');
|
|
38
|
+
transition:
|
|
39
|
+
background dt('checkbox.transition.duration'),
|
|
40
|
+
color dt('checkbox.transition.duration'),
|
|
41
|
+
border-color dt('checkbox.transition.duration'),
|
|
42
|
+
box-shadow dt('checkbox.transition.duration'),
|
|
43
|
+
outline-color dt('checkbox.transition.duration');
|
|
44
|
+
outline-color: transparent;
|
|
45
|
+
box-shadow: dt('checkbox.shadow');
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.p-checkbox-icon {
|
|
49
|
+
transition-duration: dt('checkbox.transition.duration');
|
|
50
|
+
color: dt('checkbox.icon.color');
|
|
51
|
+
font-size: dt('checkbox.icon.size');
|
|
52
|
+
width: dt('checkbox.icon.size');
|
|
53
|
+
height: dt('checkbox.icon.size');
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.p-checkbox:not(.p-disabled):has(.p-checkbox-input:hover) .p-checkbox-box {
|
|
57
|
+
border-color: dt('checkbox.hover.border.color');
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.p-checkbox-checked .p-checkbox-box {
|
|
61
|
+
border-color: dt('checkbox.checked.border.color');
|
|
62
|
+
background: dt('checkbox.checked.background');
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.p-checkbox-checked .p-checkbox-icon {
|
|
66
|
+
color: dt('checkbox.icon.checked.color');
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.p-checkbox-checked:not(.p-disabled):has(.p-checkbox-input:hover) .p-checkbox-box {
|
|
70
|
+
background: dt('checkbox.checked.hover.background');
|
|
71
|
+
border-color: dt('checkbox.checked.hover.border.color');
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.p-checkbox-checked:not(.p-disabled):has(.p-checkbox-input:hover) .p-checkbox-icon {
|
|
75
|
+
color: dt('checkbox.icon.checked.hover.color');
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.p-checkbox:not(.p-disabled):has(.p-checkbox-input:focus-visible) .p-checkbox-box {
|
|
79
|
+
border-color: dt('checkbox.focus.border.color');
|
|
80
|
+
box-shadow: dt('checkbox.focus.ring.shadow');
|
|
81
|
+
outline: dt('checkbox.focus.ring.width') dt('checkbox.focus.ring.style') dt('checkbox.focus.ring.color');
|
|
82
|
+
outline-offset: dt('checkbox.focus.ring.offset');
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.p-checkbox-checked:not(.p-disabled):has(.p-checkbox-input:focus-visible) .p-checkbox-box {
|
|
86
|
+
border-color: dt('checkbox.checked.focus.border.color');
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.p-checkbox.p-invalid > .p-checkbox-box {
|
|
90
|
+
border-color: dt('checkbox.invalid.border.color');
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.p-checkbox.p-variant-filled .p-checkbox-box {
|
|
94
|
+
background: dt('checkbox.filled.background');
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.p-checkbox-checked.p-variant-filled .p-checkbox-box {
|
|
98
|
+
background: dt('checkbox.checked.background');
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.p-checkbox-checked.p-variant-filled:not(.p-disabled):has(.p-checkbox-input:hover) .p-checkbox-box {
|
|
102
|
+
background: dt('checkbox.checked.hover.background');
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.p-checkbox.p-disabled {
|
|
106
|
+
opacity: 1;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.p-checkbox.p-disabled .p-checkbox-box {
|
|
110
|
+
background: dt('checkbox.disabled.background');
|
|
111
|
+
border-color: dt('checkbox.checked.disabled.border.color');
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.p-checkbox.p-disabled .p-checkbox-box .p-checkbox-icon {
|
|
115
|
+
color: dt('checkbox.icon.disabled.color');
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.p-checkbox-sm,
|
|
119
|
+
.p-checkbox-sm .p-checkbox-box {
|
|
120
|
+
width: dt('checkbox.sm.width');
|
|
121
|
+
height: dt('checkbox.sm.height');
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.p-checkbox-sm .p-checkbox-icon {
|
|
125
|
+
font-size: dt('checkbox.icon.sm.size');
|
|
126
|
+
width: dt('checkbox.icon.sm.size');
|
|
127
|
+
height: dt('checkbox.icon.sm.size');
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.p-checkbox-lg,
|
|
131
|
+
.p-checkbox-lg .p-checkbox-box {
|
|
132
|
+
width: dt('checkbox.lg.width');
|
|
133
|
+
height: dt('checkbox.lg.height');
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.p-checkbox-lg .p-checkbox-icon {
|
|
137
|
+
font-size: dt('checkbox.icon.lg.size');
|
|
138
|
+
width: dt('checkbox.icon.lg.size');
|
|
139
|
+
height: dt('checkbox.icon.lg.size');
|
|
140
|
+
}
|
|
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`}}),ve={name:`BaseCheckbox`,extends:L,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:_e,provide:function(){return{$pcCheckbox:this,$parentInstance:this}}};function B(e){"@babel/helpers - typeof";return B=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},B(e)}function ye(e,t,n){return(t=be(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function be(e){var t=xe(e,`string`);return B(t)==`symbol`?t:t+``}function xe(e,t){if(B(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(B(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Se(e){return Ee(e)||Te(e)||we(e)||Ce()}function Ce(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
142
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function we(e,t){if(e){if(typeof e==`string`)return V(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)?V(e,t):void 0}}function Te(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function Ee(e){if(Array.isArray(e))return V(e)}function V(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 H={name:`Checkbox`,extends:ve,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!S(e,t.value)}):n?[].concat(Se(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:_(this.value,e)},dataP:function(){return T(ye({invalid:this.$invalid,checked:this.checked,disabled:this.disabled,filled:this.$variant===`filled`},this.size,this.size))}},components:{CheckIcon:F,MinusIcon:R}},De=[`data-p-checked`,`data-p-indeterminate`,`data-p-disabled`,`data-p`],Oe=[`id`,`value`,`name`,`checked`,`tabindex`,`disabled`,`readonly`,`required`,`aria-labelledby`,`aria-label`,`aria-invalid`],ke=[`data-p`];function Ae(e,t,n,r,a,o){var l=i(`CheckIcon`),u=i(`MinusIcon`);return d(),c(`div`,s({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}),[j(`input`,s({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,Oe),j(`div`,s({class:e.cx(`box`)},o.getPTOptions(`box`),{"data-p":o.dataP}),[f(e.$slots,`icon`,{checked:o.checked,indeterminate:a.d_indeterminate,class:C(e.cx(`icon`)),dataP:o.dataP},function(){return[o.checked?(d(),p(l,s({key:0,class:e.cx(`icon`)},o.getPTOptions(`icon`),{"data-p":o.dataP}),null,16,[`class`,`data-p`])):a.d_indeterminate?(d(),p(u,s({key:1,class:e.cx(`icon`)},o.getPTOptions(`icon`),{"data-p":o.dataP}),null,16,[`class`,`data-p`])):A(``,!0)]})],16,ke)],16,De)}H.render=Ae;var U={name:`EyeIcon`,extends:b};function je(e){return Fe(e)||Pe(e)||Ne(e)||Me()}function Me(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
143
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ne(e,t){if(e){if(typeof e==`string`)return W(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)?W(e,t):void 0}}function Pe(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function Fe(e){if(Array.isArray(e))return W(e)}function W(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 Ie(e,t,n,r,i,a){return d(),c(`svg`,s({width:`14`,height:`14`,viewBox:`0 0 14 14`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},e.pti()),je(t[0]||=[j(`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)}U.render=Ie;var G={name:`EyeSlashIcon`,extends:b};function Le(e){return Ve(e)||Be(e)||ze(e)||Re()}function Re(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
144
|
+
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 K(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)?K(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 K(e)}function K(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 He(e,t,n,r,i,a){return d(),c(`svg`,s({width:`14`,height:`14`,viewBox:`0 0 14 14`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},e.pti()),Le(t[0]||=[j(`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)}G.render=He;var Ue=m.extend({name:`password`,style:`
|
|
145
|
+
.p-password {
|
|
146
|
+
display: inline-flex;
|
|
147
|
+
position: relative;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.p-password .p-password-overlay {
|
|
151
|
+
min-width: 100%;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.p-password-meter {
|
|
155
|
+
height: dt('password.meter.height');
|
|
156
|
+
background: dt('password.meter.background');
|
|
157
|
+
border-radius: dt('password.meter.border.radius');
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.p-password-meter-label {
|
|
161
|
+
height: 100%;
|
|
162
|
+
width: 0;
|
|
163
|
+
transition: width 1s ease-in-out;
|
|
164
|
+
border-radius: dt('password.meter.border.radius');
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.p-password-meter-weak {
|
|
168
|
+
background: dt('password.strength.weak.background');
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.p-password-meter-medium {
|
|
172
|
+
background: dt('password.strength.medium.background');
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.p-password-meter-strong {
|
|
176
|
+
background: dt('password.strength.strong.background');
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.p-password-fluid {
|
|
180
|
+
display: flex;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.p-password-fluid .p-password-input {
|
|
184
|
+
width: 100%;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.p-password-input::-ms-reveal,
|
|
188
|
+
.p-password-input::-ms-clear {
|
|
189
|
+
display: none;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.p-password-overlay {
|
|
193
|
+
padding: dt('password.overlay.padding');
|
|
194
|
+
background: dt('password.overlay.background');
|
|
195
|
+
color: dt('password.overlay.color');
|
|
196
|
+
border: 1px solid dt('password.overlay.border.color');
|
|
197
|
+
box-shadow: dt('password.overlay.shadow');
|
|
198
|
+
border-radius: dt('password.overlay.border.radius');
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.p-password-content {
|
|
202
|
+
display: flex;
|
|
203
|
+
flex-direction: column;
|
|
204
|
+
gap: dt('password.content.gap');
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.p-password-toggle-mask-icon {
|
|
208
|
+
inset-inline-end: dt('form.field.padding.x');
|
|
209
|
+
color: dt('password.icon.color');
|
|
210
|
+
position: absolute;
|
|
211
|
+
top: 50%;
|
|
212
|
+
margin-top: calc(-1 * calc(dt('icon.size') / 2));
|
|
213
|
+
width: dt('icon.size');
|
|
214
|
+
height: dt('icon.size');
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.p-password-clear-icon {
|
|
218
|
+
position: absolute;
|
|
219
|
+
top: 50%;
|
|
220
|
+
margin-top: -0.5rem;
|
|
221
|
+
cursor: pointer;
|
|
222
|
+
inset-inline-end: dt('form.field.padding.x');
|
|
223
|
+
color: dt('form.field.icon.color');
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
.p-password:has(.p-password-toggle-mask-icon) .p-password-input {
|
|
227
|
+
padding-inline-end: calc((dt('form.field.padding.x') * 2) + dt('icon.size'));
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.p-password:has(.p-password-toggle-mask-icon) .p-password-clear-icon {
|
|
231
|
+
inset-inline-end: calc((dt('form.field.padding.x') * 2) + dt('icon.size'));
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.p-password:has(.p-password-clear-icon) .p-password-input {
|
|
235
|
+
padding-inline-end: calc((dt('form.field.padding.x') * 2) + dt('icon.size'));
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
.p-password:has(.p-password-clear-icon):has(.p-password-toggle-mask-icon) .p-password-input {
|
|
239
|
+
padding-inline-end: calc((dt('form.field.padding.x') * 3) + calc(dt('icon.size') * 2));
|
|
240
|
+
}
|
|
241
|
+
|
|
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}}}}),We={name:`BasePassword`,extends:L,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:Ue,provide:function(){return{$pcPassword: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 J(e,t,n){return(t=Ge(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ge(e){var t=Ke(e,`string`);return q(t)==`symbol`?t:t+``}function Ke(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)}var qe={name:`Password`,extends:We,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&&=(M.clear(this.overlay),null)},methods:{onOverlayEnter:function(e){M.set(`overlay`,e,this.$primevue.config.zIndex.overlay),o(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){M.clear(e)},alignOverlay:function(){this.appendTo===`self`?n(this.overlay,this.$refs.input.$el):(this.overlay.style.minWidth=h(this.$refs.input.$el)+`px`,r(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 ie(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&&!a()&&(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){ue.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(J({},this.meter?.strength,this.meter?.strength))},overlayDataP:function(){return T(J({},`portal-`+this.appendTo,`portal-`+this.appendTo))}},components:{InputText:I,Portal:N,EyeSlashIcon:G,EyeIcon:U,TimesIcon:P}};function Y(e){"@babel/helpers - typeof";return Y=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},Y(e)}function Je(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 X(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Je(Object(n),!0).forEach(function(t){Ye(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Je(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Ye(e,t,n){return(t=Xe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xe(e){var t=Ze(e,`string`);return Y(t)==`symbol`?t:t+``}function Ze(e,t){if(Y(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Y(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var Qe=[`data-p`],$e=[`id`,`data-p`],et=[`data-p`];function tt(e,t,n,r,a,o){var u=i(`InputText`),ee=i(`TimesIcon`),m=i(`Portal`);return d(),c(`div`,s({class:e.cx(`root`),style:e.sx(`root`),"data-p":o.containerDataP},e.ptmi(`root`)),[l(u,s({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?f(e.$slots,e.$slots.maskicon?`maskicon`:`hideicon`,s({key:0,toggleCallback:o.onMaskToggle,class:[e.cx(`maskIcon`),e.maskIcon]},e.ptm(`maskIcon`)),function(){return[(d(),p(w(e.maskIcon?`i`:`EyeSlashIcon`),s({class:[e.cx(`maskIcon`),e.maskIcon],onClick:o.onMaskToggle},e.ptm(`maskIcon`)),null,16,[`class`,`onClick`]))]}):A(``,!0),e.toggleMask&&!a.unmasked?f(e.$slots,e.$slots.unmaskicon?`unmaskicon`:`showicon`,s({key:1,toggleCallback:o.onMaskToggle,class:[e.cx(`unmaskIcon`)]},e.ptm(`unmaskIcon`)),function(){return[(d(),p(w(e.unmaskIcon?`i`:`EyeIcon`),s({class:[e.cx(`unmaskIcon`),e.unmaskIcon],onClick:o.onMaskToggle},e.ptm(`unmaskIcon`)),null,16,[`class`,`onClick`]))]}):A(``,!0),o.isClearIconVisible?f(e.$slots,`clearicon`,s({key:2,class:e.cx(`clearIcon`),clearCallback:o.onClearClick},e.ptm(`clearIcon`)),function(){return[l(ee,s({class:[e.cx(`clearIcon`)],onClick:o.onClearClick},e.ptm(`clearIcon`)),null,16,[`class`,`onClick`])]}):A(``,!0),j(`span`,s({class:`p-hidden-accessible`,"aria-live":`polite`},e.ptm(`hiddenAccesible`),{"data-p-hidden-accessible":!0}),y(a.infoText),17),l(m,{appendTo:e.appendTo},{default:g(function(){return[l(x,s({name:`p-anchored-overlay`,onEnter:o.onOverlayEnter,onLeave:o.onOverlayLeave,onAfterLeave:o.onOverlayAfterLeave},e.ptm(`transition`)),{default:g(function(){return[a.overlayVisible?(d(),c(`div`,s({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`},X(X(X({},e.panelProps),e.overlayProps),e.ptm(`overlay`))),[f(e.$slots,`header`),f(e.$slots,`content`,{},function(){return[j(`div`,s({class:e.cx(`content`)},e.ptm(`content`)),[j(`div`,s({class:e.cx(`meter`)},e.ptm(`meter`)),[j(`div`,s({class:e.cx(`meterLabel`),style:{width:a.meter?a.meter.width:``},"data-p":o.meterDataP},e.ptm(`meterLabel`)),null,16,et)],16),j(`div`,s({class:e.cx(`meterText`)},e.ptm(`meterText`)),y(a.infoText),17)],16)]}),f(e.$slots,`footer`)],16,$e)):A(``,!0)]}),_:3},16,[`onEnter`,`onLeave`,`onAfterLeave`])]}),_:3},8,[`appendTo`])],16,Qe)}qe.render=tt;var nt=m.extend({name:`textarea`,style:`
|
|
243
|
+
.p-textarea {
|
|
244
|
+
font-family: inherit;
|
|
245
|
+
font-feature-settings: inherit;
|
|
246
|
+
font-size: 1rem;
|
|
247
|
+
color: dt('textarea.color');
|
|
248
|
+
background: dt('textarea.background');
|
|
249
|
+
padding-block: dt('textarea.padding.y');
|
|
250
|
+
padding-inline: dt('textarea.padding.x');
|
|
251
|
+
border: 1px solid dt('textarea.border.color');
|
|
252
|
+
transition:
|
|
253
|
+
background dt('textarea.transition.duration'),
|
|
254
|
+
color dt('textarea.transition.duration'),
|
|
255
|
+
border-color dt('textarea.transition.duration'),
|
|
256
|
+
outline-color dt('textarea.transition.duration'),
|
|
257
|
+
box-shadow dt('textarea.transition.duration');
|
|
258
|
+
appearance: none;
|
|
259
|
+
border-radius: dt('textarea.border.radius');
|
|
260
|
+
outline-color: transparent;
|
|
261
|
+
box-shadow: dt('textarea.shadow');
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
.p-textarea:enabled:hover {
|
|
265
|
+
border-color: dt('textarea.hover.border.color');
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
.p-textarea:enabled:focus {
|
|
269
|
+
border-color: dt('textarea.focus.border.color');
|
|
270
|
+
box-shadow: dt('textarea.focus.ring.shadow');
|
|
271
|
+
outline: dt('textarea.focus.ring.width') dt('textarea.focus.ring.style') dt('textarea.focus.ring.color');
|
|
272
|
+
outline-offset: dt('textarea.focus.ring.offset');
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
.p-textarea.p-invalid {
|
|
276
|
+
border-color: dt('textarea.invalid.border.color');
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
.p-textarea.p-variant-filled {
|
|
280
|
+
background: dt('textarea.filled.background');
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
.p-textarea.p-variant-filled:enabled:hover {
|
|
284
|
+
background: dt('textarea.filled.hover.background');
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
.p-textarea.p-variant-filled:enabled:focus {
|
|
288
|
+
background: dt('textarea.filled.focus.background');
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
.p-textarea:disabled {
|
|
292
|
+
opacity: 1;
|
|
293
|
+
background: dt('textarea.disabled.background');
|
|
294
|
+
color: dt('textarea.disabled.color');
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
.p-textarea::placeholder {
|
|
298
|
+
color: dt('textarea.placeholder.color');
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
.p-textarea.p-invalid::placeholder {
|
|
302
|
+
color: dt('textarea.invalid.placeholder.color');
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
.p-textarea-fluid {
|
|
306
|
+
width: 100%;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
.p-textarea-resizable {
|
|
310
|
+
overflow: hidden;
|
|
311
|
+
resize: none;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
.p-textarea-sm {
|
|
315
|
+
font-size: dt('textarea.sm.font.size');
|
|
316
|
+
padding-block: dt('textarea.sm.padding.y');
|
|
317
|
+
padding-inline: dt('textarea.sm.padding.x');
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
.p-textarea-lg {
|
|
321
|
+
font-size: dt('textarea.lg.font.size');
|
|
322
|
+
padding-block: dt('textarea.lg.padding.y');
|
|
323
|
+
padding-inline: dt('textarea.lg.padding.x');
|
|
324
|
+
}
|
|
325
|
+
`,classes:{root:function(e){var t=e.instance,n=e.props;return[`p-textarea p-component`,{"p-filled":t.$filled,"p-textarea-resizable ":n.autoResize,"p-textarea-sm p-inputfield-sm":n.size===`small`,"p-textarea-lg p-inputfield-lg":n.size===`large`,"p-invalid":t.$invalid,"p-variant-filled":t.$variant===`filled`,"p-textarea-fluid":t.$fluid}]}}}),rt={name:`BaseTextarea`,extends:L,props:{autoResize:Boolean},style:nt,provide:function(){return{$pcTextarea:this,$parentInstance:this}}};function Z(e){"@babel/helpers - typeof";return Z=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},Z(e)}function it(e,t,n){return(t=at(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function at(e){var t=ot(e,`string`);return Z(t)==`symbol`?t:t+``}function ot(e,t){if(Z(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Z(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var Q={name:`Textarea`,extends:rt,inheritAttrs:!1,observer:null,mounted:function(){var e=this;this.autoResize&&(this.observer=new ResizeObserver(function(){requestAnimationFrame(function(){e.resize()})}),this.observer.observe(this.$el))},updated:function(){this.autoResize&&this.resize()},beforeUnmount:function(){this.observer&&this.observer.disconnect()},methods:{resize:function(){if(this.$el.offsetParent){var e=this.$el.style.height,t=parseInt(e)||0,n=this.$el.scrollHeight;t&&n<t?(this.$el.style.height=`auto`,this.$el.style.height=`${this.$el.scrollHeight}px`):(!t||n>t)&&(this.$el.style.height=`${n}px`)}},onInput:function(e){this.autoResize&&this.resize(),this.writeValue(e.target.value,e)}},computed:{attrs:function(){return s(this.ptmi(`root`,{context:{filled:this.$filled,disabled:this.disabled}}),this.formField)},dataP:function(){return T(it({invalid:this.$invalid,fluid:this.$fluid,filled:this.$variant===`filled`},this.size,this.size))}}},st=[`value`,`name`,`disabled`,`aria-invalid`,`data-p`];function ct(e,t,n,r,i,a){return d(),c(`textarea`,s({class:e.cx(`root`),value:e.d_value,name:e.name,disabled:e.disabled,"aria-invalid":e.invalid||void 0,"data-p":a.dataP,onInput:t[0]||=function(){return a.onInput&&a.onInput.apply(a,arguments)}},a.attrs),null,16,st)}Q.render=ct;var lt={key:0,class:`flex items-center justify-center py-8`},ut={key:1,class:`space-y-6`},dt={class:`space-y-3`},ft={class:`flex flex-col gap-1`},pt={class:`flex flex-col gap-1`},mt={class:`space-y-2`},ht={class:`text-sm font-mono flex-1`},gt={key:0,class:`flex flex-col gap-2 px-3 py-2 rounded border border-border bg-card`},_t={class:`flex items-center gap-2`},vt={class:`flex items-center gap-4 text-xs`},yt={class:`flex items-center gap-1.5 cursor-pointer`},bt={class:`flex items-center gap-1.5 cursor-pointer`},xt={key:0,class:`text-muted-foreground ml-auto`},St={class:`space-y-3`},Ct={class:`flex flex-col gap-1`},wt={key:0,class:`text-xs text-red-500 mt-1`},Tt={class:`flex flex-col gap-1`},Et={key:0,class:`text-xs text-red-500 mt-1`},Dt={class:`flex justify-between`},Ot={class:`flex gap-2`},kt=`You are a professional data extraction assistant. Your task is to extract structured data from text based on the data structure definition provided below.
|
|
326
|
+
|
|
327
|
+
{schema}
|
|
328
|
+
|
|
329
|
+
Extraction requirements:
|
|
330
|
+
1. Extract data strictly according to the field names and types defined in the structure
|
|
331
|
+
2. If a field's information is missing from the text, set that field to null
|
|
332
|
+
3. Do not add fields that are not in the structure definition
|
|
333
|
+
4. Maintain data accuracy and completeness`,$=`Please extract data from the following text:
|
|
334
|
+
{text}`,At=t({__name:`AISettings`,props:{visible:{type:Boolean,default:!1},visibleModifiers:{}},emits:[`update:visible`],setup(t){let n=ee(t,`visible`),r=E(!1),i=E(!1),a=E(`https://dashscope.aliyuncs.com/compatible-mode/v1`),o=E(``),s=E([]),f=E(``),m=E(``),h=E(!1),_=E(``),b=E({vision:!1,structuredOutput:!1}),x=E(`manual`);function S(){x.value=`manual`,b.value={vision:!1,structuredOutput:!1},_.value&&le(_.value).then(e=>{e&&(b.value={...e},x.value=`registry`)})}function w(){_.value&&(s.value.push({name:_.value,capabilities:{...b.value}}),M())}function T(){M()}function M(){_.value=``,b.value={vision:!1,structuredOutput:!1},x.value=`manual`,h.value=!1}function ie(e){s.value.splice(e,1)}let N=O(()=>f.value.includes(`{schema}`)?``:`System prompt must contain the {schema} placeholder`),P=O(()=>m.value.includes(`{text}`)?``:`User prompt must contain the {text} placeholder`),F=O(()=>!N.value&&!P.value&&!r.value&&s.value.length>0);async function L(){r.value=!0;try{let e=await ce();a.value=e.provider.baseURL,o.value=e.provider.apiKey,s.value=e.provider.models??[],f.value=e.prompt.systemTemplate,m.value=e.prompt.userTemplate}catch{o.value=``,s.value=[],f.value=kt,m.value=$}finally{r.value=!1}}async function ue(){if(F.value){i.value=!0;try{await se({provider:{baseURL:a.value,apiKey:o.value,models:s.value},prompt:{systemTemplate:f.value,userTemplate:m.value},extraction:{outputDir:`.aiex/extracted`}})}catch(e){oe.error(e.message||`Failed to save`)}finally{i.value=!1}}}function R(){a.value=`https://dashscope.aliyuncs.com/compatible-mode/v1`,s.value=[{name:`qwen-plus`,capabilities:{vision:!1,structuredOutput:!0}},{name:`qwen-vl-plus`,capabilities:{vision:!0,structuredOutput:!0}}],f.value=kt,m.value=$}return re(()=>{L()}),e(()=>{}),(e,t)=>(d(),p(v(ae),{visible:n.value,"onUpdate:visible":t[9]||=e=>n.value=e,modal:``,header:`AI Settings`,style:{width:`680px`},draggable:!1},{footer:g(()=>[j(`div`,Dt,[l(v(D),{label:`Reset Defaults`,icon:`pi pi-replay`,severity:`secondary`,text:``,onClick:R}),j(`div`,Ot,[l(v(D),{label:`Cancel`,severity:`secondary`,text:``,onClick:t[8]||=e=>n.value=!1}),l(v(D),{label:`Save`,icon:`pi pi-check`,loading:i.value,disabled:!F.value,onClick:ue},null,8,[`loading`,`disabled`])])])]),default:g(()=>[r.value?(d(),c(`div`,lt,[...t[10]||=[j(`i`,{class:`pi pi-spin pi-spinner text-xl`},null,-1)]])):(d(),c(`div`,ut,[j(`section`,null,[t[13]||=j(`h3`,{class:`text-sm font-semibold mb-3 text-foreground`},` Provider `,-1),j(`div`,dt,[j(`div`,ft,[t[11]||=j(`label`,{class:`text-xs text-muted-foreground`},`Base URL`,-1),l(v(I),{modelValue:a.value,"onUpdate:modelValue":t[0]||=e=>a.value=e,size:`small`,placeholder:`https://dashscope.aliyuncs.com/compatible-mode/v1`},null,8,[`modelValue`])]),j(`div`,pt,[t[12]||=j(`label`,{class:`text-xs text-muted-foreground`},`API Key`,-1),l(v(qe),{modelValue:o.value,"onUpdate:modelValue":t[1]||=e=>o.value=e,feedback:!1,"toggle-mask":``,size:`small`,placeholder:`sk-xxx`,"input-class":`w-full`},null,8,[`modelValue`])])])]),j(`section`,null,[t[15]||=j(`h3`,{class:`text-sm font-semibold mb-3 text-foreground`},` Models `,-1),j(`div`,mt,[(d(!0),c(te,null,u(s.value,(e,t)=>(d(),c(`div`,{key:t,class:`flex items-center gap-2 px-3 py-2 rounded border border-border bg-card`},[j(`code`,ht,y(e.name),1),j(`span`,{class:C([`inline-flex items-center gap-1 text-xs px-1.5 py-0.5 rounded`,e.capabilities.structuredOutput?`bg-green-500/10 text-green-600`:`bg-yellow-500/10 text-yellow-600`])},[j(`i`,{class:C([e.capabilities.structuredOutput?`pi pi-check-circle`:`pi pi-exclamation-triangle`,`text-[10px]`])},null,2),k(` `+y(e.capabilities.structuredOutput?`Structured Output`:`Text-only Output`),1)],2),j(`span`,{class:C([`inline-flex items-center gap-1 text-xs px-1.5 py-0.5 rounded`,e.capabilities.vision?`bg-green-500/10 text-green-600`:`bg-red-500/10 text-red-600`])},[j(`i`,{class:C([e.capabilities.vision?`pi pi-check-circle`:`pi pi-times-circle`,`text-[10px]`])},null,2),k(` `+y(e.capabilities.vision?`Vision Supported`:`Vision Unsupported`),1)],2),l(v(D),{icon:`pi pi-times`,severity:`danger`,text:``,size:`small`,onClick:e=>ie(t)},null,8,[`onClick`])]))),128)),h.value?(d(),c(`div`,gt,[j(`div`,_t,[l(v(I),{modelValue:_.value,"onUpdate:modelValue":t[2]||=e=>_.value=e,size:`small`,placeholder:`Model name (e.g. gpt-4o)`,class:`flex-1 font-mono`,onInput:S,onKeyup:ne(w,[`enter`])},null,8,[`modelValue`]),l(v(D),{icon:`pi pi-check`,severity:`success`,text:``,size:`small`,disabled:!_.value,onClick:w},null,8,[`disabled`]),l(v(D),{icon:`pi pi-times`,severity:`secondary`,text:``,size:`small`,onClick:T})]),j(`div`,vt,[j(`label`,yt,[l(v(H),{modelValue:b.value.structuredOutput,"onUpdate:modelValue":t[3]||=e=>b.value.structuredOutput=e,binary:!0,"input-id":`add-so`},null,8,[`modelValue`]),j(`span`,{class:C(b.value.structuredOutput?`text-green-600`:`text-muted-foreground`)},` Structured Output `,2)]),j(`label`,bt,[l(v(H),{modelValue:b.value.vision,"onUpdate:modelValue":t[4]||=e=>b.value.vision=e,binary:!0,"input-id":`add-vision`},null,8,[`modelValue`]),j(`span`,{class:C(b.value.vision?`text-green-600`:`text-muted-foreground`)},` Vision `,2)]),x.value===`registry`?(d(),c(`span`,xt,[...t[14]||=[j(`i`,{class:`pi pi-database mr-0.5`},null,-1),k(`Registry `,-1)]])):A(``,!0)])])):(d(),p(v(D),{key:1,label:`Add Model`,icon:`pi pi-plus`,severity:`secondary`,text:``,size:`small`,onClick:t[5]||=e=>h.value=!0}))])]),j(`section`,null,[t[19]||=j(`h3`,{class:`text-sm font-semibold mb-3 text-foreground`},` Prompt Templates `,-1),j(`div`,St,[j(`div`,Ct,[t[16]||=j(`label`,{class:`text-xs text-muted-foreground`},`System Prompt`,-1),l(v(Q),{modelValue:f.value,"onUpdate:modelValue":t[6]||=e=>f.value=e,rows:`6`,"auto-resize":``,class:`text-xs font-mono`},null,8,[`modelValue`]),N.value?(d(),c(`p`,wt,y(N.value),1)):A(``,!0)]),j(`div`,Tt,[t[17]||=j(`label`,{class:`text-xs text-muted-foreground`},`User Prompt`,-1),l(v(Q),{modelValue:m.value,"onUpdate:modelValue":t[7]||=e=>m.value=e,rows:`6`,"auto-resize":``,class:`text-xs font-mono`},null,8,[`modelValue`]),P.value?(d(),c(`p`,Et,y(P.value),1)):A(``,!0)]),t[18]||=j(`div`,{class:`text-xs text-muted-foreground p-2 rounded border border-border`},[k(` Placeholders: `),j(`code`,{class:`bg-secondary px-1 rounded`},`{schema}`),k(` JSON Schema structure description, `),j(`code`,{class:`bg-secondary px-1 rounded`},`{text}`),k(` text to extract from `)],-1)])])]))]),_:1},8,[`visible`]))}});export{At as default};
|