@supersoniks/concorde 4.4.0 → 4.4.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.
@@ -1,4 +1,4 @@
1
- var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),l=(e=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof require<`u`?require:e)[t]}):e)(function(e){if(typeof require<`u`)return require.apply(this,arguments);throw Error('Calling `require` for "'+e+"\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.")});(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u=class e{static getLanguage(){let e=document.documentElement.lang;return localStorage.getItem(`SonicSelectedLanguage`)||e}static getCookies(){return document.cookie.split(`;`).reduce((e,t)=>{let n=t.indexOf(`=`);return e[t.substring(0,n).trim()]=t.substring(n+1),e},{})}static everyAncestors(e,t){for(;e;){if(!t(e))return;e=e.parentNode||e.host}}static getScrollableAncestor(e){for(;e;){let t=e;if(t.nodeType===1){let n=window.getComputedStyle(t);if(n?.overflowY===`auto`||n?.overflowY===`scroll`||n?.overflowY===`hidden`||n?.overflowX===`auto`||n?.overflowX===`scroll`||n?.overflowX===`hidden`)return e}e=e.parentNode||e.host}return null}static getAncestorAttributeValue(e,t){if(!e)return null;for(;!(`hasAttribute`in e&&e.hasAttribute(t))&&(e.parentNode||e.host);)e=e.parentNode||e.host;return`hasAttribute`in e?e.getAttribute(t):null}static getApiConfiguration(t){let n=e.getAncestorAttributeValue(t,`token`),r=e.getAncestorAttributeValue(t,`addHTTPResponse`)!=null,i=e.getAncestorAttributeValue(t,`serviceURL`),a=null,o=null,s=e.getAncestorAttributeValue(t,`tokenProvider`),c=e.getAncestorAttributeValue(t,`eventsApiToken`);n||(a=e.getAncestorAttributeValue(t,`userName`),o=e.getAncestorAttributeValue(t,`password`));let l=e.getAncestorAttributeValue(t,`credentials`)||void 0,u=t.getAttribute(`cache`),d=t.hasAttribute(`blockUntilDone`),f=t.hasAttribute(`keepAlive`);return{serviceURL:i,token:n,userName:a,password:o,authToken:c,tokenProvider:s,addHTTPResponse:r,credentials:l,cache:u,blockUntilDone:d,keepAlive:f}}static getClosestElement(e,t){for(;!(e.nodeName&&e.nodeName.toLowerCase()===t)&&(e.parentNode||e.host);)e=e.parentNode||e.host;return e.nodeName?e:null}static getClosestForm(t){return e.getClosestElement(t,`form`)}static getAncestorsByTagNames(e,t){let n=new Set(t.map(e=>e.toLowerCase())),r=[],i=e.parentNode||e.host;for(;i;)i instanceof Element&&n.has(i.tagName.toLowerCase())&&r.push(i),i=i.parentNode||i.host;return r}static getAncestorsBySelectors(e,t){let n=[],r=e.parentNode||e.host;for(;r;){if(r instanceof Element)for(let e of t)try{if(r.matches(e)){n.push(r);break}}catch{}r=r.parentNode||r.host}return n}static async loadJS(e){return new Promise(async t=>{let n=document.createElement(`script`);n.src=e,n.onload=()=>t(!0),n.onerror=()=>t(!0),document.head.appendChild(n)})}static async loadCSS(e){return new Promise(async t=>{let n=document.createElement(`link`);n.type=`text/css`,n.rel=`stylesheet`,n.href=e,n.onload=()=>t(!0),n.onerror=()=>t(!0),document.head.appendChild(n)})}},d=e=>{let t=document.documentElement;new MutationObserver(t=>{for(let n of t)n.type===`attributes`&&n.attributeName===`lang`&&e()}).observe(t,{attributes:!0,attributeFilter:[`lang`]})},f=class{static ucFirst(e){return typeof e==`string`?e.charAt(0).toUpperCase()+e.substring(1):e}static minutesDuration(e,t=``,n=`long`){t||=u.getLanguage();let r=(e,t)=>[Math.floor(e/t),e%t];function i(e,t,n){return new Intl.NumberFormat(e,{style:`unit`,unit:t,unitDisplay:n}).format}let[a,o]=r(e,60),s=[];return a&&s.push(i(t,`hour`,n)(a)),o&&s.push(i(t,`minute`,n)(o)),new Intl.ListFormat(t,{style:`long`,type:`conjunction`}).format(s)}static js(e){try{return Function(`return `+e)()}catch{return``}}},p=class e{static shallowEqual(e,t,n=!0){let r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length&&n)return!1;for(let i of r){let r=e[i],a=t[i];if(n?r!==a:r!=a)return!1}return!0}static deepEqual(t,n,r=!0){let i=Object.keys(t),a=Object.keys(n);if(i.length!==a.length&&r)return!1;for(let a of i){let i=t[a],o=n[a],s=e.isObject(i)&&e.isObject(o),c=r?i!==o:i!=o;if(s&&!e.deepEqual(i,o)||!s&&c)return!1}return!0}static isObject(e){return typeof e==`object`&&!!e}static isUndefindOrNull(e){return e==null}static isEmpty(t){return e.isUndefindOrNull(t)?!0:Object.keys(t).length===0}static traverse(t,n,r=!1){for(let i of n){let n=t[i];if(n===void 0)return;t=r&&e.isObject(n)?Object.assign(Array.isArray(n)?[]:{},t,n):t[i]}return t}static traverseDotNotation(t,n,r=!1){return e.traverse(t,n.split(`.`),r)}static getURLSearchArray(t,n=``){let r=[];for(let i in t){let a=t[i];n&&(i=n+`[`+i+`]`),e.isObject(a)?r=[...r,...this.getURLSearchArray(a,i)]:r.push(`${i}=${a}`)}return r}static getURLSearchString(t){return e.getURLSearchArray(t,``).join(`&`)}},m=p.traverseDotNotation,h=class{static async queueTaskPromise(){return new Promise(e=>{window.queueMicrotask(()=>e(null))})}static async delayPromise(e){return new Promise(t=>{setTimeout(t,e)})}},g=`sonic`;typeof __SONIC_PREFIX__<`u`&&(g=__SONIC_PREFIX__);var ee=g.replace(/-([a-z])/g,e=>e[1].toUpperCase()),_=ee.charAt(0).toUpperCase()+ee.slice(1);function te(e){return Object.prototype.hasOwnProperty.call(e,`__value`)}function ne(e){return typeof e==`object`&&!!e}var v=`sonic`;typeof __SONIC_PREFIX__>`u`&&(v=`sonic`);var y=v==`sonic`?`publisher-proxies-data`:v+`-publisher-proxies-data`,b=class e{static{this.instances=new Map}static{this.instancesCounter=0}constructor(e,t,n){for(this._proxies_=new Map,this._is_savable_=!1,this._expiration_delay_=1e3*60*60*12,this._invalidate_on_page_show_=!1,this._invalidateListeners_=new Set,this._formInvalidateListeners_=new Set,this._assignListeners_=new Set,this._mutationListeners_=new Set,this._fillListeners_=new Set,this._templateFillListeners_=new Set,this._lockInternalMutationPublishing_=!1,this._instanceCounter_=0,this._assignmentId_=0,this._value_=e,this.parent=t||null,this._parentKey_=n,this.root=this,this._instanceCounter_=0;this.root.parent;)this.root=this.root.parent}delete(){for(let e in this._proxies_.keys())e!=`_parent_`&&this._proxies_.get(e)?.delete();this._invalidateListeners_.clear(),this._formInvalidateListeners_.clear(),this._assignListeners_.clear(),this._mutationListeners_.clear(),this._fillListeners_.clear(),this._templateFillListeners_.clear(),this._proxies_.clear(),e.instances.delete(this._instanceCounter_)}hasListener(){return this._templateFillListeners_.size>0||this._assignListeners_.size>0||this._invalidateListeners_.size>0||this._formInvalidateListeners_.size>0||this._mutationListeners_.size>0||this._fillListeners_.size>0}_publishInternalMutation_(e=!1){if(this._mutationListeners_.forEach(e=>e()),this._is_savable_&&!x.changed){x.changed=!0,x.saveId++;let e=x.saveId;setTimeout(()=>x.getInstance().saveToLocalStorage(e),1e3)}e||this.parent&&this.parent._publishInternalMutation_()}async _publishAssignement_(e=!1){if(this._assignmentId_++,this._assignmentId_!==this._assignmentId_)return;let t=this.get();this._assignListeners_.forEach(e=>{e(t)}),this._publishInternalMutation_(e)}_publishInvalidation_(){this._invalidateListeners_.forEach(e=>e())}_publishFormInvalidation_(){this._formInvalidateListeners_.forEach(e=>e())}_publishDynamicFilling_(e,t){this._fillListeners_.forEach(n=>{n[e]!==t&&(n[e]=t)}),this._publishTemplateFilling_(e,t)}_publishTemplateFilling_(e,t){this._templateFillListeners_.forEach(n=>{let r=Object.getOwnPropertyDescriptor(n,e);r&&!r.set&&!r.writable||(n.propertyMap&&n.propertyMap[e]&&(e=n.propertyMap[e]),n[e]!==void 0&&n[e]!==t&&(n[e]=t))})}onAssign(e,t=!0){typeof e==`function`&&(this._assignListeners_.has(e)||(this._assignListeners_.add(e),t&&e(this.get())))}offAssign(e){this._assignListeners_.delete(e)}onInvalidate(e){typeof e==`function`&&this._invalidateListeners_.add(e)}offInvalidate(e){typeof e==`function`&&this._invalidateListeners_.delete(e)}invalidate(){this._publishInvalidation_()}onFormInvalidate(e){typeof e==`function`&&this._formInvalidateListeners_.add(e)}offFormInvalidate(e){typeof e==`function`&&this._formInvalidateListeners_.delete(e)}invalidateForm(){this._publishFormInvalidation_()}onInternalMutation(e){typeof e==`function`&&(this._mutationListeners_.add(e),e())}offInternalMutation(e){typeof e==`function`&&this._mutationListeners_.delete(e)}startTemplateFilling(e){if(this._templateFillListeners_.add(e),typeof this._value_==`object`)for(let t in this._value_){let n=t,r=this._value_[t];e.propertyMap&&e.propertyMap[t]&&(n=e.propertyMap[t]),e[t]!==void 0&&e[t]!==r&&(e[n]=r)}}stopTemplateFilling(e){this._templateFillListeners_.delete(e)}startDynamicFilling(e){this._fillListeners_.add(e);for(let t in this._value_){let n=this._value_[t];e[t]!==n&&(e[t]=n)}}stopDynamicFilling(e){this._fillListeners_.delete(e)}set(e,t=!1){if(this._value_===e||ne(this._value_)&&ne(e)&&e&&te(this._value_)&&te(e)&&this._value_.__value===e.__value||!ne(e)&&e===this._value_.__value)return!0;this._value_=ne(e)?e:{__value:e},this._cachedGet_=void 0;let n=te(this._value_);if(this._parentKey_&&this.parent){let e=te(this._value_)?this._value_.__value:this._value_;if(this.parent?.get()==null&&this.parent?.get()==null)if(isNaN(Number(this._parentKey_)))this.parent.set({[this._parentKey_]:e});else{let t=[];t[Number(this._parentKey_)]=e,this.parent.set(t)}else this.parent._value_[this._parentKey_]=e}if(n)return this._proxies_.forEach((e,t)=>{t!=`_parent_`&&(e.set(null),this._publishDynamicFilling_(t,null))}),this._publishAssignement_(t),this.parent&&this._parentKey_&&this.parent._publishDynamicFilling_(this._parentKey_,this._value_.__value),!0;for(let e in this._value_)this._value_[e]===void 0&&delete this._value_[e];if(this._proxies_.forEach((e,t)=>{let n=this._value_[t];t!=`_parent_`&&n===void 0&&n!==null&&isNaN(Number(t))&&(e.set(null),this._publishDynamicFilling_(t,null))}),this._publishAssignement_(),this.parent&&this._parentKey_&&this.parent._publishDynamicFilling_(this._parentKey_,this._value_),ne(this._value_))for(let t in this._value_){let n=e[t],r=ne(n)?n:{__value:n};if(!this._proxies_.has(t)){this._publishDynamicFilling_(t,n);continue}this._proxies_.get(t)?.set(r,!0),this._publishDynamicFilling_(t,n)}return!0}get(){if(x.modifiedCollectore.length>0&&x.modifiedCollectore[0].add(this),this._cachedGet_!==void 0)return this._cachedGet_;if(Object.prototype.hasOwnProperty.call(this._value_,`__value`)){let e=this._value_.__value;return this._cachedGet_=e??null}return this._cachedGet_=this._value_==null?null:this._value_}get $tag(){return this._instanceCounter_||=(e.instancesCounter++,e.instancesCounter),e.instances.set(this._instanceCounter_,this),`<`+v+`-publisher-proxy publisher="`+this._instanceCounter_+`"></`+v+`-publisher-proxy>`}},x=class e{static{this.buildDate=`Fri Apr 24 2026 12:43:39 GMT+0200 (heure d’été d’Europe centrale)`}static{this.changed=!1}static{this.saving=!1}static{this.saveId=0}static{this.instance=null}static{this.instances=new Map}constructor(){if(this.enabledLocaStorageProxies=[],this.publishers=new Map,this.localStorageData={},this.isLocalStrorageReady=null,this.initialisedData=[],e.instance!=null)throw`Singleton / use getInstance`;e.instance=this,this.isLocalStrorageReady=this.cleanStorageData()}invalidateAll(){this.publishers.forEach(e=>{e._invalidate_on_page_show_&&e.invalidate()})}async cleanStorageData(){return new Promise(e=>{(async()=>{try{let t=localStorage.getItem(y),n=null;if(t&&(n=await this.decompress(t,`gzip`)),n)try{this.localStorageData=JSON.parse(n)}catch{this.localStorageData={}}else t=await this.compress(`{}`,`gzip`),localStorage.setItem(y,t),this.localStorageData={};for(let e in this.localStorageData){let t=this.localStorageData[e],n=new Date().getTime()-(t.expirationDelayMs||432e5);t.lastModifiationMS<n&&delete this.localStorageData[e]}e(!0)}catch{window.requestAnimationFrame(()=>{e(!1)}),console.warn(`no publisher cache in this browser`)}})()})}static getInstance(t){return t?e.instances.get(t)||(console.warn(`No PublisherManager instance registered with id:`,t,`creating new one`),new e):e.instance==null?new e:e.instance}static registerInstance(t,n){e.instances.has(t)&&console.warn(`PublisherManager instance already registered with id: `,t),e.instances.set(t,n)}static get(t,n){return e.getInstance().get(t,n)}static{this.modifiedCollectore=[]}static collectModifiedPublisher(){e.modifiedCollectore.unshift(new Set)}static getModifiedPublishers(){return e.modifiedCollectore.shift()}static delete(t){return t?e.getInstance().delete(t):!1}async setLocalData(e,t){await this.isLocalStrorageReady,e.set(this.localStorageData[t+`¤lang_`+u.getLanguage()]?.data||e.get())}get(e,t){let n=t?.localStorageMode===`enabled`,r=t?.invalidateOnPageShow===!0;if(!this.publishers.has(e)){let t=re({});this.set(e,t)}let i=this.publishers.get(e);return n&&this.initialisedData.indexOf(e)===-1&&(t?.expirationDelayMs&&(i._expiration_delay_=t.expirationDelayMs),i._is_savable_=!0,this.initialisedData.push(e),this.setLocalData(i,e)),r&&(i._invalidate_on_page_show_=r),this.publishers.get(e)}set(e,t){this.publishers.set(e,t)}delete(e){return this.publishers.has(e)?(this.publishers.delete(e),!0):!1}async saveToLocalStorage(t=0){if(!(t!==e.saveId&&t%10!=0))try{if(!e.changed||e.saving)return;e.saving=!0,e.changed=!1;let t=Array.from(this.publishers.keys()),n=!1;for(let e of t){let t=this.publishers.get(e);if(!t?._is_savable_)continue;let r=t?.get();r&&(this.localStorageData[e+`¤lang_`+u.getLanguage()]={lastModifiationMS:new Date().getTime(),expirationDelayMs:t._expiration_delay_,data:r},n=!0)}if(n){let e=await this.compress(JSON.stringify(this.localStorageData),`gzip`);localStorage.setItem(y,e)}if(e.saving=!1,e.changed){e.saveId++;let t=e.saveId;setTimeout(()=>this.saveToLocalStorage(t),1e3)}}catch{e.saving=!1}}async compress(e,t){let n=new TextEncoder().encode(e),r=new window.CompressionStream(t),i=r.writable.getWriter();i.write(n),i.close();let a=await new Response(r.readable).arrayBuffer(),o=new Uint8Array(a),s=``;for(let e=0;e<o.length;e++)s+=String.fromCharCode(o[e]);return btoa(s)}async decompress(e,t){let n=atob(e),r=Uint8Array.from(n,e=>e.charCodeAt(0)).buffer,i=new window.DecompressionStream(t),a=i.writable.getWriter();a.write(r),a.close();let o=await new Response(i.readable).arrayBuffer();return new TextDecoder().decode(o)}};if(typeof window<`u`){let e=window;e[_+`PublisherManager`]=e[_+`PublisherManager`]||x}var S=new Set(`invalidate.onInvalidate.offInvalidate.invalidateForm.onFormInvalidate.offFormInvalidate.onAssign.offAssign.startDynamicFilling.stopDynamicFilling.startTemplateFilling.stopTemplateFilling.onInternalMutation.offInternalMutation.set.get.$tag._cachedGet_._templateFillListeners_._fillListeners_._assignListeners_._invalidateListeners_._formInvalidateListeners_._publishInternalMutation_.hasListener.delete._mutationListeners_._publishDynamicFilling_._publishInvalidation_._publishFormInvalidation_._publishTemplateFilling_._publishAssignement_._proxies_.parent._parentKey_._value_._is_savable_._expiration_delay_._lockInternalMutationPublishing_._instanceCounter_._assignmentId_._invalidate_on_page_show_`.split(`.`));function C(e,t){return{get:function(n,r){if(typeof r==`string`&&S.has(r))return e[r];if(r==Symbol.toPrimitive)return()=>t().get();if(!e._proxies_.has(r)){let n=e._value_[r],i=re(ne(n)?n:{__value:n},e,r);i._proxies_.set(`_parent_`,t()),e._proxies_.set(r,i)}return e._proxies_.get(r)},set:function(n,r,i){if(r==`_value_`)return e._value_=i,!0;if(r==`_cachedGet_`)return e._cachedGet_=i,!0;if(r==`_assignmentId_`)return e._assignmentId_=i,!0;if(r==`_is_savable_`)return e._is_savable_=i,!0;if(r==`_expiration_delay_`)return e._expiration_delay_=i,!0;if(r==`_invalidate_on_page_show_`)return e._invalidate_on_page_show_=i,!0;if(r==`_instanceCounter_`)return e._instanceCounter_=i,!0;if(!e._proxies_.has(r)){let n=re({},e,r);n._proxies_.set(`_parent_`,t()),e._proxies_.set(r,n)}return e._value_[r]!==i&&(e._value_[r]=i,e._publishDynamicFilling_(r,i),e._proxies_.get(r)?.set(ne(i)?i:{__value:i})),!0},deleteProperty:function(t,n){return e._publishDynamicFilling_(n,null),e._proxies_.get(n)?.set(null),delete e._value_[n]},has:function(t,n){return n in e._value_&&n!=`_lockInternalMutationPublishing_`},defineProperty:function(t,n,r){return r&&`value`in r&&(e._value_[n]=r.value),!0},getOwnPropertyDescriptor:function(e,t){return{enumerable:!0,configurable:!0}},ownKeys:function(t){return e._value_.__value?Object.keys(e._value_.__value):Object.keys(e._value_)}}}function re(e,t=null,n){let r=new b(e,t,n),i=null,a=C(r,()=>i);return i=new Proxy(r,a),i}var ie=class extends HTMLElement{constructor(){super(),this.publisherId=``,this.onAssign=e=>{this.innerHTML=e.toString()}}connectedCallback(){this.publisherId=this.getAttribute(`publisher`)||``,this.publisher=b.instances.get(parseInt(this.publisherId)),this.publisher?.onAssign(this.onAssign)}disconnectedCallback(){this.publisher?.offAssign(this.onAssign)}};try{customElements.define(v+`-publisher-proxy`,ie)}catch{}var w=e=>{if(typeof e==`function`){let t=e;return x.collectModifiedPublisher(),t(),x.getModifiedPublishers()}if(typeof e==`string`){let t=e.split(`.`),n=t.shift()||``,r=x.get(n);r=p.traverse(r,t);let i=new Set;return i.add(r),i}return new Set([e])},ae=e=>w(e).values().next().value?.get(),oe=e=>w(e).values().next().value,se=oe,ce=oe,le=(e,t)=>{w(e).values().next().value?.set(t)};window.addEventListener(`pageshow`,e=>{e.persisted&&x.getInstance().invalidateAll()});var ue=class e{static{this.observedElements=new Map}static{this.enabled=!0}static disable(){this.enabled&&(this.enabled=!1,Array.from(e.observedElements.keys()).forEach(t=>e.unObserve(t)))}static observe(t){if(!t||!e.enabled||e.observedElements.has(t))return;let n=new MutationObserver(e.onMutation),r={};r.childList=!0,r.subtree=!0,r.attributes=!0,r.attributeFilter=[`data-bind`],n.observe(t,r),t.querySelectorAll(`[data-bind]`).forEach(t=>e.addPublisherListeners(t)),e.observedElements.set(t,n)}static unObserve(t){if(!t)return;let n=this.observedElements.get(t);n&&(n.disconnect(),t.querySelectorAll(`[data-bind]`).forEach(t=>e.removePublisherListeners(t)))}static onAdded(t){t.hasAttribute&&t.hasAttribute(`data-bind`)&&e.addPublisherListeners(t),t.querySelectorAll?t.querySelectorAll(`[data-bind]`).forEach(t=>e.addPublisherListeners(t)):t.childNodes.forEach(t=>e.onAdded(t))}static onRemoved(t){t.hasAttribute&&t.hasAttribute(`data-bind`)&&e.removePublisherListeners(t),t.querySelectorAll?t.querySelectorAll(`[data-bind]`).forEach(t=>e.removePublisherListeners(t)):t.childNodes.forEach(t=>e.onRemoved(t))}static onMutation(t){for(let n of t)switch(n.type){case`attributes`:e.addPublisherListeners(n.target);break;case`childList`:n.addedNodes.forEach(t=>{e.onAdded(t)}),n.removedNodes.forEach(t=>{e.onRemoved(t)});break}}static{this.publisherListeners=new Map}static removePublisherListeners(t){let n=e.publisherListeners.get(t);n&&(e.publisherListeners.delete(t),n.forEach(e=>{e.publisher?.offAssign(e.onAssign)}))}static getVariablesDescriptor(e){let t=e.match(/(\$(?:\w+\\?\.?)+)/g);return t=t?t.map(e=>e.replace(`$`,``)):[e],t=t.filter(e=>e.length>0),{expression:e.replace(`\\`,``),variables:t.map(e=>e.split(/\b\.\b/).map(e=>e.replace(`\\`,``)))}}static getDataBindItems(t){return`attributes`in t?Array.from(t.attributes).filter(e=>e.name.indexOf(`::`)==0).map(t=>({propertyToUpdate:t.name.substring(2).replace(/-((html)|\w)/g,e=>e.substring(1).toUpperCase()),bindedVariablesDescriptor:e.getVariablesDescriptor(t.value)})):[]}static getSubPublisher(e,t){if(!t)return e;for(let n of t)if(n!=`_self_`){if(!e)return null;e=e[n]}return e}static addPublisherListeners(t){e.removePublisherListeners(t);let n=u.getAncestorAttributeValue(t.parentNode||t.host||t,`dataProvider`);if(!n)return;let r=x.getInstance().get(n),i=e.getDataBindItems(t),a=[];i.forEach(n=>{let i=n.bindedVariablesDescriptor,o=n.propertyToUpdate;for(let n of i.variables){let s=n,c=r;c=e.getSubPublisher(r,s);let l=t,u={publisher:c,onAssign:()=>{let t=i.variables.map(t=>e.getSubPublisher(r,t)?.get()),n=i.expression,a=!1;if(t.length==1&&i.variables[0].join(`.`)==n.substring(1)){let e=t[0];e===null&&(e=``),l[o]=e;return}for(let e=0;e<t.length;e++){let r=t[e],o=i.variables[e];r===null&&(a=!0,r=void 0),n=n.replace(`$`+o.join(`.`),r)}if(n.indexOf(`|`)!=-1){let e=n.indexOf(`|`);if(e==0)n=f.js(n.substring(1));else{let t=n.substring(0,e),r=n.substring(e+1),i=f[t];n=a?``:i?i(r):n}}else n=a?``:n;l[o]=n}};c?.onAssign(u.onAssign),a.push(u)}}),e.publisherListeners.set(t,a)}};ue.observe(document.documentElement),window.SonicDataBindObserver||(window.SonicDataBindObserver=ue);var T=e=>(t,n)=>{n===void 0?customElements.define(e,t):n.addInitializer((()=>{customElements.define(e,t)}))},de=globalThis,fe=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeShadow)&&`adoptedStyleSheets`in Document.prototype&&`replace`in CSSStyleSheet.prototype,pe=Symbol(),me=new WeakMap,he=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==pe)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(fe&&e===void 0){let n=t!==void 0&&t.length===1;n&&(e=me.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&me.set(t,e))}return e}toString(){return this.cssText}},ge=e=>new he(typeof e==`string`?e:e+``,void 0,pe),E=(e,...t)=>new he(e.length===1?e[0]:t.reduce(((t,n,r)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if(typeof e==`number`)return e;throw Error(`Value passed to 'css' function must be a 'css' function result: `+e+`. Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.`)})(n)+e[r+1]),e[0]),e,pe),_e=(e,t)=>{if(fe)e.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(let n of t){let t=document.createElement(`style`),r=de.litNonce;r!==void 0&&t.setAttribute(`nonce`,r),t.textContent=n.cssText,e.appendChild(t)}},ve=fe?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t=``;for(let n of e.cssRules)t+=n.cssText;return ge(t)})(e):e,{is:ye,defineProperty:be,getOwnPropertyDescriptor:xe,getOwnPropertyNames:Se,getOwnPropertySymbols:Ce,getPrototypeOf:we}=Object,Te=globalThis,Ee=Te.trustedTypes,De=Ee?Ee.emptyScript:``,Oe=Te.reactiveElementPolyfillSupport,ke=(e,t)=>e,Ae={toAttribute(e,t){switch(t){case Boolean:e=e?De:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=e!==null;break;case Number:n=e===null?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch{n=null}}return n}},je=(e,t)=>!ye(e,t),Me={attribute:!0,type:String,converter:Ae,reflect:!1,useDefault:!1,hasChanged:je};Symbol.metadata??=Symbol(`metadata`),Te.litPropertyMetadata??=new WeakMap;var Ne=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=Me){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let n=Symbol(),r=this.getPropertyDescriptor(e,n,t);r!==void 0&&be(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){let{get:r,set:i}=xe(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:r,set(t){let a=r?.call(this);i?.call(this,t),this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Me}static _$Ei(){if(this.hasOwnProperty(ke(`elementProperties`)))return;let e=we(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(ke(`finalized`)))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(ke(`properties`))){let e=this.properties,t=[...Se(e),...Ce(e)];for(let n of t)this.createProperty(n,e[n])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[e,n]of t)this.elementProperties.set(e,n)}this._$Eh=new Map;for(let[e,t]of this.elementProperties){let n=this._$Eu(e,t);n!==void 0&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let e of n)t.unshift(ve(e))}else e!==void 0&&t.push(ve(e));return t}static _$Eu(e,t){let n=t.attribute;return!1===n?void 0:typeof n==`string`?n:typeof e==`string`?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((e=>e(this)))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return _e(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$ET(e,t){let n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(r!==void 0&&!0===n.reflect){let i=(n.converter?.toAttribute===void 0?Ae:n.converter).toAttribute(t,n.type);this._$Em=e,i==null?this.removeAttribute(r):this.setAttribute(r,i),this._$Em=null}}_$AK(e,t){let n=this.constructor,r=n._$Eh.get(e);if(r!==void 0&&this._$Em!==r){let e=n.getPropertyOptions(r),i=typeof e.converter==`function`?{fromAttribute:e.converter}:e.converter?.fromAttribute===void 0?Ae:e.converter;this._$Em=r;let a=i.fromAttribute(t,e.type);this[r]=a??this._$Ej?.get(r)??a,this._$Em=null}}requestUpdate(e,t,n){if(e!==void 0){let r=this.constructor,i=this[e];if(n??=r.getPropertyOptions(e),!((n.hasChanged??je)(i,t)||n.useDefault&&n.reflect&&i===this._$Ej?.get(e)&&!this.hasAttribute(r._$Eu(e,n))))return;this.C(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:n,reflect:r,wrapped:i},a){n&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,a??t??this[e]),!0!==i||a!==void 0)||(this._$AL.has(e)||(this.hasUpdated||n||(t=void 0),this._$AL.set(e,t)),!0===r&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}let e=this.constructor.elementProperties;if(e.size>0)for(let[t,n]of e){let{wrapped:e}=n,r=this[t];!0!==e||this._$AL.has(t)||r===void 0||this.C(t,void 0,n,r)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach((e=>e.hostUpdate?.())),this.update(t)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach((e=>e.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach((e=>this._$ET(e,this[e]))),this._$EM()}updated(e){}firstUpdated(e){}};Ne.elementStyles=[],Ne.shadowRootOptions={mode:`open`},Ne[ke(`elementProperties`)]=new Map,Ne[ke(`finalized`)]=new Map,Oe?.({ReactiveElement:Ne}),(Te.reactiveElementVersions??=[]).push(`2.1.1`);var Pe={attribute:!0,type:String,converter:Ae,reflect:!1,hasChanged:je},Fe=(e=Pe,t,n)=>{let{kind:r,metadata:i}=n,a=globalThis.litPropertyMetadata.get(i);if(a===void 0&&globalThis.litPropertyMetadata.set(i,a=new Map),r===`setter`&&((e=Object.create(e)).wrapped=!0),a.set(n.name,e),r===`accessor`){let{name:r}=n;return{set(n){let i=t.get.call(this);t.set.call(this,n),this.requestUpdate(r,i,e)},init(t){return t!==void 0&&this.C(r,void 0,e,t),t}}}if(r===`setter`){let{name:r}=n;return function(n){let i=this[r];t.call(this,n),this.requestUpdate(r,i,e)}}throw Error(`Unsupported decorator location: `+r)};function D(e){return(t,n)=>typeof n==`object`?Fe(e,t,n):((e,t,n)=>{let r=t.hasOwnProperty(n);return t.constructor.createProperty(n,e),r?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}function O(e){return D({...e,state:!0,attribute:!1})}var Ie=(e,t,n)=>(n.configurable=!0,n.enumerable=!0,Reflect.decorate&&typeof t!=`object`&&Object.defineProperty(e,t,n),n);function Le(e,t){return(n,r,i)=>{let a=t=>t.renderRoot?.querySelector(e)??null;if(t){let{get:e,set:t}=typeof r==`object`?n:i??(()=>{let e=Symbol();return{get(){return this[e]},set(t){this[e]=t}}})();return Ie(n,r,{get(){let n=e.call(this);return n===void 0&&(n=a(this),(n!==null||this.hasUpdated)&&t.call(this,n)),n}})}return Ie(n,r,{get(){return a(this)}})}}function Re(e){return(t,n)=>{let{slot:r,selector:i}=e??{},a=`slot`+(r?`[name=${r}]`:`:not([name])`);return Ie(t,n,{get(){let t=(this.renderRoot?.querySelector(a))?.assignedElements(e)??[];return i===void 0?t:t.filter((e=>e.matches(i)))}})}}function k(e){return(t,n)=>{let{slot:r}=e??{},i=`slot`+(r?`[name=${r}]`:`:not([name])`);return Ie(t,n,{get(){return(this.renderRoot?.querySelector(i))?.assignedNodes(e)??[]}})}}var ze=globalThis,Be=ze.trustedTypes,Ve=Be?Be.createPolicy(`lit-html`,{createHTML:e=>e}):void 0,He=`$lit$`,Ue=`lit$${Math.random().toFixed(9).slice(2)}$`,We=`?`+Ue,Ge=`<${We}>`,Ke=document,qe=()=>Ke.createComment(``),Je=e=>e===null||typeof e!=`object`&&typeof e!=`function`,Ye=Array.isArray,Xe=e=>Ye(e)||typeof e?.[Symbol.iterator]==`function`,Ze=`[
1
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),l=(e=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof require<`u`?require:e)[t]}):e)(function(e){if(typeof require<`u`)return require.apply(this,arguments);throw Error('Calling `require` for "'+e+"\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.")});(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u=class e{static getLanguage(){let e=document.documentElement.lang;return localStorage.getItem(`SonicSelectedLanguage`)||e}static getCookies(){return document.cookie.split(`;`).reduce((e,t)=>{let n=t.indexOf(`=`);return e[t.substring(0,n).trim()]=t.substring(n+1),e},{})}static everyAncestors(e,t){for(;e;){if(!t(e))return;e=e.parentNode||e.host}}static getScrollableAncestor(e){for(;e;){let t=e;if(t.nodeType===1){let n=window.getComputedStyle(t);if(n?.overflowY===`auto`||n?.overflowY===`scroll`||n?.overflowY===`hidden`||n?.overflowX===`auto`||n?.overflowX===`scroll`||n?.overflowX===`hidden`)return e}e=e.parentNode||e.host}return null}static getAncestorAttributeValue(e,t){if(!e)return null;for(;!(`hasAttribute`in e&&e.hasAttribute(t))&&(e.parentNode||e.host);)e=e.parentNode||e.host;return`hasAttribute`in e?e.getAttribute(t):null}static getApiConfiguration(t){let n=e.getAncestorAttributeValue(t,`token`),r=e.getAncestorAttributeValue(t,`addHTTPResponse`)!=null,i=e.getAncestorAttributeValue(t,`serviceURL`),a=null,o=null,s=e.getAncestorAttributeValue(t,`tokenProvider`),c=e.getAncestorAttributeValue(t,`eventsApiToken`);n||(a=e.getAncestorAttributeValue(t,`userName`),o=e.getAncestorAttributeValue(t,`password`));let l=e.getAncestorAttributeValue(t,`credentials`)||void 0,u=t.getAttribute(`cache`),d=t.hasAttribute(`blockUntilDone`),f=t.hasAttribute(`keepAlive`);return{serviceURL:i,token:n,userName:a,password:o,authToken:c,tokenProvider:s,addHTTPResponse:r,credentials:l,cache:u,blockUntilDone:d,keepAlive:f}}static getClosestElement(e,t){for(;!(e.nodeName&&e.nodeName.toLowerCase()===t)&&(e.parentNode||e.host);)e=e.parentNode||e.host;return e.nodeName?e:null}static getClosestForm(t){return e.getClosestElement(t,`form`)}static getAncestorsByTagNames(e,t){let n=new Set(t.map(e=>e.toLowerCase())),r=[],i=e.parentNode||e.host;for(;i;)i instanceof Element&&n.has(i.tagName.toLowerCase())&&r.push(i),i=i.parentNode||i.host;return r}static getAncestorsBySelectors(e,t){let n=[],r=e.parentNode||e.host;for(;r;){if(r instanceof Element)for(let e of t)try{if(r.matches(e)){n.push(r);break}}catch{}r=r.parentNode||r.host}return n}static async loadJS(e){return new Promise(async t=>{let n=document.createElement(`script`);n.src=e,n.onload=()=>t(!0),n.onerror=()=>t(!0),document.head.appendChild(n)})}static async loadCSS(e){return new Promise(async t=>{let n=document.createElement(`link`);n.type=`text/css`,n.rel=`stylesheet`,n.href=e,n.onload=()=>t(!0),n.onerror=()=>t(!0),document.head.appendChild(n)})}},d=e=>{let t=document.documentElement;new MutationObserver(t=>{for(let n of t)n.type===`attributes`&&n.attributeName===`lang`&&e()}).observe(t,{attributes:!0,attributeFilter:[`lang`]})},f=class{static ucFirst(e){return typeof e==`string`?e.charAt(0).toUpperCase()+e.substring(1):e}static minutesDuration(e,t=``,n=`long`){t||=u.getLanguage();let r=(e,t)=>[Math.floor(e/t),e%t];function i(e,t,n){return new Intl.NumberFormat(e,{style:`unit`,unit:t,unitDisplay:n}).format}let[a,o]=r(e,60),s=[];return a&&s.push(i(t,`hour`,n)(a)),o&&s.push(i(t,`minute`,n)(o)),new Intl.ListFormat(t,{style:`long`,type:`conjunction`}).format(s)}static js(e){try{return Function(`return `+e)()}catch{return``}}},p=class e{static shallowEqual(e,t,n=!0){let r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length&&n)return!1;for(let i of r){let r=e[i],a=t[i];if(n?r!==a:r!=a)return!1}return!0}static deepEqual(t,n,r=!0){let i=Object.keys(t),a=Object.keys(n);if(i.length!==a.length&&r)return!1;for(let a of i){let i=t[a],o=n[a],s=e.isObject(i)&&e.isObject(o),c=r?i!==o:i!=o;if(s&&!e.deepEqual(i,o)||!s&&c)return!1}return!0}static isObject(e){return typeof e==`object`&&!!e}static isUndefindOrNull(e){return e==null}static isEmpty(t){return e.isUndefindOrNull(t)?!0:Object.keys(t).length===0}static traverse(t,n,r=!1){for(let i of n){let n=t[i];if(n===void 0)return;t=r&&e.isObject(n)?Object.assign(Array.isArray(n)?[]:{},t,n):t[i]}return t}static traverseDotNotation(t,n,r=!1){return e.traverse(t,n.split(`.`),r)}static getURLSearchArray(t,n=``){let r=[];for(let i in t){let a=t[i];n&&(i=n+`[`+i+`]`),e.isObject(a)?r=[...r,...this.getURLSearchArray(a,i)]:r.push(`${i}=${a}`)}return r}static getURLSearchString(t){return e.getURLSearchArray(t,``).join(`&`)}},m=p.traverseDotNotation,h=class{static async queueTaskPromise(){return new Promise(e=>{window.queueMicrotask(()=>e(null))})}static async delayPromise(e){return new Promise(t=>{setTimeout(t,e)})}},g=`sonic`;typeof __SONIC_PREFIX__<`u`&&(g=__SONIC_PREFIX__);var ee=g.replace(/-([a-z])/g,e=>e[1].toUpperCase()),_=ee.charAt(0).toUpperCase()+ee.slice(1);function te(e){return Object.prototype.hasOwnProperty.call(e,`__value`)}function ne(e){return typeof e==`object`&&!!e}var v=`sonic`;typeof __SONIC_PREFIX__>`u`&&(v=`sonic`);var y=v==`sonic`?`publisher-proxies-data`:v+`-publisher-proxies-data`,b=class e{static{this.instances=new Map}static{this.instancesCounter=0}constructor(e,t,n){for(this._proxies_=new Map,this._is_savable_=!1,this._expiration_delay_=1e3*60*60*12,this._invalidate_on_page_show_=!1,this._invalidateListeners_=new Set,this._formInvalidateListeners_=new Set,this._assignListeners_=new Set,this._mutationListeners_=new Set,this._fillListeners_=new Set,this._templateFillListeners_=new Set,this._lockInternalMutationPublishing_=!1,this._instanceCounter_=0,this._assignmentId_=0,this._value_=e,this.parent=t||null,this._parentKey_=n,this.root=this,this._instanceCounter_=0;this.root.parent;)this.root=this.root.parent}delete(){for(let e in this._proxies_.keys())e!=`_parent_`&&this._proxies_.get(e)?.delete();this._invalidateListeners_.clear(),this._formInvalidateListeners_.clear(),this._assignListeners_.clear(),this._mutationListeners_.clear(),this._fillListeners_.clear(),this._templateFillListeners_.clear(),this._proxies_.clear(),e.instances.delete(this._instanceCounter_)}hasListener(){return this._templateFillListeners_.size>0||this._assignListeners_.size>0||this._invalidateListeners_.size>0||this._formInvalidateListeners_.size>0||this._mutationListeners_.size>0||this._fillListeners_.size>0}_publishInternalMutation_(e=!1){if(this._mutationListeners_.forEach(e=>e()),this._is_savable_&&!x.changed){x.changed=!0,x.saveId++;let e=x.saveId;setTimeout(()=>x.getInstance().saveToLocalStorage(e),1e3)}e||this.parent&&this.parent._publishInternalMutation_()}async _publishAssignement_(e=!1){if(this._assignmentId_++,this._assignmentId_!==this._assignmentId_)return;let t=this.get();this._assignListeners_.forEach(e=>{e(t)}),this._publishInternalMutation_(e)}_publishInvalidation_(){this._invalidateListeners_.forEach(e=>e())}_publishFormInvalidation_(){this._formInvalidateListeners_.forEach(e=>e())}_publishDynamicFilling_(e,t){this._fillListeners_.forEach(n=>{n[e]!==t&&(n[e]=t)}),this._publishTemplateFilling_(e,t)}_publishTemplateFilling_(e,t){this._templateFillListeners_.forEach(n=>{let r=Object.getOwnPropertyDescriptor(n,e);r&&!r.set&&!r.writable||(n.propertyMap&&n.propertyMap[e]&&(e=n.propertyMap[e]),n[e]!==void 0&&n[e]!==t&&(n[e]=t))})}onAssign(e,t=!0){typeof e==`function`&&(this._assignListeners_.has(e)||(this._assignListeners_.add(e),t&&e(this.get())))}offAssign(e){this._assignListeners_.delete(e)}onInvalidate(e){typeof e==`function`&&this._invalidateListeners_.add(e)}offInvalidate(e){typeof e==`function`&&this._invalidateListeners_.delete(e)}invalidate(){this._publishInvalidation_()}onFormInvalidate(e){typeof e==`function`&&this._formInvalidateListeners_.add(e)}offFormInvalidate(e){typeof e==`function`&&this._formInvalidateListeners_.delete(e)}invalidateForm(){this._publishFormInvalidation_()}onInternalMutation(e){typeof e==`function`&&(this._mutationListeners_.add(e),e())}offInternalMutation(e){typeof e==`function`&&this._mutationListeners_.delete(e)}startTemplateFilling(e){if(this._templateFillListeners_.add(e),typeof this._value_==`object`)for(let t in this._value_){let n=t,r=this._value_[t];e.propertyMap&&e.propertyMap[t]&&(n=e.propertyMap[t]),e[t]!==void 0&&e[t]!==r&&(e[n]=r)}}stopTemplateFilling(e){this._templateFillListeners_.delete(e)}startDynamicFilling(e){this._fillListeners_.add(e);for(let t in this._value_){let n=this._value_[t];e[t]!==n&&(e[t]=n)}}stopDynamicFilling(e){this._fillListeners_.delete(e)}set(e,t=!1){if(this._value_===e||ne(this._value_)&&ne(e)&&e&&te(this._value_)&&te(e)&&this._value_.__value===e.__value||!ne(e)&&e===this._value_.__value)return!0;this._value_=ne(e)?e:{__value:e},this._cachedGet_=void 0;let n=te(this._value_);if(this._parentKey_&&this.parent){let e=te(this._value_)?this._value_.__value:this._value_;if(this.parent?.get()==null&&this.parent?.get()==null)if(isNaN(Number(this._parentKey_)))this.parent.set({[this._parentKey_]:e});else{let t=[];t[Number(this._parentKey_)]=e,this.parent.set(t)}else this.parent._value_[this._parentKey_]=e}if(n)return this._proxies_.forEach((e,t)=>{t!=`_parent_`&&(e.set(null),this._publishDynamicFilling_(t,null))}),this._publishAssignement_(t),this.parent&&this._parentKey_&&this.parent._publishDynamicFilling_(this._parentKey_,this._value_.__value),!0;for(let e in this._value_)this._value_[e]===void 0&&delete this._value_[e];if(this._proxies_.forEach((e,t)=>{let n=this._value_[t];t!=`_parent_`&&n===void 0&&n!==null&&isNaN(Number(t))&&(e.set(null),this._publishDynamicFilling_(t,null))}),this._publishAssignement_(),this.parent&&this._parentKey_&&this.parent._publishDynamicFilling_(this._parentKey_,this._value_),ne(this._value_))for(let t in this._value_){let n=e[t],r=ne(n)?n:{__value:n};if(!this._proxies_.has(t)){this._publishDynamicFilling_(t,n);continue}this._proxies_.get(t)?.set(r,!0),this._publishDynamicFilling_(t,n)}return!0}get(){if(x.modifiedCollectore.length>0&&x.modifiedCollectore[0].add(this),this._cachedGet_!==void 0)return this._cachedGet_;if(Object.prototype.hasOwnProperty.call(this._value_,`__value`)){let e=this._value_.__value;return this._cachedGet_=e??null}return this._cachedGet_=this._value_==null?null:this._value_}get $tag(){return this._instanceCounter_||=(e.instancesCounter++,e.instancesCounter),e.instances.set(this._instanceCounter_,this),`<`+v+`-publisher-proxy publisher="`+this._instanceCounter_+`"></`+v+`-publisher-proxy>`}},x=class e{static{this.buildDate=`Mon Apr 27 2026 13:14:12 GMT+0200 (Central European Summer Time)`}static{this.changed=!1}static{this.saving=!1}static{this.saveId=0}static{this.instance=null}static{this.instances=new Map}constructor(){if(this.enabledLocaStorageProxies=[],this.publishers=new Map,this.localStorageData={},this.isLocalStrorageReady=null,this.initialisedData=[],e.instance!=null)throw`Singleton / use getInstance`;e.instance=this,this.isLocalStrorageReady=this.cleanStorageData()}invalidateAll(){this.publishers.forEach(e=>{e._invalidate_on_page_show_&&e.invalidate()})}async cleanStorageData(){return new Promise(e=>{(async()=>{try{let t=localStorage.getItem(y),n=null;if(t&&(n=await this.decompress(t,`gzip`)),n)try{this.localStorageData=JSON.parse(n)}catch{this.localStorageData={}}else t=await this.compress(`{}`,`gzip`),localStorage.setItem(y,t),this.localStorageData={};for(let e in this.localStorageData){let t=this.localStorageData[e],n=new Date().getTime()-(t.expirationDelayMs||432e5);t.lastModifiationMS<n&&delete this.localStorageData[e]}e(!0)}catch{window.requestAnimationFrame(()=>{e(!1)}),console.warn(`no publisher cache in this browser`)}})()})}static getInstance(t){return t?e.instances.get(t)||(console.warn(`No PublisherManager instance registered with id:`,t,`creating new one`),new e):e.instance==null?new e:e.instance}static registerInstance(t,n){e.instances.has(t)&&console.warn(`PublisherManager instance already registered with id: `,t),e.instances.set(t,n)}static get(t,n){return e.getInstance().get(t,n)}static{this.modifiedCollectore=[]}static collectModifiedPublisher(){e.modifiedCollectore.unshift(new Set)}static getModifiedPublishers(){return e.modifiedCollectore.shift()}static delete(t){return t?e.getInstance().delete(t):!1}async setLocalData(e,t){await this.isLocalStrorageReady,e.set(this.localStorageData[t+`¤lang_`+u.getLanguage()]?.data||e.get())}get(e,t){let n=t?.localStorageMode===`enabled`,r=t?.invalidateOnPageShow===!0;if(!this.publishers.has(e)){let t=re({});this.set(e,t)}let i=this.publishers.get(e);return n&&this.initialisedData.indexOf(e)===-1&&(t?.expirationDelayMs&&(i._expiration_delay_=t.expirationDelayMs),i._is_savable_=!0,this.initialisedData.push(e),this.setLocalData(i,e)),r&&(i._invalidate_on_page_show_=r),this.publishers.get(e)}set(e,t){this.publishers.set(e,t)}delete(e){return this.publishers.has(e)?(this.publishers.delete(e),!0):!1}async saveToLocalStorage(t=0){if(!(t!==e.saveId&&t%10!=0))try{if(!e.changed||e.saving)return;e.saving=!0,e.changed=!1;let t=Array.from(this.publishers.keys()),n=!1;for(let e of t){let t=this.publishers.get(e);if(!t?._is_savable_)continue;let r=t?.get();r&&(this.localStorageData[e+`¤lang_`+u.getLanguage()]={lastModifiationMS:new Date().getTime(),expirationDelayMs:t._expiration_delay_,data:r},n=!0)}if(n){let e=await this.compress(JSON.stringify(this.localStorageData),`gzip`);localStorage.setItem(y,e)}if(e.saving=!1,e.changed){e.saveId++;let t=e.saveId;setTimeout(()=>this.saveToLocalStorage(t),1e3)}}catch{e.saving=!1}}async compress(e,t){let n=new TextEncoder().encode(e),r=new window.CompressionStream(t),i=r.writable.getWriter();i.write(n),i.close();let a=await new Response(r.readable).arrayBuffer(),o=new Uint8Array(a),s=``;for(let e=0;e<o.length;e++)s+=String.fromCharCode(o[e]);return btoa(s)}async decompress(e,t){let n=atob(e),r=Uint8Array.from(n,e=>e.charCodeAt(0)).buffer,i=new window.DecompressionStream(t),a=i.writable.getWriter();a.write(r),a.close();let o=await new Response(i.readable).arrayBuffer();return new TextDecoder().decode(o)}};if(typeof window<`u`){let e=window;e[_+`PublisherManager`]=e[_+`PublisherManager`]||x}var S=new Set(`invalidate.onInvalidate.offInvalidate.invalidateForm.onFormInvalidate.offFormInvalidate.onAssign.offAssign.startDynamicFilling.stopDynamicFilling.startTemplateFilling.stopTemplateFilling.onInternalMutation.offInternalMutation.set.get.$tag._cachedGet_._templateFillListeners_._fillListeners_._assignListeners_._invalidateListeners_._formInvalidateListeners_._publishInternalMutation_.hasListener.delete._mutationListeners_._publishDynamicFilling_._publishInvalidation_._publishFormInvalidation_._publishTemplateFilling_._publishAssignement_._proxies_.parent._parentKey_._value_._is_savable_._expiration_delay_._lockInternalMutationPublishing_._instanceCounter_._assignmentId_._invalidate_on_page_show_`.split(`.`));function C(e,t){return{get:function(n,r){if(typeof r==`string`&&S.has(r))return e[r];if(r==Symbol.toPrimitive)return()=>t().get();if(!e._proxies_.has(r)){let n=e._value_[r],i=re(ne(n)?n:{__value:n},e,r);i._proxies_.set(`_parent_`,t()),e._proxies_.set(r,i)}return e._proxies_.get(r)},set:function(n,r,i){if(r==`_value_`)return e._value_=i,!0;if(r==`_cachedGet_`)return e._cachedGet_=i,!0;if(r==`_assignmentId_`)return e._assignmentId_=i,!0;if(r==`_is_savable_`)return e._is_savable_=i,!0;if(r==`_expiration_delay_`)return e._expiration_delay_=i,!0;if(r==`_invalidate_on_page_show_`)return e._invalidate_on_page_show_=i,!0;if(r==`_instanceCounter_`)return e._instanceCounter_=i,!0;if(!e._proxies_.has(r)){let n=re({},e,r);n._proxies_.set(`_parent_`,t()),e._proxies_.set(r,n)}return e._value_[r]!==i&&(e._value_[r]=i,e._publishDynamicFilling_(r,i),e._proxies_.get(r)?.set(ne(i)?i:{__value:i})),!0},deleteProperty:function(t,n){return e._publishDynamicFilling_(n,null),e._proxies_.get(n)?.set(null),delete e._value_[n]},has:function(t,n){return n in e._value_&&n!=`_lockInternalMutationPublishing_`},defineProperty:function(t,n,r){return r&&`value`in r&&(e._value_[n]=r.value),!0},getOwnPropertyDescriptor:function(e,t){return{enumerable:!0,configurable:!0}},ownKeys:function(t){return e._value_.__value?Object.keys(e._value_.__value):Object.keys(e._value_)}}}function re(e,t=null,n){let r=new b(e,t,n),i=null,a=C(r,()=>i);return i=new Proxy(r,a),i}var ie=class extends HTMLElement{constructor(){super(),this.publisherId=``,this.onAssign=e=>{this.innerHTML=e.toString()}}connectedCallback(){this.publisherId=this.getAttribute(`publisher`)||``,this.publisher=b.instances.get(parseInt(this.publisherId)),this.publisher?.onAssign(this.onAssign)}disconnectedCallback(){this.publisher?.offAssign(this.onAssign)}};try{customElements.define(v+`-publisher-proxy`,ie)}catch{}var w=e=>{if(typeof e==`function`){let t=e;return x.collectModifiedPublisher(),t(),x.getModifiedPublishers()}if(typeof e==`string`){let t=e.split(`.`),n=t.shift()||``,r=x.get(n);r=p.traverse(r,t);let i=new Set;return i.add(r),i}return new Set([e])},ae=e=>w(e).values().next().value?.get(),oe=e=>w(e).values().next().value,se=oe,ce=oe,le=(e,t)=>{w(e).values().next().value?.set(t)};window.addEventListener(`pageshow`,e=>{e.persisted&&x.getInstance().invalidateAll()});var ue=class e{static{this.observedElements=new Map}static{this.enabled=!0}static disable(){this.enabled&&(this.enabled=!1,Array.from(e.observedElements.keys()).forEach(t=>e.unObserve(t)))}static observe(t){if(!t||!e.enabled||e.observedElements.has(t))return;let n=new MutationObserver(e.onMutation),r={};r.childList=!0,r.subtree=!0,r.attributes=!0,r.attributeFilter=[`data-bind`],n.observe(t,r),t.querySelectorAll(`[data-bind]`).forEach(t=>e.addPublisherListeners(t)),e.observedElements.set(t,n)}static unObserve(t){if(!t)return;let n=this.observedElements.get(t);n&&(n.disconnect(),t.querySelectorAll(`[data-bind]`).forEach(t=>e.removePublisherListeners(t)))}static onAdded(t){t.hasAttribute&&t.hasAttribute(`data-bind`)&&e.addPublisherListeners(t),t.querySelectorAll?t.querySelectorAll(`[data-bind]`).forEach(t=>e.addPublisherListeners(t)):t.childNodes.forEach(t=>e.onAdded(t))}static onRemoved(t){t.hasAttribute&&t.hasAttribute(`data-bind`)&&e.removePublisherListeners(t),t.querySelectorAll?t.querySelectorAll(`[data-bind]`).forEach(t=>e.removePublisherListeners(t)):t.childNodes.forEach(t=>e.onRemoved(t))}static onMutation(t){for(let n of t)switch(n.type){case`attributes`:e.addPublisherListeners(n.target);break;case`childList`:n.addedNodes.forEach(t=>{e.onAdded(t)}),n.removedNodes.forEach(t=>{e.onRemoved(t)});break}}static{this.publisherListeners=new Map}static removePublisherListeners(t){let n=e.publisherListeners.get(t);n&&(e.publisherListeners.delete(t),n.forEach(e=>{e.publisher?.offAssign(e.onAssign)}))}static getVariablesDescriptor(e){let t=e.match(/(\$(?:\w+\\?\.?)+)/g);return t=t?t.map(e=>e.replace(`$`,``)):[e],t=t.filter(e=>e.length>0),{expression:e.replace(`\\`,``),variables:t.map(e=>e.split(/\b\.\b/).map(e=>e.replace(`\\`,``)))}}static getDataBindItems(t){return`attributes`in t?Array.from(t.attributes).filter(e=>e.name.indexOf(`::`)==0).map(t=>({propertyToUpdate:t.name.substring(2).replace(/-((html)|\w)/g,e=>e.substring(1).toUpperCase()),bindedVariablesDescriptor:e.getVariablesDescriptor(t.value)})):[]}static getSubPublisher(e,t){if(!t)return e;for(let n of t)if(n!=`_self_`){if(!e)return null;e=e[n]}return e}static addPublisherListeners(t){e.removePublisherListeners(t);let n=u.getAncestorAttributeValue(t.parentNode||t.host||t,`dataProvider`);if(!n)return;let r=x.getInstance().get(n),i=e.getDataBindItems(t),a=[];i.forEach(n=>{let i=n.bindedVariablesDescriptor,o=n.propertyToUpdate;for(let n of i.variables){let s=n,c=r;c=e.getSubPublisher(r,s);let l=t,u={publisher:c,onAssign:()=>{let t=i.variables.map(t=>e.getSubPublisher(r,t)?.get()),n=i.expression,a=!1;if(t.length==1&&i.variables[0].join(`.`)==n.substring(1)){let e=t[0];e===null&&(e=``),l[o]=e;return}for(let e=0;e<t.length;e++){let r=t[e],o=i.variables[e];r===null&&(a=!0,r=void 0),n=n.replace(`$`+o.join(`.`),r)}if(n.indexOf(`|`)!=-1){let e=n.indexOf(`|`);if(e==0)n=f.js(n.substring(1));else{let t=n.substring(0,e),r=n.substring(e+1),i=f[t];n=a?``:i?i(r):n}}else n=a?``:n;l[o]=n}};c?.onAssign(u.onAssign),a.push(u)}}),e.publisherListeners.set(t,a)}};ue.observe(document.documentElement),window.SonicDataBindObserver||(window.SonicDataBindObserver=ue);var T=e=>(t,n)=>{n===void 0?customElements.define(e,t):n.addInitializer((()=>{customElements.define(e,t)}))},de=globalThis,fe=de.ShadowRoot&&(de.ShadyCSS===void 0||de.ShadyCSS.nativeShadow)&&`adoptedStyleSheets`in Document.prototype&&`replace`in CSSStyleSheet.prototype,pe=Symbol(),me=new WeakMap,he=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==pe)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(fe&&e===void 0){let n=t!==void 0&&t.length===1;n&&(e=me.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&me.set(t,e))}return e}toString(){return this.cssText}},ge=e=>new he(typeof e==`string`?e:e+``,void 0,pe),E=(e,...t)=>new he(e.length===1?e[0]:t.reduce(((t,n,r)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if(typeof e==`number`)return e;throw Error(`Value passed to 'css' function must be a 'css' function result: `+e+`. Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.`)})(n)+e[r+1]),e[0]),e,pe),_e=(e,t)=>{if(fe)e.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(let n of t){let t=document.createElement(`style`),r=de.litNonce;r!==void 0&&t.setAttribute(`nonce`,r),t.textContent=n.cssText,e.appendChild(t)}},ve=fe?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t=``;for(let n of e.cssRules)t+=n.cssText;return ge(t)})(e):e,{is:ye,defineProperty:be,getOwnPropertyDescriptor:xe,getOwnPropertyNames:Se,getOwnPropertySymbols:Ce,getPrototypeOf:we}=Object,Te=globalThis,Ee=Te.trustedTypes,De=Ee?Ee.emptyScript:``,Oe=Te.reactiveElementPolyfillSupport,ke=(e,t)=>e,Ae={toAttribute(e,t){switch(t){case Boolean:e=e?De:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=e!==null;break;case Number:n=e===null?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch{n=null}}return n}},je=(e,t)=>!ye(e,t),Me={attribute:!0,type:String,converter:Ae,reflect:!1,useDefault:!1,hasChanged:je};Symbol.metadata??=Symbol(`metadata`),Te.litPropertyMetadata??=new WeakMap;var Ne=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=Me){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let n=Symbol(),r=this.getPropertyDescriptor(e,n,t);r!==void 0&&be(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){let{get:r,set:i}=xe(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:r,set(t){let a=r?.call(this);i?.call(this,t),this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Me}static _$Ei(){if(this.hasOwnProperty(ke(`elementProperties`)))return;let e=we(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(ke(`finalized`)))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(ke(`properties`))){let e=this.properties,t=[...Se(e),...Ce(e)];for(let n of t)this.createProperty(n,e[n])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[e,n]of t)this.elementProperties.set(e,n)}this._$Eh=new Map;for(let[e,t]of this.elementProperties){let n=this._$Eu(e,t);n!==void 0&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let e of n)t.unshift(ve(e))}else e!==void 0&&t.push(ve(e));return t}static _$Eu(e,t){let n=t.attribute;return!1===n?void 0:typeof n==`string`?n:typeof e==`string`?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((e=>e(this)))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return _e(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$ET(e,t){let n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(r!==void 0&&!0===n.reflect){let i=(n.converter?.toAttribute===void 0?Ae:n.converter).toAttribute(t,n.type);this._$Em=e,i==null?this.removeAttribute(r):this.setAttribute(r,i),this._$Em=null}}_$AK(e,t){let n=this.constructor,r=n._$Eh.get(e);if(r!==void 0&&this._$Em!==r){let e=n.getPropertyOptions(r),i=typeof e.converter==`function`?{fromAttribute:e.converter}:e.converter?.fromAttribute===void 0?Ae:e.converter;this._$Em=r;let a=i.fromAttribute(t,e.type);this[r]=a??this._$Ej?.get(r)??a,this._$Em=null}}requestUpdate(e,t,n){if(e!==void 0){let r=this.constructor,i=this[e];if(n??=r.getPropertyOptions(e),!((n.hasChanged??je)(i,t)||n.useDefault&&n.reflect&&i===this._$Ej?.get(e)&&!this.hasAttribute(r._$Eu(e,n))))return;this.C(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:n,reflect:r,wrapped:i},a){n&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,a??t??this[e]),!0!==i||a!==void 0)||(this._$AL.has(e)||(this.hasUpdated||n||(t=void 0),this._$AL.set(e,t)),!0===r&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}let e=this.constructor.elementProperties;if(e.size>0)for(let[t,n]of e){let{wrapped:e}=n,r=this[t];!0!==e||this._$AL.has(t)||r===void 0||this.C(t,void 0,n,r)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach((e=>e.hostUpdate?.())),this.update(t)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach((e=>e.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach((e=>this._$ET(e,this[e]))),this._$EM()}updated(e){}firstUpdated(e){}};Ne.elementStyles=[],Ne.shadowRootOptions={mode:`open`},Ne[ke(`elementProperties`)]=new Map,Ne[ke(`finalized`)]=new Map,Oe?.({ReactiveElement:Ne}),(Te.reactiveElementVersions??=[]).push(`2.1.1`);var Pe={attribute:!0,type:String,converter:Ae,reflect:!1,hasChanged:je},Fe=(e=Pe,t,n)=>{let{kind:r,metadata:i}=n,a=globalThis.litPropertyMetadata.get(i);if(a===void 0&&globalThis.litPropertyMetadata.set(i,a=new Map),r===`setter`&&((e=Object.create(e)).wrapped=!0),a.set(n.name,e),r===`accessor`){let{name:r}=n;return{set(n){let i=t.get.call(this);t.set.call(this,n),this.requestUpdate(r,i,e)},init(t){return t!==void 0&&this.C(r,void 0,e,t),t}}}if(r===`setter`){let{name:r}=n;return function(n){let i=this[r];t.call(this,n),this.requestUpdate(r,i,e)}}throw Error(`Unsupported decorator location: `+r)};function D(e){return(t,n)=>typeof n==`object`?Fe(e,t,n):((e,t,n)=>{let r=t.hasOwnProperty(n);return t.constructor.createProperty(n,e),r?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}function O(e){return D({...e,state:!0,attribute:!1})}var Ie=(e,t,n)=>(n.configurable=!0,n.enumerable=!0,Reflect.decorate&&typeof t!=`object`&&Object.defineProperty(e,t,n),n);function Le(e,t){return(n,r,i)=>{let a=t=>t.renderRoot?.querySelector(e)??null;if(t){let{get:e,set:t}=typeof r==`object`?n:i??(()=>{let e=Symbol();return{get(){return this[e]},set(t){this[e]=t}}})();return Ie(n,r,{get(){let n=e.call(this);return n===void 0&&(n=a(this),(n!==null||this.hasUpdated)&&t.call(this,n)),n}})}return Ie(n,r,{get(){return a(this)}})}}function Re(e){return(t,n)=>{let{slot:r,selector:i}=e??{},a=`slot`+(r?`[name=${r}]`:`:not([name])`);return Ie(t,n,{get(){let t=(this.renderRoot?.querySelector(a))?.assignedElements(e)??[];return i===void 0?t:t.filter((e=>e.matches(i)))}})}}function k(e){return(t,n)=>{let{slot:r}=e??{},i=`slot`+(r?`[name=${r}]`:`:not([name])`);return Ie(t,n,{get(){return(this.renderRoot?.querySelector(i))?.assignedNodes(e)??[]}})}}var ze=globalThis,Be=ze.trustedTypes,Ve=Be?Be.createPolicy(`lit-html`,{createHTML:e=>e}):void 0,He=`$lit$`,Ue=`lit$${Math.random().toFixed(9).slice(2)}$`,We=`?`+Ue,Ge=`<${We}>`,Ke=document,qe=()=>Ke.createComment(``),Je=e=>e===null||typeof e!=`object`&&typeof e!=`function`,Ye=Array.isArray,Xe=e=>Ye(e)||typeof e?.[Symbol.iterator]==`function`,Ze=`[
2
2
  \f\r]`,Qe=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,$e=/-->/g,et=/>/g,tt=RegExp(`>|${Ze}(?:([^\\s"'>=/]+)(${Ze}*=${Ze}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,`g`),nt=/'/g,rt=/"/g,it=/^(?:script|style|textarea|title)$/i,A=(e=>(t,...n)=>({_$litType$:e,strings:t,values:n}))(1),at=Symbol.for(`lit-noChange`),j=Symbol.for(`lit-nothing`),ot=new WeakMap,st=Ke.createTreeWalker(Ke,129);function ct(e,t){if(!Ye(e)||!e.hasOwnProperty(`raw`))throw Error(`invalid template strings array`);return Ve===void 0?t:Ve.createHTML(t)}var lt=(e,t)=>{let n=e.length-1,r=[],i,a=t===2?`<svg>`:t===3?`<math>`:``,o=Qe;for(let t=0;t<n;t++){let n=e[t],s,c,l=-1,u=0;for(;u<n.length&&(o.lastIndex=u,c=o.exec(n),c!==null);)u=o.lastIndex,o===Qe?c[1]===`!--`?o=$e:c[1]===void 0?c[2]===void 0?c[3]!==void 0&&(o=tt):(it.test(c[2])&&(i=RegExp(`</`+c[2],`g`)),o=tt):o=et:o===tt?c[0]===`>`?(o=i??Qe,l=-1):c[1]===void 0?l=-2:(l=o.lastIndex-c[2].length,s=c[1],o=c[3]===void 0?tt:c[3]===`"`?rt:nt):o===rt||o===nt?o=tt:o===$e||o===et?o=Qe:(o=tt,i=void 0);let d=o===tt&&e[t+1].startsWith(`/>`)?` `:``;a+=o===Qe?n+Ge:l>=0?(r.push(s),n.slice(0,l)+He+n.slice(l)+Ue+d):n+Ue+(l===-2?t:d)}return[ct(e,a+(e[n]||`<?>`)+(t===2?`</svg>`:t===3?`</math>`:``)),r]},ut=class e{constructor({strings:t,_$litType$:n},r){let i;this.parts=[];let a=0,o=0,s=t.length-1,c=this.parts,[l,u]=lt(t,n);if(this.el=e.createElement(l,r),st.currentNode=this.el.content,n===2||n===3){let e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;(i=st.nextNode())!==null&&c.length<s;){if(i.nodeType===1){if(i.hasAttributes())for(let e of i.getAttributeNames())if(e.endsWith(He)){let t=u[o++],n=i.getAttribute(e).split(Ue),r=/([.?@])?(.*)/.exec(t);c.push({type:1,index:a,name:r[2],strings:n,ctor:r[1]===`.`?ht:r[1]===`?`?gt:r[1]===`@`?_t:mt}),i.removeAttribute(e)}else e.startsWith(Ue)&&(c.push({type:6,index:a}),i.removeAttribute(e));if(it.test(i.tagName)){let e=i.textContent.split(Ue),t=e.length-1;if(t>0){i.textContent=Be?Be.emptyScript:``;for(let n=0;n<t;n++)i.append(e[n],qe()),st.nextNode(),c.push({type:2,index:++a});i.append(e[t],qe())}}}else if(i.nodeType===8)if(i.data===We)c.push({type:2,index:a});else{let e=-1;for(;(e=i.data.indexOf(Ue,e+1))!==-1;)c.push({type:7,index:a}),e+=Ue.length-1}a++}}static createElement(e,t){let n=Ke.createElement(`template`);return n.innerHTML=e,n}};function dt(e,t,n=e,r){if(t===at)return t;let i=r===void 0?n._$Cl:n._$Co?.[r],a=Je(t)?void 0:t._$litDirective$;return i?.constructor!==a&&(i?._$AO?.(!1),a===void 0?i=void 0:(i=new a(e),i._$AT(e,n,r)),r===void 0?n._$Cl=i:(n._$Co??=[])[r]=i),i!==void 0&&(t=dt(e,i._$AS(e,t.values),i,r)),t}var ft=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:n}=this._$AD,r=(e?.creationScope??Ke).importNode(t,!0);st.currentNode=r;let i=st.nextNode(),a=0,o=0,s=n[0];for(;s!==void 0;){if(a===s.index){let t;s.type===2?t=new pt(i,i.nextSibling,this,e):s.type===1?t=new s.ctor(i,s.name,s.strings,this,e):s.type===6&&(t=new vt(i,this,e)),this._$AV.push(t),s=n[++o]}a!==s?.index&&(i=st.nextNode(),a++)}return st.currentNode=Ke,r}p(e){let t=0;for(let n of this._$AV)n!==void 0&&(n.strings===void 0?n._$AI(e[t]):(n._$AI(e,n,t),t+=n.strings.length-2)),t++}},pt=class e{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,r){this.type=2,this._$AH=j,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=dt(this,e,t),Je(e)?e===j||e==null||e===``?(this._$AH!==j&&this._$AR(),this._$AH=j):e!==this._$AH&&e!==at&&this._(e):e._$litType$===void 0?e.nodeType===void 0?Xe(e)?this.k(e):this._(e):this.T(e):this.$(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==j&&Je(this._$AH)?this._$AA.nextSibling.data=e:this.T(Ke.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:n}=e,r=typeof n==`number`?this._$AC(e):(n.el===void 0&&(n.el=ut.createElement(ct(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(t);else{let e=new ft(r,this),n=e.u(this.options);e.p(t),this.T(n),this._$AH=e}}_$AC(e){let t=ot.get(e.strings);return t===void 0&&ot.set(e.strings,t=new ut(e)),t}k(t){Ye(this._$AH)||(this._$AH=[],this._$AR());let n=this._$AH,r,i=0;for(let a of t)i===n.length?n.push(r=new e(this.O(qe()),this.O(qe()),this,this.options)):r=n[i],r._$AI(a),i++;i<n.length&&(this._$AR(r&&r._$AB.nextSibling,i),n.length=i)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let t=e.nextSibling;e.remove(),e=t}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},mt=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,r,i){this.type=1,this._$AH=j,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=i,n.length>2||n[0]!==``||n[1]!==``?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=j}_$AI(e,t=this,n,r){let i=this.strings,a=!1;if(i===void 0)e=dt(this,e,t,0),a=!Je(e)||e!==this._$AH&&e!==at,a&&(this._$AH=e);else{let r=e,o,s;for(e=i[0],o=0;o<i.length-1;o++)s=dt(this,r[n+o],t,o),s===at&&(s=this._$AH[o]),a||=!Je(s)||s!==this._$AH[o],s===j?e=j:e!==j&&(e+=(s??``)+i[o+1]),this._$AH[o]=s}a&&!r&&this.j(e)}j(e){e===j?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??``)}},ht=class extends mt{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===j?void 0:e}},gt=class extends mt{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==j)}},_t=class extends mt{constructor(e,t,n,r,i){super(e,t,n,r,i),this.type=5}_$AI(e,t=this){if((e=dt(this,e,t,0)??j)===at)return;let n=this._$AH,r=e===j&&n!==j||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,i=e!==j&&(n===j||r);r&&this.element.removeEventListener(this.name,this,n),i&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH==`function`?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},vt=class{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){dt(this,e)}},yt={M:He,P:Ue,A:We,C:1,L:lt,R:ft,D:Xe,V:dt,I:pt,H:mt,N:gt,U:_t,B:ht,F:vt},bt=ze.litHtmlPolyfillSupport;bt?.(ut,pt),(ze.litHtmlVersions??=[]).push(`3.3.1`);var xt=(e,t,n)=>{let r=n?.renderBefore??t,i=r._$litPart$;if(i===void 0){let e=n?.renderBefore??null;r._$litPart$=i=new pt(t.insertBefore(qe(),e),e,void 0,n??{})}return i._$AI(e),i},{I:St}=yt,Ct=e=>e.strings===void 0,wt=()=>document.createComment(``),Tt=(e,t,n)=>{let r=e._$AA.parentNode,i=t===void 0?e._$AB:t._$AA;if(n===void 0)n=new St(r.insertBefore(wt(),i),r.insertBefore(wt(),i),e,e.options);else{let t=n._$AB.nextSibling,a=n._$AM,o=a!==e;if(o){let t;n._$AQ?.(e),n._$AM=e,n._$AP!==void 0&&(t=e._$AU)!==a._$AU&&n._$AP(t)}if(t!==i||o){let e=n._$AA;for(;e!==t;){let t=e.nextSibling;r.insertBefore(e,i),e=t}}}return n},Et=(e,t,n=e)=>(e._$AI(t,n),e),Dt={},Ot=(e,t=Dt)=>e._$AH=t,kt=e=>e._$AH,At=e=>{e._$AR(),e._$AA.remove()},jt={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Mt=e=>(...t)=>({_$litDirective$:e,values:t}),Nt=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,n){this._$Ct=e,this._$AM=t,this._$Ci=n}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}},Pt=(e,t)=>{let n=e._$AN;if(n===void 0)return!1;for(let e of n)e._$AO?.(t,!1),Pt(e,t);return!0},Ft=e=>{let t,n;do{if((t=e._$AM)===void 0)break;n=t._$AN,n.delete(e),e=t}while(n?.size===0)},It=e=>{for(let t;t=e._$AM;e=t){let n=t._$AN;if(n===void 0)t._$AN=n=new Set;else if(n.has(e))break;n.add(e),zt(t)}};function Lt(e){this._$AN===void 0?this._$AM=e:(Ft(this),this._$AM=e,It(this))}function Rt(e,t=!1,n=0){let r=this._$AH,i=this._$AN;if(i!==void 0&&i.size!==0)if(t)if(Array.isArray(r))for(let e=n;e<r.length;e++)Pt(r[e],!1),Ft(r[e]);else r!=null&&(Pt(r,!1),Ft(r));else Pt(this,e)}var zt=e=>{e.type==jt.CHILD&&(e._$AP??=Rt,e._$AQ??=Lt)},Bt=class extends Nt{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,n){super._$AT(e,t,n),It(this),this.isConnected=e._$AU}_$AO(e,t=!0){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),t&&(Pt(this,e),Ft(this))}setValue(e){if(Ct(this._$Ct))this._$Ct._$AI(e,this);else{let t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}},Vt=globalThis,M=class extends Ne{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=xt(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return at}};M._$litElement$=!0,M.finalized=!0,Vt.litElementHydrateSupport?.({LitElement:M});var Ht=Vt.litElementPolyfillSupport;Ht?.({LitElement:M}),(Vt.litElementVersions??=[]).push(`4.2.1`);function Ut(e){if(typeof e!=`object`||!e||Array.isArray(e))return e;let t={...e};return delete t._sonic_http_response_,t}var Wt=class e{static{this.loadingGetPromises=new Map}set token(t){if(this._token=t,!t){e.tokens.delete(this.serviceURL);return}e.invalidTokens.includes(t)||e.tokens.set(this.serviceURL,t)}get token(){return e.invalidTokens.includes(this._token)?e.tokens.get(this.serviceURL):this._token}static{this.tokens=new Map}static{this.invalidTokens=[]}handleInvalidToken(t){t&&(e.invalidTokens.includes(t)||(e.invalidTokens.push(t),this.token=null))}static{this.failledTokenUpdates=new Map}static{this.firstCallDoneFlags=new Map}constructor(e){this.addHTTPResponse=!1,this.cache=`default`,this.isServiceSimulated=!1,this.blockUntilDone=!1,this.keepAlive=!1,this.serviceURL=e.serviceURL,this.blockUntilDone=e.blockUntilDone||!1,this.serviceURL==`publisher://`&&(this.isServiceSimulated=!0),this.serviceURL||=document.location.origin,this.userName=e.userName,this.password=e.password,e.token&&(this.token=e.token),this.tokenProvider=e.tokenProvider,this.authToken=e.authToken,this.addHTTPResponse=e.addHTTPResponse||!1,this.credentials=e.credentials,this.cache=e.cache||`default`,this.keepAlive=e.keepAlive||!1}async handleResult(t,n){e.firstCallDoneFlags.set(this.serviceURL,`done`),this.lastResult=t;let r=t.headers.get(`content-type`)?.toLowerCase(),i=t.status,a={};if(!r||r.indexOf(`text/`)==0)a={text:await t.text()};else try{a=await t.json()}catch{a={}}return this.addHTTPResponse&&p.isObject(a)&&(a._sonic_http_response_=t),i===498&&!e.failledTokenUpdates.has(this.serviceURL)&&(this.handleInvalidToken(this.token),a=n.apiMethod===`get`?await this[n.apiMethod](n.path,n.additionalHeaders):await this[n.apiMethod](n.path,n.data,n.method,n.additionalHeaders)),ce(`sonic-api`).lastResponse.set({http:t,processed:a}),a}async auth(){if(this.token)return;if(e.tokens.has(this.serviceURL)){this.token=e.tokens.get(this.serviceURL);return}if(!this.tokenProvider)return;let t={};this.userName&&this.password?t={Authorization:`Basic `+window.btoa(unescape(encodeURIComponent(this.userName+`:`+this.password)))}:this.authToken&&(t={Authorization:`Bearer `+this.authToken});let n=new URL(this.serviceURL),r=n.protocol+`//`+n.host,i=await fetch(this.computeURL(this.tokenProvider,{serviceHost:r}),{headers:t,credentials:this.credentials,keepalive:this.keepAlive});try{let t=await i.json();t.token?this.token=t.token:e.failledTokenUpdates.set(this.serviceURL,!0)}catch{e.failledTokenUpdates.set(this.serviceURL,!0)}}async localGet(e,t){let n=x.get(e),r=new URLSearchParams(t.split(`?`)[1]||``),i=n.get(),a=[];a=Array.isArray(i)?i:[i];let o=[],s=1/0,c=0,l=0;if(r.has(`limit`)&&(s=parseInt(r.get(`limit`)||`0`),l++),r.has(`offset`)&&(c=parseInt(r.get(`offset`)||`0`),l++),l>0&&(r.delete(`limit`),r.delete(`offset`)),r.size===0)return a.slice(c,c+s);for(let[e,t]of r.entries()){let n=t.split(`,`).map(e=>e.trim());for(let r of n)for(let n of a)if(typeof n!=`object`)isNaN(+n)?n.toString().toLowerCase().includes(t.toLowerCase())&&o.push(n):n===t&&o.push(n);else{let t=n;if(!t[e])continue;isNaN(+t[e])?t[e]?.toString().toLowerCase().includes(r.toLowerCase())&&o.push(n):t[e]===r&&o.push(n)}}return o.slice(c,c+s)}firstCallDone(){return new Promise(t=>{if(!e.firstCallDoneFlags.has(this.serviceURL))e.firstCallDoneFlags.set(this.serviceURL,`loading`),t(!0);else{let n=()=>{[void 0,`loading`].includes(e.firstCallDoneFlags.get(this.serviceURL))?window.requestAnimationFrame(n):t(!0)};n()}})}async get(t,n){await this.firstCallDone(),this.blockUntilDone&&e.firstCallDoneFlags.set(this.serviceURL,`loading`);let r=/dataProvider\((.*?)\)(.*?)$/;if(r.test(t)){let e=t.match(r);if(!e)throw Error(`dataProvider path is not valid`);return await this.localGet(e[1],e[2])}let i={apiMethod:`get`,path:t,additionalHeaders:n},a=await this.createHeaders(n),o=this.computeURL(t),s=JSON.stringify({url:o,headers:a});if(!e.loadingGetPromises.has(s)){let t=new Promise(async e=>{try{let t=await fetch(o,{headers:a,credentials:this.credentials,cache:this.cache,keepalive:this.keepAlive});e(await this.handleResult(t,i))}catch{e(null)}});e.loadingGetPromises.set(s,t)}let c=await e.loadingGetPromises.get(s);return e.loadingGetPromises.delete(s),c}async getDetailed(e,t){let n=/dataProvider\((.*?)\)(.*?)$/.test(e),r=await this.get(e,t);if(r==null)return;let i=Ut(r),a=this.computeURL(e);if(n)return{request:new Request(a,{method:`GET`}),result:i};let o=await this.createHeaders(t);return{request:new Request(a,{method:`GET`,headers:new Headers(o),credentials:this.credentials,cache:this.cache,keepalive:this.keepAlive}),response:this.lastResult,result:i}}async createHeaders(e){await this.auth();let t={};return this.token&&(t.Authorization=`Bearer `+this.token),t[`Accept-Language`]=u.getLanguage(),e&&Object.assign(t,e),t}computeURL(e,t={}){let n=``;n=e.startsWith(`http`)?e:this.serviceURL+`/`+e,n.startsWith(`http`)||(n=window.location.origin+n);let r=new URL(n);for(let e in t)r.searchParams.set(e,t[e]);return r.toString().replace(/([^(https?:)])\/{2,}/g,`$1/`)}async send(e,t,n=`POST`,r){let i={apiMethod:`send`,path:e,additionalHeaders:r,method:n,data:t},a=await this.createHeaders(r);a.Accept=`application/json`,a[`Content-Type`]=`application/json`;let o=await fetch(this.computeURL(e),{headers:a,credentials:this.credentials,method:n,body:JSON.stringify(t),keepalive:this.keepAlive});return await this.handleResult(o,i)}async submitFormData(e,t,n=`POST`,r){let i={apiMethod:`submitFormData`,path:e,additionalHeaders:r,method:n,data:t},a=await this.createHeaders(r);a.Accept=`application/json`;let o=new FormData,s=t;for(let e in s)o.set(e,s[e]);let c=await fetch(this.computeURL(e),{headers:a,credentials:this.credentials,method:n,body:o,keepalive:this.keepAlive});return await this.handleResult(c,i)}async put(e,t,n){return this.send(e,t,`PUT`,n)}async post(e,t,n){return this.send(e,t,`POST`,n)}async patch(e,t,n){return this.send(e,t,`PATCH`,n)}async delete(e,t,n){return this.send(e,t,`delete`,n)}},Gt=!1,Kt=`log`,qt=u.getApiConfiguration(document.body||document.documentElement),Jt=[],Yt=0,Xt=async(e,t)=>{if(!Gt)return;Jt.push({message:e,variables:t||{}}),Yt++;let n=Yt;window.queueMicrotask(()=>{if(n!==Yt)return;let e=[...Jt];return Jt=[],new Wt(qt).post(Kt,{logs:e})})},Zt=class extends Nt{constructor(e){if(super(e),this.it=j,e.type!==jt.CHILD)throw Error(this.constructor.directiveName+`() can only be used in child bindings`)}render(e){if(e===j||e==null)return this._t=void 0,this.it=e;if(e===at)return e;if(typeof e!=`string`)throw Error(this.constructor.directiveName+`() called with a non-string value`);if(e===this.it)return this._t;this.it=e;let t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}};Zt.directiveName=`unsafeHTML`,Zt.resultType=1;var N=Mt(Zt),Qt=new Map,$t=e=>{if(!e)return null;let t=u.getApiConfiguration(e),n=u.getAncestorAttributeValue(e,`wordingProvider`),r=u.getAncestorAttributeValue(e,`wordingVersionProvider`),i={apiConfiguration:t,wordingProvider:n,wordingVersionProvider:r},a=null;for(let[e,t]of Qt)if(p.deepEqual(e,i)){a=t;break}return a||(a={api:new Wt(t),keysToTranslate:new Set,translatedKeys:new Set,wordingProvider:n,callIndex:0,wordingVersionProvider:r,apiCallKey:i},Qt.set(i,a)),a},en=class e extends Bt{static{this.publisher=x.get(`sonic-wording`,{localStorageMode:`enabled`})}unsubscribe(){e.publisher[`wording_`+this.key].offAssign(this.onAssign)}constructor(e){super(e),this.useUnsafeHTML=!1,this.onAssign=e=>{let t=this.useUnsafeHTML?N(e):e;this.setValue(t)},this.node=e.options.host}render(e,t=!1){return this.useUnsafeHTML=t,this.key!==e&&(this.key=e,this.isConnected&&this.subscribe(e)),at}static{this.firstCall=!0}static async callApi(t,n,r=!0,i){if(await x.getInstance().isLocalStrorageReady,e.firstCall){e.firstCall=!1,d(e.reloadWordings);let t=Object.keys(e.publisher.get());for(let n of t)e.publisher.get()[n]===``&&delete e.publisher[n]}if(t){let n=u.getAncestorAttributeValue(t,`wordingVersionProvider`);n&&ce(n).onAssign(e.handleVersionProvider(t))}let a=e.publisher.get()[`wording_`+n]!=null,o=i||$t(t);if(!o)return;if(a&&n!==``){o.translatedKeys.add(n);return}o.callIndex++;let s=o.callIndex,c=o.wordingProvider??``;if(!c&&r){window.setTimeout(async()=>{e.callApi(null,n,!1,o)},1e3);return}let l=o.api;window.queueMicrotask(async()=>{if(a=e.publisher[`wording_`+n].get()!=null,!a&&n!==``&&(o.keysToTranslate.add(n),e.publisher[`wording_`+n].set(``)),s!==o.callIndex)return;let t=Array.from(o.keysToTranslate);if(!t.length)return;let r=c.split(`?`),i=r.shift(),u=(r.length>0?r.join(`?`)+`&`:``)+`labels[]=`+t.join(`&labels[]=`),d=i+`?`+u;o.translatedKeys=new Set([...o.translatedKeys,...o.keysToTranslate]),o.keysToTranslate.clear();let f=await l.get(d);for(let t in f)e.publisher[`wording_`+t].set(f[t])})}static reloadWordings(){for(let t of Qt.values())t.keysToTranslate=new Set(t.translatedKeys),t.keysToTranslate.size>0&&e.callApi(null,``,!1,t)}static{this.versionProviderHandlers=new Map}static handleVersionProvider(t){let n=$t(t),r=e=>{};if(!n)return r;if(e.versionProviderHandlers.has(n))return e.versionProviderHandlers.get(n)||r;let i=function(t){if(!n.wordingVersionProvider)return;let r=e.publisher.get().__wording_versions__??[];if(t==null)return;let i=r.find(e=>e.serviceURL===n.api.serviceURL)||{serviceURL:n.api.serviceURL,version:0};r.includes(i)||r.push(i),t!==i.version&&(i.version=t,e.publisher.set({__wording_versions__:r}),e.reloadWordings())};return e.versionProviderHandlers.set(n,i),i}subscribe(t){this.unsubscribe(),e.publisher[`wording_`+t].onAssign(this.onAssign),e.callApi(this.node,t)}disconnected(){this.unsubscribe()}reconnected(){this.key&&this.subscribe(this.key)}},tn=Mt(en);function P(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}var nn=!1,rn=new Set,F=(e,t)=>{class n extends e{static{this.instanceCounter=0}constructor(...e){super(),this.collectDependenciesVersion=0,this.displayContents=!1,this.noAutoFill=!1,this.forceAutoFill=!1,this.renderOnPropsInternalChange=!1,this.noShadowDom=null,this.propertyMap=null,this.title=``,this.dataProvider=null,this.bindPublisher=null,this._props=null,this.shouldRenderLazy=!0,this.defferedDebug=null,this.debug=null,this.onAssign=e=>{this.props=e}}hasAncestorAttribute(e){return this.getAncestorAttributeValue(e)!=null}getAncestorAttributeValue(e){return u.getAncestorAttributeValue(this,e)}get props(){return this._props!==null||!this.publisher?this._props:this.publisher.get()}set props(e){typeof e==`string`&&[`{`,`[`].includes(e.trim().charAt(0))&&(e=JSON.parse(e)),e!=this._props&&(this._props=e,this.publisher&&this.publisher.get()!=e&&this.publisher.set(e),this.requestUpdate())}updated(e){super.updated(e);let t=[...(this.shadowRoot||this).children].filter(e=>e.tagName!=`STYLE`),n=this.displayContents?`contents`:t.length==0?`none`:null;n?this.style.display=n:this.style.removeProperty(`display`)}connectedCallback(){if(n.instanceCounter++,this.hasAttribute(`lazyRendering`)){let e={root:null,threshold:.9},t=!0,n=new IntersectionObserver(e=>{for(let r of e)if(t&&r.isIntersecting){t=!1,n.disconnect(),this.initWording(),this.shouldRenderLazy=!1,this.startPublisher();break}},e);n.observe(this)}else this.initWording(),this.shouldRenderLazy=!1;this.initPublisher(),this.addDebugger(),super.connectedCallback()}disconnectedCallback(){this.removeDebugger(),super.disconnectedCallback(),this.publisher&&(this.publisher.stopTemplateFilling(this),this.publisher.offInternalMutation(this.requestUpdate)),en.publisher.stopTemplateFilling(this),this.onAssign&&this.publisher?.offAssign(this.onAssign)}addDebugger(){if(this.hasAttribute(`debug`)&&!this.defferedDebug){if(!this.debug){this.debug=document.createElement(`div`);let e=this.debug.style;e.position=`fixed`,e.top=`0`,e.right=`0`,e.margin=`auto`,e.borderRadius=`.7rem`,e.backgroundColor=`#0f1729`,e.color=`#c5d4f9`,e.padding=`16px 16px`,e.margin=`16px 16px`,e.boxShadow=`0 10px 30px -18px rgba(0,0,0,.3)`,e.overflowY=`auto`,e.zIndex=`99999999`,e.maxHeight=`calc(100vh - 32px)`,e.fontFamily=`Consolas, monospace`,e.maxWidth=`min(50vw,25rem)`,e.fontSize=`12px`,e.minWidth=`300px`,e.overflowWrap=`break-word`,e.resize=`vertical`}this.addEventListener(`click`,e=>{e.ctrlKey&&(e.preventDefault(),nn=!nn)}),this.dataProvider&&(window[this.dataProvider]=this.publisher),this.addEventListener(`mouseover`,()=>{nn||this.removeDebugger(),document.body.appendChild(this.debug),rn.add(this.debug)}),this.addEventListener(`mouseout`,()=>{nn||this.removeDebugger()}),this.publisher?.onInternalMutation(()=>{this.debug.innerHTML=`🤖 DataProvider : "<b style="font-weight:bold;color:#fff;">${this.dataProvider}</b>"<br>
3
3
  <div style="font-size:10px;border-top:1px dashed;margin-top:5px;padding-left:23px;opacity:.6;padding-top:5px;">
4
4
  Variable disponible dans la console<br>
package/docs/index.html CHANGED
@@ -10,7 +10,7 @@
10
10
  <!-- <script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
11
11
  -->
12
12
  <script src="https://cdn.jsdelivr.net/npm/marked@13.0.3"></script>
13
- <script type="module" crossorigin src="./assets/index-DP1oMukw.js"></script>
13
+ <script type="module" crossorigin src="./assets/index-CW8cIYT9.js"></script>
14
14
  <link rel="stylesheet" crossorigin href="./assets/index-DZtxIZCW.css">
15
15
  </head>
16
16
  <body class="px-6 lg:px-20">