mypgs 1.3.2 → 1.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/AI_GUIDELINES.md +353 -0
  2. package/README.md +483 -53
  3. package/assets/javascript/_imports.js +12 -11
  4. package/assets/javascript/_pgs.js +16 -1
  5. package/assets/javascript/components/_accordion.js +18 -9
  6. package/assets/javascript/components/_dropdown.js +176 -120
  7. package/assets/javascript/components/_menu.js +15 -116
  8. package/assets/javascript/components/_modals.js +0 -1
  9. package/assets/javascript/components/_notifications.js +2 -3
  10. package/assets/javascript/components/_slides.js +0 -1
  11. package/assets/javascript/components/_stepTabs.js +0 -1
  12. package/assets/javascript/components/_steps.js +0 -1
  13. package/assets/javascript/patterns/_cookieConsent.js +8 -2
  14. package/assets/javascript/pgs.d.ts +12 -1
  15. package/assets/scss/base/_html.scss +23 -1
  16. package/assets/scss/components/_dropdown.scss +24 -88
  17. package/assets/scss/components/_menu.scss +129 -15
  18. package/assets/scss/components/_modals.scss +15 -3
  19. package/assets/scss/components/_notification.scss +11 -14
  20. package/assets/scss/components/_tooltip.scss +2 -9
  21. package/assets/scss/index.scss +0 -1
  22. package/assets/scss/layout/_gap.scss +7 -1
  23. package/assets/scss/layout/_layout.scss +0 -12
  24. package/assets/scss/layout/_pageShell.scss +104 -105
  25. package/assets/scss/mixin/_mx-form.scss +1 -3
  26. package/assets/scss/mixin/_mx-responsive.scss +2 -2
  27. package/assets/scss/mixin/_mx-semantic.scss +0 -60
  28. package/assets/scss/mixin/mixin.scss +0 -1
  29. package/assets/scss/patterns/_footer.scss +1 -0
  30. package/assets/scss/patterns/_header.scss +20 -18
  31. package/dist/css/index.css +324 -1160
  32. package/dist/css/index.css.map +1 -1
  33. package/dist/css/index.min.css +1 -1
  34. package/dist/index.d.ts +12 -1
  35. package/dist/javascript/index.js +277 -272
  36. package/dist/javascript/index.js.map +1 -1
  37. package/dist/javascript/index.min.js +1 -1
  38. package/package.json +1 -1
  39. package/templates/components/{md-accordion.html → accordion.html} +2 -2
  40. package/templates/components/dropdown.html +91 -0
  41. package/templates/components/menu.html +41 -0
  42. package/templates/components/modal.html +78 -0
  43. package/templates/components/notification.html +35 -0
  44. package/templates/components/{md-slides.html → slides.html} +5 -5
  45. package/templates/components/{md-steps.html → steps.html} +7 -7
  46. package/templates/components/{md-tooltip.html → tooltip.html} +4 -2
  47. package/templates/demo.css +18 -0
  48. package/templates/demo.html +4 -5
  49. package/templates/demo.js +53 -52
  50. package/templates/layout/flex.html +89 -0
  51. package/templates/layout/grid.html +89 -0
  52. package/templates/layout/pageShell.html +59 -0
  53. package/templates/layout/section.html +40 -0
  54. package/templates/{layout/md-footer.html → patterns/footer.html} +1 -0
  55. package/templates/{layout/md-header.html → patterns/header.html} +6 -9
  56. package/assets/scss/base/_reset.scss +0 -15
  57. package/assets/scss/mixin/_mx-menu.scss +0 -154
  58. package/templates/components/md-dropdown.html +0 -16
  59. package/templates/components/md-menu.html +0 -40
  60. package/templates/components/md-modal.html +0 -19
  61. package/templates/components/md-notification.html +0 -13
  62. package/templates/layout/md-pageShell.html +0 -22
  63. package/templates/layout/md-section.html +0 -25
  64. /package/templates/components/{md-breadcumbs.html → breadcumbs.html} +0 -0
  65. /package/templates/components/{md-button.html → button.html} +0 -0
  66. /package/templates/components/{md-card.html → card.html} +0 -0
  67. /package/templates/components/{md-form.html → form.html} +0 -0
  68. /package/templates/components/{md-logo.html → logo.html} +0 -0
  69. /package/templates/components/{md-searchbar.html → searchbar.html} +0 -0
  70. /package/templates/components/{md-stepTabs.html → stepTabs.html} +0 -0
  71. /package/templates/components/{md-table.html → table.html} +0 -0
  72. /package/templates/layout/{md-body.html → body.html} +0 -0
  73. /package/templates/{layout/md-cookieConsent.html → patterns/cookieConsent.html} +0 -0
@@ -1 +1 @@
1
- (()=>{var e={795(){function e(e="svg"){const t=getComputedStyle(document.documentElement),o=[];for(let n=0;n<20;n++){const r=t.getPropertyValue("--"+e+"-color-"+n).toLocaleLowerCase().split("&");if(""==!r[0]&&""==!r[1]){let e=[r[0],r[1]];o.push(e)}}return o}const t=[e("svg"),e("lottie")];let o=pgs(document).querySelectorAll("toggleDarkmode");function n(e,o){e.forEach(e=>{const t=e.querySelector("i");t&&(t.classList.toggle("fa-moon",!o),t.classList.toggle("fa-sun",o))}),function(){function e(e,o="svg"){let n="true"!==document.documentElement.getAttribute("data-darkmode");e.querySelectorAll("[fill], [stroke]").forEach(e=>{for(const o of t)for(const t of o){let o=(t[0]||"").replace(/\s/g,""),r=(t[1]||"").replace(/\s/g,"");["fill","stroke"].forEach(t=>{const i=e.getAttribute(t);e.style.transition="fill 0.5s ease, stroke 0.5s ease",n?i==r&&e.setAttribute(t,o):i==o&&e.setAttribute(t,r)})}})}document.querySelectorAll('object[type="image/svg+xml"]').forEach(t=>{if(t.addEventListener("load",()=>{const o=t.contentDocument;o&&e(o,"svg")}),t.contentDocument){const e=new Event("load");t.dispatchEvent(e)}}),document.querySelectorAll("lottie-player").forEach(t=>{if(t.addEventListener("load",()=>{const o=t.shadowRoot.querySelector("svg");o&&e(o,"lottie")}),t.shadowRoot){const e=new Event("load");t.dispatchEvent(e)}})}()}"true"===localStorage.getItem("screenIsDarkMode")&&(document.body.classList.add("darkmode"),document.querySelector(":root").setAttribute("data-darkmode","true"),document.body.setAttribute("data-darkmode","true")),o.forEach(e=>{let t="true"===document.documentElement.getAttribute("data-darkmode");n(o,t),e.addEventListener("click",()=>{let e="true"!==document.documentElement.getAttribute("data-darkmode");localStorage.setItem("screenIsDarkMode",e),document.body.classList.toggle("darkmode",e),document.body.setAttribute("data-darkmode",e),document.querySelector(":root").setAttribute("data-darkmode",e),n(o,e)})})},359(){document.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll('object[type="image/svg+xml"]').forEach(e=>{function t(t){if(!t)return;const o=t.querySelector("svg");if(!o)return;const n=window.getComputedStyle(e);o.setAttribute("preserveAspectRatio","cover"===n.objectFit?"xMidYMid slice":"xMidYMid meet")}function o(){const o=e.contentDocument;if(!o)return;if(!o.querySelector("svg"))return;if(t(o),e.__objectResizeObserver)return;let n=0;const r=new ResizeObserver(()=>{n||(n=requestAnimationFrame(()=>{n=0,t(o)}))});r.observe(e),e.__objectResizeObserver=r}e.contentDocument&&e.contentDocument.querySelector("svg")?o():e.addEventListener("load",o,{once:!0})}),document.body.classList.add("object-loaded")})},48(){const e="pgs_cookie_preferences_v1";function t(){window.dataLayer=window.dataLayer||[],window.gtag=window.gtag||function(){window.dataLayer.push(arguments)}}function o(e,t,o){if(!(e instanceof HTMLElement&&t))return;const n=(e.getAttribute("pgs")||"").split(/\s+/).filter(Boolean),r=o?[...new Set([...n,t])]:n.filter(e=>e!==t);r.length>0?e.setAttribute("pgs",r.join(" ")):e.removeAttribute("pgs")}document.addEventListener("DOMContentLoaded",function(){const n=pgs(document).querySelector("cookieConsent");if(!n)return;const r=n.querySelector('[pgs~="cookieConsent-toggleAnalytics"]'),i=n.querySelector('[pgs~="cookieConsent-actionAccept"]'),s=n.querySelector('[pgs~="cookieConsent-actionReject"]'),a=document.querySelectorAll('[pgs~="cookieConsent-actionOpen"]'),c=(n.dataset.gaId||"").trim(),l=c.length>0;let d=null;function u(e){n.hidden=!e,n.setAttribute("aria-hidden",String(!e)),document.body.classList.toggle("cookieConsent-open",e),e?(d=document.activeElement,setTimeout(()=>{n.focus()},0)):d instanceof HTMLElement&&d.focus({preventScroll:!0})}function p(){u(!1)}function g(r){!function(t){try{localStorage.setItem(e,JSON.stringify({...t,updatedAt:(new Date).toISOString()}))}catch(e){console.warn("PGS cookie consent: impossibile salvare le preferenze",e)}}({analytics:r}),o(n,"cookieConsent-accepted",!!r),o(n,"cookieConsent-declined",!r),function({allowAnalytics:e,measurementId:o}){t(),e?(window.gtag("consent","update",{analytics_storage:"granted"}),function(e){if(!e||window.__PGS_gaLoaded)return;window.__PGS_gaLoaded=!0;const t=document.createElement("script");t.async=!0,t.src=`https://www.googletagmanager.com/gtag/js?id=${e}`,document.head.appendChild(t),window.gtag("js",new Date),window.gtag("config",e,{anonymize_ip:!0,allow_google_signals:!1})}(o)):window.gtag("consent","update",{analytics_storage:"denied"})}({allowAnalytics:!!r,measurementId:c})}!function({root:e,analyticsToggle:t,acceptAllButton:o,rejectButton:n,openButtons:r}){e.dataset.cookieComponent="consent",t?.setAttribute("data-cookie-toggle","analytics"),o?.setAttribute("data-cookie-action","accept"),n?.setAttribute("data-cookie-action","reject"),e.querySelector('[pgs~="cookieConsent-featureEssential"]')?.setAttribute("data-cookie-feature","essential"),e.querySelector('[pgs~="cookieConsent-featureAnalytics"]')?.setAttribute("data-cookie-feature","analytics"),r.forEach(e=>{e.setAttribute("data-cookie-action","open")})}({root:n,analyticsToggle:r,acceptAllButton:i,rejectButton:s,openButtons:a}),r&&(r.disabled=!l,l?o(n,"cookieConsent-gaUnavailable",!1):(r.checked=!1,o(n,"cookieConsent-gaUnavailable",!0))),t(),window.gtag("consent","default",{analytics_storage:"denied"}),i?.addEventListener("click",()=>{r&&l&&(r.checked=!0),g(!!l),p()}),s?.addEventListener("click",()=>{const e=!!r&&r.checked&&l;!e&&r&&(r.checked=!1),g(e),p()}),r?.addEventListener("change",e=>{!l&&e.target instanceof HTMLInputElement&&(e.target.checked=!1)}),n.addEventListener("keydown",e=>{if("Escape"===e.key)e.preventDefault(),p();else if("Tab"===e.key){const t=n.querySelectorAll('a[href], button:not([disabled]), input:not([disabled]), [tabindex]:not([tabindex="-1"])');if(0===t.length)return;const o=t[0],r=t[t.length-1];e.shiftKey||document.activeElement!==r||(e.preventDefault(),o.focus()),e.shiftKey&&document.activeElement===o&&(e.preventDefault(),r.focus())}}),a.forEach(e=>{e.addEventListener("click",e=>{e.preventDefault(),u(!0)})});const f=function(){try{return function(e){try{return e?JSON.parse(e):null}catch(e){return console.warn("PGS cookie consent: impossibile leggere le preferenze",e),null}}(localStorage.getItem(e))}catch(e){return null}}();f&&"boolean"==typeof f.analytics?(r&&(r.checked=!!f.analytics&&l),g(f.analytics&&l),p()):u(!0)})},107(){const e=pgs(document).querySelector("header");pgs(e).querySelectorAll("header-element").forEach(t=>function(t){if("true"==t.getAttribute("data-initialize"))return;t.setAttribute("data-initialize","true");let o,n=!1;let r=0;const i=()=>{r||(r=requestAnimationFrame(()=>{r=0,function(r){let i,s=window.getComputedStyle(r),a=parseFloat(s.paddingLeft)+parseFloat(s.paddingRight),c=parseFloat(s.gap),l=parseInt(r.offsetWidth-a);if(n)i=o;else{let e=[];Array.from(r.children).filter(e=>!pgs(e).contains("header-element-onlyMobile")).forEach(t=>{pgs(t).contains("header-element-hamburger")||e.push(...t.children)}),c=Math.round(c*(e.length-1)),i=e.reduce((e,t)=>e+t.offsetWidth,0)-2+c}window.innerWidth<600?(e.setAttribute("data-header-mobileActive","true"),t.setAttribute("data-header-mobileActive","true")):l<i?(e.setAttribute("data-header-mobileActive","true"),r.setAttribute("data-header-mobileActive","true"),n=!0,o=i):(e.setAttribute("data-header-mobileActive","false"),r.setAttribute("data-header-mobileActive","false"))}(t)}))};new ResizeObserver(i).observe(t),i()}(t));const t=document.querySelector("body");function o(){const e=document.querySelectorAll("header > [data-initialize=true]"),o=window.getComputedStyle(document.documentElement).marginTop??0,n=Array.from(e).map(e=>e.offsetHeight).reduce((e,t)=>e+t)+parseInt(o);t.style.setProperty("--heightOfHeader",`${n}px`);const r="true"===document.querySelector("header").getAttribute("data-header-scroll")?0:n;t.style.setProperty("--heightOfHeaderScroll",`${r}px`)}o(),window.addEventListener("resize",o),window.addEventListener("scroll",o);let n=window.scrollY;window.addEventListener("scroll",()=>{let t=window.scrollY;window.innerHeight<=900&&(t>=80?t>n?(e.style.transform="translateY(-100%)",e.setAttribute("data-header-scroll",!0)):(e.style.transform="translateY(0px)",e.setAttribute("data-header-scroll",!1)):(e.style.transform="translateY(0)",e.setAttribute("data-header-scroll",!1))),n=t}),window.addEventListener("resize",()=>{window.innerWidth>768&&(e.style.transform="translateY(0)")}),window.innerWidth<600&&(document.querySelector("header").setAttribute("data-header-mobileActive","true"),document.querySelector("[pgs~=header-element]").setAttribute("data-header-mobileActive","true"))}},t={};function o(n){var r=t[n];if(void 0!==r)return r.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,o),i.exports}(()=>{"use strict";function e(e){const t="pgs";if(!e)throw new TypeError("pgs(root): root richiesto");const o="function"==typeof e.getAttribute&&"function"==typeof e.setAttribute;if("function"!=typeof e.querySelector||"function"!=typeof e.querySelectorAll)throw new TypeError("pgs(root): root deve supportare querySelector/querySelectorAll");function n(t){throw new TypeError(`pgs(${e.nodeName||"root"}).${t}(): disponibile solo su Element (non su Document)`)}function r(e){return Array.isArray(e)&&(e=e.join(",")),String(e).split(",").map(e=>e.trim()).filter(Boolean).map(e=>`[${t}~="${e}"]`).join(",")}function i(e,o=" "){return(e.getAttribute(t)||"").split(o).filter(Boolean)}function s(e,o,n=" "){e.setAttribute(t,o.join(n))}function a(t){if(o)return n.contains=function(o){const n=e.getAttribute(t)||"",r=String(o).replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`(?:^|\\s)${r}(?:\\[[^\\]]*\\])?(?=\\s|$)`).test(n)},n.getValueBrackets=function(o){const n=e.getAttribute(t)||"",r=String(o).replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),i=n.match(new RegExp(`(?:^|\\s)${r}\\[([^\\]]*)\\]`));return i?i[1]:void 0},Object.defineProperty(n,"value",{get:()=>e.getAttribute(t),set(o){e.setAttribute(t,o)}}),n;function n(){return n}}const c=function(){function a(){return a}return a.querySelector=function(t){return e.querySelector(r(t))},a.querySelectorAll=function(t){return e.querySelectorAll(r(t))},a.add=function(...t){if(!o)return n("add");const r=i(e);for(const e of t)r.includes(e)||r.push(e);return s(e,r),a},a.remove=function(...t){return o?(s(e,i(e).filter(e=>!t.includes(e))),a):n("remove")},a.toggle=function(t,r){if(!o)return n("toggle");const s=i(e).includes(t);return void 0!==r?(r&&!s&&a.add(t),!r&&s&&a.remove(t),!!r):s?(a.remove(t),!1):(a.add(t),!0)},a.contains=function(t){return o?i(e).includes(t):n("contains")},Object.defineProperty(a,"value",{get(){if(o)return e.getAttribute(t)},set(r){if(!o)return n("value");e.setAttribute(t,r)}}),a}();return c.state=function(t){if(!o)return;const n=(o=" ")=>(e.getAttribute(t)||"").split(o).filter(Boolean),r=(o,n=" ")=>e.setAttribute(t,o.join(n));function i(...e){return i.add(...e),i}return i.add=function(...e){const t=e.flat().map(e=>String(e).trim()).filter(Boolean),o=n();for(const e of t)o.includes(e)||o.push(e);return r(o),i},i.remove=function(...e){const t=e.flat().map(e=>String(e).trim()).filter(Boolean),o=n().filter(e=>!t.includes(e));return r(o),i},i.toggle=function(e,t){const o=String(e).trim();if(!o)return!1;const i=n(),s=i.includes(o);return void 0!==t?(t&&!s&&(i.push(o),r(i)),!t&&s&&r(i.filter(e=>e!==o)),!!t):s?(r(i.filter(e=>e!==o)),!1):(i.push(o),r(i),!0)},i.contains=function(e){const t=String(e).trim();return!!t&&n().includes(t)},Object.defineProperty(i,"value",{get:()=>e.getAttribute(t),set(o){e.setAttribute(t,o)}}),i}("pgs-state"),c.option=a("pgs-option"),c.modules=a("pgs-modules"),c}const t={};function n(e,o){const n=String(e||"").trim().replace(/^pgs[_-\s]*/i,"").toLowerCase();if(!n)throw new TypeError("pgs.registerImport(...modules): ogni modulo deve avere name o PGS_name");t[n]={name:e,module:o}}e.registerImport=function(...t){return t.flat().forEach(e=>{!e||"object"!=typeof e||e.PGS_name||e.name?n(e?.PGS_name||e?.name,e):Object.entries(e).forEach(([e,t])=>n(e,t))}),e},e.import=function(...e){return e.flat().reduce((e,o)=>{const n=String(o||"").trim().replace(/^pgs[_-\s]*/i,"").toLowerCase(),r=t[n];if(!r)throw new Error(`pgs.import(): modulo "${o}" non registrato`);return e[r.name]=r.module,e},{})},globalThis.pgs??=e,o(795),o(359);const r=new WeakMap;function i(e=document){pgs(e).querySelectorAll("accordion").forEach((e,t)=>{if(r.has(e))return;const o=pgs(e).querySelector("accordion-button"),n=pgs(e).querySelector("accordion-content");if(!o||!n)return;const s=t+1,a=`acc-btn-${s}`,c=`acc-panel-${s}`,l=pgs(e).state.contains("open");function d(e,t,o){const n=(t?.textContent||"").trim().replace(/\s+/g," ");t.setAttribute("aria-label",`${e?"Chiudi":"Apri"} ${n||"sezione"}`),t.setAttribute("aria-expanded",String(e)),o.hidden=!e}function u(){const t=!pgs(e).state.contains("open");pgs(e).state.toggle("open",t),d(t,o,n),function(){for(const t of pgs(document).querySelectorAll("accordion")){if(t===e)continue;const o=pgs(t).querySelector("accordion-button"),n=pgs(t).querySelector("accordion-content");o&&n&&(pgs(t).state().remove("open"),d(!1,o,n))}}(),t&&setTimeout(()=>e.scrollIntoView({block:"nearest",inline:"nearest"}),100)}o.setAttribute("role","button"),o.setAttribute("tabindex","0"),o.setAttribute("id",a),o.setAttribute("aria-controls",c),n.setAttribute("id",c),n.setAttribute("role","region"),n.setAttribute("aria-labelledby",a),d(l,o,n),o.addEventListener("click",u),o.addEventListener("keydown",e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),u())}),r.set(e,{element:e,button:o,content:n,open:function(){pgs(e).state.contains("open")||u()},close:function(){pgs(e).state.contains("open")&&u()},toggle:u,refresh:()=>(i(e.parentNode||document),r.get(e)),isOpen:()=>pgs(e).state.contains("open")})})}i();const s={PGS_name:"PGS_accordion",init:i,api:function(e){return r.get(e)}},a=new WeakMap;function c(e=document){pgs(e).querySelectorAll("dropdown").forEach((e,t)=>{if(a.has(e))return;const o=pgs(e).querySelector("dropdown-button"),n=pgs(e).querySelector("dropdown-content");if(!o||!n)return;if("true"===e.getAttribute("data-initialize"))return;e.setAttribute("data-initialize","true");const r=`--dropdown-anchor-${t}`;e.style.setProperty("--dropdown-anchor",r),o.id||(o.id=`dropdown-btn-${t}`),n.id||(n.id=`dropdown-panel-${t}`),o.setAttribute("type","button"),o.setAttribute("aria-haspopup","true"),o.setAttribute("aria-controls",n.id),o.setAttribute("aria-expanded","false"),n.setAttribute("aria-labelledby",o.id),n.hasAttribute("popover")||n.setAttribute("popover","auto"),o.setAttribute("popovertarget",n.id),o.setAttribute("popovertargetaction","toggle");const i=CSS.supports("anchor-name: --dropdown-anchor")&&CSS.supports("position-anchor: --dropdown-anchor")&&CSS.supports("position-area: bottom")&&CSS.supports("top: anchor(bottom)"),s=pgs(e).contains("tooltip")||!i,l=()=>{if(!s)return;const t=o.getBoundingClientRect(),r=getComputedStyle(e),i=parseFloat(r.getPropertyValue("--dropdown-offset"))||10,a=parseFloat(r.getPropertyValue("--dropdown-padding"))||0,c=parseFloat(r.getPropertyValue("--dropdown-arrow-size"))||12,l=window.innerWidth,d=l-16,u=getComputedStyle(n),p=parseFloat(u.maxWidth),g=Number.isFinite(p)?Math.min(p,d):d,f=Math.min(Math.max(n.scrollWidth+2*a,t.width),g),m=t.bottom+i,h=t.left+t.width/2-f/2,b=Math.min(Math.max(h,8),l-f-8),y=t.left+t.width/2,S=Math.min(Math.max(y-b,a+c),f-a-c);e.style.setProperty("--dropdown-fallback-top",`${m}px`),e.style.setProperty("--dropdown-fallback-left",`${b}px`),e.style.setProperty("--dropdown-arrow-left",`${S}px`)};function d(){n.matches(":popover-open")||(l(),n.showPopover())}function u(){n.matches(":popover-open")&&n.hidePopover()}o.addEventListener("click",e=>{s&&(e.preventDefault(),n.matches(":popover-open")?n.hidePopover():(l(),n.showPopover()))}),n.addEventListener("toggle",t=>{const r=n.matches(":popover-open");o.setAttribute("aria-expanded",r?"true":"false"),pgs(e).state.toggle("open",r),r&&(l(),n.querySelector('a, button, input, select, textarea, [tabindex]:not([tabindex="-1"])')?.focus())}),window.addEventListener("resize",()=>{n.matches(":popover-open")&&l()}),window.addEventListener("scroll",()=>{n.matches(":popover-open")&&l()},!0),a.set(e,{element:e,button:o,content:n,open:d,close:u,toggle:function(){n.matches(":popover-open")?u():d()},updatePosition:l,refresh:()=>(c(e.parentNode||document),a.get(e)),isOpen:()=>n.matches(":popover-open")})})}function l(e){return a.get(e)}c();const d={PGS_name:"PGS_dropdown",init:c,api:l},u=new WeakMap;function p(e=document){pgs(e).querySelectorAll("menu-horizontal").forEach(e=>{u.has(e)||(e.querySelectorAll("nav > ul > li.menu-item-has-children").forEach(e=>{if(e.querySelector("ul")){const t=e.querySelector("ul");if(pgs(e).querySelector("dropdown-button"))return;const o=document.createElement("button");o.className="icon-down",o.type="button",o.innerHTML="<span>&#9207;</span>",e.querySelector("a").insertAdjacentElement("afterend",o),pgs(e).add("dropdown"),pgs(o).add("dropdown-button"),pgs(o).add("buttonNohover"),pgs(t).add("dropdown-content"),pgs(t).add("menu-vertical")}}),u.set(e,{element:e,type:"horizontal",items:()=>Array.from(e.querySelectorAll("nav > ul > li")),submenus:()=>Array.from(e.querySelectorAll(".menu-item-has-children > ul")),dropdowns:()=>Array.from(e.querySelectorAll(".menu-item-has-children")).map(l).filter(Boolean),refresh:()=>(p(e.parentNode||document),u.get(e))}))}),pgs(e).querySelectorAll("menu-vertical").forEach(e=>{function t(t){return e.querySelectorAll(".menu-item-has-children > ul")[t]}function o(e,o){const n=t(e),r=n?.parentElement?.querySelector(":scope > button");n&&r&&(pgs(n).state.toggle("open",o),r.setAttribute("aria-expanded",String(o)),r.setAttribute("aria-label",o?"Chiudi sottomenu":"Apri sottomenu"))}u.has(e)||(e.querySelectorAll(".menu-item-has-children").forEach((e,t)=>{const o=e.querySelector("ul");if(!o)return;if(e.querySelector(":scope > button"))return;const n=document.createElement("button");n.className="icon-down buttonIcon",n.type="button";const r=`vertical-submenu-${t}`;function i(){const e=pgs(o).state.toggle("open");n.setAttribute("aria-expanded",e),n.setAttribute("aria-label",e?"Chiudi sottomenu":"Apri sottomenu")}o.id=r,pgs(n).add("buttonIcon"),n.setAttribute("aria-expanded","false"),n.setAttribute("aria-controls",r),n.setAttribute("aria-label","Apri sottomenu"),n.innerHTML="<span aria-hidden='true'>&#9207;</span>",e.querySelector("a").insertAdjacentElement("afterend",n),n.addEventListener("click",i),n.addEventListener("keydown",e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),i())})}),u.set(e,{element:e,type:"vertical",items:()=>Array.from(e.querySelectorAll(":scope > li")),submenus:()=>Array.from(e.querySelectorAll(".menu-item-has-children > ul")),openSubmenu:e=>o(e,!0),closeSubmenu:e=>o(e,!1),toggleSubmenu:e=>{const n=t(e);n&&o(e,!pgs(n).state.contains("open"))},isSubmenuOpen:e=>{const o=t(e);return!!o&&pgs(o).state.contains("open")},refresh:()=>(p(e.parentNode||document),u.get(e))}))}),c()}p();const g={PGS_name:"PGS_menu",init:p,api:function(e){return u.get(e)}},f=new WeakMap;function m(e="modal"){pgs(document).querySelectorAll(e).forEach(t=>{if(f.has(t))return;const o=pgs(t).querySelector("modal-button"),n=t.querySelector("dialog");if(!o||!n)return;const r='<button pgs="buttonClose modal-close" type="button" tabindex="0" aria-label="Chiudi"><i class="fa-solid fa-close"></i></button>',i=pgs(t)?.querySelector("modal-dialog-content-header"),s=pgs(t).option.contains("disableBackdropClose"),a=pgs(t).option.contains("history"),c=pgs(t).option.getValueBrackets("containerID"),l=pgs(t).option.getValueBrackets("containerPGS"),d=pgs(n).option.contains("topLevel");pgs(t).querySelector("modal-close")||(i?i.insertAdjacentHTML("beforeend",r):n.insertAdjacentHTML("beforeend",r));const u=pgs(t).querySelector("modal-close");function p(e=!0){o?.setAttribute("aria-expanded",e),n?.setAttribute("aria-expanded",e)}function g(e){e?.stopImmediatePropagation(),n.open?h(e):(n.open||document.querySelectorAll("dialog[open]").forEach(e=>e.close()),p(!0),d?n.showModal():n.show(),t.dispatchEvent(new CustomEvent("modal:open")),n.dispatchEvent(new CustomEvent("modal:open")))}function h(e){e?.stopImmediatePropagation(),p(!1),n.close(),t.dispatchEvent(new CustomEvent("modal:close")),n.dispatchEvent(new CustomEvent("modal:close"))}pgs(n).add("dialog modal-dialog"),o.setAttribute("role","button"),o.setAttribute("aria-label","apri modale"),d||(c?document.querySelector("#"+c)?.append(n):l?pgs(document).querySelector(l)?.append(n):document.body.append(n)),o.addEventListener("click",e=>g(e)),o.addEventListener("keypress",e=>!n.open&&("Enter"===e.key||" "===e.key)&&g(e)),n.addEventListener("close",()=>p(!1)),n.addEventListener("click",e=>{e.target!=n||s||h(e)}),u?.addEventListener("click",e=>h(e)),a&&o.id&&(setTimeout(function(){new URLSearchParams(window.location.search).get("modal")===o.id&&(document.getElementById(o.id)?.scrollIntoView({behavior:"smooth"}),g())},1),new MutationObserver(()=>{let e=n.hasAttribute("open");try{const t=new URL(window.location.href),n=new URLSearchParams(t.search);e?n.set("modal",o.id):n.delete("modal"),t.search=n.toString()?`?${n.toString()}`:"",window.history.pushState({modal:o.id,open:e},"",t)}catch(e){}}).observe(n,{attributes:!0,attributeFilter:["open"]}),window.addEventListener("popstate",()=>{try{const e=new URLSearchParams(window.location.search).get("modal")===o.id;e&&!n.open&&n.showModal(),!e&&n.open&&h()}catch(e){}})),f.set(t,{element:t,button:o,dialog:n,closeButton:u,open:function(e){n.open||g(e)},close:function(e){n.open&&h(e)},toggle:g,refresh:()=>(m(e),f.get(t)),isOpen:()=>n.open})})}m();const h={PGS_name:"PGS_modal",init:m,api:function(e){return f.get(e)}};function b(e,t){const o=(()=>{let e=0,t=0,o=0,n=!1;return{update:function(r){const i=performance.now(),s=i-e;let a=Math.abs(r.deltaY);return 1===r.deltaMode?a*=16:2===r.deltaMode&&(a*=r.currentTarget?.clientHeight||800),a<30&&s<35&&t++,o++,o>=6&&(n=t>=3,t=0,o=0),e=i,n},get value(){return n}}})();let n=e;n.addEventListener("wheel",e=>{const r=t;if(o.update(e))return;if(e.ctrlKey)return;if(Math.abs(e.deltaX)>Math.abs(e.deltaY))return;let i=e.deltaY;1===e.deltaMode?i*=16:2===e.deltaMode&&(i*=n.clientHeight);const s=n.scrollLeft<=0,a=n.scrollLeft+n.clientWidth>=n.scrollWidth-1;(i>0&&!a||i<0&&!s)&&(e.preventDefault(),n.scrollLeft+=i*r)},{passive:!1})}const y=new WeakMap;class S{constructor({selector:e,viewRatio:t=.97,optionIntersectionObserver:o={},scrollOptions:n={}}={}){this.selector=e,this.viewRatio=t,this.optionIntersectionObserver={threshold:Array.from({length:101},(e,t)=>t/100),rootMargin:"0px",...o},this.scrollOptions={behavior:"smooth",inline:"center",block:"nearest",container:"nearest",...n},this.container=this.selector?pgs(this.selector).querySelector("slides-container"):null}#e(){const e=this.selector;pgs(e).querySelector("slides-prec")||pgs(e).querySelector("slides-next")||(e.insertAdjacentHTML("afterbegin",'<button pgs="slides-prec buttonIcon" type="button" class="precButton" aria-label="slide precedente"> <span> <i class="fa-solid fa-arrow-left"></i></span></button>'),e.insertAdjacentHTML("beforeend",'<button pgs="slides-next buttonIcon" type="button" class="nextButton" aria-label="prossima slide"> <span> <i class="fa-solid fa-arrow-right"></i></span></button>')),pgs(e).querySelector("slides-dots")||(e.insertAdjacentHTML("beforeend",'<div pgs="slides-dots" class="slides-dots"></div>'),Array.from(this.container.children).forEach(()=>{pgs(e).querySelector("slides-dots").insertAdjacentHTML("beforeend",'<button type="button" class="slide-dot" aria-label="vai alla prossima slide"></button>')}))}#t(){const e=this.container.querySelectorAll(".view");let t;t=pgs(this.selector).option.contains("singleScroll")?e[e.length-1]:e[0];const o=t?.previousElementSibling;o?.scrollIntoView(this.scrollOptions),o?.focus({preventScroll:!0})}#o(){const e=this.container.querySelectorAll(".view");let t;t=pgs(this.selector).option.contains("singleScroll")?e[0]:e[e.length-1];const o=t?.nextElementSibling;console.log(t,o),o?.scrollIntoView(this.scrollOptions),o?.focus({preventScroll:!0})}#n(e){this.container.children[e].scrollIntoView(this.scrollOptions)}#r(e,t,o,n,r){e.forEach(e=>{const i=.9+.1*e.intersectionRatio,s=i>=.98;!pgs(e.target).option.contains("notScrollAnimation")&&e.target.firstElementChild&&e.target.firstElementChild.style.setProperty("--visible-percent",`${i}`),e.target.classList.toggle("view",s),e.target.classList.toggle("notView",!s);const a=e.target.parentNode.children,c=a[0].classList.contains("view"),l=a[a.length-1].classList.contains("view");n.disabled=l,o.disabled=c,n.setAttribute("aria-disabled",String(l)),o.setAttribute("aria-disabled",String(c));const d=Array.from(t.children).filter(e=>e.classList.contains("view"));r.forEach((e,o)=>{const n=d.some(e=>Array.from(t.children).indexOf(e)===o);e.classList.toggle("active",n),e.setAttribute("aria-current",n?"true":"false")})})}execute(){const e=this.selector;if(!this.container)return;this.#e();const t=pgs(e).querySelector("slides-prec"),o=pgs(e).querySelector("slides-next"),n=Array.from(pgs(e).querySelector("slides-dots").children);pgs(e).option.contains("notScrollWithMouse")||b(this.container,5),n.forEach((e,t)=>e.addEventListener("click",e=>this.#n(t))),t.addEventListener("click",e=>this.#t(),{passive:!0}),o.addEventListener("click",e=>this.#o(),{passive:!0});const r=new IntersectionObserver(e=>this.#r(e,this.container,t,o,n),{root:this.container,...this.optionIntersectionObserver});Array.from(this.container.children).forEach(e=>r.observe(e)),y.set(this.selector,{element:this.selector,container:this.container,previous:()=>this.#t(),next:()=>this.#o(),goTo:e=>this.#n(e),getCurrentIndexes:()=>Array.from(this.container.children).map((e,t)=>e.classList.contains("view")?t:-1).filter(e=>-1!==e),getCurrentElements:()=>Array.from(this.container.children).filter(e=>e.classList.contains("view")),getTotal:()=>this.container.children.length,isAtStart:()=>this.container.children[0]?.classList.contains("view")||!1,isAtEnd:()=>{const e=this.container.children,t=e[e.length-1];return t?.classList.contains("view")||!1},refresh:()=>(A(this.selector.parentNode||document),y.get(this.selector))})}}function A(e=document){pgs(e).querySelectorAll("slides").forEach(e=>{y.has(e)||new S({selector:e}).execute()})}A();const v={PGS_name:"PGS_slides",init:A,api:function(e){return y.get(e)}},w=new WeakMap;function E(e=document){pgs(e).querySelectorAll("steps").forEach(e=>{w.has(e)||(pgs(e).querySelectorAll("steps-step").forEach((e,t)=>{let o;if(pgs(e).querySelector("steps-step-circle")?o=pgs(e).querySelector("steps-step-circle"):(o=document.createElement("span"),pgs(o).add("steps-step-circle"),o.textContent=t+1,e.insertAdjacentElement("afterbegin",o)),!pgs(e).querySelector("steps-step-line")){const t=document.createElement("span");pgs(t).add("steps-step-line"),e.insertAdjacentElement("afterbegin",t)}}),w.set(e,{element:e,steps:()=>Array.from(pgs(e).querySelectorAll("steps-step")),getStep:t=>pgs(e).querySelectorAll("steps-step")[t],getTotal:()=>pgs(e).querySelectorAll("steps-step").length,refresh:()=>(w.delete(e),E(e.parentNode||document),w.get(e))}))})}E();const q={PGS_name:"PGS_steps",init:E,api:function(e){return w.get(e)}},k=new WeakMap;function L(e=document){pgs(e).querySelectorAll("stepTabs").forEach(e=>{if("true"===e.dataset.stepTabsInitialized)return;e.dataset.stepTabsInitialized="true";const t=pgs(e).querySelector("stepTabs-prev"),o=pgs(e).querySelector("stepTabs-next"),n=pgs(e).querySelector("stepTabs-restart"),r=pgs(e).querySelector("stepTabs-dots"),i=pgs(e).querySelector("stepTabs-container"),s=pgs(i).querySelectorAll("tab"),a=s.length,c=Array.from(s).filter(e=>pgs(e).state.contains("is-locked"));let l=0;t&&(t.disabled=!0);let d=!1;if(!i||0===a)return;const u=[];function p(e,t,o){e&&o!==pgs(e).state.contains(t)&&pgs(e).state.toggle(t,o)}function g(){const e=s[l];t&&(t.disabled=0===l),o&&(o.disabled=l===a-1||pgs(e).state.contains("is-locked"))}function f(t,o=!0){l=Math.min(Math.max(t,0),a-1);const n=s[l];d=!0,s.forEach((e,t)=>p(e,"is-active",t===l)),g(),u.forEach((e,t)=>{p(e,"is-active",t===l),p(e,"is-completed",t<l)}),d=!1,o&&!e.closest("dialog")&&(n?.focus(),e?.scrollIntoView({behavior:"smooth",block:"start"})),e.dispatchEvent(new CustomEvent("stepTabs:change",{detail:{current:l,total:a}}))}function m(){f(0),c.forEach(e=>pgs(e).state.add("is-locked"))}r&&(r.innerHTML="",s.forEach((e,t)=>{const o=pgs(e).option.getValueBrackets("tabIcon")||"fa-circle",n=document.createElement("button");n.type="button",pgs(n).add("stepTabs-dots-dot"),n.setAttribute("data-step",t),n.innerHTML=`<i class="fa-solid ${o}"></i>`,n.addEventListener("click",()=>{pgs(n).state.contains("is-completed")&&f(t,!0)}),r.appendChild(n),u.push(n)})),f(0,!1);const h=new MutationObserver(()=>{d||g()});s?.forEach(e=>h.observe(e,{attributes:!0,attributeFilter:["pgs-state"]})),t?.addEventListener("click",e=>f(l-1)),o?.addEventListener("click",e=>{g(),o.disabled||f(l+1)}),n?.addEventListener("click",e=>m(),{capture:!0}),k.set(e,{element:e,container:i,restart:m,goTo:f,next:()=>f(l+1),prev:()=>f(l-1),toggleLock:(e,t=!0)=>"number"==typeof e&&s[e]&&(pgs(s[e]).state.toggle("is-locked",t),f(l)),refresh:()=>(L(e.parentNode||document),k.get(e)),getCurrent:()=>l,getState:()=>({current:l,total:a})})})}L();const x={PGS_name:"PGS_stepTabs",init:L,api:function(e){return k.get(e)}},_={_escapeHtml:e=>String(e??""),_getDuration(e){const t=e.duration,o=Number.parseInt(t,10);return Number.isNaN(o)?5e3:o},_getApi:e=>"toast"===String(e.element||"notification").trim()?M.toast:M.alert,_getType(e,t){const o=String(e.type||"info").trim();return"function"==typeof t[o]?o:"info"},_getData(e){try{return JSON.parse(e.dataset.notification||"{}")}catch(e){return console.warn("PGS notification: dati non validi",e),{}}},_getContent(e,t){const o=this._escapeHtml(t),n=this._escapeHtml(e);return n?o?`\n <span pgs="notification-element-title">${n}</span>\n <br>\n <span pgs="notification-element-content">${o}</span>\n `:`<span pgs="notification-element-title">${n}</span>`:o},initNotification(e,t,o,n,r,i="replace",s=null){let a=pgs(document).querySelector(t);if(!a){const e=document.createElement("div");pgs(e).add(t),e.setAttribute("aria-live","polite"),e.setAttribute("aria-relevant","additions"),document.body.appendChild(e),a=e}const c=document.createElement(s?"a":"div");function l(){"stack"==i?c.style.translate="120%":c.style.opacity="0",setTimeout(()=>c.remove(),300)}"replace"==i&&(a.innerHTML=""),s&&(c.href=s),r>0&&c.style.setProperty("--notification-timeout",r+"ms"),pgs(c).state.add(e),pgs(c).add("notification-element"),c.setAttribute("role","error"==e?"alert":"status"),c.innerHTML=`${o} <p>${n}</p>`,a.appendChild(c),r>0&&setTimeout(()=>{l()},r);const d=document.createElement("button");d.type="button",d.ariaLabel="Rimuovi notifica",d.innerHTML='<i class="fa-solid fa-xmark"></i>',d.setAttribute("pgs","buttonClose"),c.insertAdjacentElement("afterbegin",d),d.addEventListener("click",function(e){e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),l()})},deleteAll(e){let t=pgs(document).querySelector(e);t&&(t.innerHTML="")},trigger(e=document){pgs(e).querySelectorAll("notificationTrigger").forEach(e=>{if(!e||"true"===e.dataset.initialize)return;e.dataset.initialize="true";const t=this._getData(e),o=String(t.title||"").trim(),n=String(t.message||"").trim();if(!o&&!n)return void e.remove();const r=t.link||null,i=t.icon||void 0,s=this._getDuration(t),a=this._getApi(t),c=this._getType(t,a),l=this._getContent(o,n);a===M.toast?a[c](l,s,i):a[c](l,r,s,i),e.remove()})}};function P(e=document){return _.trigger(e)}const M={PGS_name:"PGS_notification",trigger:P,alert:{error:(e="Errore",t=null,o=0,n='<i class="fa-solid fa-octagon-xmark"></i>')=>_.initNotification("error","notification",n,e,o,"stack",t),success:(e="Aggiornato",t=null,o=0,n='<i class="fa-solid fa-check"></i>')=>_.initNotification("success","notification",n,e,o,"stack",t),info:(e="Aggiornamento",t=null,o=0,n='<i class="fa-solid fa-circle-info"></i>')=>_.initNotification("info","notification",n,e,o,"stack",t),warning:(e="Attenzione",t=null,o=0,n='<i class="fa-solid fa-triangle-exclamation"></i>')=>_.initNotification("warning","notification",n,e,o,"stack",t),deleteAll:()=>_.deleteAll("notification")},toast:{error:(e="Errore",t=4e3,o='<i class="fa-solid fa-octagon-xmark"></i>')=>_.initNotification("error","toast",o,e,t),success:(e="Aggiornato",t=4e3,o='<i class="fa-solid fa-check"></i>')=>_.initNotification("success","toast",o,e,t),info:(e="Aggiornamento",t=0,o='<i class="fa-solid fa-circle-info"></i>')=>_.initNotification("info","toast",o,e,t),warning:(e="Attenzione",t=4e3,o='<i class="fa-solid fa-triangle-exclamation"></i>')=>_.initNotification("warning","toast",o,e,t),deleteAll:()=>_.deleteAll("toast")}};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>P()):P(),e.registerImport({PGS_accordion:s,PGS_dropdown:d,PGS_menu:g,PGS_modal:h,PGS_notification:M,PGS_slides:v,PGS_stepTabs:x,PGS_steps:q,PGS_formValidate:class{constructor({form:e}={}){this.container=e,this._rules=[]}addError(e,t){e.setAttribute("data-form-field-status","error"),0==t&&e.scrollIntoView();let o=e.getAttribute("data-form-field-message");0==t&&o?M.toast.error(o):0==t&&M.toast.error("Compila tutti i campi!")}removeError(e){e.setAttribute("data-form-field-status","")}#i(e){e.forEach(e=>{e.addEventListener("click",t=>this.removeError(e))})}help={isRequired:e=>!!e&&((!0===e.required||"true"===e?.dataset?.required||"true"==e?.getAttribute("aria-required"))&&!e.hidden),isEmptyTextLike:e=>!String(e?.value??"").trim(),isEmptySelect:e=>!String(e?.value??"").trim(),getGroupName:e=>e?.name||e?.getAttribute?.("name")||""};#s(e){const t=[];for(const o of this._rules){const n=o(e);n&&(Array.isArray(n)?t.push(...n):t.push(n))}const o=Array.from(e.querySelectorAll("input")).filter(e=>!e.disabled&&"hidden"!==e.type&&"checkbox"!==e.type&&"radio"!==e.type&&"file"!==e.type&&!!this.help.isRequired(e)&&this.help.isEmptyTextLike(e)),n=Array.from(e.querySelectorAll("textarea")).filter(e=>!e.disabled&&!!this.help.isRequired(e)&&this.help.isEmptyTextLike(e)),r=Array.from(e.querySelectorAll("select")).filter(e=>!e.disabled&&!!this.help.isRequired(e)&&this.help.isEmptySelect(e)),i=Array.from(e.querySelectorAll('input[type="radio"]')).filter(e=>!e.disabled),s=new Map;for(const e of i){if(!this.help.isRequired(e))continue;const t=this.help.getGroupName(e);t&&(s.has(t)||s.set(t,[]),s.get(t).push(e))}const a=[];for(const[e,t]of s.entries())t.some(e=>e.checked)||a.push(t[0]);const c=Array.from(e.querySelectorAll('input[type="checkbox"]')).filter(e=>!e.disabled),l=[],d=new Map;for(const e of c){if(!this.help.isRequired(e))continue;const t=this.help.getGroupName(e);t?(d.has(t)||d.set(t,[]),d.get(t).push(e)):e.checked||l.push(e)}const u=[];for(const[e,t]of d.entries())t.some(e=>e.checked)||u.push(t[0]);return[o,n,r,a,l,u,Array.from(e.querySelectorAll('input[type="file"]')).filter(e=>!(e.disabled||!this.help.isRequired(e)||e.files&&e.files.length>0)),t].flat()}validate(){const e=this.#s(this.container),t=this.container.querySelectorAll("input, textarea, select");Array.from(t).filter(e=>!e.disabled);for(const o of t)e.includes(o)||this.removeError(o);return e.forEach((e,t)=>this.addError(e,t)),this.#i(t),e.length?(this.container.setAttribute("data-form-status","error"),!1):(this.container.setAttribute("data-form-status","success"),!0)}ifSuccess(e="Inviato con successo"){1==this.validate()&&M.toast.success(e)}addNewRule(e){if("function"!=typeof e)throw new Error("Rule must be a function");return this._rules.push(e),this}},PGS_scrollHorizontal:b}),o(107),o(48)})()})();
1
+ (()=>{var e={795(){function e(e="svg"){const t=getComputedStyle(document.documentElement),n=[];for(let o=0;o<20;o++){const r=t.getPropertyValue("--"+e+"-color-"+o).toLocaleLowerCase().split("&");if(""==!r[0]&&""==!r[1]){let e=[r[0],r[1]];n.push(e)}}return n}const t=[e("svg"),e("lottie")];let n=pgs(document).querySelectorAll("toggleDarkmode");function o(e,n){e.forEach(e=>{const t=e.querySelector("i");t&&(t.classList.toggle("fa-moon",!n),t.classList.toggle("fa-sun",n))}),function(){function e(e,n="svg"){let o="true"!==document.documentElement.getAttribute("data-darkmode");e.querySelectorAll("[fill], [stroke]").forEach(e=>{for(const n of t)for(const t of n){let n=(t[0]||"").replace(/\s/g,""),r=(t[1]||"").replace(/\s/g,"");["fill","stroke"].forEach(t=>{const i=e.getAttribute(t);e.style.transition="fill 0.5s ease, stroke 0.5s ease",o?i==r&&e.setAttribute(t,n):i==n&&e.setAttribute(t,r)})}})}document.querySelectorAll('object[type="image/svg+xml"]').forEach(t=>{if(t.addEventListener("load",()=>{const n=t.contentDocument;n&&e(n,"svg")}),t.contentDocument){const e=new Event("load");t.dispatchEvent(e)}}),document.querySelectorAll("lottie-player").forEach(t=>{if(t.addEventListener("load",()=>{const n=t.shadowRoot.querySelector("svg");n&&e(n,"lottie")}),t.shadowRoot){const e=new Event("load");t.dispatchEvent(e)}})}()}"true"===localStorage.getItem("screenIsDarkMode")&&(document.body.classList.add("darkmode"),document.querySelector(":root").setAttribute("data-darkmode","true"),document.body.setAttribute("data-darkmode","true")),n.forEach(e=>{let t="true"===document.documentElement.getAttribute("data-darkmode");o(n,t),e.addEventListener("click",()=>{let e="true"!==document.documentElement.getAttribute("data-darkmode");localStorage.setItem("screenIsDarkMode",e),document.body.classList.toggle("darkmode",e),document.body.setAttribute("data-darkmode",e),document.querySelector(":root").setAttribute("data-darkmode",e),o(n,e)})})},359(){document.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll('object[type="image/svg+xml"]').forEach(e=>{function t(t){if(!t)return;const n=t.querySelector("svg");if(!n)return;const o=window.getComputedStyle(e);n.setAttribute("preserveAspectRatio","cover"===o.objectFit?"xMidYMid slice":"xMidYMid meet")}function n(){const n=e.contentDocument;if(!n)return;if(!n.querySelector("svg"))return;if(t(n),e.__objectResizeObserver)return;let o=0;const r=new ResizeObserver(()=>{o||(o=requestAnimationFrame(()=>{o=0,t(n)}))});r.observe(e),e.__objectResizeObserver=r}e.contentDocument&&e.contentDocument.querySelector("svg")?n():e.addEventListener("load",n,{once:!0})}),document.body.classList.add("object-loaded")})},48(){const e="pgs_cookie_preferences_v1";function t(){window.dataLayer=window.dataLayer||[],window.gtag=window.gtag||function(){window.dataLayer.push(arguments)}}function n(e,t,n){if(!(e instanceof HTMLElement&&t))return;const o=(e.getAttribute("pgs")||"").split(/\s+/).filter(Boolean),r=n?[...new Set([...o,t])]:o.filter(e=>e!==t);r.length>0?e.setAttribute("pgs",r.join(" ")):e.removeAttribute("pgs")}function o(){const o=pgs(document).querySelector("cookieConsent");if(!o)return;const r=o.querySelector('[pgs~="cookieConsent-toggleAnalytics"]'),i=o.querySelector('[pgs~="cookieConsent-actionAccept"]'),s=o.querySelector('[pgs~="cookieConsent-actionReject"]'),a=document.querySelectorAll('[pgs~="cookieConsent-actionOpen"]'),c=(o.dataset.gaId||"").trim(),l=c.length>0;let d=null;function u(e){o.hidden=!e,o.setAttribute("aria-hidden",String(!e)),document.body.classList.toggle("cookieConsent-open",e),e?(d=document.activeElement,setTimeout(()=>{o.focus()},0)):d instanceof HTMLElement&&d.focus({preventScroll:!0})}function p(){u(!1)}function g(r){!function(t){try{localStorage.setItem(e,JSON.stringify({...t,updatedAt:(new Date).toISOString()}))}catch(e){console.warn("PGS cookie consent: impossibile salvare le preferenze",e)}}({analytics:r}),n(o,"cookieConsent-accepted",!!r),n(o,"cookieConsent-declined",!r),function({allowAnalytics:e,measurementId:n}){t(),e?(window.gtag("consent","update",{analytics_storage:"granted"}),function(e){if(!e||window.__PGS_gaLoaded)return;window.__PGS_gaLoaded=!0;const t=document.createElement("script");t.async=!0,t.src=`https://www.googletagmanager.com/gtag/js?id=${e}`,document.head.appendChild(t),window.gtag("js",new Date),window.gtag("config",e,{anonymize_ip:!0,allow_google_signals:!1})}(n)):window.gtag("consent","update",{analytics_storage:"denied"})}({allowAnalytics:!!r,measurementId:c})}!function({root:e,analyticsToggle:t,acceptAllButton:n,rejectButton:o,openButtons:r}){e.dataset.cookieComponent="consent",t?.setAttribute("data-cookie-toggle","analytics"),n?.setAttribute("data-cookie-action","accept"),o?.setAttribute("data-cookie-action","reject"),e.querySelector('[pgs~="cookieConsent-featureEssential"]')?.setAttribute("data-cookie-feature","essential"),e.querySelector('[pgs~="cookieConsent-featureAnalytics"]')?.setAttribute("data-cookie-feature","analytics"),r.forEach(e=>{e.setAttribute("data-cookie-action","open")})}({root:o,analyticsToggle:r,acceptAllButton:i,rejectButton:s,openButtons:a}),r&&(r.disabled=!l,l?n(o,"cookieConsent-gaUnavailable",!1):(r.checked=!1,n(o,"cookieConsent-gaUnavailable",!0))),t(),window.gtag("consent","default",{analytics_storage:"denied"}),i?.addEventListener("click",()=>{r&&l&&(r.checked=!0),g(!!l),p()}),s?.addEventListener("click",()=>{const e=!!r&&r.checked&&l;!e&&r&&(r.checked=!1),g(e),p()}),r?.addEventListener("change",e=>{!l&&e.target instanceof HTMLInputElement&&(e.target.checked=!1)}),o.addEventListener("keydown",e=>{if("Escape"===e.key)e.preventDefault(),p();else if("Tab"===e.key){const t=o.querySelectorAll('a[href], button:not([disabled]), input:not([disabled]), [tabindex]:not([tabindex="-1"])');if(0===t.length)return;const n=t[0],r=t[t.length-1];e.shiftKey||document.activeElement!==r||(e.preventDefault(),n.focus()),e.shiftKey&&document.activeElement===n&&(e.preventDefault(),r.focus())}}),a.forEach(e=>{e.addEventListener("click",e=>{e.preventDefault(),u(!0)})});const f=function(){try{return function(e){try{return e?JSON.parse(e):null}catch(e){return console.warn("PGS cookie consent: impossibile leggere le preferenze",e),null}}(localStorage.getItem(e))}catch(e){return null}}();f&&"boolean"==typeof f.analytics?(r&&(r.checked=!!f.analytics&&l),g(f.analytics&&l),p()):u(!0)}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",o):o()},107(){const e=pgs(document).querySelector("header");pgs(e).querySelectorAll("header-element").forEach(t=>function(t){if("true"==t.getAttribute("data-initialize"))return;t.setAttribute("data-initialize","true");let n,o=!1;let r=0;const i=()=>{r||(r=requestAnimationFrame(()=>{r=0,function(r){let i,s=window.getComputedStyle(r),a=parseFloat(s.paddingLeft)+parseFloat(s.paddingRight),c=parseFloat(s.gap),l=parseInt(r.offsetWidth-a);if(o)i=n;else{let e=[];Array.from(r.children).filter(e=>!pgs(e).contains("header-element-onlyMobile")).forEach(t=>{pgs(t).contains("header-element-hamburger")||e.push(...t.children)}),c=Math.round(c*(e.length-1)),i=e.reduce((e,t)=>e+t.offsetWidth,0)-2+c}window.innerWidth<600?(e.setAttribute("data-header-mobileActive","true"),t.setAttribute("data-header-mobileActive","true")):l<i?(e.setAttribute("data-header-mobileActive","true"),r.setAttribute("data-header-mobileActive","true"),o=!0,n=i):(e.setAttribute("data-header-mobileActive","false"),r.setAttribute("data-header-mobileActive","false"))}(t)}))};new ResizeObserver(i).observe(t),i()}(t));const t=document.querySelector("body");function n(){const e=document.querySelectorAll("header > [data-initialize=true]"),n=window.getComputedStyle(document.documentElement).marginTop??0,o=Array.from(e).map(e=>e.offsetHeight).reduce((e,t)=>e+t)+parseInt(n);t.style.setProperty("--heightOfHeader",`${o}px`);const r="true"===document.querySelector("header").getAttribute("data-header-scroll")?0:o;t.style.setProperty("--heightOfHeaderScroll",`${r}px`)}n(),window.addEventListener("resize",n),window.addEventListener("scroll",n);let o=window.scrollY;window.addEventListener("scroll",()=>{let t=window.scrollY;window.innerHeight<=900&&(t>=80?t>o?(e.style.transform="translateY(-100%)",e.setAttribute("data-header-scroll",!0)):(e.style.transform="translateY(0px)",e.setAttribute("data-header-scroll",!1)):(e.style.transform="translateY(0)",e.setAttribute("data-header-scroll",!1))),o=t}),window.addEventListener("resize",()=>{window.innerWidth>768&&(e.style.transform="translateY(0)")}),window.innerWidth<600&&(document.querySelector("header").setAttribute("data-header-mobileActive","true"),document.querySelector("[pgs~=header-element]").setAttribute("data-header-mobileActive","true"))}};const t={};function n(o){const r=t[o];if(void 0!==r)return r.exports;const i=t[o]={exports:{}};return e[o](i,i.exports,n),i.exports}(()=>{"use strict";function e(e){const t="pgs";if(!e)throw new TypeError("pgs(root): root richiesto");const n="function"==typeof e.getAttribute&&"function"==typeof e.setAttribute;if("function"!=typeof e.querySelector||"function"!=typeof e.querySelectorAll)throw new TypeError("pgs(root): root deve supportare querySelector/querySelectorAll");function o(t){throw new TypeError(`pgs(${e.nodeName||"root"}).${t}(): disponibile solo su Element (non su Document)`)}function r(e){return Array.isArray(e)&&(e=e.join(",")),String(e).split(",").map(e=>e.trim()).filter(Boolean).map(e=>`[${t}~="${e}"]`).join(",")}function i(e,n=" "){return(e.getAttribute(t)||"").split(n).filter(Boolean)}function s(e,n,o=" "){e.setAttribute(t,n.join(o))}const a=function(){function a(){return a}return a.querySelector=function(t){return e.querySelector(r(t))},a.querySelectorAll=function(t){return e.querySelectorAll(r(t))},a.add=function(...t){if(!n)return o("add");const r=i(e);for(const e of t)r.includes(e)||r.push(e);return s(e,r),a},a.remove=function(...t){return n?(s(e,i(e).filter(e=>!t.includes(e))),a):o("remove")},a.toggle=function(t,r){if(!n)return o("toggle");const s=i(e).includes(t);return void 0!==r?(r&&!s&&a.add(t),!r&&s&&a.remove(t),!!r):s?(a.remove(t),!1):(a.add(t),!0)},a.contains=function(t){return n?i(e).includes(t):o("contains")},Object.defineProperty(a,"value",{get(){if(n)return e.getAttribute(t)},set(r){if(!n)return o("value");e.setAttribute(t,r)}}),a}();return a.state=function(t){if(!n)return;const o=(n=" ")=>(e.getAttribute(t)||"").split(n).filter(Boolean),r=(n,o=" ")=>e.setAttribute(t,n.join(o));function i(...e){return i.add(...e),i}return i.add=function(...e){const t=e.flat().map(e=>String(e).trim()).filter(Boolean),n=o();for(const e of t)n.includes(e)||n.push(e);return r(n),i},i.remove=function(...e){const t=e.flat().map(e=>String(e).trim()).filter(Boolean),n=o().filter(e=>!t.includes(e));return r(n),i},i.toggle=function(e,t){const n=String(e).trim();if(!n)return!1;const i=o(),s=i.includes(n);return void 0!==t?(t&&!s&&(i.push(n),r(i)),!t&&s&&r(i.filter(e=>e!==n)),!!t):s?(r(i.filter(e=>e!==n)),!1):(i.push(n),r(i),!0)},i.contains=function(e){const t=String(e).trim();return!!t&&o().includes(t)},Object.defineProperty(i,"value",{get:()=>e.getAttribute(t),set(n){e.setAttribute(t,n)}}),i}("pgs-state"),a.option=function(t){if(n)return o.contains=function(n){const o=e.getAttribute(t)||"",r=String(n).replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`(?:^|\\s)${r}(?:\\[[^\\]]*\\])?(?=\\s|$)`).test(o)},o.getValueBrackets=function(n){const o=e.getAttribute(t)||"",r=String(n).replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),i=o.match(new RegExp(`(?:^|\\s)${r}\\[([^\\]]*)\\]`));return i?i[1]:void 0},Object.defineProperty(o,"value",{get:()=>e.getAttribute(t),set(n){e.setAttribute(t,n)}}),o;function o(){return o}}("pgs-option"),a}const t={};function o(e,n){const o=String(e||"").trim().replace(/^pgs[_-\s]*/i,"").toLowerCase();if(!o)throw new TypeError("pgs.registerImport(...modules): ogni modulo deve avere name o PGS_name");t[o]={name:e,module:n}}e.registerImport=function(...t){return t.flat().forEach(e=>{!e||"object"!=typeof e||e.PGS_name||e.name?o(e?.PGS_name||e?.name,e):Object.entries(e).forEach(([e,t])=>o(e,t))}),e},e.registerModules=function(t={}){return Object.entries(t).forEach(([t,n])=>{const o=String(t||"").trim();if(o){if(Object.prototype.hasOwnProperty.call(e,o)&&e[o]!==n)throw new Error(`pgs.registerModules(): "${o}" e' gia' definito su pgs`);e[o]=n}}),e},e.import=function(...e){return e.flat().reduce((e,n)=>{const o=String(n||"").trim().replace(/^pgs[_-\s]*/i,"").toLowerCase(),r=t[o];if(!r)throw new Error(`pgs.import(): modulo "${n}" non registrato`);return e[r.name]=r.module,e},{})},globalThis.pgs??=e,n(795),n(359);const r=new WeakMap;let i=0;function s(e,t){return Array.from(e.children).find(e=>pgs(e).contains(t))}function a(e=document){pgs(e).querySelectorAll("accordion").forEach(e=>{if(r.has(e))return;const t=s(e,"accordion-button"),n=s(e,"accordion-content");if(!t||!n)return;const o=(i+=1,i),c=`acc-btn-${o}`,l=`acc-panel-${o}`,d=pgs(e).state.contains("open");function u(e,t,n){const o=(t?.textContent||"").trim().replace(/\s+/g," ");t.setAttribute("aria-label",`${e?"Chiudi":"Apri"} ${o||"sezione"}`),t.setAttribute("aria-expanded",String(e)),n.hidden=!e}function p(){const o=!pgs(e).state.contains("open");pgs(e).state.toggle("open",o),u(o,t,n),function(){for(const t of pgs(document).querySelectorAll("accordion")){if(t===e)continue;const n=pgs(t).querySelector("accordion-button"),o=pgs(t).querySelector("accordion-content");n&&o&&(pgs(t).state().remove("open"),u(!1,n,o))}}(),o&&setTimeout(()=>e.scrollIntoView({block:"nearest",inline:"nearest"}),100)}t.setAttribute("role","button"),t.setAttribute("tabindex","0"),t.id||t.setAttribute("id",c),n.id||n.setAttribute("id",l),t.setAttribute("aria-controls",n.id),n.setAttribute("role","region"),n.setAttribute("aria-labelledby",t.id),u(d,t,n),t.addEventListener("click",p),t.addEventListener("keydown",e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),p())}),r.set(e,{element:e,button:t,content:n,open:function(){pgs(e).state.contains("open")||p()},close:function(){pgs(e).state.contains("open")&&p()},toggle:p,refresh:()=>(a(e.parentNode||document),r.get(e)),isOpen:()=>pgs(e).state.contains("open")})})}a();const c={init:a,api:function(e){return r.get(e)}},l=new WeakMap,d=new Set;let u=0;function p(e){return e instanceof Element&&pgs(e).contains("dropdown-content")}function g(e){const t=l.get(e);if(!t||!t.isOpen())return;const{trigger:n,content:o}=t,{side:r,align:i}=function(e){const t=(pgs(e).option.getValueBrackets("position")||"bottom center").trim().toLowerCase().split(/\s+/).filter(Boolean),n=t.find(e=>["top","right","bottom","left"].includes(e))||"bottom",o=t.find(e=>["top","right","bottom","left","center"].includes(e)&&e!==n)||"center";return{side:n,align:o}}(e),s=n.getBoundingClientRect(),a=o.getBoundingClientRect(),c=document.documentElement.clientWidth,d=Math.max(8,c-a.width-8);let u=s.left+(s.width-a.width)/2,p=s.bottom+8;var g,f;"top"!==r&&"bottom"!==r||(p="top"===r?s.top-a.height-8:s.bottom+8,"left"===i&&(u=s.left),"right"===i&&(u=s.right-a.width)),"left"!==r&&"right"!==r||(u="left"===r?s.left-a.width-8:s.right+8,p=s.top+(s.height-a.height)/2,"top"===i&&(p=s.top),"bottom"===i&&(p=s.bottom-a.height)),"left"===r&&u<8&&(u=s.right+8),"right"===r&&u+a.width>c-8&&(u=s.left-a.width-8),g=u,f=d,u=Math.min(Math.max(g,8),f),o.style.setProperty("--dropdown-left",`${Math.round(u)}px`),o.style.setProperty("--dropdown-top",`${Math.round(p)}px`)}function f(){d.forEach(g)}function m(e){const t=l.get(e);t&&t.isOpen()&&(pgs(e).state.remove("open"),t.trigger.setAttribute("aria-expanded","false"),d.delete(e))}function h(e){const t=l.get(e);t&&!t.isOpen()&&(d.forEach(t=>{t!==e&&m(t)}),pgs(e).state.add("open"),t.trigger.setAttribute("aria-expanded","true"),d.add(e),g(e))}function b(e){const t=l.get(e);t&&(t.isOpen()?m(e):h(e))}function y(e=document){(function(e){const t=e instanceof Element&&pgs(e).contains("dropdown")?[e]:[];return t.push(...pgs(e).querySelectorAll("dropdown")),t})(e).forEach(e=>{if(l.has(e))return;const t=(n=e,Array.from(n.children).find(p)||pgs(n).querySelector("dropdown-content"));var n;if(!t)return;const o=function(e,t){const n=Array.from(e.children).filter(e=>e!==t);return n.find(e=>pgs(e).contains("dropdown-button"))||n.find(e=>!p(e))||e}(e,t),r=(u+=1,u);o.id||(o.id=`dropdown-btn-${r}`),t.id||(t.id=`dropdown-panel-${r}`),o.matches("button")&&!o.hasAttribute("type")&&o.setAttribute("type","button"),o.setAttribute("aria-haspopup","true"),o.setAttribute("aria-controls",t.id),o.setAttribute("aria-expanded",String(pgs(e).state.contains("open"))),t.setAttribute("aria-labelledby",o.id);const i={element:e,trigger:o,content:t,open:()=>h(e),close:()=>m(e),toggle:()=>b(e),refresh:()=>(y(e.parentNode||document),g(e),l.get(e)),isOpen:()=>pgs(e).state.contains("open")};o.addEventListener("click",t=>{p(t.target)||(t.preventDefault(),t.stopPropagation(),b(e))}),t.addEventListener("click",e=>e.stopPropagation()),l.set(e,i),i.isOpen()&&d.add(e),g(e)})}document.addEventListener("click",e=>{var t;t=e.target,Array.from(d).some(e=>e.contains(t))||d.forEach(m)}),document.addEventListener("keydown",e=>{"Escape"===e.key&&d.forEach(m)}),window.addEventListener("resize",f),window.addEventListener("scroll",f,!0),y();const A={init:y,api:function(e){return l.get(e)}},v=new WeakMap;function w(e=document){pgs(e).querySelectorAll("menu").forEach(e=>{v.has(e)||(e.querySelectorAll("li").forEach(e=>{const t=e.querySelector("ul");if(t){const n=document.createElement("button");n.type="button",n.innerHTML="<span>&#9207;</span>",pgs(n).add("menu-buttonIcon"),e.querySelector("a").insertAdjacentElement("afterend",n),pgs(e).add("dropdown"),pgs(n).add("dropdown-button"),pgs(n).add("buttonNohover"),pgs(t).add("dropdown-content")}}),v.set(e,{element:e,type:"horizontal",refresh:()=>(w(e.parentNode||document),v.get(e))}),A.init(e))})}w();const S={init:w,api:function(e){return v.get(e)}},E=new WeakMap;function k(e="modal"){pgs(document).querySelectorAll(e).forEach(t=>{if(E.has(t))return;const n=pgs(t).querySelector("modal-button"),o=t.querySelector("dialog");if(!n||!o)return;const r='<button pgs="buttonClose modal-close" type="button" tabindex="0" aria-label="Chiudi"><i class="fa-solid fa-close"></i></button>',i=pgs(t)?.querySelector("modal-dialog-content-header"),s=pgs(t).option.contains("disableBackdropClose"),a=pgs(t).option.contains("history"),c=pgs(t).option.getValueBrackets("containerID"),l=pgs(t).option.getValueBrackets("containerPGS"),d=pgs(o).option.contains("topLevel");pgs(t).querySelector("modal-close")||(i?i.insertAdjacentHTML("beforeend",r):o.insertAdjacentHTML("beforeend",r));const u=pgs(t).querySelector("modal-close");function p(e=!0){n?.setAttribute("aria-expanded",e),o?.setAttribute("aria-expanded",e)}function g(e){e?.stopImmediatePropagation(),o.open?f(e):(o.open||document.querySelectorAll("dialog[open]").forEach(e=>e.close()),p(!0),d?o.showModal():o.show(),t.dispatchEvent(new CustomEvent("modal:open")),o.dispatchEvent(new CustomEvent("modal:open")))}function f(e){e?.stopImmediatePropagation(),p(!1),o.close(),t.dispatchEvent(new CustomEvent("modal:close")),o.dispatchEvent(new CustomEvent("modal:close"))}pgs(o).add("dialog modal-dialog"),n.setAttribute("role","button"),n.setAttribute("aria-label","apri modale"),d||(c?document.querySelector("#"+c)?.append(o):l?pgs(document).querySelector(l)?.append(o):document.body.append(o)),n.addEventListener("click",e=>g(e)),n.addEventListener("keypress",e=>!o.open&&("Enter"===e.key||" "===e.key)&&g(e)),o.addEventListener("close",()=>p(!1)),o.addEventListener("click",e=>{e.target!=o||s||f(e)}),u?.addEventListener("click",e=>f(e)),a&&n.id&&(setTimeout(function(){new URLSearchParams(window.location.search).get("modal")===n.id&&(document.getElementById(n.id)?.scrollIntoView({behavior:"smooth"}),g())},1),new MutationObserver(()=>{let e=o.hasAttribute("open");try{const t=new URL(window.location.href),o=new URLSearchParams(t.search);e?o.set("modal",n.id):o.delete("modal"),t.search=o.toString()?`?${o.toString()}`:"",window.history.pushState({modal:n.id,open:e},"",t)}catch(e){}}).observe(o,{attributes:!0,attributeFilter:["open"]}),window.addEventListener("popstate",()=>{try{const e=new URLSearchParams(window.location.search).get("modal")===n.id;e&&!o.open&&o.showModal(),!e&&o.open&&f()}catch(e){}})),E.set(t,{element:t,button:n,dialog:o,closeButton:u,open:function(e){o.open||g(e)},close:function(e){o.open&&f(e)},toggle:g,refresh:()=>(k(e),E.get(t)),isOpen:()=>o.open})})}k();const q={init:k,api:function(e){return E.get(e)}};function L(e,t){const n=(()=>{let e=0,t=0,n=0,o=!1;return{update:function(r){const i=performance.now(),s=i-e;let a=Math.abs(r.deltaY);return 1===r.deltaMode?a*=16:2===r.deltaMode&&(a*=r.currentTarget?.clientHeight||800),a<30&&s<35&&t++,n++,n>=6&&(o=t>=3,t=0,n=0),e=i,o},get value(){return o}}})();let o=e;o.addEventListener("wheel",e=>{const r=t;if(n.update(e))return;if(e.ctrlKey)return;if(Math.abs(e.deltaX)>Math.abs(e.deltaY))return;let i=e.deltaY;1===e.deltaMode?i*=16:2===e.deltaMode&&(i*=o.clientHeight);const s=o.scrollLeft<=0,a=o.scrollLeft+o.clientWidth>=o.scrollWidth-1;(i>0&&!a||i<0&&!s)&&(e.preventDefault(),o.scrollLeft+=i*r)},{passive:!1})}const M=new WeakMap;class x{constructor({selector:e,viewRatio:t=.97,optionIntersectionObserver:n={},scrollOptions:o={}}={}){this.selector=e,this.viewRatio=t,this.optionIntersectionObserver={threshold:Array.from({length:101},(e,t)=>t/100),rootMargin:"0px",...n},this.scrollOptions={behavior:"smooth",inline:"center",block:"nearest",container:"nearest",...o},this.container=this.selector?pgs(this.selector).querySelector("slides-container"):null}#e(){const e=this.selector;pgs(e).querySelector("slides-prec")||pgs(e).querySelector("slides-next")||(e.insertAdjacentHTML("afterbegin",'<button pgs="slides-prec buttonIcon" type="button" class="precButton" aria-label="slide precedente"> <span> <i class="fa-solid fa-arrow-left"></i></span></button>'),e.insertAdjacentHTML("beforeend",'<button pgs="slides-next buttonIcon" type="button" class="nextButton" aria-label="prossima slide"> <span> <i class="fa-solid fa-arrow-right"></i></span></button>')),pgs(e).querySelector("slides-dots")||(e.insertAdjacentHTML("beforeend",'<div pgs="slides-dots" class="slides-dots"></div>'),Array.from(this.container.children).forEach(()=>{pgs(e).querySelector("slides-dots").insertAdjacentHTML("beforeend",'<button type="button" class="slide-dot" aria-label="vai alla prossima slide"></button>')}))}#t(){const e=this.container.querySelectorAll(".view");let t;t=pgs(this.selector).option.contains("singleScroll")?e[e.length-1]:e[0];const n=t?.previousElementSibling;n?.scrollIntoView(this.scrollOptions),n?.focus({preventScroll:!0})}#n(){const e=this.container.querySelectorAll(".view");let t;t=pgs(this.selector).option.contains("singleScroll")?e[0]:e[e.length-1];const n=t?.nextElementSibling;console.log(t,n),n?.scrollIntoView(this.scrollOptions),n?.focus({preventScroll:!0})}#o(e){this.container.children[e].scrollIntoView(this.scrollOptions)}#r(e,t,n,o,r){e.forEach(e=>{const i=.9+.1*e.intersectionRatio,s=i>=.98;!pgs(e.target).option.contains("notScrollAnimation")&&e.target.firstElementChild&&e.target.firstElementChild.style.setProperty("--visible-percent",`${i}`),e.target.classList.toggle("view",s),e.target.classList.toggle("notView",!s);const a=e.target.parentNode.children,c=a[0].classList.contains("view"),l=a[a.length-1].classList.contains("view");o.disabled=l,n.disabled=c,o.setAttribute("aria-disabled",String(l)),n.setAttribute("aria-disabled",String(c));const d=Array.from(t.children).filter(e=>e.classList.contains("view"));r.forEach((e,n)=>{const o=d.some(e=>Array.from(t.children).indexOf(e)===n);e.classList.toggle("active",o),e.setAttribute("aria-current",o?"true":"false")})})}execute(){const e=this.selector;if(!this.container)return;this.#e();const t=pgs(e).querySelector("slides-prec"),n=pgs(e).querySelector("slides-next"),o=Array.from(pgs(e).querySelector("slides-dots").children);pgs(e).option.contains("notScrollWithMouse")||L(this.container,5),o.forEach((e,t)=>e.addEventListener("click",e=>this.#o(t))),t.addEventListener("click",e=>this.#t(),{passive:!0}),n.addEventListener("click",e=>this.#n(),{passive:!0});const r=new IntersectionObserver(e=>this.#r(e,this.container,t,n,o),{root:this.container,...this.optionIntersectionObserver});Array.from(this.container.children).forEach(e=>r.observe(e)),M.set(this.selector,{element:this.selector,container:this.container,previous:()=>this.#t(),next:()=>this.#n(),goTo:e=>this.#o(e),getCurrentIndexes:()=>Array.from(this.container.children).map((e,t)=>e.classList.contains("view")?t:-1).filter(e=>-1!==e),getCurrentElements:()=>Array.from(this.container.children).filter(e=>e.classList.contains("view")),getTotal:()=>this.container.children.length,isAtStart:()=>this.container.children[0]?.classList.contains("view")||!1,isAtEnd:()=>{const e=this.container.children,t=e[e.length-1];return t?.classList.contains("view")||!1},refresh:()=>(T(this.selector.parentNode||document),M.get(this.selector))})}}function T(e=document){pgs(e).querySelectorAll("slides").forEach(e=>{M.has(e)||new x({selector:e}).execute()})}T();const C={init:T,api:function(e){return M.get(e)}},O=new WeakMap;function I(e=document){pgs(e).querySelectorAll("steps").forEach(e=>{O.has(e)||(pgs(e).querySelectorAll("steps-step").forEach((e,t)=>{let n;if(pgs(e).querySelector("steps-step-circle")?n=pgs(e).querySelector("steps-step-circle"):(n=document.createElement("span"),pgs(n).add("steps-step-circle"),n.textContent=t+1,e.insertAdjacentElement("afterbegin",n)),!pgs(e).querySelector("steps-step-line")){const t=document.createElement("span");pgs(t).add("steps-step-line"),e.insertAdjacentElement("afterbegin",t)}}),O.set(e,{element:e,steps:()=>Array.from(pgs(e).querySelectorAll("steps-step")),getStep:t=>pgs(e).querySelectorAll("steps-step")[t],getTotal:()=>pgs(e).querySelectorAll("steps-step").length,refresh:()=>(O.delete(e),I(e.parentNode||document),O.get(e))}))})}I();const _={init:I,api:function(e){return O.get(e)}},j=new WeakMap;function N(e=document){pgs(e).querySelectorAll("stepTabs").forEach(e=>{if("true"===e.dataset.stepTabsInitialized)return;e.dataset.stepTabsInitialized="true";const t=pgs(e).querySelector("stepTabs-prev"),n=pgs(e).querySelector("stepTabs-next"),o=pgs(e).querySelector("stepTabs-restart"),r=pgs(e).querySelector("stepTabs-dots"),i=pgs(e).querySelector("stepTabs-container"),s=pgs(i).querySelectorAll("tab"),a=s.length,c=Array.from(s).filter(e=>pgs(e).state.contains("is-locked"));let l=0;t&&(t.disabled=!0);let d=!1;if(!i||0===a)return;const u=[];function p(e,t,n){e&&n!==pgs(e).state.contains(t)&&pgs(e).state.toggle(t,n)}function g(){const e=s[l];t&&(t.disabled=0===l),n&&(n.disabled=l===a-1||pgs(e).state.contains("is-locked"))}function f(t,n=!0){l=Math.min(Math.max(t,0),a-1);const o=s[l];d=!0,s.forEach((e,t)=>p(e,"is-active",t===l)),g(),u.forEach((e,t)=>{p(e,"is-active",t===l),p(e,"is-completed",t<l)}),d=!1,n&&!e.closest("dialog")&&(o?.focus(),e?.scrollIntoView({behavior:"smooth",block:"start"})),e.dispatchEvent(new CustomEvent("stepTabs:change",{detail:{current:l,total:a}}))}function m(){f(0),c.forEach(e=>pgs(e).state.add("is-locked"))}r&&(r.innerHTML="",s.forEach((e,t)=>{const n=pgs(e).option.getValueBrackets("tabIcon")||"fa-circle",o=document.createElement("button");o.type="button",pgs(o).add("stepTabs-dots-dot"),o.setAttribute("data-step",t),o.innerHTML=`<i class="fa-solid ${n}"></i>`,o.addEventListener("click",()=>{pgs(o).state.contains("is-completed")&&f(t,!0)}),r.appendChild(o),u.push(o)})),f(0,!1);const h=new MutationObserver(()=>{d||g()});s?.forEach(e=>h.observe(e,{attributes:!0,attributeFilter:["pgs-state"]})),t?.addEventListener("click",e=>f(l-1)),n?.addEventListener("click",e=>{g(),n.disabled||f(l+1)}),o?.addEventListener("click",e=>m(),{capture:!0}),j.set(e,{element:e,container:i,restart:m,goTo:f,next:()=>f(l+1),prev:()=>f(l-1),toggleLock:(e,t=!0)=>"number"==typeof e&&s[e]&&(pgs(s[e]).state.toggle("is-locked",t),f(l)),refresh:()=>(N(e.parentNode||document),j.get(e)),getCurrent:()=>l,getState:()=>({current:l,total:a})})})}N();const $={init:N,api:function(e){return j.get(e)}},R={_escapeHtml:e=>String(e??""),_getDuration(e){const t=e.duration,n=Number.parseInt(t,10);return Number.isNaN(n)?5e3:n},_getApi:e=>"toast"===String(e.element||"notification").trim()?P.toast:P.alert,_getType(e,t){const n=String(e.type||"info").trim();return"function"==typeof t[n]?n:"info"},_getData(e){try{return JSON.parse(e.dataset.notification||"{}")}catch(e){return console.warn("PGS notification: dati non validi",e),{}}},_getContent(e,t){const n=this._escapeHtml(t),o=this._escapeHtml(e);return o?n?`\n <span pgs="notification-element-title">${o}</span>\n <br>\n <span pgs="notification-element-content">${n}</span>\n `:`<span pgs="notification-element-title">${o}</span>`:n},initNotification(e,t,n,o,r,i="replace",s=null){let a=pgs(document).querySelector(t);if(!a){const e=document.createElement("div");pgs(e).add(t),e.setAttribute("aria-live","polite"),e.setAttribute("aria-relevant","additions"),document.body.appendChild(e),a=e}const c=document.createElement(s?"a":"div");function l(){"stack"==i?c.style.translate="120%":c.style.opacity="0",setTimeout(()=>c.remove(),300)}"replace"==i&&(a.innerHTML=""),s&&(c.href=s),r>0&&c.style.setProperty("--notification-timeout",r+"ms"),pgs(c).state.add(e),pgs(c).add("notification-element"),c.setAttribute("role","error"==e?"alert":"status"),c.innerHTML=`${n} <p>${o}</p>`,a.appendChild(c),r>0&&setTimeout(()=>{l()},r);const d=document.createElement("button");d.type="button",d.ariaLabel="Rimuovi notifica",d.innerHTML='<i class="fa-solid fa-xmark"></i>',d.setAttribute("pgs","buttonClose"),c.insertAdjacentElement("afterbegin",d),d.addEventListener("click",function(e){e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),l()})},deleteAll(e){let t=pgs(document).querySelector(e);t&&(t.innerHTML="")},trigger(e=document){pgs(e).querySelectorAll("notificationTrigger").forEach(e=>{if(!e||"true"===e.dataset.initialize)return;e.dataset.initialize="true";const t=this._getData(e),n=String(t.title||"").trim(),o=String(t.message||"").trim();if(!n&&!o)return void e.remove();const r=t.link||null,i=t.icon||void 0,s=this._getDuration(t),a=this._getApi(t),c=this._getType(t,a),l=this._getContent(n,o);a===P.toast?a[c](l,s,i):a[c](l,r,s,i),e.remove()})}};function D(e=document){return R.trigger(e)}const P={trigger:D,alert:{error:(e="Errore",t=null,n=0,o='<i class="fa-solid fa-circle-xmark"></i>')=>R.initNotification("error","notification",o,e,n,"stack",t),success:(e="Aggiornato",t=null,n=0,o='<i class="fa-solid fa-check"></i>')=>R.initNotification("success","notification",o,e,n,"stack",t),info:(e="Aggiornamento",t=null,n=0,o='<i class="fa-solid fa-circle-info"></i>')=>R.initNotification("info","notification",o,e,n,"stack",t),warning:(e="Attenzione",t=null,n=0,o='<i class="fa-solid fa-triangle-exclamation"></i>')=>R.initNotification("warning","notification",o,e,n,"stack",t),deleteAll:()=>R.deleteAll("notification")},toast:{error:(e="Errore",t=4e3,n='<i class="fa-solid fa-circle-xmark"></i>')=>R.initNotification("error","toast",n,e,t),success:(e="Aggiornato",t=4e3,n='<i class="fa-solid fa-check"></i>')=>R.initNotification("success","toast",n,e,t),info:(e="Aggiornamento",t=0,n='<i class="fa-solid fa-circle-info"></i>')=>R.initNotification("info","toast",n,e,t),warning:(e="Attenzione",t=4e3,n='<i class="fa-solid fa-triangle-exclamation"></i>')=>R.initNotification("warning","toast",n,e,t),deleteAll:()=>R.deleteAll("toast")}};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>D()):D(),e.registerModules({accordion:c,dropdown:A,menu:S,modal:q,notification:P,slides:C,stepTabs:$,steps:_,formValidate:class{constructor({form:e}={}){this.container=e,this._rules=[]}addError(e,t){e.setAttribute("data-form-field-status","error"),0==t&&e.scrollIntoView();let n=e.getAttribute("data-form-field-message");0==t&&n?P.toast.error(n):0==t&&P.toast.error("Compila tutti i campi!")}removeError(e){e.setAttribute("data-form-field-status","")}#i(e){e.forEach(e=>{e.addEventListener("click",t=>this.removeError(e))})}help={isRequired:e=>!!e&&((!0===e.required||"true"===e?.dataset?.required||"true"==e?.getAttribute("aria-required"))&&!e.hidden),isEmptyTextLike:e=>!String(e?.value??"").trim(),isEmptySelect:e=>!String(e?.value??"").trim(),getGroupName:e=>e?.name||e?.getAttribute?.("name")||""};#s(e){const t=[];for(const n of this._rules){const o=n(e);o&&(Array.isArray(o)?t.push(...o):t.push(o))}const n=Array.from(e.querySelectorAll("input")).filter(e=>!e.disabled&&"hidden"!==e.type&&"checkbox"!==e.type&&"radio"!==e.type&&"file"!==e.type&&!!this.help.isRequired(e)&&this.help.isEmptyTextLike(e)),o=Array.from(e.querySelectorAll("textarea")).filter(e=>!e.disabled&&!!this.help.isRequired(e)&&this.help.isEmptyTextLike(e)),r=Array.from(e.querySelectorAll("select")).filter(e=>!e.disabled&&!!this.help.isRequired(e)&&this.help.isEmptySelect(e)),i=Array.from(e.querySelectorAll('input[type="radio"]')).filter(e=>!e.disabled),s=new Map;for(const e of i){if(!this.help.isRequired(e))continue;const t=this.help.getGroupName(e);t&&(s.has(t)||s.set(t,[]),s.get(t).push(e))}const a=[];for(const[e,t]of s.entries())t.some(e=>e.checked)||a.push(t[0]);const c=Array.from(e.querySelectorAll('input[type="checkbox"]')).filter(e=>!e.disabled),l=[],d=new Map;for(const e of c){if(!this.help.isRequired(e))continue;const t=this.help.getGroupName(e);t?(d.has(t)||d.set(t,[]),d.get(t).push(e)):e.checked||l.push(e)}const u=[];for(const[e,t]of d.entries())t.some(e=>e.checked)||u.push(t[0]);return[n,o,r,a,l,u,Array.from(e.querySelectorAll('input[type="file"]')).filter(e=>!(e.disabled||!this.help.isRequired(e)||e.files&&e.files.length>0)),t].flat()}validate(){const e=this.#s(this.container),t=this.container.querySelectorAll("input, textarea, select");Array.from(t).filter(e=>!e.disabled);for(const n of t)e.includes(n)||this.removeError(n);return e.forEach((e,t)=>this.addError(e,t)),this.#i(t),e.length?(this.container.setAttribute("data-form-status","error"),!1):(this.container.setAttribute("data-form-status","success"),!0)}ifSuccess(e="Inviato con successo"){1==this.validate()&&P.toast.success(e)}addNewRule(e){if("function"!=typeof e)throw new Error("Rule must be a function");return this._rules.push(e),this}},scrollHorizontal:L}),n(107),n(48)})()})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mypgs",
3
- "version": "1.3.2",
3
+ "version": "1.3.3",
4
4
  "description": "MyPGS frontend theme and UI behaviors, with bundled JavaScript and CSS assets.",
5
5
  "main": "./dist/javascript/index.js",
6
6
  "module": "./assets/javascript/index.js",
@@ -1,5 +1,5 @@
1
1
  <ul pgs="grid-1 gapTexts">
2
- <li pgs="accordion" class="accordion-item">
2
+ <li pgs="accordion" >
3
3
  <button pgs="accordion-button" type="button">
4
4
  <i class="fa-solid fa-circle-question" aria-hidden="true"></i>
5
5
  <span>Domanda frequente</span>
@@ -10,7 +10,7 @@
10
10
  </div>
11
11
  </li>
12
12
 
13
- <li pgs="accordion" class="accordion-item">
13
+ <li pgs="accordion" >
14
14
  <button pgs="accordion-button" type="button">
15
15
  <i class="fa-solid fa-circle-info" aria-hidden="true"></i>
16
16
  <span>Seconda sezione</span>
@@ -0,0 +1,91 @@
1
+ <div pgs="flexRow">
2
+
3
+ <span pgs="dropdown">
4
+ <button pgs="dropdown-button button" pgs-option="buttonReverse" type="button">
5
+ Bottom center
6
+ <i class="fa-solid fa-chevron-down" aria-hidden="true"></i>
7
+ </button>
8
+
9
+ <div pgs="dropdown-content">
10
+ Contenuto bottom center
11
+ </div>
12
+ </span>
13
+
14
+ <span pgs="dropdown" pgs-option="position[top left]">
15
+ <button pgs="dropdown-button button" pgs-option="buttonReverse" type="button">
16
+ Top left
17
+ <i class="fa-solid fa-chevron-down" aria-hidden="true"></i>
18
+ </button>
19
+
20
+ <div pgs="dropdown-content">
21
+ Contenuto top left
22
+ </div>
23
+ </span>
24
+
25
+ <span pgs="dropdown" pgs-option="position[top center]">
26
+ <button pgs="dropdown-button button" pgs-option="buttonReverse" type="button">
27
+ Top center
28
+ <i class="fa-solid fa-chevron-down" aria-hidden="true"></i>
29
+ </button>
30
+
31
+ <div pgs="dropdown-content">
32
+ Contenuto top center
33
+ </div>
34
+ </span>
35
+
36
+ <span pgs="dropdown" pgs-option="position[top right]">
37
+ <button pgs="dropdown-button button" pgs-option="buttonReverse" type="button">
38
+ Top right
39
+ <i class="fa-solid fa-chevron-down" aria-hidden="true"></i>
40
+ </button>
41
+
42
+ <div pgs="dropdown-content">
43
+ Contenuto top right
44
+ </div>
45
+ </span>
46
+
47
+ <span pgs="dropdown" pgs-option="position[bottom left]">
48
+ <button pgs="dropdown-button button" pgs-option="buttonReverse" type="button">
49
+ Bottom left
50
+ <i class="fa-solid fa-chevron-down" aria-hidden="true"></i>
51
+ </button>
52
+
53
+ <div pgs="dropdown-content">
54
+ Contenuto bottom left
55
+ </div>
56
+ </span>
57
+
58
+ <span pgs="dropdown" pgs-option="position[bottom right]">
59
+ <button pgs="dropdown-button button" pgs-option="buttonReverse" type="button">
60
+ Bottom right
61
+ <i class="fa-solid fa-chevron-down" aria-hidden="true"></i>
62
+ </button>
63
+
64
+ <div pgs="dropdown-content">
65
+ Contenuto bottom right
66
+ </div>
67
+ </span>
68
+
69
+ <span pgs="dropdown" pgs-option="position[left center]">
70
+ <button pgs="dropdown-button button" pgs-option="buttonReverse" type="button">
71
+ Left center
72
+ <i class="fa-solid fa-chevron-down" aria-hidden="true"></i>
73
+ </button>
74
+
75
+ <div pgs="dropdown-content">
76
+ Contenuto left center
77
+ </div>
78
+ </span>
79
+
80
+ <span pgs="dropdown" pgs-option="position[right center]">
81
+ <button pgs="dropdown-button button" pgs-option="buttonReverse" type="button">
82
+ Right center
83
+ <i class="fa-solid fa-chevron-down" aria-hidden="true"></i>
84
+ </button>
85
+
86
+ <div pgs="dropdown-content">
87
+ Contenuto right center
88
+ </div>
89
+ </span>
90
+
91
+ </div>
@@ -0,0 +1,41 @@
1
+ <nav pgs="menu" pgs-option="horizontal" aria-label="Menu orizzontale">
2
+ <ul>
3
+ <li>
4
+ <a href="/" aria-current="page">
5
+ <i class="fa-solid fa-house" aria-hidden="true"></i>
6
+ <span>Home</span>
7
+ </a>
8
+ </li>
9
+ <li>
10
+ <a href="/servizi">
11
+ <i class="fa-solid fa-layer-group" aria-hidden="true"></i>
12
+ <span>Servizi</span>
13
+ </a>
14
+ <ul>
15
+ <li><a href="/servizi/uno">Servizio uno</a></li>
16
+ <li><a href="/servizi/due">Servizio due</a></li>
17
+ </ul>
18
+ </li>
19
+ </ul>
20
+ </nav>
21
+
22
+ <nav pgs="menu" pgs-option="vertical" aria-label="Menu verticale">
23
+ <ul>
24
+ <li>
25
+ <a href="/" aria-current="page">
26
+ <i class="fa-solid fa-house" aria-hidden="true"></i>
27
+ <span>Home</span>
28
+ </a>
29
+ </li>
30
+ <li>
31
+ <a href="/servizi">
32
+ <i class="fa-solid fa-layer-group" aria-hidden="true"></i>
33
+ <span>Servizi</span>
34
+ </a>
35
+ <ul>
36
+ <li><a href="/servizi/uno">Servizio uno</a></li>
37
+ <li><a href="/servizi/due">Servizio due</a></li>
38
+ </ul>
39
+ </li>
40
+ </ul>
41
+ </nav>
@@ -0,0 +1,78 @@
1
+ <div pgs="modal" pgs-option="containerID[modal-container]">
2
+ <button pgs="modal-button button" type="button">
3
+ <i class="fa-solid fa-window-maximize"></i> Apri modale
4
+ </button>
5
+
6
+ <dialog>
7
+ <div pgs="modal-dialog-content">
8
+ <div pgs="modal-dialog-content-header">
9
+ <h3>Modale di esempio</h3>
10
+ </div>
11
+
12
+ <div pgs="modal-dialog-content-scroll">
13
+ <p>Contenuto della modale. Il bottone di chiusura viene aggiunto automaticamente se non presente.</p>
14
+ </div>
15
+ </div>
16
+ </dialog>
17
+ </div>
18
+
19
+ <div pgs="modal" pgs-option="containerID[modal-container]">
20
+ <button pgs="modal-button button" type="button">
21
+ <i class="fa-solid fa-window-maximize"></i> Apri modale right
22
+ </button>
23
+
24
+ <dialog pgs-option="right">
25
+ <div pgs="modal-dialog-content">
26
+ <div pgs="modal-dialog-content-header">
27
+ <h3>Modale laterale</h3>
28
+ </div>
29
+
30
+ <div pgs="modal-dialog-content-scroll">
31
+ <p>Contenuto della modale con <code>pgs-option="right"</code>.</p>
32
+ </div>
33
+ </div>
34
+ </dialog>
35
+ </div>
36
+
37
+ <div pgs="modal" pgs-option="containerID[modal-container]">
38
+ <button pgs="modal-button button" type="button">
39
+ <i class="fa-solid fa-window-maximize"></i> Apri modale left
40
+ </button>
41
+
42
+ <dialog pgs-option="left">
43
+ <div pgs="modal-dialog-content">
44
+ <div pgs="modal-dialog-content-header">
45
+ <h3>Modale laterale sinistra</h3>
46
+ </div>
47
+
48
+ <div pgs="modal-dialog-content-scroll">
49
+ <p>Contenuto della modale con <code>pgs-option="left"</code>.</p>
50
+ </div>
51
+ </div>
52
+ </dialog>
53
+ </div>
54
+
55
+ <div pgs="modal">
56
+ <button pgs="modal-button button" type="button">
57
+ <i class="fa-solid fa-floppy-disk"></i> Conferma salvataggio
58
+ </button>
59
+
60
+ <dialog pgs-option="topLevel">
61
+ <div pgs="modal-dialog-content">
62
+ <div pgs="modal-dialog-content-header">
63
+ <h3>Salvare le modifiche?</h3>
64
+ </div>
65
+
66
+ <div pgs="modal-dialog-content-scroll flexColumnElements">
67
+ <p>Hai modifiche non salvate. Conferma per applicarle oppure annulla per tornare alla pagina.</p>
68
+
69
+ <div pgs="flexRow">
70
+ <button pgs="button modal-close" type="button">Annulla</button>
71
+ <button pgs="buttonStrong" type="button">Salva modifiche</button>
72
+ </div>
73
+ </div>
74
+ </div>
75
+ </dialog>
76
+ </div>
77
+
78
+ <div id="modal-container"></div>
@@ -0,0 +1,35 @@
1
+ <div pgs="notification" aria-live="polite"></div>
2
+ <div pgs="toast" aria-live="polite"></div>
3
+
4
+ <div pgs="hidden notificationTrigger" data-notification='{
5
+ "title":"Titolo",
6
+ "message":"Messaggio",
7
+ "element":"notification",
8
+ "type":"info",
9
+ "icon":null,
10
+ "duration":"-1",
11
+ "link":null
12
+ }'>
13
+ </div>
14
+ <div pgs="hidden notificationTrigger" data-notification='{
15
+ "title":"Benvetuto",
16
+ "message":"Messaggio",
17
+ "element":"toast",
18
+ "type":"info",
19
+ "icon":null,
20
+ "duration":"3000",
21
+ "link":null
22
+ }'>
23
+ </div>
24
+ <!--
25
+ <div pgs="hidden notificationTrigger" data-notification='{
26
+ "title":"Titolo",
27
+ "message":"Messaggio",
28
+ "element":"notification | toast",
29
+ "type":"info | success | warning | error",
30
+ "icon":"null | <i class=\"fa-solid fa-rocket\"></i>",
31
+ "duration":"-1 | 0 | 4000 | 5000",
32
+ "link":"null | /pagina/"
33
+ }'>
34
+ </div>
35
+ -->
@@ -1,6 +1,6 @@
1
- <div pgs="slides" class="slides" pgs-option="singleScroll shadowDesktop">
2
- <ul pgs="slides-container" class="slides-container">
3
- <li class="slides-ul-li">
1
+ <div pgs="slides" pgs-option="singleScroll shadowDesktop">
2
+ <ul pgs="slides-container">
3
+ <li>
4
4
  <article pgs="card flexColumn">
5
5
  <img pgs="card-img imgCover" src="https://placehold.co/800x500?text=Slide+1" alt="Slide 1">
6
6
  <div pgs="flexColumnTexts">
@@ -10,7 +10,7 @@
10
10
  </article>
11
11
  </li>
12
12
 
13
- <li class="slides-ul-li">
13
+ <li>
14
14
  <article pgs="card flexColumn">
15
15
  <img pgs="card-img imgCover" src="https://placehold.co/800x500?text=Slide+2" alt="Slide 2">
16
16
  <div pgs="flexColumnTexts">
@@ -20,7 +20,7 @@
20
20
  </article>
21
21
  </li>
22
22
 
23
- <li class="slides-ul-li">
23
+ <li>
24
24
  <article pgs="card flexColumn">
25
25
  <img pgs="card-img imgCover" src="https://placehold.co/800x500?text=Slide+3" alt="Slide 3">
26
26
  <div pgs="flexColumnTexts">
@@ -1,23 +1,23 @@
1
- <ol pgs="steps" class="steps">
2
- <li pgs="steps-step" class="step_li">
1
+ <ol pgs="steps">
2
+ <li pgs="steps-step">
3
3
  <span pgs="steps-step-circle">1</span>
4
- <div pgs="steps-step-content" class="step_li-content">
4
+ <div pgs="steps-step-content">
5
5
  <h3>Primo step</h3>
6
6
  <p>Descrizione del primo passaggio.</p>
7
7
  </div>
8
8
  </li>
9
9
 
10
- <li pgs="steps-step" class="step_li">
10
+ <li pgs="steps-step">
11
11
  <span pgs="steps-step-circle">2</span>
12
- <div pgs="steps-step-content" class="step_li-content">
12
+ <div pgs="steps-step-content">
13
13
  <h3>Secondo step</h3>
14
14
  <p>Descrizione del secondo passaggio.</p>
15
15
  </div>
16
16
  </li>
17
17
 
18
- <li pgs="steps-step" class="step_li">
18
+ <li pgs="steps-step">
19
19
  <span pgs="steps-step-circle">3</span>
20
- <div pgs="steps-step-content" class="step_li-content">
20
+ <div pgs="steps-step-content">
21
21
  <h3>Terzo step</h3>
22
22
  <p>Descrizione del terzo passaggio.</p>
23
23
  </div>
@@ -1,6 +1,8 @@
1
1
  <span pgs="dropdown tooltip">
2
- <button pgs="dropdown-button buttonMini tooltip-button" title="open-tooltip" type="button"><i class="fa-solid fa-info"></i></button>
2
+ <button pgs="dropdown-button buttonMini tooltip-button" title="open-tooltip" type="button">
3
+ <i class="fa-solid fa-info"></i>
4
+ </button>
3
5
  <div pgs="dropdown-content tooltip-content">
4
6
  Lorem ipsum dolor sit amet consectetur adipisicing elit. Iusto hic, id consectetur facilis et, iste animi minima quidem praesentium omnis quod. Quidem provident ad cum aut reprehenderit laboriosam eum placeat.
5
7
  </div>
6
- </span>
8
+ </span>
@@ -1,3 +1,7 @@
1
+ body{
2
+ --color-background: light-dark(#f1ffef, #101010);
3
+ }
4
+
1
5
  .primary-menu {
2
6
  overflow: auto;
3
7
  }
@@ -48,4 +52,18 @@ pre {
48
52
 
49
53
  [pgs~=buttonBig]{
50
54
  max-width: 300px;
55
+ }
56
+
57
+ #templates-demo-before{
58
+ position: relative;
59
+ z-index: 2;
60
+ }
61
+
62
+ #templates-demo-main{
63
+ position: relative;
64
+ z-index: 1;
65
+ }
66
+
67
+ #templates-demo-after{
68
+ position: relative;
51
69
  }
@@ -13,11 +13,10 @@
13
13
  <link rel="stylesheet" href="demo.css">
14
14
  </head>
15
15
 
16
- <body pgs="bodyBase bodyImg bodyText bodyHeading" style="background-color: var(--color-box2);">
17
- <div id="templates-demo-layouts-before"></div>
18
- <main pgs="main" id="templates-demo-components"></main>
19
- <div id="templates-demo-layouts" pgs="flexColumnSections"></div>
20
-
16
+ <body pgs="bodyBase bodyImg bodyText bodyHeading">
17
+ <div id="templates-demo-before"></div>
18
+ <main id="templates-demo-main" pgs="main"></main>
19
+ <div id="templates-demo-after"></div>
21
20
  <script src="./demo.js"></script>
22
21
  </body>
23
22