@appius-fr/apx 2.6.1 → 2.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/APX.dev.mjs +63 -19
- package/dist/APX.mjs +1 -1
- package/dist/APX.prod.mjs +1 -1
- package/dist/APX.standalone.js +67 -17
- package/dist/APX.standalone.js.map +1 -1
- package/modules/tools/form-packer/README.md +12 -14
- package/modules/tools/form-packer/augment-apx.mjs +4 -2
- package/modules/tools/form-packer/packToJson.mjs +58 -16
- package/package.json +1 -1
package/dist/APX.prod.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var t={613:(t,e,n)=>{n.d(e,{Z:()=>r});var o=n(81),s=n.n(o),a=n(645),i=n.n(a)()(s());i.push([t.id,'/* Dialog styling */\n.APX-dialog {\n display: none;\n position: fixed;\n z-index: 1002;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n overflow: auto;\n background-color: rgba(0, 0, 0, 0.4);\n /* Dimmed background for focus on dialog */\n}\n\n.APX-dialog-content {\n background-color: #fefefe;\n padding: 40px;\n border: none;\n width: auto;\n min-width: 300px;\n max-width: 80%;\n margin: auto;\n border-radius: 8px;\n box-shadow: 0px 6px 20px rgba(0, 0, 0, 0.1);\n font-family: \'Helvetica Neue\', Arial, sans-serif;\n}\n\nh2.APX-dialog-title{\n margin-top:0;\n}\n\n.APX-close-dialog {\n color: #aaa;\n float: right;\n font-size: 24px;\n margin-top: -10px;\n /* Adjust positioning */\n margin-right: -10px;\n}\n\n.APX-close-dialog:hover,\n.APX-close-dialog:focus {\n color: #333;\n /* Darker color on hover/focus */\n cursor: pointer;\n}\n\n/* Input fields styling */\n.APX-dialog-content input[type="text"],\n.APX-dialog-content input[type="number"],\n.APX-dialog-content input[type="date"],\n.APX-dialog-content input[type="datetime-local"] {\n width: 100%;\n padding: 10px;\n margin-bottom: 20px;\n border: 1px solid #ccc;\n border-radius: 4px;\n font-family: \'Helvetica Neue\', Arial, sans-serif;\n font-size: 16px;\n box-sizing: border-box;\n transition: border-color 0.3s;\n}\n\n.APX-dialog-content input[type="text"]:focus,\n.APX-dialog-content input[type="number"]:focus,\n.APX-dialog-content input[type="date"]:focus,\n.APX-dialog-content input[type="datetime-local"]:focus {\n border-color: #2C3E50;\n /* Deep Blue Color */\n outline: none;\n}\n\n/* Button in the dialog */\n.APX-dialog-button-container button {\n position: relative;\n background-color: #2C3E50;\n color: #ECF0F1;\n border: none;\n padding: 10px 20px;\n border-radius: 5px;\n font-size: 16px;\n cursor: pointer;\n transition: all 0.3s ease;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);\n}\n\n.APX-dialog-button-container button:hover {\n background-color: #34495E;\n transform: translateY(-1px);\n box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);\n}\n\n.APX-dialog-button-container {\n display: flex;\n gap: 10px;\n margin-top:1em;\n /* spacing between buttons */\n}\n\n/* Loading indicator */\n.APX-dialog-loading-indicator {\n display: flex;\n justify-content: center;\n align-items: center;\n height: 100px;\n width: 100%;\n}\n\n.APX-dialog-loading-indicator::before {\n content: \'\';\n width: 40px;\n height: 40px;\n border: 4px solid #f3f3f3;\n border-top: 4px solid #2C3E50;\n border-radius: 50%;\n animation: APX-dialog-spin 1s linear infinite;\n}\n\n@keyframes APX-dialog-spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n}\n.APX-dialog-button-disabled {\n opacity: 0.5;\n cursor: not-allowed !important;\n background-color: #95a5a6 !important; /* Grayed out color */\n box-shadow: none !important;\n transition: all 0.2s ease;\n transform: none !important;\n}\n\n.APX-dialog-button-disabled:hover {\n background-color: #95a5a6 !important; /* Keep gray on hover */\n transform: none !important;\n}\n\n/* Add a subtle strikethrough effect */\n.APX-dialog-button-disabled::after {\n content: \'\';\n position: absolute;\n top: 50%;\n left: 0;\n width: 100%;\n height: 1px;\n background-color: rgba(0, 0, 0, 0.2);\n transform: rotate(-5deg);\n}',""]);const r=i},152:(t,e,n)=>{n.d(e,{Z:()=>r});var o=n(81),s=n.n(o),a=n(645),i=n.n(a)()(s());i.push([t.id,".APX-toast-container {\n position: fixed;\n display: flex;\n flex-direction: column;\n gap: var(--apx-toast-gap, 8px);\n z-index: var(--apx-toast-z-index, 11000);\n pointer-events: none;\n}\n\n.APX-toast-container--bottom-right { right: 12px; bottom: 12px; align-items: flex-end; }\n.APX-toast-container--bottom-left { left: 12px; bottom: 12px; align-items: flex-start; }\n.APX-toast-container--top-right { right: 12px; top: 12px; align-items: flex-end; }\n.APX-toast-container--top-left { left: 12px; top: 12px; align-items: flex-start; }\n\n.APX-toast {\n min-width: var(--apx-toast-min-width, 260px);\n max-width: var(--apx-toast-max-width, 420px);\n font-size: var(--apx-toast-font-size, 14px);\n border-radius: var(--apx-toast-radius, 6px);\n box-shadow: var(--apx-toast-shadow, 0 6px 24px rgba(0,0,0,0.2));\n padding: var(--apx-toast-padding, 10px 42px 10px 14px);\n color: #111;\n background: #eee;\n pointer-events: auto;\n position: relative;\n transition: opacity 180ms ease, transform 180ms ease;\n}\n\n.APX-toast--info { background: var(--apx-toast-info-bg, #0dcaf0); color: var(--apx-toast-info-fg, #052c65); }\n.APX-toast--success { background: var(--apx-toast-success-bg, #198754); color: var(--apx-toast-success-fg, #ffffff); }\n.APX-toast--warning { background: var(--apx-toast-warning-bg, #ffc107); color: var(--apx-toast-warning-fg, #664d03); }\n.APX-toast--danger { background: var(--apx-toast-danger-bg, #dc3545); color: var(--apx-toast-danger-fg, #ffffff); }\n\n.APX-toast__content { line-height: 1.35; }\n\n.APX-toast__close {\n position: absolute;\n top: 50%; right: 10px;\n width: 24px; height: 24px;\n transform: translateY(-50%);\n display: inline-flex; align-items: center; justify-content: center;\n background: transparent; color: currentColor;\n border: 0; border-radius: 4px; padding: 0; margin: 0;\n cursor: pointer; appearance: none; -webkit-appearance: none;\n opacity: .75; transition: opacity 120ms ease;\n}\n.APX-toast__close:hover { opacity: 1; }\n.APX-toast__close:focus { outline: 2px solid rgba(0,0,0,.2); outline-offset: 2px; }\n.APX-toast__close::before {\n content: '×';\n font-size: 16px; line-height: 1; text-align: center;\n}\n\n/* Progress bar (outside content, flush to toast edges) */\n.APX-toast__progress {\n position: absolute;\n left: 0;\n right: 0;\n height: var(--apx-toast-progress-height, 4px);\n display: flex;\n flex-direction: row;\n align-items: stretch;\n flex-shrink: 0;\n border-radius: inherit;\n overflow: visible;\n}\n.APX-toast__progress--top {\n top: 0;\n border-radius: var(--apx-toast-radius, 6px) var(--apx-toast-radius, 6px) 0 0;\n}\n.APX-toast__progress--bottom {\n bottom: 0;\n border-radius: 0 0 var(--apx-toast-radius, 6px) var(--apx-toast-radius, 6px);\n}\n/* Track contains the bar; no margin (pause button is on the corner, overlapping) */\n.APX-toast__progress-track {\n flex: 1;\n min-width: 0;\n overflow: hidden;\n}\n.APX-toast__progress-bar {\n height: 100%;\n width: 100%;\n max-width: 100%;\n transition: width 80ms linear;\n background: rgba(0, 0, 0, 0.25);\n}\n.APX-toast--info .APX-toast__progress-bar { background: rgba(5, 44, 101, 0.5); }\n.APX-toast--success .APX-toast__progress-bar { background: rgba(0, 0, 0, 0.25); }\n.APX-toast--warning .APX-toast__progress-bar { background: rgba(102, 77, 3, 0.5); }\n.APX-toast--danger .APX-toast__progress-bar { background: rgba(0, 0, 0, 0.25); }\n/* Pause/Resume button: round, center exactly on toast corner (top-left or bottom-left) */\n.APX-toast__progress-pause {\n position: absolute;\n width: var(--apx-toast-progress-pause-size, 18px);\n height: var(--apx-toast-progress-pause-size, 18px);\n left: 0;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n background: #eee;\n color: currentColor;\n border: 1px solid rgba(0, 0, 0, 0.35);\n border-radius: 50%;\n padding: 0;\n margin: 0;\n cursor: pointer;\n line-height: 1;\n opacity: 0.95;\n transition: opacity 120ms ease;\n flex-shrink: 0;\n}\n.APX-toast__progress--top .APX-toast__progress-pause {\n top: 0;\n transform: translate(-50%, -50%);\n}\n.APX-toast__progress--bottom .APX-toast__progress-pause {\n bottom: 0;\n transform: translate(-50%, 50%);\n}\n.APX-toast--info .APX-toast__progress-pause { background: var(--apx-toast-info-bg, #0dcaf0); border-color: rgba(5, 44, 101, 0.55); }\n.APX-toast--success .APX-toast__progress-pause { background: var(--apx-toast-success-bg, #198754); border-color: rgba(0, 0, 0, 0.3); }\n.APX-toast--warning .APX-toast__progress-pause { background: var(--apx-toast-warning-bg, #ffc107); border-color: rgba(102, 77, 3, 0.6); }\n.APX-toast--danger .APX-toast__progress-pause { background: var(--apx-toast-danger-bg, #dc3545); border-color: rgba(0, 0, 0, 0.35); }\n.APX-toast__progress-pause:hover { opacity: 1; }\n.APX-toast__progress-pause:focus { outline: 2px solid rgba(0,0,0,.4); outline-offset: -2px; }\n.APX-toast__progress-pause svg {\n width: 10px;\n height: 10px;\n display: block;\n}\n/* Extra top/bottom padding when progress bar is present (default content padding 10px + bar height) */\n.APX-toast--has-progress-top { padding-top: calc(10px + var(--apx-toast-progress-height, 4px)); }\n.APX-toast--has-progress-bottom { padding-bottom: calc(10px + var(--apx-toast-progress-height, 4px)); }\n/* Reserve space for stacking when pause button is present (button extends outside toast corner) */\n.APX-toast--has-progress-top.APX-toast--has-progress-pause { margin-top: calc(var(--apx-toast-progress-pause-size, 18px) / 2); }\n.APX-toast--has-progress-bottom.APX-toast--has-progress-pause { margin-bottom: calc(var(--apx-toast-progress-pause-size, 18px) / 2); }\n\n/* Animations */\n.APX-toast--enter { opacity: 0; transform: translateY(8px); }\n.APX-toast--enter.APX-toast--enter-active { opacity: 1; transform: translateY(0); }\n.APX-toast--exit { opacity: 1; transform: translateY(0); }\n.APX-toast--exit.APX-toast--exit-active { opacity: 0; transform: translateY(8px); }\n\n\n",""]);const r=i},570:(t,e,n)=>{n.d(e,{Z:()=>m});var o=n(81),s=n.n(o),a=n(645),i=n.n(a),r=n(667),c=n.n(r),l=new URL(n(29),n.b),d=new URL(n(913),n.b),p=new URL(n(260),n.b),u=i()(s()),f=c()(l),g=c()(d),h=c()(p);u.push([t.id,`.apx-tristate {\n display: inline-block;\n vertical-align: middle;\n text-align: center;\n cursor: pointer;\n position: relative;\n min-width:13px;\n min-height:13px;\n background-size: contain;\n background-color: white;\n border-radius:3px;\n}\n.apx-tristate.unchecked {\n background-image: url(${f});\n}\n.apx-tristate.checked {\n background-image: url(${g});\n background-repeat: no-repeat;\n background-position: center;\n}\n.apx-tristate.crossed {\n background-image: url(${h});\n background-repeat: no-repeat;\n background-position: center;\n}`,""]);const m=u},645:t=>{t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n="",o=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),o&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),o&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n})).join("")},e.i=function(t,n,o,s,a){"string"==typeof t&&(t=[[null,t,void 0]]);var i={};if(o)for(var r=0;r<this.length;r++){var c=this[r][0];null!=c&&(i[c]=!0)}for(var l=0;l<t.length;l++){var d=[].concat(t[l]);o&&i[d[0]]||(void 0!==a&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=a),n&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=n):d[2]=n),s&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=s):d[4]="".concat(s)),e.push(d))}},e}},667:t=>{t.exports=function(t,e){return e||(e={}),t?(t=String(t.__esModule?t.default:t),/^['"].*['"]$/.test(t)&&(t=t.slice(1,-1)),e.hash&&(t+=e.hash),/["'() \t\n]|(%20)/.test(t)||e.needQuotes?'"'.concat(t.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):t):t}},81:t=>{t.exports=function(t){return t[1]}},379:t=>{var e=[];function n(t){for(var n=-1,o=0;o<e.length;o++)if(e[o].identifier===t){n=o;break}return n}function o(t,o){for(var a={},i=[],r=0;r<t.length;r++){var c=t[r],l=o.base?c[0]+o.base:c[0],d=a[l]||0,p="".concat(l," ").concat(d);a[l]=d+1;var u=n(p),f={css:c[1],media:c[2],sourceMap:c[3],supports:c[4],layer:c[5]};if(-1!==u)e[u].references++,e[u].updater(f);else{var g=s(f,o);o.byIndex=r,e.splice(r,0,{identifier:p,updater:g,references:1})}i.push(p)}return i}function s(t,e){var n=e.domAPI(e);return n.update(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap&&e.supports===t.supports&&e.layer===t.layer)return;n.update(t=e)}else n.remove()}}t.exports=function(t,s){var a=o(t=t||[],s=s||{});return function(t){t=t||[];for(var i=0;i<a.length;i++){var r=n(a[i]);e[r].references--}for(var c=o(t,s),l=0;l<a.length;l++){var d=n(a[l]);0===e[d].references&&(e[d].updater(),e.splice(d,1))}a=c}}},569:t=>{var e={};t.exports=function(t,n){var o=function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}e[t]=n}return e[t]}(t);if(!o)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");o.appendChild(n)}},216:t=>{t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},565:(t,e,n)=>{t.exports=function(t){var e=n.nc;e&&t.setAttribute("nonce",e)}},795:t=>{t.exports=function(t){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var e=t.insertStyleElement(t);return{update:function(n){!function(t,e,n){var o="";n.supports&&(o+="@supports (".concat(n.supports,") {")),n.media&&(o+="@media ".concat(n.media," {"));var s=void 0!==n.layer;s&&(o+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),o+=n.css,s&&(o+="}"),n.media&&(o+="}"),n.supports&&(o+="}");var a=n.sourceMap;a&&"undefined"!=typeof btoa&&(o+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),e.styleTagTransform(o,t,e.options)}(e,t,n)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},589:t=>{t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}},260:t=>{t.exports="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20viewBox%3D%220%200%2032%2032%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22m0.543%205.647c0-3.119%202.531-5.647%205.65-5.647h19.309c3.12%200%205.65%202.511%205.65%205.647v20.705c0%203.119-2.531%205.647-5.65%205.647h-19.309c-3.12%200-5.65-2.511-5.65-5.647v-20.705z%22%20fill%3D%22%23f00%22%2F%3E%3Cpath%20d%3D%22m8%208%2016%2016%22%20stroke%3D%22%23fff%22%20stroke-width%3D%222%22%2F%3E%3Cpath%20d%3D%22M24%208L8%2024%22%20stroke%3D%22%23fff%22%20stroke-width%3D%222%22%2F%3E%3C%2Fsvg%3E"},29:t=>{t.exports="data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20width%3D%2732%27%20height%3D%2732%27%3E%3Cpath%20%20fill%3D%22%23cccccc%22%20d%3D%22M25.107%2032.030h-18.214c-3.456%200-6.268-2.81-6.268-6.264v-19.529c0-3.456%202.812-6.268%206.268-6.268h18.214c3.456%200%206.268%202.812%206.268%206.268v19.529c0%203.452-2.812%206.264-6.268%206.264zM6.893%201.85c-2.419%200-4.386%201.967-4.386%204.386v19.529c0%202.417%201.967%204.382%204.386%204.382h18.214c2.419%200%204.386-1.965%204.386-4.382v-19.529c0-2.419-1.967-4.386-4.386-4.386h-18.214z%22%3E%3C/path%3E%3C/svg%3E"},913:t=>{t.exports="data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20width%3D%2732%27%20height%3D%2732%27%3E%3Cpath%20fill%3D%22%230654ba%22%20d%3D%22M0.543%205.647c0-3.119%202.531-5.647%205.65-5.647h19.309c3.12%200%205.65%202.511%205.65%205.647v20.705c0%203.119-2.531%205.647-5.65%205.647h-19.309c-3.12%200-5.65-2.511-5.65-5.647v-20.705zM5.313%2017.587l7.039%206.839%2013.831-13.439-2.636-2.561-10.929%2010.62-4.442-4.317-2.862%202.858z%22%3E%3C/path%3E%3C/svg%3E"}},e={};function n(o){var s=e[o];if(void 0!==s)return s.exports;var a=e[o]={id:o,exports:{}};return t[o](a,a.exports,n),a.exports}n.m=t,n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var o in e)n.o(e,o)&&!n.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.b=document.baseURI||self.location.href,n.nc=void 0;var o={};(()=>{n.d(o,{Z:()=>J});let t=0;const e={},s={};function a(t,n,o,a="",i){const r=a?function(t,e){for(;t&&1===t.nodeType;){if(t.matches(e))return t;t=t.parentNode}return null}(t.target,a):i;function c(){e[n]&&e[n].reduce(((e,n)=>e.then((()=>new Promise(((e,o)=>{try{const s=n.bind(r)(t);s instanceof Promise?s.then(e).catch(o):e(s)}catch(t){o(t)}}))))),Promise.resolve()).catch((t=>{console.error("Error in callback chain:",t)}))}r&&(clearTimeout(s[n]),0===o?c():s[n]=setTimeout(c,o))}var i=n(379),r=n.n(i),c=n(795),l=n.n(c),d=n(569),p=n.n(d),u=n(565),f=n.n(u),g=n(216),h=n.n(g),m=n(589),y=n.n(m),b=n(570),v={};function x(t){t.tristate=function(e={}){t.elements.forEach((t=>{if("checkbox"===t.type){const[n,o,s]=function(t,e){const n=window.getComputedStyle(t);t.style.display="none";const o=document.createElement("div");o.classList.add("apx-tristate"),e.size&&(e.size.width&&(o.style.width=e.size.width+"px"),e.size.height&&(o.style.height=e.size.height+"px")),e.classes&&o.classList.add(...function(t){let e=[];return"string"==typeof t?e=(t=t.replace(/\s\s+/g," ")).indexOf(" ")>-1?t.split(" "):t.indexOf(",")>-1?t.split(","):[t]:Array.isArray(t)&&(e=t),e}(e.classes)),o.style.margin=n.margin,t.checked?o.classList.add("checked"):o.classList.add("unchecked");const s=document.createElement("input");return s.type="hidden",s.name=t.name,t.dataset.name=t.name,t.removeAttribute("name"),e.defaultState?function(t,e,n){"checked"===t.defaultState?(e.classList.remove("unchecked"),e.classList.add("checked"),n.value="true"):"unchecked"===t.defaultState?(e.classList.remove("checked"),e.classList.add("unchecked"),n.removeAttribute("name"),n.removeAttribute("value")):"crossed"===t.defaultState&&(e.classList.remove("checked"),e.classList.add("crossed"),n.value="false")}(e,o,s):t.checked?s.value="true":(s.name="",s.value=""),o.tabIndex=t.tabIndex,o.appendChild(s),t.parentNode.insertBefore(o,t.nextSibling),o.addEventListener("click",(function(n){!function(t,e,n){t.classList.contains("checked")?(t.classList.remove("checked"),t.classList.add("crossed"),e.checked=!1,n.value="false"):t.classList.contains("crossed")?(t.classList.remove("crossed"),t.classList.add("unchecked"),n.removeAttribute("name"),n.removeAttribute("value")):(t.classList.remove("unchecked"),t.classList.add("checked"),e.checked=!0,n.value="true",n.setAttribute("name",e.dataset.name))}(o,t,s),A(e,t,o,s,n)})),o.addEventListener("keyup",w.bind(null,t)),[t,o,s]}(t,e);e.callbacks&&e.callbacks.after&&"function"==typeof e.callbacks.after&&e.callbacks.after(n,o,s)}}))}}function A(t,e,n,o,s){t.callbacks&&t.callbacks.change&&"function"==typeof t.callbacks.change&&t.callbacks.change(e,n,o),t.bubbleEvents&&("click"===s.type?e.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0})):"keyup"===s.type?e.dispatchEvent(new KeyboardEvent("keyup",{key:" ",bubbles:!0,cancelable:!0})):"change"===s.type&&e.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0})))}function w(t,e){32===e.keyCode&&(A(t,e),e.preventDefault(),e.target.click())}v.styleTagTransform=y(),v.setAttributes=f(),v.insert=p().bind(null,"head"),v.domAPI=l(),v.insertStyleElement=h(),r()(b.Z,v),b.Z&&b.Z.locals&&b.Z.locals;var P=n(613),k={};k.styleTagTransform=y(),k.setAttributes=f(),k.insert=p().bind(null,"head"),k.domAPI=l(),k.insertStyleElement=h(),r()(P.Z,k),P.Z&&P.Z.locals&&P.Z.locals;var X=n(152),E={};E.styleTagTransform=y(),E.setAttributes=f(),E.insert=p().bind(null,"head"),E.domAPI=l(),E.insertStyleElement=h(),r()(X.Z,E),X.Z&&X.Z.locals&&X.Z.locals;const L="undefined"!=typeof window&&"undefined"!=typeof document,C=new Map;let $=null,_=null;const S={position:"bottom-right",maxToasts:5,defaultDurationMs:5e3,zIndex:11e3,ariaLive:"polite",gap:8,dedupe:!1,containerClass:"",offset:0,progress:!1};function T(t,e){const n=document.createElement(t);return e&&e.split(" ").filter(Boolean).forEach((t=>n.classList.add(t))),n}function N(t){return t?'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><path d="M8 6L8 18L17 12Z"/></svg>':'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><line x1="9" y1="6" x2="9" y2="18"/><line x1="15" y1="6" x2="15" y2="18"/></svg>'}function M(t,e,n,o){const s=o.position,a=!0===o.pauseButton,i=T("div",`APX-toast__progress APX-toast__progress--${s}`),r=T("div","APX-toast__progress-track"),c=T("div","APX-toast__progress-bar");c.setAttribute("role","progressbar"),c.setAttribute("aria-valuemin","0"),c.setAttribute("aria-valuemax","100"),c.setAttribute("aria-label","Temps restant"),c.setAttribute("aria-valuenow","100"),c.style.width="100%",r.appendChild(c),i.appendChild(r);let l=null;return a&&(l=T("button","APX-toast__progress-pause"),l.type="button",l.setAttribute("aria-label","Pause"),l.setAttribute("title","Pause"),l.innerHTML=N(!1),i.insertBefore(l,r)),"top"===s?(t.insertBefore(i,e),t.classList.add("APX-toast--has-progress-top")):(t.insertBefore(i,n),t.classList.add("APX-toast--has-progress-bottom")),a&&t.classList.add("APX-toast--has-progress-pause"),{wrap:i,bar:c,pauseBtn:l}}function j(t){return{above:"top",below:"bottom",before:"left",after:"right"}[t]||t}function D(t){if("string"==typeof t)return t.includes("top")?"up":(t.includes("bottom"),"down");if("object"==typeof t&&null!==t){const e=t.type||(t.x||t.y?"sticky":null);if("sticky"===e||!e&&(t.x||t.y)){if(void 0!==t.y){if(t.y.startsWith("-"))return"down";const e=parseFloat(t.y);if(!isNaN(e))return t.y.includes("%")?e<50?"up":"down":e<400?"up":"down"}return"down"}if("anchored"===e&&t.placement){const e=j(t.placement);return"top"===e||"above"===e?"up":"down"}if("relative"===e){if(void 0!==t.y){const e=parseFloat(t.y);if(!isNaN(e))return e<0?"up":"down"}return"down"}}return"down"}function F(){L&&(document.querySelectorAll('.APX-toast-container:not([data-apx-toast-managed="true"])').forEach((t=>{if(0===t.children.length){const e=t.getAttribute("data-apx-toast-position");e&&C.delete(e),t.remove()}})),_&&0===_.children.length&&(_.remove(),_=null),$=null)}function z(t){if("string"==typeof t)return`s:${t}`;if("object"==typeof t&&null!==t){const e=[],n=t.type||(t.x||t.y?"sticky":null);if(n&&e.push(`t:${n}`),void 0!==t.x&&e.push(`x:${t.x}`),void 0!==t.y&&e.push(`y:${t.y}`),t.element){const n=t.element.id||t.element.dataset?.apxToastAnchorId||`el_${function(t){const e=t.getBoundingClientRect(),n=`${t.tagName}_${e.left}_${e.top}_${e.width}_${e.height}`;let o=0;for(let t=0;t<n.length;t++)o=(o<<5)-o+n.charCodeAt(t),o&=o;return Math.abs(o).toString(36)}(t.element)}`;e.push(`el:${n}`)}if(t.placement){const n=j(t.placement);e.push(`p:${n}`)}return void 0!==t.gap&&e.push(`g:${t.gap}`),t.useNativeCSS&&e.push("native:true"),`o:${e.join("|")}`}return"s:bottom-right"}class O{constructor(t){this.config={...S,...t||{}},this.container=null,this.idToRef=new Map,this.open=[]}configure(t){this.config={...this.config,...t||{}},this.container&&this.applyContainerConfig()}setAriaLive(t){this.configure({ariaLive:t})}getOpenToasts(){return this.open.slice()}show(t){if(!L)return null;const e=this.normalizeOptions(t);if(this.config.dedupe&&e.id&&this.idToRef.has(e.id)){const t=this.idToRef.get(e.id);return t.update(e),t}const n=e.position||this.config.position||"bottom-right",o=void 0!==e.flow?e.flow:void 0!==this.config.flow?this.config.flow:"auto",s="auto"===o?D(n):o;this.ensureContainer();const a=T("div",`APX-toast APX-toast--${e.type}`);a.setAttribute("role","status");const i=e.id||`t_${Date.now()}_${Math.random().toString(36).slice(2,8)}`;a.dataset.toastId=i,e.className&&(a.className+=` ${e.className}`);const r=T("div","APX-toast__content");"string"==typeof e.message?r.textContent=e.message:e.message&&r.appendChild(e.message),a.appendChild(r);let c=null;!1!==e.dismissible&&(c=T("button","APX-toast__close"),c.setAttribute("aria-label","Close"),c.type="button",a.appendChild(c));let l=null,d=null,p=null;if(e.progress.enable&&e.durationMs>0){const t=M(a,r,c,e.progress);l=t.wrap,d=t.bar,p=t.pauseBtn}let u=null,f=null,g=null,h=null;if(n&&"object"==typeof n&&null!==n){const t=n.type||(n.x||n.y?"sticky":null);if(n.useNativeCSS&&("relative"===t||"anchored"===t)&&n.element){const e=n.element;h=e.style.position,e.style.position="relative";const o=z(n);let a=e.querySelector(`[data-apx-toast-position="${o}"]`);if(a)a.style.flexDirection="up"===s?"column-reverse":"column";else{if(a=T("div","APX-toast-container APX-toast-container-native"),a.setAttribute("data-apx-toast-position",o),a.style.position="absolute",a.style.zIndex=String(this.config.zIndex),a.style.gap=`${this.config.gap}px`,a.setAttribute("aria-live",String(this.config.ariaLive)),a.style.flexDirection="up"===s?"column-reverse":"column","relative"===t)void 0!==n.x&&(n.x.startsWith("-")?a.style.right=n.x.substring(1):a.style.left=n.x),void 0!==n.y&&(n.y.startsWith("-")?a.style.bottom=n.y.substring(1):a.style.top=n.y);else if("anchored"===t){const t=j(n.placement),e=n.gap||"1em";switch(t){case"top":a.style.bottom=`calc(100% + ${e})`,a.style.left="0";break;case"bottom":a.style.top=`calc(100% + ${e})`,a.style.left="0";break;case"left":a.style.right=`calc(100% + ${e})`,a.style.top="0";break;case"right":a.style.left=`calc(100% + ${e})`,a.style.top="0"}}e.appendChild(a)}u=a,g=()=>{if(e&&e.parentElement&&(e.style.position=h||"",a&&0===a.children.length)){const t=a.getAttribute("data-apx-toast-position");t&&C.delete(t),a.remove()}}}else{u=this.getContainerForPosition(n,s);const e=()=>{const t=this.calculatePosition(n,u);Object.assign(u.style,t)};if(e(),("relative"===t||"anchored"===t)&&n.element){let t=null,o=0;const s=16,a=()=>{const n=Date.now();n-o<s?(t&&cancelAnimationFrame(t),t=requestAnimationFrame((()=>{e(),o=Date.now()}))):(e(),o=n)},i=function(t){const e=[];let n=t.parentElement;for(;n&&n!==document.body&&n!==document.documentElement;){const t=window.getComputedStyle(n),o=t.overflow+t.overflowY+t.overflowX;(o.includes("scroll")||o.includes("auto"))&&e.push(n),n=n.parentElement}return e}(n.element);window.addEventListener("scroll",a,{passive:!0}),window.addEventListener("resize",a,{passive:!0}),i.forEach((t=>{t.addEventListener("scroll",a,{passive:!0})}));const r=new MutationObserver((()=>{n.element.parentElement||X.close("api")}));r.observe(document.body,{childList:!0,subtree:!0}),f=e,g=()=>{window.removeEventListener("scroll",a),window.removeEventListener("resize",a),i.forEach((t=>{t.removeEventListener("scroll",a)})),r.disconnect(),t&&cancelAnimationFrame(t)}}}}else u=this.getContainerForPosition(n,s);u?u.appendChild(a):this.container.appendChild(a),a.classList.add("APX-toast--enter"),requestAnimationFrame((()=>{a.classList.add("APX-toast--enter-active")}));let m=e.durationMs,y=null,b=null,v=!1,x=null;const A={click:new Set,close:new Set},w=()=>{if(m&&!(m<=0)&&(b=Date.now(),y=window.setTimeout((()=>X.close("timeout")),m),d)){const t=()=>{if(null==y||null==b)return;const n=Date.now()-b,o=Math.max(0,m-n),s=e.durationMs,a=s>0?Math.max(0,Math.min(100,o/s*100)):0;d.style.width=`${a}%`,d.setAttribute("aria-valuenow",String(Math.round(a))),x=requestAnimationFrame(t)};x=requestAnimationFrame(t)}},P=()=>{null!=y&&(window.clearTimeout(y),y=null,null!=b&&(m-=Date.now()-b)),null!=x&&(cancelAnimationFrame(x),x=null)},k=t=>{t.addEventListener("click",(e=>{e.stopPropagation(),v=!v,v?P():w();const n=v?"Reprendre":"Pause";t.setAttribute("aria-label",n),t.setAttribute("title",n),t.innerHTML=N(v)}))},X={id:i,el:a,close:t=>{cleanup(t||"api")},update:t=>{const n=this.normalizeOptions({...e,...t});if("string"==typeof n.message?r.textContent=n.message:n.message&&(r.innerHTML="",r.appendChild(n.message)),["info","success","warning","danger"].forEach((t=>a.classList.remove(`APX-toast--${t}`))),a.classList.add(`APX-toast--${n.type}`),e.className!==n.className&&(e.className&&a.classList.remove(...e.className.split(" ").filter(Boolean)),n.className&&a.classList.add(...n.className.split(" ").filter(Boolean))),e.progress=n.progress,l)!n.progress.enable||n.durationMs<=0?l.style.display="none":(l.style.display="",function(t,e,n,o,s){t.classList.remove("APX-toast--has-progress-top","APX-toast--has-progress-bottom"),t.classList.add("top"===s?"APX-toast--has-progress-top":"APX-toast--has-progress-bottom"),e.classList.remove("APX-toast__progress--top","APX-toast__progress--bottom"),e.classList.add(`APX-toast__progress--${s}`);const a="top"===s?n:o;e.nextElementSibling!==a&&t.insertBefore(e,a)}(a,l,r,c,n.progress.position));else if(n.progress.enable&&n.durationMs>0){const t=M(a,r,c,n.progress);l=t.wrap,d=t.bar,p=t.pauseBtn,p&&k(p)}l&&"none"!==l.style.display&&!0===n.progress.pauseButton?a.classList.add("APX-toast--has-progress-pause"):a.classList.remove("APX-toast--has-progress-pause"),e.durationMs=n.durationMs,m=n.durationMs,d&&(d.style.width="100%",d.setAttribute("aria-valuenow","100")),P(),w()},whenClosed:()=>_,on:(t,e)=>(A[t].add(e),()=>X.off(t,e)),off:(t,e)=>{A[t].delete(e)}},E=(t,e)=>A[t].forEach((t=>{try{t(e)}catch(t){}})),_=new Promise((t=>{const n=n=>{if(E("close",n),"function"==typeof e.onClose)try{e.onClose(X,n)}catch(t){}t()},o=t=>{if(!a)return;if(P(),null!=x&&(cancelAnimationFrame(x),x=null),g&&(g(),g=null),"overflow"===t){a.parentElement&&a.parentElement.removeChild(a);const e=this.open.indexOf(X);return e>=0&&this.open.splice(e,1),this.idToRef.delete(i),void n(t)}a.classList.add("APX-toast--exit"),requestAnimationFrame((()=>a.classList.add("APX-toast--exit-active")));const e=()=>{a.removeEventListener("transitionend",e),a.parentElement&&a.parentElement.removeChild(a);const o=this.open.indexOf(X);o>=0&&this.open.splice(o,1),this.idToRef.delete(i),$&&clearTimeout($),$=setTimeout(F,2e4),n(t)};a.addEventListener("transitionend",e)};X.close=t=>o(t||"api")}));return a.addEventListener("click",(t=>{if(E("click",t),"function"==typeof e.onClick)try{e.onClick(X,t)}catch(t){}})),a.addEventListener("mouseenter",P),a.addEventListener("mouseleave",(()=>{v||w()})),c&&c.addEventListener("click",(t=>{t.stopPropagation(),X.close("close")})),p&&k(p),this.open.push(X),this.idToRef.set(i,X),this.open.length>this.config.maxToasts&&this.open[0].close("overflow"),w(),X}info(t,e){return this.show({...e||{},message:t,type:"info"})}success(t,e){return this.show({...e||{},message:t,type:"success"})}warning(t,e){return this.show({...e||{},message:t,type:"warning"})}danger(t,e){return this.show({...e||{},message:t,type:"danger"})}closeAll(t){this.open.slice().forEach((e=>e.close(t||"api")))}normalizeOptions(t){const e={...t};return e.type||(e.type="info"),"boolean"!=typeof e.dismissible&&(e.dismissible=!0),"number"!=typeof e.durationMs&&(e.durationMs=this.config.defaultDurationMs),!e.id&&this.config.id&&(e.id=this.config.id),e.progress=function(t,e){const n=!0===e?{enable:!0,position:"top",pauseButton:!1}:e&&"object"==typeof e?{enable:!!e.enable,position:"bottom"===e.position?"bottom":"top",pauseButton:!0===e.pauseButton}:{enable:!1,position:"top",pauseButton:!1};return null==t?n:!0===t?{enable:!0,position:"top",pauseButton:!1}:"object"==typeof t?{enable:!!t.enable,position:"bottom"===t.position?"bottom":"top",pauseButton:!0===t.pauseButton}:{enable:!1,position:"top",pauseButton:!1}}(t.progress,this.config.progress),e}getContainerForPosition(t,e,n=!1){if(!L)return null;const o=z(t),s=e&&"auto"!==e?e:D(t);let a=C.get(o);if(!a&&L&&(a=document.querySelector(`[data-apx-toast-position="${o}"]`),a&&C.set(o,a)),a)a.style.flexDirection="up"===s?"column-reverse":"column",n&&!a.hasAttribute("data-apx-toast-managed")&&a.setAttribute("data-apx-toast-managed","true");else{a=T("div","APX-toast-container"),a.setAttribute("data-apx-toast-position",o),n&&a.setAttribute("data-apx-toast-managed","true");const e="string"==typeof t?t:t.type||"bottom-right";if(a.classList.add(`APX-toast-container--${e}`),a.setAttribute("aria-live",String(this.config.ariaLive)),a.style.zIndex=String(this.config.zIndex),a.style.gap=`${this.config.gap}px`,a.style.flexDirection="up"===s?"column-reverse":"column","object"==typeof t&&null!==t){a.style.position="fixed";const e=this.calculatePosition(t,a);Object.assign(a.style,e)}const i=L?(_||(_=document.querySelector(".APX-toast-wrapper"),_||(_=T("div","APX-toast-wrapper"),_.style.position="fixed",_.style.top="0",_.style.left="0",_.style.width="0",_.style.height="0",_.style.pointerEvents="none",_.style.zIndex="10000",document.body.appendChild(_))),_):null;i?i.appendChild(a):document.body.appendChild(a),C.set(o,a)}return a}ensureContainer(){if(this.container||!L)return;const t=this.config.position||"bottom-right",e=void 0!==this.config.flow?this.config.flow:"auto";this.container=this.getContainerForPosition(t,e,!0),this.applyContainerConfig()}applyContainerConfig(){if(!this.container)return;const t=this.config.position||"bottom-right",e="string"==typeof t?t:t.type||"bottom-right";if(this.container.style.zIndex=String(this.config.zIndex),this.container.style.gap=`${this.config.gap}px`,this.container.setAttribute("aria-live",String(this.config.ariaLive)),"string"==typeof t){const t=["bottom-right","bottom-left","top-right","top-left"].map((t=>`APX-toast-container--${t}`));this.container.classList.remove(...t),this.container.classList.add(`APX-toast-container--${e}`)}if(this.config.containerClass&&this.config.containerClass.split(" ").filter(Boolean).forEach((t=>{this.container.classList.add(t)})),"string"==typeof t)if(this.config.offset){const t=`${this.config.offset}px`;e.includes("bottom")?this.container.style.bottom=t:this.container.style.top=t,e.includes("right")?this.container.style.right=t:this.container.style.left=t}else e.includes("bottom")?this.container.style.bottom="":this.container.style.top="",e.includes("right")?this.container.style.right="":this.container.style.left="";else"object"==typeof t&&null!==t&&(this.container.style.position="fixed")}calculatePosition(t,e){if("string"==typeof t)return{};if("object"==typeof t&&null!==t){const e=t.type||(t.x||t.y?"sticky":null);if("sticky"===e||!e&&(t.x||t.y)){const e={};return void 0!==t.x&&(t.x.startsWith("-")?e.right=t.x.substring(1):e.left=t.x),void 0!==t.y&&(t.y.startsWith("-")?e.bottom=t.y.substring(1):e.top=t.y),e}if("relative"===e&&t.element){const e=t.element.getBoundingClientRect(),n=t=>{if(!t)return 0;const e=parseFloat(t);return t.includes("em")?16*e:e},o=n(t.x||"0"),s=n(t.y||"0");return{left:`${e.left+o}px`,top:`${e.top+s}px`}}if("anchored"===e&&t.element){const e=t.element.getBoundingClientRect(),n=(t=>{const e=parseFloat(t);return t.includes("em")?16*e:e})(t.gap||"1em"),o={};switch(j(t.placement)){case"top":o.bottom=`${window.innerHeight-e.top+n}px`,o.left=`${e.left}px`;break;case"bottom":o.top=`${e.bottom+n}px`,o.left=`${e.left}px`;break;case"left":o.right=`${window.innerWidth-e.left+n}px`,o.top=`${e.top}px`;break;case"right":o.left=`${e.right+n}px`,o.top=`${e.top}px`}return o}}return{}}}let I=null;const B=()=>(I||(I=new O(undefined)),I);function R(t){return B().show(t)}Object.assign(R,{create:(t,e)=>{if("string"==typeof t){const n=t,o=new O({...e||{}});return R.custom||(R.custom={}),R.custom[n]=o,o}return new O({...t||{}})},custom:{},use:t=>R.custom&&R.custom[t]||null,Manager:O,show:t=>B().show(t),info:(t,e)=>B().info(t,e),success:(t,e)=>B().success(t,e),warning:(t,e)=>B().warning(t,e),danger:(t,e)=>B().danger(t,e),configure:t=>B().configure(t),setAriaLive:t=>B().setAriaLive(t),closeAll:t=>B().closeAll(t),getOpenToasts:()=>B().getOpenToasts()});const q=R,H=t=>{if(!(t&&t instanceof HTMLFormElement))throw new TypeError("packFormToJSON expects an HTMLFormElement");const e=new FormData(t),n={},o=t=>t.reduce(((t,e)=>"key"===e.type?t?`${t}[${e.name}]`:e.name:"numeric"===e.type?`${t}[${e.index}]`:"array"===e.type?`${t}[]`:t),""),s=new Map,a=new Map,i=[],r=(t,e,n,o)=>{const a=s.get(t)??{isFinal:!1,isIntermediate:!1,hasArraySuffix:!1,key:o};s.has(t)||s.set(t,a),e?(a.isFinal=!0,a.key=o,n&&(a.hasArraySuffix=!0)):(a.isIntermediate=!0,a.key??=o)};for(const[t,n]of e.entries()){if(!t)continue;i.push({key:t,value:n});const e=Z(t);let o="";for(let n=0;n<e.length;n++){const s=e[n],a=n===e.length-1,i="array"===s.type;"key"===s.type?o=o?`${o}[${s.name}]`:s.name:"numeric"===s.type?o=`${o}[${s.index}]`:"array"===s.type&&(o=`${o}[]`),r(o,a,i&&a,t)}for(let t=0;t<e.length-1;t++){const n=e[t],o=e[t+1];if("key"===n.type){const t=n.name,e=a.get(t)??{hasNumeric:!1,hasString:!1};a.has(t)||a.set(t,e),o&&("numeric"===o.type?e.hasNumeric=!0:"key"!==o.type&&"array"!==o.type||(e.hasString=!0))}}}(()=>{const t=new Set,e=new Map;for(const[n,o]of s.entries())o.isFinal&&(t.add(n),e.set(n,o.key));for(const[n,o]of s.entries())if(o.isIntermediate)for(const s of t)if(n.startsWith(`${s}[`))throw new Error(`Path conflict: "${s}" is used as a final value (in field "${e.get(s)}"), but "${n}" tries to use it as an intermediate path (in field "${o.key}"). This creates incompatible data structures. You cannot use "${s}" as a primitive value and then access it as an object.`)})();const c=t=>{if(!t)return!1;const e=a.get(t);return e?.hasNumeric&&e?.hasString},l=t=>{const e={};for(let n=0;n<t.length;n++)e[n]=t[n];for(const[n,o]of Object.entries(t)){const t=Number.parseInt(n,10);(Number.isNaN(t)||n!==String(t))&&(e[n]=o)}return e},d=t=>{if(Array.isArray(t))return t;const e=[];if("object"==typeof t&&null!==t)for(const[n,o]of Object.entries(t)){const t=Number.parseInt(n,10);Number.isNaN(t)||(e[t]=o)}return e},p=(t,e,n,o=!1)=>{if(Array.isArray(t)){const o=l(t);return n&&null!==e&&(n[e]=o),o}if("object"!=typeof t||null===t){const t={};return n&&null!==e&&(n[e]=t),t}return t},u=(t,e,n)=>{if(!Array.isArray(t)){const o=d(t);return n&&null!==e&&(n[e]=o),o}return t},f=(t,e,n,o,s)=>{if("array"===e.type)t[e.name]??=[],Array.isArray(t[e.name])?t[e.name].push(n):t[e.name]=[t[e.name],n];else if("numeric"===e.type){const{index:s}=e;for(t=u(t,o.key,o.container);t.length<=s;)t.push(void 0);t[s]=n}else c(s)?(t=p(t,o.key,o.container,!0),Array.isArray(t[e.name])&&(t[e.name]=l(t[e.name])),void 0===t[e.name]||"object"==typeof t[e.name]&&null!==t[e.name]?void 0===t[e.name]?t[e.name]=n:Array.isArray(t[e.name])?t[e.name].push(n):t[e.name]=[t[e.name],n]:t[e.name]=n):void 0===t[e.name]?t[e.name]=n:Array.isArray(t[e.name])?t[e.name].push(n):t[e.name]=[t[e.name],n]},g=(t,e,n,s,a,i,r,f)=>{if("numeric"===e.type){const{index:n}=e;if(c(a)){if(t=p(t,s.key,s.container,!0),t[n]??={},"object"!=typeof t[n]||null===t[n]){const e=i.slice(0,r+1),s=o(e);throw new Error(`Cannot access property on primitive value. Key "${f}" tries to access "${s}" but it is already a ${typeof t[n]} value: ${JSON.stringify(t[n])}. This should have been detected during conflict detection phase.`)}}else{for(t=u(t,s.key,s.container);t.length<=n;)t.push(void 0);if(t[n]??={},"object"!=typeof t[n]||null===t[n]){const e=i.slice(0,r+1),s=o(e);throw new Error(`Cannot access property on primitive value. Key "${f}" tries to access "${s}" but it is already a ${typeof t[n]} value: ${JSON.stringify(t[n])}. This should have been detected during conflict detection phase.`)}}return t[n]}const g="numeric"===n?.type;if(c(a)){if(t=p(t,s.key,s.container,!0),t[e.name]??={},Array.isArray(t[e.name]))t[e.name]=l(t[e.name]);else if("object"!=typeof t[e.name]||null===t[e.name]){const n=i.slice(0,r+1),s=o(n);throw new Error(`Cannot access property on primitive value. Key "${f}" tries to access "${s}" but it is already a ${typeof t[e.name]} value: ${JSON.stringify(t[e.name])}. This should have been detected during conflict detection phase.`)}}else void 0===t[e.name]?t[e.name]=g?[]:{}:g&&!Array.isArray(t[e.name])?Object.keys(t[e.name]).some((t=>{const e=Number.parseInt(t,10);return Number.isNaN(e)||t!==String(e)}))||(t[e.name]=d(t[e.name])):g||U(t[e.name])||(Array.isArray(t[e.name])?t[e.name]=l(t[e.name]):t[e.name]={});if(void 0!==t[e.name]&&("object"!=typeof t[e.name]||null===t[e.name])){const n=i.slice(0,r+1),s=o(n);throw new Error(`Cannot access property on primitive value. Key "${f}" tries to access "${s}" but it is already a ${typeof t[e.name]} value: ${JSON.stringify(t[e.name])}. This should have been detected during conflict detection phase.`)}return t[e.name]};for(const{value:t,key:e}of i){if(!e)continue;const o=Z(e),s=[{container:n,key:null}];let a=n;const i="key"===o[0]?.type?o[0].name:"";for(let n=0;n<o.length;n++){const r=o[n],c=n===o.length-1,l=n+1<o.length?o[n+1]:null,d=s[s.length-1];if(c)f(a,r,t,d,i);else{const t=g(a,r,l,d,i,o,n,e);s.push({container:a,key:"numeric"===r.type?r.index:r.name}),a=t}}}return n},Z=t=>{const e=[];let n="",o=0;const s=t.length;for(;o<s;){const a=t[o];if("["===a){n&&(e.push({name:n,type:"key"}),n=""),o++;let a="";for(;o<s&&"]"!==t[o];)a+=t[o],o++;if(""===a){const t=e[e.length-1];t?t.type="array":e.push({name:"",type:"array"})}else{const t=Number.parseInt(a,10);Number.isNaN(t)||a!==String(t)?e.push({name:a,type:"key"}):e.push({name:String(t),type:"numeric",index:t})}o++}else n+=a,o++}return n&&e.push({name:n,type:"key"}),e},U=t=>"object"==typeof t&&null!==t&&!Array.isArray(t),Y={packFormToJSON:H},W=function(n,o=document){let s;if("string"==typeof o)o=document.querySelector(o);else if(W.isAPXObject(o))o=o.first();else if(!(o instanceof HTMLElement||o instanceof Document))throw new Error("Invalid context for APX");if("string"==typeof n&&n.startsWith("//")){s=document.evaluate(n,o,null,XPathResult.ANY_TYPE,null);let t=[],e=s.iterateNext();for(;e;)t.push(e),e=s.iterateNext();s=t}else if("string"==typeof n)s=o.querySelectorAll(n);else if(n instanceof HTMLElement)s=o.contains(n)?[n]:[];else if(n instanceof NodeList||n instanceof HTMLCollection)s=Array.from(n).filter((t=>o.contains(t)));else if(Array.isArray(n)&&n.every((t=>t instanceof HTMLElement)))s=n.filter((t=>o.contains(t)));else if("undefined"!=typeof jQuery&&n instanceof jQuery)s=Array.from(n.get()).filter((t=>o.contains(t)));else{if("function"!=typeof n)throw new Error("Invalid input type for APX");s=W(n(),o)}var i={elements:s,_isAPXObject:!0};return i.length=s.length,i.each=function(t){return this.elements instanceof Array&&this.elements.forEach(t),this.elements instanceof NodeList&&Array.from(this.elements).forEach(t),this},i.get=function(t){return this.elements[t]},i.all=function(){return this.elements instanceof Array?this.elements:this.elements instanceof NodeList?Array.from(this.elements):this},i.first=function(){return this.get(0)},function(n){let o=n.elements;n.listen=function(n,s,i){let r,c={};"string"==typeof s?(r=s,c=i||{}):c=s||{};const l=function(){const e=Math.random().toString(36).substr(2,9),n=`${Date.now()}_${e}_${t}`;return t=(t+1)%1e3,n}(),d=c.timeout||0;return Array.isArray(n)||(n=[n]),n.forEach((t=>{o.forEach((e=>{e.addEventListener(t,(t=>{a(t,l,d,r,e)}))}))})),{do:function(t){return e[l]||(e[l]=[]),e[l].push(t),this}}},n.trigger=function(t){let o;if("string"==typeof t)o=t,t=new Event(t,{bubbles:!0,cancelable:!0});else{if(!(t instanceof Event))return void console.error("Invalid event type provided to apx.trigger. It must be either a string or Event object.");o=t.type}n.elements.forEach((e=>{e.dispatchEvent(t)})),Object.keys(e).forEach((n=>{const s=e[n];if(s&&s.eventType===o){const{selector:e}=s;e&&!t.target.matches(e)||a(t,n,0,e,t.target)}}))}}(i),x(i),function(t){t.pack=function(){const t=this.first();if(!t)throw new Error("No element found");if("FORM"!==t.tagName)throw new Error("Element is not a form");return H(t)}}(i),i};W.loadCss=function(t){return fetch(t).then((t=>t.text())).then((t=>{const e=document.createElement("style");e.type="text/css",e.textContent=t,document.head.appendChild(e)})).catch((t=>{console.error("Failed to load CSS:",t)}))},W.dialog=t=>{const{title:e,content:n,contentURI:o,buttons:s,size:a,showLoadingIndicator:i,contentMethod:r,contentData:c,contentHeaders:l}={title:"",content:"",contentURI:"",buttons:[],size:"medium",showLoadingIndicator:!1,contentMethod:"GET",contentData:null,contentHeaders:void 0,...t},d=document.createElement("div");d.innerHTML='<div class="APX-dialog"> <div class="APX-dialog-content"> <span class="APX-close-dialog">×</span> <h2 class="APX-dialog-title"></h2> <div class="APX-dialog-dynamic-content"></div> <div class="APX-dialog-button-container"></div> </div> </div>'.trim();const p=d.firstChild,u={},f={};["opening","opened","closing","closed","contentLoading","contentLoaded"].forEach((t=>{f[t]=new Promise((e=>{u[t]=e}))}));const g=t=>{u[t]?u[t]():console.warn(`No resolver found for lifecycle event: ${t}`)},h={element:p,buttons:{},isClosed:!1,lifecycle:f,disableButton:t=>{const e=p.querySelector(`.APX-dialog-button[data-key="${t}"]`);e&&(e.disabled=!0,e.classList.add("APX-dialog-button-disabled"))},enableButton:t=>{const e=p.querySelector(`.APX-dialog-button[data-key="${t}"]`);e&&(e.disabled=!1,e.classList.remove("APX-dialog-button-disabled"))},open:async()=>{try{g("opening"),await h.lifecycle.opening,i&&o?(document.body.appendChild(p),p.style.display="flex",p.querySelector(".APX-dialog-dynamic-content").innerHTML='<div class="APX-dialog-loading-indicator"></div>',await y()):(await y(),document.body.appendChild(p),p.style.display="flex"),g("opened"),await h.lifecycle.opened}catch(t){console.error("Error opening dialog:",t)}return h},close:async()=>{try{g("closing"),await h.lifecycle.closing,m(),g("closed"),await h.lifecycle.closed}catch(t){console.error("Error during dialog closing:",t)}return h}},m=()=>{h.isClosed||(h.isClosed=!0,p.style.display="none",document.body.contains(p)&&document.body.removeChild(p))},y=async()=>{const t=document.body.style.cursor;document.body.style.cursor="wait";const e=p.querySelector(".APX-dialog-dynamic-content");try{g("contentLoading"),await h.lifecycle.contentLoading;const t=o?await b(o):n;e.innerHTML=t,g("contentLoaded"),await h.lifecycle.contentLoaded}catch(t){console.error("Error loading content:",t)}finally{document.body.style.cursor=t}},b=async t=>{const e=(r||"GET").toUpperCase(),n={...l||{}},o=Object.keys(n).some((t=>"content-type"===t.toLowerCase())),s={method:e};if("POST"===e){let t;const e="undefined"!=typeof FormData&&c instanceof FormData,a="undefined"!=typeof URLSearchParams&&c instanceof URLSearchParams,i="undefined"!=typeof Blob&&c instanceof Blob,r="string"==typeof c,l=c&&"object"==typeof c&&!e&&!a&&!i;e?t=c:a?(t=c,o||(n["Content-Type"]="application/x-www-form-urlencoded;charset=UTF-8")):l?(t=JSON.stringify(c),o||(n["Content-Type"]="application/json")):(r||i||null!=c)&&(t=c),void 0!==t&&(s.body=t)}Object.keys(n).length>0&&(s.headers=n);const a=await fetch(t,s);if(!a.ok)throw new Error(`Failed to fetch content: ${a.statusText}`);return a.text()};return(()=>{const t=p.querySelector(".APX-dialog-content");if("auto"===a)return;const e={small:{width:"300px",height:"200px"},medium:{width:"500px",height:"400px"},large:{width:"800px",height:"600px"}}[a]||"object"==typeof a&&a;e&&(t.style.minWidth=e.width||"500px",t.style.minHeight=e.height||"400px")})(),(()=>{const t=p.querySelector(".APX-dialog-button-container");s.forEach((({key:e,label:n,order:o=0,align:s="flex-end",closeOnClick:a=!0})=>{const i=document.createElement("button");i.classList.add("APX-dialog-button"),i.textContent=n,i.style.order=o,i.setAttribute("data-key",e);const r={disable:()=>{i.disabled=!0,i.classList.add("APX-dialog-button-disabled")},enable:()=>{i.disabled=!1,i.classList.remove("APX-dialog-button-disabled")},key:e,element:i};if(a){let t=!1;const n=new Promise((e=>{i.onclick=()=>{t||i.disabled||(t=!0,e({dialog:h,button:r}),h.close())}}));h.buttons[e]=n}else{let t=[];const n={then:e=>("function"==typeof e&&t.push(e),n)};i.onclick=()=>{i.disabled||t.forEach((t=>t({dialog:h,button:r})))},h.buttons[e]=n}t.appendChild(i),t.style.justifyContent=s}))})(),p.querySelector(".APX-dialog-title").textContent=e,p.querySelector(".APX-close-dialog").onclick=h.close,h},W.toast=q,W.tools=Y,W.isAPXObject=function(t){return t&&!0===t._isAPXObject},W.is_numeric=t=>!isNaN(t-parseFloat(t));const J=W})();var s=o.Z;export{s as default};
|
|
1
|
+
var t={613:(t,e,n)=>{n.d(e,{Z:()=>r});var o=n(81),s=n.n(o),a=n(645),i=n.n(a)()(s());i.push([t.id,'/* Dialog styling */\n.APX-dialog {\n display: none;\n position: fixed;\n z-index: 1002;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n overflow: auto;\n background-color: rgba(0, 0, 0, 0.4);\n /* Dimmed background for focus on dialog */\n}\n\n.APX-dialog-content {\n background-color: #fefefe;\n padding: 40px;\n border: none;\n width: auto;\n min-width: 300px;\n max-width: 80%;\n margin: auto;\n border-radius: 8px;\n box-shadow: 0px 6px 20px rgba(0, 0, 0, 0.1);\n font-family: \'Helvetica Neue\', Arial, sans-serif;\n}\n\nh2.APX-dialog-title{\n margin-top:0;\n}\n\n.APX-close-dialog {\n color: #aaa;\n float: right;\n font-size: 24px;\n margin-top: -10px;\n /* Adjust positioning */\n margin-right: -10px;\n}\n\n.APX-close-dialog:hover,\n.APX-close-dialog:focus {\n color: #333;\n /* Darker color on hover/focus */\n cursor: pointer;\n}\n\n/* Input fields styling */\n.APX-dialog-content input[type="text"],\n.APX-dialog-content input[type="number"],\n.APX-dialog-content input[type="date"],\n.APX-dialog-content input[type="datetime-local"] {\n width: 100%;\n padding: 10px;\n margin-bottom: 20px;\n border: 1px solid #ccc;\n border-radius: 4px;\n font-family: \'Helvetica Neue\', Arial, sans-serif;\n font-size: 16px;\n box-sizing: border-box;\n transition: border-color 0.3s;\n}\n\n.APX-dialog-content input[type="text"]:focus,\n.APX-dialog-content input[type="number"]:focus,\n.APX-dialog-content input[type="date"]:focus,\n.APX-dialog-content input[type="datetime-local"]:focus {\n border-color: #2C3E50;\n /* Deep Blue Color */\n outline: none;\n}\n\n/* Button in the dialog */\n.APX-dialog-button-container button {\n position: relative;\n background-color: #2C3E50;\n color: #ECF0F1;\n border: none;\n padding: 10px 20px;\n border-radius: 5px;\n font-size: 16px;\n cursor: pointer;\n transition: all 0.3s ease;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);\n}\n\n.APX-dialog-button-container button:hover {\n background-color: #34495E;\n transform: translateY(-1px);\n box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);\n}\n\n.APX-dialog-button-container {\n display: flex;\n gap: 10px;\n margin-top:1em;\n /* spacing between buttons */\n}\n\n/* Loading indicator */\n.APX-dialog-loading-indicator {\n display: flex;\n justify-content: center;\n align-items: center;\n height: 100px;\n width: 100%;\n}\n\n.APX-dialog-loading-indicator::before {\n content: \'\';\n width: 40px;\n height: 40px;\n border: 4px solid #f3f3f3;\n border-top: 4px solid #2C3E50;\n border-radius: 50%;\n animation: APX-dialog-spin 1s linear infinite;\n}\n\n@keyframes APX-dialog-spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n}\n.APX-dialog-button-disabled {\n opacity: 0.5;\n cursor: not-allowed !important;\n background-color: #95a5a6 !important; /* Grayed out color */\n box-shadow: none !important;\n transition: all 0.2s ease;\n transform: none !important;\n}\n\n.APX-dialog-button-disabled:hover {\n background-color: #95a5a6 !important; /* Keep gray on hover */\n transform: none !important;\n}\n\n/* Add a subtle strikethrough effect */\n.APX-dialog-button-disabled::after {\n content: \'\';\n position: absolute;\n top: 50%;\n left: 0;\n width: 100%;\n height: 1px;\n background-color: rgba(0, 0, 0, 0.2);\n transform: rotate(-5deg);\n}',""]);const r=i},152:(t,e,n)=>{n.d(e,{Z:()=>r});var o=n(81),s=n.n(o),a=n(645),i=n.n(a)()(s());i.push([t.id,".APX-toast-container {\n position: fixed;\n display: flex;\n flex-direction: column;\n gap: var(--apx-toast-gap, 8px);\n z-index: var(--apx-toast-z-index, 11000);\n pointer-events: none;\n}\n\n.APX-toast-container--bottom-right { right: 12px; bottom: 12px; align-items: flex-end; }\n.APX-toast-container--bottom-left { left: 12px; bottom: 12px; align-items: flex-start; }\n.APX-toast-container--top-right { right: 12px; top: 12px; align-items: flex-end; }\n.APX-toast-container--top-left { left: 12px; top: 12px; align-items: flex-start; }\n\n.APX-toast {\n min-width: var(--apx-toast-min-width, 260px);\n max-width: var(--apx-toast-max-width, 420px);\n font-size: var(--apx-toast-font-size, 14px);\n border-radius: var(--apx-toast-radius, 6px);\n box-shadow: var(--apx-toast-shadow, 0 6px 24px rgba(0,0,0,0.2));\n padding: var(--apx-toast-padding, 10px 42px 10px 14px);\n color: #111;\n background: #eee;\n pointer-events: auto;\n position: relative;\n transition: opacity 180ms ease, transform 180ms ease;\n}\n\n.APX-toast--info { background: var(--apx-toast-info-bg, #0dcaf0); color: var(--apx-toast-info-fg, #052c65); }\n.APX-toast--success { background: var(--apx-toast-success-bg, #198754); color: var(--apx-toast-success-fg, #ffffff); }\n.APX-toast--warning { background: var(--apx-toast-warning-bg, #ffc107); color: var(--apx-toast-warning-fg, #664d03); }\n.APX-toast--danger { background: var(--apx-toast-danger-bg, #dc3545); color: var(--apx-toast-danger-fg, #ffffff); }\n\n.APX-toast__content { line-height: 1.35; }\n\n.APX-toast__close {\n position: absolute;\n top: 50%; right: 10px;\n width: 24px; height: 24px;\n transform: translateY(-50%);\n display: inline-flex; align-items: center; justify-content: center;\n background: transparent; color: currentColor;\n border: 0; border-radius: 4px; padding: 0; margin: 0;\n cursor: pointer; appearance: none; -webkit-appearance: none;\n opacity: .75; transition: opacity 120ms ease;\n}\n.APX-toast__close:hover { opacity: 1; }\n.APX-toast__close:focus { outline: 2px solid rgba(0,0,0,.2); outline-offset: 2px; }\n.APX-toast__close::before {\n content: '×';\n font-size: 16px; line-height: 1; text-align: center;\n}\n\n/* Progress bar (outside content, flush to toast edges) */\n.APX-toast__progress {\n position: absolute;\n left: 0;\n right: 0;\n height: var(--apx-toast-progress-height, 4px);\n display: flex;\n flex-direction: row;\n align-items: stretch;\n flex-shrink: 0;\n border-radius: inherit;\n overflow: visible;\n}\n.APX-toast__progress--top {\n top: 0;\n border-radius: var(--apx-toast-radius, 6px) var(--apx-toast-radius, 6px) 0 0;\n}\n.APX-toast__progress--bottom {\n bottom: 0;\n border-radius: 0 0 var(--apx-toast-radius, 6px) var(--apx-toast-radius, 6px);\n}\n/* Track contains the bar; no margin (pause button is on the corner, overlapping) */\n.APX-toast__progress-track {\n flex: 1;\n min-width: 0;\n overflow: hidden;\n}\n.APX-toast__progress-bar {\n height: 100%;\n width: 100%;\n max-width: 100%;\n transition: width 80ms linear;\n background: rgba(0, 0, 0, 0.25);\n}\n.APX-toast--info .APX-toast__progress-bar { background: rgba(5, 44, 101, 0.5); }\n.APX-toast--success .APX-toast__progress-bar { background: rgba(0, 0, 0, 0.25); }\n.APX-toast--warning .APX-toast__progress-bar { background: rgba(102, 77, 3, 0.5); }\n.APX-toast--danger .APX-toast__progress-bar { background: rgba(0, 0, 0, 0.25); }\n/* Pause/Resume button: round, center exactly on toast corner (top-left or bottom-left) */\n.APX-toast__progress-pause {\n position: absolute;\n width: var(--apx-toast-progress-pause-size, 18px);\n height: var(--apx-toast-progress-pause-size, 18px);\n left: 0;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n background: #eee;\n color: currentColor;\n border: 1px solid rgba(0, 0, 0, 0.35);\n border-radius: 50%;\n padding: 0;\n margin: 0;\n cursor: pointer;\n line-height: 1;\n opacity: 0.95;\n transition: opacity 120ms ease;\n flex-shrink: 0;\n}\n.APX-toast__progress--top .APX-toast__progress-pause {\n top: 0;\n transform: translate(-50%, -50%);\n}\n.APX-toast__progress--bottom .APX-toast__progress-pause {\n bottom: 0;\n transform: translate(-50%, 50%);\n}\n.APX-toast--info .APX-toast__progress-pause { background: var(--apx-toast-info-bg, #0dcaf0); border-color: rgba(5, 44, 101, 0.55); }\n.APX-toast--success .APX-toast__progress-pause { background: var(--apx-toast-success-bg, #198754); border-color: rgba(0, 0, 0, 0.3); }\n.APX-toast--warning .APX-toast__progress-pause { background: var(--apx-toast-warning-bg, #ffc107); border-color: rgba(102, 77, 3, 0.6); }\n.APX-toast--danger .APX-toast__progress-pause { background: var(--apx-toast-danger-bg, #dc3545); border-color: rgba(0, 0, 0, 0.35); }\n.APX-toast__progress-pause:hover { opacity: 1; }\n.APX-toast__progress-pause:focus { outline: 2px solid rgba(0,0,0,.4); outline-offset: -2px; }\n.APX-toast__progress-pause svg {\n width: 10px;\n height: 10px;\n display: block;\n}\n/* Extra top/bottom padding when progress bar is present (default content padding 10px + bar height) */\n.APX-toast--has-progress-top { padding-top: calc(10px + var(--apx-toast-progress-height, 4px)); }\n.APX-toast--has-progress-bottom { padding-bottom: calc(10px + var(--apx-toast-progress-height, 4px)); }\n/* Reserve space for stacking when pause button is present (button extends outside toast corner) */\n.APX-toast--has-progress-top.APX-toast--has-progress-pause { margin-top: calc(var(--apx-toast-progress-pause-size, 18px) / 2); }\n.APX-toast--has-progress-bottom.APX-toast--has-progress-pause { margin-bottom: calc(var(--apx-toast-progress-pause-size, 18px) / 2); }\n\n/* Animations */\n.APX-toast--enter { opacity: 0; transform: translateY(8px); }\n.APX-toast--enter.APX-toast--enter-active { opacity: 1; transform: translateY(0); }\n.APX-toast--exit { opacity: 1; transform: translateY(0); }\n.APX-toast--exit.APX-toast--exit-active { opacity: 0; transform: translateY(8px); }\n\n\n",""]);const r=i},570:(t,e,n)=>{n.d(e,{Z:()=>m});var o=n(81),s=n.n(o),a=n(645),i=n.n(a),r=n(667),c=n.n(r),l=new URL(n(29),n.b),d=new URL(n(913),n.b),p=new URL(n(260),n.b),u=i()(s()),f=c()(l),g=c()(d),h=c()(p);u.push([t.id,`.apx-tristate {\n display: inline-block;\n vertical-align: middle;\n text-align: center;\n cursor: pointer;\n position: relative;\n min-width:13px;\n min-height:13px;\n background-size: contain;\n background-color: white;\n border-radius:3px;\n}\n.apx-tristate.unchecked {\n background-image: url(${f});\n}\n.apx-tristate.checked {\n background-image: url(${g});\n background-repeat: no-repeat;\n background-position: center;\n}\n.apx-tristate.crossed {\n background-image: url(${h});\n background-repeat: no-repeat;\n background-position: center;\n}`,""]);const m=u},645:t=>{t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n="",o=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),o&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),o&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n})).join("")},e.i=function(t,n,o,s,a){"string"==typeof t&&(t=[[null,t,void 0]]);var i={};if(o)for(var r=0;r<this.length;r++){var c=this[r][0];null!=c&&(i[c]=!0)}for(var l=0;l<t.length;l++){var d=[].concat(t[l]);o&&i[d[0]]||(void 0!==a&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=a),n&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=n):d[2]=n),s&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=s):d[4]="".concat(s)),e.push(d))}},e}},667:t=>{t.exports=function(t,e){return e||(e={}),t?(t=String(t.__esModule?t.default:t),/^['"].*['"]$/.test(t)&&(t=t.slice(1,-1)),e.hash&&(t+=e.hash),/["'() \t\n]|(%20)/.test(t)||e.needQuotes?'"'.concat(t.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):t):t}},81:t=>{t.exports=function(t){return t[1]}},379:t=>{var e=[];function n(t){for(var n=-1,o=0;o<e.length;o++)if(e[o].identifier===t){n=o;break}return n}function o(t,o){for(var a={},i=[],r=0;r<t.length;r++){var c=t[r],l=o.base?c[0]+o.base:c[0],d=a[l]||0,p="".concat(l," ").concat(d);a[l]=d+1;var u=n(p),f={css:c[1],media:c[2],sourceMap:c[3],supports:c[4],layer:c[5]};if(-1!==u)e[u].references++,e[u].updater(f);else{var g=s(f,o);o.byIndex=r,e.splice(r,0,{identifier:p,updater:g,references:1})}i.push(p)}return i}function s(t,e){var n=e.domAPI(e);return n.update(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap&&e.supports===t.supports&&e.layer===t.layer)return;n.update(t=e)}else n.remove()}}t.exports=function(t,s){var a=o(t=t||[],s=s||{});return function(t){t=t||[];for(var i=0;i<a.length;i++){var r=n(a[i]);e[r].references--}for(var c=o(t,s),l=0;l<a.length;l++){var d=n(a[l]);0===e[d].references&&(e[d].updater(),e.splice(d,1))}a=c}}},569:t=>{var e={};t.exports=function(t,n){var o=function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}e[t]=n}return e[t]}(t);if(!o)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");o.appendChild(n)}},216:t=>{t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},565:(t,e,n)=>{t.exports=function(t){var e=n.nc;e&&t.setAttribute("nonce",e)}},795:t=>{t.exports=function(t){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var e=t.insertStyleElement(t);return{update:function(n){!function(t,e,n){var o="";n.supports&&(o+="@supports (".concat(n.supports,") {")),n.media&&(o+="@media ".concat(n.media," {"));var s=void 0!==n.layer;s&&(o+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),o+=n.css,s&&(o+="}"),n.media&&(o+="}"),n.supports&&(o+="}");var a=n.sourceMap;a&&"undefined"!=typeof btoa&&(o+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),e.styleTagTransform(o,t,e.options)}(e,t,n)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},589:t=>{t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}},260:t=>{t.exports="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20viewBox%3D%220%200%2032%2032%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22m0.543%205.647c0-3.119%202.531-5.647%205.65-5.647h19.309c3.12%200%205.65%202.511%205.65%205.647v20.705c0%203.119-2.531%205.647-5.65%205.647h-19.309c-3.12%200-5.65-2.511-5.65-5.647v-20.705z%22%20fill%3D%22%23f00%22%2F%3E%3Cpath%20d%3D%22m8%208%2016%2016%22%20stroke%3D%22%23fff%22%20stroke-width%3D%222%22%2F%3E%3Cpath%20d%3D%22M24%208L8%2024%22%20stroke%3D%22%23fff%22%20stroke-width%3D%222%22%2F%3E%3C%2Fsvg%3E"},29:t=>{t.exports="data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20width%3D%2732%27%20height%3D%2732%27%3E%3Cpath%20%20fill%3D%22%23cccccc%22%20d%3D%22M25.107%2032.030h-18.214c-3.456%200-6.268-2.81-6.268-6.264v-19.529c0-3.456%202.812-6.268%206.268-6.268h18.214c3.456%200%206.268%202.812%206.268%206.268v19.529c0%203.452-2.812%206.264-6.268%206.264zM6.893%201.85c-2.419%200-4.386%201.967-4.386%204.386v19.529c0%202.417%201.967%204.382%204.386%204.382h18.214c2.419%200%204.386-1.965%204.386-4.382v-19.529c0-2.419-1.967-4.386-4.386-4.386h-18.214z%22%3E%3C/path%3E%3C/svg%3E"},913:t=>{t.exports="data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20width%3D%2732%27%20height%3D%2732%27%3E%3Cpath%20fill%3D%22%230654ba%22%20d%3D%22M0.543%205.647c0-3.119%202.531-5.647%205.65-5.647h19.309c3.12%200%205.65%202.511%205.65%205.647v20.705c0%203.119-2.531%205.647-5.65%205.647h-19.309c-3.12%200-5.65-2.511-5.65-5.647v-20.705zM5.313%2017.587l7.039%206.839%2013.831-13.439-2.636-2.561-10.929%2010.62-4.442-4.317-2.862%202.858z%22%3E%3C/path%3E%3C/svg%3E"}},e={};function n(o){var s=e[o];if(void 0!==s)return s.exports;var a=e[o]={id:o,exports:{}};return t[o](a,a.exports,n),a.exports}n.m=t,n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var o in e)n.o(e,o)&&!n.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.b=document.baseURI||self.location.href,n.nc=void 0;var o={};(()=>{n.d(o,{Z:()=>J});let t=0;const e={},s={};function a(t,n,o,a="",i){const r=a?function(t,e){for(;t&&1===t.nodeType;){if(t.matches(e))return t;t=t.parentNode}return null}(t.target,a):i;function c(){e[n]&&e[n].reduce(((e,n)=>e.then((()=>new Promise(((e,o)=>{try{const s=n.bind(r)(t);s instanceof Promise?s.then(e).catch(o):e(s)}catch(t){o(t)}}))))),Promise.resolve()).catch((t=>{console.error("Error in callback chain:",t)}))}r&&(clearTimeout(s[n]),0===o?c():s[n]=setTimeout(c,o))}var i=n(379),r=n.n(i),c=n(795),l=n.n(c),d=n(569),p=n.n(d),u=n(565),f=n.n(u),g=n(216),h=n.n(g),m=n(589),y=n.n(m),b=n(570),v={};function x(t){t.tristate=function(e={}){t.elements.forEach((t=>{if("checkbox"===t.type){const[n,o,s]=function(t,e){const n=window.getComputedStyle(t);t.style.display="none";const o=document.createElement("div");o.classList.add("apx-tristate"),e.size&&(e.size.width&&(o.style.width=e.size.width+"px"),e.size.height&&(o.style.height=e.size.height+"px")),e.classes&&o.classList.add(...function(t){let e=[];return"string"==typeof t?e=(t=t.replace(/\s\s+/g," ")).indexOf(" ")>-1?t.split(" "):t.indexOf(",")>-1?t.split(","):[t]:Array.isArray(t)&&(e=t),e}(e.classes)),o.style.margin=n.margin,t.checked?o.classList.add("checked"):o.classList.add("unchecked");const s=document.createElement("input");return s.type="hidden",s.name=t.name,t.dataset.name=t.name,t.removeAttribute("name"),e.defaultState?function(t,e,n){"checked"===t.defaultState?(e.classList.remove("unchecked"),e.classList.add("checked"),n.value="true"):"unchecked"===t.defaultState?(e.classList.remove("checked"),e.classList.add("unchecked"),n.removeAttribute("name"),n.removeAttribute("value")):"crossed"===t.defaultState&&(e.classList.remove("checked"),e.classList.add("crossed"),n.value="false")}(e,o,s):t.checked?s.value="true":(s.name="",s.value=""),o.tabIndex=t.tabIndex,o.appendChild(s),t.parentNode.insertBefore(o,t.nextSibling),o.addEventListener("click",(function(n){!function(t,e,n){t.classList.contains("checked")?(t.classList.remove("checked"),t.classList.add("crossed"),e.checked=!1,n.value="false"):t.classList.contains("crossed")?(t.classList.remove("crossed"),t.classList.add("unchecked"),n.removeAttribute("name"),n.removeAttribute("value")):(t.classList.remove("unchecked"),t.classList.add("checked"),e.checked=!0,n.value="true",n.setAttribute("name",e.dataset.name))}(o,t,s),A(e,t,o,s,n)})),o.addEventListener("keyup",w.bind(null,t)),[t,o,s]}(t,e);e.callbacks&&e.callbacks.after&&"function"==typeof e.callbacks.after&&e.callbacks.after(n,o,s)}}))}}function A(t,e,n,o,s){t.callbacks&&t.callbacks.change&&"function"==typeof t.callbacks.change&&t.callbacks.change(e,n,o),t.bubbleEvents&&("click"===s.type?e.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0})):"keyup"===s.type?e.dispatchEvent(new KeyboardEvent("keyup",{key:" ",bubbles:!0,cancelable:!0})):"change"===s.type&&e.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0})))}function w(t,e){32===e.keyCode&&(A(t,e),e.preventDefault(),e.target.click())}v.styleTagTransform=y(),v.setAttributes=f(),v.insert=p().bind(null,"head"),v.domAPI=l(),v.insertStyleElement=h(),r()(b.Z,v),b.Z&&b.Z.locals&&b.Z.locals;var P=n(613),k={};k.styleTagTransform=y(),k.setAttributes=f(),k.insert=p().bind(null,"head"),k.domAPI=l(),k.insertStyleElement=h(),r()(P.Z,k),P.Z&&P.Z.locals&&P.Z.locals;var X=n(152),E={};E.styleTagTransform=y(),E.setAttributes=f(),E.insert=p().bind(null,"head"),E.domAPI=l(),E.insertStyleElement=h(),r()(X.Z,E),X.Z&&X.Z.locals&&X.Z.locals;const L="undefined"!=typeof window&&"undefined"!=typeof document,C=new Map;let $=null,_=null;const S={position:"bottom-right",maxToasts:5,defaultDurationMs:5e3,zIndex:11e3,ariaLive:"polite",gap:8,dedupe:!1,containerClass:"",offset:0,progress:!1};function T(t,e){const n=document.createElement(t);return e&&e.split(" ").filter(Boolean).forEach((t=>n.classList.add(t))),n}function N(t){return t?'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><path d="M8 6L8 18L17 12Z"/></svg>':'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><line x1="9" y1="6" x2="9" y2="18"/><line x1="15" y1="6" x2="15" y2="18"/></svg>'}function M(t,e,n,o){const s=o.position,a=!0===o.pauseButton,i=T("div",`APX-toast__progress APX-toast__progress--${s}`),r=T("div","APX-toast__progress-track"),c=T("div","APX-toast__progress-bar");c.setAttribute("role","progressbar"),c.setAttribute("aria-valuemin","0"),c.setAttribute("aria-valuemax","100"),c.setAttribute("aria-label","Temps restant"),c.setAttribute("aria-valuenow","100"),c.style.width="100%",r.appendChild(c),i.appendChild(r);let l=null;return a&&(l=T("button","APX-toast__progress-pause"),l.type="button",l.setAttribute("aria-label","Pause"),l.setAttribute("title","Pause"),l.innerHTML=N(!1),i.insertBefore(l,r)),"top"===s?(t.insertBefore(i,e),t.classList.add("APX-toast--has-progress-top")):(t.insertBefore(i,n),t.classList.add("APX-toast--has-progress-bottom")),a&&t.classList.add("APX-toast--has-progress-pause"),{wrap:i,bar:c,pauseBtn:l}}function j(t){return{above:"top",below:"bottom",before:"left",after:"right"}[t]||t}function D(t){if("string"==typeof t)return t.includes("top")?"up":(t.includes("bottom"),"down");if("object"==typeof t&&null!==t){const e=t.type||(t.x||t.y?"sticky":null);if("sticky"===e||!e&&(t.x||t.y)){if(void 0!==t.y){if(t.y.startsWith("-"))return"down";const e=parseFloat(t.y);if(!isNaN(e))return t.y.includes("%")?e<50?"up":"down":e<400?"up":"down"}return"down"}if("anchored"===e&&t.placement){const e=j(t.placement);return"top"===e||"above"===e?"up":"down"}if("relative"===e){if(void 0!==t.y){const e=parseFloat(t.y);if(!isNaN(e))return e<0?"up":"down"}return"down"}}return"down"}function F(){L&&(document.querySelectorAll('.APX-toast-container:not([data-apx-toast-managed="true"])').forEach((t=>{if(0===t.children.length){const e=t.getAttribute("data-apx-toast-position");e&&C.delete(e),t.remove()}})),_&&0===_.children.length&&(_.remove(),_=null),$=null)}function z(t){if("string"==typeof t)return`s:${t}`;if("object"==typeof t&&null!==t){const e=[],n=t.type||(t.x||t.y?"sticky":null);if(n&&e.push(`t:${n}`),void 0!==t.x&&e.push(`x:${t.x}`),void 0!==t.y&&e.push(`y:${t.y}`),t.element){const n=t.element.id||t.element.dataset?.apxToastAnchorId||`el_${function(t){const e=t.getBoundingClientRect(),n=`${t.tagName}_${e.left}_${e.top}_${e.width}_${e.height}`;let o=0;for(let t=0;t<n.length;t++)o=(o<<5)-o+n.charCodeAt(t),o&=o;return Math.abs(o).toString(36)}(t.element)}`;e.push(`el:${n}`)}if(t.placement){const n=j(t.placement);e.push(`p:${n}`)}return void 0!==t.gap&&e.push(`g:${t.gap}`),t.useNativeCSS&&e.push("native:true"),`o:${e.join("|")}`}return"s:bottom-right"}class O{constructor(t){this.config={...S,...t||{}},this.container=null,this.idToRef=new Map,this.open=[]}configure(t){this.config={...this.config,...t||{}},this.container&&this.applyContainerConfig()}setAriaLive(t){this.configure({ariaLive:t})}getOpenToasts(){return this.open.slice()}show(t){if(!L)return null;const e=this.normalizeOptions(t);if(this.config.dedupe&&e.id&&this.idToRef.has(e.id)){const t=this.idToRef.get(e.id);return t.update(e),t}const n=e.position||this.config.position||"bottom-right",o=void 0!==e.flow?e.flow:void 0!==this.config.flow?this.config.flow:"auto",s="auto"===o?D(n):o;this.ensureContainer();const a=T("div",`APX-toast APX-toast--${e.type}`);a.setAttribute("role","status");const i=e.id||`t_${Date.now()}_${Math.random().toString(36).slice(2,8)}`;a.dataset.toastId=i,e.className&&(a.className+=` ${e.className}`);const r=T("div","APX-toast__content");"string"==typeof e.message?r.textContent=e.message:e.message&&r.appendChild(e.message),a.appendChild(r);let c=null;!1!==e.dismissible&&(c=T("button","APX-toast__close"),c.setAttribute("aria-label","Close"),c.type="button",a.appendChild(c));let l=null,d=null,p=null;if(e.progress.enable&&e.durationMs>0){const t=M(a,r,c,e.progress);l=t.wrap,d=t.bar,p=t.pauseBtn}let u=null,f=null,g=null,h=null;if(n&&"object"==typeof n&&null!==n){const t=n.type||(n.x||n.y?"sticky":null);if(n.useNativeCSS&&("relative"===t||"anchored"===t)&&n.element){const e=n.element;h=e.style.position,e.style.position="relative";const o=z(n);let a=e.querySelector(`[data-apx-toast-position="${o}"]`);if(a)a.style.flexDirection="up"===s?"column-reverse":"column";else{if(a=T("div","APX-toast-container APX-toast-container-native"),a.setAttribute("data-apx-toast-position",o),a.style.position="absolute",a.style.zIndex=String(this.config.zIndex),a.style.gap=`${this.config.gap}px`,a.setAttribute("aria-live",String(this.config.ariaLive)),a.style.flexDirection="up"===s?"column-reverse":"column","relative"===t)void 0!==n.x&&(n.x.startsWith("-")?a.style.right=n.x.substring(1):a.style.left=n.x),void 0!==n.y&&(n.y.startsWith("-")?a.style.bottom=n.y.substring(1):a.style.top=n.y);else if("anchored"===t){const t=j(n.placement),e=n.gap||"1em";switch(t){case"top":a.style.bottom=`calc(100% + ${e})`,a.style.left="0";break;case"bottom":a.style.top=`calc(100% + ${e})`,a.style.left="0";break;case"left":a.style.right=`calc(100% + ${e})`,a.style.top="0";break;case"right":a.style.left=`calc(100% + ${e})`,a.style.top="0"}}e.appendChild(a)}u=a,g=()=>{if(e&&e.parentElement&&(e.style.position=h||"",a&&0===a.children.length)){const t=a.getAttribute("data-apx-toast-position");t&&C.delete(t),a.remove()}}}else{u=this.getContainerForPosition(n,s);const e=()=>{const t=this.calculatePosition(n,u);Object.assign(u.style,t)};if(e(),("relative"===t||"anchored"===t)&&n.element){let t=null,o=0;const s=16,a=()=>{const n=Date.now();n-o<s?(t&&cancelAnimationFrame(t),t=requestAnimationFrame((()=>{e(),o=Date.now()}))):(e(),o=n)},i=function(t){const e=[];let n=t.parentElement;for(;n&&n!==document.body&&n!==document.documentElement;){const t=window.getComputedStyle(n),o=t.overflow+t.overflowY+t.overflowX;(o.includes("scroll")||o.includes("auto"))&&e.push(n),n=n.parentElement}return e}(n.element);window.addEventListener("scroll",a,{passive:!0}),window.addEventListener("resize",a,{passive:!0}),i.forEach((t=>{t.addEventListener("scroll",a,{passive:!0})}));const r=new MutationObserver((()=>{n.element.parentElement||X.close("api")}));r.observe(document.body,{childList:!0,subtree:!0}),f=e,g=()=>{window.removeEventListener("scroll",a),window.removeEventListener("resize",a),i.forEach((t=>{t.removeEventListener("scroll",a)})),r.disconnect(),t&&cancelAnimationFrame(t)}}}}else u=this.getContainerForPosition(n,s);u?u.appendChild(a):this.container.appendChild(a),a.classList.add("APX-toast--enter"),requestAnimationFrame((()=>{a.classList.add("APX-toast--enter-active")}));let m=e.durationMs,y=null,b=null,v=!1,x=null;const A={click:new Set,close:new Set},w=()=>{if(m&&!(m<=0)&&(b=Date.now(),y=window.setTimeout((()=>X.close("timeout")),m),d)){const t=()=>{if(null==y||null==b)return;const n=Date.now()-b,o=Math.max(0,m-n),s=e.durationMs,a=s>0?Math.max(0,Math.min(100,o/s*100)):0;d.style.width=`${a}%`,d.setAttribute("aria-valuenow",String(Math.round(a))),x=requestAnimationFrame(t)};x=requestAnimationFrame(t)}},P=()=>{null!=y&&(window.clearTimeout(y),y=null,null!=b&&(m-=Date.now()-b)),null!=x&&(cancelAnimationFrame(x),x=null)},k=t=>{t.addEventListener("click",(e=>{e.stopPropagation(),v=!v,v?P():w();const n=v?"Reprendre":"Pause";t.setAttribute("aria-label",n),t.setAttribute("title",n),t.innerHTML=N(v)}))},X={id:i,el:a,close:t=>{cleanup(t||"api")},update:t=>{const n=this.normalizeOptions({...e,...t});if("string"==typeof n.message?r.textContent=n.message:n.message&&(r.innerHTML="",r.appendChild(n.message)),["info","success","warning","danger"].forEach((t=>a.classList.remove(`APX-toast--${t}`))),a.classList.add(`APX-toast--${n.type}`),e.className!==n.className&&(e.className&&a.classList.remove(...e.className.split(" ").filter(Boolean)),n.className&&a.classList.add(...n.className.split(" ").filter(Boolean))),e.progress=n.progress,l)!n.progress.enable||n.durationMs<=0?l.style.display="none":(l.style.display="",function(t,e,n,o,s){t.classList.remove("APX-toast--has-progress-top","APX-toast--has-progress-bottom"),t.classList.add("top"===s?"APX-toast--has-progress-top":"APX-toast--has-progress-bottom"),e.classList.remove("APX-toast__progress--top","APX-toast__progress--bottom"),e.classList.add(`APX-toast__progress--${s}`);const a="top"===s?n:o;e.nextElementSibling!==a&&t.insertBefore(e,a)}(a,l,r,c,n.progress.position));else if(n.progress.enable&&n.durationMs>0){const t=M(a,r,c,n.progress);l=t.wrap,d=t.bar,p=t.pauseBtn,p&&k(p)}l&&"none"!==l.style.display&&!0===n.progress.pauseButton?a.classList.add("APX-toast--has-progress-pause"):a.classList.remove("APX-toast--has-progress-pause"),e.durationMs=n.durationMs,m=n.durationMs,d&&(d.style.width="100%",d.setAttribute("aria-valuenow","100")),P(),w()},whenClosed:()=>_,on:(t,e)=>(A[t].add(e),()=>X.off(t,e)),off:(t,e)=>{A[t].delete(e)}},E=(t,e)=>A[t].forEach((t=>{try{t(e)}catch(t){}})),_=new Promise((t=>{const n=n=>{if(E("close",n),"function"==typeof e.onClose)try{e.onClose(X,n)}catch(t){}t()},o=t=>{if(!a)return;if(P(),null!=x&&(cancelAnimationFrame(x),x=null),g&&(g(),g=null),"overflow"===t){a.parentElement&&a.parentElement.removeChild(a);const e=this.open.indexOf(X);return e>=0&&this.open.splice(e,1),this.idToRef.delete(i),void n(t)}a.classList.add("APX-toast--exit"),requestAnimationFrame((()=>a.classList.add("APX-toast--exit-active")));const e=()=>{a.removeEventListener("transitionend",e),a.parentElement&&a.parentElement.removeChild(a);const o=this.open.indexOf(X);o>=0&&this.open.splice(o,1),this.idToRef.delete(i),$&&clearTimeout($),$=setTimeout(F,2e4),n(t)};a.addEventListener("transitionend",e)};X.close=t=>o(t||"api")}));return a.addEventListener("click",(t=>{if(E("click",t),"function"==typeof e.onClick)try{e.onClick(X,t)}catch(t){}})),a.addEventListener("mouseenter",P),a.addEventListener("mouseleave",(()=>{v||w()})),c&&c.addEventListener("click",(t=>{t.stopPropagation(),X.close("close")})),p&&k(p),this.open.push(X),this.idToRef.set(i,X),this.open.length>this.config.maxToasts&&this.open[0].close("overflow"),w(),X}info(t,e){return this.show({...e||{},message:t,type:"info"})}success(t,e){return this.show({...e||{},message:t,type:"success"})}warning(t,e){return this.show({...e||{},message:t,type:"warning"})}danger(t,e){return this.show({...e||{},message:t,type:"danger"})}closeAll(t){this.open.slice().forEach((e=>e.close(t||"api")))}normalizeOptions(t){const e={...t};return e.type||(e.type="info"),"boolean"!=typeof e.dismissible&&(e.dismissible=!0),"number"!=typeof e.durationMs&&(e.durationMs=this.config.defaultDurationMs),!e.id&&this.config.id&&(e.id=this.config.id),e.progress=function(t,e){const n=!0===e?{enable:!0,position:"top",pauseButton:!1}:e&&"object"==typeof e?{enable:!!e.enable,position:"bottom"===e.position?"bottom":"top",pauseButton:!0===e.pauseButton}:{enable:!1,position:"top",pauseButton:!1};return null==t?n:!0===t?{enable:!0,position:"top",pauseButton:!1}:"object"==typeof t?{enable:!!t.enable,position:"bottom"===t.position?"bottom":"top",pauseButton:!0===t.pauseButton}:{enable:!1,position:"top",pauseButton:!1}}(t.progress,this.config.progress),e}getContainerForPosition(t,e,n=!1){if(!L)return null;const o=z(t),s=e&&"auto"!==e?e:D(t);let a=C.get(o);if(!a&&L&&(a=document.querySelector(`[data-apx-toast-position="${o}"]`),a&&C.set(o,a)),a)a.style.flexDirection="up"===s?"column-reverse":"column",n&&!a.hasAttribute("data-apx-toast-managed")&&a.setAttribute("data-apx-toast-managed","true");else{a=T("div","APX-toast-container"),a.setAttribute("data-apx-toast-position",o),n&&a.setAttribute("data-apx-toast-managed","true");const e="string"==typeof t?t:t.type||"bottom-right";if(a.classList.add(`APX-toast-container--${e}`),a.setAttribute("aria-live",String(this.config.ariaLive)),a.style.zIndex=String(this.config.zIndex),a.style.gap=`${this.config.gap}px`,a.style.flexDirection="up"===s?"column-reverse":"column","object"==typeof t&&null!==t){a.style.position="fixed";const e=this.calculatePosition(t,a);Object.assign(a.style,e)}const i=L?(_||(_=document.querySelector(".APX-toast-wrapper"),_||(_=T("div","APX-toast-wrapper"),_.style.position="fixed",_.style.top="0",_.style.left="0",_.style.width="0",_.style.height="0",_.style.pointerEvents="none",_.style.zIndex="10000",document.body.appendChild(_))),_):null;i?i.appendChild(a):document.body.appendChild(a),C.set(o,a)}return a}ensureContainer(){if(this.container||!L)return;const t=this.config.position||"bottom-right",e=void 0!==this.config.flow?this.config.flow:"auto";this.container=this.getContainerForPosition(t,e,!0),this.applyContainerConfig()}applyContainerConfig(){if(!this.container)return;const t=this.config.position||"bottom-right",e="string"==typeof t?t:t.type||"bottom-right";if(this.container.style.zIndex=String(this.config.zIndex),this.container.style.gap=`${this.config.gap}px`,this.container.setAttribute("aria-live",String(this.config.ariaLive)),"string"==typeof t){const t=["bottom-right","bottom-left","top-right","top-left"].map((t=>`APX-toast-container--${t}`));this.container.classList.remove(...t),this.container.classList.add(`APX-toast-container--${e}`)}if(this.config.containerClass&&this.config.containerClass.split(" ").filter(Boolean).forEach((t=>{this.container.classList.add(t)})),"string"==typeof t)if(this.config.offset){const t=`${this.config.offset}px`;e.includes("bottom")?this.container.style.bottom=t:this.container.style.top=t,e.includes("right")?this.container.style.right=t:this.container.style.left=t}else e.includes("bottom")?this.container.style.bottom="":this.container.style.top="",e.includes("right")?this.container.style.right="":this.container.style.left="";else"object"==typeof t&&null!==t&&(this.container.style.position="fixed")}calculatePosition(t,e){if("string"==typeof t)return{};if("object"==typeof t&&null!==t){const e=t.type||(t.x||t.y?"sticky":null);if("sticky"===e||!e&&(t.x||t.y)){const e={};return void 0!==t.x&&(t.x.startsWith("-")?e.right=t.x.substring(1):e.left=t.x),void 0!==t.y&&(t.y.startsWith("-")?e.bottom=t.y.substring(1):e.top=t.y),e}if("relative"===e&&t.element){const e=t.element.getBoundingClientRect(),n=t=>{if(!t)return 0;const e=parseFloat(t);return t.includes("em")?16*e:e},o=n(t.x||"0"),s=n(t.y||"0");return{left:`${e.left+o}px`,top:`${e.top+s}px`}}if("anchored"===e&&t.element){const e=t.element.getBoundingClientRect(),n=(t=>{const e=parseFloat(t);return t.includes("em")?16*e:e})(t.gap||"1em"),o={};switch(j(t.placement)){case"top":o.bottom=`${window.innerHeight-e.top+n}px`,o.left=`${e.left}px`;break;case"bottom":o.top=`${e.bottom+n}px`,o.left=`${e.left}px`;break;case"left":o.right=`${window.innerWidth-e.left+n}px`,o.top=`${e.top}px`;break;case"right":o.left=`${e.right+n}px`,o.top=`${e.top}px`}return o}}return{}}}let I=null;const B=()=>(I||(I=new O(undefined)),I);function R(t){return B().show(t)}Object.assign(R,{create:(t,e)=>{if("string"==typeof t){const n=t,o=new O({...e||{}});return R.custom||(R.custom={}),R.custom[n]=o,o}return new O({...t||{}})},custom:{},use:t=>R.custom&&R.custom[t]||null,Manager:O,show:t=>B().show(t),info:(t,e)=>B().info(t,e),success:(t,e)=>B().success(t,e),warning:(t,e)=>B().warning(t,e),danger:(t,e)=>B().danger(t,e),configure:t=>B().configure(t),setAriaLive:t=>B().setAriaLive(t),closeAll:t=>B().closeAll(t),getOpenToasts:()=>B().getOpenToasts()});const q=R,H=(t,e={})=>{if(!(t&&t instanceof HTMLFormElement))throw new TypeError("packFormToJSON expects an HTMLFormElement");const n=!0===e.numericKeysAlwaysArray,o=new FormData(t),s={},a=t=>t.reduce(((t,e)=>"key"===e.type?t?`${t}[${e.name}]`:e.name:"numeric"===e.type?`${t}[${e.index}]`:"array"===e.type?`${t}[]`:t),""),i=new Map,r=new Map,c=new Map,l=[],d=(t,e,n,o)=>{const s=i.get(t)??{isFinal:!1,isIntermediate:!1,hasArraySuffix:!1,key:o};i.has(t)||i.set(t,s),e?(s.isFinal=!0,s.key=o,n&&(s.hasArraySuffix=!0)):(s.isIntermediate=!0,s.key??=o)};for(const[t,e]of o.entries()){if(!t)continue;l.push({key:t,value:e});const n=Z(t);let o="";for(let e=0;e<n.length;e++){const s=n[e],a=e===n.length-1,i="array"===s.type;if("key"===s.type)o=o?`${o}[${s.name}]`:s.name;else if("numeric"===s.type){const t=o;let e=c.get(t);e||(e=new Set,c.set(t,e)),e.add(s.index),o=`${o}[${s.index}]`}else"array"===s.type&&(o=`${o}[]`);d(o,a,i&&a,t)}for(let t=0;t<n.length-1;t++){const e=n[t],o=n[t+1];if("key"===e.type){const t=e.name,n=r.get(t)??{hasNumeric:!1,hasString:!1};r.has(t)||r.set(t,n),o&&("numeric"===o.type?n.hasNumeric=!0:"key"!==o.type&&"array"!==o.type||(n.hasString=!0))}}}(()=>{const t=new Set,e=new Map;for(const[n,o]of i.entries())o.isFinal&&(t.add(n),e.set(n,o.key));for(const[n,o]of i.entries())if(o.isIntermediate)for(const s of t)if(n.startsWith(`${s}[`))throw new Error(`Path conflict: "${s}" is used as a final value (in field "${e.get(s)}"), but "${n}" tries to use it as an intermediate path (in field "${o.key}"). This creates incompatible data structures. You cannot use "${s}" as a primitive value and then access it as an object.`)})();const p=t=>{if(!t)return!1;const e=r.get(t);return e?.hasNumeric&&e?.hasString},u=t=>{const e=c.get(t);return!e||0===e.size||!!n||(t=>{if(0===t.length)return!1;const e=[...t].sort(((t,e)=>t-e));for(let t=0;t<e.length;t++)if(e[t]!==t)return!1;return!0})([...e])},f=t=>{const e={};for(let n=0;n<t.length;n++)e[n]=t[n];for(const[n,o]of Object.entries(t)){const t=Number.parseInt(n,10);(Number.isNaN(t)||n!==String(t))&&(e[n]=o)}return e},g=t=>{if(Array.isArray(t))return t;const e=[];if("object"==typeof t&&null!==t)for(const[n,o]of Object.entries(t)){const t=Number.parseInt(n,10);Number.isNaN(t)||(e[t]=o)}return e},h=(t,e,n,o=!1)=>{if(Array.isArray(t)){const o=f(t);return n&&null!==e&&(n[e]=o),o}if("object"!=typeof t||null===t){const t={};return n&&null!==e&&(n[e]=t),t}return t},m=(t,e,n)=>{if(!Array.isArray(t)){const o=g(t);return n&&null!==e&&(n[e]=o),o}return t},y=(t,e,n,o,s,a)=>{if("array"===e.type)t[e.name]??=[],Array.isArray(t[e.name])?t[e.name].push(n):t[e.name]=[t[e.name],n];else if("numeric"===e.type){const{index:s}=e;if(u(a)){for(t=m(t,o.key,o.container);t.length<=s;)t.push(void 0);t[s]=n}else(t=h(t,o.key,o.container,!0))[s]=n}else p(s)?(t=h(t,o.key,o.container,!0),Array.isArray(t[e.name])&&(t[e.name]=f(t[e.name])),void 0===t[e.name]||"object"==typeof t[e.name]&&null!==t[e.name]?void 0===t[e.name]?t[e.name]=n:Array.isArray(t[e.name])?t[e.name].push(n):t[e.name]=[t[e.name],n]:t[e.name]=n):void 0===t[e.name]?t[e.name]=n:Array.isArray(t[e.name])?t[e.name].push(n):t[e.name]=[t[e.name],n]},b=(t,e,n,o,s,i,r,c)=>{if("numeric"===e.type){const{index:n}=e,l=a(i.slice(0,r));if(u(l)&&!p(s)){for(t=m(t,o.key,o.container);t.length<=n;)t.push(void 0);if(t[n]??={},"object"!=typeof t[n]||null===t[n]){const e=i.slice(0,r+1),o=a(e);throw new Error(`Cannot access property on primitive value. Key "${c}" tries to access "${o}" but it is already a ${typeof t[n]} value: ${JSON.stringify(t[n])}. This should have been detected during conflict detection phase.`)}}else if(t=h(t,o.key,o.container,!0),t[n]??={},"object"!=typeof t[n]||null===t[n]){const e=i.slice(0,r+1),o=a(e);throw new Error(`Cannot access property on primitive value. Key "${c}" tries to access "${o}" but it is already a ${typeof t[n]} value: ${JSON.stringify(t[n])}. This should have been detected during conflict detection phase.`)}return t[n]}const l="numeric"===n?.type;if(p(s)){if(t=h(t,o.key,o.container,!0),t[e.name]??={},Array.isArray(t[e.name]))t[e.name]=f(t[e.name]);else if("object"!=typeof t[e.name]||null===t[e.name]){const n=i.slice(0,r+1),o=a(n);throw new Error(`Cannot access property on primitive value. Key "${c}" tries to access "${o}" but it is already a ${typeof t[e.name]} value: ${JSON.stringify(t[e.name])}. This should have been detected during conflict detection phase.`)}}else void 0===t[e.name]?t[e.name]=l?[]:{}:l&&!Array.isArray(t[e.name])?Object.keys(t[e.name]).some((t=>{const e=Number.parseInt(t,10);return Number.isNaN(e)||t!==String(e)}))||(t[e.name]=g(t[e.name])):l||U(t[e.name])||(Array.isArray(t[e.name])?t[e.name]=f(t[e.name]):t[e.name]={});if(void 0!==t[e.name]&&("object"!=typeof t[e.name]||null===t[e.name])){const n=i.slice(0,r+1),o=a(n);throw new Error(`Cannot access property on primitive value. Key "${c}" tries to access "${o}" but it is already a ${typeof t[e.name]} value: ${JSON.stringify(t[e.name])}. This should have been detected during conflict detection phase.`)}return t[e.name]};for(const{value:t,key:e}of l){if(!e)continue;const n=Z(e),o=[{container:s,key:null}];let i=s;const r="key"===n[0]?.type?n[0].name:"";for(let s=0;s<n.length;s++){const c=n[s],l=s===n.length-1,d=s+1<n.length?n[s+1]:null,p=o[o.length-1];if(l)y(i,c,t,p,r,a(n.slice(0,s)));else{const t=b(i,c,d,p,r,n,s,e);o.push({container:i,key:"numeric"===c.type?c.index:c.name}),i=t}}}return s},Z=t=>{const e=[];let n="",o=0;const s=t.length;for(;o<s;){const a=t[o];if("["===a){n&&(e.push({name:n,type:"key"}),n=""),o++;let a="";for(;o<s&&"]"!==t[o];)a+=t[o],o++;if(""===a){const t=e[e.length-1];t?t.type="array":e.push({name:"",type:"array"})}else{const t=Number.parseInt(a,10);Number.isNaN(t)||a!==String(t)?e.push({name:a,type:"key"}):e.push({name:String(t),type:"numeric",index:t})}o++}else n+=a,o++}return n&&e.push({name:n,type:"key"}),e},U=t=>"object"==typeof t&&null!==t&&!Array.isArray(t),Y={packFormToJSON:H},W=function(n,o=document){let s;if("string"==typeof o)o=document.querySelector(o);else if(W.isAPXObject(o))o=o.first();else if(!(o instanceof HTMLElement||o instanceof Document))throw new Error("Invalid context for APX");if("string"==typeof n&&n.startsWith("//")){s=document.evaluate(n,o,null,XPathResult.ANY_TYPE,null);let t=[],e=s.iterateNext();for(;e;)t.push(e),e=s.iterateNext();s=t}else if("string"==typeof n)s=o.querySelectorAll(n);else if(n instanceof HTMLElement)s=o.contains(n)?[n]:[];else if(n instanceof NodeList||n instanceof HTMLCollection)s=Array.from(n).filter((t=>o.contains(t)));else if(Array.isArray(n)&&n.every((t=>t instanceof HTMLElement)))s=n.filter((t=>o.contains(t)));else if("undefined"!=typeof jQuery&&n instanceof jQuery)s=Array.from(n.get()).filter((t=>o.contains(t)));else{if("function"!=typeof n)throw new Error("Invalid input type for APX");s=W(n(),o)}var i={elements:s,_isAPXObject:!0};return i.length=s.length,i.each=function(t){return this.elements instanceof Array&&this.elements.forEach(t),this.elements instanceof NodeList&&Array.from(this.elements).forEach(t),this},i.get=function(t){return this.elements[t]},i.all=function(){return this.elements instanceof Array?this.elements:this.elements instanceof NodeList?Array.from(this.elements):this},i.first=function(){return this.get(0)},function(n){let o=n.elements;n.listen=function(n,s,i){let r,c={};"string"==typeof s?(r=s,c=i||{}):c=s||{};const l=function(){const e=Math.random().toString(36).substr(2,9),n=`${Date.now()}_${e}_${t}`;return t=(t+1)%1e3,n}(),d=c.timeout||0;return Array.isArray(n)||(n=[n]),n.forEach((t=>{o.forEach((e=>{e.addEventListener(t,(t=>{a(t,l,d,r,e)}))}))})),{do:function(t){return e[l]||(e[l]=[]),e[l].push(t),this}}},n.trigger=function(t){let o;if("string"==typeof t)o=t,t=new Event(t,{bubbles:!0,cancelable:!0});else{if(!(t instanceof Event))return void console.error("Invalid event type provided to apx.trigger. It must be either a string or Event object.");o=t.type}n.elements.forEach((e=>{e.dispatchEvent(t)})),Object.keys(e).forEach((n=>{const s=e[n];if(s&&s.eventType===o){const{selector:e}=s;e&&!t.target.matches(e)||a(t,n,0,e,t.target)}}))}}(i),x(i),function(t){t.pack=function(t){const e=this.first();if(!e)throw new Error("No element found");if("FORM"!==e.tagName)throw new Error("Element is not a form");return H(e,t)}}(i),i};W.loadCss=function(t){return fetch(t).then((t=>t.text())).then((t=>{const e=document.createElement("style");e.type="text/css",e.textContent=t,document.head.appendChild(e)})).catch((t=>{console.error("Failed to load CSS:",t)}))},W.dialog=t=>{const{title:e,content:n,contentURI:o,buttons:s,size:a,showLoadingIndicator:i,contentMethod:r,contentData:c,contentHeaders:l}={title:"",content:"",contentURI:"",buttons:[],size:"medium",showLoadingIndicator:!1,contentMethod:"GET",contentData:null,contentHeaders:void 0,...t},d=document.createElement("div");d.innerHTML='<div class="APX-dialog"> <div class="APX-dialog-content"> <span class="APX-close-dialog">×</span> <h2 class="APX-dialog-title"></h2> <div class="APX-dialog-dynamic-content"></div> <div class="APX-dialog-button-container"></div> </div> </div>'.trim();const p=d.firstChild,u={},f={};["opening","opened","closing","closed","contentLoading","contentLoaded"].forEach((t=>{f[t]=new Promise((e=>{u[t]=e}))}));const g=t=>{u[t]?u[t]():console.warn(`No resolver found for lifecycle event: ${t}`)},h={element:p,buttons:{},isClosed:!1,lifecycle:f,disableButton:t=>{const e=p.querySelector(`.APX-dialog-button[data-key="${t}"]`);e&&(e.disabled=!0,e.classList.add("APX-dialog-button-disabled"))},enableButton:t=>{const e=p.querySelector(`.APX-dialog-button[data-key="${t}"]`);e&&(e.disabled=!1,e.classList.remove("APX-dialog-button-disabled"))},open:async()=>{try{g("opening"),await h.lifecycle.opening,i&&o?(document.body.appendChild(p),p.style.display="flex",p.querySelector(".APX-dialog-dynamic-content").innerHTML='<div class="APX-dialog-loading-indicator"></div>',await y()):(await y(),document.body.appendChild(p),p.style.display="flex"),g("opened"),await h.lifecycle.opened}catch(t){console.error("Error opening dialog:",t)}return h},close:async()=>{try{g("closing"),await h.lifecycle.closing,m(),g("closed"),await h.lifecycle.closed}catch(t){console.error("Error during dialog closing:",t)}return h}},m=()=>{h.isClosed||(h.isClosed=!0,p.style.display="none",document.body.contains(p)&&document.body.removeChild(p))},y=async()=>{const t=document.body.style.cursor;document.body.style.cursor="wait";const e=p.querySelector(".APX-dialog-dynamic-content");try{g("contentLoading"),await h.lifecycle.contentLoading;const t=o?await b(o):n;e.innerHTML=t,g("contentLoaded"),await h.lifecycle.contentLoaded}catch(t){console.error("Error loading content:",t)}finally{document.body.style.cursor=t}},b=async t=>{const e=(r||"GET").toUpperCase(),n={...l||{}},o=Object.keys(n).some((t=>"content-type"===t.toLowerCase())),s={method:e};if("POST"===e){let t;const e="undefined"!=typeof FormData&&c instanceof FormData,a="undefined"!=typeof URLSearchParams&&c instanceof URLSearchParams,i="undefined"!=typeof Blob&&c instanceof Blob,r="string"==typeof c,l=c&&"object"==typeof c&&!e&&!a&&!i;e?t=c:a?(t=c,o||(n["Content-Type"]="application/x-www-form-urlencoded;charset=UTF-8")):l?(t=JSON.stringify(c),o||(n["Content-Type"]="application/json")):(r||i||null!=c)&&(t=c),void 0!==t&&(s.body=t)}Object.keys(n).length>0&&(s.headers=n);const a=await fetch(t,s);if(!a.ok)throw new Error(`Failed to fetch content: ${a.statusText}`);return a.text()};return(()=>{const t=p.querySelector(".APX-dialog-content");if("auto"===a)return;const e={small:{width:"300px",height:"200px"},medium:{width:"500px",height:"400px"},large:{width:"800px",height:"600px"}}[a]||"object"==typeof a&&a;e&&(t.style.minWidth=e.width||"500px",t.style.minHeight=e.height||"400px")})(),(()=>{const t=p.querySelector(".APX-dialog-button-container");s.forEach((({key:e,label:n,order:o=0,align:s="flex-end",closeOnClick:a=!0})=>{const i=document.createElement("button");i.classList.add("APX-dialog-button"),i.textContent=n,i.style.order=o,i.setAttribute("data-key",e);const r={disable:()=>{i.disabled=!0,i.classList.add("APX-dialog-button-disabled")},enable:()=>{i.disabled=!1,i.classList.remove("APX-dialog-button-disabled")},key:e,element:i};if(a){let t=!1;const n=new Promise((e=>{i.onclick=()=>{t||i.disabled||(t=!0,e({dialog:h,button:r}),h.close())}}));h.buttons[e]=n}else{let t=[];const n={then:e=>("function"==typeof e&&t.push(e),n)};i.onclick=()=>{i.disabled||t.forEach((t=>t({dialog:h,button:r})))},h.buttons[e]=n}t.appendChild(i),t.style.justifyContent=s}))})(),p.querySelector(".APX-dialog-title").textContent=e,p.querySelector(".APX-close-dialog").onclick=h.close,h},W.toast=q,W.tools=Y,W.isAPXObject=function(t){return t&&!0===t._isAPXObject},W.is_numeric=t=>!isNaN(t-parseFloat(t));const J=W})();var s=o.Z;export{s as default};
|
package/dist/APX.standalone.js
CHANGED
|
@@ -3056,12 +3056,14 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
3056
3056
|
/* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__(apx) {
|
|
3057
3057
|
/**
|
|
3058
3058
|
* Convertit le premier formulaire sélectionné en objet JSON
|
|
3059
|
+
* @param {Object} [options] - Options passées à packFormToJSON (ex. { numericKeysAlwaysArray: true })
|
|
3059
3060
|
* @returns {Object} L'objet JSON résultant
|
|
3060
3061
|
* @throws {Error} Si aucun formulaire n'est trouvé ou si le premier élément n'est pas un formulaire
|
|
3061
3062
|
* @example
|
|
3062
3063
|
* const data = APX('form.myformclass').pack();
|
|
3064
|
+
* const dataLegacy = APX('form').pack({ numericKeysAlwaysArray: true });
|
|
3063
3065
|
*/
|
|
3064
|
-
apx.pack = function () {
|
|
3066
|
+
apx.pack = function (options) {
|
|
3065
3067
|
var firstElement = this.first();
|
|
3066
3068
|
if (!firstElement) {
|
|
3067
3069
|
throw new Error('No element found');
|
|
@@ -3069,7 +3071,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
3069
3071
|
if (firstElement.tagName !== 'FORM') {
|
|
3070
3072
|
throw new Error('Element is not a form');
|
|
3071
3073
|
}
|
|
3072
|
-
return (0,_packToJson_mjs__WEBPACK_IMPORTED_MODULE_0__.packFormToJSON)(firstElement);
|
|
3074
|
+
return (0,_packToJson_mjs__WEBPACK_IMPORTED_MODULE_0__.packFormToJSON)(firstElement, options);
|
|
3073
3075
|
};
|
|
3074
3076
|
return apx;
|
|
3075
3077
|
}
|
|
@@ -3088,6 +3090,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
3088
3090
|
/* harmony export */ packFormToJSON: () => (/* binding */ packFormToJSON)
|
|
3089
3091
|
/* harmony export */ });
|
|
3090
3092
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
3093
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
3094
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3095
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
3096
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
3091
3097
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
3092
3098
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3093
3099
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
@@ -3098,14 +3104,18 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
3098
3104
|
/**
|
|
3099
3105
|
* Convertit un formulaire HTML en objet JSON
|
|
3100
3106
|
* @param {HTMLFormElement} form - Le formulaire à convertir
|
|
3107
|
+
* @param {Object} [options] - Options de conversion
|
|
3108
|
+
* @param {boolean} [options.numericKeysAlwaysArray=false] - Si true, toute clé numérique est traitée comme index de tableau (comportement d'avant 2.6.2). Sinon, heuristique : tableau seulement si indices denses 0,1,2,…,n.
|
|
3101
3109
|
* @returns {Object} L'objet JSON résultant
|
|
3102
3110
|
* @throws {TypeError} Si form n'est pas un HTMLFormElement
|
|
3103
3111
|
*/
|
|
3104
3112
|
var packFormToJSON = function packFormToJSON(form) {
|
|
3113
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
3105
3114
|
// Validation de l'entrée
|
|
3106
3115
|
if (!form || !(form instanceof HTMLFormElement)) {
|
|
3107
3116
|
throw new TypeError('packFormToJSON expects an HTMLFormElement');
|
|
3108
3117
|
}
|
|
3118
|
+
var numericKeysAlwaysArray = options.numericKeysAlwaysArray === true;
|
|
3109
3119
|
var formData = new FormData(form);
|
|
3110
3120
|
var jsonData = {};
|
|
3111
3121
|
|
|
@@ -3144,6 +3154,7 @@ var packFormToJSON = function packFormToJSON(form) {
|
|
|
3144
3154
|
|
|
3145
3155
|
var pathUsage = new Map(); // Map<pathString, PathUsage>
|
|
3146
3156
|
var keyAnalysis = new Map(); // Map<basePath, {hasNumeric: boolean, hasString: boolean}>
|
|
3157
|
+
var numericIndicesByPath = new Map(); // Map<pathString, Set<number>> — indices under each parent path
|
|
3147
3158
|
var allEntries = [];
|
|
3148
3159
|
|
|
3149
3160
|
/**
|
|
@@ -3203,6 +3214,13 @@ var packFormToJSON = function packFormToJSON(form) {
|
|
|
3203
3214
|
if (_part.type === 'key') {
|
|
3204
3215
|
currentPath = currentPath ? "".concat(currentPath, "[").concat(_part.name, "]") : _part.name;
|
|
3205
3216
|
} else if (_part.type === 'numeric') {
|
|
3217
|
+
var _parentPath = currentPath;
|
|
3218
|
+
var set = numericIndicesByPath.get(_parentPath);
|
|
3219
|
+
if (!set) {
|
|
3220
|
+
set = new Set();
|
|
3221
|
+
numericIndicesByPath.set(_parentPath, set);
|
|
3222
|
+
}
|
|
3223
|
+
set.add(_part.index);
|
|
3206
3224
|
currentPath = "".concat(currentPath, "[").concat(_part.index, "]");
|
|
3207
3225
|
} else if (_part.type === 'array') {
|
|
3208
3226
|
currentPath = "".concat(currentPath, "[]");
|
|
@@ -3326,6 +3344,36 @@ var packFormToJSON = function packFormToJSON(form) {
|
|
|
3326
3344
|
return (analysis === null || analysis === void 0 ? void 0 : analysis.hasNumeric) && (analysis === null || analysis === void 0 ? void 0 : analysis.hasString);
|
|
3327
3345
|
};
|
|
3328
3346
|
|
|
3347
|
+
/**
|
|
3348
|
+
* True if indices are exactly 0, 1, 2, ..., n (dense, sequential from 0).
|
|
3349
|
+
* @param {number[]} indices - Sorted array of indices
|
|
3350
|
+
* @returns {boolean}
|
|
3351
|
+
*/
|
|
3352
|
+
var isDenseSequential = function isDenseSequential(indices) {
|
|
3353
|
+
if (indices.length === 0) return false;
|
|
3354
|
+
var sorted = _toConsumableArray(indices).sort(function (a, b) {
|
|
3355
|
+
return a - b;
|
|
3356
|
+
});
|
|
3357
|
+
for (var j = 0; j < sorted.length; j++) {
|
|
3358
|
+
if (sorted[j] !== j) return false;
|
|
3359
|
+
}
|
|
3360
|
+
return true;
|
|
3361
|
+
};
|
|
3362
|
+
|
|
3363
|
+
/**
|
|
3364
|
+
* True if numeric keys under this path should be treated as array indices.
|
|
3365
|
+
* With numericKeysAlwaysArray: always true when path has numeric children.
|
|
3366
|
+
* Otherwise: true only when indices are dense 0..n.
|
|
3367
|
+
* @param {string} parentPath - Path to the container that has numeric children
|
|
3368
|
+
* @returns {boolean}
|
|
3369
|
+
*/
|
|
3370
|
+
var useArrayForNumericPath = function useArrayForNumericPath(parentPath) {
|
|
3371
|
+
var set = numericIndicesByPath.get(parentPath);
|
|
3372
|
+
if (!set || set.size === 0) return true;
|
|
3373
|
+
if (numericKeysAlwaysArray) return true;
|
|
3374
|
+
return isDenseSequential(_toConsumableArray(set));
|
|
3375
|
+
};
|
|
3376
|
+
|
|
3329
3377
|
/**
|
|
3330
3378
|
* Convertit un tableau en objet en préservant les indices numériques comme propriétés
|
|
3331
3379
|
* @param {Array} arr - Le tableau à convertir
|
|
@@ -3428,8 +3476,9 @@ var packFormToJSON = function packFormToJSON(form) {
|
|
|
3428
3476
|
* @param {*} value - La valeur à assigner
|
|
3429
3477
|
* @param {Object} parent - Le conteneur parent
|
|
3430
3478
|
* @param {string} basePath - Le chemin de base pour la détection de conflit
|
|
3479
|
+
* @param {string} parentPath - Chemin du conteneur actuel (pour heuristique numeric)
|
|
3431
3480
|
*/
|
|
3432
|
-
var processFinalValue = function processFinalValue(container, part, value, parent, basePath) {
|
|
3481
|
+
var processFinalValue = function processFinalValue(container, part, value, parent, basePath, parentPath) {
|
|
3433
3482
|
if (part.type === 'array') {
|
|
3434
3483
|
var _container, _part$name, _container$_part$name;
|
|
3435
3484
|
// Tableau explicite avec []
|
|
@@ -3440,13 +3489,18 @@ var packFormToJSON = function packFormToJSON(form) {
|
|
|
3440
3489
|
container[part.name] = [container[part.name], value];
|
|
3441
3490
|
}
|
|
3442
3491
|
} else if (part.type === 'numeric') {
|
|
3443
|
-
// Indice numérique final
|
|
3444
3492
|
var index = part.index;
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
container.
|
|
3493
|
+
var useArray = useArrayForNumericPath(parentPath);
|
|
3494
|
+
if (useArray) {
|
|
3495
|
+
container = ensureArray(container, parent.key, parent.container);
|
|
3496
|
+
while (container.length <= index) {
|
|
3497
|
+
container.push(undefined);
|
|
3498
|
+
}
|
|
3499
|
+
container[index] = value;
|
|
3500
|
+
} else {
|
|
3501
|
+
container = ensureObject(container, parent.key, parent.container, true);
|
|
3502
|
+
container[index] = value;
|
|
3448
3503
|
}
|
|
3449
|
-
container[index] = value;
|
|
3450
3504
|
} else {
|
|
3451
3505
|
// Clé simple finale
|
|
3452
3506
|
var conflict = hasConflict(basePath);
|
|
@@ -3490,30 +3544,26 @@ var packFormToJSON = function packFormToJSON(form) {
|
|
|
3490
3544
|
*/
|
|
3491
3545
|
var processIntermediatePart = function processIntermediatePart(container, part, nextPart, parent, basePath, parts, i, key) {
|
|
3492
3546
|
if (part.type === 'numeric') {
|
|
3493
|
-
// Indice numérique : le container doit être un tableau ou un objet (selon conflit)
|
|
3494
3547
|
var index = part.index;
|
|
3495
|
-
var
|
|
3496
|
-
|
|
3548
|
+
var parentPath = buildPathString(parts.slice(0, i));
|
|
3549
|
+
var useArray = useArrayForNumericPath(parentPath) && !hasConflict(basePath);
|
|
3550
|
+
if (!useArray) {
|
|
3497
3551
|
var _container2, _container2$index;
|
|
3498
|
-
// Conflit : utiliser un objet (les indices seront des propriétés)
|
|
3499
3552
|
container = ensureObject(container, parent.key, parent.container, true);
|
|
3500
3553
|
(_container2$index = (_container2 = container)[index]) !== null && _container2$index !== void 0 ? _container2$index : _container2[index] = {};
|
|
3501
3554
|
if (_typeof(container[index]) !== 'object' || container[index] === null) {
|
|
3502
|
-
// Cette erreur ne devrait jamais se produire si la détection fonctionne correctement
|
|
3503
3555
|
var pathParts = parts.slice(0, i + 1);
|
|
3504
3556
|
var currentPath = buildPathString(pathParts);
|
|
3505
3557
|
throw new Error("Cannot access property on primitive value. " + "Key \"".concat(key, "\" tries to access \"").concat(currentPath, "\" but it is already a ").concat(_typeof(container[index]), " value: ").concat(JSON.stringify(container[index]), ". ") + "This should have been detected during conflict detection phase.");
|
|
3506
3558
|
}
|
|
3507
3559
|
} else {
|
|
3508
3560
|
var _container3, _container3$index;
|
|
3509
|
-
// Pas de conflit : utiliser un tableau
|
|
3510
3561
|
container = ensureArray(container, parent.key, parent.container);
|
|
3511
3562
|
while (container.length <= index) {
|
|
3512
3563
|
container.push(undefined);
|
|
3513
3564
|
}
|
|
3514
3565
|
(_container3$index = (_container3 = container)[index]) !== null && _container3$index !== void 0 ? _container3$index : _container3[index] = {};
|
|
3515
3566
|
if (_typeof(container[index]) !== 'object' || container[index] === null) {
|
|
3516
|
-
// Cette erreur ne devrait jamais se produire si la détection fonctionne correctement
|
|
3517
3567
|
var _pathParts = parts.slice(0, i + 1);
|
|
3518
3568
|
var _currentPath = buildPathString(_pathParts);
|
|
3519
3569
|
throw new Error("Cannot access property on primitive value. " + "Key \"".concat(key, "\" tries to access \"").concat(_currentPath, "\" but it is already a ").concat(_typeof(container[index]), " value: ").concat(JSON.stringify(container[index]), ". ") + "This should have been detected during conflict detection phase.");
|
|
@@ -3589,8 +3639,8 @@ var packFormToJSON = function packFormToJSON(form) {
|
|
|
3589
3639
|
var nextPart = i + 1 < parts.length ? parts[i + 1] : null;
|
|
3590
3640
|
var parent = path[path.length - 1];
|
|
3591
3641
|
if (isLast) {
|
|
3592
|
-
|
|
3593
|
-
processFinalValue(container, part, value, parent, basePath);
|
|
3642
|
+
var parentPath = buildPathString(parts.slice(0, i));
|
|
3643
|
+
processFinalValue(container, part, value, parent, basePath, parentPath);
|
|
3594
3644
|
} else {
|
|
3595
3645
|
// Partie intermédiaire : créer la structure
|
|
3596
3646
|
var newContainer = processIntermediatePart(container, part, nextPart, parent, basePath, parts, i, key);
|