REDROOM
PHP 8.2.31
Path:
Logout
Edit File
Size: 1.53 KB
Close
/home/nshryvcy/radiantskinclinics.org/wp-content/plugins/extendify_old/src/Shared/state/ai-consent.js
Text
Base64
import apiFetch from '@wordpress/api-fetch'; import { __, sprintf } from '@wordpress/i18n'; import { create } from 'zustand'; import { devtools, persist } from 'zustand/middleware'; const storage = { setItem: (_name, store) => apiFetch({ path: '/extendify/v1/shared/update-user-meta', method: 'POST', data: { option: 'ai_consent', value: store.state.userGaveConsent }, }), }; const defaultConsentTerms = sprintf( // translators: %1$s and %2$s are opening and closing anchor tags. __( 'By using AI features, you agree with the %1$sTerms of Use and Privacy Policy%2$s.', 'extendify-local', ), '<a href="https://hosting-ai-terms.com/" target="_blank">', '</a>', ); const state = (set, get) => ({ showAIConsent: window.extSharedData?.showAIConsent ?? false, consentTerms: window.extSharedData?.consentTermsCustom || defaultConsentTerms, userGaveConsent: window.extSharedData?.userGaveConsent ?? false, setUserGaveConsent: (userGaveConsent) => set({ userGaveConsent }), // Context refers to the feature where the function is being used. shouldShowAIConsent: (context) => { const { showAIConsent, consentTerms, userGaveConsent } = get(); const enabled = showAIConsent && consentTerms; const display = { launch: enabled, draft: enabled && !userGaveConsent, 'help-center': enabled && !userGaveConsent, }; return display?.[context] ?? false; }, }); export const useAIConsentStore = create( persist(devtools(state, { name: 'Extendify AI Consent' }), { name: 'extendify-ai-consent', storage, skipHydration: true, }), );
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 1 × Files: 5
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
__tests__
DIR
-
drwxr-xr-x
2026-04-28 02:40:02
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
activity.js
1.22 KB
lrw-r--r--
2026-02-19 03:27:14
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ai-consent.js
1.53 KB
lrw-r--r--
2025-12-17 19:09:10
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
generate-images.js
1.88 KB
lrw-r--r--
2026-02-19 03:27:14
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
site-profile.js
914 B
lrw-r--r--
2026-02-27 04:48:52
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
unsplash-cache.js
661 B
lrw-r--r--
2026-02-19 03:27:14
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).