File size: 28,842 Bytes
da04281
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a3701ff
 
 
 
 
 
da04281
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a3701ff
 
da04281
 
 
a3701ff
 
da04281
 
 
a3701ff
 
da04281
 
 
 
a3701ff
 
 
 
 
 
 
 
 
 
 
 
da04281
 
a3701ff
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
da04281
 
a3701ff
 
da04281
a3701ff
 
 
 
 
 
 
 
 
 
 
 
 
 
da04281
 
a3701ff
 
da04281
a3701ff
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
da04281
 
 
 
a3701ff
 
 
 
 
da04281
a3701ff
 
 
 
 
 
 
 
 
 
 
 
da04281
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a3701ff
da04281
 
 
a3701ff
 
da04281
a3701ff
da04281
 
 
 
a3701ff
 
 
da04281
a3701ff
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
da04281
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a3701ff
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
da04281
 
 
 
 
 
a3701ff
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
da04281
 
 
 
 
 
 
a3701ff
 
 
 
 
 
 
 
 
 
 
 
da04281
 
a3701ff
da04281
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Communication Preference Management</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        .fade-in {
            animation: fadeIn 0.3s ease-in-out;
        }
        
        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }
        
        .slide-up {
            animation: slideUp 0.3s ease-out;
        }
        
        @keyframes slideUp {
            from { transform: translateY(20px); opacity: 0; }
            to { transform: translateY(0); opacity: 1; }
        }
        
        .file-input-wrapper {
            position: relative;
            overflow: hidden;
            display: inline-block;
        }
        
        .file-input-wrapper input[type=file] {
            position: absolute;
            left: 0;
            top: 0;
            opacity: 0;
        }
        
        .tab-content {
            display: none;
        }
        
        .tab-content.active {
            display: block;
            animation: fadeIn 0.3s ease-in-out;
        }
        
        .tag {
            display: inline-flex;
            align-items: center;
            background-color: #e2e8f0;
            border-radius: 9999px;
            padding: 0.25rem 0.75rem;
            margin-right: 0.5rem;
            margin-bottom: 0.5rem;
        }
        
        .tag-remove {
            margin-left: 0.5rem;
            cursor: pointer;
            color: #64748b;
        }
        
        .criteria-section {
            border-left: 3px solid #3b82f6;
            padding-left: 1rem;
            margin-bottom: 1.5rem;
        }
    </style>
</head>
<body class="bg-gray-100">
    <div class="container mx-auto p-4">
        <button id="openModalBtn" class="bg-blue-600 hover:bg-blue-700 text-white font-medium py-2 px-4 rounded-lg transition duration-200">
            <i class="fas fa-plus mr-2"></i> Add Communication Preference
        </button>
    </div>

    <!-- Modal -->
    <div id="preferenceModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center p-4 hidden">
        <div class="bg-white rounded-xl shadow-2xl w-full max-w-3xl max-h-[90vh] overflow-y-auto slide-up">
            <!-- Modal Header -->
            <div class="border-b border-gray-200 p-6 sticky top-0 bg-white z-10">
                <div class="flex justify-between items-center">
                    <h3 class="text-2xl font-semibold text-gray-800">Manage Communication Preference</h3>
                    <button id="closeModalBtn" class="text-gray-500 hover:text-gray-700">
                        <i class="fas fa-times text-xl"></i>
                    </button>
                </div>
            </div>
            
            <!-- Modal Body -->
            <div class="p-6 space-y-6">
                <!-- Basic Information Section -->
                <div>
                    <h4 class="text-lg font-medium text-gray-800 mb-4">Basic Information</h4>
                    <div class="space-y-4">
                        <div>
                            <label for="preferenceName" class="block text-sm font-medium text-gray-700 mb-1">Preference Name *</label>
                            <input type="text" id="preferenceName" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500">
                        </div>
                        
                        <div>
                            <label for="description" class="block text-sm font-medium text-gray-700 mb-1">Description</label>
                            <textarea id="description" rows="3" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"></textarea>
                        </div>
                        
                        <div>
                            <label for="tooltip" class="block text-sm font-medium text-gray-700 mb-1">Tooltip Text</label>
                            <input type="text" id="tooltip" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500">
                            <p class="text-xs text-gray-500 mt-1">This will appear when users hover over the preference name</p>
                        </div>
                        
                        <div class="flex items-center">
                            <input type="checkbox" id="isMandatory" class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded">
                            <label for="isMandatory" class="ml-2 block text-sm text-gray-700">This preference is mandatory</label>
                        </div>
                    </div>
                </div>
                
                <!-- User Assignment Section -->
                <div>
                    <h4 class="text-lg font-medium text-gray-800 mb-4">User Assignment</h4>
                    
                    <div class="space-y-4">
                        <div class="space-y-2">
                            <div class="flex items-center space-x-4">
                                <div class="flex items-center">
                                    <input type="radio" id="assignNone" name="assignmentType" value="none" class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300">
                                    <label for="assignNone" class="ml-2 block text-sm text-gray-700">None</label>
                                </div>
                                
                                <div class="flex items-center">
                                    <input type="radio" id="assignAll" name="assignmentType" value="all" checked class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300">
                                    <label for="assignAll" class="ml-2 block text-sm text-gray-700">All Network Members</label>
                                </div>
                                
                                <div class="flex items-center">
                                    <input type="radio" id="assignCriteria" name="assignmentType" value="criteria" class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300">
                                    <label for="assignCriteria" class="ml-2 block text-sm text-gray-700">Select assignment criteria</label>
                                </div>
                            </div>
                        </div>
                        
                        <!-- Conditional Content for Criteria Assignment -->
                        <div id="criteriaAssignmentContent" class="hidden bg-gray-50 p-4 rounded-lg space-y-4">
                            <!-- Assignment Criteria Sections -->
                            <div class="criteria-section">
                                <h5 class="text-sm font-medium text-gray-700 mb-3">Assignment Criteria</h5>
                                
                                <div class="space-y-4">
                                    <!-- Region & Country -->
                                    <div>
                                        <div class="flex items-center mb-2">
                                            <input type="checkbox" id="enableRegionCountry" class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded">
                                            <label for="enableRegionCountry" class="ml-2 block text-sm text-gray-700">Region & Country</label>
                                        </div>
                                        
                                        <div id="regionCountryContent" class="hidden pl-6 mt-2">
                                            <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
                                                <div>
                                                    <label for="region" class="block text-sm font-medium text-gray-700 mb-1">Region</label>
                                                    <select id="region" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500">
                                                        <option value="">Select a region</option>
                                                        <option value="europe">Europe</option>
                                                        <option value="asia">Asia</option>
                                                        <option value="americas">Americas</option>
                                                        <option value="africa">Africa</option>
                                                    </select>
                                                </div>
                                                
                                                <div>
                                                    <label for="country" class="block text-sm font-medium text-gray-700 mb-1">Country</label>
                                                    <select id="country" disabled class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 bg-gray-100">
                                                        <option value="">Select a region first</option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    
                                    <!-- User Tags -->
                                    <div>
                                        <div class="flex items-center mb-2">
                                            <input type="checkbox" id="enableUserTags" class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded">
                                            <label for="enableUserTags" class="ml-2 block text-sm text-gray-700">User Tags</label>
                                        </div>
                                        
                                        <div id="userTagsContent" class="hidden pl-6 mt-2">
                                            <div>
                                                <label for="tagInput" class="block text-sm font-medium text-gray-700 mb-1">Add User Tags</label>
                                                <div class="flex">
                                                    <input type="text" id="tagInput" class="flex-1 px-3 py-2 border border-gray-300 rounded-l-md focus:outline-none focus:ring-2 focus:ring-blue-500" placeholder="Enter tags separated by commas">
                                                    <button type="button" id="addTagsBtn" class="px-4 py-2 bg-blue-600 text-white rounded-r-md hover:bg-blue-700">Add</button>
                                                </div>
                                                <div id="tagsContainer" class="mt-2 flex flex-wrap"></div>
                                            </div>
                                        </div>
                                    </div>
                                    
                                    <!-- Key Contact Roles -->
                                    <div>
                                        <div class="flex items-center mb-2">
                                            <input type="checkbox" id="enableContactRoles" class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded">
                                            <label for="enableContactRoles" class="ml-2 block text-sm text-gray-700">Key Contact Roles</label>
                                        </div>
                                        
                                        <div id="contactRolesContent" class="hidden pl-6 mt-2">
                                            <div>
                                                <label class="block text-sm font-medium text-gray-700 mb-2">Select Key Contact Roles</label>
                                                <div class="space-y-2">
                                                    <div class="flex items-center">
                                                        <input type="checkbox" id="roleAdmin" class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded">
                                                        <label for="roleAdmin" class="ml-2 block text-sm text-gray-700">Administrator</label>
                                                    </div>
                                                    <div class="flex items-center">
                                                        <input type="checkbox" id="roleManager" class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded">
                                                        <label for="roleManager" class="ml-2 block text-sm text-gray-700">Manager</label>
                                                    </div>
                                                    <div class="flex items-center">
                                                        <input type="checkbox" id="roleSupervisor" class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded">
                                                        <label for="roleSupervisor" class="ml-2 block text-sm text-gray-700">Supervisor</label>
                                                    </div>
                                                    <div class="flex items-center">
                                                        <input type="checkbox" id="roleCoordinator" class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded">
                                                        <label for="roleCoordinator" class="ml-2 block text-sm text-gray-700">Coordinator</label>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            
                            <!-- Additional Users Upload -->
                            <div class="criteria-section">
                                <h5 class="text-sm font-medium text-gray-700 mb-3">Additional Users</h5>
                                
                                <div>
                                    <label class="block text-sm font-medium text-gray-700 mb-2">Upload additional users (optional)</label>
                                    <div class="file-input-wrapper">
                                        <button type="button" class="px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700">
                                            <i class="fas fa-upload mr-2"></i> Choose Excel/CSV File
                                        </button>
                                        <input type="file" id="userImportFile" accept=".xlsx,.xls,.csv" class="hidden">
                                    </div>
                                    <p class="text-xs text-gray-500 mt-2">Supported formats: .xlsx, .xls, .csv</p>
                                    <div id="fileInfo" class="mt-2 text-sm text-gray-600 hidden">
                                        <i class="fas fa-check-circle text-green-500 mr-1"></i>
                                        <span id="fileName"></span> selected
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            
            <!-- Modal Footer -->
            <div class="border-t border-gray-200 p-6 sticky bottom-0 bg-white">
                <div class="flex justify-end space-x-3">
                    <button type="button" id="cancelBtn" class="px-4 py-2 border border-gray-300 rounded-md text-sm font-medium text-gray-700 hover:bg-gray-50">Cancel</button>
                    <button type="button" id="saveBtn" class="px-4 py-2 bg-blue-600 text-white rounded-md text-sm font-medium hover:bg-blue-700">Save Preference</button>
                </div>
            </div>
        </div>
    </div>

    <script>
        document.addEventListener('DOMContentLoaded', function() {
            // Modal toggle
            const modal = document.getElementById('preferenceModal');
            const openModalBtn = document.getElementById('openModalBtn');
            const closeModalBtn = document.getElementById('closeModalBtn');
            const cancelBtn = document.getElementById('cancelBtn');
            
            openModalBtn.addEventListener('click', () => {
                modal.classList.remove('hidden');
            });
            
            [closeModalBtn, cancelBtn].forEach(btn => {
                btn.addEventListener('click', () => {
                    modal.classList.add('hidden');
                });
            });
            
            // Assignment type toggle
            const assignmentRadios = document.querySelectorAll('input[name="assignmentType"]');
            const criteriaAssignmentContent = document.getElementById('criteriaAssignmentContent');
            
            assignmentRadios.forEach(radio => {
                radio.addEventListener('change', function() {
                    if (this.value === 'criteria') {
                        criteriaAssignmentContent.classList.remove('hidden');
                    } else {
                        criteriaAssignmentContent.classList.add('hidden');
                    }
                });
            });
            
            // Criteria toggles
            const enableRegionCountry = document.getElementById('enableRegionCountry');
            const regionCountryContent = document.getElementById('regionCountryContent');
            
            const enableUserTags = document.getElementById('enableUserTags');
            const userTagsContent = document.getElementById('userTagsContent');
            
            const enableContactRoles = document.getElementById('enableContactRoles');
            const contactRolesContent = document.getElementById('contactRolesContent');
            
            enableRegionCountry.addEventListener('change', function() {
                if (this.checked) {
                    regionCountryContent.classList.remove('hidden');
                } else {
                    regionCountryContent.classList.add('hidden');
                }
            });
            
            enableUserTags.addEventListener('change', function() {
                if (this.checked) {
                    userTagsContent.classList.remove('hidden');
                } else {
                    userTagsContent.classList.add('hidden');
                }
            });
            
            enableContactRoles.addEventListener('change', function() {
                if (this.checked) {
                    contactRolesContent.classList.remove('hidden');
                } else {
                    contactRolesContent.classList.add('hidden');
                }
            });
            
            // Region-country dependency
            const regionSelect = document.getElementById('region');
            const countrySelect = document.getElementById('country');
            
            const countryOptions = {
                europe: ['United Kingdom', 'Germany', 'France', 'Spain', 'Italy'],
                asia: ['China', 'Japan', 'India', 'South Korea', 'Singapore'],
                americas: ['United States', 'Canada', 'Brazil', 'Mexico', 'Argentina'],
                africa: ['South Africa', 'Egypt', 'Nigeria', 'Kenya', 'Morocco']
            };
            
            regionSelect.addEventListener('change', function() {
                if (this.value) {
                    countrySelect.disabled = false;
                    countrySelect.innerHTML = '<option value="">Select a country</option>';
                    countrySelect.classList.remove('bg-gray-100');
                    
                    countryOptions[this.value].forEach(country => {
                        const option = document.createElement('option');
                        option.value = country.toLowerCase().replace(' ', '-');
                        option.textContent = country;
                        countrySelect.appendChild(option);
                    });
                } else {
                    countrySelect.disabled = true;
                    countrySelect.innerHTML = '<option value="">Select a region first</option>';
                    countrySelect.classList.add('bg-gray-100');
                }
            });
            
            // Tag management
            const tagInput = document.getElementById('tagInput');
            const addTagsBtn = document.getElementById('addTagsBtn');
            const tagsContainer = document.getElementById('tagsContainer');
            
            addTagsBtn.addEventListener('click', function() {
                const tagsText = tagInput.value.trim();
                if (tagsText) {
                    const tags = tagsText.split(',').map(tag => tag.trim()).filter(tag => tag);
                    
                    tags.forEach(tag => {
                        const tagElement = document.createElement('div');
                        tagElement.className = 'tag';
                        tagElement.innerHTML = `
                            ${tag}
                            <span class="tag-remove" onclick="this.parentElement.remove()">
                                <i class="fas fa-times"></i>
                            </span>
                        `;
                        tagsContainer.appendChild(tagElement);
                    });
                    
                    tagInput.value = '';
                }
            });
            
            // File upload display
            const fileInput = document.getElementById('userImportFile');
            const fileInfo = document.getElementById('fileInfo');
            const fileName = document.getElementById('fileName');
            
            fileInput.addEventListener('change', function() {
                if (this.files.length > 0) {
                    fileName.textContent = this.files[0].name;
                    fileInfo.classList.remove('hidden');
                } else {
                    fileInfo.classList.add('hidden');
                }
            });
            
            // Save button
            const saveBtn = document.getElementById('saveBtn');
            
            saveBtn.addEventListener('click', function() {
                // Validate form
                const preferenceName = document.getElementById('preferenceName').value.trim();
                if (!preferenceName) {
                    alert('Please enter a preference name');
                    return;
                }
                
                // Check if criteria is selected but no criteria options are chosen
                const assignmentType = document.querySelector('input[name="assignmentType"]:checked').value;
                if (assignmentType === 'criteria') {
                    const hasCriteria = enableRegionCountry.checked || enableUserTags.checked || enableContactRoles.checked;
                    if (!hasCriteria) {
                        alert('Please select at least one assignment criteria');
                        return;
                    }
                    
                    // Validate region/country if enabled
                    if (enableRegionCountry.checked) {
                        const region = regionSelect.value;
                        const country = countrySelect.value;
                        if (!region) {
                            alert('Please select a region');
                            return;
                        }
                        if (!country) {
                            alert('Please select a country');
                            return;
                        }
                    }
                    
                    // Validate tags if enabled
                    if (enableUserTags.checked && tagsContainer.children.length === 0) {
                        alert('Please add at least one user tag');
                        return;
                    }
                    
                    // Validate roles if enabled
                    if (enableContactRoles.checked) {
                        const rolesSelected = document.querySelectorAll('#contactRolesContent input[type="checkbox"]:checked').length > 0;
                        if (!rolesSelected) {
                            alert('Please select at least one contact role');
                            return;
                        }
                    }
                }
                
                // Gather form data (in a real app, you would send this to a server)
                const formData = {
                    name: preferenceName,
                    description: document.getElementById('description').value.trim(),
                    tooltip: document.getElementById('tooltip').value.trim(),
                    isMandatory: document.getElementById('isMandatory').checked,
                    assignmentType: assignmentType,
                    criteria: {
                        regionCountry: enableRegionCountry.checked ? {
                            region: regionSelect.value,
                            country: countrySelect.value
                        } : null,
                        userTags: enableUserTags.checked ? 
                            Array.from(tagsContainer.children).map(tag => tag.textContent.trim().replace('×', '')) : 
                            null,
                        contactRoles: enableContactRoles.checked ? {
                            admin: document.getElementById('roleAdmin').checked,
                            manager: document.getElementById('roleManager').checked,
                            supervisor: document.getElementById('roleSupervisor').checked,
                            coordinator: document.getElementById('roleCoordinator').checked
                        } : null,
                        additionalUsers: fileInput.files.length > 0 ? fileInput.files[0].name : null
                    }
                };
                
                console.log('Form data:', formData);
                alert('Preference saved successfully!');
                modal.classList.add('hidden');
                
                // Reset form (in a real app, you might want to keep some values)
                document.getElementById('preferenceName').value = '';
                document.getElementById('description').value = '';
                document.getElementById('tooltip').value = '';
                document.getElementById('isMandatory').checked = false;
                document.getElementById('assignAll').checked = true;
                criteriaAssignmentContent.classList.add('hidden');
                enableRegionCountry.checked = false;
                regionCountryContent.classList.add('hidden');
                enableUserTags.checked = false;
                userTagsContent.classList.add('hidden');
                enableContactRoles.checked = false;
                contactRolesContent.classList.add('hidden');
                tagsContainer.innerHTML = '';
                fileInfo.classList.add('hidden');
                fileInput.value = '';
            });
        });
    </script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=EmilyMooreGlobal/communication-preference" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>