diff --git a/shaarli-pro/dist/awesomplete.min.css b/shaarli-pro/dist/awesomplete.min.css
deleted file mode 100644
index 2fede79..0000000
--- a/shaarli-pro/dist/awesomplete.min.css
+++ /dev/null
@@ -1 +0,0 @@
-.awesomplete [hidden]{display:none}.awesomplete .visually-hidden{position:absolute;clip:rect(0,0,0,0)}.awesomplete{position:relative}.awesomplete,.awesomplete>input{display:block;width:100%}.awesomplete>ul{animation:slideDown .2s ease;background:var(--bg-card);border:1px solid var(--border);border-radius:.5rem;box-shadow:var(--shadow-lg);box-sizing:border-box;color:var(--text-main);left:0;list-style:none;margin:.25rem 0 0;min-width:100%;overflow:hidden;padding:0;position:absolute;text-shadow:none;z-index:1000}.awesomplete>ul:empty{display:none}.awesomplete>ul>li{border-bottom:1px solid var(--border-light);color:var(--text-main);cursor:pointer;font-size:.95rem;padding:.75rem 1rem;position:relative;transition:background .1s ease}.awesomplete>ul>li:last-child{border-bottom:none}.awesomplete>ul>li:hover{background:var(--bg-card-hover);color:var(--primary)}.awesomplete>ul>li[aria-selected=true]{background:var(--primary);color:#fff}.awesomplete mark{background:rgba(255,255,0,.3);color:inherit;font-weight:700;padding:0}.awesomplete li[aria-selected=true] mark{background:hsla(0,0%,100%,.3);color:inherit}[data-theme=dark] .awesomplete>ul{background:var(--bg-card);border-color:var(--border)}[data-theme=dark] .awesomplete>ul>li:hover{background:var(--bg-card-hover)}.card,.form-add .card,.page-edit .card{overflow:visible!important}@keyframes slideDown{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}
\ No newline at end of file
diff --git a/shaarli-pro/dist/custom_views.min.css b/shaarli-pro/dist/custom_views.min.css
deleted file mode 100644
index 4bbf5f4..0000000
--- a/shaarli-pro/dist/custom_views.min.css
+++ /dev/null
@@ -1 +0,0 @@
-:root{--special-view-panel-bg:var(--tile-bg,var(--bg-card));--special-view-panel-alt:color-mix(in srgb,var(--tile-bg,var(--bg-card)) 85%,var(--bg-body));--special-view-border:var(--tile-border,var(--border));--special-view-divider:var(--border-light);--special-view-shadow:var(--tile-shadow,var(--shadow-md));--special-view-muted:var(--text-secondary);--special-view-strong:var(--text-main);--special-view-chip-bg:color-mix(in srgb,var(--primary) 12%,transparent);--special-view-chip-hover:color-mix(in srgb,var(--primary) 22%,transparent);--special-view-chip-text:var(--text-main)}.special-view-wrapper{display:flex;flex-direction:row;min-height:calc(100vh - 60px);width:100%}body.view-todo .content-container{background-color:transparent;min-height:100vh;padding:2rem}body.view-todo #linklist{display:block}.create-task-btn:hover{background-color:var(--primary-hover);transform:translateY(-1px)}.todo-list-item{align-items:center;border-radius:.5rem;color:var(--special-view-strong);cursor:pointer;display:flex;gap:.75rem;margin-bottom:.25rem;padding:.75rem 1rem;transition:background-color .2s}.todo-list-item:hover{background-color:color-mix(in srgb,var(--special-view-strong) 8%,transparent)}.todo-list-item.active{background-color:color-mix(in srgb,var(--primary) 10%,transparent);color:var(--primary);font-weight:600;margin:0}.todo-item{align-items:center;border-bottom:1px solid var(--special-view-divider);display:flex;gap:1rem;padding:1rem;transition:background-color .2s}.todo-item:hover{background-color:color-mix(in srgb,var(--special-view-strong) 5%,transparent)}.todo-checkbox{align-items:center;border:2px solid var(--special-view-muted);border-radius:50%;cursor:pointer;display:flex;flex-shrink:0;height:20px;justify-content:center;width:20px}.todo-checkbox.checked{background-color:var(--primary);border-color:var(--primary);color:#fff}.todo-content{display:flex;flex:1;flex-direction:column;gap:.25rem}.todo-title{color:var(--special-view-strong);font-size:1rem;font-weight:400}.todo-item.completed .todo-title{color:var(--text-muted);text-decoration:line-through}.todo-meta{align-items:center;color:var(--special-view-muted);display:flex;font-size:.75rem;gap:.5rem}.todo-badge{background-color:var(--special-view-chip-bg);border-radius:1rem;font-size:.7rem;padding:.125rem .5rem}.due-date{align-items:center;display:flex;gap:.25rem}body.view-archive .content-container,body.view-notes .content-container{background-color:transparent;min-height:100vh;padding:2rem}.notes-top-bar{align-items:flex-start;display:flex;justify-content:center;margin-bottom:2rem;padding-right:0}.note-input-container{background-color:var(--special-view-panel-bg);border:1px solid var(--special-view-border);border-radius:12px;box-shadow:var(--special-view-shadow);max-width:100%;overflow:hidden;transition:box-shadow .2s;width:800px}.note-input-container.is-editing{max-height:72vh}.note-input-collapsed{align-items:center;color:var(--special-view-muted);cursor:text;display:flex;font-size:1rem;font-weight:500;padding:12px 16px}.note-input-container.is-editing{cursor:default}.icon-btn:hover{background-color:color-mix(in srgb,var(--text-muted) 10%,transparent)}.icon-btn.active{background-color:var(--special-view-chip-bg);color:var(--primary)}.notes-masonry{column-count:4;column-gap:16px;margin:0 auto;max-width:1600px;width:100%}@media (max-width:1400px){.notes-masonry{column-count:3}}@media (max-width:1024px){.notes-masonry{column-count:2}}@media (max-width:640px){.notes-masonry{column-count:1}}.notes-masonry:has(.note-card:first-child:last-child){column-count:1}.notes-masonry:has(.note-card:nth-child(2):last-child){column-count:2}.notes-masonry:has(.note-card:nth-child(3):last-child){column-count:3}.notes-masonry .note-card{break-inside:avoid;display:inline-block;margin:0 0 16px;width:100%;-webkit-column-break-inside:avoid;page-break-inside:avoid;box-shadow:var(--special-view-shadow);column-span:none}.note-card,.notes-masonry .note-card{background:var(--special-view-panel-bg);border:1px solid var(--special-view-border);border-radius:14px;overflow:hidden}.note-card .note-inner{padding:14px 58px 12px 16px;position:relative}.note-modal-overlay{align-items:center;backdrop-filter:blur(3px);-webkit-backdrop-filter:blur(3px);background:rgba(0,0,0,.55);display:none;inset:0;justify-content:center;overflow-y:auto;padding:1rem;position:fixed;z-index:1100}.note-modal,.note-modal-overlay.open{display:flex}.note-modal{background:var(--special-view-panel-bg);border:1px solid var(--special-view-border);border-radius:14px;box-shadow:0 14px 28px rgba(0,0,0,.25),0 10px 10px rgba(0,0,0,.22);color:inherit;flex-direction:column;max-height:86vh;overflow:hidden;width:min(720px,92vw)}.note-modal-header{align-items:flex-start;display:flex;flex-shrink:0;gap:12px;justify-content:space-between;padding:18px 20px 10px}.note-modal-tags.is-empty{display:none}.note-modal-tags .note-tag{align-items:center;background:var(--special-view-chip-bg);border-radius:999px;color:var(--special-view-chip-text);display:inline-flex;font-size:.75rem;font-weight:500;gap:.25rem;padding:.25rem .5rem}.note-modal-tags .note-tag-text{line-height:1.2}.note-modal-tags .note-tag-remove-btn{align-items:center;background:var(--special-view-chip-hover);border:none;border-radius:999px;color:currentColor;cursor:pointer;display:inline-flex;font-size:.8rem;height:1.1rem;justify-content:center;line-height:1;padding:0;width:1.1rem}.note-modal-actions{align-items:center;background:transparent;display:flex;flex-shrink:0;flex-wrap:wrap;gap:6px;justify-content:space-between;padding:8px 16px 16px}.note-modal-pin-toggle.active,.note-modal-pin-toggle:hover{background-color:color-mix(in srgb,var(--text-main) 14%,transparent)}.note-body{color:var(--special-view-strong);font-size:.875rem;line-height:1.4;word-wrap:break-word;display:block;max-height:360px;overflow:hidden}.note-body p,.note-modal-content p{margin:0 0 .5rem}.bookmark-palette>button:hover{background:var(--primary-light);color:var(--primary)}.palette-popup{backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);background:var(--special-view-panel-bg);border:1px solid var(--special-view-border);border-radius:12px;bottom:calc(100% + 8px);box-shadow:0 14px 34px rgba(0,0,0,.22);display:none;left:0;max-height:min(320px,calc(100vh - 140px));max-width:min(340px,calc(100vw - 32px));overflow:auto;overscroll-behavior:contain;padding:12px;position:absolute;width:max-content;z-index:50}.palette-popup.open{display:block}.note-card .note-hover-actions a,.note-card .note-hover-actions button{color:inherit}.note-card[class*=note-color-]{border:1px solid var(--special-view-border);color:var(--note-card-fg,var(--special-view-strong))}body.view-archive .content-container{background-color:transparent!important}.archive-title-container{margin-bottom:1rem;text-align:center}.archive-title{align-items:center;color:var(--special-view-strong);display:flex;font-size:1.75rem;font-weight:600;gap:.5rem;justify-content:center;margin:0}.archive-title i{color:var(--primary);font-size:1.5rem}.archive-subtitle{color:var(--special-view-muted);font-size:.875rem;margin:.25rem 0 0}.archive-top-bar{align-items:center;flex-direction:column;gap:1rem;padding-right:0;position:relative}.archive-top-bar .notes-tools{position:absolute;right:1rem;top:50%;transform:translateY(-50%)}body.view-todo .note-card.todo-card .note-body{padding-top:.25rem}body.view-todo .note-card.todo-card .todo-checklist-preview-wrap{display:block;-webkit-line-clamp:initial;line-clamp:none;-webkit-box-orient:initial;max-height:360px;overflow:hidden;padding-top:.25rem}.todo-checklist-preview{display:flex;flex-direction:column;gap:.35rem;list-style:none;margin:0;padding:0}.todo-checklist-preview-item{align-items:flex-start;display:flex;font-size:.95rem;gap:.6rem;line-height:1.35}.todo-checklist-preview-box{align-items:center;border:2px solid;border-radius:4px;display:inline-flex;flex:0 0 auto;height:16px;justify-content:center;margin-top:2px;opacity:.7;width:16px}.todo-checklist-preview-box i{font-size:14px;opacity:0}.todo-checklist-preview-text{flex:1;min-width:0;overflow-wrap:break-word;word-wrap:break-word;word-break:break-word}.todo-checklist-preview-item.is-checked{opacity:.7}.todo-checklist-preview-item.is-checked .todo-checklist-preview-box i{opacity:1}.todo-checklist-preview-item.is-checked .todo-checklist-preview-text{text-decoration:line-through}.todo-checklist-preview-more{opacity:.7}.todo-modal .note-modal-content{padding-top:6px}.todo-checklist{display:flex;flex-direction:column;gap:6px;padding-bottom:6px}.todo-checklist-row{align-items:center;border-radius:8px;display:grid;gap:8px;grid-template-columns:26px 26px minmax(0,1fr) 34px;padding:6px 2px}.todo-checklist-row.is-checked{opacity:.75}.todo-checklist-row.is-dragging{opacity:.6}.todo-drag-handle{align-items:center;background:none;border:none;color:inherit;cursor:grab;display:inline-flex;height:26px;justify-content:center;opacity:.7;padding:0;width:26px}.todo-drag-handle:active{cursor:grabbing}.todo-drag-handle i{font-size:18px}.todo-checklist-box{align-items:center;cursor:pointer;display:inline-flex;height:26px;justify-content:center;width:26px}.todo-checklist-box input{opacity:0;pointer-events:none;position:absolute}.todo-checklist-box-ui{border:2px solid;border-radius:4px;display:inline-block;height:16px;opacity:.75;width:16px}.todo-item-checkbox:checked+.todo-checklist-box-ui{background:currentColor;box-shadow:inset 0 0 0 3px rgba(0,0,0,.22)}[data-theme=dark] .todo-item-checkbox:checked+.todo-checklist-box-ui{box-shadow:inset 0 0 0 3px rgba(0,0,0,.35)}.todo-item-text{background:transparent;border:none;border-radius:6px;color:inherit;font-size:1rem;line-height:1.4;min-width:0;outline:none;padding:6px;width:100%}.todo-checklist-row.is-checked .todo-item-text{text-decoration:line-through}.todo-item-text:focus{background:color-mix(in srgb,var(--text-main) 6%,transparent)}[data-theme=dark] .todo-item-text:focus{background:color-mix(in srgb,var(--text-main) 8%,transparent)}.todo-item-delete{align-items:center;background:none;border:none;border-radius:50%;color:inherit;cursor:pointer;display:inline-flex;height:34px;justify-content:center;opacity:.7;padding:0;width:34px}.todo-item-delete:hover{background:color-mix(in srgb,var(--text-main) 8%,transparent);opacity:1}[data-theme=dark] .todo-item-delete:hover{background:color-mix(in srgb,var(--text-main) 12%,transparent)}.todo-item-delete i{font-size:20px}.todo-add-item-btn{align-items:center;background:none;border:none;color:inherit;cursor:pointer;display:inline-flex;font-size:1rem;gap:10px;justify-content:flex-start;opacity:.8;padding:8px 0;width:100%}.todo-add-item-btn i{font-size:18px}.todo-add-item-btn:hover{opacity:1}body.view-archive .content-container,body.view-notes .content-container,body.view-todo .content-container{padding:1.75rem clamp(1rem,3vw,2.5rem)}body.view-archive .linklist-filters,body.view-notes .linklist-filters,body.view-todo .linklist-filters{align-items:center;background:var(--special-view-chip-bg);border:1px solid var(--special-view-border);border-radius:9999px;color:var(--special-view-strong);display:inline-flex;font-size:.85rem;font-weight:500;gap:.5rem;margin:0 0 1.25rem;max-width:max-content;padding:.45rem .85rem}.notes-top-bar{align-items:center;gap:1rem;margin-left:auto;margin-right:auto;max-width:1600px;position:relative}.notes-top-bar .notes-tools{position:absolute;right:0;top:50%;transform:translateY(-50%)}.note-input-container{transition:box-shadow .2s ease,border-color .2s ease;width:min(760px,100%)}.note-input-container.is-editing,.note-input-container:hover{box-shadow:var(--tile-shadow-hover,var(--shadow-md))}.note-input-container.is-editing{border-color:color-mix(in srgb,var(--primary) 40%,var(--special-view-border))}.note-input-container input[type=text],.note-input-container textarea{background:transparent;border:0;color:var(--special-view-strong);font-family:inherit;font-size:1rem;outline:none;padding:10px 14px;width:100%}.note-input-container textarea{line-height:1.45;min-height:120px;resize:vertical}.note-input-container input[type=text]::placeholder,.note-input-container textarea::placeholder{color:var(--special-view-muted)}.note-input-container .note-editor-toolbar,.note-input-container .note-input-actions,.note-input-container .todo-editor-toolbar{align-items:center;background:color-mix(in srgb,var(--special-view-panel-bg) 88%,var(--bg-body));border-top:1px solid var(--special-view-divider);display:flex;flex-wrap:wrap;gap:4px;padding:6px 10px}.note-input-container .icon-btn,.note-input-container button:not(.btn):not([class*=note-close]):not([class*=submit]){background:transparent;border:0;border-radius:6px;color:var(--special-view-strong);cursor:pointer;font-size:.85rem;line-height:1;padding:6px 8px;transition:background .15s ease}.note-input-container .icon-btn:hover,.note-input-container button:not(.btn):not([class*=note-close]):not([class*=submit]):hover{background:color-mix(in srgb,var(--text-main) 10%,transparent)}.note-input-container .note-close-btn,.note-input-container [data-action=close]{background:var(--special-view-panel-alt);border:1px solid var(--special-view-border);border-radius:8px;color:var(--special-view-strong);cursor:pointer;font-size:.85rem;padding:6px 12px}.note-input-container .note-close-btn:hover,.note-input-container [data-action=close]:hover{background:var(--tile-bg-hover,var(--bg-card-hover))}.note-input-container .todo-checklist-row{border-bottom:1px solid var(--special-view-divider);border-radius:0;padding:4px 10px}.note-input-container .todo-checklist-row:last-of-type{border-bottom:0}.note-input-container .todo-item-text{padding:8px 6px}.note-card .note-title{color:inherit;font-size:1rem;font-weight:600;line-height:1.3;margin:0 0 6px}.note-card .note-body{font-size:.9rem;line-height:1.5}.note-card .link-tag,.note-card .note-tag{background:color-mix(in srgb,var(--primary) 14%,transparent);border:1px solid color-mix(in srgb,var(--primary) 22%,transparent);border-radius:9999px;color:var(--special-view-chip-text);font-size:.72rem;font-weight:500;padding:2px 8px}.notes-masonry .note-card{transition:box-shadow .2s ease,transform .2s ease,border-color .2s ease}.notes-masonry .note-card:hover{border-color:color-mix(in srgb,var(--primary) 35%,var(--special-view-border));box-shadow:var(--tile-shadow-hover,var(--shadow-lg));transform:translateY(-1px)}.note-card:not([class*=note-color-]){color:var(--special-view-strong)}body.view-todo .notes-masonry:empty:after{content:"Aucune tâche pour le moment."}body.view-notes .notes-masonry:empty:after,body.view-todo .notes-masonry:empty:after{color:var(--special-view-muted);display:block;font-size:.95rem;padding:3rem 1rem;text-align:center}body.view-notes .notes-masonry:empty:after{content:"Aucune note pour le moment."}.icon-btn{align-items:center;background:transparent;border:none;border-radius:8px;color:var(--special-view-strong);cursor:pointer;display:inline-flex;font-size:1rem;height:32px;justify-content:center;line-height:1;padding:0;text-decoration:none;transition:background .15s ease,color .15s ease;width:32px}.notes-tools{align-items:center;display:flex;gap:4px}.note-pin-corner{align-items:center;background:transparent;border-radius:50%;color:var(--special-view-muted);display:inline-flex;font-size:1rem;height:28px;justify-content:center;opacity:0;position:absolute;right:12px;text-decoration:none;top:10px;transition:opacity .15s ease,background .15s ease,color .15s ease;width:28px}.note-card:hover .note-pin-corner,.note-pin-corner.active{opacity:1}.note-pin-corner:hover{background:color-mix(in srgb,var(--text-main) 12%,transparent);color:var(--special-view-strong)}.note-pin-corner.active{color:var(--primary)}.note-tags{display:flex;flex-wrap:wrap;gap:4px;padding:4px 0 6px}.note-hover-actions{align-items:center;border-top:1px solid var(--special-view-divider);display:flex;gap:2px;margin-top:8px;opacity:0;padding:4px 8px 6px;transition:opacity .15s ease}.note-card:hover .note-hover-actions{opacity:1}.note-hover-actions button,.note-hover-actions>a{align-items:center;background:transparent;border:none;border-radius:8px;color:inherit;cursor:pointer;display:inline-flex;font-size:.95rem;height:30px;justify-content:center;line-height:1;padding:0;text-decoration:none;transition:background .15s ease;width:30px}.note-hover-actions button:hover,.note-hover-actions>a:hover{background:color-mix(in srgb,var(--text-main) 12%,transparent)}.note-hover-actions .spacer{flex:1}.note-input-placeholder{color:var(--special-view-muted);flex:1;font-size:1rem;font-weight:500}.note-input-collapsed .note-input-actions{background:transparent;border-top:none;flex-shrink:0;padding:0}.note-input-expanded,.todo-draft-expanded{display:flex;flex-direction:column;overflow:hidden}.todo-draft-list{flex-shrink:0;max-height:220px;overflow-y:auto;padding:4px 0}.note-input-expanded-actions{align-items:center;background:color-mix(in srgb,var(--special-view-panel-bg) 88%,var(--bg-body));border-top:1px solid var(--special-view-divider);display:flex;flex-shrink:0;gap:8px;justify-content:space-between;padding:8px 10px}.note-input-actions-left{align-items:center;display:flex;gap:4px}.todo-draft-add-btn{align-items:center;background:transparent;border:none;color:var(--special-view-muted);cursor:pointer;display:flex;flex-shrink:0;font-family:inherit;font-size:.9rem;gap:8px;padding:8px 14px;text-align:left;transition:color .15s ease;width:100%}.todo-draft-add-btn:hover{color:var(--special-view-strong)}.todo-draft-add-btn i{font-size:18px}.note-input-close-btn{align-items:center!important;background:var(--special-view-panel-alt)!important;border:1px solid var(--special-view-border)!important;border-radius:8px!important;color:var(--special-view-strong)!important;cursor:pointer;display:inline-flex!important;flex-shrink:0;font-family:inherit;font-size:.9rem!important;height:auto!important;padding:6px 16px!important;transition:background .15s ease;width:auto!important}.note-input-close-btn:hover{background:var(--tile-bg-hover,var(--bg-card-hover))!important}.note-input-format-btn,.note-input-palette-btn{align-items:center;background:transparent;border:none;border-radius:8px;color:var(--special-view-strong);cursor:pointer;display:inline-flex;font-size:1.1rem;height:32px;justify-content:center;padding:0;transition:background .15s ease;width:32px}.note-input-format-btn:hover,.note-input-palette-btn:hover{background:color-mix(in srgb,var(--text-main) 10%,transparent)}.note-input-container .note-input-title,.note-input-container .todo-draft-title{font-size:1.05rem;font-weight:600;padding:12px 14px 4px}.todo-draft-row{align-items:center;display:grid;gap:6px;grid-template-columns:26px minmax(0,1fr) 34px;padding:2px 4px}.note-card .note-tag{align-items:center;display:inline-flex;gap:3px}.note-card .note-tag-remove-btn{align-items:center;background:color-mix(in srgb,var(--primary) 30%,transparent);border:none;border-radius:999px;color:var(--special-view-chip-text);cursor:pointer;display:inline-flex;flex-shrink:0;font-size:.7rem;height:14px;justify-content:center;line-height:1;padding:0;transition:background .15s ease;width:14px}.note-card .note-tag-remove-btn:hover{background:color-mix(in srgb,var(--primary) 55%,transparent)}.note-modal-content{flex:1 1 auto;overflow-y:auto;padding:0 20px 12px}.note-modal-tags{display:flex;flex-shrink:0;flex-wrap:wrap;gap:6px;padding:6px 20px 10px}.note-modal-pin-toggle{align-items:center;background:transparent;border:none;border-radius:50%;color:var(--special-view-muted);cursor:pointer;display:inline-flex;flex-shrink:0;font-size:1rem;height:32px;justify-content:center;padding:0;transition:background .15s ease,color .15s ease;width:32px}.note-modal-pin-toggle.active{color:var(--primary)}.note-modal-actions-left{align-items:center;display:flex;gap:4px}.note-modal-color-picker{position:relative}.note-modal-actions a,.note-modal-actions button,.note-modal-actions>div>button{align-items:center;background:transparent;border:none;border-radius:8px;color:var(--special-view-strong);cursor:pointer;display:inline-flex;font-size:1rem;height:32px;justify-content:center;padding:0;text-decoration:none;transition:background .15s ease;width:32px}.note-modal-actions a:hover,.note-modal-actions button:hover,.note-modal-actions>div>button:hover{background:color-mix(in srgb,var(--text-main) 10%,transparent)}.note-modal-close-btn{align-items:center!important;background:var(--special-view-panel-alt)!important;border:1px solid var(--special-view-border)!important;border-radius:8px!important;color:var(--special-view-strong)!important;cursor:pointer;display:inline-flex!important;font-family:inherit;font-size:.9rem!important;height:auto!important;padding:6px 20px!important;transition:background .15s ease;width:auto!important}.note-modal-close-btn:hover{background:var(--tile-bg-hover,var(--bg-card-hover))!important}.note-modal-header .note-title{color:inherit;flex:1;font-size:1.15rem;font-weight:600;line-height:1.3;margin:0;word-break:break-word}.bg-studio-panel{background:var(--special-view-panel-bg);border:1px solid var(--special-view-border);border-radius:14px;box-shadow:0 8px 32px rgba(0,0,0,.25),0 2px 8px rgba(0,0,0,.12);color:var(--special-view-strong);display:flex;flex-direction:column;font-family:inherit;font-size:.9rem;max-height:min(560px,calc(100vh - 24px));overflow:hidden;position:fixed;width:min(360px,calc(100vw - 24px));z-index:1200}.bg-studio-header{align-items:center;border-bottom:1px solid var(--special-view-divider);display:flex;flex-shrink:0;gap:8px;justify-content:space-between;padding:12px 16px 8px}.bg-studio-title{flex:1;font-size:.95rem;font-weight:600}.bg-studio-close{align-items:center;background:transparent;border:none;border-radius:50%;color:inherit;cursor:pointer;display:inline-flex;flex-shrink:0;font-size:1rem;height:28px;justify-content:center;padding:0;transition:background .15s ease;width:28px}.bg-studio-close:hover{background:color-mix(in srgb,var(--text-main) 10%,transparent)}.bg-studio-gallery{display:flex;flex:0 1 auto;flex-wrap:wrap;gap:6px;max-height:200px;overflow-y:auto;padding:10px 14px}.bg-studio-tile{align-items:center;display:flex;flex-direction:column;gap:3px}.bg-studio-thumb{background-color:var(--special-view-panel-alt);background-position:50%;background-size:cover;border:2px solid transparent;border-radius:8px;cursor:pointer;height:44px;overflow:hidden;padding:0;transition:border-color .15s ease,box-shadow .15s ease;width:58px}.bg-studio-thumb.is-active,.bg-studio-thumb:hover{border-color:var(--primary)}.bg-studio-thumb.is-active{box-shadow:0 0 0 2px color-mix(in srgb,var(--primary) 40%,transparent)}.bg-studio-thumb-solid{background:var(--special-view-panel-alt);display:block;height:100%;width:100%}.bg-studio-thumb-label{color:var(--special-view-muted);font-size:.65rem;max-width:58px;overflow:hidden;text-align:center;text-overflow:ellipsis;white-space:nowrap}.bg-studio-rows{border-bottom:1px solid var(--special-view-divider);flex-shrink:0;gap:8px;overflow-y:auto;padding:8px 14px 6px}.bg-studio-row,.bg-studio-rows{display:flex;flex-direction:column}.bg-studio-row{gap:5px}.bg-studio-row-heading{align-items:center;display:flex;justify-content:space-between}.bg-studio-row-label{color:var(--special-view-muted);font-size:.75rem;font-weight:600;letter-spacing:.04em;text-transform:uppercase}.bg-studio-reset{align-items:center;background:transparent;border:none;border-radius:50%;color:var(--special-view-muted);cursor:pointer;display:inline-flex;font-size:.9rem;height:22px;justify-content:center;padding:0;transition:background .15s ease,color .15s ease;width:22px}.bg-studio-reset:hover{background:color-mix(in srgb,var(--text-main) 10%,transparent);color:var(--special-view-strong)}.bg-studio-swatches{display:flex;flex-wrap:wrap;gap:5px}.bg-studio-swatch{border:2px solid transparent;border-radius:50%;box-shadow:0 1px 3px rgba(0,0,0,.18);cursor:pointer;flex-shrink:0;height:22px;padding:0;transition:border-color .15s ease,transform .1s ease;width:22px}.bg-studio-swatch:hover{transform:scale(1.15)}.bg-studio-swatch.is-active{border-color:var(--primary);box-shadow:0 0 0 2px color-mix(in srgb,var(--primary) 40%,transparent)}.bg-studio-swatch-custom{align-items:center;background:var(--special-view-panel-alt);border-color:var(--special-view-border);color:var(--special-view-muted);display:inline-flex;font-size:.75rem;justify-content:center}.bg-studio-filters{display:flex;flex-wrap:wrap;gap:4px}.bg-studio-filter-btn{align-items:center;background:transparent;border:1px solid var(--special-view-border);border-radius:8px;color:var(--special-view-muted);cursor:pointer;display:inline-flex;font-size:.95rem;height:30px;justify-content:center;padding:0;transition:background .15s ease,color .15s ease,border-color .15s ease;width:30px}.bg-studio-filter-btn:hover{background:color-mix(in srgb,var(--text-main) 8%,transparent);color:var(--special-view-strong)}.bg-studio-filter-btn.is-active{background:color-mix(in srgb,var(--primary) 12%,transparent);border-color:var(--primary);color:var(--primary)}.bg-studio-search{align-items:center;border-top:1px solid var(--special-view-divider);display:flex;flex-shrink:0;gap:6px;padding:8px 14px}.bg-studio-search>i{color:var(--special-view-muted);flex-shrink:0;font-size:1rem}.bg-studio-search-input{background:transparent;border:none;color:var(--special-view-strong);flex:1;font-family:inherit;font-size:.85rem;min-width:0;outline:none}.bg-studio-search-input::placeholder{color:var(--special-view-muted)}.bg-studio-clear{align-items:center;background:transparent;border:none;border-radius:50%;color:var(--special-view-muted);cursor:pointer;display:inline-flex;font-size:.85rem;height:20px;justify-content:center;padding:0;transition:background .15s ease,color .15s ease;width:20px}.bg-studio-clear:hover{background:color-mix(in srgb,var(--text-main) 10%,transparent);color:var(--special-view-strong)}.link-outer.note-has-bg,.note-card.note-has-bg,.note-modal.note-has-bg{background-image:var(--note-bg-image,none)!important;background-position:50%;background-repeat:no-repeat;background-size:cover}.note-card{position:relative}.link-outer.note-filter-dots:after,.link-outer.note-filter-glass:after,.link-outer.note-filter-grid:after,.link-outer.note-filter-lined:after,.link-outer.note-filter-noise:after,.link-outer.note-filter-stripes:after,.link-outer.note-filter-vignette:after,.note-card.note-filter-dots:after,.note-card.note-filter-glass:after,.note-card.note-filter-grid:after,.note-card.note-filter-lined:after,.note-card.note-filter-noise:after,.note-card.note-filter-stripes:after,.note-card.note-filter-vignette:after{border-radius:inherit;content:"";inset:0;pointer-events:none;position:absolute;z-index:0}.link-outer.note-filter-glass:after,.note-card.note-filter-glass:after{backdrop-filter:blur(2px);-webkit-backdrop-filter:blur(2px);background:hsla(0,0%,100%,.06)}.link-outer.note-filter-vignette:after,.note-card.note-filter-vignette:after{background:radial-gradient(ellipse at center,transparent 45%,rgba(0,0,0,.42) 100%)}.link-outer.note-filter-lined:after,.note-card.note-filter-lined:after{background-image:repeating-linear-gradient(180deg,transparent 0,transparent 27px,hsla(0,0%,50%,.18) 0,hsla(0,0%,50%,.18) 28px)}.link-outer.note-filter-grid:after,.note-card.note-filter-grid:after{background-image:repeating-linear-gradient(90deg,hsla(0,0%,50%,.15) 0,hsla(0,0%,50%,.15) 1px,transparent 0,transparent 28px),repeating-linear-gradient(180deg,hsla(0,0%,50%,.15) 0,hsla(0,0%,50%,.15) 1px,transparent 0,transparent 28px)}.link-outer.note-filter-noise:after,.note-card.note-filter-noise:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='a'%3E%3CfeTurbulence baseFrequency='.9' numOctaves='4' stitchTiles='stitch' type='fractalNoise'/%3E%3C/filter%3E%3Cpath d='M0 0h200v200H0z' filter='url(%23a)' opacity='.06'/%3E%3C/svg%3E");background-repeat:repeat}.link-outer.note-filter-dots:after,.note-card.note-filter-dots:after{background-image:radial-gradient(circle,hsla(0,0%,50%,.3) 1px,transparent 0);background-size:14px 14px}.link-outer.note-filter-stripes:after,.note-card.note-filter-stripes:after{background-image:repeating-linear-gradient(-45deg,transparent,transparent 8px,hsla(0,0%,50%,.12) 0,hsla(0,0%,50%,.12) 9px)}.link-outer .link-actions,.link-outer .link-content,.link-outer .link-meta,.note-card .note-hover-actions,.note-card .note-inner{position:relative;z-index:1}.link-outer .link-hover-actions,.link-outer .link-select-checkbox,.link-outer .link-visibility-badge{z-index:20}.link-outer[class*=note-color-],.link-outer[class*=note-color-] .link-actions,.link-outer[class*=note-color-] .link-actions a,.link-outer[class*=note-color-] .link-actions button,.link-outer[class*=note-color-] .link-description,.link-outer[class*=note-color-] .link-meta,.link-outer[class*=note-color-] .link-meta a,.link-outer[class*=note-color-] .link-title,.link-outer[class*=note-color-] .link-title a,.link-outer[class*=note-color-] .link-url,.link-outer[class*=note-color-] .link-url a,.view-list .link-outer[class*=note-color-],.view-list .link-outer[class*=note-color-] a,.view-list .link-outer[class*=note-color-] button{color:var(--note-card-fg,var(--tile-text))}.note-card[class*=note-color-] .note-body,.note-card[class*=note-color-] .note-title,.note-card[class*=note-color-] .todo-checklist-preview-item,.note-card[class*=note-color-] .todo-checklist-preview-text{color:var(--note-card-fg,var(--special-view-strong))}@media (prefers-reduced-motion:reduce){*,:after,:before{animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.01ms!important}}
\ No newline at end of file
diff --git a/shaarli-pro/dist/custom_views.min.js b/shaarli-pro/dist/custom_views.min.js
index 5ceb60b..2e45c70 100644
--- a/shaarli-pro/dist/custom_views.min.js
+++ b/shaarli-pro/dist/custom_views.min.js
@@ -1 +1 @@
-!function(){"use strict";function t(t){return"undefined"!=typeof window&&"function"==typeof window.renderMarkdown?window.renderMarkdown(t):String(t||"").replace(/\n/g,"
")}function e(t,e){if("undefined"!=typeof window&&"function"==typeof window.applyKeepNoteFormatting)return window.applyKeepNoteFormatting(t,e)}document.addEventListener("DOMContentLoaded",function(){const t=new URLSearchParams(window.location.search),e=t.get("searchtags")||t.get("searchTags")||"",o=window.location.pathname.match(/\/tag\/(.+)$/),n=(e+" "+(o?decodeURIComponent(o[1]):"")).toLowerCase().split(/[\s,]+/).filter(t=>t),d=!!document.querySelector('.sidebar-link[aria-label="Notes"].active, .header-nav-link[aria-label="Notes"].active, .sidebar-link[href*="searchtags=note"].active, .sidebar-link[href*="searchtags=shaarli-note"].active')||!!document.querySelector('.sidebar-link[aria-label="'+window.ShaarliProI18n.t("Notes")+'"].active, .header-nav-link[aria-label="'+window.ShaarliProI18n.t("Notes")+'"].active'),c=!!document.querySelector('.sidebar-link[aria-label="Mes tâches"].active, .header-nav-link[aria-label="Mes tâches"].active, .sidebar-link[href*="searchtags=shaarli-todo"].active, .sidebar-link[href*="searchtags=todo"].active')||!!document.querySelector('.sidebar-link[aria-label="'+window.ShaarliProI18n.t("My tasks")+'"].active, .header-nav-link[aria-label="'+window.ShaarliProI18n.t("My tasks")+'"].active'),p=!!document.querySelector('.sidebar-link[aria-label="Archive"].active, .header-nav-link[aria-label="Archive"].active, .sidebar-link[href*="searchtags=shaarli-archive"].active, .sidebar-link[href*="searchtags=shaarli-archiver"].active')||!!document.querySelector('.sidebar-link[aria-label="'+window.ShaarliProI18n.t("Archive")+'"].active, .header-nav-link[aria-label="'+window.ShaarliProI18n.t("Archive")+'"].active'),b=Array.from(document.querySelectorAll(".search-tag-chip")).map(t=>(t.textContent||"").trim().toLowerCase()),y=t=>"shaarli-archive"===t||"shaarli-archiver"===t,v=t=>"note"===t||"shaarli-note"===t||"#note"===t,w=t=>"todo"===t||"shaarli-todo"===t||"#todo"===t,S=n.some(v)||d||b.some(v),E=n.some(w)||c||b.some(w),C=n.some(y)||p||b.some(y),q=document.getElementById("links-list"),I=document.querySelector(".content-container"),x=()=>{try{document.body.classList.remove("view-todo","view-notes","view-archive")}catch(t){}const t=document.querySelector(".content-toolbar");t&&(t.style.display="");const e=document.getElementById("links-list");e&&(e.style.display=""),document.querySelectorAll(".notes-wrapper.todo-wrapper").forEach(t=>t.remove())};window.renderMarkdown=function(t){if(!t)return"";const e=String(t).replace(/\r\n?/g,"\n"),o=t=>String(t).replace(/&/g,"&").replace(//g,">"),n=t=>String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">"),r=t=>{const e=String(t||"").trim();return e&&/^(https?:|mailto:|\/)/i.test(e)?e:""},a=t=>{let e=o(t||"");const a=[];return e=e.replace(/`([^`\n]+)`/g,(t,e)=>{const o=`__MD_CODE_${a.length}__`;return a.push(`${e}`),o}),e=e.replace(/!\[([^\]]*)\]\(([^)]+)\)/g,(t,e,o)=>{const a=r(o);return a?``:t}),e=e.replace(/\[([^\]]+)\]\(([^)]+)\)/g,(t,e,o)=>{const a=r(o);return a?`${e}`:t}),e=e.replace(/\*\*(.+?)\*\*/g,"$1"),e=e.replace(/__(.+?)__/g,"$1"),e=e.replace(/~~(.+?)~~/g,"
$1"),e=e.replace(/\*(.+?)\*/g,"$1"),e=e.replace(/_(.+?)_/g,"$1"),e=e.replace(/<u>([\s\S]*?)<\/u>/g,"$1"),e=e.replace(/__MD_CODE_(\d+)__/g,(t,e)=>a[Number(e)]||""),e},i=e.split("\n"),l=[];let s=!1,d=!1,c=!1,u=!1,m="",p=[];const f=()=>{s&&(l.push(""),s=!1),d&&(l.push(""),d=!1),c&&(l.push(""),c=!1)};if(i.forEach(t=>{const e=t.trim(),r=e.match(/^```\s*([\w-]+)?\s*$/);if(r){if(f(),u){const t=m?` data-lang="${n(m)}"`:"";l.push(`
${o(p.join("\n"))}`),u=!1,m="",p=[]}else u=!0,m=r[1]||"",p=[];return}if(u)return void p.push(t);if(!e)return f(),void l.push('');const i=t.match(/^\s*(#{1,6})\s+(.+)$/);if(i){f();const t=i[1].length;return void l.push(`${a(h[1])}`);const g=t.match(/^\s*[-*]\s+\[( |x|X)\]\s+(.+)$/);if(g){s&&(l.push(""),s=!1),d&&(l.push(""),d=!1),c||(l.push('
${a(t)}
`)}),u){const t=m?` data-lang="${n(m)}"`:"";l.push(`${o(p.join("\n"))}`)}return f(),l.join("")},window.applyKeepNoteFormatting=function(t,e){if(!t||!e)return;const o=t.selectionStart||0,n=t.selectionEnd||0,r=String(t.value||""),a=r.slice(o,n),i=(e,o,n,a="end")=>{const i=r.slice(0,e)+n+r.slice(o);if(t.value=i,t.focus({preventScroll:!0}),"select"===a)t.setSelectionRange(e,e+n.length);else{const o=e+n.length;t.setSelectionRange(o,o)}},l=(e,i)=>{const l=a||"",s=`${e}${l}${i}`,d=r.slice(0,o)+s+r.slice(n);t.value=d;const c=o+e.length,u=c+l.length;t.focus({preventScroll:!0}),t.setSelectionRange(c,u)},s=e=>{const{lineStart:a,lineEnd:i}=(()=>{const t=r.slice(0,o),e=r.slice(n),a=t.lastIndexOf("\n")+1,i=e.indexOf("\n");return{lineStart:a,lineEnd:-1===i?r.length:n+i}})(),l=r.slice(a,i).split(/\r?\n/).map(e).join("\n"),s=r.slice(0,a)+l+r.slice(i);t.value=s,t.focus({preventScroll:!0}),t.setSelectionRange(a,a+l.length)};if("bold"===e)return l("**","**");if("italic"===e)return l("*","*");if("underline"===e)return l("","");if("strike"===e)return l("~~","~~");if("code"===e)return l("`","`");if("link"===e){const e=`[${a||"Texte du lien"}](https://)`;i(o,n,e);const r=o+e.length-1;return void t.setSelectionRange(r,r)}if("image"===e){const e=``;i(o,n,e);const r=o+e.length-1;return void t.setSelectionRange(r,r)}if("quote"===e)return s(t=>t.startsWith("> ")?t:`> ${t}`);if("ul"===e)return s(t=>{const e=t.trim();return e?/^[-*+]\s+/.test(e)?t:`- ${e}`:"- "});if("ol"===e)return s((t,e)=>{const o=t.trim();return o?/^\d+\.\s+/.test(o)?t:`${e+1}. ${o}`:`${e+1}. `});if("todo"===e)return s(t=>{const e=t.trim();return e?/^[-*]\s+\[( |x|X)\]\s+/.test(e)?t:`- [ ] ${e}`:"- [ ] "});if("codeblock"===e){return void i(o,n,`\n\`\`\`\n${a||"code"}\n\`\`\`\n`,"select")}if("h1"===e||"h2"===e||"h3"===e||"p"===e){const t="h1"===e?"# ":"h2"===e?"## ":"h3"===e?"### ":"";return s(e=>{const o=e.replace(/^\s*(#{1,6}\s+)/,"");return t?t+o:o})}if("clear"===e){if(!a)return s(t=>t.replace(/^\s*(#{1,6}\s+)/,"").replace(/^\s*>\s?/,"").replace(/^\s*[-*+]\s+\[( |x|X)\]\s+/,"").replace(/^\s*[-*+]\s+/,"").replace(/^\s*\d+\.\s+/,"").replace(/\*\*(.*?)\*\*/g,"$1").replace(/__(.*?)__/g,"$1").replace(/~~(.*?)~~/g,"$1").replace(/\*(.*?)\*/g,"$1").replace(/_(.*?)_/g,"$1").replace(/`(.*?)`/g,"$1").replace(/(.*?)<\/u>/g,"$1"));const t=a.replace(/\*\*(.*?)\*\*/g,"$1").replace(/__(.*?)__/g,"$1").replace(/~~(.*?)~~/g,"$1").replace(/\*(.*?)\*/g,"$1").replace(/_(.*?)_/g,"$1").replace(/`(.*?)`/g,"$1").replace(/(.*?)<\/u>/g,"$1");i(o,n,t)}};const D=function(){if(V(),window.requestAnimationFrame(k),bt(),q&&I)if(E)try{!function(t,e){document.body.classList.add("view-todo","view-notes");const o=document.querySelector(".content-toolbar");o&&(o.style.display="none");const n=document.createElement("div");n.className="notes-wrapper todo-wrapper";const d=document.createElement("div");d.className="notes-top-bar";const c=document.createElement("div");c.className="note-input-container todo-input-container";const u=()=>{c.classList.remove("is-editing","todo-draft-mode","is-enhanced"),O(c,{color:"default",filter:"none",background:"none",fontColor:"auto"}),c.innerHTML=`\n ${window.ShaarliProI18n.t("Archived notes")}
\n `,r.appendChild(a);const i=document.createElement("div");i.className="notes-tools",i.innerHTML=`\n \n \n `,r.appendChild(i),n.appendChild(r);const l=document.createElement("div");l.className="notes-content-area";const s=Array.from(t.querySelectorAll(".link-outer")),d=s.map(t=>ct(t)).filter(t=>(t.tags||[]).some(t=>"shaarli-archive"===t||"shaarli-archiver"===t));ut(l,d,"grid",!0),n.appendChild(l),t.style.display="none",t.parentNode?t.parentNode.insertBefore(n,t):e.appendChild(n);const c=document.createElement("div");c.className="note-modal-overlay",c.innerHTML=`\n \n `,document.body.appendChild(c);const p=n.querySelector("#btn-view-grid"),f=n.querySelector("#btn-view-list");p.addEventListener("click",()=>{p.classList.add("active"),f.classList.remove("active"),ut(l,d,"grid",!0)}),f.addEventListener("click",()=>{f.classList.add("active"),p.classList.remove("active"),ut(l,d,"list",!0)}),c.querySelector("#note-modal-close").addEventListener("click",()=>{c.classList.remove("open")}),c.addEventListener("click",t=>{t.target===c&&c.classList.remove("open")});const h=c.querySelector("#note-modal-pin"),g=c.querySelector("#note-modal-color-btn"),b=c.querySelector("#note-modal-color-popup");g.addEventListener("click",t=>{t.preventDefault(),t.stopPropagation();const e=c.querySelector(".note-modal");j({anchorEl:g,mode:"modal",entityId:e&&e.dataset.noteId||"",editUrl:e&&e.dataset.editUrl||"",currentColor:e?_(e):"default",currentFilter:e?U(e):"none",currentBackground:e?A(e):"none",currentFontColor:e?T(e):"auto",title:window.ShaarliProI18n.t("My images & colors")})}),h.addEventListener("click",t=>{t.preventDefault(),t.stopPropagation();const e=c.querySelector(".note-modal"),o=e.dataset.noteId,n=e.dataset.editUrl;if(!o||!n)return;yt(o,n,h);const r=h.classList.contains("active");let a=(e.dataset.tags||"").split("||").filter(t=>t);r?a.includes("shaarli-pin")||a.push("shaarli-pin"):a=a.filter(t=>"shaarli-pin"!==t),e.dataset.tags=a.join("||"),pt(c.querySelector("#note-modal-tags"),a),c.currentNote&&(c.currentNote.isPinned=r,c.currentNote.tags=a)}),c.querySelector("#note-modal-delete").addEventListener("click",()=>{if(!confirm(window.ShaarliProI18n.t("Delete this note?")))return;const t=c.querySelector(".note-modal"),e=t.dataset.deleteUrl;t.dataset.noteId;e&&"#"!==e&&m(e).then(()=>{window.location.href="/?searchtags=shaarli-archive"}).catch(t=>{console.error("Delete failed:",t),alert(window.ShaarliProI18n.t("Error deleting."))})}),c.querySelector("#note-modal-unarchive").addEventListener("click",t=>{t.preventDefault();const e=c.querySelector(".note-modal"),o=e.dataset.noteId,n=e.dataset.editUrl;o&&n&&u(n,"shaarli-archive").then(()=>{c.currentNote&&(c.currentNote.tags=(c.currentNote.tags||[]).filter(t=>"shaarli-archive"!==t));const t=document.querySelector(`.note-card[data-id="${o}"]`);t&&t.remove();const e=d.findIndex(t=>String(t.id)===String(o));e>-1&&d.splice(e,1),c.classList.remove("open")}).catch(t=>{console.error("Error unarchiving note:",t),alert(window.ShaarliProI18n.t("Error unarchiving note."))})}),c.addEventListener("click",t=>{t.target.closest(".note-modal-color-picker")||b.classList.remove("open")}),document.addEventListener("click",t=>{t.target.closest(".note-hover-actions .palette-popup")&&!t.target.closest('.note-hover-actions [id^="palette-"]')&&document.querySelectorAll(".note-hover-actions .palette-popup.open").forEach(t=>{t.classList.remove("open")})})}(q,I),f()}catch(t){console.error("[custom_views] Erreur lors de l'initialisation de la vue Archive:",t),x()}else f()};!function(){if(N)return;const t=document.documentElement;if(!t)return;let e=P();new MutationObserver(t=>{if(!t.some(t=>"data-theme"===t.attributeName))return;const o=P();o!==e&&(e=o,document.querySelectorAll(".note-card, .note-modal, .link-outer, .note-input-container").forEach(t=>{O(t,{color:_(t),filter:U(t),background:A(t),fontColor:T(t)})}),function(){document.querySelectorAll(".note-card").forEach(t=>{const e=t.querySelector(".note-hover-actions .palette-popup");if(!e)return;const o=t.dataset.id||"";if(!o)return;const n=t.querySelector('.note-hover-actions a[href*="/admin/shaare/"], .note-hover-actions a[href*="do=editlink"], .note-hover-actions a[title="Edit"]');var r;e.innerHTML=G({entityId:(r={id:o,editUrl:n&&n.href?n.href:"#",color:_(t),background:A(t)})&&r.id?r.id:"",editUrl:r&&r.editUrl?r.editUrl:"",currentColor:r&&r.color?r.color:"default",currentFilter:r&&r.filter?r.filter:"none",mode:"entity"})}),document.querySelectorAll(".link-outer").forEach(t=>{const e=t.querySelector(".bookmark-palette .palette-popup");if(!e)return;const o=t.dataset.id||t.getAttribute("data-id")||t.id;if(!o)return;const n=t.querySelector(".link-actions"),r=n?n.querySelector(`a[title="${window.ShaarliProI18n.t("Edit")}"], a[href*="/admin/shaare/"]`):null;e.innerHTML=X(o,r&&r.href?r.href:"#",_(t),A(t))});const t=h(),e=g(t);if(!t||!e)return;const o=t.querySelector(".note-modal");o&&(e.color=_(o),e.background=A(o));const n=t.querySelector(".note-modal-palette");n&&(n.innerHTML=ht(e))}())}).observe(t,{attributes:!0,attributeFilter:["data-theme"]}),N=!0}(),$().then(()=>{D()}).catch(t=>{console.error("Erreur lors du chargement des backgrounds:",t),D()})});const o=[{key:"default",label:window.ShaarliProI18n.t("Default"),light:"#f8fafc",dark:"#20293A"},{key:"red",label:window.ShaarliProI18n.t("Red"),light:"#f28b82",dark:"#9c2116"},{key:"orange",label:window.ShaarliProI18n.t("Orange"),light:"#fbbc04",dark:"#9c7a16"},{key:"yellow",label:window.ShaarliProI18n.t("Yellow"),light:"#fff475",dark:"#9c9116"},{key:"green",label:window.ShaarliProI18n.t("Green"),light:"#ccff90",dark:"#5e9c16"},{key:"teal",label:window.ShaarliProI18n.t("Mint"),light:"#a7ffeb",dark:"#169c7d"},{key:"blue",label:window.ShaarliProI18n.t("Light blue"),light:"#cbf0f8",dark:"#16849c"},{key:"darkblue",label:window.ShaarliProI18n.t("Blue"),light:"#aecbfa",dark:"#16499c"},{key:"purple",label:window.ShaarliProI18n.t("Purple"),light:"#d7aefb",dark:"#5d169c"},{key:"pink",label:window.ShaarliProI18n.t("Pink"),light:"#fdcfe8",dark:"#9c165f"},{key:"brown",label:window.ShaarliProI18n.t("Beige"),light:"#e6c9a8",dark:"#9c5d16"},{key:"grey",label:window.ShaarliProI18n.t("Gray"),light:"#e8eaed",dark:"#4e5764"},{key:"custom",label:window.ShaarliProI18n.t("Custom"),light:"#custom",dark:"#custom"}],n=[{key:"none",label:window.ShaarliProI18n.t("None"),icon:"mdi-close-circle-outline"},{key:"glass",label:window.ShaarliProI18n.t("Glass"),icon:"mdi-blur"},{key:"vignette",label:window.ShaarliProI18n.t("Vignette"),icon:"mdi-vignette"},{key:"lined",label:window.ShaarliProI18n.t("Lined"),icon:"mdi-format-align-justify"},{key:"grid",label:window.ShaarliProI18n.t("Grid"),icon:"mdi-grid"},{key:"noise",label:window.ShaarliProI18n.t("Noise"),icon:"mdi-grain"},{key:"dots",label:window.ShaarliProI18n.t("Dots"),icon:"mdi-dots-grid"},{key:"stripes",label:window.ShaarliProI18n.t("Stripes"),icon:"mdi-slash-forward"}],r=[{key:"auto",label:window.ShaarliProI18n.t("Auto"),value:"auto"},{key:"light",label:window.ShaarliProI18n.t("Light"),value:"#f5f7fb"},{key:"dark",label:window.ShaarliProI18n.t("Dark"),value:"#202124"},{key:"white",label:window.ShaarliProI18n.t("White"),value:"#ffffff"},{key:"black",label:window.ShaarliProI18n.t("Black"),value:"#000000"},{key:"custom",label:window.ShaarliProI18n.t("Custom"),value:"custom"}],a="font-",i="note-color-",l="notefilter-",s="notebg-";function d(t){if("string"!=typeof t)return!1;const e=t.trim().toLowerCase();if(!e)return!1;if("note"===e||"#note"===e)return!0;if("shaarli-note"===e)return!0;if("todo"===e||"#todo"===e)return!0;if("shaarli-todo"===e)return!0;if("shaarli-pin"===e)return!0;if("brain-dump"===e)return!0;if(e.startsWith(a))return!0;if(e.startsWith(i))return!0;if(e.startsWith(l))return!0;if(e.startsWith(s))return!0;if(e.startsWith("notefilter-"))return!0;if(e.startsWith("notebg-"))return!0;if(e.startsWith("note-color-"))return!0;if(e.startsWith("note-")){const t=e.substring(5);if(o.some(e=>e.key===t))return!0}return!1}function c({tag:t,onRemoveClass:e="tag-remove-btn",tagClass:o="tag-pill"}){const n=document.createElement("span");n.className=o,n.dataset.tag=t;const r=document.createElement("span");r.className=`${o}-text`,r.textContent=t,n.appendChild(r);if(!(!arguments[0]||!Object.prototype.hasOwnProperty.call(arguments[0],"canRemove")||!!arguments[0].canRemove))return n;const a=document.createElement("button");return a.type="button",a.className=e,a.dataset.tag=t,a.setAttribute("aria-label",`Supprimer le tag ${t}`),a.title=window.ShaarliProI18n.t("Delete"),a.innerHTML="×",n.appendChild(a),n}function u(t,e){return fetch(t).then(t=>t.text()).then(t=>{const o=(new DOMParser).parseFromString(t,"text/html").querySelector('form[name="linkform"]');if(!o)throw new Error("Could not find edit form");const n=new URLSearchParams;o.querySelectorAll("input, textarea").forEach(t=>{"checkbox"===t.type?t.checked&&n.append(t.name,t.value||"on"):t.name&&n.append(t.name,Y(t))});let r=(n.get("lf_tags")||"").split(/[\s,]+/).filter(t=>""!==t.trim());return r=r.filter(t=>t!==e),n.set("lf_tags",r.join(" ")),n.append("save_edit","1"),fetch(o.action,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:n.toString()})}).then(t=>{if(!t.ok)throw new Error("Failed to update tags");return t})}function m(t){return t&&"#"!==t?fetch(t).then(t=>{if(!t.ok)throw new Error("Delete request failed");return t}):Promise.reject("Invalid delete URL")}let p=!1;function f(){p||(document.querySelectorAll(".link-tag-list .link-tag").forEach(t=>{const e=(t.dataset.tag||t.textContent||"").trim();e&&("shaarli-pin"!==e?d(e)&&t.classList.add("is-tech-tag"):t.classList.add("is-tech-tag"))}),document.addEventListener("click",function(t){const e=t.target.closest(".tag-remove-btn, .note-tag-remove-btn");if(!e)return;t.preventDefault(),t.stopPropagation();const o=(e.dataset.tag||"").trim();if(!o)return;const n=e.closest(".link-tag, .note-tag"),r=e.closest(".link-outer, .note-card, .note-modal");let a="";if(r&&r.classList.contains("note-card"))a=r.dataset.editUrl||"";else if(r&&r.classList.contains("note-modal"))a=r.dataset.editUrl||"";else{const t=r?r.querySelector(".link-actions"):null,e=t?t.querySelector('a[href*="admin/shaare"]'):null;a=e?e.href:""}a&&u(a,o).then(()=>{if(n&&n.remove(),r&&r.classList.contains("note-card")){let t=(r.dataset.tags||"").split("||").filter(t=>t);t=t.filter(t=>t!==o),r.dataset.tags=t.join("||");const e=h(),n=g(e);if(e&&n&&String(n.id)===String(r.dataset.id)){n.tags=(n.tags||[]).filter(t=>t!==o);pt(e.querySelector(".note-modal-tags"),n.tags)}}if(r&&r.classList.contains("note-modal")){let t=(r.dataset.tags||"").split("||").filter(t=>t);t=t.filter(t=>t!==o),r.dataset.tags=t.join("||");const e=h(),n=g(e);if(e&&n){n.tags=(n.tags||[]).filter(t=>t!==o);pt(e.querySelector(".note-modal-tags"),n.tags)}const a=r.dataset.noteId||r.dataset.todoId||(n&&n.id?String(n.id):""),i=a?document.querySelector(`.note-card[data-id="${a}"]`):null;if(i){const t=i.querySelector(`.note-tag[data-tag="${CSS.escape(o)}"]`);t&&t.remove();let e=(i.dataset.tags||"").split("||").filter(t=>t);e=e.filter(t=>t!==o),i.dataset.tags=e.join("||")}}}).catch(t=>{console.error("Error removing tag:",t),alert(window.ShaarliProI18n.t("Error removing tag."))})}),p=!0)}function h(){return document.querySelector(".note-modal-overlay.open")}function g(t){return t&&(t.currentTodo||t.currentNote)||null}const b=`${function(){const t=Array.from(document.querySelectorAll('link[rel="stylesheet"]')).find(t=>t.href&&(t.href.includes("/custom_views.css")||t.href.includes("/custom_views.min.css")));if(t&&t.href){const e=new URL(t.href,window.location.origin).pathname.replace(/\/(css|dist)\/custom_views(\.min)?\.css$/,"");if(e)return e}const e=Array.from(document.querySelectorAll("script[src]")).find(t=>t.src&&(t.src.includes("/custom_views.js")||t.src.includes("/custom_views.min.js")));if(e&&e.src){const t=new URL(e.src,window.location.origin).pathname.replace(/\/(js|dist)\/custom_views(\.min)?\.js$/,"");if(t)return t}return window.shaarli&&"string"==typeof window.shaarli.assetPath&&""!==window.shaarli.assetPath.trim()?window.shaarli.assetPath.replace(/\/$/,""):"/tpl/shaarli-pro"}().replace(/\/$/,"")}/img`;let y=[],v=!1,w=null;function k(){const t=document.getElementById("links-list");if(!t)return;const e=t.querySelector(".pinned-section-head"),o=t.querySelector(".normal-section-head"),n=t.querySelector(".compact-table-head");if(!e||!o||!n)return;const r=Array.from(t.getElementsByClassName("link-outer"));if(!r.length)return;const a=t=>{if(t.classList.contains("is-sticky")||t.classList.contains("is-pinned-tag"))return!0;const e=t.querySelectorAll(".link-tag-list a, .link-tag-list .link-tag-link, .note-tag");for(const t of e){if("shaarli-pin"===(t.textContent||"").trim().toLowerCase())return!0}return!1},i=r.filter(t=>a(t)),l=r.filter(t=>!a(t));t.classList.toggle("has-pinned",i.length>0),t.classList.toggle("has-normal",l.length>0);const s=document.createDocumentFragment();s.appendChild(e),i.forEach(t=>s.appendChild(t)),s.appendChild(o),s.appendChild(n),l.forEach(t=>s.appendChild(t)),t.replaceChildren(s)}window.__shaarliCustomViewsVersion="1.0.5-inline-bg-manifest","undefined"!=typeof console&&console&&console.info,document.addEventListener("DOMContentLoaded",function(){const t=document.getElementById("links-list");if(!t)return;k(),["view-grid-btn","view-list-btn","view-compact-btn"].forEach(t=>{const e=document.getElementById(t);e&&e.addEventListener("click",()=>{window.requestAnimationFrame(k)})}),t.addEventListener("click",t=>{t.target.closest('a[href*="/pin?token="]')&&window.setTimeout(()=>{window.location.reload()},500)})});const S=[{key:"cafe",label:window.ShaarliProI18n.t("Coffee"),files:{light:"bg-light-cafe.jpg",dark:"bg-dark-cafe.jpg"}},{key:"codes",label:"Codes",files:{light:"bg-light-codes.jpg",dark:"bg-dark-codes.jpg"}},{key:"dune",label:"Dune",files:{light:"bg-light-dune.jpg",dark:"bg-dark-dune.jpg"}},{key:"feuille-ligne",label:"Feuille Ligne",files:{light:"bg-light-feuilleLigne.jpg",dark:"bg-dark-feuilleLigne.jpg"}},{key:"feuille-quadrillage",label:"Feuille Quadrillage",files:{light:"bg-light-feuilleQuadrille.jpg",dark:"bg-dark-feuilleQuadrille.jpg"}},{key:"fleurs",label:"Fleurs",files:{light:"bg-light-fleurs.jpg",dark:"bg-dark-fleurs.jpg"}},{key:"foret",label:window.ShaarliProI18n.t("Forest"),files:{light:"bg-light-foret.jpg",dark:"bg-dark-foret.jpg"}},{key:"grid",label:"Grid",files:{light:"bg-light-grid.jpg",dark:"bg-dark-grid.jpg"}},{key:"journal",label:"Journal",files:{light:"bg-light-journal.jpg",dark:"bg-dark-journal.jpg"}},{key:"lecture",label:"Lecture",files:{light:"bg-light-lecture.jpg",dark:"bg-dark-lecture.jpg"}},{key:"legumes",label:window.ShaarliProI18n.t("Vegetables"),files:{light:"bg-light-legumes.jpg",dark:"bg-dark-legumes.jpg"}},{key:"montagnes",label:"Montagnes",files:{light:"bg-light-montagnes.jpg",dark:"bg-dark-montagnes.jpg"}},{key:"ocean",label:window.ShaarliProI18n.t("Ocean"),files:{light:"bg-light-ocean.jpg",dark:"bg-dark-ocean.jpg"}},{key:"radio",label:"Radio",files:{light:"bg-light-radio.jpg",dark:"bg-dark-radio.jpg"}},{key:"sports",label:"Sports",files:{light:"bg-light-sports.jpg",dark:"bg-dark-sports.jpg"}},{key:"vague1",label:"Vague 1",files:{light:"bg-light-vague1.jpg",dark:"bg-dark-vague1.jpg"}},{key:"vague2",label:"Vague 2",files:{light:"bg-light-vague2.jpg",dark:"bg-dark-vague2.jpg"}},{key:"ville",label:"Ville",files:{light:"bg-light-ville.jpg",dark:"bg-dark-ville.jpg"}},{key:"voyage",label:"Voyage",files:{light:"bg-light-voyage.jpg",dark:"bg-dark-voyage.jpg"}}];function $(){return v?Promise.resolve(y):w||(y=function(t){const e=Array.isArray(t)?t:t&&Array.isArray(t.backgrounds)?t.backgrounds:[],o={};return e.forEach(t=>{if(!t||"object"!=typeof t)return;const e=L("string"==typeof t.key?t.key:t.label||"");if(!e)return;const n=t.files&&"object"==typeof t.files?t.files:{},r="string"==typeof n.light?n.light.trim():"",a="string"==typeof n.dark?n.dark.trim():"";(r||a)&&(o[e]||(o[e]={key:e,label:E(t.label||"",e),paths:{light:"",dark:""}}),r&&(o[e].paths.light=`note-bg-light/${r}`),a&&(o[e].paths.dark=`note-bg-dark/${a}`))}),Object.values(o).sort((t,e)=>t.label.localeCompare(e.label,"fr",{sensitivity:"base"}))}(S),v=!0,w=Promise.resolve(y),w)}function L(t){return"string"!=typeof t?"":t.trim().toLowerCase().replace(/[\s_]+/g,"-").replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}function E(t,e){return("string"==typeof t&&""!==t.trim()?t:e).replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/\s+/g," ").trim().split(" ").filter(t=>""!==t).map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function P(){return"dark"===document.documentElement.getAttribute("data-theme")?"dark":"light"}function C(t,e=P()){if(!t||"object"!=typeof t)return"";const o="dark"===e?"dark":"light",n="string"==typeof t[o]?t[o].trim():"",r="string"==typeof t.light?t.light.trim():"",a="string"==typeof t.dark?t.dark.trim():"";return n||r||a}function q(t,e=P()){const o=function(t){if("string"!=typeof t)return null;const e=t.trim(),o=/^#([0-9a-f]{3})$/i.exec(e);if(o)return{r:parseInt(o[1].charAt(0).repeat(2),16),g:parseInt(o[1].charAt(1).repeat(2),16),b:parseInt(o[1].charAt(2).repeat(2),16)};const n=/^#([0-9a-f]{6})$/i.exec(e);return n?{r:parseInt(n[1].slice(0,2),16),g:parseInt(n[1].slice(2,4),16),b:parseInt(n[1].slice(4,6),16)}:null}(t);if(!o)return"dark"===e?"#e8eaed":"#202124";return(.299*o.r+.587*o.g+.114*o.b)/255>.56?"#202124":"#f5f7fb"}function I(t=P()){const e="dark"===t?"dark":"light";return y.filter(t=>t.paths&&t.paths[e])}function x(t,e=P()){const o=L(t);if(!o)return"";const n=y.find(t=>t.key===o);if(!n||!n.paths)return"";const r="dark"===e?"dark":"light",a=n.paths[r]||"";return a?`${b}/${a}`:""}function _(t){if(!t)return"default";if("custom"===t.dataset.color&&t.dataset.customColor)return`custom:${t.dataset.customColor}`;const e=Array.from(t.classList).find(t=>t.startsWith("note-color-"));return e?e.replace("note-color-",""):t.dataset.color||"default"}function A(t){if(!t)return"none";return L(t.dataset.background||"")||"none"}function M(t){if("string"!=typeof t)return"none";const e=t.trim().toLowerCase();return n.some(t=>t.key===e)?e:"none"}function U(t){return t?M(t.dataset.filter||""):"none"}function T(t){return t&&t.dataset.fontColor||"auto"}let N=!1;function D(t){if(!t||!t.classList.contains("open"))return;t.classList.remove("open-down"),t.style.left="",t.style.right="";if(t.getBoundingClientRect().top<8){t.classList.add("open-down");t.getBoundingClientRect().bottom>window.innerHeight-8&&t.classList.remove("open-down")}let e=t.getBoundingClientRect();e.right>window.innerWidth-8&&(t.style.left="auto",t.style.right="0",e=t.getBoundingClientRect()),e.left<8&&(t.style.left="0",t.style.right="auto")}let F=!1;function H(){const t=document.getElementById("shaarli-bg-studio");t&&(t.classList.remove("open"),t.style.display="none",t.setAttribute("aria-hidden","true"),t.__anchorEl=null)}function j({anchorEl:t,mode:e,entityId:o,editUrl:n,currentColor:r,currentFilter:a,currentBackground:i,currentFontColor:l,title:s}){!function(){if(F)return;if(document.getElementById("shaarli-bg-studio"))return void(F=!0);const t=document.createElement("div");t.id="shaarli-bg-studio",t.className="bg-studio-panel",t.setAttribute("role","dialog"),t.setAttribute("aria-modal","false"),t.setAttribute("aria-hidden","true"),t.style.display="none",document.body.appendChild(t),t.addEventListener("click",t=>{const e=t.target.closest("button[data-bg-studio-action]");if(!e)return;const o=document.getElementById("shaarli-bg-studio");if(!o)return;const n=o.dataset.mode||"entity",r=o.dataset.entityId||"",a=o.dataset.editUrl||"",i=t=>{"function"==typeof o.__draftApply&&o.__draftApply(t)},l=e.dataset.bgStudioAction;if("close"!==l){if("set-color"===l){const t=e.dataset.colorKey||"default";return void("draft"===n?(o.dataset.color=t,i({color:t}),R(o)):"modal"===n?(setModalNoteColor(t),o.dataset.color=t,R(o)):(setNoteColor(r,t,a),o.dataset.color=t,R(o)))}if("set-background"===l){const t=e.dataset.bgKey||"none";return void("draft"===n?(o.dataset.background=t,i({background:t}),R(o)):"modal"===n?(setModalNoteBackground(t),o.dataset.background=t,R(o)):(setNoteBackground(r,t,a),o.dataset.background=t,R(o)))}if("set-filter"===l){const t=e.dataset.filter||"none",l=M(t||"")||"none";return void("draft"===n?(o.dataset.filter=l,i({filter:l}),R(o)):"modal"===n?(setModalNoteFilter(t),o.dataset.filter=l,R(o)):(setNoteFilter(r,t,a),o.dataset.filter=l,R(o)))}if("set-query"===l){o.dataset.query="",R(o);const t=o.querySelector(".bg-studio-search-input");return void(t&&t.focus())}if("set-defaults"!==l)if("reset-font-color"!==l)if("open-color-picker"!==l)if("open-font-color-picker"!==l){if("set-font-color"===l){const t=e.dataset.fontColorKey||"auto";return void("draft"===n?(o.dataset.fontColor=t,i({fontColor:t}),R(o)):"modal"===n?(Ct(t),o.dataset.fontColor=t,R(o)):(Pt(r,t,a),o.dataset.fontColor=t,R(o)))}}else kt({mode:n,entityId:r,editUrl:a,type:"font"});else kt({mode:n,entityId:r,editUrl:a,type:"background"});else"draft"===n?(o.dataset.fontColor="auto",i({fontColor:"auto"}),R(o)):"modal"===n?(Ct("auto"),o.dataset.fontColor="auto",R(o)):(Pt(r,"auto",a),o.dataset.fontColor="auto",R(o));else"draft"===n?(o.dataset.color="default",o.dataset.background="none",i({color:"default",background:"none"}),R(o)):"modal"===n?(setModalNoteColor("default"),o.dataset.color="default",o.dataset.background="none",R(o)):(setNoteColor(r,"default",a),o.dataset.color="default",o.dataset.background="none",R(o))}else H()}),t.addEventListener("keydown",e=>{const o=e.target&&e.target.closest?e.target.closest("button"):null;if(!o)return;if("Enter"===e.key||" "===e.key)return void((o.hasAttribute("data-bg-studio-action")||o.classList.contains("bg-studio-thumb")||o.classList.contains("bg-studio-swatch"))&&(e.preventDefault(),o.click()));const n=(t,e)=>{if(!t||0===t.length)return;const o=t[Math.max(0,Math.min(t.length-1,e))];o&&"function"==typeof o.focus&&o.focus()};if(o.classList.contains("bg-studio-thumb")){const r=Array.from(t.querySelectorAll(".bg-studio-gallery .bg-studio-thumb")),a=r.indexOf(o);if(-1===a)return;const i=2;return void("ArrowRight"===e.key?(e.preventDefault(),n(r,a+i)):"ArrowLeft"===e.key?(e.preventDefault(),n(r,a-i)):"ArrowDown"===e.key?(e.preventDefault(),n(r,a+1)):"ArrowUp"===e.key&&(e.preventDefault(),n(r,a-1)))}if(o.classList.contains("bg-studio-swatch")){const r=Array.from(t.querySelectorAll(".bg-studio-swatches .bg-studio-swatch")),a=r.indexOf(o);if(-1===a)return;return void("ArrowRight"===e.key?(e.preventDefault(),n(r,a+1)):"ArrowLeft"===e.key&&(e.preventDefault(),n(r,a-1)))}}),t.addEventListener("input",t=>{const e=t.target&&t.target.matches(".bg-studio-search-input")?t.target:null;if(!e)return;const o=document.getElementById("shaarli-bg-studio");o&&(o.dataset.query=e.value||"",window.clearTimeout(o.__searchTimer),o.__searchTimer=window.setTimeout(()=>{R(o)},150))}),F=!0}();const d=document.getElementById("shaarli-bg-studio");d&&(d.dataset.mode=e||"entity",d.dataset.entityId=o||"",d.dataset.editUrl=n||"",d.dataset.color=r||"default",d.dataset.filter=M(a||"")||"none",d.dataset.background=L(i||"")||"none",d.dataset.fontColor=l||d.dataset.fontColor||"auto",d.dataset.query=d.dataset.query||"",d.dataset.title=s||window.ShaarliProI18n.t("My images & colors"),d.__anchorEl=t||null,R(d),d.style.display="block",d.classList.add("open"),d.setAttribute("aria-hidden","false"),function(t,e){if(!t)return;const o=12,n=e&&e.getBoundingClientRect?e.getBoundingClientRect():null;t.style.left="",t.style.top="",t.style.right="",t.style.bottom="";const r=t.getBoundingClientRect(),a=n?n.top-r.height-10:o,i=n?n.left:o;let l=a;l${e}`),o}),e=e.replace(/!\[([^\]]*)\]\(([^)]+)\)/g,(t,e,o)=>{const a=r(o);return a?`${o(p.join("\n"))}`),u=!1,m="",p=[]}else u=!0,m=r[1]||"",p=[];return}if(u)return void p.push(t);if(!e)return f(),void l.push('');const i=t.match(/^\s*(#{1,6})\s+(.+)$/);if(i){f();const t=i[1].length;return void l.push(`${a(h[1])}`);const g=t.match(/^\s*[-*]\s+\[( |x|X)\]\s+(.+)$/);if(g){s&&(l.push(""),s=!1),d&&(l.push(""),d=!1),c||(l.push('
${a(t)}
`)}),u){const t=m?` data-lang="${n(m)}"`:"";l.push(`${o(p.join("\n"))}`)}return f(),l.join("")},window.applyKeepNoteFormatting=function(t,e){if(!t||!e)return;const o=t.selectionStart||0,n=t.selectionEnd||0,r=String(t.value||""),a=r.slice(o,n),i=(e,o,n,a="end")=>{const i=r.slice(0,e)+n+r.slice(o);if(t.value=i,t.focus({preventScroll:!0}),"select"===a)t.setSelectionRange(e,e+n.length);else{const o=e+n.length;t.setSelectionRange(o,o)}},l=(e,i)=>{const l=a||"",s=`${e}${l}${i}`,d=r.slice(0,o)+s+r.slice(n);t.value=d;const c=o+e.length,u=c+l.length;t.focus({preventScroll:!0}),t.setSelectionRange(c,u)},s=e=>{const{lineStart:a,lineEnd:i}=(()=>{const t=r.slice(0,o),e=r.slice(n),a=t.lastIndexOf("\n")+1,i=e.indexOf("\n");return{lineStart:a,lineEnd:-1===i?r.length:n+i}})(),l=r.slice(a,i).split(/\r?\n/).map(e).join("\n"),s=r.slice(0,a)+l+r.slice(i);t.value=s,t.focus({preventScroll:!0}),t.setSelectionRange(a,a+l.length)};if("bold"===e)return l("**","**");if("italic"===e)return l("*","*");if("underline"===e)return l("","");if("strike"===e)return l("~~","~~");if("code"===e)return l("`","`");if("link"===e){const e=`[${a||"Texte du lien"}](https://)`;i(o,n,e);const r=o+e.length-1;return void t.setSelectionRange(r,r)}if("image"===e){const e=``;i(o,n,e);const r=o+e.length-1;return void t.setSelectionRange(r,r)}if("quote"===e)return s(t=>t.startsWith("> ")?t:`> ${t}`);if("ul"===e)return s(t=>{const e=t.trim();return e?/^[-*+]\s+/.test(e)?t:`- ${e}`:"- "});if("ol"===e)return s((t,e)=>{const o=t.trim();return o?/^\d+\.\s+/.test(o)?t:`${e+1}. ${o}`:`${e+1}. `});if("todo"===e)return s(t=>{const e=t.trim();return e?/^[-*]\s+\[( |x|X)\]\s+/.test(e)?t:`- [ ] ${e}`:"- [ ] "});if("codeblock"===e){return void i(o,n,`\n\`\`\`\n${a||"code"}\n\`\`\`\n`,"select")}if("h1"===e||"h2"===e||"h3"===e||"p"===e){const t="h1"===e?"# ":"h2"===e?"## ":"h3"===e?"### ":"";return s(e=>{const o=e.replace(/^\s*(#{1,6}\s+)/,"");return t?t+o:o})}if("clear"===e){if(!a)return s(t=>t.replace(/^\s*(#{1,6}\s+)/,"").replace(/^\s*>\s?/,"").replace(/^\s*[-*+]\s+\[( |x|X)\]\s+/,"").replace(/^\s*[-*+]\s+/,"").replace(/^\s*\d+\.\s+/,"").replace(/\*\*(.*?)\*\*/g,"$1").replace(/__(.*?)__/g,"$1").replace(/~~(.*?)~~/g,"$1").replace(/\*(.*?)\*/g,"$1").replace(/_(.*?)_/g,"$1").replace(/`(.*?)`/g,"$1").replace(/(.*?)<\/u>/g,"$1"));const t=a.replace(/\*\*(.*?)\*\*/g,"$1").replace(/__(.*?)__/g,"$1").replace(/~~(.*?)~~/g,"$1").replace(/\*(.*?)\*/g,"$1").replace(/_(.*?)_/g,"$1").replace(/`(.*?)`/g,"$1").replace(/(.*?)<\/u>/g,"$1");i(o,n,t)}};const D=function(){if(V(),window.requestAnimationFrame(k),bt(),q&&I)if(E)try{!function(t,e){document.body.classList.add("view-todo","view-notes");const o=document.querySelector(".content-toolbar");o&&(o.style.display="none");const n=document.createElement("div");n.className="notes-wrapper todo-wrapper";const d=document.createElement("div");d.className="notes-top-bar";const c=document.createElement("div");c.className="note-input-container todo-input-container";const u=()=>{c.classList.remove("is-editing","todo-draft-mode","is-enhanced"),O(c,{color:"default",filter:"none",background:"none",fontColor:"auto"}),c.innerHTML=`\n ${window.ShaarliProI18n.t("Archived notes")}
\n `,r.appendChild(a);const i=document.createElement("div");i.className="notes-tools",i.innerHTML=`\n \n \n `,r.appendChild(i),n.appendChild(r);const l=document.createElement("div");l.className="notes-content-area";const s=Array.from(t.querySelectorAll(".link-outer")),d=s.map(t=>ct(t)).filter(t=>(t.tags||[]).some(t=>"shaarli-archive"===t||"shaarli-archiver"===t));ut(l,d,"grid",!0),n.appendChild(l),t.style.display="none",t.parentNode?t.parentNode.insertBefore(n,t):e.appendChild(n);const c=document.createElement("div");c.className="note-modal-overlay",c.innerHTML=`\n \n `,document.body.appendChild(c);const p=n.querySelector("#btn-view-grid"),f=n.querySelector("#btn-view-list");p.addEventListener("click",()=>{p.classList.add("active"),f.classList.remove("active"),ut(l,d,"grid",!0)}),f.addEventListener("click",()=>{f.classList.add("active"),p.classList.remove("active"),ut(l,d,"list",!0)}),c.querySelector("#note-modal-close").addEventListener("click",()=>{c.classList.remove("open")}),c.addEventListener("click",t=>{t.target===c&&c.classList.remove("open")});const h=c.querySelector("#note-modal-pin"),g=c.querySelector("#note-modal-color-btn"),b=c.querySelector("#note-modal-color-popup");g.addEventListener("click",t=>{t.preventDefault(),t.stopPropagation();const e=c.querySelector(".note-modal");j({anchorEl:g,mode:"modal",entityId:e&&e.dataset.noteId||"",editUrl:e&&e.dataset.editUrl||"",currentColor:e?_(e):"default",currentFilter:e?U(e):"none",currentBackground:e?A(e):"none",currentFontColor:e?T(e):"auto",title:window.ShaarliProI18n.t("My images & colors")})}),h.addEventListener("click",t=>{t.preventDefault(),t.stopPropagation();const e=c.querySelector(".note-modal"),o=e.dataset.noteId,n=e.dataset.editUrl;if(!o||!n)return;yt(o,n,h);const r=h.classList.contains("active");let a=(e.dataset.tags||"").split("||").filter(t=>t);r?a.includes("shaarli-pin")||a.push("shaarli-pin"):a=a.filter(t=>"shaarli-pin"!==t),e.dataset.tags=a.join("||"),pt(c.querySelector("#note-modal-tags"),a),c.currentNote&&(c.currentNote.isPinned=r,c.currentNote.tags=a)}),c.querySelector("#note-modal-delete").addEventListener("click",()=>{if(!confirm(window.ShaarliProI18n.t("Delete this note?")))return;const t=c.querySelector(".note-modal"),e=t.dataset.deleteUrl;t.dataset.noteId;e&&"#"!==e&&m(e).then(()=>{window.location.href="/?searchtags=shaarli-archive"}).catch(t=>{console.error("Delete failed:",t),alert(window.ShaarliProI18n.t("Error deleting."))})}),c.querySelector("#note-modal-unarchive").addEventListener("click",t=>{t.preventDefault();const e=c.querySelector(".note-modal"),o=e.dataset.noteId,n=e.dataset.editUrl;o&&n&&u(n,"shaarli-archive").then(()=>{c.currentNote&&(c.currentNote.tags=(c.currentNote.tags||[]).filter(t=>"shaarli-archive"!==t));const t=document.querySelector(`.note-card[data-id="${o}"]`);t&&t.remove();const e=d.findIndex(t=>String(t.id)===String(o));e>-1&&d.splice(e,1),c.classList.remove("open")}).catch(t=>{console.error("Error unarchiving note:",t),alert(window.ShaarliProI18n.t("Error unarchiving note."))})}),c.addEventListener("click",t=>{t.target.closest(".note-modal-color-picker")||b.classList.remove("open")}),document.addEventListener("click",t=>{t.target.closest(".note-hover-actions .palette-popup")&&!t.target.closest('.note-hover-actions [id^="palette-"]')&&document.querySelectorAll(".note-hover-actions .palette-popup.open").forEach(t=>{t.classList.remove("open")})})}(q,I),f()}catch(t){console.error("[custom_views] Erreur lors de l'initialisation de la vue Archive:",t),x()}else f()};!function(){if(N)return;const t=document.documentElement;if(!t)return;let e=P();new MutationObserver(t=>{if(!t.some(t=>"data-theme"===t.attributeName))return;const o=P();o!==e&&(e=o,document.querySelectorAll(".note-card, .note-modal, .link-outer, .note-input-container").forEach(t=>{O(t,{color:_(t),filter:U(t),background:A(t),fontColor:T(t)})}),function(){document.querySelectorAll(".note-card").forEach(t=>{const e=t.querySelector(".note-hover-actions .palette-popup");if(!e)return;const o=t.dataset.id||"";if(!o)return;const n=t.querySelector('.note-hover-actions a[href*="/admin/shaare/"], .note-hover-actions a[href*="do=editlink"], .note-hover-actions a[title="Edit"]');var r;e.innerHTML=G({entityId:(r={id:o,editUrl:n&&n.href?n.href:"#",color:_(t),background:A(t)})&&r.id?r.id:"",editUrl:r&&r.editUrl?r.editUrl:"",currentColor:r&&r.color?r.color:"default",currentFilter:r&&r.filter?r.filter:"none",mode:"entity"})}),document.querySelectorAll(".link-outer").forEach(t=>{const e=t.querySelector(".bookmark-palette .palette-popup");if(!e)return;const o=t.dataset.id||t.getAttribute("data-id")||t.id;if(!o)return;const n=t.querySelector(".link-actions"),r=n?n.querySelector(`a[title="${window.ShaarliProI18n.t("Edit")}"], a[href*="/admin/shaare/"]`):null;e.innerHTML=X(o,r&&r.href?r.href:"#",_(t),A(t))});const t=h(),e=g(t);if(!t||!e)return;const o=t.querySelector(".note-modal");o&&(e.color=_(o),e.background=A(o));const n=t.querySelector(".note-modal-palette");n&&(n.innerHTML=ht(e))}())}).observe(t,{attributes:!0,attributeFilter:["data-theme"]}),N=!0}(),$().then(()=>{D()}).catch(t=>{console.error("Erreur lors du chargement des backgrounds:",t),D()})});const o=[{key:"default",label:window.ShaarliProI18n.t("Default"),light:"#f8fafc",dark:"#20293A"},{key:"red",label:window.ShaarliProI18n.t("Red"),light:"#f28b82",dark:"#9c2116"},{key:"orange",label:window.ShaarliProI18n.t("Orange"),light:"#fbbc04",dark:"#9c7a16"},{key:"yellow",label:window.ShaarliProI18n.t("Yellow"),light:"#fff475",dark:"#9c9116"},{key:"green",label:window.ShaarliProI18n.t("Green"),light:"#ccff90",dark:"#5e9c16"},{key:"teal",label:window.ShaarliProI18n.t("Mint"),light:"#a7ffeb",dark:"#169c7d"},{key:"blue",label:window.ShaarliProI18n.t("Light blue"),light:"#cbf0f8",dark:"#16849c"},{key:"darkblue",label:window.ShaarliProI18n.t("Blue"),light:"#aecbfa",dark:"#16499c"},{key:"purple",label:window.ShaarliProI18n.t("Purple"),light:"#d7aefb",dark:"#5d169c"},{key:"pink",label:window.ShaarliProI18n.t("Pink"),light:"#fdcfe8",dark:"#9c165f"},{key:"brown",label:window.ShaarliProI18n.t("Beige"),light:"#e6c9a8",dark:"#9c5d16"},{key:"grey",label:window.ShaarliProI18n.t("Gray"),light:"#e8eaed",dark:"#4e5764"},{key:"custom",label:window.ShaarliProI18n.t("Custom"),light:"#custom",dark:"#custom"}],n=[{key:"none",label:window.ShaarliProI18n.t("None"),icon:"mdi-close-circle-outline"},{key:"glass",label:window.ShaarliProI18n.t("Glass"),icon:"mdi-blur"},{key:"vignette",label:window.ShaarliProI18n.t("Vignette"),icon:"mdi-vignette"},{key:"lined",label:window.ShaarliProI18n.t("Lined"),icon:"mdi-format-align-justify"},{key:"grid",label:window.ShaarliProI18n.t("Grid"),icon:"mdi-grid"},{key:"noise",label:window.ShaarliProI18n.t("Noise"),icon:"mdi-grain"},{key:"dots",label:window.ShaarliProI18n.t("Dots"),icon:"mdi-dots-grid"},{key:"stripes",label:window.ShaarliProI18n.t("Stripes"),icon:"mdi-slash-forward"}],r=[{key:"auto",label:window.ShaarliProI18n.t("Auto"),value:"auto"},{key:"light",label:window.ShaarliProI18n.t("Light"),value:"#f5f7fb"},{key:"dark",label:window.ShaarliProI18n.t("Dark"),value:"#202124"},{key:"white",label:window.ShaarliProI18n.t("White"),value:"#ffffff"},{key:"black",label:window.ShaarliProI18n.t("Black"),value:"#000000"},{key:"custom",label:window.ShaarliProI18n.t("Custom"),value:"custom"}],a="font-",i="note-color-",l="notefilter-",s="notebg-";function d(t){if("string"!=typeof t)return!1;const e=t.trim().toLowerCase();if(!e)return!1;if("note"===e||"#note"===e)return!0;if("shaarli-note"===e)return!0;if("todo"===e||"#todo"===e)return!0;if("shaarli-todo"===e)return!0;if("shaarli-pin"===e)return!0;if("brain-dump"===e)return!0;if(e.startsWith(a))return!0;if(e.startsWith(i))return!0;if(e.startsWith(l))return!0;if(e.startsWith(s))return!0;if(e.startsWith("notefilter-"))return!0;if(e.startsWith("notebg-"))return!0;if(e.startsWith("note-color-"))return!0;if(e.startsWith("note-")){const t=e.substring(5);if(o.some(e=>e.key===t))return!0}return!1}function c({tag:t,onRemoveClass:e="tag-remove-btn",tagClass:o="tag-pill"}){const n=document.createElement("span");n.className=o,n.dataset.tag=t;const r=document.createElement("span");r.className=`${o}-text`,r.textContent=t,n.appendChild(r);if(!(!arguments[0]||!Object.prototype.hasOwnProperty.call(arguments[0],"canRemove")||!!arguments[0].canRemove))return n;const a=document.createElement("button");return a.type="button",a.className=e,a.dataset.tag=t,a.setAttribute("aria-label",`Supprimer le tag ${t}`),a.title=window.ShaarliProI18n.t("Delete"),a.innerHTML="×",n.appendChild(a),n}function u(t,e){return fetch(t).then(t=>t.text()).then(t=>{const o=(new DOMParser).parseFromString(t,"text/html").querySelector('form[name="linkform"]');if(!o)throw new Error("Could not find edit form");const n=new URLSearchParams;o.querySelectorAll("input, textarea").forEach(t=>{"checkbox"===t.type?t.checked&&n.append(t.name,t.value||"on"):t.name&&n.append(t.name,Y(t))});let r=(n.get("lf_tags")||"").split(/[\s,]+/).filter(t=>""!==t.trim());return r=r.filter(t=>t!==e),n.set("lf_tags",r.join(" ")),n.append("save_edit","1"),fetch(o.action,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:n.toString()})}).then(t=>{if(!t.ok)throw new Error("Failed to update tags");return t})}function m(t){return t&&"#"!==t?fetch(t).then(t=>{if(!t.ok)throw new Error("Delete request failed");return t}):Promise.reject("Invalid delete URL")}let p=!1;function f(){p||(document.querySelectorAll(".link-tag-list .link-tag").forEach(t=>{const e=(t.dataset.tag||t.textContent||"").trim();e&&("shaarli-pin"!==e?d(e)&&t.classList.add("is-tech-tag"):t.classList.add("is-tech-tag"))}),document.addEventListener("click",function(t){const e=t.target.closest(".tag-remove-btn, .note-tag-remove-btn");if(!e)return;t.preventDefault(),t.stopPropagation();const o=(e.dataset.tag||"").trim();if(!o)return;const n=e.closest(".link-tag, .note-tag"),r=e.closest(".link-outer, .note-card, .note-modal");let a="";if(r&&r.classList.contains("note-card"))a=r.dataset.editUrl||"";else if(r&&r.classList.contains("note-modal"))a=r.dataset.editUrl||"";else{const t=r?r.querySelector(".link-actions"):null,e=t?t.querySelector('a[href*="admin/shaare"]'):null;a=e?e.href:""}a&&u(a,o).then(()=>{if(n&&n.remove(),r&&r.classList.contains("note-card")){let t=(r.dataset.tags||"").split("||").filter(t=>t);t=t.filter(t=>t!==o),r.dataset.tags=t.join("||");const e=h(),n=g(e);if(e&&n&&String(n.id)===String(r.dataset.id)){n.tags=(n.tags||[]).filter(t=>t!==o);pt(e.querySelector(".note-modal-tags"),n.tags)}}if(r&&r.classList.contains("note-modal")){let t=(r.dataset.tags||"").split("||").filter(t=>t);t=t.filter(t=>t!==o),r.dataset.tags=t.join("||");const e=h(),n=g(e);if(e&&n){n.tags=(n.tags||[]).filter(t=>t!==o);pt(e.querySelector(".note-modal-tags"),n.tags)}const a=r.dataset.noteId||r.dataset.todoId||(n&&n.id?String(n.id):""),i=a?document.querySelector(`.note-card[data-id="${a}"]`):null;if(i){const t=i.querySelector(`.note-tag[data-tag="${CSS.escape(o)}"]`);t&&t.remove();let e=(i.dataset.tags||"").split("||").filter(t=>t);e=e.filter(t=>t!==o),i.dataset.tags=e.join("||")}}}).catch(t=>{console.error("Error removing tag:",t),alert(window.ShaarliProI18n.t("Error removing tag."))})}),p=!0)}function h(){return document.querySelector(".note-modal-overlay.open")}function g(t){return t&&(t.currentTodo||t.currentNote)||null}const b=`${function(){const t=Array.from(document.querySelectorAll('link[rel="stylesheet"]')).find(t=>t.href&&(t.href.includes("/custom_views.css")||t.href.includes("/custom_views.min.css")));if(t&&t.href){const e=new URL(t.href,window.location.origin).pathname.replace(/\/(css|dist)\/custom_views(\.min)?\.css$/,"");if(e)return e}const e=Array.from(document.querySelectorAll("script[src]")).find(t=>t.src&&(t.src.includes("/custom_views.js")||t.src.includes("/custom_views.min.js")));if(e&&e.src){const t=new URL(e.src,window.location.origin).pathname.replace(/\/(js|dist)\/custom_views(\.min)?\.js$/,"");if(t)return t}return window.shaarli&&"string"==typeof window.shaarli.assetPath&&""!==window.shaarli.assetPath.trim()?window.shaarli.assetPath.replace(/\/$/,""):"/tpl/shaarli-pro"}().replace(/\/$/,"")}/img`;let y=[],v=!1,w=null;function k(){const t=document.getElementById("links-list");if(!t)return;const e=t.querySelector(".pinned-section-head"),o=t.querySelector(".normal-section-head"),n=t.querySelector(".compact-table-head");if(!e||!o||!n)return;const r=Array.from(t.getElementsByClassName("link-outer"));if(!r.length)return;const a=t=>{if(t.classList.contains("is-sticky")||t.classList.contains("is-pinned-tag"))return!0;const e=t.querySelectorAll(".link-tag-list a, .link-tag-list .link-tag-link, .note-tag");for(const t of e){if("shaarli-pin"===(t.textContent||"").trim().toLowerCase())return!0}return!1},i=r.filter(t=>a(t)),l=r.filter(t=>!a(t));t.classList.toggle("has-pinned",i.length>0),t.classList.toggle("has-normal",l.length>0);const s=document.createDocumentFragment();s.appendChild(e),i.forEach(t=>s.appendChild(t)),s.appendChild(o),s.appendChild(n),l.forEach(t=>s.appendChild(t)),t.replaceChildren(s)}window.__shaarliCustomViewsVersion="1.0.5-inline-bg-manifest","undefined"!=typeof console&&console&&console.info,document.addEventListener("DOMContentLoaded",function(){const t=document.getElementById("links-list");if(!t)return;k(),["view-grid-btn","view-list-btn","view-compact-btn"].forEach(t=>{const e=document.getElementById(t);e&&e.addEventListener("click",()=>{window.requestAnimationFrame(k)})}),t.addEventListener("click",t=>{t.target.closest('a[href*="/pin?token="]')&&window.setTimeout(()=>{window.location.reload()},500)})});const S=[{key:"cafe",label:window.ShaarliProI18n.t("Coffee"),files:{light:"bg-light-cafe.jpg",dark:"bg-dark-cafe.jpg"}},{key:"codes",label:"Codes",files:{light:"bg-light-codes.jpg",dark:"bg-dark-codes.jpg"}},{key:"dune",label:"Dune",files:{light:"bg-light-dune.jpg",dark:"bg-dark-dune.jpg"}},{key:"feuille-ligne",label:"Feuille Ligne",files:{light:"bg-light-feuilleLigne.jpg",dark:"bg-dark-feuilleLigne.jpg"}},{key:"feuille-quadrillage",label:"Feuille Quadrillage",files:{light:"bg-light-feuilleQuadrille.jpg",dark:"bg-dark-feuilleQuadrille.jpg"}},{key:"fleurs",label:"Fleurs",files:{light:"bg-light-fleurs.jpg",dark:"bg-dark-fleurs.jpg"}},{key:"foret",label:window.ShaarliProI18n.t("Forest"),files:{light:"bg-light-foret.jpg",dark:"bg-dark-foret.jpg"}},{key:"grid",label:"Grid",files:{light:"bg-light-grid.jpg",dark:"bg-dark-grid.jpg"}},{key:"journal",label:"Journal",files:{light:"bg-light-journal.jpg",dark:"bg-dark-journal.jpg"}},{key:"lecture",label:"Lecture",files:{light:"bg-light-lecture.jpg",dark:"bg-dark-lecture.jpg"}},{key:"legumes",label:window.ShaarliProI18n.t("Vegetables"),files:{light:"bg-light-legumes.jpg",dark:"bg-dark-legumes.jpg"}},{key:"montagnes",label:"Montagnes",files:{light:"bg-light-montagnes.jpg",dark:"bg-dark-montagnes.jpg"}},{key:"ocean",label:window.ShaarliProI18n.t("Ocean"),files:{light:"bg-light-ocean.jpg",dark:"bg-dark-ocean.jpg"}},{key:"radio",label:"Radio",files:{light:"bg-light-radio.jpg",dark:"bg-dark-radio.jpg"}},{key:"sports",label:"Sports",files:{light:"bg-light-sports.jpg",dark:"bg-dark-sports.jpg"}},{key:"vague1",label:"Vague 1",files:{light:"bg-light-vague1.jpg",dark:"bg-dark-vague1.jpg"}},{key:"vague2",label:"Vague 2",files:{light:"bg-light-vague2.jpg",dark:"bg-dark-vague2.jpg"}},{key:"ville",label:"Ville",files:{light:"bg-light-ville.jpg",dark:"bg-dark-ville.jpg"}},{key:"voyage",label:"Voyage",files:{light:"bg-light-voyage.jpg",dark:"bg-dark-voyage.jpg"}}];function $(){return v?Promise.resolve(y):w||(y=function(t){const e=Array.isArray(t)?t:t&&Array.isArray(t.backgrounds)?t.backgrounds:[],o={};return e.forEach(t=>{if(!t||"object"!=typeof t)return;const e=L("string"==typeof t.key?t.key:t.label||"");if(!e)return;const n=t.files&&"object"==typeof t.files?t.files:{},r="string"==typeof n.light?n.light.trim():"",a="string"==typeof n.dark?n.dark.trim():"";(r||a)&&(o[e]||(o[e]={key:e,label:E(t.label||"",e),paths:{light:"",dark:""}}),r&&(o[e].paths.light=`note-bg-light/${r}`),a&&(o[e].paths.dark=`note-bg-dark/${a}`))}),Object.values(o).sort((t,e)=>t.label.localeCompare(e.label,"fr",{sensitivity:"base"}))}(S),v=!0,w=Promise.resolve(y),w)}function L(t){return"string"!=typeof t?"":t.trim().toLowerCase().replace(/[\s_]+/g,"-").replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}function E(t,e){return("string"==typeof t&&""!==t.trim()?t:e).replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/\s+/g," ").trim().split(" ").filter(t=>""!==t).map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function P(){return"dark"===document.documentElement.getAttribute("data-theme")?"dark":"light"}function C(t,e=P()){if(!t||"object"!=typeof t)return"";const o="dark"===e?"dark":"light",n="string"==typeof t[o]?t[o].trim():"",r="string"==typeof t.light?t.light.trim():"",a="string"==typeof t.dark?t.dark.trim():"";return n||r||a}function q(t,e=P()){const o=function(t){if("string"!=typeof t)return null;const e=t.trim(),o=/^#([0-9a-f]{3})$/i.exec(e);if(o)return{r:parseInt(o[1].charAt(0).repeat(2),16),g:parseInt(o[1].charAt(1).repeat(2),16),b:parseInt(o[1].charAt(2).repeat(2),16)};const n=/^#([0-9a-f]{6})$/i.exec(e);return n?{r:parseInt(n[1].slice(0,2),16),g:parseInt(n[1].slice(2,4),16),b:parseInt(n[1].slice(4,6),16)}:null}(t);if(!o)return"dark"===e?"#e8eaed":"#202124";return(.299*o.r+.587*o.g+.114*o.b)/255>.56?"#202124":"#f5f7fb"}function I(t=P()){const e="dark"===t?"dark":"light";return y.filter(t=>t.paths&&t.paths[e])}function x(t,e=P()){const o=L(t);if(!o)return"";const n=y.find(t=>t.key===o);if(!n||!n.paths)return"";const r="dark"===e?"dark":"light",a=n.paths[r]||"";return a?`${b}/${a}`:""}function _(t){if(!t)return"default";if("custom"===t.dataset.color&&t.dataset.customColor)return`custom:${t.dataset.customColor}`;const e=Array.from(t.classList).find(t=>t.startsWith("note-color-"));return e?e.replace("note-color-",""):t.dataset.color||"default"}function A(t){if(!t)return"none";return L(t.dataset.background||"")||"none"}function M(t){if("string"!=typeof t)return"none";const e=t.trim().toLowerCase();return n.some(t=>t.key===e)?e:"none"}function U(t){return t?M(t.dataset.filter||""):"none"}function T(t){return t&&t.dataset.fontColor||"auto"}let N=!1;function D(t){if(!t||!t.classList.contains("open"))return;t.classList.remove("open-down"),t.style.left="",t.style.right="";if(t.getBoundingClientRect().top<8){t.classList.add("open-down");t.getBoundingClientRect().bottom>window.innerHeight-8&&t.classList.remove("open-down")}let e=t.getBoundingClientRect();e.right>window.innerWidth-8&&(t.style.left="auto",t.style.right="0",e=t.getBoundingClientRect()),e.left<8&&(t.style.left="0",t.style.right="auto")}let F=!1;function H(){const t=document.getElementById("shaarli-bg-studio");t&&(t.classList.remove("open"),t.style.display="none",t.setAttribute("aria-hidden","true"),t.__anchorEl=null)}function j({anchorEl:t,mode:e,entityId:o,editUrl:n,currentColor:r,currentFilter:a,currentBackground:i,currentFontColor:l,title:s}){!function(){if(F)return;if(document.getElementById("shaarli-bg-studio"))return void(F=!0);const t=document.createElement("div");t.id="shaarli-bg-studio",t.className="bg-studio-panel",t.setAttribute("role","dialog"),t.setAttribute("aria-modal","false"),t.setAttribute("aria-hidden","true"),t.style.display="none",document.body.appendChild(t),t.addEventListener("click",t=>{const e=t.target.closest("button[data-bg-studio-action]");if(!e)return;const o=document.getElementById("shaarli-bg-studio");if(!o)return;const n=o.dataset.mode||"entity",r=o.dataset.entityId||"",a=o.dataset.editUrl||"",i=t=>{"function"==typeof o.__draftApply&&o.__draftApply(t)},l=e.dataset.bgStudioAction;if("close"!==l){if("set-color"===l){const t=e.dataset.colorKey||"default";return void("draft"===n?(o.dataset.color=t,i({color:t}),R(o)):"modal"===n?(setModalNoteColor(t),o.dataset.color=t,R(o)):(setNoteColor(r,t,a),o.dataset.color=t,R(o)))}if("set-background"===l){const t=e.dataset.bgKey||"none";return void("draft"===n?(o.dataset.background=t,i({background:t}),R(o)):"modal"===n?(setModalNoteBackground(t),o.dataset.background=t,R(o)):(setNoteBackground(r,t,a),o.dataset.background=t,R(o)))}if("set-filter"===l){const t=e.dataset.filter||"none",l=M(t||"")||"none";return void("draft"===n?(o.dataset.filter=l,i({filter:l}),R(o)):"modal"===n?(setModalNoteFilter(t),o.dataset.filter=l,R(o)):(setNoteFilter(r,t,a),o.dataset.filter=l,R(o)))}if("set-query"===l){o.dataset.query="",R(o);const t=o.querySelector(".bg-studio-search-input");return void(t&&t.focus())}if("set-defaults"!==l)if("reset-font-color"!==l)if("open-color-picker"!==l)if("open-font-color-picker"!==l){if("set-font-color"===l){const t=e.dataset.fontColorKey||"auto";return void("draft"===n?(o.dataset.fontColor=t,i({fontColor:t}),R(o)):"modal"===n?(Ct(t),o.dataset.fontColor=t,R(o)):(Pt(r,t,a),o.dataset.fontColor=t,R(o)))}}else kt({mode:n,entityId:r,editUrl:a,type:"font"});else kt({mode:n,entityId:r,editUrl:a,type:"background"});else"draft"===n?(o.dataset.fontColor="auto",i({fontColor:"auto"}),R(o)):"modal"===n?(Ct("auto"),o.dataset.fontColor="auto",R(o)):(Pt(r,"auto",a),o.dataset.fontColor="auto",R(o));else"draft"===n?(o.dataset.color="default",o.dataset.background="none",i({color:"default",background:"none"}),R(o)):"modal"===n?(setModalNoteColor("default"),o.dataset.color="default",o.dataset.background="none",R(o)):(setNoteColor(r,"default",a),o.dataset.color="default",o.dataset.background="none",R(o))}else H()}),t.addEventListener("keydown",e=>{const o=e.target&&e.target.closest?e.target.closest("button"):null;if(!o)return;if("Enter"===e.key||" "===e.key)return void((o.hasAttribute("data-bg-studio-action")||o.classList.contains("bg-studio-thumb")||o.classList.contains("bg-studio-swatch"))&&(e.preventDefault(),o.click()));const n=(t,e)=>{if(!t||0===t.length)return;const o=t[Math.max(0,Math.min(t.length-1,e))];o&&"function"==typeof o.focus&&o.focus()};if(o.classList.contains("bg-studio-thumb")){const r=Array.from(t.querySelectorAll(".bg-studio-gallery .bg-studio-thumb")),a=r.indexOf(o);if(-1===a)return;const i=2;return void("ArrowRight"===e.key?(e.preventDefault(),n(r,a+i)):"ArrowLeft"===e.key?(e.preventDefault(),n(r,a-i)):"ArrowDown"===e.key?(e.preventDefault(),n(r,a+1)):"ArrowUp"===e.key&&(e.preventDefault(),n(r,a-1)))}if(o.classList.contains("bg-studio-swatch")){const r=Array.from(t.querySelectorAll(".bg-studio-swatches .bg-studio-swatch")),a=r.indexOf(o);if(-1===a)return;return void("ArrowRight"===e.key?(e.preventDefault(),n(r,a+1)):"ArrowLeft"===e.key&&(e.preventDefault(),n(r,a-1)))}}),t.addEventListener("input",t=>{const e=t.target&&t.target.matches(".bg-studio-search-input")?t.target:null;if(!e)return;const o=document.getElementById("shaarli-bg-studio");o&&(o.dataset.query=e.value||"",window.clearTimeout(o.__searchTimer),o.__searchTimer=window.setTimeout(()=>{R(o)},150))}),F=!0}();const d=document.getElementById("shaarli-bg-studio");d&&(d.dataset.mode=e||"entity",d.dataset.entityId=o||"",d.dataset.editUrl=n||"",d.dataset.color=r||"default",d.dataset.filter=M(a||"")||"none",d.dataset.background=L(i||"")||"none",d.dataset.fontColor=l||d.dataset.fontColor||"auto",d.dataset.query=d.dataset.query||"",d.dataset.title=s||window.ShaarliProI18n.t("My images & colors"),d.__anchorEl=t||null,R(d),d.style.display="block",d.classList.add("open"),d.setAttribute("aria-hidden","false"),function(t,e){if(!t)return;const o=12,n=e&&e.getBoundingClientRect?e.getBoundingClientRect():null;t.style.left="",t.style.top="",t.style.right="",t.style.bottom="";const r=t.getBoundingClientRect(),a=n?n.top-r.height-10:o,i=n?n.left:o;let l=a;l