directus-extension-inframe 2.0.6 → 2.1.0
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 +80 -76
- package/dist/api.js +1 -1
- package/dist/app.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +42 -39
package/README.md
CHANGED
|
@@ -1,107 +1,120 @@
|
|
|
1
|
-
#
|
|
1
|
+
# 🚀 inFrame: The Ultimate Module for External Content Integration in Directus
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/directus-extension-inframe)
|
|
4
4
|
[](https://github.com/devix-tecnologia/directus-extension-inframe/blob/main/LICENSE)
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
---
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
## 💡 Stop Switching Tabs. Start Integrating.
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
**inFrame** is the _plug-and-play_ solution that transforms your Directus admin panel into a centralized information
|
|
11
|
+
hub. Integrate BI dashboards, real-time reports, external tools, and any content via `iframe` directly into your
|
|
12
|
+
Headless CMS.
|
|
11
13
|
|
|
12
|
-
|
|
13
|
-
- **📈 Real-time reports**: View updated data without leaving Directus
|
|
14
|
-
- **🔗 Organized links**: Centralize access to external tools in one place
|
|
15
|
-
- **🌍 Multilingual support**: Automatic translations for multiple languages
|
|
16
|
-
- **⚡ Zero configuration**: Plug-and-play installation with automatic setup
|
|
14
|
+
> **Boost Productivity:** Get instant access to critical data and third-party tools without ever leaving Directus.
|
|
17
15
|
|
|
18
|
-
|
|
16
|
+

|
|
19
17
|
|
|
20
|
-
|
|
18
|
+
---
|
|
21
19
|
|
|
22
|
-
|
|
20
|
+
## 🎯 Why inFrame is Essential for Your Directus Project
|
|
23
21
|
|
|
24
|
-
|
|
22
|
+
| Key Benefit | Description |
|
|
23
|
+
| :-------------------------------- | :---------------------------------------------------------------------------------------------------- |
|
|
24
|
+
| **📊 BI & Dashboard Integration** | Connect Power BI, Tableau, Metabase, Grafana, or any Business Intelligence tool. |
|
|
25
|
+
| **🔗 Tool Centralization** | Organize external links and systems into a single, easily accessible module for your entire team. |
|
|
26
|
+
| **⚡ Zero-Config Installation** | The extension automatically creates all necessary collections and fields. Install and use in seconds! |
|
|
27
|
+
| **🔄 Navigation Persistence** | The module automatically saves and restores your last view, even after closing the browser. |
|
|
28
|
+
| **🌍 Multilingual Support** | Ready for global projects, with automatic translations for multiple languages. |
|
|
25
29
|
|
|
26
|
-
|
|
27
|
-
- ✅ `languages` collection for languages
|
|
28
|
-
- ✅ `inframe_translations` collection for translations
|
|
29
|
-
- ✅ Folder system for organization
|
|
30
|
-
- ✅ All fields and relations configured
|
|
30
|
+
---
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
## ✨ Exclusive Feature: Dynamic URL Variables
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
3. Done! Start using immediately
|
|
34
|
+
Take integration to the next level. inFrame allows you to inject user data and the current Directus context directly
|
|
35
|
+
into your iframe's URL. Perfect for authentication and report personalization.
|
|
37
36
|
|
|
38
|
-
###
|
|
37
|
+
### Available Variables
|
|
39
38
|
|
|
40
|
-
|
|
39
|
+
| Variable | Description | Usage Example |
|
|
40
|
+
| :------------ | :---------------------------------------------------------- | :---------------------------------------------- |
|
|
41
|
+
| `$token` | Directus access token (JWT). **(Use with extreme caution)** | `https://app.site.com/report?auth=$token` |
|
|
42
|
+
| `$user_id` | ID of the logged-in user. | `https://metabase.com/dash?user_id=$user_id` |
|
|
43
|
+
| `$user_email` | Email of the logged-in user. | `https://analytics.com/view?viewer=$user_email` |
|
|
44
|
+
| `$user_role` | Key of the user's role. | `https://app.site.com/access?role=$user_role` |
|
|
45
|
+
| `$timestamp` | Current timestamp (ISO 8601). | `https://app.site.com/log?time=$timestamp` |
|
|
46
|
+
| `$locale` | User's language preference (e.g., `en-US`). | `https://app.site.com/lang?locale=$locale` |
|
|
41
47
|
|
|
42
|
-
|
|
43
|
-
- 🔖 Restores state when returning to the module
|
|
44
|
-
- 🚀 Works even after closing/reopening browser
|
|
45
|
-
- ⚡ Zero performance impact
|
|
48
|
+
### ⚠️ Security: Responsible Use of `$token`
|
|
46
49
|
|
|
47
|
-
|
|
50
|
+
Using the `$token` exposes the Directus access token in the URL, which can be a security risk. **We strongly recommend
|
|
51
|
+
using `$user_id` or `$user_email` whenever possible.**
|
|
48
52
|
|
|
49
|
-
|
|
53
|
+
> [!WARNING] **Use `$token` ONLY with sites you fully trust and control.** The token can leak in server logs, browser
|
|
54
|
+
> history, and `Referer` headers. The extension will block the use of `$token` in URLs that do not use HTTPS.
|
|
50
55
|
|
|
51
|
-
|
|
52
|
-
npm install directus-extension-inframe
|
|
53
|
-
```
|
|
56
|
+
---
|
|
54
57
|
|
|
55
|
-
|
|
58
|
+
## 🛠️ Installation: Click & Go (Zero Config)
|
|
56
59
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
+
The inFrame module is designed for immediate use. Choose the installation method that suits your setup:
|
|
61
|
+
|
|
62
|
+
### 1. Directus Marketplace (Recommended)
|
|
63
|
+
|
|
64
|
+
The easiest way to install is directly through the Directus Admin App:
|
|
65
|
+
|
|
66
|
+
1. Navigate to **Settings** -> **Extensions**.
|
|
67
|
+
2. Find **"inFrame Module"** in the Marketplace.
|
|
68
|
+
3. Click **"Install"**.
|
|
69
|
+
4. Restart your Directus server (if self-hosted).
|
|
70
|
+
5. Done! The **"Reports"** module will appear in your sidebar.
|
|
60
71
|
|
|
61
|
-
###
|
|
72
|
+
### 2. Manual Installation (NPM/PNPM)
|
|
62
73
|
|
|
63
|
-
|
|
64
|
-
2. Access the admin panel
|
|
65
|
-
3. The "Reports" module will be available in the sidebar
|
|
74
|
+
For self-hosted environments or custom setups, you can install via your package manager:
|
|
66
75
|
|
|
67
|
-
|
|
76
|
+
```bash
|
|
77
|
+
# Using NPM
|
|
78
|
+
npm install directus-extension-inframe
|
|
79
|
+
|
|
80
|
+
# Using PNPM
|
|
81
|
+
pnpm add directus-extension-inframe
|
|
82
|
+
```
|
|
68
83
|
|
|
69
|
-
|
|
84
|
+
**Automatic Setup:** The extension automatically creates all necessary collections, fields, and relations upon
|
|
85
|
+
installation:
|
|
70
86
|
|
|
71
|
-
|
|
87
|
+
- ✅ `inframe` Collection to manage your content.
|
|
88
|
+
- ✅ Translation Collections (`languages`, `inframe_translations`).
|
|
89
|
+
- ✅ All required fields and relations configured.
|
|
72
90
|
|
|
73
|
-
|
|
91
|
+
---
|
|
74
92
|
|
|
75
|
-
|
|
76
|
-
2. Fill in the fields:
|
|
77
|
-
- **URL**: Link to the content to be displayed in the iframe
|
|
78
|
-
- **Status**: Published, Draft or Archived
|
|
79
|
-
- **Icon**: Choose a Material Design icon
|
|
80
|
-
- **Thumbnail**: Preview image (optional)
|
|
81
|
-
3. Add translations for different languages (optional)
|
|
82
|
-
4. Save
|
|
93
|
+
## 📖 How to Use
|
|
83
94
|
|
|
84
|
-
|
|
95
|
+
1. **Access the Module:** Click on **"Reports"** in the sidebar.
|
|
96
|
+
2. **Create a New Item:** Click "Create new" and fill in:
|
|
97
|
+
- **URL:** The link to the iframe content.
|
|
98
|
+
- **Status:** Published, Draft, or Archived.
|
|
99
|
+
- **Icon:** Choose a Material Design icon for the item.
|
|
100
|
+
3. **Save:** The content will be displayed in the iframe, ready for interaction.
|
|
85
101
|
|
|
86
|
-
|
|
102
|
+
---
|
|
87
103
|
|
|
88
|
-
## ⚙️
|
|
104
|
+
## ⚙️ Advanced Configuration (Docker)
|
|
89
105
|
|
|
90
|
-
If you
|
|
106
|
+
If you are using Docker, you may need to configure the Content Security Policy (CSP) to allow loading iframes from
|
|
107
|
+
external domains.
|
|
91
108
|
|
|
92
109
|
```yaml
|
|
93
110
|
environment:
|
|
94
|
-
|
|
111
|
+
# Add trusted domains to the frame-src directive
|
|
112
|
+
CONTENT_SECURITY_POLICY_DIRECTIVES__FRAME_SRC: "'self' https://your-bi-domain.com https://another-tool.com"
|
|
95
113
|
```
|
|
96
114
|
|
|
97
|
-
> [!
|
|
115
|
+
> [!CAUTION] Avoid using `'*'` in production. List only trusted domains.
|
|
98
116
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
- Configure CSP (Content Security Policy) properly
|
|
102
|
-
- List only trusted domains for iframes
|
|
103
|
-
- Use HTTPS in production
|
|
104
|
-
- Review user permissions in Directus
|
|
117
|
+
---
|
|
105
118
|
|
|
106
119
|
## 🌍 Compatibility
|
|
107
120
|
|
|
@@ -111,19 +124,10 @@ Tested and compatible with:
|
|
|
111
124
|
- **Directus 10.x**: 10.8.3
|
|
112
125
|
- **Directus 11.x**: 11.13.1 and newer versions
|
|
113
126
|
|
|
114
|
-
## 🐛 Known Issues
|
|
115
|
-
|
|
116
|
-
- Some websites block iframe display by policy (X-Frame-Options)
|
|
117
|
-
- HTTPS content cannot be displayed in HTTP Directus
|
|
118
|
-
|
|
119
127
|
## 🤝 Contributing
|
|
120
128
|
|
|
121
|
-
Contributions are welcome! See our [Contributing Guide](CONTRIBUTING.md) for details
|
|
122
|
-
|
|
123
|
-
- How to set up the development environment
|
|
124
|
-
- Running tests
|
|
125
|
-
- Submitting Pull Requests
|
|
126
|
-
- Code standards
|
|
129
|
+
Contributions are welcome! See our [Contributing Guide](CONTRIBUTING.md) for details on how to set up the development
|
|
130
|
+
environment, run tests, and submit Pull Requests.
|
|
127
131
|
|
|
128
132
|
## 📝 License
|
|
129
133
|
|
package/dist/api.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=["interface","display","layout","module","panel","theme"],n=["hook","endpoint"],t=["operation"];function i(e,n,t){function i(t,i){var o;Object.defineProperty(t,"_zod",{value:t._zod??{},enumerable:!1}),(o=t._zod).traits??(o.traits=new Set),t._zod.traits.add(e),n(t,i);for(const e in a.prototype)e in t||Object.defineProperty(t,e,{value:a.prototype[e].bind(t)});t._zod.constr=a,t._zod.def=i}const o=t?.Parent??Object;class r extends o{}function a(e){var n;const o=t?.Parent?new r:this;i(o,e),(n=o._zod).deferred??(n.deferred=[]);for(const e of o._zod.deferred)e();return o}return Object.defineProperty(r,"name",{value:e}),Object.defineProperty(a,"init",{value:i}),Object.defineProperty(a,Symbol.hasInstance,{value:n=>!!(t?.Parent&&n instanceof t.Parent)||n?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}class o extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class r extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const a={};function s(e){return a}function l(e,n){return"bigint"==typeof n?n.toString():n}function c(e){return{get value(){{const n=e();return Object.defineProperty(this,"value",{value:n}),n}}}}function u(e){return null==e}function d(e){const n=e.startsWith("^")?1:0,t=e.endsWith("$")?e.length-1:e.length;return e.slice(n,t)}const p=Symbol("evaluating");function f(e,n,t){let i;Object.defineProperty(e,n,{get(){if(i!==p)return void 0===i&&(i=p,i=t()),i},set(t){Object.defineProperty(e,n,{value:t})},configurable:!0})}function m(e,n,t){Object.defineProperty(e,n,{value:t,writable:!0,enumerable:!0,configurable:!0})}function h(...e){const n={};for(const t of e){const e=Object.getOwnPropertyDescriptors(t);Object.assign(n,e)}return Object.defineProperties({},n)}function _(e){return JSON.stringify(e)}const g="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function y(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const v=c(()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function w(e){if(!1===y(e))return!1;const n=e.constructor;if(void 0===n)return!0;const t=n.prototype;return!1!==y(t)&&!1!==Object.prototype.hasOwnProperty.call(t,"isPrototypeOf")}function b(e){return w(e)?{...e}:Array.isArray(e)?[...e]:e}const z=new Set(["string","number","symbol"]);function k(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function $(e,n,t){const i=new e._zod.constr(n??e._zod.def);return n&&!t?.parent||(i._zod.parent=e),i}function x(e){const n=e;if(!n)return{};if("string"==typeof n)return{error:()=>n};if(void 0!==n?.message){if(void 0!==n?.error)throw new Error("Cannot specify both `message` and `error` params");n.error=n.message}return delete n.message,"string"==typeof n.error?{...n,error:()=>n.error}:n}function E(e,n=0){if(!0===e.aborted)return!0;for(let t=n;t<e.issues.length;t++)if(!0!==e.issues[t]?.continue)return!0;return!1}function Z(e,n){return n.map(n=>{var t;return(t=n).path??(t.path=[]),n.path.unshift(e),n})}function A(e){return"string"==typeof e?e:e?.message}function P(e,n,t){const i={...e,path:e.path??[]};if(!e.message){const o=A(e.inst?._zod.def?.error?.(e))??A(n?.error?.(e))??A(t.customError?.(e))??A(t.localeError?.(e))??"Invalid input";i.message=o}return delete i.inst,delete i.continue,n?.reportInput||delete i.input,i}function T(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function O(...e){const[n,t,i]=e;return"string"==typeof n?{message:n,code:"custom",input:t,inst:i}:{...n}}const F=(e,n)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:n,enumerable:!1}),e.message=JSON.stringify(n,l,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},S=i("$ZodError",F),j=i("$ZodError",F,{Parent:Error});const I=e=>(n,t,i,r)=>{const a=i?Object.assign(i,{async:!1}):{async:!1},l=n._zod.run({value:t,issues:[]},a);if(l instanceof Promise)throw new o;if(l.issues.length){const n=new(r?.Err??e)(l.issues.map(e=>P(e,a,s())));throw g(n,r?.callee),n}return l.value},C=e=>async(n,t,i,o)=>{const r=i?Object.assign(i,{async:!0}):{async:!0};let a=n._zod.run({value:t,issues:[]},r);if(a instanceof Promise&&(a=await a),a.issues.length){const n=new(o?.Err??e)(a.issues.map(e=>P(e,r,s())));throw g(n,o?.callee),n}return a.value},U=e=>(n,t,i)=>{const r=i?{...i,async:!1}:{async:!1},a=n._zod.run({value:t,issues:[]},r);if(a instanceof Promise)throw new o;return a.issues.length?{success:!1,error:new(e??S)(a.issues.map(e=>P(e,r,s())))}:{success:!0,data:a.value}},R=U(j),D=e=>async(n,t,i)=>{const o=i?Object.assign(i,{async:!0}):{async:!0};let r=n._zod.run({value:t,issues:[]},o);return r instanceof Promise&&(r=await r),r.issues.length?{success:!1,error:new e(r.issues.map(e=>P(e,o,s())))}:{success:!0,data:r.value}},q=D(j),N=e=>(n,t,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return I(e)(n,t,o)},L=e=>(n,t,i)=>I(e)(n,t,i),V=e=>async(n,t,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return C(e)(n,t,o)},W=e=>async(n,t,i)=>C(e)(n,t,i),M=e=>(n,t,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return U(e)(n,t,o)},B=e=>(n,t,i)=>U(e)(n,t,i),J=e=>async(n,t,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return D(e)(n,t,o)},K=e=>async(n,t,i)=>D(e)(n,t,i),G=/^[cC][^\s-]{8,}$/,H=/^[0-9a-z]+$/,Y=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Q=/^[0-9a-vA-V]{20}$/,X=/^[A-Za-z0-9]{27}$/,ee=/^[a-zA-Z0-9_-]{21}$/,ne=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,te=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,ie=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,oe=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;const re=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ae=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,se=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,le=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ce=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ue=/^[A-Za-z0-9_-]*$/,de=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,pe=/^\+(?:[0-9]){6,14}[0-9]$/,fe="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",me=new RegExp(`^${fe}$`);function he(e){const n="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${n}`:0===e.precision?`${n}:[0-5]\\d`:`${n}:[0-5]\\d\\.\\d{${e.precision}}`:`${n}(?::[0-5]\\d(?:\\.\\d+)?)?`}const _e=/^(?:true|false)$/i,ge=/^[^A-Z]*$/,ye=/^[^a-z]*$/,ve=i("$ZodCheck",(e,n)=>{var t;e._zod??(e._zod={}),e._zod.def=n,(t=e._zod).onattach??(t.onattach=[])}),we=i("$ZodCheckMaxLength",(e,n)=>{var t;ve.init(e,n),(t=e._zod.def).when??(t.when=e=>{const n=e.value;return!u(n)&&void 0!==n.length}),e._zod.onattach.push(e=>{const t=e._zod.bag.maximum??Number.POSITIVE_INFINITY;n.maximum<t&&(e._zod.bag.maximum=n.maximum)}),e._zod.check=t=>{const i=t.value;if(i.length<=n.maximum)return;const o=T(i);t.issues.push({origin:o,code:"too_big",maximum:n.maximum,inclusive:!0,input:i,inst:e,continue:!n.abort})}}),be=i("$ZodCheckMinLength",(e,n)=>{var t;ve.init(e,n),(t=e._zod.def).when??(t.when=e=>{const n=e.value;return!u(n)&&void 0!==n.length}),e._zod.onattach.push(e=>{const t=e._zod.bag.minimum??Number.NEGATIVE_INFINITY;n.minimum>t&&(e._zod.bag.minimum=n.minimum)}),e._zod.check=t=>{const i=t.value;if(i.length>=n.minimum)return;const o=T(i);t.issues.push({origin:o,code:"too_small",minimum:n.minimum,inclusive:!0,input:i,inst:e,continue:!n.abort})}}),ze=i("$ZodCheckLengthEquals",(e,n)=>{var t;ve.init(e,n),(t=e._zod.def).when??(t.when=e=>{const n=e.value;return!u(n)&&void 0!==n.length}),e._zod.onattach.push(e=>{const t=e._zod.bag;t.minimum=n.length,t.maximum=n.length,t.length=n.length}),e._zod.check=t=>{const i=t.value,o=i.length;if(o===n.length)return;const r=T(i),a=o>n.length;t.issues.push({origin:r,...a?{code:"too_big",maximum:n.length}:{code:"too_small",minimum:n.length},inclusive:!0,exact:!0,input:t.value,inst:e,continue:!n.abort})}}),ke=i("$ZodCheckStringFormat",(e,n)=>{var t,i;ve.init(e,n),e._zod.onattach.push(e=>{const t=e._zod.bag;t.format=n.format,n.pattern&&(t.patterns??(t.patterns=new Set),t.patterns.add(n.pattern))}),n.pattern?(t=e._zod).check??(t.check=t=>{n.pattern.lastIndex=0,n.pattern.test(t.value)||t.issues.push({origin:"string",code:"invalid_format",format:n.format,input:t.value,...n.pattern?{pattern:n.pattern.toString()}:{},inst:e,continue:!n.abort})}):(i=e._zod).check??(i.check=()=>{})}),$e=i("$ZodCheckRegex",(e,n)=>{ke.init(e,n),e._zod.check=t=>{n.pattern.lastIndex=0,n.pattern.test(t.value)||t.issues.push({origin:"string",code:"invalid_format",format:"regex",input:t.value,pattern:n.pattern.toString(),inst:e,continue:!n.abort})}}),xe=i("$ZodCheckLowerCase",(e,n)=>{n.pattern??(n.pattern=ge),ke.init(e,n)}),Ee=i("$ZodCheckUpperCase",(e,n)=>{n.pattern??(n.pattern=ye),ke.init(e,n)}),Ze=i("$ZodCheckIncludes",(e,n)=>{ve.init(e,n);const t=k(n.includes),i=new RegExp("number"==typeof n.position?`^.{${n.position}}${t}`:t);n.pattern=i,e._zod.onattach.push(e=>{const n=e._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(i)}),e._zod.check=t=>{t.value.includes(n.includes,n.position)||t.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:n.includes,input:t.value,inst:e,continue:!n.abort})}}),Ae=i("$ZodCheckStartsWith",(e,n)=>{ve.init(e,n);const t=new RegExp(`^${k(n.prefix)}.*`);n.pattern??(n.pattern=t),e._zod.onattach.push(e=>{const n=e._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(t)}),e._zod.check=t=>{t.value.startsWith(n.prefix)||t.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:n.prefix,input:t.value,inst:e,continue:!n.abort})}}),Pe=i("$ZodCheckEndsWith",(e,n)=>{ve.init(e,n);const t=new RegExp(`.*${k(n.suffix)}$`);n.pattern??(n.pattern=t),e._zod.onattach.push(e=>{const n=e._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(t)}),e._zod.check=t=>{t.value.endsWith(n.suffix)||t.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:n.suffix,input:t.value,inst:e,continue:!n.abort})}}),Te=i("$ZodCheckOverwrite",(e,n)=>{ve.init(e,n),e._zod.check=e=>{e.value=n.tx(e.value)}});class Oe{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e)return e(this,{execution:"sync"}),void e(this,{execution:"async"});const n=e.split("\n").filter(e=>e),t=Math.min(...n.map(e=>e.length-e.trimStart().length)),i=n.map(e=>e.slice(t)).map(e=>" ".repeat(2*this.indent)+e);for(const e of i)this.content.push(e)}compile(){const e=Function,n=this?.args;return new e(...n,[...(this?.content??[""]).map(e=>` ${e}`)].join("\n"))}}const Fe={major:4,minor:1,patch:12},Se=i("$ZodType",(e,n)=>{var t;e??(e={}),e._zod.def=n,e._zod.bag=e._zod.bag||{},e._zod.version=Fe;const i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(const n of i)for(const t of n._zod.onattach)t(e);if(0===i.length)(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const n=(e,n,t)=>{let i,r=E(e);for(const a of n){if(a._zod.def.when){if(!a._zod.def.when(e))continue}else if(r)continue;const n=e.issues.length,s=a._zod.check(e);if(s instanceof Promise&&!1===t?.async)throw new o;if(i||s instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await s;e.issues.length!==n&&(r||(r=E(e,n)))});else{if(e.issues.length===n)continue;r||(r=E(e,n))}}return i?i.then(()=>e):e},t=(t,r,a)=>{if(E(t))return t.aborted=!0,t;const s=n(r,i,a);if(s instanceof Promise){if(!1===a.async)throw new o;return s.then(n=>e._zod.parse(n,a))}return e._zod.parse(s,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if("backward"===a.direction){const n=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return n instanceof Promise?n.then(e=>t(e,r,a)):t(n,r,a)}const s=e._zod.parse(r,a);if(s instanceof Promise){if(!1===a.async)throw new o;return s.then(e=>n(e,i,a))}return n(s,i,a)}}e["~standard"]={validate:n=>{try{const t=R(e,n);return t.success?{value:t.data}:{issues:t.error?.issues}}catch(t){return q(e,n).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}}),je=i("$ZodString",(e,n)=>{var t;Se.init(e,n),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??(t=e._zod.bag,new RegExp(`^${t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*"}$`)),e._zod.parse=(t,i)=>{if(n.coerce)try{t.value=String(t.value)}catch(i){}return"string"==typeof t.value||t.issues.push({expected:"string",code:"invalid_type",input:t.value,inst:e}),t}}),Ie=i("$ZodStringFormat",(e,n)=>{ke.init(e,n),je.init(e,n)}),Ce=i("$ZodGUID",(e,n)=>{n.pattern??(n.pattern=te),Ie.init(e,n)}),Ue=i("$ZodUUID",(e,n)=>{if(n.version){const e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[n.version];if(void 0===e)throw new Error(`Invalid UUID version: "${n.version}"`);n.pattern??(n.pattern=ie(e))}else n.pattern??(n.pattern=ie());Ie.init(e,n)}),Re=i("$ZodEmail",(e,n)=>{n.pattern??(n.pattern=oe),Ie.init(e,n)}),De=i("$ZodURL",(e,n)=>{Ie.init(e,n),e._zod.check=t=>{try{const i=t.value.trim(),o=new URL(i);return n.hostname&&(n.hostname.lastIndex=0,n.hostname.test(o.hostname)||t.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:de.source,input:t.value,inst:e,continue:!n.abort})),n.protocol&&(n.protocol.lastIndex=0,n.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||t.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:n.protocol.source,input:t.value,inst:e,continue:!n.abort})),void(n.normalize?t.value=o.href:t.value=i)}catch(i){t.issues.push({code:"invalid_format",format:"url",input:t.value,inst:e,continue:!n.abort})}}}),qe=i("$ZodEmoji",(e,n)=>{n.pattern??(n.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Ie.init(e,n)}),Ne=i("$ZodNanoID",(e,n)=>{n.pattern??(n.pattern=ee),Ie.init(e,n)}),Le=i("$ZodCUID",(e,n)=>{n.pattern??(n.pattern=G),Ie.init(e,n)}),Ve=i("$ZodCUID2",(e,n)=>{n.pattern??(n.pattern=H),Ie.init(e,n)}),We=i("$ZodULID",(e,n)=>{n.pattern??(n.pattern=Y),Ie.init(e,n)}),Me=i("$ZodXID",(e,n)=>{n.pattern??(n.pattern=Q),Ie.init(e,n)}),Be=i("$ZodKSUID",(e,n)=>{n.pattern??(n.pattern=X),Ie.init(e,n)}),Je=i("$ZodISODateTime",(e,n)=>{n.pattern??(n.pattern=function(e){const n=he({precision:e.precision}),t=["Z"];e.local&&t.push(""),e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const i=`${n}(?:${t.join("|")})`;return new RegExp(`^${fe}T(?:${i})$`)}(n)),Ie.init(e,n)}),Ke=i("$ZodISODate",(e,n)=>{n.pattern??(n.pattern=me),Ie.init(e,n)}),Ge=i("$ZodISOTime",(e,n)=>{n.pattern??(n.pattern=new RegExp(`^${he(n)}$`)),Ie.init(e,n)}),He=i("$ZodISODuration",(e,n)=>{n.pattern??(n.pattern=ne),Ie.init(e,n)}),Ye=i("$ZodIPv4",(e,n)=>{n.pattern??(n.pattern=re),Ie.init(e,n),e._zod.onattach.push(e=>{e._zod.bag.format="ipv4"})}),Qe=i("$ZodIPv6",(e,n)=>{n.pattern??(n.pattern=ae),Ie.init(e,n),e._zod.onattach.push(e=>{e._zod.bag.format="ipv6"}),e._zod.check=t=>{try{new URL(`http://[${t.value}]`)}catch{t.issues.push({code:"invalid_format",format:"ipv6",input:t.value,inst:e,continue:!n.abort})}}}),Xe=i("$ZodCIDRv4",(e,n)=>{n.pattern??(n.pattern=se),Ie.init(e,n)}),en=i("$ZodCIDRv6",(e,n)=>{n.pattern??(n.pattern=le),Ie.init(e,n),e._zod.check=t=>{const i=t.value.split("/");try{if(2!==i.length)throw new Error;const[e,n]=i;if(!n)throw new Error;const t=Number(n);if(`${t}`!==n)throw new Error;if(t<0||t>128)throw new Error;new URL(`http://[${e}]`)}catch{t.issues.push({code:"invalid_format",format:"cidrv6",input:t.value,inst:e,continue:!n.abort})}}});function nn(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const tn=i("$ZodBase64",(e,n)=>{n.pattern??(n.pattern=ce),Ie.init(e,n),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding="base64"}),e._zod.check=t=>{nn(t.value)||t.issues.push({code:"invalid_format",format:"base64",input:t.value,inst:e,continue:!n.abort})}});const on=i("$ZodBase64URL",(e,n)=>{n.pattern??(n.pattern=ue),Ie.init(e,n),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding="base64url"}),e._zod.check=t=>{(function(e){if(!ue.test(e))return!1;const n=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return nn(n.padEnd(4*Math.ceil(n.length/4),"="))})(t.value)||t.issues.push({code:"invalid_format",format:"base64url",input:t.value,inst:e,continue:!n.abort})}}),rn=i("$ZodE164",(e,n)=>{n.pattern??(n.pattern=pe),Ie.init(e,n)});const an=i("$ZodJWT",(e,n)=>{Ie.init(e,n),e._zod.check=t=>{(function(e,n=null){try{const t=e.split(".");if(3!==t.length)return!1;const[i]=t;if(!i)return!1;const o=JSON.parse(atob(i));return!("typ"in o&&"JWT"!==o?.typ||!o.alg||n&&(!("alg"in o)||o.alg!==n))}catch{return!1}})(t.value,n.alg)||t.issues.push({code:"invalid_format",format:"jwt",input:t.value,inst:e,continue:!n.abort})}}),sn=i("$ZodBoolean",(e,n)=>{Se.init(e,n),e._zod.pattern=_e,e._zod.parse=(t,i)=>{if(n.coerce)try{t.value=Boolean(t.value)}catch(e){}const o=t.value;return"boolean"==typeof o||t.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),t}}),ln=i("$ZodUnknown",(e,n)=>{Se.init(e,n),e._zod.parse=e=>e}),cn=i("$ZodNever",(e,n)=>{Se.init(e,n),e._zod.parse=(n,t)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function un(e,n,t){e.issues.length&&n.issues.push(...Z(t,e.issues)),n.value[t]=e.value}const dn=i("$ZodArray",(e,n)=>{Se.init(e,n),e._zod.parse=(t,i)=>{const o=t.value;if(!Array.isArray(o))return t.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),t;t.value=Array(o.length);const r=[];for(let e=0;e<o.length;e++){const a=o[e],s=n.element._zod.run({value:a,issues:[]},i);s instanceof Promise?r.push(s.then(n=>un(n,t,e))):un(s,t,e)}return r.length?Promise.all(r).then(()=>t):t}});function pn(e,n,t,i){e.issues.length&&n.issues.push(...Z(t,e.issues)),void 0===e.value?t in i&&(n.value[t]=void 0):n.value[t]=e.value}function fn(e){const n=Object.keys(e.shape);for(const t of n)if(!e.shape?.[t]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${t}": expected a Zod schema`);const t=(i=e.shape,Object.keys(i).filter(e=>"optional"===i[e]._zod.optin&&"optional"===i[e]._zod.optout));var i;return{...e,keys:n,keySet:new Set(n),numKeys:n.length,optionalKeys:new Set(t)}}function mn(e,n,t,i,o,r){const a=[],s=o.keySet,l=o.catchall._zod,c=l.def.type;for(const o of Object.keys(n)){if(s.has(o))continue;if("never"===c){a.push(o);continue}const r=l.run({value:n[o],issues:[]},i);r instanceof Promise?e.push(r.then(e=>pn(e,t,o,n))):pn(r,t,o,n)}return a.length&&t.issues.push({code:"unrecognized_keys",keys:a,input:n,inst:r}),e.length?Promise.all(e).then(()=>t):t}const hn=i("$ZodObject",(e,n)=>{Se.init(e,n);const t=Object.getOwnPropertyDescriptor(n,"shape");if(!t?.get){const e=n.shape;Object.defineProperty(n,"shape",{get:()=>{const t={...e};return Object.defineProperty(n,"shape",{value:t}),t}})}const i=c(()=>fn(n));f(e._zod,"propValues",()=>{const e=n.shape,t={};for(const n in e){const i=e[n]._zod;if(i.values){t[n]??(t[n]=new Set);for(const e of i.values)t[n].add(e)}}return t});const o=y,r=n.catchall;let a;e._zod.parse=(n,t)=>{a??(a=i.value);const s=n.value;if(!o(s))return n.issues.push({expected:"object",code:"invalid_type",input:s,inst:e}),n;n.value={};const l=[],c=a.shape;for(const e of a.keys){const i=c[e]._zod.run({value:s[e],issues:[]},t);i instanceof Promise?l.push(i.then(t=>pn(t,n,e,s))):pn(i,n,e,s)}return r?mn(l,s,n,t,i.value,e):l.length?Promise.all(l).then(()=>n):n}}),_n=i("$ZodObjectJIT",(e,n)=>{hn.init(e,n);const t=e._zod.parse,i=c(()=>fn(n));let o;const r=y,s=!a.jitless,l=s&&v.value,u=n.catchall;let d;e._zod.parse=(a,c)=>{d??(d=i.value);const p=a.value;return r(p)?s&&l&&!1===c?.async&&!0!==c.jitless?(o||(o=(e=>{const n=new Oe(["shape","payload","ctx"]),t=i.value,o=e=>{const n=_(e);return`shape[${n}]._zod.run({ value: input[${n}], issues: [] }, ctx)`};n.write("const input = payload.value;");const r=Object.create(null);let a=0;for(const e of t.keys)r[e]="key_"+a++;n.write("const newResult = {};");for(const e of t.keys){const t=r[e],i=_(e);n.write(`const ${t} = ${o(e)};`),n.write(`\n if (${t}.issues.length) {\n payload.issues = payload.issues.concat(${t}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${i}, ...iss.path] : [${i}]\n })));\n }\n \n \n if (${t}.value === undefined) {\n if (${i} in input) {\n newResult[${i}] = undefined;\n }\n } else {\n newResult[${i}] = ${t}.value;\n }\n \n `)}n.write("payload.value = newResult;"),n.write("return payload;");const s=n.compile();return(n,t)=>s(e,n,t)})(n.shape)),a=o(a,c),u?mn([],p,a,c,d,e):a):t(a,c):(a.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),a)}});function gn(e,n,t,i){for(const t of e)if(0===t.issues.length)return n.value=t.value,n;const o=e.filter(e=>!E(e));return 1===o.length?(n.value=o[0].value,o[0]):(n.issues.push({code:"invalid_union",input:n.value,inst:t,errors:e.map(e=>e.issues.map(e=>P(e,i,s())))}),n)}const yn=i("$ZodUnion",(e,n)=>{Se.init(e,n),f(e._zod,"optin",()=>n.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),f(e._zod,"optout",()=>n.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),f(e._zod,"values",()=>{if(n.options.every(e=>e._zod.values))return new Set(n.options.flatMap(e=>Array.from(e._zod.values)))}),f(e._zod,"pattern",()=>{if(n.options.every(e=>e._zod.pattern)){const e=n.options.map(e=>e._zod.pattern);return new RegExp(`^(${e.map(e=>d(e.source)).join("|")})$`)}});const t=1===n.options.length,i=n.options[0]._zod.run;e._zod.parse=(o,r)=>{if(t)return i(o,r);let a=!1;const s=[];for(const e of n.options){const n=e._zod.run({value:o.value,issues:[]},r);if(n instanceof Promise)s.push(n),a=!0;else{if(0===n.issues.length)return n;s.push(n)}}return a?Promise.all(s).then(n=>gn(n,o,e,r)):gn(s,o,e,r)}}),vn=i("$ZodIntersection",(e,n)=>{Se.init(e,n),e._zod.parse=(e,t)=>{const i=e.value,o=n.left._zod.run({value:i,issues:[]},t),r=n.right._zod.run({value:i,issues:[]},t);return o instanceof Promise||r instanceof Promise?Promise.all([o,r]).then(([n,t])=>bn(e,n,t)):bn(e,o,r)}});function wn(e,n){if(e===n)return{valid:!0,data:e};if(e instanceof Date&&n instanceof Date&&+e===+n)return{valid:!0,data:e};if(w(e)&&w(n)){const t=Object.keys(n),i=Object.keys(e).filter(e=>-1!==t.indexOf(e)),o={...e,...n};for(const t of i){const i=wn(e[t],n[t]);if(!i.valid)return{valid:!1,mergeErrorPath:[t,...i.mergeErrorPath]};o[t]=i.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(n)){if(e.length!==n.length)return{valid:!1,mergeErrorPath:[]};const t=[];for(let i=0;i<e.length;i++){const o=wn(e[i],n[i]);if(!o.valid)return{valid:!1,mergeErrorPath:[i,...o.mergeErrorPath]};t.push(o.data)}return{valid:!0,data:t}}return{valid:!1,mergeErrorPath:[]}}function bn(e,n,t){if(n.issues.length&&e.issues.push(...n.issues),t.issues.length&&e.issues.push(...t.issues),E(e))return e;const i=wn(n.value,t.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}const zn=i("$ZodRecord",(e,n)=>{Se.init(e,n),e._zod.parse=(t,i)=>{const o=t.value;if(!w(o))return t.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),t;const r=[];if(n.keyType._zod.values){const a=n.keyType._zod.values;t.value={};for(const e of a)if("string"==typeof e||"number"==typeof e||"symbol"==typeof e){const a=n.valueType._zod.run({value:o[e],issues:[]},i);a instanceof Promise?r.push(a.then(n=>{n.issues.length&&t.issues.push(...Z(e,n.issues)),t.value[e]=n.value})):(a.issues.length&&t.issues.push(...Z(e,a.issues)),t.value[e]=a.value)}let s;for(const e in o)a.has(e)||(s=s??[],s.push(e));s&&s.length>0&&t.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:s})}else{t.value={};for(const a of Reflect.ownKeys(o)){if("__proto__"===a)continue;const l=n.keyType._zod.run({value:a,issues:[]},i);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(l.issues.length){t.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(e=>P(e,i,s())),input:a,path:[a],inst:e}),t.value[l.value]=l.value;continue}const c=n.valueType._zod.run({value:o[a],issues:[]},i);c instanceof Promise?r.push(c.then(e=>{e.issues.length&&t.issues.push(...Z(a,e.issues)),t.value[l.value]=e.value})):(c.issues.length&&t.issues.push(...Z(a,c.issues)),t.value[l.value]=c.value)}}return r.length?Promise.all(r).then(()=>t):t}}),kn=i("$ZodEnum",(e,n)=>{Se.init(e,n);const t=function(e){const n=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,t])=>-1===n.indexOf(+e)).map(([e,n])=>n)}(n.entries),i=new Set(t);e._zod.values=i,e._zod.pattern=new RegExp(`^(${t.filter(e=>z.has(typeof e)).map(e=>"string"==typeof e?k(e):e.toString()).join("|")})$`),e._zod.parse=(n,o)=>{const r=n.value;return i.has(r)||n.issues.push({code:"invalid_value",values:t,input:r,inst:e}),n}}),$n=i("$ZodLiteral",(e,n)=>{if(Se.init(e,n),0===n.values.length)throw new Error("Cannot create literal schema with no valid values");e._zod.values=new Set(n.values),e._zod.pattern=new RegExp(`^(${n.values.map(e=>"string"==typeof e?k(e):e?k(e.toString()):String(e)).join("|")})$`),e._zod.parse=(t,i)=>{const o=t.value;return e._zod.values.has(o)||t.issues.push({code:"invalid_value",values:n.values,input:o,inst:e}),t}}),xn=i("$ZodTransform",(e,n)=>{Se.init(e,n),e._zod.parse=(t,i)=>{if("backward"===i.direction)throw new r(e.constructor.name);const a=n.transform(t.value,t);if(i.async){return(a instanceof Promise?a:Promise.resolve(a)).then(e=>(t.value=e,t))}if(a instanceof Promise)throw new o;return t.value=a,t}});function En(e,n){return e.issues.length&&void 0===n?{issues:[],value:void 0}:e}const Zn=i("$ZodOptional",(e,n)=>{Se.init(e,n),e._zod.optin="optional",e._zod.optout="optional",f(e._zod,"values",()=>n.innerType._zod.values?new Set([...n.innerType._zod.values,void 0]):void 0),f(e._zod,"pattern",()=>{const e=n.innerType._zod.pattern;return e?new RegExp(`^(${d(e.source)})?$`):void 0}),e._zod.parse=(e,t)=>{if("optional"===n.innerType._zod.optin){const i=n.innerType._zod.run(e,t);return i instanceof Promise?i.then(n=>En(n,e.value)):En(i,e.value)}return void 0===e.value?e:n.innerType._zod.run(e,t)}}),An=i("$ZodNullable",(e,n)=>{Se.init(e,n),f(e._zod,"optin",()=>n.innerType._zod.optin),f(e._zod,"optout",()=>n.innerType._zod.optout),f(e._zod,"pattern",()=>{const e=n.innerType._zod.pattern;return e?new RegExp(`^(${d(e.source)}|null)$`):void 0}),f(e._zod,"values",()=>n.innerType._zod.values?new Set([...n.innerType._zod.values,null]):void 0),e._zod.parse=(e,t)=>null===e.value?e:n.innerType._zod.run(e,t)}),Pn=i("$ZodDefault",(e,n)=>{Se.init(e,n),e._zod.optin="optional",f(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(e,t)=>{if("backward"===t.direction)return n.innerType._zod.run(e,t);if(void 0===e.value)return e.value=n.defaultValue,e;const i=n.innerType._zod.run(e,t);return i instanceof Promise?i.then(e=>Tn(e,n)):Tn(i,n)}});function Tn(e,n){return void 0===e.value&&(e.value=n.defaultValue),e}const On=i("$ZodPrefault",(e,n)=>{Se.init(e,n),e._zod.optin="optional",f(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(e,t)=>("backward"===t.direction||void 0===e.value&&(e.value=n.defaultValue),n.innerType._zod.run(e,t))}),Fn=i("$ZodNonOptional",(e,n)=>{Se.init(e,n),f(e._zod,"values",()=>{const e=n.innerType._zod.values;return e?new Set([...e].filter(e=>void 0!==e)):void 0}),e._zod.parse=(t,i)=>{const o=n.innerType._zod.run(t,i);return o instanceof Promise?o.then(n=>Sn(n,e)):Sn(o,e)}});function Sn(e,n){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:n}),e}const jn=i("$ZodCatch",(e,n)=>{Se.init(e,n),f(e._zod,"optin",()=>n.innerType._zod.optin),f(e._zod,"optout",()=>n.innerType._zod.optout),f(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(e,t)=>{if("backward"===t.direction)return n.innerType._zod.run(e,t);const i=n.innerType._zod.run(e,t);return i instanceof Promise?i.then(i=>(e.value=i.value,i.issues.length&&(e.value=n.catchValue({...e,error:{issues:i.issues.map(e=>P(e,t,s()))},input:e.value}),e.issues=[]),e)):(e.value=i.value,i.issues.length&&(e.value=n.catchValue({...e,error:{issues:i.issues.map(e=>P(e,t,s()))},input:e.value}),e.issues=[]),e)}}),In=i("$ZodPipe",(e,n)=>{Se.init(e,n),f(e._zod,"values",()=>n.in._zod.values),f(e._zod,"optin",()=>n.in._zod.optin),f(e._zod,"optout",()=>n.out._zod.optout),f(e._zod,"propValues",()=>n.in._zod.propValues),e._zod.parse=(e,t)=>{if("backward"===t.direction){const i=n.out._zod.run(e,t);return i instanceof Promise?i.then(e=>Cn(e,n.in,t)):Cn(i,n.in,t)}const i=n.in._zod.run(e,t);return i instanceof Promise?i.then(e=>Cn(e,n.out,t)):Cn(i,n.out,t)}});function Cn(e,n,t){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:e.value,issues:e.issues},t)}const Un=i("$ZodReadonly",(e,n)=>{Se.init(e,n),f(e._zod,"propValues",()=>n.innerType._zod.propValues),f(e._zod,"values",()=>n.innerType._zod.values),f(e._zod,"optin",()=>n.innerType._zod.optin),f(e._zod,"optout",()=>n.innerType._zod.optout),e._zod.parse=(e,t)=>{if("backward"===t.direction)return n.innerType._zod.run(e,t);const i=n.innerType._zod.run(e,t);return i instanceof Promise?i.then(Rn):Rn(i)}});function Rn(e){return e.value=Object.freeze(e.value),e}const Dn=i("$ZodCustom",(e,n)=>{ve.init(e,n),Se.init(e,n),e._zod.parse=(e,n)=>e,e._zod.check=t=>{const i=t.value,o=n.fn(i);if(o instanceof Promise)return o.then(n=>qn(n,t,i,e));qn(o,t,i,e)}});function qn(e,n,t,i){if(!e){const e={code:"custom",input:t,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(e.params=i._zod.def.params),n.issues.push(O(e))}}class Nn{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...n){const t=n[0];if(this._map.set(e,t),t&&"object"==typeof t&&"id"in t){if(this._idmap.has(t.id))throw new Error(`ID ${t.id} already exists in the registry`);this._idmap.set(t.id,e)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){const n=this._map.get(e);return n&&"object"==typeof n&&"id"in n&&this._idmap.delete(n.id),this._map.delete(e),this}get(e){const n=e._zod.parent;if(n){const t={...this.get(n)??{}};delete t.id;const i={...t,...this._map.get(e)};return Object.keys(i).length?i:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function Ln(){return new Nn}const Vn=Ln();function Wn(e,n){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...x(n)})}function Mn(e,n){return new we({check:"max_length",...x(n),maximum:e})}function Bn(e,n){return new be({check:"min_length",...x(n),minimum:e})}function Jn(e,n){return new ze({check:"length_equals",...x(n),length:e})}function Kn(e){return new Te({check:"overwrite",tx:e})}function Gn(e){const n=function(e,n){const t=new ve({check:"custom",...x(n)});return t._zod.check=e,t}(t=>(t.addIssue=e=>{if("string"==typeof e)t.issues.push(O(e,t.value,n._zod.def));else{const i=e;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=t.value),i.inst??(i.inst=n),i.continue??(i.continue=!n._zod.def.abort),t.issues.push(O(i))}},e(t.value,t)));return n}const Hn=i("ZodISODateTime",(e,n)=>{Je.init(e,n),bt.init(e,n)});function Yn(e){return function(e,n){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...x(n)})}(Hn,e)}const Qn=i("ZodISODate",(e,n)=>{Ke.init(e,n),bt.init(e,n)});function Xn(e){return function(e,n){return new e({type:"string",format:"date",check:"string_format",...x(n)})}(Qn,e)}const et=i("ZodISOTime",(e,n)=>{Ge.init(e,n),bt.init(e,n)});function nt(e){return function(e,n){return new e({type:"string",format:"time",check:"string_format",precision:null,...x(n)})}(et,e)}const tt=i("ZodISODuration",(e,n)=>{He.init(e,n),bt.init(e,n)});function it(e){return function(e,n){return new e({type:"string",format:"duration",check:"string_format",...x(n)})}(tt,e)}const ot=i("ZodError",(e,n)=>{S.init(e,n),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>function(e,n=e=>e.message){const t={_errors:[]},i=e=>{for(const o of e.issues)if("invalid_union"===o.code&&o.errors.length)o.errors.map(e=>i({issues:e}));else if("invalid_key"===o.code)i({issues:o.issues});else if("invalid_element"===o.code)i({issues:o.issues});else if(0===o.path.length)t._errors.push(n(o));else{let e=t,i=0;for(;i<o.path.length;){const t=o.path[i];i===o.path.length-1?(e[t]=e[t]||{_errors:[]},e[t]._errors.push(n(o))):e[t]=e[t]||{_errors:[]},e=e[t],i++}}};return i(e),t}(e,n)},flatten:{value:n=>function(e,n=e=>e.message){const t={},i=[];for(const o of e.issues)o.path.length>0?(t[o.path[0]]=t[o.path[0]]||[],t[o.path[0]].push(n(o))):i.push(n(o));return{formErrors:i,fieldErrors:t}}(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,l,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,l,2)}},isEmpty:{get:()=>0===e.issues.length}})},{Parent:Error}),rt=I(ot),at=C(ot),st=U(ot),lt=D(ot),ct=N(ot),ut=L(ot),dt=V(ot),pt=W(ot),ft=M(ot),mt=B(ot),ht=J(ot),_t=K(ot),gt=i("ZodType",(e,n)=>(Se.init(e,n),e.def=n,e.type=n.type,Object.defineProperty(e,"_def",{value:n}),e.check=(...t)=>e.clone(h(n,{checks:[...n.checks??[],...t.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]})),e.clone=(n,t)=>$(e,n,t),e.brand=()=>e,e.register=(n,t)=>(n.add(e,t),e),e.parse=(n,t)=>rt(e,n,t,{callee:e.parse}),e.safeParse=(n,t)=>st(e,n,t),e.parseAsync=async(n,t)=>at(e,n,t,{callee:e.parseAsync}),e.safeParseAsync=async(n,t)=>lt(e,n,t),e.spa=e.safeParseAsync,e.encode=(n,t)=>ct(e,n,t),e.decode=(n,t)=>ut(e,n,t),e.encodeAsync=async(n,t)=>dt(e,n,t),e.decodeAsync=async(n,t)=>pt(e,n,t),e.safeEncode=(n,t)=>ft(e,n,t),e.safeDecode=(n,t)=>mt(e,n,t),e.safeEncodeAsync=async(n,t)=>ht(e,n,t),e.safeDecodeAsync=async(n,t)=>_t(e,n,t),e.refine=(n,t)=>e.check(function(e,n={}){return function(e,n,t){return new e({type:"custom",check:"custom",fn:n,...x(t)})}(yi,e,n)}(n,t)),e.superRefine=n=>e.check(Gn(n)),e.overwrite=n=>e.check(Kn(n)),e.optional=()=>li(e),e.nullable=()=>ui(e),e.nullish=()=>li(ui(e)),e.nonoptional=n=>function(e,n){return new fi({type:"nonoptional",innerType:e,...x(n)})}(e,n),e.array=()=>Kt(e),e.or=n=>Qt([e,n]),e.and=n=>new Xt({type:"intersection",left:e,right:n}),e.transform=n=>_i(e,new ai({type:"transform",transform:n})),e.default=n=>{return t=n,new di({type:"default",innerType:e,get defaultValue(){return"function"==typeof t?t():b(t)}});var t},e.prefault=n=>{return t=n,new pi({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof t?t():b(t)}});var t},e.catch=n=>{return new mi({type:"catch",innerType:e,catchValue:"function"==typeof(t=n)?t:()=>t});var t},e.pipe=n=>_i(e,n),e.readonly=()=>new gi({type:"readonly",innerType:e}),e.describe=n=>{const t=e.clone();return Vn.add(t,{description:n}),t},Object.defineProperty(e,"description",{get:()=>Vn.get(e)?.description,configurable:!0}),e.meta=(...n)=>{if(0===n.length)return Vn.get(e);const t=e.clone();return Vn.add(t,n[0]),t},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),yt=i("_ZodString",(e,n)=>{je.init(e,n),gt.init(e,n);const t=e._zod.bag;e.format=t.format??null,e.minLength=t.minimum??null,e.maxLength=t.maximum??null,e.regex=(...n)=>e.check(function(e,n){return new $e({check:"string_format",format:"regex",...x(n),pattern:e})}(...n)),e.includes=(...n)=>e.check(function(e,n){return new Ze({check:"string_format",format:"includes",...x(n),includes:e})}(...n)),e.startsWith=(...n)=>e.check(function(e,n){return new Ae({check:"string_format",format:"starts_with",...x(n),prefix:e})}(...n)),e.endsWith=(...n)=>e.check(function(e,n){return new Pe({check:"string_format",format:"ends_with",...x(n),suffix:e})}(...n)),e.min=(...n)=>e.check(Bn(...n)),e.max=(...n)=>e.check(Mn(...n)),e.length=(...n)=>e.check(Jn(...n)),e.nonempty=(...n)=>e.check(Bn(1,...n)),e.lowercase=n=>e.check(function(e){return new xe({check:"string_format",format:"lowercase",...x(e)})}(n)),e.uppercase=n=>e.check(function(e){return new Ee({check:"string_format",format:"uppercase",...x(e)})}(n)),e.trim=()=>e.check(Kn(e=>e.trim())),e.normalize=(...n)=>e.check(function(e){return Kn(n=>n.normalize(e))}(...n)),e.toLowerCase=()=>e.check(Kn(e=>e.toLowerCase())),e.toUpperCase=()=>e.check(Kn(e=>e.toUpperCase()))}),vt=i("ZodString",(e,n)=>{je.init(e,n),yt.init(e,n),e.email=n=>e.check(function(e,n){return new e({type:"string",format:"email",check:"string_format",abort:!1,...x(n)})}(zt,n)),e.url=n=>e.check(function(e,n){return new e({type:"string",format:"url",check:"string_format",abort:!1,...x(n)})}(xt,n)),e.jwt=n=>e.check(function(e,n){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...x(n)})}(qt,n)),e.emoji=n=>e.check(function(e,n){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...x(n)})}(Et,n)),e.guid=n=>e.check(Wn(kt,n)),e.uuid=n=>e.check(function(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...x(n)})}($t,n)),e.uuidv4=n=>e.check(function(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...x(n)})}($t,n)),e.uuidv6=n=>e.check(function(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...x(n)})}($t,n)),e.uuidv7=n=>e.check(function(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...x(n)})}($t,n)),e.nanoid=n=>e.check(function(e,n){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...x(n)})}(Zt,n)),e.guid=n=>e.check(Wn(kt,n)),e.cuid=n=>e.check(function(e,n){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...x(n)})}(At,n)),e.cuid2=n=>e.check(function(e,n){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...x(n)})}(Pt,n)),e.ulid=n=>e.check(function(e,n){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...x(n)})}(Tt,n)),e.base64=n=>e.check(function(e,n){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...x(n)})}(Ut,n)),e.base64url=n=>e.check(function(e,n){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...x(n)})}(Rt,n)),e.xid=n=>e.check(function(e,n){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...x(n)})}(Ot,n)),e.ksuid=n=>e.check(function(e,n){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...x(n)})}(Ft,n)),e.ipv4=n=>e.check(function(e,n){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...x(n)})}(St,n)),e.ipv6=n=>e.check(function(e,n){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...x(n)})}(jt,n)),e.cidrv4=n=>e.check(function(e,n){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...x(n)})}(It,n)),e.cidrv6=n=>e.check(function(e,n){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...x(n)})}(Ct,n)),e.e164=n=>e.check(function(e,n){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...x(n)})}(Dt,n)),e.datetime=n=>e.check(Yn(n)),e.date=n=>e.check(Xn(n)),e.time=n=>e.check(nt(n)),e.duration=n=>e.check(it(n))});function wt(e){return function(e,n){return new e({type:"string",...x(n)})}(vt,e)}const bt=i("ZodStringFormat",(e,n)=>{Ie.init(e,n),yt.init(e,n)}),zt=i("ZodEmail",(e,n)=>{Re.init(e,n),bt.init(e,n)}),kt=i("ZodGUID",(e,n)=>{Ce.init(e,n),bt.init(e,n)}),$t=i("ZodUUID",(e,n)=>{Ue.init(e,n),bt.init(e,n)}),xt=i("ZodURL",(e,n)=>{De.init(e,n),bt.init(e,n)}),Et=i("ZodEmoji",(e,n)=>{qe.init(e,n),bt.init(e,n)}),Zt=i("ZodNanoID",(e,n)=>{Ne.init(e,n),bt.init(e,n)}),At=i("ZodCUID",(e,n)=>{Le.init(e,n),bt.init(e,n)}),Pt=i("ZodCUID2",(e,n)=>{Ve.init(e,n),bt.init(e,n)}),Tt=i("ZodULID",(e,n)=>{We.init(e,n),bt.init(e,n)}),Ot=i("ZodXID",(e,n)=>{Me.init(e,n),bt.init(e,n)}),Ft=i("ZodKSUID",(e,n)=>{Be.init(e,n),bt.init(e,n)}),St=i("ZodIPv4",(e,n)=>{Ye.init(e,n),bt.init(e,n)}),jt=i("ZodIPv6",(e,n)=>{Qe.init(e,n),bt.init(e,n)}),It=i("ZodCIDRv4",(e,n)=>{Xe.init(e,n),bt.init(e,n)}),Ct=i("ZodCIDRv6",(e,n)=>{en.init(e,n),bt.init(e,n)}),Ut=i("ZodBase64",(e,n)=>{tn.init(e,n),bt.init(e,n)}),Rt=i("ZodBase64URL",(e,n)=>{on.init(e,n),bt.init(e,n)}),Dt=i("ZodE164",(e,n)=>{rn.init(e,n),bt.init(e,n)}),qt=i("ZodJWT",(e,n)=>{an.init(e,n),bt.init(e,n)}),Nt=i("ZodBoolean",(e,n)=>{sn.init(e,n),gt.init(e,n)});function Lt(e){return function(e,n){return new e({type:"boolean",...x(n)})}(Nt,e)}const Vt=i("ZodUnknown",(e,n)=>{ln.init(e,n),gt.init(e,n)});function Wt(){return new Vt({type:"unknown"})}const Mt=i("ZodNever",(e,n)=>{cn.init(e,n),gt.init(e,n)});function Bt(e){return function(e,n){return new e({type:"never",...x(n)})}(Mt,e)}const Jt=i("ZodArray",(e,n)=>{dn.init(e,n),gt.init(e,n),e.element=n.element,e.min=(n,t)=>e.check(Bn(n,t)),e.nonempty=n=>e.check(Bn(1,n)),e.max=(n,t)=>e.check(Mn(n,t)),e.length=(n,t)=>e.check(Jn(n,t)),e.unwrap=()=>e.element});function Kt(e,n){return function(e,n,t){return new e({type:"array",element:n,...x(t)})}(Jt,e,n)}const Gt=i("ZodObject",(e,n)=>{_n.init(e,n),gt.init(e,n),f(e,"shape",()=>n.shape),e.keyof=()=>ii(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Wt()}),e.loose=()=>e.clone({...e._zod.def,catchall:Wt()}),e.strict=()=>e.clone({...e._zod.def,catchall:Bt()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>function(e,n){if(!w(n))throw new Error("Invalid input to extend: expected a plain object");const t=e._zod.def.checks;if(t&&t.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const i=h(e._zod.def,{get shape(){const t={...e._zod.def.shape,...n};return m(this,"shape",t),t},checks:[]});return $(e,i)}(e,n),e.safeExtend=n=>function(e,n){if(!w(n))throw new Error("Invalid input to safeExtend: expected a plain object");const t={...e._zod.def,get shape(){const t={...e._zod.def.shape,...n};return m(this,"shape",t),t},checks:e._zod.def.checks};return $(e,t)}(e,n),e.merge=n=>function(e,n){const t=h(e._zod.def,{get shape(){const t={...e._zod.def.shape,...n._zod.def.shape};return m(this,"shape",t),t},get catchall(){return n._zod.def.catchall},checks:[]});return $(e,t)}(e,n),e.pick=n=>function(e,n){const t=e._zod.def;return $(e,h(e._zod.def,{get shape(){const e={};for(const i in n){if(!(i in t.shape))throw new Error(`Unrecognized key: "${i}"`);n[i]&&(e[i]=t.shape[i])}return m(this,"shape",e),e},checks:[]}))}(e,n),e.omit=n=>function(e,n){const t=e._zod.def,i=h(e._zod.def,{get shape(){const i={...e._zod.def.shape};for(const e in n){if(!(e in t.shape))throw new Error(`Unrecognized key: "${e}"`);n[e]&&delete i[e]}return m(this,"shape",i),i},checks:[]});return $(e,i)}(e,n),e.partial=(...n)=>function(e,n,t){const i=h(n._zod.def,{get shape(){const i=n._zod.def.shape,o={...i};if(t)for(const n in t){if(!(n in i))throw new Error(`Unrecognized key: "${n}"`);t[n]&&(o[n]=e?new e({type:"optional",innerType:i[n]}):i[n])}else for(const n in i)o[n]=e?new e({type:"optional",innerType:i[n]}):i[n];return m(this,"shape",o),o},checks:[]});return $(n,i)}(si,e,n[0]),e.required=(...n)=>function(e,n,t){const i=h(n._zod.def,{get shape(){const i=n._zod.def.shape,o={...i};if(t)for(const n in t){if(!(n in o))throw new Error(`Unrecognized key: "${n}"`);t[n]&&(o[n]=new e({type:"nonoptional",innerType:i[n]}))}else for(const n in i)o[n]=new e({type:"nonoptional",innerType:i[n]});return m(this,"shape",o),o},checks:[]});return $(n,i)}(fi,e,n[0])});function Ht(e,n){const t={type:"object",shape:e??{},...x(n)};return new Gt(t)}const Yt=i("ZodUnion",(e,n)=>{yn.init(e,n),gt.init(e,n),e.options=n.options});function Qt(e,n){return new Yt({type:"union",options:e,...x(n)})}const Xt=i("ZodIntersection",(e,n)=>{vn.init(e,n),gt.init(e,n)});const ei=i("ZodRecord",(e,n)=>{zn.init(e,n),gt.init(e,n),e.keyType=n.keyType,e.valueType=n.valueType});function ni(e,n,t){return new ei({type:"record",keyType:e,valueType:n,...x(t)})}const ti=i("ZodEnum",(e,n)=>{kn.init(e,n),gt.init(e,n),e.enum=n.entries,e.options=Object.values(n.entries);const t=new Set(Object.keys(n.entries));e.extract=(e,i)=>{const o={};for(const i of e){if(!t.has(i))throw new Error(`Key ${i} not found in enum`);o[i]=n.entries[i]}return new ti({...n,checks:[],...x(i),entries:o})},e.exclude=(e,i)=>{const o={...n.entries};for(const n of e){if(!t.has(n))throw new Error(`Key ${n} not found in enum`);delete o[n]}return new ti({...n,checks:[],...x(i),entries:o})}});function ii(e,n){const t=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new ti({type:"enum",entries:t,...x(n)})}const oi=i("ZodLiteral",(e,n)=>{$n.init(e,n),gt.init(e,n),e.values=new Set(n.values),Object.defineProperty(e,"value",{get(){if(n.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return n.values[0]}})});function ri(e,n){return new oi({type:"literal",values:Array.isArray(e)?e:[e],...x(n)})}const ai=i("ZodTransform",(e,n)=>{xn.init(e,n),gt.init(e,n),e._zod.parse=(t,i)=>{if("backward"===i.direction)throw new r(e.constructor.name);t.addIssue=i=>{if("string"==typeof i)t.issues.push(O(i,t.value,n));else{const n=i;n.fatal&&(n.continue=!1),n.code??(n.code="custom"),n.input??(n.input=t.value),n.inst??(n.inst=e),t.issues.push(O(n))}};const o=n.transform(t.value,t);return o instanceof Promise?o.then(e=>(t.value=e,t)):(t.value=o,t)}});const si=i("ZodOptional",(e,n)=>{Zn.init(e,n),gt.init(e,n),e.unwrap=()=>e._zod.def.innerType});function li(e){return new si({type:"optional",innerType:e})}const ci=i("ZodNullable",(e,n)=>{An.init(e,n),gt.init(e,n),e.unwrap=()=>e._zod.def.innerType});function ui(e){return new ci({type:"nullable",innerType:e})}const di=i("ZodDefault",(e,n)=>{Pn.init(e,n),gt.init(e,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});const pi=i("ZodPrefault",(e,n)=>{On.init(e,n),gt.init(e,n),e.unwrap=()=>e._zod.def.innerType});const fi=i("ZodNonOptional",(e,n)=>{Fn.init(e,n),gt.init(e,n),e.unwrap=()=>e._zod.def.innerType});const mi=i("ZodCatch",(e,n)=>{jn.init(e,n),gt.init(e,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});const hi=i("ZodPipe",(e,n)=>{In.init(e,n),gt.init(e,n),e.in=n.in,e.out=n.out});function _i(e,n){return new hi({type:"pipe",in:e,out:n})}const gi=i("ZodReadonly",(e,n)=>{Un.init(e,n),gt.init(e,n),e.unwrap=()=>e._zod.def.innerType});const yi=i("ZodCustom",(e,n)=>{Dn.init(e,n),gt.init(e,n)});const vi="directus:extension",wi=Ht({app:wt(),api:wt()}),bi=Ht({request:li(Ht({urls:Kt(wt()),methods:Kt(Qt([ri("GET"),ri("POST"),ri("PATCH"),ri("PUT"),ri("DELETE")]))})),log:li(Ht({})),sleep:li(Ht({}))}),zi=li(Ht({enabled:Lt(),requestedScopes:bi})),ki=Qt([Ht({type:ii(n),name:wt(),source:wt()}),Ht({type:ii(e),name:wt(),source:wt()}),Ht({type:ii(t),name:wt(),source:wi})]),$i=Ht({host:wt(),hidden:Lt().optional()}),xi=Ht({type:ii(e),path:wt(),source:wt()}),Ei=Ht({type:ii(n),path:wt(),source:wt(),sandbox:zi}),Zi=Ht({type:ii(t),path:wi,source:wi,sandbox:zi}),Ai=Ht({type:ri("bundle"),partial:Lt().optional(),path:wi,entries:Kt(ki)});Kt(ki);const Pi=$i.and(Qt([xi,Ei,Zi,Ai]));Ht({name:wt(),version:wt(),type:Qt([ri("module"),ri("commonjs")]).optional(),description:wt().optional(),icon:wt().optional(),dependencies:ni(wt(),wt()).optional(),devDependencies:ni(wt(),wt()).optional(),[vi]:Pi});var Ti={collections:[{collection:"language",meta:{collection:"language",icon:null,note:null,display_template:null,hidden:!1,singleton:!1,translations:null,archive_field:null,archive_app_filter:!0,archive_value:null,unarchive_value:null,sort_field:null,accountability:"all",color:null,item_duplication_fields:null,sort:1,group:"inframe_pasta",collapse:"open",preview_url:null,versioning:!1},schema:{}},{collection:"inframe",meta:{collection:"inframe",icon:null,note:null,display_template:null,hidden:!1,singleton:!1,translations:[{language:"en-US",translation:"Inframe",singular:"Inframe",plural:"Inframes"}],archive_field:"status",archive_app_filter:!0,archive_value:"archived",unarchive_value:"draft",sort_field:"sort",accountability:"all",color:null,item_duplication_fields:null,sort:2,group:"inframe_pasta",collapse:"open",preview_url:null,versioning:!1},schema:{}},{collection:"inframe_translation",meta:{collection:"inframe_translation",icon:"import_export",note:null,display_template:null,hidden:!0,singleton:!1,translations:null,archive_field:null,archive_app_filter:!0,archive_value:null,unarchive_value:null,sort_field:null,accountability:"all",color:null,item_duplication_fields:null,sort:3,group:"inframe_pasta",collapse:"open",preview_url:null,versioning:!1},schema:{}},{collection:"inframe_pasta",meta:{collection:"inframe_pasta",icon:"folder",note:null,display_template:null,hidden:!1,singleton:!1,translations:null,archive_field:null,archive_app_filter:!0,archive_value:null,unarchive_value:null,sort_field:null,accountability:"all",color:null,item_duplication_fields:null,sort:16,group:null,collapse:"open",preview_url:null,versioning:!1},schema:null}],fields:[{collection:"language",field:"code",type:"string",schema:{name:"code",table:"language",data_type:"character varying",default_value:null,generation_expression:null,max_length:255,numeric_precision:null,numeric_scale:null,is_generated:!1,is_nullable:!1,is_unique:!0,is_indexed:!1,is_primary_key:!0,has_auto_increment:!1,foreign_key_schema:null,foreign_key_table:null,foreign_key_column:null,comment:null},meta:{collection:"language",field:"code",special:null,interface:"input",options:null,display:null,display_options:null,readonly:!1,hidden:!1,sort:1,width:"full",translations:null,note:null,conditions:null,required:!1,group:null,validation:null,validation_message:null,searchable:!0}},{collection:"language",field:"name",type:"string",schema:{name:"name",table:"language",data_type:"character varying",default_value:null,generation_expression:null,max_length:255,numeric_precision:null,numeric_scale:null,is_generated:!1,is_nullable:!1,is_unique:!0,is_indexed:!0,is_primary_key:!1,has_auto_increment:!1,foreign_key_schema:null,foreign_key_table:null,foreign_key_column:null,comment:null},meta:{collection:"language",field:"name",special:null,interface:"input",options:null,display:null,display_options:null,readonly:!1,hidden:!1,sort:2,width:"full",translations:null,note:null,conditions:null,required:!1,group:null,validation:null,validation_message:null,searchable:!0}},{collection:"language",field:"direction",type:"string",schema:{name:"direction",table:"language",data_type:"character varying",default_value:null,generation_expression:null,max_length:255,numeric_precision:null,numeric_scale:null,is_generated:!1,is_nullable:!0,is_unique:!1,is_indexed:!1,is_primary_key:!1,has_auto_increment:!1,foreign_key_schema:null,foreign_key_table:null,foreign_key_column:null,comment:null},meta:{collection:"language",field:"direction",special:null,interface:"select-dropdown",options:{choices:[{text:"ltr",value:"ltr"},{text:"rtl",value:"rtl"}]},display:null,display_options:null,readonly:!1,hidden:!1,sort:3,width:"full",translations:null,note:null,conditions:null,required:!1,group:null,validation:null,validation_message:null,searchable:!0}},{collection:"inframe",field:"id",type:"uuid",schema:{name:"id",table:"inframe",data_type:"uuid",default_value:null,generation_expression:null,max_length:null,numeric_precision:null,numeric_scale:null,is_generated:!1,is_nullable:!1,is_unique:!0,is_indexed:!1,is_primary_key:!0,has_auto_increment:!1,foreign_key_schema:null,foreign_key_table:null,foreign_key_column:null,comment:null},meta:{collection:"inframe",field:"id",special:["uuid"],interface:"input",options:null,display:null,display_options:null,readonly:!0,hidden:!0,sort:1,width:"full",translations:null,note:null,conditions:null,required:!1,group:null,validation:null,validation_message:null,searchable:!0}},{collection:"inframe",field:"sort",type:"integer",schema:{name:"sort",table:"inframe",data_type:"integer",default_value:null,generation_expression:null,max_length:null,numeric_precision:32,numeric_scale:0,is_generated:!1,is_nullable:!0,is_unique:!1,is_indexed:!1,is_primary_key:!1,has_auto_increment:!1,foreign_key_schema:null,foreign_key_table:null,foreign_key_column:null,comment:null},meta:{collection:"inframe",field:"sort",special:null,interface:"input",options:null,display:null,display_options:null,readonly:!1,hidden:!0,sort:2,width:"full",translations:null,note:null,conditions:null,required:!1,group:null,validation:null,validation_message:null,searchable:!0}},{collection:"inframe",field:"status",type:"string",schema:{name:"status",table:"inframe",data_type:"character varying",default_value:"draft",generation_expression:null,max_length:255,numeric_precision:null,numeric_scale:null,is_generated:!1,is_nullable:!1,is_unique:!1,is_indexed:!1,is_primary_key:!1,has_auto_increment:!1,foreign_key_schema:null,foreign_key_table:null,foreign_key_column:null,comment:null},meta:{collection:"inframe",field:"status",special:null,interface:"select-dropdown",options:{choices:[{text:"Publicado",value:"published",color:"var(--theme--primary)"},{text:"Rascunho",value:"draft",color:"var(--theme--foreground)"},{text:"Arquivado",value:"archived",color:"var(--theme--warning)"}]},display:"labels",display_options:{showAsDot:!0,choices:[{text:"Publicado",value:"published",color:"var(--theme--primary)",foreground:"var(--theme--primary)",background:"var(--theme--primary-background)"},{text:"Rascunho",value:"draft",color:"var(--theme--foreground)",foreground:"var(--theme--foreground)",background:"var(--theme--background-normal)"},{text:"Arquivado",value:"archived",color:"var(--theme--warning)",foreground:"var(--theme--warning)",background:"var(--theme--warning-background)"}]},readonly:!1,hidden:!1,sort:3,width:"full",translations:null,note:null,conditions:null,required:!1,group:null,validation:null,validation_message:null,searchable:!0}},{collection:"inframe",field:"icon",type:"string",schema:{name:"icon",table:"inframe",data_type:"character varying",default_value:null,generation_expression:null,max_length:255,numeric_precision:null,numeric_scale:null,is_generated:!1,is_nullable:!0,is_unique:!1,is_indexed:!1,is_primary_key:!1,has_auto_increment:!1,foreign_key_schema:null,foreign_key_table:null,foreign_key_column:null,comment:null},meta:{collection:"inframe",field:"icon",special:null,interface:"select-icon",options:null,display:null,display_options:null,readonly:!1,hidden:!1,sort:4,width:"half",translations:null,note:null,conditions:null,required:!1,group:null,validation:null,validation_message:null,searchable:!0}},{collection:"inframe",field:"url",type:"string",schema:{name:"url",table:"inframe",data_type:"character varying",default_value:null,generation_expression:null,max_length:255,numeric_precision:null,numeric_scale:null,is_generated:!1,is_nullable:!0,is_unique:!1,is_indexed:!1,is_primary_key:!1,has_auto_increment:!1,foreign_key_schema:null,foreign_key_table:null,foreign_key_column:null,comment:null},meta:{collection:"inframe",field:"url",special:null,interface:"input",options:{iconLeft:"link"},display:null,display_options:null,readonly:!1,hidden:!1,sort:5,width:"half",translations:null,note:null,conditions:null,required:!1,group:null,validation:null,validation_message:null,searchable:!0}},{collection:"inframe",field:"thumbnail",type:"uuid",schema:{name:"thumbnail",table:"inframe",data_type:"uuid",default_value:null,generation_expression:null,max_length:null,numeric_precision:null,numeric_scale:null,is_generated:!1,is_nullable:!0,is_unique:!1,is_indexed:!1,is_primary_key:!1,has_auto_increment:!1,foreign_key_schema:"public",foreign_key_table:"directus_files",foreign_key_column:"id",comment:null},meta:{collection:"inframe",field:"thumbnail",special:["file"],interface:"file-image",options:{crop:!1},display:"image",display_options:{},readonly:!1,hidden:!1,sort:6,width:"full",translations:null,note:null,conditions:null,required:!1,group:null,validation:null,validation_message:null,searchable:!0}},{collection:"inframe",field:"translations",type:"alias",schema:null,meta:{collection:"inframe",field:"translations",special:["translations"],interface:"translations",options:{languageField:"name",userLanguage:!0,defaultLanguage:"en-US"},display:"translations",display_options:{template:"{{title}}",languageIndicatorField:"name"},readonly:!1,hidden:!1,sort:7,width:"full",translations:null,note:null,conditions:null,required:!1,group:null,validation:null,validation_message:null,searchable:!0}},{collection:"inframe_translation",field:"id",type:"integer",schema:{name:"id",table:"inframe_translation",data_type:"integer",default_value:"nextval('inframe_translation_id_seq'::regclass)",generation_expression:null,max_length:null,numeric_precision:32,numeric_scale:0,is_generated:!1,is_nullable:!1,is_unique:!0,is_indexed:!1,is_primary_key:!0,has_auto_increment:!0,foreign_key_schema:null,foreign_key_table:null,foreign_key_column:null,comment:null},meta:{collection:"inframe_translation",field:"id",special:null,interface:null,options:null,display:null,display_options:null,readonly:!1,hidden:!0,sort:1,width:"full",translations:null,note:null,conditions:null,required:!1,group:null,validation:null,validation_message:null,searchable:!0}},{collection:"inframe_translation",field:"inframe",type:"uuid",schema:{name:"inframe",table:"inframe_translation",data_type:"uuid",default_value:null,generation_expression:null,max_length:null,numeric_precision:null,numeric_scale:null,is_generated:!1,is_nullable:!0,is_unique:!1,is_indexed:!1,is_primary_key:!1,has_auto_increment:!1,foreign_key_schema:"public",foreign_key_table:"inframe",foreign_key_column:"id",comment:null},meta:{collection:"inframe_translation",field:"inframe",special:null,interface:null,options:null,display:null,display_options:null,readonly:!1,hidden:!0,sort:2,width:"full",translations:null,note:null,conditions:null,required:!1,group:null,validation:null,validation_message:null,searchable:!0}},{collection:"inframe_translation",field:"language",type:"string",schema:{name:"language",table:"inframe_translation",data_type:"character varying",default_value:null,generation_expression:null,max_length:255,numeric_precision:null,numeric_scale:null,is_generated:!1,is_nullable:!0,is_unique:!1,is_indexed:!1,is_primary_key:!1,has_auto_increment:!1,foreign_key_schema:"public",foreign_key_table:"language",foreign_key_column:"code",comment:null},meta:{collection:"inframe_translation",field:"language",special:null,interface:null,options:null,display:null,display_options:null,readonly:!1,hidden:!0,sort:3,width:"full",translations:null,note:null,conditions:null,required:!1,group:null,validation:null,validation_message:null,searchable:!0}},{collection:"inframe_translation",field:"title",type:"string",schema:{name:"title",table:"inframe_translation",data_type:"character varying",default_value:null,generation_expression:null,max_length:255,numeric_precision:null,numeric_scale:null,is_generated:!1,is_nullable:!0,is_unique:!1,is_indexed:!1,is_primary_key:!1,has_auto_increment:!1,foreign_key_schema:null,foreign_key_table:null,foreign_key_column:null,comment:null},meta:{collection:"inframe_translation",field:"title",special:null,interface:"input",options:null,display:null,display_options:null,readonly:!1,hidden:!1,sort:4,width:"full",translations:null,note:null,conditions:null,required:!1,group:null,validation:null,validation_message:null,searchable:!0}}],relations:[{collection:"inframe",field:"thumbnail",related_collection:"directus_files",schema:{constraint_name:"inframe_thumbnail_foreign",table:"inframe",column:"thumbnail",foreign_key_schema:"public",foreign_key_table:"directus_files",foreign_key_column:"id",on_update:"NO ACTION",on_delete:"SET NULL"},meta:{many_collection:"inframe",many_field:"thumbnail",one_collection:"directus_files",one_field:null,one_collection_field:null,one_allowed_collections:null,junction_field:null,sort_field:null,one_deselect_action:"nullify"}},{collection:"inframe_translation",field:"language",related_collection:"language",schema:{constraint_name:"inframe_translation_language_foreign",table:"inframe_translation",column:"language",foreign_key_schema:"public",foreign_key_table:"language",foreign_key_column:"code",on_update:"NO ACTION",on_delete:"SET NULL"},meta:{many_collection:"inframe_translation",many_field:"language",one_collection:"language",one_field:null,one_collection_field:null,one_allowed_collections:null,junction_field:"inframe",sort_field:null,one_deselect_action:"nullify"}},{collection:"inframe_translation",field:"inframe",related_collection:"inframe",schema:{constraint_name:"inframe_translation_inframe_foreign",table:"inframe_translation",column:"inframe",foreign_key_schema:"public",foreign_key_table:"inframe",foreign_key_column:"id",on_update:"NO ACTION",on_delete:"SET NULL"},meta:{many_collection:"inframe_translation",many_field:"inframe",one_collection:"inframe",one_field:"translations",one_collection_field:null,one_allowed_collections:null,junction_field:"language",sort_field:null,one_deselect_action:"nullify"}}]};async function Oi({services:e,logger:n,database:t,getSchema:i}){const{CollectionsService:o,FieldsService:r,RelationsService:a}=e;n.info("[inFrame Extension] Starting collections configuration...");const s=await i(),l=new o({schema:s,knex:t});new r({schema:s,knex:t}),new a({schema:s,knex:t});let c=[];try{c=await l.readByQuery()}catch(e){n.warn(`[inFrame Extension] Error listing collections: ${e.message}`),c=[]}const u=new Set(c.map(e=>e.collection));let d=0,p=0,f=0;const m=Ti.collections||[],h=Ti.fields||[],_=Ti.relations||[];n.info(`[inFrame Extension] 📋 Collections to process: ${m.map(e=>e.collection).join(", ")}`);try{const e=[];let t=null;for(;e.length!==t;){t=e.length;for(const t of m)if(!e.includes(t.collection)){if(t.meta?.group){const{group:i}=t.meta;if(!m.some(e=>e.collection===i)&&!u.has(i)){e.push(t.collection),n.warn(`[inFrame Extension] ⚠️ Skipping collection "${t.collection}" because its group "${i}" does not exist`);continue}if(!e.includes(i)&&!u.has(i))continue}if(u.has(t.collection))n.info(`[inFrame Extension] ⏭️ Collection ${t.collection} already exists`);else try{n.info(`[inFrame Extension] 🔨 Creating collection: ${t.collection}`);const e=h.filter(e=>e.collection===t.collection);await l.createOne({collection:t.collection,meta:t.meta,schema:t.schema||null,fields:e.map(e=>{const n={field:e.field,type:e.type,meta:e.meta};return null!==e.schema&&(n.schema=e.schema),n})}),d++,p+=e.length,n.info(`[inFrame Extension] ✅ Collection ${t.collection} created with ${e.length} field(s)`)}catch(e){n.error(`[inFrame Extension] ❌ Error creating collection ${t.collection}: ${e.message}`)}e.push(t.collection)}}n.info(`[inFrame Extension] ✅ Imported ${d} collection(s) with ${p} field(s)`)}catch(e){n.error(`[inFrame Extension] ❌ Error during collections import: ${e.message}`)}try{const e=new r({schema:await i({accountability:null,database:t}),knex:t});for(const i of h)if(u.has(i.collection)||d>0)try{if(!await t.select("*").from("directus_fields").where("collection",i.collection).where("field",i.field).first()){n.info(`[inFrame Extension] 🔨 Creating field: ${i.collection}.${i.field}`);const t={field:i.field,type:i.type,meta:i.meta};null!==i.schema&&(t.schema=i.schema),await e.createField(i.collection,t),p++,n.info(`[inFrame Extension] ✅ Field ${i.collection}.${i.field} created`)}}catch(e){n.error(`[inFrame Extension] ❌ Error creating field ${i.collection}.${i.field}: ${e.message}`)}n.info(`[inFrame Extension] ✅ Total fields created: ${p}`)}catch(e){n.error(`[inFrame Extension] ❌ Error during fields import: ${e.message}`)}try{const e=new a({schema:await i({accountability:null,database:t}),knex:t});n.info("[inFrame Extension] 📋 Importing relations...");for(const i of _)try{if(await t.select("*").from("directus_relations").where("many_collection",i.collection).where("many_field",i.field).first()){n.info(`[inFrame Extension] ⏭️ Relation ${i.collection}.${i.field} -> ${i.related_collection} already exists`);continue}n.info(`[inFrame Extension] 🔗 Creating relation: ${i.collection}.${i.field} -> ${i.related_collection}`),await e.createOne({collection:i.collection,field:i.field,related_collection:i.related_collection,meta:i.meta,schema:i.schema}),f++,n.info(`[inFrame Extension] ✅ Relation ${i.collection}.${i.field} -> ${i.related_collection} created`)}catch(e){n.error(`[inFrame Extension] ❌ Error creating relation ${i.collection}.${i.field}: ${e.message}`)}n.info(`[inFrame Extension] ✅ Total relations created: ${f}`)}catch(e){n.error(`[inFrame Extension] ❌ Error during relations import: ${e.message}`)}n.info(`[inFrame Extension] 🎉 Configuration complete! Created: ${d} collection(s), ${p} field(s), ${f} relation(s)`);try{await i({accountability:null,database:t}),n.info("[inFrame Extension] ✅ Schema refreshed")}catch(e){n.warn(`[inFrame Extension] ⚠️ Error refreshing schema: ${e.message}`)}}const Fi=[{name:"inframe-setup",config:({action:e,init:n},{services:t,logger:i,database:o,getSchema:r})=>{i.info("[inFrame Extension] 🔌 Hook registered, waiting for events..."),n("routes.after",async()=>{i.info("[inFrame Extension] 🚀 routes.after event triggered, running setup...");try{await Oi({services:t,logger:i,database:o,getSchema:r})}catch(e){i.error(`[inFrame Extension] Error during initial setup: ${e.message}`)}}),e("server.start",async()=>{i.info("[inFrame Extension] 🚀 server.start event triggered, running setup...");try{await Oi({services:t,logger:i,database:o,getSchema:r})}catch(e){i.error(`[inFrame Extension] Error during initial setup: ${e.message}`)}}),e("extensions.install",async({extension:e})=>{if(e?.includes("inframe")||e?.includes("@devix-tecnologia/directus-extension-inframe")){i.info("[inFrame Extension] Extension installed, configuring collections...");try{await Oi({services:t,logger:i,database:o,getSchema:r})}catch(e){i.error(`[inFrame Extension] Error during installation: ${e.message}`)}}}),e("extensions.reload",async()=>{i.info("[inFrame Extension] Verifying collections configuration...");try{await async function({logger:e,services:n,getSchema:t}){const{CollectionsService:i}=n,o=await t(),r=new i({schema:o,knex:null});try{const n=await r.readByQuery(),t=new Set(n.map(e=>e.collection)),i=Ti.collections.map(e=>e.collection),o=i.filter(e=>t.has(e)).length,a=i.length;o===a?e.info(`[inFrame Extension] All ${a} collections are configured correctly ✓`):e.warn(`[inFrame Extension] ${o}/${a} collections found. Run setup if needed.`)}catch(n){e.warn(`[inFrame Extension] Error verifying collections: ${n.message}`)}}({logger:i,services:t,getSchema:r})}catch(e){i.warn(`[inFrame Extension] Error verifying collections: ${e.message}`)}})}}],Si=[],ji=[];export{Si as endpoints,Fi as hooks,ji as operations};
|
|
1
|
+
const e=["interface","display","layout","module","panel","theme"],n=["hook","endpoint"],t=["operation"];function i(e,n,t){function i(t,i){var o;Object.defineProperty(t,"_zod",{value:t._zod??{},enumerable:!1}),(o=t._zod).traits??(o.traits=new Set),t._zod.traits.add(e),n(t,i);for(const e in a.prototype)e in t||Object.defineProperty(t,e,{value:a.prototype[e].bind(t)});t._zod.constr=a,t._zod.def=i}const o=t?.Parent??Object;class r extends o{}function a(e){var n;const o=t?.Parent?new r:this;i(o,e),(n=o._zod).deferred??(n.deferred=[]);for(const e of o._zod.deferred)e();return o}return Object.defineProperty(r,"name",{value:e}),Object.defineProperty(a,"init",{value:i}),Object.defineProperty(a,Symbol.hasInstance,{value:n=>!!(t?.Parent&&n instanceof t.Parent)||n?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}class o extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class r extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const a={};function s(e){return a}function l(e,n){return"bigint"==typeof n?n.toString():n}function c(e){return{get value(){{const n=e();return Object.defineProperty(this,"value",{value:n}),n}}}}function u(e){return null==e}function d(e){const n=e.startsWith("^")?1:0,t=e.endsWith("$")?e.length-1:e.length;return e.slice(n,t)}const f=Symbol("evaluating");function p(e,n,t){let i;Object.defineProperty(e,n,{get(){if(i!==f)return void 0===i&&(i=f,i=t()),i},set(t){Object.defineProperty(e,n,{value:t})},configurable:!0})}function m(e,n,t){Object.defineProperty(e,n,{value:t,writable:!0,enumerable:!0,configurable:!0})}function h(...e){const n={};for(const t of e){const e=Object.getOwnPropertyDescriptors(t);Object.assign(n,e)}return Object.defineProperties({},n)}function _(e){return JSON.stringify(e)}const g="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function y(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const v=c(()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function w(e){if(!1===y(e))return!1;const n=e.constructor;if(void 0===n)return!0;const t=n.prototype;return!1!==y(t)&&!1!==Object.prototype.hasOwnProperty.call(t,"isPrototypeOf")}function b(e){return w(e)?{...e}:Array.isArray(e)?[...e]:e}const z=new Set(["string","number","symbol"]);function k(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function $(e,n,t){const i=new e._zod.constr(n??e._zod.def);return n&&!t?.parent||(i._zod.parent=e),i}function x(e){const n=e;if(!n)return{};if("string"==typeof n)return{error:()=>n};if(void 0!==n?.message){if(void 0!==n?.error)throw new Error("Cannot specify both `message` and `error` params");n.error=n.message}return delete n.message,"string"==typeof n.error?{...n,error:()=>n.error}:n}function E(e,n=0){if(!0===e.aborted)return!0;for(let t=n;t<e.issues.length;t++)if(!0!==e.issues[t]?.continue)return!0;return!1}function Z(e,n){return n.map(n=>{var t;return(t=n).path??(t.path=[]),n.path.unshift(e),n})}function A(e){return"string"==typeof e?e:e?.message}function P(e,n,t){const i={...e,path:e.path??[]};if(!e.message){const o=A(e.inst?._zod.def?.error?.(e))??A(n?.error?.(e))??A(t.customError?.(e))??A(t.localeError?.(e))??"Invalid input";i.message=o}return delete i.inst,delete i.continue,n?.reportInput||delete i.input,i}function T(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function F(...e){const[n,t,i]=e;return"string"==typeof n?{message:n,code:"custom",input:t,inst:i}:{...n}}const S=(e,n)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:n,enumerable:!1}),e.message=JSON.stringify(n,l,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},O=i("$ZodError",S),j=i("$ZodError",S,{Parent:Error});const I=e=>(n,t,i,r)=>{const a=i?Object.assign(i,{async:!1}):{async:!1},l=n._zod.run({value:t,issues:[]},a);if(l instanceof Promise)throw new o;if(l.issues.length){const n=new(r?.Err??e)(l.issues.map(e=>P(e,a,s())));throw g(n,r?.callee),n}return l.value},C=e=>async(n,t,i,o)=>{const r=i?Object.assign(i,{async:!0}):{async:!0};let a=n._zod.run({value:t,issues:[]},r);if(a instanceof Promise&&(a=await a),a.issues.length){const n=new(o?.Err??e)(a.issues.map(e=>P(e,r,s())));throw g(n,o?.callee),n}return a.value},U=e=>(n,t,i)=>{const r=i?{...i,async:!1}:{async:!1},a=n._zod.run({value:t,issues:[]},r);if(a instanceof Promise)throw new o;return a.issues.length?{success:!1,error:new(e??O)(a.issues.map(e=>P(e,r,s())))}:{success:!0,data:a.value}},R=U(j),D=e=>async(n,t,i)=>{const o=i?Object.assign(i,{async:!0}):{async:!0};let r=n._zod.run({value:t,issues:[]},o);return r instanceof Promise&&(r=await r),r.issues.length?{success:!1,error:new e(r.issues.map(e=>P(e,o,s())))}:{success:!0,data:r.value}},q=D(j),N=e=>(n,t,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return I(e)(n,t,o)},L=e=>(n,t,i)=>I(e)(n,t,i),V=e=>async(n,t,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return C(e)(n,t,o)},W=e=>async(n,t,i)=>C(e)(n,t,i),B=e=>(n,t,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return U(e)(n,t,o)},M=e=>(n,t,i)=>U(e)(n,t,i),J=e=>async(n,t,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return D(e)(n,t,o)},K=e=>async(n,t,i)=>D(e)(n,t,i),G=/^[cC][^\s-]{8,}$/,H=/^[0-9a-z]+$/,Y=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Q=/^[0-9a-vA-V]{20}$/,X=/^[A-Za-z0-9]{27}$/,ee=/^[a-zA-Z0-9_-]{21}$/,ne=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,te=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,ie=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,oe=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;const re=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ae=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,se=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,le=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ce=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ue=/^[A-Za-z0-9_-]*$/,de=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,fe=/^\+(?:[0-9]){6,14}[0-9]$/,pe="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",me=new RegExp(`^${pe}$`);function he(e){const n="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${n}`:0===e.precision?`${n}:[0-5]\\d`:`${n}:[0-5]\\d\\.\\d{${e.precision}}`:`${n}(?::[0-5]\\d(?:\\.\\d+)?)?`}const _e=/^(?:true|false)$/i,ge=/^[^A-Z]*$/,ye=/^[^a-z]*$/,ve=i("$ZodCheck",(e,n)=>{var t;e._zod??(e._zod={}),e._zod.def=n,(t=e._zod).onattach??(t.onattach=[])}),we=i("$ZodCheckMaxLength",(e,n)=>{var t;ve.init(e,n),(t=e._zod.def).when??(t.when=e=>{const n=e.value;return!u(n)&&void 0!==n.length}),e._zod.onattach.push(e=>{const t=e._zod.bag.maximum??Number.POSITIVE_INFINITY;n.maximum<t&&(e._zod.bag.maximum=n.maximum)}),e._zod.check=t=>{const i=t.value;if(i.length<=n.maximum)return;const o=T(i);t.issues.push({origin:o,code:"too_big",maximum:n.maximum,inclusive:!0,input:i,inst:e,continue:!n.abort})}}),be=i("$ZodCheckMinLength",(e,n)=>{var t;ve.init(e,n),(t=e._zod.def).when??(t.when=e=>{const n=e.value;return!u(n)&&void 0!==n.length}),e._zod.onattach.push(e=>{const t=e._zod.bag.minimum??Number.NEGATIVE_INFINITY;n.minimum>t&&(e._zod.bag.minimum=n.minimum)}),e._zod.check=t=>{const i=t.value;if(i.length>=n.minimum)return;const o=T(i);t.issues.push({origin:o,code:"too_small",minimum:n.minimum,inclusive:!0,input:i,inst:e,continue:!n.abort})}}),ze=i("$ZodCheckLengthEquals",(e,n)=>{var t;ve.init(e,n),(t=e._zod.def).when??(t.when=e=>{const n=e.value;return!u(n)&&void 0!==n.length}),e._zod.onattach.push(e=>{const t=e._zod.bag;t.minimum=n.length,t.maximum=n.length,t.length=n.length}),e._zod.check=t=>{const i=t.value,o=i.length;if(o===n.length)return;const r=T(i),a=o>n.length;t.issues.push({origin:r,...a?{code:"too_big",maximum:n.length}:{code:"too_small",minimum:n.length},inclusive:!0,exact:!0,input:t.value,inst:e,continue:!n.abort})}}),ke=i("$ZodCheckStringFormat",(e,n)=>{var t,i;ve.init(e,n),e._zod.onattach.push(e=>{const t=e._zod.bag;t.format=n.format,n.pattern&&(t.patterns??(t.patterns=new Set),t.patterns.add(n.pattern))}),n.pattern?(t=e._zod).check??(t.check=t=>{n.pattern.lastIndex=0,n.pattern.test(t.value)||t.issues.push({origin:"string",code:"invalid_format",format:n.format,input:t.value,...n.pattern?{pattern:n.pattern.toString()}:{},inst:e,continue:!n.abort})}):(i=e._zod).check??(i.check=()=>{})}),$e=i("$ZodCheckRegex",(e,n)=>{ke.init(e,n),e._zod.check=t=>{n.pattern.lastIndex=0,n.pattern.test(t.value)||t.issues.push({origin:"string",code:"invalid_format",format:"regex",input:t.value,pattern:n.pattern.toString(),inst:e,continue:!n.abort})}}),xe=i("$ZodCheckLowerCase",(e,n)=>{n.pattern??(n.pattern=ge),ke.init(e,n)}),Ee=i("$ZodCheckUpperCase",(e,n)=>{n.pattern??(n.pattern=ye),ke.init(e,n)}),Ze=i("$ZodCheckIncludes",(e,n)=>{ve.init(e,n);const t=k(n.includes),i=new RegExp("number"==typeof n.position?`^.{${n.position}}${t}`:t);n.pattern=i,e._zod.onattach.push(e=>{const n=e._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(i)}),e._zod.check=t=>{t.value.includes(n.includes,n.position)||t.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:n.includes,input:t.value,inst:e,continue:!n.abort})}}),Ae=i("$ZodCheckStartsWith",(e,n)=>{ve.init(e,n);const t=new RegExp(`^${k(n.prefix)}.*`);n.pattern??(n.pattern=t),e._zod.onattach.push(e=>{const n=e._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(t)}),e._zod.check=t=>{t.value.startsWith(n.prefix)||t.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:n.prefix,input:t.value,inst:e,continue:!n.abort})}}),Pe=i("$ZodCheckEndsWith",(e,n)=>{ve.init(e,n);const t=new RegExp(`.*${k(n.suffix)}$`);n.pattern??(n.pattern=t),e._zod.onattach.push(e=>{const n=e._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(t)}),e._zod.check=t=>{t.value.endsWith(n.suffix)||t.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:n.suffix,input:t.value,inst:e,continue:!n.abort})}}),Te=i("$ZodCheckOverwrite",(e,n)=>{ve.init(e,n),e._zod.check=e=>{e.value=n.tx(e.value)}});class Fe{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e)return e(this,{execution:"sync"}),void e(this,{execution:"async"});const n=e.split("\n").filter(e=>e),t=Math.min(...n.map(e=>e.length-e.trimStart().length)),i=n.map(e=>e.slice(t)).map(e=>" ".repeat(2*this.indent)+e);for(const e of i)this.content.push(e)}compile(){const e=Function,n=this?.args;return new e(...n,[...(this?.content??[""]).map(e=>` ${e}`)].join("\n"))}}const Se={major:4,minor:1,patch:12},Oe=i("$ZodType",(e,n)=>{var t;e??(e={}),e._zod.def=n,e._zod.bag=e._zod.bag||{},e._zod.version=Se;const i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(const n of i)for(const t of n._zod.onattach)t(e);if(0===i.length)(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const n=(e,n,t)=>{let i,r=E(e);for(const a of n){if(a._zod.def.when){if(!a._zod.def.when(e))continue}else if(r)continue;const n=e.issues.length,s=a._zod.check(e);if(s instanceof Promise&&!1===t?.async)throw new o;if(i||s instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await s;e.issues.length!==n&&(r||(r=E(e,n)))});else{if(e.issues.length===n)continue;r||(r=E(e,n))}}return i?i.then(()=>e):e},t=(t,r,a)=>{if(E(t))return t.aborted=!0,t;const s=n(r,i,a);if(s instanceof Promise){if(!1===a.async)throw new o;return s.then(n=>e._zod.parse(n,a))}return e._zod.parse(s,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if("backward"===a.direction){const n=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return n instanceof Promise?n.then(e=>t(e,r,a)):t(n,r,a)}const s=e._zod.parse(r,a);if(s instanceof Promise){if(!1===a.async)throw new o;return s.then(e=>n(e,i,a))}return n(s,i,a)}}e["~standard"]={validate:n=>{try{const t=R(e,n);return t.success?{value:t.data}:{issues:t.error?.issues}}catch(t){return q(e,n).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}}),je=i("$ZodString",(e,n)=>{var t;Oe.init(e,n),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??(t=e._zod.bag,new RegExp(`^${t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*"}$`)),e._zod.parse=(t,i)=>{if(n.coerce)try{t.value=String(t.value)}catch(i){}return"string"==typeof t.value||t.issues.push({expected:"string",code:"invalid_type",input:t.value,inst:e}),t}}),Ie=i("$ZodStringFormat",(e,n)=>{ke.init(e,n),je.init(e,n)}),Ce=i("$ZodGUID",(e,n)=>{n.pattern??(n.pattern=te),Ie.init(e,n)}),Ue=i("$ZodUUID",(e,n)=>{if(n.version){const e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[n.version];if(void 0===e)throw new Error(`Invalid UUID version: "${n.version}"`);n.pattern??(n.pattern=ie(e))}else n.pattern??(n.pattern=ie());Ie.init(e,n)}),Re=i("$ZodEmail",(e,n)=>{n.pattern??(n.pattern=oe),Ie.init(e,n)}),De=i("$ZodURL",(e,n)=>{Ie.init(e,n),e._zod.check=t=>{try{const i=t.value.trim(),o=new URL(i);return n.hostname&&(n.hostname.lastIndex=0,n.hostname.test(o.hostname)||t.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:de.source,input:t.value,inst:e,continue:!n.abort})),n.protocol&&(n.protocol.lastIndex=0,n.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||t.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:n.protocol.source,input:t.value,inst:e,continue:!n.abort})),void(n.normalize?t.value=o.href:t.value=i)}catch(i){t.issues.push({code:"invalid_format",format:"url",input:t.value,inst:e,continue:!n.abort})}}}),qe=i("$ZodEmoji",(e,n)=>{n.pattern??(n.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Ie.init(e,n)}),Ne=i("$ZodNanoID",(e,n)=>{n.pattern??(n.pattern=ee),Ie.init(e,n)}),Le=i("$ZodCUID",(e,n)=>{n.pattern??(n.pattern=G),Ie.init(e,n)}),Ve=i("$ZodCUID2",(e,n)=>{n.pattern??(n.pattern=H),Ie.init(e,n)}),We=i("$ZodULID",(e,n)=>{n.pattern??(n.pattern=Y),Ie.init(e,n)}),Be=i("$ZodXID",(e,n)=>{n.pattern??(n.pattern=Q),Ie.init(e,n)}),Me=i("$ZodKSUID",(e,n)=>{n.pattern??(n.pattern=X),Ie.init(e,n)}),Je=i("$ZodISODateTime",(e,n)=>{n.pattern??(n.pattern=function(e){const n=he({precision:e.precision}),t=["Z"];e.local&&t.push(""),e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const i=`${n}(?:${t.join("|")})`;return new RegExp(`^${pe}T(?:${i})$`)}(n)),Ie.init(e,n)}),Ke=i("$ZodISODate",(e,n)=>{n.pattern??(n.pattern=me),Ie.init(e,n)}),Ge=i("$ZodISOTime",(e,n)=>{n.pattern??(n.pattern=new RegExp(`^${he(n)}$`)),Ie.init(e,n)}),He=i("$ZodISODuration",(e,n)=>{n.pattern??(n.pattern=ne),Ie.init(e,n)}),Ye=i("$ZodIPv4",(e,n)=>{n.pattern??(n.pattern=re),Ie.init(e,n),e._zod.onattach.push(e=>{e._zod.bag.format="ipv4"})}),Qe=i("$ZodIPv6",(e,n)=>{n.pattern??(n.pattern=ae),Ie.init(e,n),e._zod.onattach.push(e=>{e._zod.bag.format="ipv6"}),e._zod.check=t=>{try{new URL(`http://[${t.value}]`)}catch{t.issues.push({code:"invalid_format",format:"ipv6",input:t.value,inst:e,continue:!n.abort})}}}),Xe=i("$ZodCIDRv4",(e,n)=>{n.pattern??(n.pattern=se),Ie.init(e,n)}),en=i("$ZodCIDRv6",(e,n)=>{n.pattern??(n.pattern=le),Ie.init(e,n),e._zod.check=t=>{const i=t.value.split("/");try{if(2!==i.length)throw new Error;const[e,n]=i;if(!n)throw new Error;const t=Number(n);if(`${t}`!==n)throw new Error;if(t<0||t>128)throw new Error;new URL(`http://[${e}]`)}catch{t.issues.push({code:"invalid_format",format:"cidrv6",input:t.value,inst:e,continue:!n.abort})}}});function nn(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const tn=i("$ZodBase64",(e,n)=>{n.pattern??(n.pattern=ce),Ie.init(e,n),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding="base64"}),e._zod.check=t=>{nn(t.value)||t.issues.push({code:"invalid_format",format:"base64",input:t.value,inst:e,continue:!n.abort})}});const on=i("$ZodBase64URL",(e,n)=>{n.pattern??(n.pattern=ue),Ie.init(e,n),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding="base64url"}),e._zod.check=t=>{(function(e){if(!ue.test(e))return!1;const n=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return nn(n.padEnd(4*Math.ceil(n.length/4),"="))})(t.value)||t.issues.push({code:"invalid_format",format:"base64url",input:t.value,inst:e,continue:!n.abort})}}),rn=i("$ZodE164",(e,n)=>{n.pattern??(n.pattern=fe),Ie.init(e,n)});const an=i("$ZodJWT",(e,n)=>{Ie.init(e,n),e._zod.check=t=>{(function(e,n=null){try{const t=e.split(".");if(3!==t.length)return!1;const[i]=t;if(!i)return!1;const o=JSON.parse(atob(i));return!("typ"in o&&"JWT"!==o?.typ||!o.alg||n&&(!("alg"in o)||o.alg!==n))}catch{return!1}})(t.value,n.alg)||t.issues.push({code:"invalid_format",format:"jwt",input:t.value,inst:e,continue:!n.abort})}}),sn=i("$ZodBoolean",(e,n)=>{Oe.init(e,n),e._zod.pattern=_e,e._zod.parse=(t,i)=>{if(n.coerce)try{t.value=Boolean(t.value)}catch(e){}const o=t.value;return"boolean"==typeof o||t.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),t}}),ln=i("$ZodUnknown",(e,n)=>{Oe.init(e,n),e._zod.parse=e=>e}),cn=i("$ZodNever",(e,n)=>{Oe.init(e,n),e._zod.parse=(n,t)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function un(e,n,t){e.issues.length&&n.issues.push(...Z(t,e.issues)),n.value[t]=e.value}const dn=i("$ZodArray",(e,n)=>{Oe.init(e,n),e._zod.parse=(t,i)=>{const o=t.value;if(!Array.isArray(o))return t.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),t;t.value=Array(o.length);const r=[];for(let e=0;e<o.length;e++){const a=o[e],s=n.element._zod.run({value:a,issues:[]},i);s instanceof Promise?r.push(s.then(n=>un(n,t,e))):un(s,t,e)}return r.length?Promise.all(r).then(()=>t):t}});function fn(e,n,t,i){e.issues.length&&n.issues.push(...Z(t,e.issues)),void 0===e.value?t in i&&(n.value[t]=void 0):n.value[t]=e.value}function pn(e){const n=Object.keys(e.shape);for(const t of n)if(!e.shape?.[t]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${t}": expected a Zod schema`);const t=(i=e.shape,Object.keys(i).filter(e=>"optional"===i[e]._zod.optin&&"optional"===i[e]._zod.optout));var i;return{...e,keys:n,keySet:new Set(n),numKeys:n.length,optionalKeys:new Set(t)}}function mn(e,n,t,i,o,r){const a=[],s=o.keySet,l=o.catchall._zod,c=l.def.type;for(const o of Object.keys(n)){if(s.has(o))continue;if("never"===c){a.push(o);continue}const r=l.run({value:n[o],issues:[]},i);r instanceof Promise?e.push(r.then(e=>fn(e,t,o,n))):fn(r,t,o,n)}return a.length&&t.issues.push({code:"unrecognized_keys",keys:a,input:n,inst:r}),e.length?Promise.all(e).then(()=>t):t}const hn=i("$ZodObject",(e,n)=>{Oe.init(e,n);const t=Object.getOwnPropertyDescriptor(n,"shape");if(!t?.get){const e=n.shape;Object.defineProperty(n,"shape",{get:()=>{const t={...e};return Object.defineProperty(n,"shape",{value:t}),t}})}const i=c(()=>pn(n));p(e._zod,"propValues",()=>{const e=n.shape,t={};for(const n in e){const i=e[n]._zod;if(i.values){t[n]??(t[n]=new Set);for(const e of i.values)t[n].add(e)}}return t});const o=y,r=n.catchall;let a;e._zod.parse=(n,t)=>{a??(a=i.value);const s=n.value;if(!o(s))return n.issues.push({expected:"object",code:"invalid_type",input:s,inst:e}),n;n.value={};const l=[],c=a.shape;for(const e of a.keys){const i=c[e]._zod.run({value:s[e],issues:[]},t);i instanceof Promise?l.push(i.then(t=>fn(t,n,e,s))):fn(i,n,e,s)}return r?mn(l,s,n,t,i.value,e):l.length?Promise.all(l).then(()=>n):n}}),_n=i("$ZodObjectJIT",(e,n)=>{hn.init(e,n);const t=e._zod.parse,i=c(()=>pn(n));let o;const r=y,s=!a.jitless,l=s&&v.value,u=n.catchall;let d;e._zod.parse=(a,c)=>{d??(d=i.value);const f=a.value;return r(f)?s&&l&&!1===c?.async&&!0!==c.jitless?(o||(o=(e=>{const n=new Fe(["shape","payload","ctx"]),t=i.value,o=e=>{const n=_(e);return`shape[${n}]._zod.run({ value: input[${n}], issues: [] }, ctx)`};n.write("const input = payload.value;");const r=Object.create(null);let a=0;for(const e of t.keys)r[e]="key_"+a++;n.write("const newResult = {};");for(const e of t.keys){const t=r[e],i=_(e);n.write(`const ${t} = ${o(e)};`),n.write(`\n if (${t}.issues.length) {\n payload.issues = payload.issues.concat(${t}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${i}, ...iss.path] : [${i}]\n })));\n }\n \n \n if (${t}.value === undefined) {\n if (${i} in input) {\n newResult[${i}] = undefined;\n }\n } else {\n newResult[${i}] = ${t}.value;\n }\n \n `)}n.write("payload.value = newResult;"),n.write("return payload;");const s=n.compile();return(n,t)=>s(e,n,t)})(n.shape)),a=o(a,c),u?mn([],f,a,c,d,e):a):t(a,c):(a.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),a)}});function gn(e,n,t,i){for(const t of e)if(0===t.issues.length)return n.value=t.value,n;const o=e.filter(e=>!E(e));return 1===o.length?(n.value=o[0].value,o[0]):(n.issues.push({code:"invalid_union",input:n.value,inst:t,errors:e.map(e=>e.issues.map(e=>P(e,i,s())))}),n)}const yn=i("$ZodUnion",(e,n)=>{Oe.init(e,n),p(e._zod,"optin",()=>n.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),p(e._zod,"optout",()=>n.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),p(e._zod,"values",()=>{if(n.options.every(e=>e._zod.values))return new Set(n.options.flatMap(e=>Array.from(e._zod.values)))}),p(e._zod,"pattern",()=>{if(n.options.every(e=>e._zod.pattern)){const e=n.options.map(e=>e._zod.pattern);return new RegExp(`^(${e.map(e=>d(e.source)).join("|")})$`)}});const t=1===n.options.length,i=n.options[0]._zod.run;e._zod.parse=(o,r)=>{if(t)return i(o,r);let a=!1;const s=[];for(const e of n.options){const n=e._zod.run({value:o.value,issues:[]},r);if(n instanceof Promise)s.push(n),a=!0;else{if(0===n.issues.length)return n;s.push(n)}}return a?Promise.all(s).then(n=>gn(n,o,e,r)):gn(s,o,e,r)}}),vn=i("$ZodIntersection",(e,n)=>{Oe.init(e,n),e._zod.parse=(e,t)=>{const i=e.value,o=n.left._zod.run({value:i,issues:[]},t),r=n.right._zod.run({value:i,issues:[]},t);return o instanceof Promise||r instanceof Promise?Promise.all([o,r]).then(([n,t])=>bn(e,n,t)):bn(e,o,r)}});function wn(e,n){if(e===n)return{valid:!0,data:e};if(e instanceof Date&&n instanceof Date&&+e===+n)return{valid:!0,data:e};if(w(e)&&w(n)){const t=Object.keys(n),i=Object.keys(e).filter(e=>-1!==t.indexOf(e)),o={...e,...n};for(const t of i){const i=wn(e[t],n[t]);if(!i.valid)return{valid:!1,mergeErrorPath:[t,...i.mergeErrorPath]};o[t]=i.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(n)){if(e.length!==n.length)return{valid:!1,mergeErrorPath:[]};const t=[];for(let i=0;i<e.length;i++){const o=wn(e[i],n[i]);if(!o.valid)return{valid:!1,mergeErrorPath:[i,...o.mergeErrorPath]};t.push(o.data)}return{valid:!0,data:t}}return{valid:!1,mergeErrorPath:[]}}function bn(e,n,t){if(n.issues.length&&e.issues.push(...n.issues),t.issues.length&&e.issues.push(...t.issues),E(e))return e;const i=wn(n.value,t.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}const zn=i("$ZodRecord",(e,n)=>{Oe.init(e,n),e._zod.parse=(t,i)=>{const o=t.value;if(!w(o))return t.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),t;const r=[];if(n.keyType._zod.values){const a=n.keyType._zod.values;t.value={};for(const e of a)if("string"==typeof e||"number"==typeof e||"symbol"==typeof e){const a=n.valueType._zod.run({value:o[e],issues:[]},i);a instanceof Promise?r.push(a.then(n=>{n.issues.length&&t.issues.push(...Z(e,n.issues)),t.value[e]=n.value})):(a.issues.length&&t.issues.push(...Z(e,a.issues)),t.value[e]=a.value)}let s;for(const e in o)a.has(e)||(s=s??[],s.push(e));s&&s.length>0&&t.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:s})}else{t.value={};for(const a of Reflect.ownKeys(o)){if("__proto__"===a)continue;const l=n.keyType._zod.run({value:a,issues:[]},i);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(l.issues.length){t.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(e=>P(e,i,s())),input:a,path:[a],inst:e}),t.value[l.value]=l.value;continue}const c=n.valueType._zod.run({value:o[a],issues:[]},i);c instanceof Promise?r.push(c.then(e=>{e.issues.length&&t.issues.push(...Z(a,e.issues)),t.value[l.value]=e.value})):(c.issues.length&&t.issues.push(...Z(a,c.issues)),t.value[l.value]=c.value)}}return r.length?Promise.all(r).then(()=>t):t}}),kn=i("$ZodEnum",(e,n)=>{Oe.init(e,n);const t=function(e){const n=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,t])=>-1===n.indexOf(+e)).map(([e,n])=>n)}(n.entries),i=new Set(t);e._zod.values=i,e._zod.pattern=new RegExp(`^(${t.filter(e=>z.has(typeof e)).map(e=>"string"==typeof e?k(e):e.toString()).join("|")})$`),e._zod.parse=(n,o)=>{const r=n.value;return i.has(r)||n.issues.push({code:"invalid_value",values:t,input:r,inst:e}),n}}),$n=i("$ZodLiteral",(e,n)=>{if(Oe.init(e,n),0===n.values.length)throw new Error("Cannot create literal schema with no valid values");e._zod.values=new Set(n.values),e._zod.pattern=new RegExp(`^(${n.values.map(e=>"string"==typeof e?k(e):e?k(e.toString()):String(e)).join("|")})$`),e._zod.parse=(t,i)=>{const o=t.value;return e._zod.values.has(o)||t.issues.push({code:"invalid_value",values:n.values,input:o,inst:e}),t}}),xn=i("$ZodTransform",(e,n)=>{Oe.init(e,n),e._zod.parse=(t,i)=>{if("backward"===i.direction)throw new r(e.constructor.name);const a=n.transform(t.value,t);if(i.async){return(a instanceof Promise?a:Promise.resolve(a)).then(e=>(t.value=e,t))}if(a instanceof Promise)throw new o;return t.value=a,t}});function En(e,n){return e.issues.length&&void 0===n?{issues:[],value:void 0}:e}const Zn=i("$ZodOptional",(e,n)=>{Oe.init(e,n),e._zod.optin="optional",e._zod.optout="optional",p(e._zod,"values",()=>n.innerType._zod.values?new Set([...n.innerType._zod.values,void 0]):void 0),p(e._zod,"pattern",()=>{const e=n.innerType._zod.pattern;return e?new RegExp(`^(${d(e.source)})?$`):void 0}),e._zod.parse=(e,t)=>{if("optional"===n.innerType._zod.optin){const i=n.innerType._zod.run(e,t);return i instanceof Promise?i.then(n=>En(n,e.value)):En(i,e.value)}return void 0===e.value?e:n.innerType._zod.run(e,t)}}),An=i("$ZodNullable",(e,n)=>{Oe.init(e,n),p(e._zod,"optin",()=>n.innerType._zod.optin),p(e._zod,"optout",()=>n.innerType._zod.optout),p(e._zod,"pattern",()=>{const e=n.innerType._zod.pattern;return e?new RegExp(`^(${d(e.source)}|null)$`):void 0}),p(e._zod,"values",()=>n.innerType._zod.values?new Set([...n.innerType._zod.values,null]):void 0),e._zod.parse=(e,t)=>null===e.value?e:n.innerType._zod.run(e,t)}),Pn=i("$ZodDefault",(e,n)=>{Oe.init(e,n),e._zod.optin="optional",p(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(e,t)=>{if("backward"===t.direction)return n.innerType._zod.run(e,t);if(void 0===e.value)return e.value=n.defaultValue,e;const i=n.innerType._zod.run(e,t);return i instanceof Promise?i.then(e=>Tn(e,n)):Tn(i,n)}});function Tn(e,n){return void 0===e.value&&(e.value=n.defaultValue),e}const Fn=i("$ZodPrefault",(e,n)=>{Oe.init(e,n),e._zod.optin="optional",p(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(e,t)=>("backward"===t.direction||void 0===e.value&&(e.value=n.defaultValue),n.innerType._zod.run(e,t))}),Sn=i("$ZodNonOptional",(e,n)=>{Oe.init(e,n),p(e._zod,"values",()=>{const e=n.innerType._zod.values;return e?new Set([...e].filter(e=>void 0!==e)):void 0}),e._zod.parse=(t,i)=>{const o=n.innerType._zod.run(t,i);return o instanceof Promise?o.then(n=>On(n,e)):On(o,e)}});function On(e,n){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:n}),e}const jn=i("$ZodCatch",(e,n)=>{Oe.init(e,n),p(e._zod,"optin",()=>n.innerType._zod.optin),p(e._zod,"optout",()=>n.innerType._zod.optout),p(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(e,t)=>{if("backward"===t.direction)return n.innerType._zod.run(e,t);const i=n.innerType._zod.run(e,t);return i instanceof Promise?i.then(i=>(e.value=i.value,i.issues.length&&(e.value=n.catchValue({...e,error:{issues:i.issues.map(e=>P(e,t,s()))},input:e.value}),e.issues=[]),e)):(e.value=i.value,i.issues.length&&(e.value=n.catchValue({...e,error:{issues:i.issues.map(e=>P(e,t,s()))},input:e.value}),e.issues=[]),e)}}),In=i("$ZodPipe",(e,n)=>{Oe.init(e,n),p(e._zod,"values",()=>n.in._zod.values),p(e._zod,"optin",()=>n.in._zod.optin),p(e._zod,"optout",()=>n.out._zod.optout),p(e._zod,"propValues",()=>n.in._zod.propValues),e._zod.parse=(e,t)=>{if("backward"===t.direction){const i=n.out._zod.run(e,t);return i instanceof Promise?i.then(e=>Cn(e,n.in,t)):Cn(i,n.in,t)}const i=n.in._zod.run(e,t);return i instanceof Promise?i.then(e=>Cn(e,n.out,t)):Cn(i,n.out,t)}});function Cn(e,n,t){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:e.value,issues:e.issues},t)}const Un=i("$ZodReadonly",(e,n)=>{Oe.init(e,n),p(e._zod,"propValues",()=>n.innerType._zod.propValues),p(e._zod,"values",()=>n.innerType._zod.values),p(e._zod,"optin",()=>n.innerType._zod.optin),p(e._zod,"optout",()=>n.innerType._zod.optout),e._zod.parse=(e,t)=>{if("backward"===t.direction)return n.innerType._zod.run(e,t);const i=n.innerType._zod.run(e,t);return i instanceof Promise?i.then(Rn):Rn(i)}});function Rn(e){return e.value=Object.freeze(e.value),e}const Dn=i("$ZodCustom",(e,n)=>{ve.init(e,n),Oe.init(e,n),e._zod.parse=(e,n)=>e,e._zod.check=t=>{const i=t.value,o=n.fn(i);if(o instanceof Promise)return o.then(n=>qn(n,t,i,e));qn(o,t,i,e)}});function qn(e,n,t,i){if(!e){const e={code:"custom",input:t,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(e.params=i._zod.def.params),n.issues.push(F(e))}}class Nn{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...n){const t=n[0];if(this._map.set(e,t),t&&"object"==typeof t&&"id"in t){if(this._idmap.has(t.id))throw new Error(`ID ${t.id} already exists in the registry`);this._idmap.set(t.id,e)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){const n=this._map.get(e);return n&&"object"==typeof n&&"id"in n&&this._idmap.delete(n.id),this._map.delete(e),this}get(e){const n=e._zod.parent;if(n){const t={...this.get(n)??{}};delete t.id;const i={...t,...this._map.get(e)};return Object.keys(i).length?i:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function Ln(){return new Nn}const Vn=Ln();function Wn(e,n){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...x(n)})}function Bn(e,n){return new we({check:"max_length",...x(n),maximum:e})}function Mn(e,n){return new be({check:"min_length",...x(n),minimum:e})}function Jn(e,n){return new ze({check:"length_equals",...x(n),length:e})}function Kn(e){return new Te({check:"overwrite",tx:e})}function Gn(e){const n=function(e,n){const t=new ve({check:"custom",...x(n)});return t._zod.check=e,t}(t=>(t.addIssue=e=>{if("string"==typeof e)t.issues.push(F(e,t.value,n._zod.def));else{const i=e;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=t.value),i.inst??(i.inst=n),i.continue??(i.continue=!n._zod.def.abort),t.issues.push(F(i))}},e(t.value,t)));return n}const Hn=i("ZodISODateTime",(e,n)=>{Je.init(e,n),bt.init(e,n)});function Yn(e){return function(e,n){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...x(n)})}(Hn,e)}const Qn=i("ZodISODate",(e,n)=>{Ke.init(e,n),bt.init(e,n)});function Xn(e){return function(e,n){return new e({type:"string",format:"date",check:"string_format",...x(n)})}(Qn,e)}const et=i("ZodISOTime",(e,n)=>{Ge.init(e,n),bt.init(e,n)});function nt(e){return function(e,n){return new e({type:"string",format:"time",check:"string_format",precision:null,...x(n)})}(et,e)}const tt=i("ZodISODuration",(e,n)=>{He.init(e,n),bt.init(e,n)});function it(e){return function(e,n){return new e({type:"string",format:"duration",check:"string_format",...x(n)})}(tt,e)}const ot=i("ZodError",(e,n)=>{O.init(e,n),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>function(e,n=e=>e.message){const t={_errors:[]},i=e=>{for(const o of e.issues)if("invalid_union"===o.code&&o.errors.length)o.errors.map(e=>i({issues:e}));else if("invalid_key"===o.code)i({issues:o.issues});else if("invalid_element"===o.code)i({issues:o.issues});else if(0===o.path.length)t._errors.push(n(o));else{let e=t,i=0;for(;i<o.path.length;){const t=o.path[i];i===o.path.length-1?(e[t]=e[t]||{_errors:[]},e[t]._errors.push(n(o))):e[t]=e[t]||{_errors:[]},e=e[t],i++}}};return i(e),t}(e,n)},flatten:{value:n=>function(e,n=e=>e.message){const t={},i=[];for(const o of e.issues)o.path.length>0?(t[o.path[0]]=t[o.path[0]]||[],t[o.path[0]].push(n(o))):i.push(n(o));return{formErrors:i,fieldErrors:t}}(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,l,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,l,2)}},isEmpty:{get:()=>0===e.issues.length}})},{Parent:Error}),rt=I(ot),at=C(ot),st=U(ot),lt=D(ot),ct=N(ot),ut=L(ot),dt=V(ot),ft=W(ot),pt=B(ot),mt=M(ot),ht=J(ot),_t=K(ot),gt=i("ZodType",(e,n)=>(Oe.init(e,n),e.def=n,e.type=n.type,Object.defineProperty(e,"_def",{value:n}),e.check=(...t)=>e.clone(h(n,{checks:[...n.checks??[],...t.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]})),e.clone=(n,t)=>$(e,n,t),e.brand=()=>e,e.register=(n,t)=>(n.add(e,t),e),e.parse=(n,t)=>rt(e,n,t,{callee:e.parse}),e.safeParse=(n,t)=>st(e,n,t),e.parseAsync=async(n,t)=>at(e,n,t,{callee:e.parseAsync}),e.safeParseAsync=async(n,t)=>lt(e,n,t),e.spa=e.safeParseAsync,e.encode=(n,t)=>ct(e,n,t),e.decode=(n,t)=>ut(e,n,t),e.encodeAsync=async(n,t)=>dt(e,n,t),e.decodeAsync=async(n,t)=>ft(e,n,t),e.safeEncode=(n,t)=>pt(e,n,t),e.safeDecode=(n,t)=>mt(e,n,t),e.safeEncodeAsync=async(n,t)=>ht(e,n,t),e.safeDecodeAsync=async(n,t)=>_t(e,n,t),e.refine=(n,t)=>e.check(function(e,n={}){return function(e,n,t){return new e({type:"custom",check:"custom",fn:n,...x(t)})}(yi,e,n)}(n,t)),e.superRefine=n=>e.check(Gn(n)),e.overwrite=n=>e.check(Kn(n)),e.optional=()=>li(e),e.nullable=()=>ui(e),e.nullish=()=>li(ui(e)),e.nonoptional=n=>function(e,n){return new pi({type:"nonoptional",innerType:e,...x(n)})}(e,n),e.array=()=>Kt(e),e.or=n=>Qt([e,n]),e.and=n=>new Xt({type:"intersection",left:e,right:n}),e.transform=n=>_i(e,new ai({type:"transform",transform:n})),e.default=n=>{return t=n,new di({type:"default",innerType:e,get defaultValue(){return"function"==typeof t?t():b(t)}});var t},e.prefault=n=>{return t=n,new fi({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof t?t():b(t)}});var t},e.catch=n=>{return new mi({type:"catch",innerType:e,catchValue:"function"==typeof(t=n)?t:()=>t});var t},e.pipe=n=>_i(e,n),e.readonly=()=>new gi({type:"readonly",innerType:e}),e.describe=n=>{const t=e.clone();return Vn.add(t,{description:n}),t},Object.defineProperty(e,"description",{get:()=>Vn.get(e)?.description,configurable:!0}),e.meta=(...n)=>{if(0===n.length)return Vn.get(e);const t=e.clone();return Vn.add(t,n[0]),t},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),yt=i("_ZodString",(e,n)=>{je.init(e,n),gt.init(e,n);const t=e._zod.bag;e.format=t.format??null,e.minLength=t.minimum??null,e.maxLength=t.maximum??null,e.regex=(...n)=>e.check(function(e,n){return new $e({check:"string_format",format:"regex",...x(n),pattern:e})}(...n)),e.includes=(...n)=>e.check(function(e,n){return new Ze({check:"string_format",format:"includes",...x(n),includes:e})}(...n)),e.startsWith=(...n)=>e.check(function(e,n){return new Ae({check:"string_format",format:"starts_with",...x(n),prefix:e})}(...n)),e.endsWith=(...n)=>e.check(function(e,n){return new Pe({check:"string_format",format:"ends_with",...x(n),suffix:e})}(...n)),e.min=(...n)=>e.check(Mn(...n)),e.max=(...n)=>e.check(Bn(...n)),e.length=(...n)=>e.check(Jn(...n)),e.nonempty=(...n)=>e.check(Mn(1,...n)),e.lowercase=n=>e.check(function(e){return new xe({check:"string_format",format:"lowercase",...x(e)})}(n)),e.uppercase=n=>e.check(function(e){return new Ee({check:"string_format",format:"uppercase",...x(e)})}(n)),e.trim=()=>e.check(Kn(e=>e.trim())),e.normalize=(...n)=>e.check(function(e){return Kn(n=>n.normalize(e))}(...n)),e.toLowerCase=()=>e.check(Kn(e=>e.toLowerCase())),e.toUpperCase=()=>e.check(Kn(e=>e.toUpperCase()))}),vt=i("ZodString",(e,n)=>{je.init(e,n),yt.init(e,n),e.email=n=>e.check(function(e,n){return new e({type:"string",format:"email",check:"string_format",abort:!1,...x(n)})}(zt,n)),e.url=n=>e.check(function(e,n){return new e({type:"string",format:"url",check:"string_format",abort:!1,...x(n)})}(xt,n)),e.jwt=n=>e.check(function(e,n){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...x(n)})}(qt,n)),e.emoji=n=>e.check(function(e,n){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...x(n)})}(Et,n)),e.guid=n=>e.check(Wn(kt,n)),e.uuid=n=>e.check(function(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...x(n)})}($t,n)),e.uuidv4=n=>e.check(function(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...x(n)})}($t,n)),e.uuidv6=n=>e.check(function(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...x(n)})}($t,n)),e.uuidv7=n=>e.check(function(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...x(n)})}($t,n)),e.nanoid=n=>e.check(function(e,n){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...x(n)})}(Zt,n)),e.guid=n=>e.check(Wn(kt,n)),e.cuid=n=>e.check(function(e,n){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...x(n)})}(At,n)),e.cuid2=n=>e.check(function(e,n){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...x(n)})}(Pt,n)),e.ulid=n=>e.check(function(e,n){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...x(n)})}(Tt,n)),e.base64=n=>e.check(function(e,n){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...x(n)})}(Ut,n)),e.base64url=n=>e.check(function(e,n){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...x(n)})}(Rt,n)),e.xid=n=>e.check(function(e,n){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...x(n)})}(Ft,n)),e.ksuid=n=>e.check(function(e,n){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...x(n)})}(St,n)),e.ipv4=n=>e.check(function(e,n){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...x(n)})}(Ot,n)),e.ipv6=n=>e.check(function(e,n){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...x(n)})}(jt,n)),e.cidrv4=n=>e.check(function(e,n){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...x(n)})}(It,n)),e.cidrv6=n=>e.check(function(e,n){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...x(n)})}(Ct,n)),e.e164=n=>e.check(function(e,n){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...x(n)})}(Dt,n)),e.datetime=n=>e.check(Yn(n)),e.date=n=>e.check(Xn(n)),e.time=n=>e.check(nt(n)),e.duration=n=>e.check(it(n))});function wt(e){return function(e,n){return new e({type:"string",...x(n)})}(vt,e)}const bt=i("ZodStringFormat",(e,n)=>{Ie.init(e,n),yt.init(e,n)}),zt=i("ZodEmail",(e,n)=>{Re.init(e,n),bt.init(e,n)}),kt=i("ZodGUID",(e,n)=>{Ce.init(e,n),bt.init(e,n)}),$t=i("ZodUUID",(e,n)=>{Ue.init(e,n),bt.init(e,n)}),xt=i("ZodURL",(e,n)=>{De.init(e,n),bt.init(e,n)}),Et=i("ZodEmoji",(e,n)=>{qe.init(e,n),bt.init(e,n)}),Zt=i("ZodNanoID",(e,n)=>{Ne.init(e,n),bt.init(e,n)}),At=i("ZodCUID",(e,n)=>{Le.init(e,n),bt.init(e,n)}),Pt=i("ZodCUID2",(e,n)=>{Ve.init(e,n),bt.init(e,n)}),Tt=i("ZodULID",(e,n)=>{We.init(e,n),bt.init(e,n)}),Ft=i("ZodXID",(e,n)=>{Be.init(e,n),bt.init(e,n)}),St=i("ZodKSUID",(e,n)=>{Me.init(e,n),bt.init(e,n)}),Ot=i("ZodIPv4",(e,n)=>{Ye.init(e,n),bt.init(e,n)}),jt=i("ZodIPv6",(e,n)=>{Qe.init(e,n),bt.init(e,n)}),It=i("ZodCIDRv4",(e,n)=>{Xe.init(e,n),bt.init(e,n)}),Ct=i("ZodCIDRv6",(e,n)=>{en.init(e,n),bt.init(e,n)}),Ut=i("ZodBase64",(e,n)=>{tn.init(e,n),bt.init(e,n)}),Rt=i("ZodBase64URL",(e,n)=>{on.init(e,n),bt.init(e,n)}),Dt=i("ZodE164",(e,n)=>{rn.init(e,n),bt.init(e,n)}),qt=i("ZodJWT",(e,n)=>{an.init(e,n),bt.init(e,n)}),Nt=i("ZodBoolean",(e,n)=>{sn.init(e,n),gt.init(e,n)});function Lt(e){return function(e,n){return new e({type:"boolean",...x(n)})}(Nt,e)}const Vt=i("ZodUnknown",(e,n)=>{ln.init(e,n),gt.init(e,n)});function Wt(){return new Vt({type:"unknown"})}const Bt=i("ZodNever",(e,n)=>{cn.init(e,n),gt.init(e,n)});function Mt(e){return function(e,n){return new e({type:"never",...x(n)})}(Bt,e)}const Jt=i("ZodArray",(e,n)=>{dn.init(e,n),gt.init(e,n),e.element=n.element,e.min=(n,t)=>e.check(Mn(n,t)),e.nonempty=n=>e.check(Mn(1,n)),e.max=(n,t)=>e.check(Bn(n,t)),e.length=(n,t)=>e.check(Jn(n,t)),e.unwrap=()=>e.element});function Kt(e,n){return function(e,n,t){return new e({type:"array",element:n,...x(t)})}(Jt,e,n)}const Gt=i("ZodObject",(e,n)=>{_n.init(e,n),gt.init(e,n),p(e,"shape",()=>n.shape),e.keyof=()=>ii(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Wt()}),e.loose=()=>e.clone({...e._zod.def,catchall:Wt()}),e.strict=()=>e.clone({...e._zod.def,catchall:Mt()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>function(e,n){if(!w(n))throw new Error("Invalid input to extend: expected a plain object");const t=e._zod.def.checks;if(t&&t.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const i=h(e._zod.def,{get shape(){const t={...e._zod.def.shape,...n};return m(this,"shape",t),t},checks:[]});return $(e,i)}(e,n),e.safeExtend=n=>function(e,n){if(!w(n))throw new Error("Invalid input to safeExtend: expected a plain object");const t={...e._zod.def,get shape(){const t={...e._zod.def.shape,...n};return m(this,"shape",t),t},checks:e._zod.def.checks};return $(e,t)}(e,n),e.merge=n=>function(e,n){const t=h(e._zod.def,{get shape(){const t={...e._zod.def.shape,...n._zod.def.shape};return m(this,"shape",t),t},get catchall(){return n._zod.def.catchall},checks:[]});return $(e,t)}(e,n),e.pick=n=>function(e,n){const t=e._zod.def;return $(e,h(e._zod.def,{get shape(){const e={};for(const i in n){if(!(i in t.shape))throw new Error(`Unrecognized key: "${i}"`);n[i]&&(e[i]=t.shape[i])}return m(this,"shape",e),e},checks:[]}))}(e,n),e.omit=n=>function(e,n){const t=e._zod.def,i=h(e._zod.def,{get shape(){const i={...e._zod.def.shape};for(const e in n){if(!(e in t.shape))throw new Error(`Unrecognized key: "${e}"`);n[e]&&delete i[e]}return m(this,"shape",i),i},checks:[]});return $(e,i)}(e,n),e.partial=(...n)=>function(e,n,t){const i=h(n._zod.def,{get shape(){const i=n._zod.def.shape,o={...i};if(t)for(const n in t){if(!(n in i))throw new Error(`Unrecognized key: "${n}"`);t[n]&&(o[n]=e?new e({type:"optional",innerType:i[n]}):i[n])}else for(const n in i)o[n]=e?new e({type:"optional",innerType:i[n]}):i[n];return m(this,"shape",o),o},checks:[]});return $(n,i)}(si,e,n[0]),e.required=(...n)=>function(e,n,t){const i=h(n._zod.def,{get shape(){const i=n._zod.def.shape,o={...i};if(t)for(const n in t){if(!(n in o))throw new Error(`Unrecognized key: "${n}"`);t[n]&&(o[n]=new e({type:"nonoptional",innerType:i[n]}))}else for(const n in i)o[n]=new e({type:"nonoptional",innerType:i[n]});return m(this,"shape",o),o},checks:[]});return $(n,i)}(pi,e,n[0])});function Ht(e,n){const t={type:"object",shape:e??{},...x(n)};return new Gt(t)}const Yt=i("ZodUnion",(e,n)=>{yn.init(e,n),gt.init(e,n),e.options=n.options});function Qt(e,n){return new Yt({type:"union",options:e,...x(n)})}const Xt=i("ZodIntersection",(e,n)=>{vn.init(e,n),gt.init(e,n)});const ei=i("ZodRecord",(e,n)=>{zn.init(e,n),gt.init(e,n),e.keyType=n.keyType,e.valueType=n.valueType});function ni(e,n,t){return new ei({type:"record",keyType:e,valueType:n,...x(t)})}const ti=i("ZodEnum",(e,n)=>{kn.init(e,n),gt.init(e,n),e.enum=n.entries,e.options=Object.values(n.entries);const t=new Set(Object.keys(n.entries));e.extract=(e,i)=>{const o={};for(const i of e){if(!t.has(i))throw new Error(`Key ${i} not found in enum`);o[i]=n.entries[i]}return new ti({...n,checks:[],...x(i),entries:o})},e.exclude=(e,i)=>{const o={...n.entries};for(const n of e){if(!t.has(n))throw new Error(`Key ${n} not found in enum`);delete o[n]}return new ti({...n,checks:[],...x(i),entries:o})}});function ii(e,n){const t=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new ti({type:"enum",entries:t,...x(n)})}const oi=i("ZodLiteral",(e,n)=>{$n.init(e,n),gt.init(e,n),e.values=new Set(n.values),Object.defineProperty(e,"value",{get(){if(n.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return n.values[0]}})});function ri(e,n){return new oi({type:"literal",values:Array.isArray(e)?e:[e],...x(n)})}const ai=i("ZodTransform",(e,n)=>{xn.init(e,n),gt.init(e,n),e._zod.parse=(t,i)=>{if("backward"===i.direction)throw new r(e.constructor.name);t.addIssue=i=>{if("string"==typeof i)t.issues.push(F(i,t.value,n));else{const n=i;n.fatal&&(n.continue=!1),n.code??(n.code="custom"),n.input??(n.input=t.value),n.inst??(n.inst=e),t.issues.push(F(n))}};const o=n.transform(t.value,t);return o instanceof Promise?o.then(e=>(t.value=e,t)):(t.value=o,t)}});const si=i("ZodOptional",(e,n)=>{Zn.init(e,n),gt.init(e,n),e.unwrap=()=>e._zod.def.innerType});function li(e){return new si({type:"optional",innerType:e})}const ci=i("ZodNullable",(e,n)=>{An.init(e,n),gt.init(e,n),e.unwrap=()=>e._zod.def.innerType});function ui(e){return new ci({type:"nullable",innerType:e})}const di=i("ZodDefault",(e,n)=>{Pn.init(e,n),gt.init(e,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});const fi=i("ZodPrefault",(e,n)=>{Fn.init(e,n),gt.init(e,n),e.unwrap=()=>e._zod.def.innerType});const pi=i("ZodNonOptional",(e,n)=>{Sn.init(e,n),gt.init(e,n),e.unwrap=()=>e._zod.def.innerType});const mi=i("ZodCatch",(e,n)=>{jn.init(e,n),gt.init(e,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});const hi=i("ZodPipe",(e,n)=>{In.init(e,n),gt.init(e,n),e.in=n.in,e.out=n.out});function _i(e,n){return new hi({type:"pipe",in:e,out:n})}const gi=i("ZodReadonly",(e,n)=>{Un.init(e,n),gt.init(e,n),e.unwrap=()=>e._zod.def.innerType});const yi=i("ZodCustom",(e,n)=>{Dn.init(e,n),gt.init(e,n)});const vi="directus:extension",wi=Ht({app:wt(),api:wt()}),bi=Ht({request:li(Ht({urls:Kt(wt()),methods:Kt(Qt([ri("GET"),ri("POST"),ri("PATCH"),ri("PUT"),ri("DELETE")]))})),log:li(Ht({})),sleep:li(Ht({}))}),zi=li(Ht({enabled:Lt(),requestedScopes:bi})),ki=Qt([Ht({type:ii(n),name:wt(),source:wt()}),Ht({type:ii(e),name:wt(),source:wt()}),Ht({type:ii(t),name:wt(),source:wi})]),$i=Ht({host:wt(),hidden:Lt().optional()}),xi=Ht({type:ii(e),path:wt(),source:wt()}),Ei=Ht({type:ii(n),path:wt(),source:wt(),sandbox:zi}),Zi=Ht({type:ii(t),path:wi,source:wi,sandbox:zi}),Ai=Ht({type:ri("bundle"),partial:Lt().optional(),path:wi,entries:Kt(ki)});Kt(ki);const Pi=$i.and(Qt([xi,Ei,Zi,Ai]));Ht({name:wt(),version:wt(),type:Qt([ri("module"),ri("commonjs")]).optional(),description:wt().optional(),icon:wt().optional(),dependencies:ni(wt(),wt()).optional(),devDependencies:ni(wt(),wt()).optional(),[vi]:Pi});var Ti={collections:[{collection:"language",meta:{collection:"language",icon:null,note:null,display_template:null,hidden:!1,singleton:!1,translations:null,archive_field:null,archive_app_filter:!0,archive_value:null,unarchive_value:null,sort_field:null,accountability:"all",color:null,item_duplication_fields:null,sort:1,group:"inframe_pasta",collapse:"open",preview_url:null,versioning:!1},schema:{}},{collection:"inframe",meta:{collection:"inframe",icon:null,note:null,display_template:null,hidden:!1,singleton:!1,translations:[{language:"en-US",translation:"Inframe",singular:"Inframe",plural:"Inframes"}],archive_field:"status",archive_app_filter:!0,archive_value:"archived",unarchive_value:"draft",sort_field:"sort",accountability:"all",color:null,item_duplication_fields:null,sort:2,group:"inframe_pasta",collapse:"open",preview_url:null,versioning:!1},schema:{}},{collection:"inframe_translation",meta:{collection:"inframe_translation",icon:"import_export",note:null,display_template:null,hidden:!0,singleton:!1,translations:null,archive_field:null,archive_app_filter:!0,archive_value:null,unarchive_value:null,sort_field:null,accountability:"all",color:null,item_duplication_fields:null,sort:3,group:"inframe_pasta",collapse:"open",preview_url:null,versioning:!1},schema:{}},{collection:"inframe_pasta",meta:{collection:"inframe_pasta",icon:"folder",note:null,display_template:null,hidden:!1,singleton:!1,translations:null,archive_field:null,archive_app_filter:!0,archive_value:null,unarchive_value:null,sort_field:null,accountability:"all",color:null,item_duplication_fields:null,sort:16,group:null,collapse:"open",preview_url:null,versioning:!1},schema:null}],fields:[{collection:"language",field:"code",type:"string",schema:{name:"code",table:"language",data_type:"character varying",default_value:null,generation_expression:null,max_length:255,numeric_precision:null,numeric_scale:null,is_generated:!1,is_nullable:!1,is_unique:!0,is_indexed:!1,is_primary_key:!0,has_auto_increment:!1,foreign_key_schema:null,foreign_key_table:null,foreign_key_column:null,comment:null},meta:{collection:"language",field:"code",special:null,interface:"input",options:null,display:null,display_options:null,readonly:!1,hidden:!1,sort:1,width:"full",translations:null,note:null,conditions:null,required:!1,group:null,validation:null,validation_message:null,searchable:!0}},{collection:"language",field:"name",type:"string",schema:{name:"name",table:"language",data_type:"character varying",default_value:null,generation_expression:null,max_length:255,numeric_precision:null,numeric_scale:null,is_generated:!1,is_nullable:!1,is_unique:!0,is_indexed:!0,is_primary_key:!1,has_auto_increment:!1,foreign_key_schema:null,foreign_key_table:null,foreign_key_column:null,comment:null},meta:{collection:"language",field:"name",special:null,interface:"input",options:null,display:null,display_options:null,readonly:!1,hidden:!1,sort:2,width:"full",translations:null,note:null,conditions:null,required:!1,group:null,validation:null,validation_message:null,searchable:!0}},{collection:"language",field:"direction",type:"string",schema:{name:"direction",table:"language",data_type:"character varying",default_value:null,generation_expression:null,max_length:255,numeric_precision:null,numeric_scale:null,is_generated:!1,is_nullable:!0,is_unique:!1,is_indexed:!1,is_primary_key:!1,has_auto_increment:!1,foreign_key_schema:null,foreign_key_table:null,foreign_key_column:null,comment:null},meta:{collection:"language",field:"direction",special:null,interface:"select-dropdown",options:{choices:[{text:"ltr",value:"ltr"},{text:"rtl",value:"rtl"}]},display:null,display_options:null,readonly:!1,hidden:!1,sort:3,width:"full",translations:null,note:null,conditions:null,required:!1,group:null,validation:null,validation_message:null,searchable:!0}},{collection:"inframe",field:"id",type:"uuid",schema:{name:"id",table:"inframe",data_type:"uuid",default_value:null,generation_expression:null,max_length:null,numeric_precision:null,numeric_scale:null,is_generated:!1,is_nullable:!1,is_unique:!0,is_indexed:!1,is_primary_key:!0,has_auto_increment:!1,foreign_key_schema:null,foreign_key_table:null,foreign_key_column:null,comment:null},meta:{collection:"inframe",field:"id",special:["uuid"],interface:"input",options:null,display:null,display_options:null,readonly:!0,hidden:!0,sort:1,width:"full",translations:null,note:null,conditions:null,required:!1,group:null,validation:null,validation_message:null,searchable:!0}},{collection:"inframe",field:"sort",type:"integer",schema:{name:"sort",table:"inframe",data_type:"integer",default_value:null,generation_expression:null,max_length:null,numeric_precision:32,numeric_scale:0,is_generated:!1,is_nullable:!0,is_unique:!1,is_indexed:!1,is_primary_key:!1,has_auto_increment:!1,foreign_key_schema:null,foreign_key_table:null,foreign_key_column:null,comment:null},meta:{collection:"inframe",field:"sort",special:null,interface:"input",options:null,display:null,display_options:null,readonly:!1,hidden:!0,sort:2,width:"full",translations:null,note:null,conditions:null,required:!1,group:null,validation:null,validation_message:null,searchable:!0}},{collection:"inframe",field:"status",type:"string",schema:{name:"status",table:"inframe",data_type:"character varying",default_value:"draft",generation_expression:null,max_length:255,numeric_precision:null,numeric_scale:null,is_generated:!1,is_nullable:!1,is_unique:!1,is_indexed:!1,is_primary_key:!1,has_auto_increment:!1,foreign_key_schema:null,foreign_key_table:null,foreign_key_column:null,comment:null},meta:{collection:"inframe",field:"status",special:null,interface:"select-dropdown",options:{choices:[{text:"Publicado",value:"published",color:"var(--theme--primary)"},{text:"Rascunho",value:"draft",color:"var(--theme--foreground)"},{text:"Arquivado",value:"archived",color:"var(--theme--warning)"}]},display:"labels",display_options:{showAsDot:!0,choices:[{text:"Publicado",value:"published",color:"var(--theme--primary)",foreground:"var(--theme--primary)",background:"var(--theme--primary-background)"},{text:"Rascunho",value:"draft",color:"var(--theme--foreground)",foreground:"var(--theme--foreground)",background:"var(--theme--background-normal)"},{text:"Arquivado",value:"archived",color:"var(--theme--warning)",foreground:"var(--theme--warning)",background:"var(--theme--warning-background)"}]},readonly:!1,hidden:!1,sort:3,width:"full",translations:null,note:null,conditions:null,required:!1,group:null,validation:null,validation_message:null,searchable:!0}},{collection:"inframe",field:"icon",type:"string",schema:{name:"icon",table:"inframe",data_type:"character varying",default_value:null,generation_expression:null,max_length:255,numeric_precision:null,numeric_scale:null,is_generated:!1,is_nullable:!0,is_unique:!1,is_indexed:!1,is_primary_key:!1,has_auto_increment:!1,foreign_key_schema:null,foreign_key_table:null,foreign_key_column:null,comment:null},meta:{collection:"inframe",field:"icon",special:null,interface:"select-icon",options:null,display:null,display_options:null,readonly:!1,hidden:!1,sort:4,width:"half",translations:null,note:null,conditions:null,required:!1,group:null,validation:null,validation_message:null,searchable:!0}},{collection:"inframe",field:"url",type:"string",schema:{name:"url",table:"inframe",data_type:"character varying",default_value:null,generation_expression:null,max_length:255,numeric_precision:null,numeric_scale:null,is_generated:!1,is_nullable:!0,is_unique:!1,is_indexed:!1,is_primary_key:!1,has_auto_increment:!1,foreign_key_schema:null,foreign_key_table:null,foreign_key_column:null,comment:null},meta:{collection:"inframe",field:"url",special:null,interface:"input",options:{iconLeft:"link"},display:null,display_options:null,readonly:!1,hidden:!1,sort:5,width:"half",translations:null,note:null,conditions:null,required:!1,group:null,validation:null,validation_message:null,searchable:!0}},{collection:"inframe",field:"thumbnail",type:"uuid",schema:{name:"thumbnail",table:"inframe",data_type:"uuid",default_value:null,generation_expression:null,max_length:null,numeric_precision:null,numeric_scale:null,is_generated:!1,is_nullable:!0,is_unique:!1,is_indexed:!1,is_primary_key:!1,has_auto_increment:!1,foreign_key_schema:"public",foreign_key_table:"directus_files",foreign_key_column:"id",comment:null},meta:{collection:"inframe",field:"thumbnail",special:["file"],interface:"file-image",options:{crop:!1},display:"image",display_options:{},readonly:!1,hidden:!1,sort:6,width:"full",translations:null,note:null,conditions:null,required:!1,group:null,validation:null,validation_message:null,searchable:!0}},{collection:"inframe",field:"translations",type:"alias",schema:null,meta:{collection:"inframe",field:"translations",special:["translations"],interface:"translations",options:{languageField:"name",userLanguage:!0,defaultLanguage:"en-US"},display:"translations",display_options:{template:"{{title}}",languageIndicatorField:"name"},readonly:!1,hidden:!1,sort:7,width:"full",translations:null,note:null,conditions:null,required:!1,group:null,validation:null,validation_message:null,searchable:!0}},{collection:"inframe_translation",field:"id",type:"integer",schema:{name:"id",table:"inframe_translation",data_type:"integer",default_value:"nextval('inframe_translation_id_seq'::regclass)",generation_expression:null,max_length:null,numeric_precision:32,numeric_scale:0,is_generated:!1,is_nullable:!1,is_unique:!0,is_indexed:!1,is_primary_key:!0,has_auto_increment:!0,foreign_key_schema:null,foreign_key_table:null,foreign_key_column:null,comment:null},meta:{collection:"inframe_translation",field:"id",special:null,interface:null,options:null,display:null,display_options:null,readonly:!1,hidden:!0,sort:1,width:"full",translations:null,note:null,conditions:null,required:!1,group:null,validation:null,validation_message:null,searchable:!0}},{collection:"inframe_translation",field:"inframe",type:"uuid",schema:{name:"inframe",table:"inframe_translation",data_type:"uuid",default_value:null,generation_expression:null,max_length:null,numeric_precision:null,numeric_scale:null,is_generated:!1,is_nullable:!0,is_unique:!1,is_indexed:!1,is_primary_key:!1,has_auto_increment:!1,foreign_key_schema:"public",foreign_key_table:"inframe",foreign_key_column:"id",comment:null},meta:{collection:"inframe_translation",field:"inframe",special:null,interface:null,options:null,display:null,display_options:null,readonly:!1,hidden:!0,sort:2,width:"full",translations:null,note:null,conditions:null,required:!1,group:null,validation:null,validation_message:null,searchable:!0}},{collection:"inframe_translation",field:"language",type:"string",schema:{name:"language",table:"inframe_translation",data_type:"character varying",default_value:null,generation_expression:null,max_length:255,numeric_precision:null,numeric_scale:null,is_generated:!1,is_nullable:!0,is_unique:!1,is_indexed:!1,is_primary_key:!1,has_auto_increment:!1,foreign_key_schema:"public",foreign_key_table:"language",foreign_key_column:"code",comment:null},meta:{collection:"inframe_translation",field:"language",special:null,interface:null,options:null,display:null,display_options:null,readonly:!1,hidden:!0,sort:3,width:"full",translations:null,note:null,conditions:null,required:!1,group:null,validation:null,validation_message:null,searchable:!0}},{collection:"inframe_translation",field:"title",type:"string",schema:{name:"title",table:"inframe_translation",data_type:"character varying",default_value:null,generation_expression:null,max_length:255,numeric_precision:null,numeric_scale:null,is_generated:!1,is_nullable:!0,is_unique:!1,is_indexed:!1,is_primary_key:!1,has_auto_increment:!1,foreign_key_schema:null,foreign_key_table:null,foreign_key_column:null,comment:null},meta:{collection:"inframe_translation",field:"title",special:null,interface:"input",options:null,display:null,display_options:null,readonly:!1,hidden:!1,sort:4,width:"full",translations:null,note:null,conditions:null,required:!1,group:null,validation:null,validation_message:null,searchable:!0}}],relations:[{collection:"inframe",field:"thumbnail",related_collection:"directus_files",schema:{constraint_name:"inframe_thumbnail_foreign",table:"inframe",column:"thumbnail",foreign_key_schema:"public",foreign_key_table:"directus_files",foreign_key_column:"id",on_update:"NO ACTION",on_delete:"SET NULL"},meta:{many_collection:"inframe",many_field:"thumbnail",one_collection:"directus_files",one_field:null,one_collection_field:null,one_allowed_collections:null,junction_field:null,sort_field:null,one_deselect_action:"nullify"}},{collection:"inframe_translation",field:"language",related_collection:"language",schema:{constraint_name:"inframe_translation_language_foreign",table:"inframe_translation",column:"language",foreign_key_schema:"public",foreign_key_table:"language",foreign_key_column:"code",on_update:"NO ACTION",on_delete:"SET NULL"},meta:{many_collection:"inframe_translation",many_field:"language",one_collection:"language",one_field:null,one_collection_field:null,one_allowed_collections:null,junction_field:"inframe",sort_field:null,one_deselect_action:"nullify"}},{collection:"inframe_translation",field:"inframe",related_collection:"inframe",schema:{constraint_name:"inframe_translation_inframe_foreign",table:"inframe_translation",column:"inframe",foreign_key_schema:"public",foreign_key_table:"inframe",foreign_key_column:"id",on_update:"NO ACTION",on_delete:"SET NULL"},meta:{many_collection:"inframe_translation",many_field:"inframe",one_collection:"inframe",one_field:"translations",one_collection_field:null,one_allowed_collections:null,junction_field:"language",sort_field:null,one_deselect_action:"nullify"}}]};async function Fi({services:e,logger:n,database:t,getSchema:i}){const{CollectionsService:o,FieldsService:r,RelationsService:a}=e;n.info("[inFrame Extension] Starting collections configuration...");const s=new o({schema:await i(),knex:t});let l=[];try{l=await s.readByQuery()}catch(e){n.warn(`[inFrame Extension] Error listing collections: ${e.message}`),l=[]}const c=new Set(l.map(e=>e.collection));let u=0,d=0,f=0;const p=Ti.collections||[],m=Ti.fields||[],h=Ti.relations||[];n.info(`[inFrame Extension] 📋 Collections to process: ${p.map(e=>e.collection).join(", ")}`);try{const e=[];let t=null;for(;e.length!==t;){t=e.length;for(const t of p)if(!e.includes(t.collection)){if(t.meta?.group){const{group:i}=t.meta;if(!p.some(e=>e.collection===i)&&!c.has(i)){e.push(t.collection),n.warn(`[inFrame Extension] ⚠️ Skipping collection "${t.collection}" because its group "${i}" does not exist`);continue}if(!e.includes(i)&&!c.has(i))continue}if(c.has(t.collection))n.info(`[inFrame Extension] ⏭️ Collection ${t.collection} already exists`);else try{n.info(`[inFrame Extension] 🔨 Creating collection: ${t.collection}`);const e=m.filter(e=>e.collection===t.collection);await s.createOne({collection:t.collection,meta:t.meta,schema:t.schema||null,fields:e.map(e=>{const n={field:e.field,type:e.type,meta:e.meta};return null!==e.schema&&(n.schema=e.schema),n})}),u++,d+=e.length,n.info(`[inFrame Extension] ✅ Collection ${t.collection} created with ${e.length} field(s)`)}catch(e){n.error(`[inFrame Extension] ❌ Error creating collection ${t.collection}: ${e.message}`)}e.push(t.collection)}}n.info(`[inFrame Extension] ✅ Imported ${u} collection(s) with ${d} field(s)`)}catch(e){n.error(`[inFrame Extension] ❌ Error during collections import: ${e.message}`)}try{const e=new r({schema:await i({accountability:null,database:t}),knex:t});for(const i of m)if(c.has(i.collection)||u>0)try{if(!await t.select("*").from("directus_fields").where("collection",i.collection).where("field",i.field).first()){n.info(`[inFrame Extension] 🔨 Creating field: ${i.collection}.${i.field}`);const t={field:i.field,type:i.type,meta:i.meta};null!==i.schema&&(t.schema=i.schema),await e.createField(i.collection,t),d++,n.info(`[inFrame Extension] ✅ Field ${i.collection}.${i.field} created`)}}catch(e){n.error(`[inFrame Extension] ❌ Error creating field ${i.collection}.${i.field}: ${e.message}`)}n.info(`[inFrame Extension] ✅ Total fields created: ${d}`)}catch(e){n.error(`[inFrame Extension] ❌ Error during fields import: ${e.message}`)}try{const e=new a({schema:await i({accountability:null,database:t}),knex:t});n.info("[inFrame Extension] 📋 Importing relations...");for(const i of h)try{if(await t.select("*").from("directus_relations").where("many_collection",i.collection).where("many_field",i.field).first()){n.info(`[inFrame Extension] ⏭️ Relation ${i.collection}.${i.field} -> ${i.related_collection} already exists`);continue}n.info(`[inFrame Extension] 🔗 Creating relation: ${i.collection}.${i.field} -> ${i.related_collection}`),await e.createOne({collection:i.collection,field:i.field,related_collection:i.related_collection,meta:i.meta,schema:i.schema}),f++,n.info(`[inFrame Extension] ✅ Relation ${i.collection}.${i.field} -> ${i.related_collection} created`)}catch(e){n.error(`[inFrame Extension] ❌ Error creating relation ${i.collection}.${i.field}: ${e.message}`)}n.info(`[inFrame Extension] ✅ Total relations created: ${f}`)}catch(e){n.error(`[inFrame Extension] ❌ Error during relations import: ${e.message}`)}try{await async function({services:e,logger:n,database:t,getSchema:i}){n.info("[inFrame Extension] 🌍 Setting up default languages...");const{ItemsService:o}=e,r=[{code:"pt-BR",name:"Português",direction:"ltr"},{code:"en-US",name:"English",direction:"ltr"},{code:"es-ES",name:"Español",direction:"ltr"}];try{if(!await t.select("collection").from("directus_collections").where("collection","language").first())return void n.warn("[inFrame Extension] ⚠️ Language collection does not exist, skipping language setup");const e=new o("language",{schema:await i({accountability:null,database:t}),knex:t});let a=0;for(const i of r)try{if(await t.select("*").from("language").where("code",i.code).first()){n.info(`[inFrame Extension] ⏭️ Language ${i.code} (${i.name}) already exists`);continue}await e.createOne(i),a++,n.info(`[inFrame Extension] ✅ Language ${i.code} (${i.name}) created`)}catch(e){n.error(`[inFrame Extension] ❌ Error creating language ${i.code}: ${e.message}`)}a>0?n.info(`[inFrame Extension] ✅ Created ${a} default language(s)`):n.info("[inFrame Extension] ℹ️ All default languages already exist")}catch(e){n.error(`[inFrame Extension] ❌ Error setting up languages: ${e.message}`)}}({services:e,logger:n,database:t,getSchema:i})}catch(e){n.error(`[inFrame Extension] ❌ Error during languages setup: ${e.message}`)}n.info(`[inFrame Extension] 🎉 Configuration complete! Created: ${u} collection(s), ${d} field(s), ${f} relation(s)`);try{await i({accountability:null,database:t}),n.info("[inFrame Extension] ✅ Schema refreshed")}catch(e){n.warn(`[inFrame Extension] ⚠️ Error refreshing schema: ${e.message}`)}}const Si=[{name:"inframe-setup",config:({action:e,init:n},{services:t,logger:i,database:o,getSchema:r})=>{i.info("[inFrame Extension] 🔌 Hook registered, waiting for events..."),n("routes.after",async()=>{i.info("[inFrame Extension] 🚀 routes.after event triggered, running setup...");try{await Fi({services:t,logger:i,database:o,getSchema:r})}catch(e){i.error(`[inFrame Extension] Error during initial setup: ${e.message}`)}}),e("server.start",async()=>{i.info("[inFrame Extension] 🚀 server.start event triggered, running setup...");try{await Fi({services:t,logger:i,database:o,getSchema:r})}catch(e){i.error(`[inFrame Extension] Error during initial setup: ${e.message}`)}}),e("extensions.install",async({extension:e})=>{if(e?.includes("inframe")||e?.includes("@devix-tecnologia/directus-extension-inframe")){i.info("[inFrame Extension] Extension installed, configuring collections...");try{await Fi({services:t,logger:i,database:o,getSchema:r})}catch(e){i.error(`[inFrame Extension] Error during installation: ${e.message}`)}}}),e("extensions.reload",async()=>{i.info("[inFrame Extension] Verifying collections configuration...");try{await async function({logger:e,services:n,getSchema:t}){const{CollectionsService:i}=n,o=await t(),r=new i({schema:o,knex:null});try{const n=await r.readByQuery(),t=new Set(n.map(e=>e.collection)),i=Ti.collections.map(e=>e.collection),o=i.filter(e=>t.has(e)).length,a=i.length;o===a?e.info(`[inFrame Extension] All ${a} collections are configured correctly ✓`):e.warn(`[inFrame Extension] ${o}/${a} collections found. Run setup if needed.`)}catch(n){e.warn(`[inFrame Extension] Error verifying collections: ${n.message}`)}}({logger:i,services:t,database:o,getSchema:r})}catch(e){i.warn(`[inFrame Extension] Error verifying collections: ${e.message}`)}})}}],Oi=[],ji=[];export{Oi as endpoints,Si as hooks,ji as operations};
|
package/dist/app.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useApi as e,defineModule as n}from"@directus/extensions-sdk";import{ref as t,defineComponent as a,resolveComponent as r,createElementBlock as i,openBlock as o,createElementVNode as d,Fragment as l,renderList as s,createVNode as c,withCtx as m,toDisplayString as u,watch as p,computed as g,onMounted as f,createBlock as v,createCommentVNode as h,normalizeStyle as b,createSlots as x}from"vue";import{useRouter as y,useRoute as w}from"vue-router";const k=async e=>(await e.get("/users/me")).data.data.language||"en-US",I=e=>e&&0!==e.length&&e[0]&&e[0].title?e[0].title:"Item inFrame",T=()=>{const n=t([]),a=t(!1),r=e();return{items:n,loading:a,fetchItems:async()=>{a.value=!0;try{const e=await k(r),t=await r.get("/items/inframe",{params:{fields:["id","sort","status","icon","url","thumbnail","translations.language","translations.title"],filter:{status:{_eq:"published"}},sort:["sort"]}}),a=Array.isArray(t.data)?t.data:t.data.data||[];n.value=a.map(n=>{if(n.translations&&n.translations.length>0){const t=n.translations.find(n=>n.language===e);t&&(n.translations=[t,...n.translations.filter(n=>n.language!==e)])}return n})}finally{a.value=!1}},getTitle:I}},_=()=>{const n=t(null),a=t(!1),r=e();return{item:n,loading:a,fetchItem:async e=>{if(e){a.value=!0;try{const t=await k(r),a=await r.get(`/items/inframe/${e}`,{params:{fields:["id","status","sort","icon","url","thumbnail","translations.language","translations.title"]}}),i=a.data.data||a.data;if(console.log("[useFetchItem] Response:",a.data),console.log("[useFetchItem] Parsed data:",i),i.translations&&i.translations.length>0){const e=i.translations.find(e=>e.language===t);e&&(i.translations=[e,...i.translations.filter(e=>e.language!==t)])}n.value=i,console.log("[useFetchItem] Final item:",n.value)}finally{a.value=!1}}},getTitle:I}};var z=a({name:"NavMenu",props:{items:{type:Array,required:!0}},setup(){const{getTitle:e}=T();return{getTitle:e}}}),q=[],S=[];function A(e,n){if(e&&"undefined"!=typeof document){var t,a=!0===n.prepend?"prepend":"append",r=!0===n.singleTag,i="string"==typeof n.container?document.querySelector(n.container):document.getElementsByTagName("head")[0];if(r){var o=q.indexOf(i);-1===o&&(o=q.push(i)-1,S[o]={}),t=S[o]&&S[o][a]?S[o][a]:S[o][a]=d()}else t=d();65279===e.charCodeAt(0)&&(e=e.substring(1)),t.styleSheet?t.styleSheet.cssText+=e:t.appendChild(document.createTextNode(e))}function d(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),n.attributes)for(var t=Object.keys(n.attributes),r=0;r<t.length;r++)e.setAttribute(t[r],n.attributes[t[r]]);var o="prepend"===a?"afterbegin":"beforeend";return i.insertAdjacentElement(o,e),e}}A("\n.nav-menu[data-v-33faf0a5] {\n margin-top: 20px;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n}\n.menu-list[data-v-33faf0a5] {\n list-style: none;\n padding: 0;\n margin: 0;\n}\n.menu-item[data-v-33faf0a5] {\n margin-bottom: 8px;\n}\n.menu-link[data-v-33faf0a5] {\n display: flex;\n align-items: center;\n text-decoration: none;\n color: var(--theme--foreground-accent);\n font-size: 16px;\n padding: 12px 20px;\n transition:\n background-color 0.3s ease,\n color 0.3s ease;\n}\n.menu-link[data-v-33faf0a5]:hover {\n background-color: var(--theme--primary-light);\n color: var(--theme--primary);\n}\n.menu-link.active-link[data-v-33faf0a5] {\n background-color: var(--theme--primary);\n color: var(--white);\n font-weight: bold;\n}\n.menu-icon[data-v-33faf0a5] {\n margin-right: 10px;\n font-size: 20px;\n}\n.menu-link span[data-v-33faf0a5] {\n font-weight: 500;\n}\n",{});var R=(e,n)=>{const t=e.__vccOpts||e;for(const[e,a]of n)t[e]=a;return t};const C={class:"nav-menu"},j={class:"menu-list"},N={class:"menu-link-text"};var E=R(z,[["render",function(e,n,t,a,p,g){const f=r("v-icon"),v=r("router-link");return o(),i("nav",C,[d("ul",j,[(o(!0),i(l,null,s(e.items,n=>(o(),i("li",{key:n.id,class:"menu-item"},[c(v,{to:`/inframe/${n.id}`,class:"menu-link","active-class":"active-link"},{default:m(()=>[c(f,{class:"menu-icon",name:n.icon},null,8,["name"]),d("span",N,u(e.getTitle(n.translations)),1)]),_:2},1032,["to"])]))),128))])])}],["__scopeId","data-v-33faf0a5"]]);const M="directus_inframe_last_route",$="lastRoute",D=()=>{const e=y(),n=w(),a=t(!1);(()=>{try{const e=localStorage.getItem(M);"undefined"!==e&&"null"!==e&&""!==e||localStorage.removeItem(M)}catch{}})();const r=t=>{const a=t||n.params.id;if(a&&"undefined"!==a)try{localStorage.setItem(M,a);const t={...n.query};t[$]=a,e.replace({path:n.path,query:t}).catch(()=>{})}catch{}},i=()=>{try{const e=n.query[$];if(e&&"undefined"!==e)return e;const t=localStorage.getItem(M);if(t&&"undefined"!==t)return t;"undefined"===t&&localStorage.removeItem(M)}catch{}return null};return{saveCurrentRoute:r,getLastRoute:i,restoreLastRoute:async()=>{const n=i();if(!n||"undefined"===n)return!1;try{return a.value=!0,await e.push(`/inframe/${n}`),!0}catch{return!1}finally{a.value=!1}},clearSavedRoute:()=>{try{localStorage.removeItem(M);const t={...n.query};delete t[$],e.replace({path:n.path,query:t}).catch(()=>{})}catch{}},startAutoSave:()=>{p(()=>n.params.id,e=>{!a.value&&e&&r(e)},{immediate:!1})},isRestoringRoute:a}};var F=a({name:"InframeList",components:{NavMenu:E},setup(){const{items:e,loading:n,fetchItems:t,getTitle:a}=T(),r=y(),i=w(),{startAutoSave:o}=D(),d=g(()=>i.params.id);return f(async()=>{await t(),o()}),{items:e,loading:n,page_title:"Extra",getTitle:a,currentItemId:d,navigateToItem:e=>{r.push(`/inframe/${e}`)}}}});A("\n.container[data-v-2d557b14] {\n display: flex;\n flex-wrap: wrap;\n gap: 20px;\n padding: 20px 50px;\n}\n.card-container[data-v-2d557b14] {\n display: flex;\n flex-wrap: wrap;\n gap: 20px;\n width: 100%;\n}\n.card[data-v-2d557b14] {\n background-color: #ffffff;\n border-radius: 8px;\n box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);\n flex: 1 1 25%;\n height: 200px;\n display: flex;\n flex-direction: column; /* Para garantir que o conteúdo não sobreponha a imagem */\n justify-content: flex-end; /* Ajusta o conteúdo para o fundo */\n align-items: center;\n text-align: center;\n overflow: hidden;\n transition:\n transform 0.3s ease,\n box-shadow 0.3s ease;\n}\n.card[data-v-2d557b14]:hover {\n transform: translateY(-10px);\n box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);\n}\n.card-link[data-v-2d557b14] {\n display: flex;\n flex-direction: column;\n justify-content: flex-end; /* Coloca o conteúdo no fundo do link */\n align-items: center;\n height: 100%;\n text-decoration: none; /* Remove o estilo de link */\n background-size: cover;\n background-position: center;\n background-repeat: no-repeat;\n padding: 0;\n width: 100%;\n}\n.card-header h3[data-v-2d557b14] {\n margin: 0; /* Remove a margem para melhor controle de espaçamento */\n padding: 10px;\n background: var(--theme--primary);\n width: 100%;\n}\n.card-header[data-v-2d557b14] {\n background-color: var(--theme--primary-light);\n padding: 0;\n font-size: 18px;\n font-weight: bold;\n color: var(--white);\n width: 100%;\n}\n.card-body[data-v-2d557b14] {\n padding: 16px;\n font-size: 14px;\n color: var(--theme--foreground);\n}\n.card-body p[data-v-2d557b14] {\n margin: 0;\n}\n.empty-state[data-v-2d557b14] {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 400px;\n color: var(--theme--foreground-subdued);\n text-align: center;\n gap: 1rem;\n}\n.empty-state h2[data-v-2d557b14] {\n margin: 0;\n font-size: 1.5rem;\n font-weight: 600;\n color: var(--theme--foreground);\n}\n.empty-state p[data-v-2d557b14] {\n margin: 0;\n font-size: 1rem;\n}\n.loading-state[data-v-2d557b14] {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 400px;\n color: var(--theme--foreground-subdued);\n text-align: center;\n}\n.loading-state p[data-v-2d557b14] {\n margin: 0;\n font-size: 1.125rem;\n}\n.card-container[data-v-2d557b14] {\n display: flex;\n flex-wrap: wrap;\n gap: 20px;\n width: 100%;\n}\n.card[data-v-2d557b14] {\n background-color: #ffffff;\n border-radius: 8px;\n box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);\n flex: 1 1 25%;\n height: 200px;\n display: flex;\n flex-direction: column;\n justify-content: flex-end;\n align-items: center;\n text-align: center;\n overflow: hidden;\n transition:\n transform 0.3s ease,\n box-shadow 0.3s ease;\n cursor: pointer;\n}\n.card[data-v-2d557b14]:hover {\n transform: translateY(-10px);\n box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);\n}\n.card-link[data-v-2d557b14] {\n display: flex;\n flex-direction: column;\n justify-content: flex-end;\n align-items: center;\n height: 100%;\n text-decoration: none;\n background-size: cover;\n background-position: center;\n background-repeat: no-repeat;\n padding: 0;\n width: 100%;\n}\n.card-header h3[data-v-2d557b14] {\n margin: 0;\n padding: 10px;\n background: var(--theme--primary);\n width: 100%;\n}\n.card-header[data-v-2d557b14] {\n background-color: var(--theme--primary-light);\n padding: 0;\n font-size: 18px;\n font-weight: bold;\n color: var(--white);\n width: 100%;\n}\n.card-body[data-v-2d557b14] {\n padding: 16px;\n font-size: 14px;\n color: var(--theme--foreground);\n}\n.card-body p[data-v-2d557b14] {\n margin: 0;\n}\n",{});const L={class:"container"},O={key:0,class:"loading-state"},U={class:"empty-state"},B={class:"card-container"},P=["onClick"],Y={class:"card-header"};var H=R(F,[["render",function(e,n,t,a,p,g){const f=r("NavMenu"),x=r("v-icon"),y=r("router-view"),w=r("private-view");return o(),v(w,{title:e.page_title},{navigation:m(()=>[c(f,{items:e.items},null,8,["items"])]),default:m(()=>[d("div",L,[h(" Loading state "),e.loading?(o(),i("div",O,[...n[0]||(n[0]=[d("p",null,"Carregando...",-1)])])):0===e.items.length?(o(),i(l,{key:1},[h(" Mensagem quando não há itens (após carregar) "),d("div",U,[c(x,{name:"inbox",large:""}),n[1]||(n[1]=d("h2",null,"Nenhum item cadastrado",-1)),n[2]||(n[2]=d("p",null,"Crie um novo item na coleção inframe para começar.",-1))])],2112)):e.currentItemId?(o(),i(l,{key:3},[h(" O router-view vai renderizar o conteúdo quando há um item selecionado "),c(y)],2112)):(o(),i(l,{key:2},[h(" Lista de cards quando está na página inicial (sem ID na rota) "),d("div",B,[(o(!0),i(l,null,s(e.items,n=>(o(),i("div",{key:n.id,class:"card",onClick:t=>e.navigateToItem(n.id)},[d("div",{class:"card-link",style:b(n.thumbnail?`background-image: url(http://localhost:8055/assets/${n.thumbnail})`:"")},[d("div",Y,[d("h3",null,u(e.getTitle(n.translations)),1)])],4)],8,P))),128))])],2112))])]),_:1},8,["title"])}],["__scopeId","data-v-2d557b14"]]),V=a({name:"ItemDetail",components:{NavMenu:E},props:{item:{type:Object,required:!0},items:{type:Array,required:!0},loading:{type:Boolean,default:!1},title:{type:String,default:""}},setup:e=>({...e,breadcrumb:[{name:"Home",to:"/inframe"}],normalizeUrl:e=>e?e.match(/^https?:\/\//i)?e:`https://${e}`:""})});A("\n.header-bar[data-v-0ceec750] {\n display: none !important;\n}\n[data-v-0ceec750] .header-bar {\n display: none !important;\n}\n.container[data-v-0ceec750] {\n margin: 20px 50px;\n}\nh2[data-v-0ceec750] {\n color: var(--theme--foreground-accent);\n margin-bottom: 10px;\n}\np[data-v-0ceec750] {\n font-size: 16px;\n line-height: 1.5;\n color: var(--theme--foreground-accent);\n}\n.main[data-v-0ceec750] {\n position: relative;\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n}\n.iframe-area[data-v-0ceec750] {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n overflow: hidden !important;\n}\niframe[data-v-0ceec750] {\n width: 100%;\n height: 100%;\n border: none;\n}\n",{});const G={class:"main"},J={key:0},K={key:1},Q={key:2},W={class:"iframe-area"},X=["src"],Z={key:3};var ee=a({name:"ItemDetailRoute",components:{ItemDetail:R(V,[["render",function(e,n,t,a,l,s){const u=r("v-breadcrumb"),p=r("NavMenu"),g=r("private-view");return o(),v(g,{title:e.title},x({navigation:m(()=>[c(p,{items:e.items},null,8,["items"])]),default:m(()=>[d("div",G,[e.loading?(o(),i("div",J,[...n[0]||(n[0]=[d("p",null,"Carregando...",-1)])])):e.item?e.item?(o(),i("div",Q,[d("div",W,[d("iframe",{src:e.normalizeUrl(e.item.url),frameborder:"0",sandbox:"allow-scripts allow-same-origin allow-forms allow-popups allow-popups-to-escape-sandbox",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowfullscreen:""},null,8,X)])])):(o(),i("div",Z,[...n[2]||(n[2]=[d("p",null,"Erro ao carregar dados. Tente novamente mais tarde.",-1)])])):(o(),i("div",K,[...n[1]||(n[1]=[d("p",null,"Nenhum item encontrado. Verifique se o item existe e está publicado.",-1)])]))])]),_:2},[e.breadcrumb.length>0?{name:"headline",fn:m(()=>[c(u,{items:e.breadcrumb},null,8,["items"])]),key:"0"}:void 0]),1032,["title"])}],["__scopeId","data-v-0ceec750"]])},setup(){const e=w(),{items:n,fetchItems:t,getTitle:a}=T(),{item:r,loading:i,fetchItem:o}=_(),{saveCurrentRoute:d,startAutoSave:l}=D();return f(async()=>{await t();const n=e.params.id;n&&(await o(n),d(n)),l()}),p(()=>e.params.id,async e=>{e&&(await o(e),d(e))}),{item:r,items:n,loading:i,getTitle:a}}});const ne={key:1,class:"loading-state"},te={key:2,class:"error-state"};const ae=[],re=[],ie=[],oe=[n({id:"inframe",name:"Extra",icon:"tv_signin",routes:[{path:"",props:!0,component:H},{path:":id",component:R(ee,[["render",function(e,n,t,a,l,s){const c=r("ItemDetail");return e.item?(o(),v(c,{key:0,item:e.item,items:e.items,loading:e.loading,title:e.getTitle(e.item?.translations||[])},null,8,["item","items","loading","title"])):e.loading?(o(),i("div",ne,[...n[0]||(n[0]=[d("p",null,"Carregando item...",-1)])])):(o(),i("div",te,[...n[1]||(n[1]=[d("p",null,"Item não encontrado ou erro ao carregar.",-1)])]))}]]),props:!0}]})],de=[],le=[],se=[];export{re as displays,ae as interfaces,ie as layouts,oe as modules,se as operations,de as panels,le as themes};
|
|
1
|
+
import{useApi as e,useStores as n,defineModule as t}from"@directus/extensions-sdk";import{ref as a,defineComponent as r,resolveComponent as o,createElementBlock as i,openBlock as s,createElementVNode as l,Fragment as d,renderList as c,createVNode as u,withCtx as m,toDisplayString as p,watch as g,computed as f,onMounted as v,createBlock as h,createCommentVNode as b,normalizeStyle as y,createSlots as x}from"vue";import{useRouter as w,useRoute as k}from"vue-router";const I=async e=>(await e.get("/users/me")).data.data.language||"en-US",_=e=>e&&0!==e.length&&e[0]&&e[0].title?e[0].title:"Item inFrame",R=()=>{const n=a([]),t=a(!1),r=e();return{items:n,loading:t,fetchItems:async()=>{t.value=!0;try{const e=await I(r),t=await r.get("/items/inframe",{params:{fields:["id","sort","status","icon","url","thumbnail","translations.language","translations.title"],filter:{status:{_eq:"published"}},sort:["sort"]}}),a=Array.isArray(t.data)?t.data:t.data.data||[];n.value=a.map(n=>{if(n.translations&&n.translations.length>0){const t=n.translations.find(n=>n.language===e);t&&(n.translations=[t,...n.translations.filter(n=>n.language!==e)])}return n})}finally{t.value=!1}},getTitle:_}},$=()=>{const n=a(null),t=a(!1),r=e();return{item:n,loading:t,fetchItem:async e=>{if(e){t.value=!0;try{const t=await I(r),a=await r.get(`/items/inframe/${e}`,{params:{fields:["id","status","sort","icon","url","thumbnail","translations.language","translations.title"]}}),o=a.data.data||a.data;if(o.translations&&o.translations.length>0){const e=o.translations.find(e=>e.language===t);e&&(o.translations=[e,...o.translations.filter(e=>e.language!==t)])}n.value=o}finally{t.value=!1}}},getTitle:_}};var S=r({name:"NavMenu",props:{items:{type:Array,required:!0}},setup(){const{getTitle:e}=R();return{getTitle:e}}}),U=[],T=[];function C(e,n){if(e&&"undefined"!=typeof document){var t,a=!0===n.prepend?"prepend":"append",r=!0===n.singleTag,o="string"==typeof n.container?document.querySelector(n.container):document.getElementsByTagName("head")[0];if(r){var i=U.indexOf(o);-1===i&&(i=U.push(o)-1,T[i]={}),t=T[i]&&T[i][a]?T[i][a]:T[i][a]=s()}else t=s();65279===e.charCodeAt(0)&&(e=e.substring(1)),t.styleSheet?t.styleSheet.cssText+=e:t.appendChild(document.createTextNode(e))}function s(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),n.attributes)for(var t=Object.keys(n.attributes),r=0;r<t.length;r++)e.setAttribute(t[r],n.attributes[t[r]]);var i="prepend"===a?"afterbegin":"beforeend";return o.insertAdjacentElement(i,e),e}}C("\n.nav-menu[data-v-33faf0a5] {\n margin-top: 20px;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n}\n.menu-list[data-v-33faf0a5] {\n list-style: none;\n padding: 0;\n margin: 0;\n}\n.menu-item[data-v-33faf0a5] {\n margin-bottom: 8px;\n}\n.menu-link[data-v-33faf0a5] {\n display: flex;\n align-items: center;\n text-decoration: none;\n color: var(--theme--foreground-accent);\n font-size: 16px;\n padding: 12px 20px;\n transition:\n background-color 0.3s ease,\n color 0.3s ease;\n}\n.menu-link[data-v-33faf0a5]:hover {\n background-color: var(--theme--primary-light);\n color: var(--theme--primary);\n}\n.menu-link.active-link[data-v-33faf0a5] {\n background-color: var(--theme--primary);\n color: var(--white);\n font-weight: bold;\n}\n.menu-icon[data-v-33faf0a5] {\n margin-right: 10px;\n font-size: 20px;\n}\n.menu-link span[data-v-33faf0a5] {\n font-weight: 500;\n}\n",{});var z=(e,n)=>{const t=e.__vccOpts||e;for(const[e,a]of n)t[e]=a;return t};const E={class:"nav-menu"},q={class:"menu-list"},A={class:"menu-link-text"};var j=z(S,[["render",function(e,n,t,a,r,g){const f=o("v-icon"),v=o("router-link");return s(),i("nav",E,[l("ul",q,[(s(!0),i(d,null,c(e.items,n=>(s(),i("li",{key:n.id,class:"menu-item"},[u(v,{to:`/inframe/${n.id}`,class:"menu-link","active-class":"active-link"},{default:m(()=>[u(f,{class:"menu-icon",name:n.icon},null,8,["name"]),l("span",A,p(e.getTitle(n.translations)),1)]),_:2},1032,["to"])]))),128))])])}],["__scopeId","data-v-33faf0a5"]]);const L="directus_inframe_last_route",F="lastRoute",N=()=>{const e=w(),n=k(),t=a(!1);(()=>{try{const e=localStorage.getItem(L);"undefined"!==e&&"null"!==e&&""!==e||localStorage.removeItem(L)}catch{}})();const r=t=>{const a=t||n.params.id;if(a&&"undefined"!==a)try{localStorage.setItem(L,a);const t={...n.query};t[F]=a,e.replace({path:n.path,query:t}).catch(()=>{})}catch{}},o=()=>{try{const e=n.query[F];if(e&&"string"==typeof e&&"undefined"!==e)return e;const t=localStorage.getItem(L);if(t&&"undefined"!==t)return t;"undefined"===t&&localStorage.removeItem(L)}catch{}return null};return{saveCurrentRoute:r,getLastRoute:o,restoreLastRoute:async()=>{const n=o();if(!n||"undefined"===n)return!1;try{return t.value=!0,await e.push(`/inframe/${n}`),!0}catch{return!1}finally{t.value=!1}},clearSavedRoute:()=>{try{localStorage.removeItem(L);const t={...n.query};delete t[F],e.replace({path:n.path,query:t}).catch(()=>{})}catch{}},startAutoSave:()=>{g(()=>n.params.id,e=>{!t.value&&e&&r(e)},{immediate:!1})},isRestoringRoute:t}};var D=r({name:"InframeList",components:{NavMenu:j},setup(){const{items:e,loading:n,fetchItems:t,getTitle:a}=R(),r=w(),o=k(),{startAutoSave:i}=N(),s=f(()=>o.params.id);return v(async()=>{await t(),i()}),{items:e,loading:n,page_title:"Extra",getTitle:a,currentItemId:s,navigateToItem:e=>{r.push(`/inframe/${e}`)}}}});C("\n.container[data-v-2d557b14] {\n display: flex;\n flex-wrap: wrap;\n gap: 20px;\n padding: 20px 50px;\n}\n.card-container[data-v-2d557b14] {\n display: flex;\n flex-wrap: wrap;\n gap: 20px;\n width: 100%;\n}\n.card[data-v-2d557b14] {\n background-color: #ffffff;\n border-radius: 8px;\n box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);\n flex: 1 1 25%;\n height: 200px;\n display: flex;\n flex-direction: column; /* Para garantir que o conteúdo não sobreponha a imagem */\n justify-content: flex-end; /* Ajusta o conteúdo para o fundo */\n align-items: center;\n text-align: center;\n overflow: hidden;\n transition:\n transform 0.3s ease,\n box-shadow 0.3s ease;\n}\n.card[data-v-2d557b14]:hover {\n transform: translateY(-10px);\n box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);\n}\n.card-link[data-v-2d557b14] {\n display: flex;\n flex-direction: column;\n justify-content: flex-end; /* Coloca o conteúdo no fundo do link */\n align-items: center;\n height: 100%;\n text-decoration: none; /* Remove o estilo de link */\n background-size: cover;\n background-position: center;\n background-repeat: no-repeat;\n padding: 0;\n width: 100%;\n}\n.card-header h3[data-v-2d557b14] {\n margin: 0; /* Remove a margem para melhor controle de espaçamento */\n padding: 10px;\n background: var(--theme--primary);\n width: 100%;\n}\n.card-header[data-v-2d557b14] {\n background-color: var(--theme--primary-light);\n padding: 0;\n font-size: 18px;\n font-weight: bold;\n color: var(--white);\n width: 100%;\n}\n.card-body[data-v-2d557b14] {\n padding: 16px;\n font-size: 14px;\n color: var(--theme--foreground);\n}\n.card-body p[data-v-2d557b14] {\n margin: 0;\n}\n.empty-state[data-v-2d557b14] {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 400px;\n color: var(--theme--foreground-subdued);\n text-align: center;\n gap: 1rem;\n}\n.empty-state h2[data-v-2d557b14] {\n margin: 0;\n font-size: 1.5rem;\n font-weight: 600;\n color: var(--theme--foreground);\n}\n.empty-state p[data-v-2d557b14] {\n margin: 0;\n font-size: 1rem;\n}\n.loading-state[data-v-2d557b14] {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 400px;\n color: var(--theme--foreground-subdued);\n text-align: center;\n}\n.loading-state p[data-v-2d557b14] {\n margin: 0;\n font-size: 1.125rem;\n}\n.card-container[data-v-2d557b14] {\n display: flex;\n flex-wrap: wrap;\n gap: 20px;\n width: 100%;\n}\n.card[data-v-2d557b14] {\n background-color: #ffffff;\n border-radius: 8px;\n box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);\n flex: 1 1 25%;\n height: 200px;\n display: flex;\n flex-direction: column;\n justify-content: flex-end;\n align-items: center;\n text-align: center;\n overflow: hidden;\n transition:\n transform 0.3s ease,\n box-shadow 0.3s ease;\n cursor: pointer;\n}\n.card[data-v-2d557b14]:hover {\n transform: translateY(-10px);\n box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);\n}\n.card-link[data-v-2d557b14] {\n display: flex;\n flex-direction: column;\n justify-content: flex-end;\n align-items: center;\n height: 100%;\n text-decoration: none;\n background-size: cover;\n background-position: center;\n background-repeat: no-repeat;\n padding: 0;\n width: 100%;\n}\n.card-header h3[data-v-2d557b14] {\n margin: 0;\n padding: 10px;\n background: var(--theme--primary);\n width: 100%;\n}\n.card-header[data-v-2d557b14] {\n background-color: var(--theme--primary-light);\n padding: 0;\n font-size: 18px;\n font-weight: bold;\n color: var(--white);\n width: 100%;\n}\n.card-body[data-v-2d557b14] {\n padding: 16px;\n font-size: 14px;\n color: var(--theme--foreground);\n}\n.card-body p[data-v-2d557b14] {\n margin: 0;\n}\n",{});const O={class:"container"},M={key:0,class:"loading-state"},P={class:"empty-state"},V={class:"card-container"},Y=["onClick"],H={class:"card-header"};var B=z(D,[["render",function(e,n,t,a,r,g){const f=o("NavMenu"),v=o("v-icon"),x=o("router-view"),w=o("private-view");return s(),h(w,{title:e.page_title},{navigation:m(()=>[u(f,{items:e.items},null,8,["items"])]),default:m(()=>[l("div",O,[b(" Loading state "),e.loading?(s(),i("div",M,[...n[0]||(n[0]=[l("p",null,"Carregando...",-1)])])):0===e.items.length?(s(),i(d,{key:1},[b(" Mensagem quando não há itens (após carregar) "),l("div",P,[u(v,{name:"inbox",large:""}),n[1]||(n[1]=l("h2",null,"Nenhum item cadastrado",-1)),n[2]||(n[2]=l("p",null,"Crie um novo item na coleção inframe para começar.",-1))])],2112)):e.currentItemId?(s(),i(d,{key:3},[b(" O router-view vai renderizar o conteúdo quando há um item selecionado "),u(x)],2112)):(s(),i(d,{key:2},[b(" Lista de cards quando está na página inicial (sem ID na rota) "),l("div",V,[(s(!0),i(d,null,c(e.items,n=>(s(),i("div",{key:n.id,class:"card",onClick:t=>e.navigateToItem(n.id)},[l("div",{class:"card-link",style:y(n.thumbnail?`background-image: url(http://localhost:8055/assets/${n.thumbnail})`:"")},[l("div",H,[l("h3",null,p(e.getTitle(n.translations)),1)])],4)],8,Y))),128))])],2112))])]),_:1},8,["title"])}],["__scopeId","data-v-2d557b14"]]);var W=r({name:"ItemDetail",components:{NavMenu:j},props:{item:{type:Object,required:!0},items:{type:Array,required:!0},loading:{type:Boolean,default:!1},title:{type:String,default:""}},setup(t){const r=[{name:"Home",to:"/inframe"}],o=a(""),i=a(!1),s=a(null),{processUrl:l}=(()=>{const t=e(),r=a(null),o=a(""),i=a(!1),s=a(null),l=async()=>{try{const e=await t.get("/users/me",{params:{fields:["id","email","first_name","last_name","role","language"]}}),n=e.data?.data||e.data;return r.value={id:n.id||"",email:n.email||"",first_name:n.first_name||"",last_name:n.last_name||"",role:n.role||"",language:n.language||"en-US"},r.value}catch(e){return s.value=`Failed to fetch user data: ${e.message}`,console.error("[inFrame Security]",s.value),null}},d=()=>{try{const{useUserStore:e}=n(),t=e();if(t&&t.currentUser)return o.value=t.accessToken||"",o.value;const a=localStorage.getItem("directus_token")||"";return o.value=a,a}catch(e){return console.error("[inFrame Security] Failed to get access token:",e.message),""}},c=e=>{const n={isValid:!0,errors:[],warnings:[]};if(e.includes("$token")||e.includes("$refresh_token")){if(!e.match(/\$token/)&&!e.match(/\$refresh_token/))return n;const t=e.split("?"),a=t.length>0?t[0]:e;a&&!a.startsWith("https://")&&(n.isValid=!1,n.errors.push("🔒 SECURITY ERROR: $token variable can only be used with HTTPS URLs. HTTP is not allowed.")),n.warnings.push("⚠️ WARNING: You are using $token in the URL. The token will be exposed in server logs, browser history, and referrer headers."),n.warnings.push("⚠️ Only use this with fully trusted external sites. Consider using a backend proxy for better security.")}return n},u=(e,n,t)=>{if(!e)return"";let a=e;t&&e.includes("$token")&&(a=a.replace(/\$token/g,encodeURIComponent(t))),n&&(a=a.replace(/\$user_id/g,encodeURIComponent(n.id)).replace(/\$user_email/g,encodeURIComponent(n.email)).replace(/\$user_first_name/g,encodeURIComponent(n.first_name)).replace(/\$user_last_name/g,encodeURIComponent(n.last_name)).replace(/\$user_name/g,encodeURIComponent(`${n.first_name} ${n.last_name}`)).replace(/\$user_role/g,encodeURIComponent(n.role)).replace(/\$locale/g,encodeURIComponent(n.language)));const r=(new Date).toISOString();return a=a.replace(/\$timestamp/g,encodeURIComponent(r)),a};return{processUrl:async e=>{if(!e)return"";i.value=!0,s.value=null;try{const n=c(e);if(n.warnings.length>0&&n.warnings.forEach(e=>{console.warn("[inFrame Security]",e)}),!n.isValid)throw n.errors.forEach(e=>{console.error("[inFrame Security]",e)}),s.value=n.errors.join("\n"),new Error(n.errors.join("\n"));if(!e.match(/\$\w+/))return e;const t=await l();t||console.warn("[inFrame] Failed to fetch user data, some variables may not be replaced");const a=e.includes("$token")?d():"",r=u(e,t,a);return e.includes("$token")?console.info("[inFrame] URL processed with token variable (not logging full URL for security)"):console.info("[inFrame] URL processed:",r),r}catch(e){throw s.value=e.message,console.error("[inFrame] Error processing URL:",e),e}finally{i.value=!1}},getUserData:l,getAccessToken:d,validateUrlSecurity:c,replaceVariables:u,userData:r,accessToken:o,loading:i,error:s}})(),d=async e=>{if(e){i.value=!0,s.value=null;try{const n=(e=>e?e.match(/^https?:\/\//i)?e:`https://${e}`:"")(e),t=await l(n);o.value=t}catch(e){s.value=e.message||"Erro ao processar URL",o.value=""}finally{i.value=!1}}else o.value=""};return v(()=>{t.item?.url&&d(t.item.url)}),g(()=>t.item?.url,e=>{e&&d(e)}),{...t,breadcrumb:r,processedUrl:o,urlProcessing:i,urlError:s}}});C("\n.header-bar[data-v-f3075c8b] {\n display: none !important;\n}\n[data-v-f3075c8b] .header-bar {\n display: none !important;\n}\n.container[data-v-f3075c8b] {\n margin: 20px 50px;\n}\nh2[data-v-f3075c8b] {\n color: var(--theme--foreground-accent);\n margin-bottom: 10px;\n}\np[data-v-f3075c8b] {\n font-size: 16px;\n line-height: 1.5;\n color: var(--theme--foreground-accent);\n}\n.main[data-v-f3075c8b] {\n position: relative;\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n}\n.iframe-area[data-v-f3075c8b] {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n overflow: hidden !important;\n}\niframe[data-v-f3075c8b] {\n width: 100%;\n height: 100%;\n border: none;\n}\n.error-state[data-v-f3075c8b] {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 400px;\n color: var(--theme--danger);\n text-align: center;\n gap: 1rem;\n padding: 2rem;\n}\n.error-state h2[data-v-f3075c8b] {\n margin: 0;\n font-size: 1.5rem;\n font-weight: 600;\n}\n.error-state p[data-v-f3075c8b] {\n margin: 0;\n font-size: 1rem;\n max-width: 600px;\n}\n.error-state .help-text[data-v-f3075c8b] {\n color: var(--theme--foreground-subdued);\n font-size: 0.875rem;\n}\n",{});const G={class:"main"},J={key:0},K={key:1,class:"error-state"},Q={style:{"white-space":"pre-line"}},X={key:2},Z={key:3},ee={class:"iframe-area"},ne=["src"],te={key:4};var ae=r({name:"ItemDetailRoute",components:{ItemDetail:z(W,[["render",function(e,n,t,a,r,d){const c=o("v-breadcrumb"),g=o("NavMenu"),f=o("v-icon"),v=o("private-view");return s(),h(v,{title:e.title},x({navigation:m(()=>[u(g,{items:e.items},null,8,["items"])]),default:m(()=>[l("div",G,[e.loading||e.urlProcessing?(s(),i("div",J,[...n[0]||(n[0]=[l("p",null,"Carregando...",-1)])])):e.urlError?(s(),i("div",K,[u(f,{name:"error",large:""}),n[1]||(n[1]=l("h2",null,"Erro de Segurança",-1)),l("p",Q,p(e.urlError),1),n[2]||(n[2]=l("p",{class:"help-text"}," Para usar variáveis como $token, a URL deve começar com https:// para garantir a segurança dos dados. ",-1))])):e.item?e.item?(s(),i("div",Z,[l("div",ee,[l("iframe",{src:e.processedUrl,frameborder:"0",sandbox:"allow-scripts allow-same-origin allow-forms allow-popups allow-popups-to-escape-sandbox",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowfullscreen:""},null,8,ne)])])):(s(),i("div",te,[...n[4]||(n[4]=[l("p",null,"Erro ao carregar dados. Tente novamente mais tarde.",-1)])])):(s(),i("div",X,[...n[3]||(n[3]=[l("p",null,"Nenhum item encontrado. Verifique se o item existe e está publicado.",-1)])]))])]),_:2},[e.breadcrumb.length>0?{name:"headline",fn:m(()=>[u(c,{items:e.breadcrumb},null,8,["items"])]),key:"0"}:void 0]),1032,["title"])}],["__scopeId","data-v-f3075c8b"]])},setup(){const e=k(),{items:n,fetchItems:t,getTitle:a}=R(),{item:r,loading:o,fetchItem:i}=$(),{saveCurrentRoute:s,startAutoSave:l}=N();return v(async()=>{await t();const n=e.params.id;n&&(await i(n),s(n)),l()}),g(()=>e.params.id,async e=>{e&&(await i(e),s(e))}),{item:r,items:n,loading:o,getTitle:a}}});const re={key:1,class:"loading-state"},oe={key:2,class:"error-state"};const ie=[],se=[],le=[],de=[t({id:"inframe",name:"Extra",icon:"tv_signin",routes:[{path:"",props:!0,component:B},{path:":id",component:z(ae,[["render",function(e,n,t,a,r,d){const c=o("ItemDetail");return e.item?(s(),h(c,{key:0,item:e.item,items:e.items,loading:e.loading,title:e.getTitle(e.item?.translations||[])},null,8,["item","items","loading","title"])):e.loading?(s(),i("div",re,[...n[0]||(n[0]=[l("p",null,"Carregando item...",-1)])])):(s(),i("div",oe,[...n[1]||(n[1]=[l("p",null,"Item não encontrado ou erro ao carregar.",-1)])]))}]]),props:!0}]})],ce=[],ue=[],me=[];export{se as displays,ie as interfaces,le as layouts,de as modules,me as operations,ce as panels,ue as themes};
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useApi as e,defineModule as t}from"@directus/extensions-sdk";import{ref as n,defineComponent as a,resolveComponent as r,createElementBlock as i,openBlock as o,createElementVNode as s,Fragment as l,renderList as d,createVNode as c,withCtx as m,toDisplayString as u,watch as p,onMounted as f,createBlock as g,createCommentVNode as v,createSlots as h}from"vue";import{useRouter as b,useRoute as y}from"vue-router";const x=async e=>(await e.get("/users/me")).data.data.language||"en-US",w=e=>e&&0!==e.length&&e[0]&&e[0].title?e[0].title:"Item inFrame",k=()=>{const t=n([]),a=n(!1),r=e();return{items:t,loading:a,fetchItems:async()=>{a.value=!0;try{const e=await x(r),n=await r.get("/items/inframe",{params:{fields:["id","sort","status","icon","url","thumbnail","translations.languages_code","translations.title"],deep:{translations:{_filter:{languages_code:{_eq:e}}}},filter:{status:{_eq:"published"}},sort:["sort"]}});t.value=n.data}finally{a.value=!1}},getTitle:w}},_=()=>{const t=n(null),a=n(!1),r=e();return{item:t,loading:a,fetchItem:async e=>{if(e){a.value=!0;try{const n=await x(r),a=await r.get(`/items/inframe/${e}`,{params:{fields:["id","status","sort","icon","url","thumbnail","translations.languages_code","translations.title"],deep:{translations:{_filter:{languages_code:{_eq:n}}}},filter:{status:{_eq:"published"}}}});t.value=a.data}finally{a.value=!1}}},getTitle:w}};var I=a({name:"NavMenu",props:{items:{type:Array,required:!0}},setup(){const{getTitle:e}=k();return{getTitle:e}}}),T=[],q=[];function R(e,t){if(e&&"undefined"!=typeof document){var n,a=!0===t.prepend?"prepend":"append",r=!0===t.singleTag,i="string"==typeof t.container?document.querySelector(t.container):document.getElementsByTagName("head")[0];if(r){var o=T.indexOf(i);-1===o&&(o=T.push(i)-1,q[o]={}),n=q[o]&&q[o][a]?q[o][a]:q[o][a]=s()}else n=s();65279===e.charCodeAt(0)&&(e=e.substring(1)),n.styleSheet?n.styleSheet.cssText+=e:n.appendChild(document.createTextNode(e))}function s(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),t.attributes)for(var n=Object.keys(t.attributes),r=0;r<n.length;r++)e.setAttribute(n[r],t.attributes[n[r]]);var o="prepend"===a?"afterbegin":"beforeend";return i.insertAdjacentElement(o,e),e}}R("\n.nav-menu[data-v-33faf0a5] {\n margin-top: 20px;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n}\n.menu-list[data-v-33faf0a5] {\n list-style: none;\n padding: 0;\n margin: 0;\n}\n.menu-item[data-v-33faf0a5] {\n margin-bottom: 8px;\n}\n.menu-link[data-v-33faf0a5] {\n display: flex;\n align-items: center;\n text-decoration: none;\n color: var(--theme--foreground-accent);\n font-size: 16px;\n padding: 12px 20px;\n transition:\n background-color 0.3s ease,\n color 0.3s ease;\n}\n.menu-link[data-v-33faf0a5]:hover {\n background-color: var(--theme--primary-light);\n color: var(--theme--primary);\n}\n.menu-link.active-link[data-v-33faf0a5] {\n background-color: var(--theme--primary);\n color: var(--white);\n font-weight: bold;\n}\n.menu-icon[data-v-33faf0a5] {\n margin-right: 10px;\n font-size: 20px;\n}\n.menu-link span[data-v-33faf0a5] {\n font-weight: 500;\n}\n",{});var S=(e,t)=>{const n=e.__vccOpts||e;for(const[e,a]of t)n[e]=a;return n};const A={class:"nav-menu"},z={class:"menu-list"},N={class:"menu-link-text"};var j=S(I,[["render",function(e,t,n,a,p,f){const g=r("v-icon"),v=r("router-link");return o(),i("nav",A,[s("ul",z,[(o(!0),i(l,null,d(e.items,t=>(o(),i("li",{key:t.id,class:"menu-item"},[c(v,{to:`/inframe/${t.id}`,class:"menu-link","active-class":"active-link"},{default:m(()=>[c(g,{class:"menu-icon",name:t.icon},null,8,["name"]),s("span",N,u(e.getTitle(t.translations)),1)]),_:2},1032,["to"])]))),128))])])}],["__scopeId","data-v-33faf0a5"]]);const C="directus_inframe_last_route",O="lastRoute",M=()=>{const e=b(),t=y(),a=n(!1),r=n=>{const a=n||t.params.id;if(a)try{localStorage.setItem(C,a);const n={...t.query};n[O]=a,e.replace({path:t.path,query:n}).catch(()=>{})}catch
|
|
1
|
+
import{useApi as e,defineModule as t}from"@directus/extensions-sdk";import{ref as n,defineComponent as a,resolveComponent as r,createElementBlock as i,openBlock as o,createElementVNode as s,Fragment as l,renderList as d,createVNode as c,withCtx as m,toDisplayString as u,watch as p,onMounted as f,createBlock as g,createCommentVNode as v,createSlots as h}from"vue";import{useRouter as b,useRoute as y}from"vue-router";const x=async e=>(await e.get("/users/me")).data.data.language||"en-US",w=e=>e&&0!==e.length&&e[0]&&e[0].title?e[0].title:"Item inFrame",k=()=>{const t=n([]),a=n(!1),r=e();return{items:t,loading:a,fetchItems:async()=>{a.value=!0;try{const e=await x(r),n=await r.get("/items/inframe",{params:{fields:["id","sort","status","icon","url","thumbnail","translations.languages_code","translations.title"],deep:{translations:{_filter:{languages_code:{_eq:e}}}},filter:{status:{_eq:"published"}},sort:["sort"]}});t.value=n.data}finally{a.value=!1}},getTitle:w}},_=()=>{const t=n(null),a=n(!1),r=e();return{item:t,loading:a,fetchItem:async e=>{if(e){a.value=!0;try{const n=await x(r),a=await r.get(`/items/inframe/${e}`,{params:{fields:["id","status","sort","icon","url","thumbnail","translations.languages_code","translations.title"],deep:{translations:{_filter:{languages_code:{_eq:n}}}},filter:{status:{_eq:"published"}}}});t.value=a.data}finally{a.value=!1}}},getTitle:w}};var I=a({name:"NavMenu",props:{items:{type:Array,required:!0}},setup(){const{getTitle:e}=k();return{getTitle:e}}}),T=[],q=[];function R(e,t){if(e&&"undefined"!=typeof document){var n,a=!0===t.prepend?"prepend":"append",r=!0===t.singleTag,i="string"==typeof t.container?document.querySelector(t.container):document.getElementsByTagName("head")[0];if(r){var o=T.indexOf(i);-1===o&&(o=T.push(i)-1,q[o]={}),n=q[o]&&q[o][a]?q[o][a]:q[o][a]=s()}else n=s();65279===e.charCodeAt(0)&&(e=e.substring(1)),n.styleSheet?n.styleSheet.cssText+=e:n.appendChild(document.createTextNode(e))}function s(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),t.attributes)for(var n=Object.keys(t.attributes),r=0;r<n.length;r++)e.setAttribute(n[r],t.attributes[n[r]]);var o="prepend"===a?"afterbegin":"beforeend";return i.insertAdjacentElement(o,e),e}}R("\n.nav-menu[data-v-33faf0a5] {\n margin-top: 20px;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n}\n.menu-list[data-v-33faf0a5] {\n list-style: none;\n padding: 0;\n margin: 0;\n}\n.menu-item[data-v-33faf0a5] {\n margin-bottom: 8px;\n}\n.menu-link[data-v-33faf0a5] {\n display: flex;\n align-items: center;\n text-decoration: none;\n color: var(--theme--foreground-accent);\n font-size: 16px;\n padding: 12px 20px;\n transition:\n background-color 0.3s ease,\n color 0.3s ease;\n}\n.menu-link[data-v-33faf0a5]:hover {\n background-color: var(--theme--primary-light);\n color: var(--theme--primary);\n}\n.menu-link.active-link[data-v-33faf0a5] {\n background-color: var(--theme--primary);\n color: var(--white);\n font-weight: bold;\n}\n.menu-icon[data-v-33faf0a5] {\n margin-right: 10px;\n font-size: 20px;\n}\n.menu-link span[data-v-33faf0a5] {\n font-weight: 500;\n}\n",{});var S=(e,t)=>{const n=e.__vccOpts||e;for(const[e,a]of t)n[e]=a;return n};const A={class:"nav-menu"},z={class:"menu-list"},N={class:"menu-link-text"};var j=S(I,[["render",function(e,t,n,a,p,f){const g=r("v-icon"),v=r("router-link");return o(),i("nav",A,[s("ul",z,[(o(!0),i(l,null,d(e.items,t=>(o(),i("li",{key:t.id,class:"menu-item"},[c(v,{to:`/inframe/${t.id}`,class:"menu-link","active-class":"active-link"},{default:m(()=>[c(g,{class:"menu-icon",name:t.icon},null,8,["name"]),s("span",N,u(e.getTitle(t.translations)),1)]),_:2},1032,["to"])]))),128))])])}],["__scopeId","data-v-33faf0a5"]]);const C="directus_inframe_last_route",O="lastRoute",M=()=>{const e=b(),t=y(),a=n(!1),r=n=>{const a=n||t.params.id;if(a)try{localStorage.setItem(C,a);const n={...t.query};n[O]=a,e.replace({path:t.path,query:n}).catch(()=>{})}catch{}},i=()=>{try{const e=t.query[O];if(e)return e;const n=localStorage.getItem(C);if(n)return n}catch{}return null};return{saveCurrentRoute:r,getLastRoute:i,restoreLastRoute:async()=>{const t=i();if(!t)return!1;try{return a.value=!0,await e.push(`/inframe/${t}`),!0}catch{return!1}finally{a.value=!1}},clearSavedRoute:()=>{try{localStorage.removeItem(C);const n={...t.query};delete n[O],e.replace({path:t.path,query:n}).catch(()=>{})}catch{}},startAutoSave:()=>{p(()=>t.params.id,e=>{!a.value&&e&&r(e)},{immediate:!1})},isRestoringRoute:a}};var D=a({name:"InframeList",components:{NavMenu:j},setup(){const{items:e,fetchItems:t,getTitle:n}=k(),a=b(),{restoreLastRoute:r,startAutoSave:i}=M();return f(async()=>{await t(),i();if(!await r()&&e.value&&e.value.length>0){const t=e.value[0];t&&a.push(`/inframe/${t.id}`)}}),{items:e,page_title:"Organograma",getTitle:n}}});R("\n.container[data-v-b493d20e] {\n display: flex;\n flex-wrap: wrap;\n gap: 20px;\n padding: 20px 50px;\n}\n.card-container[data-v-b493d20e] {\n display: flex;\n flex-wrap: wrap;\n gap: 20px;\n width: 100%;\n}\n.card[data-v-b493d20e] {\n background-color: #ffffff;\n border-radius: 8px;\n box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);\n flex: 1 1 25%;\n height: 200px;\n display: flex;\n flex-direction: column; /* Para garantir que o conteúdo não sobreponha a imagem */\n justify-content: flex-end; /* Ajusta o conteúdo para o fundo */\n align-items: center;\n text-align: center;\n overflow: hidden;\n transition:\n transform 0.3s ease,\n box-shadow 0.3s ease;\n}\n.card[data-v-b493d20e]:hover {\n transform: translateY(-10px);\n box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);\n}\n.card-link[data-v-b493d20e] {\n display: flex;\n flex-direction: column;\n justify-content: flex-end; /* Coloca o conteúdo no fundo do link */\n align-items: center;\n height: 100%;\n text-decoration: none; /* Remove o estilo de link */\n background-size: cover;\n background-position: center;\n background-repeat: no-repeat;\n padding: 0;\n width: 100%;\n}\n.card-header h3[data-v-b493d20e] {\n margin: 0; /* Remove a margem para melhor controle de espaçamento */\n padding: 10px;\n background: var(--theme--primary);\n width: 100%;\n}\n.card-header[data-v-b493d20e] {\n background-color: var(--theme--primary-light);\n padding: 0;\n font-size: 18px;\n font-weight: bold;\n color: var(--white);\n width: 100%;\n}\n.card-body[data-v-b493d20e] {\n padding: 16px;\n font-size: 14px;\n color: var(--theme--foreground);\n}\n.card-body p[data-v-b493d20e] {\n margin: 0;\n}\n",{});const E={class:"container"};var L=S(D,[["render",function(e,t,n,a,i,l){const d=r("NavMenu"),u=r("router-view"),p=r("private-view");return o(),g(p,{title:e.page_title},{navigation:m(()=>[c(d,{items:e.items},null,8,["items"])]),default:m(()=>[s("div",E,[v(" O router-view vai renderizar o conteúdo do primeiro item automaticamente "),c(u)])]),_:1},8,["title"])}],["__scopeId","data-v-b493d20e"]]),$=a({name:"ItemDetail",components:{NavMenu:j},props:{item:{type:Object,required:!0},items:{type:Array,required:!0},loading:{type:Boolean,default:!1},title:{type:String,default:""}},setup:e=>({...e,breadcrumb:[{name:"Home",to:"/inframe"}]})});R("\n.header-bar[data-v-978ef17c] {\n display: none !important;\n}\n[data-v-978ef17c] .header-bar {\n display: none !important;\n}\n.container[data-v-978ef17c] {\n margin: 20px 50px;\n}\nh2[data-v-978ef17c] {\n color: var(--theme--foreground-accent);\n margin-bottom: 10px;\n}\np[data-v-978ef17c] {\n font-size: 16px;\n line-height: 1.5;\n color: var(--theme--foreground-accent);\n}\n.main[data-v-978ef17c] {\n position: relative;\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n}\n.iframe-area[data-v-978ef17c] {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n overflow: hidden !important;\n}\niframe[data-v-978ef17c] {\n width: 100%;\n height: 100%;\n border: none;\n}\n",{});const B={class:"main"},F={key:0},H={key:1},P={class:"iframe-area"},U=["src"],Y={key:2};var G=a({name:"ItemDetailRoute",components:{ItemDetail:S($,[["render",function(e,t,n,a,l,d){const u=r("v-breadcrumb"),p=r("NavMenu"),f=r("private-view");return e.item?(o(),g(f,{key:0,title:e.title},h({navigation:m(()=>[c(p,{items:e.items},null,8,["items"])]),default:m(()=>[s("div",B,[e.loading?(o(),i("div",F,[...t[0]||(t[0]=[s("p",null,"Carregando...",-1)])])):e.item?(o(),i("div",H,[s("div",P,[s("iframe",{src:e.item.url,frameborder:"0",sandbox:"allow-scripts allow-same-origin"},null,8,U)])])):(o(),i("div",Y,[...t[1]||(t[1]=[s("p",null,"Erro ao carregar dados. Tente novamente mais tarde.",-1)])]))])]),_:2},[e.breadcrumb.length>0?{name:"headline",fn:m(()=>[c(u,{items:e.breadcrumb},null,8,["items"])]),key:"0"}:void 0]),1032,["title"])):v("v-if",!0)}],["__scopeId","data-v-978ef17c"]])},setup(){const e=y(),{items:t,fetchItems:n,getTitle:a}=k(),{item:r,loading:i,fetchItem:o}=_(),{saveCurrentRoute:s,startAutoSave:l}=M();return f(async()=>{await n();const t=e.params.id;t&&(await o(t),s(t)),l()}),p(()=>e.params.id,async e=>{e&&(await o(e),s(e))}),{item:r,items:t,loading:i,getTitle:a}}});var J=t({id:"inframe",name:"Relatórios",icon:"document_scanner",routes:[{path:"",props:!0,component:L},{path:":id",component:S(G,[["render",function(e,t,n,a,i,s){const l=r("ItemDetail");return o(),g(l,{item:e.item,items:e.items,loading:e.loading,title:e.getTitle(e.item?.translations||[])},null,8,["item","items","loading","title"])}]]),props:!0}]});export{J as default};
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "directus-extension-inframe",
|
|
3
|
+
"type": "module",
|
|
3
4
|
"description": "Display dashboards, reports and external sites in iframes, directly in your Directus panel. Install, configure and centralize everything in one place!",
|
|
4
5
|
"icon": "web_asset",
|
|
5
|
-
"type": "module",
|
|
6
6
|
"private": false,
|
|
7
|
-
"version": "2.0
|
|
7
|
+
"version": "2.1.0",
|
|
8
8
|
"keywords": [
|
|
9
9
|
"directus",
|
|
10
10
|
"directus-extension",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"source": "src/hooks/inframe-setup/index.ts"
|
|
39
39
|
}
|
|
40
40
|
],
|
|
41
|
-
"host": "^10.
|
|
41
|
+
"host": "^10.8.3"
|
|
42
42
|
},
|
|
43
43
|
"publishConfig": {
|
|
44
44
|
"registry": "https://registry.npmjs.org/",
|
|
@@ -48,37 +48,60 @@
|
|
|
48
48
|
"type": "git",
|
|
49
49
|
"url": "git+https://github.com/devix-tecnologia/directus-extension-inframe.git"
|
|
50
50
|
},
|
|
51
|
+
"scripts": {
|
|
52
|
+
"build": "directus-extension build",
|
|
53
|
+
"dev": "directus-extension build -w --no-minify",
|
|
54
|
+
"link": "directus-extension link",
|
|
55
|
+
"validate": "directus-extension validate",
|
|
56
|
+
"lint": "eslint . --ext .ts,.vue",
|
|
57
|
+
"lint:fix": "eslint . --ext .ts,.vue --fix",
|
|
58
|
+
"format": "prettier --write .",
|
|
59
|
+
"format:check": "prettier --check .",
|
|
60
|
+
"typecheck": "tsc --noEmit",
|
|
61
|
+
"test": "pnpm test:e2e",
|
|
62
|
+
"test:integration": "vitest run tests/*.spec.ts",
|
|
63
|
+
"test:watch": "vitest",
|
|
64
|
+
"test:coverage": "vitest run --coverage",
|
|
65
|
+
"test:e2e": "VERBOSE=true node tests/run-e2e.js",
|
|
66
|
+
"test:e2e:ui": "VERBOSE=true node tests/run-e2e.js --ui",
|
|
67
|
+
"test:e2e:debug": "playwright test --debug",
|
|
68
|
+
"test:e2e:headed": "playwright test --headed",
|
|
69
|
+
"test:e2e:report": "playwright show-report",
|
|
70
|
+
"semantic-release": "semantic-release"
|
|
71
|
+
},
|
|
51
72
|
"devDependencies": {
|
|
52
|
-
"@directus/extensions-sdk": "^17.0.
|
|
53
|
-
"@eslint/js": "9.39.
|
|
54
|
-
"@playwright/test": "^1.
|
|
73
|
+
"@directus/extensions-sdk": "^17.0.4",
|
|
74
|
+
"@eslint/js": "9.39.2",
|
|
75
|
+
"@playwright/test": "^1.57.0",
|
|
55
76
|
"@semantic-release/git": "^10.0.1",
|
|
56
77
|
"@semantic-release/github": "^12.0.2",
|
|
57
|
-
"@semantic-release/npm": "^13.1.
|
|
58
|
-
"@types/node": "^
|
|
78
|
+
"@semantic-release/npm": "^13.1.3",
|
|
79
|
+
"@types/node": "^25.0.3",
|
|
59
80
|
"axios": "^1.13.2",
|
|
60
81
|
"dotenv": "^17.2.3",
|
|
61
|
-
"eslint": "9.39.
|
|
82
|
+
"eslint": "9.39.2",
|
|
62
83
|
"eslint-config-prettier": "10.1.8",
|
|
63
84
|
"eslint-plugin-vue": "10.6.2",
|
|
64
85
|
"globals": "^16.5.0",
|
|
65
|
-
"playwright": "^1.
|
|
66
|
-
"prettier": "3.7.
|
|
67
|
-
"rollup": "^4.
|
|
86
|
+
"playwright": "^1.57.0",
|
|
87
|
+
"prettier": "3.7.4",
|
|
88
|
+
"rollup": "^4.54.0",
|
|
68
89
|
"semantic-release": "^25.0.2",
|
|
90
|
+
"taskin": "^2.3.1",
|
|
69
91
|
"typescript": "^5.9.3",
|
|
70
|
-
"typescript-eslint": "8.
|
|
71
|
-
"vite": "^7.
|
|
72
|
-
"vitest": "^4.0.
|
|
73
|
-
"vue": "^3.5.
|
|
92
|
+
"typescript-eslint": "8.50.0",
|
|
93
|
+
"vite": "^7.3.0",
|
|
94
|
+
"vitest": "^4.0.16",
|
|
95
|
+
"vue": "^3.5.26",
|
|
74
96
|
"vue-eslint-parser": "^10.2.0"
|
|
75
97
|
},
|
|
76
98
|
"dependencies": {
|
|
77
99
|
"vue-router": "^4.6.3"
|
|
78
100
|
},
|
|
101
|
+
"packageManager": "pnpm@10.28.2",
|
|
79
102
|
"engines": {
|
|
80
103
|
"node": "22",
|
|
81
|
-
"pnpm": "10.
|
|
104
|
+
"pnpm": "10.28.2"
|
|
82
105
|
},
|
|
83
106
|
"author": "Devix Tecnologia",
|
|
84
107
|
"contributors": [
|
|
@@ -97,25 +120,5 @@
|
|
|
97
120
|
"bugs": {
|
|
98
121
|
"url": "https://github.com/devix-tecnologia/directus-extension-inframe/issues"
|
|
99
122
|
},
|
|
100
|
-
"homepage": "https://github.com/devix-tecnologia/directus-extension-inframe#readme"
|
|
101
|
-
|
|
102
|
-
"build": "directus-extension build",
|
|
103
|
-
"dev": "directus-extension build -w --no-minify",
|
|
104
|
-
"link": "directus-extension link",
|
|
105
|
-
"validate": "directus-extension validate",
|
|
106
|
-
"lint": "eslint . --ext .ts,.vue",
|
|
107
|
-
"lint:fix": "eslint . --ext .ts,.vue --fix",
|
|
108
|
-
"format": "prettier --write .",
|
|
109
|
-
"format:check": "prettier --check .",
|
|
110
|
-
"test": "pnpm test:e2e",
|
|
111
|
-
"test:integration": "vitest run tests/*.spec.ts",
|
|
112
|
-
"test:watch": "vitest",
|
|
113
|
-
"test:coverage": "vitest run --coverage",
|
|
114
|
-
"test:e2e": "playwright test",
|
|
115
|
-
"test:e2e:ui": "playwright test --ui",
|
|
116
|
-
"test:e2e:debug": "playwright test --debug",
|
|
117
|
-
"test:e2e:headed": "playwright test --headed",
|
|
118
|
-
"test:e2e:report": "playwright show-report",
|
|
119
|
-
"semantic-release": "semantic-release"
|
|
120
|
-
}
|
|
121
|
-
}
|
|
123
|
+
"homepage": "https://github.com/devix-tecnologia/directus-extension-inframe#readme"
|
|
124
|
+
}
|