@once-ui-system/core 1.6.1 → 1.6.2

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.
@@ -15088,14 +15088,6 @@
15088
15088
  ],
15089
15089
  "tags": []
15090
15090
  },
15091
- {
15092
- "char": "🇱🇰",
15093
- "description": "flag: Sri Lanka",
15094
- "aliases": [
15095
- "sri_lanka"
15096
- ],
15097
- "tags": []
15098
- },
15099
15091
  {
15100
15092
  "char": "🇱🇷",
15101
15093
  "description": "flag: Liberia",
package/dist/index.d.ts CHANGED
@@ -6,4 +6,5 @@ export * from "./types";
6
6
  export * from "./interfaces";
7
7
  export * from "./utils";
8
8
  export * from "./hooks";
9
+ export * from "./server";
9
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC"}
package/dist/index.js CHANGED
@@ -6,4 +6,5 @@ export * from "./types";
6
6
  export * from "./interfaces";
7
7
  export * from "./utils";
8
8
  export * from "./hooks";
9
+ export * from "./server";
9
10
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC"}
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@once-ui-system/core",
3
- "version": "1.6.1",
3
+ "version": "1.6.2",
4
4
  "description": "Once UI for Next.js NPM package",
5
5
  "keywords": [
6
6
  "once-ui",
@@ -65,6 +65,10 @@
65
65
  "./hooks": {
66
66
  "import": "./dist/hooks/index.js",
67
67
  "require": "./dist/hooks/index.js"
68
+ },
69
+ "./server": {
70
+ "import": "./dist/server/index.js",
71
+ "require": "./dist/server/index.js"
68
72
  }
69
73
  },
70
74
  "dependencies": {
@@ -0,0 +1,2 @@
1
+ export * from './og-utils';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './og-utils';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { NextResponse } from 'next/server';
2
+ export interface OGData {
3
+ url: string;
4
+ title: string;
5
+ description: string;
6
+ image: string;
7
+ faviconUrl?: string;
8
+ }
9
+ export interface OGFetchOptions {
10
+ timeout?: number;
11
+ userAgent?: string;
12
+ decodeEntities?: boolean;
13
+ }
14
+ export declare function handleOGFetch(request: Request, options?: OGFetchOptions): Promise<NextResponse>;
15
+ export interface OGProxyOptions {
16
+ userAgent?: string;
17
+ cacheMaxAge?: number;
18
+ }
19
+ export declare function handleOGProxy(request: Request, options?: OGProxyOptions): Promise<NextResponse>;
20
+ //# sourceMappingURL=og-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"og-utils.d.ts","sourceRoot":"","sources":["../../src/server/og-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,MAAM,WAAW,MAAM;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AA8CD,wBAAsB,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,GAAE,cAAmB,GAAG,OAAO,CAAC,YAAY,CAAC,CAkEzG;AAED,MAAM,WAAW,cAAc;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,wBAAsB,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,GAAE,cAAmB,GAAG,OAAO,CAAC,YAAY,CAAC,CAuCzG"}
@@ -0,0 +1,125 @@
1
+ import { NextResponse } from 'next/server';
2
+ function decodeHTMLEntities(text) {
3
+ return text.replace(/&(#?[a-zA-Z0-9]+);/g, (match, entity) => {
4
+ const entities = {
5
+ 'amp': '&',
6
+ 'lt': '<',
7
+ 'gt': '>',
8
+ 'quot': '"',
9
+ 'apos': "'",
10
+ '#x27': "'",
11
+ '#39': "'",
12
+ '#x26': '&',
13
+ '#38': '&'
14
+ };
15
+ if (entity.startsWith('#')) {
16
+ const code = entity.startsWith('#x') ?
17
+ parseInt(entity.slice(2), 16) :
18
+ parseInt(entity.slice(1), 10);
19
+ return String.fromCharCode(code);
20
+ }
21
+ return entities[entity] || match;
22
+ });
23
+ }
24
+ async function fetchWithTimeout(url, timeout = 5000, userAgent = 'Mozilla/5.0 (compatible; OG-Fetcher/1.0)') {
25
+ const controller = new AbortController();
26
+ const timeoutId = setTimeout(() => controller.abort(), timeout);
27
+ try {
28
+ const response = await fetch(url, {
29
+ signal: controller.signal,
30
+ headers: {
31
+ 'User-Agent': userAgent
32
+ }
33
+ });
34
+ clearTimeout(timeoutId);
35
+ return response;
36
+ }
37
+ catch (error) {
38
+ clearTimeout(timeoutId);
39
+ throw error;
40
+ }
41
+ }
42
+ export async function handleOGFetch(request, options = {}) {
43
+ const { timeout = 5000, userAgent = 'Mozilla/5.0 (compatible; OG-Fetcher/1.0)', decodeEntities = true } = options;
44
+ const { searchParams } = new URL(request.url);
45
+ const url = searchParams.get('url');
46
+ if (!url) {
47
+ return NextResponse.json({ error: 'URL parameter is required' }, { status: 400 });
48
+ }
49
+ try {
50
+ const response = await fetchWithTimeout(url, timeout, userAgent);
51
+ if (!response.ok) {
52
+ throw new Error(`HTTP ${response.status}: ${response.statusText}`);
53
+ }
54
+ const html = await response.text();
55
+ const ogData = {
56
+ url: url,
57
+ title: '',
58
+ description: '',
59
+ image: '',
60
+ };
61
+ const titleMatch = html.match(/<title[^>]*>([^<]+)<\/title>/i);
62
+ if (titleMatch) {
63
+ ogData.title = titleMatch[1].trim();
64
+ }
65
+ const ogTitleMatch = html.match(/<meta[^>]*property=["']og:title["'][^>]*content=["']([^"']+)["'][^>]*>/i);
66
+ if (ogTitleMatch) {
67
+ ogData.title = ogTitleMatch[1].trim();
68
+ }
69
+ const descMatch = html.match(/<meta[^>]*name=["']description["'][^>]*content=["']([^"']+)["'][^>]*>/i)
70
+ || html.match(/<meta[^>]*content=["']([^"']+)["'][^>]*name=["']description["'][^>]*>/i)
71
+ || html.match(/<meta[^>]*property=["']og:description["'][^>]*content=["']([^"']+)["'][^>]*>/i);
72
+ if (descMatch) {
73
+ ogData.description = descMatch[1].trim();
74
+ }
75
+ const ogImageMatch = html.match(/<meta[^>]*property=["']og:image["'][^>]*content=["']([^"']+)["'][^>]*>/i)
76
+ || html.match(/<meta[^>]*content=["']([^"']+)["'][^>]*property=["']og:image["'][^>]*>/i);
77
+ if (ogImageMatch) {
78
+ ogData.image = ogImageMatch[1].trim();
79
+ }
80
+ const faviconMatch = html.match(/<link[^>]*rel=["'](?:icon|shortcut icon)["'][^>]*href=["']([^"']+)["'][^>]*>/i);
81
+ if (faviconMatch) {
82
+ ogData.faviconUrl = faviconMatch[1].trim();
83
+ }
84
+ if (decodeEntities) {
85
+ ogData.title = decodeHTMLEntities(ogData.title);
86
+ ogData.description = decodeHTMLEntities(ogData.description);
87
+ }
88
+ return NextResponse.json(ogData);
89
+ }
90
+ catch (error) {
91
+ console.error('Error fetching OG data:', error);
92
+ return NextResponse.json({ error: 'Failed to fetch Open Graph data', message: error instanceof Error ? error.message : 'Unknown error' }, { status: 500 });
93
+ }
94
+ }
95
+ export async function handleOGProxy(request, options = {}) {
96
+ const { userAgent = 'Mozilla/5.0 (compatible; OG-Proxy/1.0)', cacheMaxAge = 3600 } = options;
97
+ const { searchParams } = new URL(request.url);
98
+ const url = searchParams.get('url');
99
+ if (!url) {
100
+ return NextResponse.json({ error: 'URL parameter is required' }, { status: 400 });
101
+ }
102
+ try {
103
+ const response = await fetch(url, {
104
+ headers: {
105
+ 'User-Agent': userAgent,
106
+ },
107
+ });
108
+ if (!response.ok) {
109
+ return NextResponse.json({ error: `Failed to fetch image: ${response.status}` }, { status: response.status });
110
+ }
111
+ const contentType = response.headers.get('content-type') || 'image/jpeg';
112
+ const buffer = await response.arrayBuffer();
113
+ return new NextResponse(buffer, {
114
+ headers: {
115
+ 'Content-Type': contentType,
116
+ 'Cache-Control': `public, max-age=${cacheMaxAge}`,
117
+ },
118
+ });
119
+ }
120
+ catch (error) {
121
+ console.error('Error proxying image:', error);
122
+ return NextResponse.json({ error: 'Failed to proxy image', message: error instanceof Error ? error.message : 'Unknown error' }, { status: 500 });
123
+ }
124
+ }
125
+ //# sourceMappingURL=og-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"og-utils.js","sourceRoot":"","sources":["../../src/server/og-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAgB3C,SAAS,kBAAkB,CAAC,IAAY;IACtC,OAAO,IAAI,CAAC,OAAO,CAAC,qBAAqB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;QAC3D,MAAM,QAAQ,GAA8B;YAC1C,KAAK,EAAE,GAAG;YACV,IAAI,EAAE,GAAG;YACT,IAAI,EAAE,GAAG;YACT,MAAM,EAAE,GAAG;YACX,MAAM,EAAE,GAAG;YACX,MAAM,EAAE,GAAG;YACX,KAAK,EAAE,GAAG;YACV,MAAM,EAAE,GAAG;YACX,KAAK,EAAE,GAAG;SACX,CAAC;QAEF,IAAI,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YAC3B,MAAM,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;gBACpC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;gBAC/B,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YAChC,OAAO,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keywords": [
6
- "once-ui",
7
- "react",
8
- "nextjs",
9
- "scss",
10
- "design system",
11
- "design framework",
12
- "nextjs design system"
13
- ],
14
- "author": "Once UI",
15
- "license": "MIT",
16
- "repository": {
17
- "type": "git",
18
- "url": "https://github.com/once-ui-system/core.git",
19
- "directory": "packages/core"
20
- },
21
- "bugs": {
22
- "url": "https://github.com/once-ui-system/core/issues"
23
- },
24
- "homepage": "https://docs.once-ui.com",
25
- "main": "dist/index.js",
26
- "exports": {
27
- ".": {
28
- "import": "./dist/index.js",
29
- "require": "./dist/index.js"
30
- },
31
- "./components": {
32
- "import": "./dist/components/index.js",
33
- "require": "./dist/components/index.js"
34
- },
35
- "./components/*": {
36
- "import": "./dist/components/*.js",
37
- "require": "./dist/components/*.js"
38
- },
39
- "./contexts": {
40
- "import": "./dist/contexts/index.js",
41
- "require": "./dist/contexts/index.js"
42
- },
43
- "./modules": {
44
- "import": "./dist/modules/index.js",
45
- "require": "./dist/modules/index.js"
46
- },
47
- "./icons": {
48
- "import": "./dist/icons/index.js",
49
- "require": "./dist/icons/index.js"
50
- },
51
- "./types": {
52
- "import": "./dist/types/index.js",
53
- "require": "./dist/types/index.js"
54
- },
55
- "./interfaces": {
56
- "import": "./dist/interfaces/index.js",
57
- "require": "./dist/interfaces/index.js"
58
- },
59
- "./css/styles.css": "./dist/css/styles.css",
60
- "./css/tokens.css": "./dist/css/tokens.css",
61
- "./utils": {
62
- "import": "./dist/utils/index.js",
63
- "require": "./dist/utils/index.js"
64
- },
65
- "./hooks": {
66
- "import": "./dist/hooks/index.js",
67
- "require": "./dist/hooks/index.js"
68
- }
69
- },
70
- "dependencies": {
71
- "@floating-ui/react-dom": "^2.1.1",
72
- "classnames": "^2.5.1",
73
- "compressorjs": "^1.2.1",
74
- "date-fns": "^4.1.0",
75
- "prismjs": "^1.30.0",
76
- "react-icons": "^5.2.1",
77
- "recharts": "^2.15.1"
78
- },
79
- "peerDependencies": {
80
- "next": ">=13.4",
81
- "react": ">=18",
82
- "react-dom": ">=18",
83
- "sass": "^1.77.6",
84
- "sharp": "^0.33.4"
85
- },
86
- "devDependencies": {
87
- "@biomejs/biome": "1.9.4",
88
- "@types/node": "20.17.23",
89
- "@types/react": "19.0.1",
90
- "@types/react-dom": "19.0.2",
91
- "rimraf": "^5.0.10",
92
- "typescript": "5.8.2"
93
- },
94
- "overrides": {
95
- "@types/react": "19.0.1",
96
- "@types/react-dom": "19.0.2"
97
- },
98
- "scripts": {
99
- "build": "pnpm clean && pnpm generate-emoji-data && tsc --project tsconfig.build.json && pnpm copy-files && pnpm build:css",
100
- "build:css": "sass src/styles/index.scss:dist/css/styles.css src/tokens/index.scss:dist/css/tokens.css --style=compressed",
101
- "copy-files": "node scripts/copy-files.js",
102
- "clean": "rimraf dist",
103
- "lint": "biome check .",
104
- "format": "biome format --write .",
105
- "typecheck": "tsc --noEmit",
106
- "dev": "tsc --watch --preserveWatchOutput",
107
- "generate-emoji-data": "node scripts/generate-emoji-data.js"
108
- }
109
- }
1
+ {
2
+ "name": "@once-ui-system/core",
3
+ "version": "1.6.2",
4
+ "description": "Once UI for Next.js NPM package",
5
+ "keywords": [
6
+ "once-ui",
7
+ "react",
8
+ "nextjs",
9
+ "scss",
10
+ "design system",
11
+ "design framework",
12
+ "nextjs design system"
13
+ ],
14
+ "author": "Once UI",
15
+ "license": "MIT",
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "https://github.com/once-ui-system/core.git",
19
+ "directory": "packages/core"
20
+ },
21
+ "bugs": {
22
+ "url": "https://github.com/once-ui-system/core/issues"
23
+ },
24
+ "homepage": "https://docs.once-ui.com",
25
+ "main": "dist/index.js",
26
+ "exports": {
27
+ ".": {
28
+ "import": "./dist/index.js",
29
+ "require": "./dist/index.js"
30
+ },
31
+ "./components": {
32
+ "import": "./dist/components/index.js",
33
+ "require": "./dist/components/index.js"
34
+ },
35
+ "./components/*": {
36
+ "import": "./dist/components/*.js",
37
+ "require": "./dist/components/*.js"
38
+ },
39
+ "./contexts": {
40
+ "import": "./dist/contexts/index.js",
41
+ "require": "./dist/contexts/index.js"
42
+ },
43
+ "./modules": {
44
+ "import": "./dist/modules/index.js",
45
+ "require": "./dist/modules/index.js"
46
+ },
47
+ "./icons": {
48
+ "import": "./dist/icons/index.js",
49
+ "require": "./dist/icons/index.js"
50
+ },
51
+ "./types": {
52
+ "import": "./dist/types/index.js",
53
+ "require": "./dist/types/index.js"
54
+ },
55
+ "./interfaces": {
56
+ "import": "./dist/interfaces/index.js",
57
+ "require": "./dist/interfaces/index.js"
58
+ },
59
+ "./css/styles.css": "./dist/css/styles.css",
60
+ "./css/tokens.css": "./dist/css/tokens.css",
61
+ "./utils": {
62
+ "import": "./dist/utils/index.js",
63
+ "require": "./dist/utils/index.js"
64
+ },
65
+ "./hooks": {
66
+ "import": "./dist/hooks/index.js",
67
+ "require": "./dist/hooks/index.js"
68
+ },
69
+ "./server": {
70
+ "import": "./dist/server/index.js",
71
+ "require": "./dist/server/index.js"
72
+ }
73
+ },
74
+ "scripts": {
75
+ "build": "pnpm clean && pnpm generate-emoji-data && tsc --project tsconfig.build.json && pnpm copy-files && pnpm build:css",
76
+ "build:css": "sass src/styles/index.scss:dist/css/styles.css src/tokens/index.scss:dist/css/tokens.css --style=compressed",
77
+ "copy-files": "node scripts/copy-files.js",
78
+ "clean": "rimraf dist",
79
+ "prepare": "pnpm build",
80
+ "lint": "biome check .",
81
+ "format": "biome format --write .",
82
+ "typecheck": "tsc --noEmit",
83
+ "dev": "tsc --watch --preserveWatchOutput",
84
+ "prepack": "pnpm build",
85
+ "generate-emoji-data": "node scripts/generate-emoji-data.js"
86
+ },
87
+ "dependencies": {
88
+ "@floating-ui/react-dom": "^2.1.1",
89
+ "classnames": "^2.5.1",
90
+ "compressorjs": "^1.2.1",
91
+ "date-fns": "^4.1.0",
92
+ "prismjs": "^1.30.0",
93
+ "react-icons": "^5.2.1",
94
+ "recharts": "^2.15.1"
95
+ },
96
+ "peerDependencies": {
97
+ "next": ">=13.4",
98
+ "react": ">=18",
99
+ "react-dom": ">=18",
100
+ "sass": "^1.77.6",
101
+ "sharp": "^0.33.4"
102
+ },
103
+ "devDependencies": {
104
+ "@biomejs/biome": "1.9.4",
105
+ "@types/node": "20.17.23",
106
+ "@types/react": "19.0.1",
107
+ "@types/react-dom": "19.0.2",
108
+ "rimraf": "^5.0.10",
109
+ "typescript": "5.8.2"
110
+ },
111
+ "overrides": {
112
+ "@types/react": "19.0.1",
113
+ "@types/react-dom": "19.0.2"
114
+ }
115
+ }
package/LICENSE.md DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2024-2025 Once UI
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
package/next-env.d.ts DELETED
@@ -1,5 +0,0 @@
1
- /// <reference types="next" />
2
- /// <reference types="next/image-types/global" />
3
-
4
- // NOTE: This file should not be edited
5
- // see https://nextjs.org/docs/app/api-reference/config/typescript for more information.