@supersoniks/concorde 3.1.44 → 3.1.46
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/build-infos.json +1 -1
- package/concorde-core.bundle.js +11 -11
- package/concorde-core.es.js +88 -81
- package/dist/concorde-core.bundle.js +11 -11
- package/dist/concorde-core.es.js +88 -81
- package/docs/assets/index-CnxgssIs.js +4433 -0
- package/docs/assets/index-DCqvoAAf.css +1 -0
- package/docs/css/docs.css +0 -0
- package/docs/fonts/ClashGrotesk-Bold.eot +0 -0
- package/docs/fonts/ClashGrotesk-Bold.ttf +0 -0
- package/docs/fonts/ClashGrotesk-Bold.woff +0 -0
- package/docs/fonts/ClashGrotesk-Bold.woff2 +0 -0
- package/docs/fonts/ClashGrotesk-Extralight.eot +0 -0
- package/docs/fonts/ClashGrotesk-Extralight.ttf +0 -0
- package/docs/fonts/ClashGrotesk-Extralight.woff +0 -0
- package/docs/fonts/ClashGrotesk-Extralight.woff2 +0 -0
- package/docs/fonts/ClashGrotesk-Light.eot +0 -0
- package/docs/fonts/ClashGrotesk-Light.ttf +0 -0
- package/docs/fonts/ClashGrotesk-Light.woff +0 -0
- package/docs/fonts/ClashGrotesk-Light.woff2 +0 -0
- package/docs/fonts/ClashGrotesk-Medium.eot +0 -0
- package/docs/fonts/ClashGrotesk-Medium.ttf +0 -0
- package/docs/fonts/ClashGrotesk-Medium.woff +0 -0
- package/docs/fonts/ClashGrotesk-Medium.woff2 +0 -0
- package/docs/fonts/ClashGrotesk-Regular.eot +0 -0
- package/docs/fonts/ClashGrotesk-Regular.ttf +0 -0
- package/docs/fonts/ClashGrotesk-Regular.woff +0 -0
- package/docs/fonts/ClashGrotesk-Regular.woff2 +0 -0
- package/docs/fonts/ClashGrotesk-Semibold.eot +0 -0
- package/docs/fonts/ClashGrotesk-Semibold.ttf +0 -0
- package/docs/fonts/ClashGrotesk-Semibold.woff +0 -0
- package/docs/fonts/ClashGrotesk-Semibold.woff2 +0 -0
- package/docs/fonts/ClashGrotesk-Variable.eot +0 -0
- package/docs/fonts/ClashGrotesk-Variable.ttf +0 -0
- package/docs/fonts/ClashGrotesk-Variable.woff +0 -0
- package/docs/fonts/ClashGrotesk-Variable.woff2 +0 -0
- package/docs/img/concorde-icon.svg +5 -0
- package/docs/img/concorde-logo.svg +1 -0
- package/docs/img/concorde.png +0 -0
- package/docs/img/concorde_def.png +0 -0
- package/docs/img/concorde_seuil.png.webp +0 -0
- package/docs/img/concorde_seuil_invert.png +0 -0
- package/docs/img/paul_metrand.jpg +0 -0
- package/docs/img/paul_metrand_xs.jpg +0 -0
- package/docs/index.html +93 -0
- package/docs/src/core/components/functional/date/date.md +290 -0
- package/docs/src/core/components/functional/fetch/fetch.md +117 -0
- package/docs/src/core/components/functional/if/if.md +16 -0
- package/docs/src/core/components/functional/list/list.md +199 -0
- package/docs/src/core/components/functional/mix/mix.md +41 -0
- package/docs/src/core/components/functional/queue/queue.md +87 -0
- package/docs/src/core/components/functional/router/router.md +112 -0
- package/docs/src/core/components/functional/sdui/default-library.json +108 -0
- package/docs/src/core/components/functional/sdui/example.json +99 -0
- package/docs/src/core/components/functional/sdui/sdui.md +356 -0
- package/docs/src/core/components/functional/states/states.md +87 -0
- package/docs/src/core/components/functional/submit/submit.md +83 -0
- package/docs/src/core/components/functional/subscriber/subscriber.md +91 -0
- package/docs/src/core/components/functional/value/value.md +35 -0
- package/docs/src/core/components/ui/alert/alert.md +121 -0
- package/docs/src/core/components/ui/badge/badge.md +102 -0
- package/docs/src/core/components/ui/button/button.md +184 -0
- package/docs/src/core/components/ui/captcha/captcha.md +12 -0
- package/docs/src/core/components/ui/card/card.md +96 -0
- package/docs/src/core/components/ui/divider/divider.md +35 -0
- package/docs/src/core/components/ui/form/checkbox/checkbox.md +96 -0
- package/docs/src/core/components/ui/form/fieldset/fieldset.md +129 -0
- package/docs/src/core/components/ui/form/form-actions/form-actions.md +77 -0
- package/docs/src/core/components/ui/form/form-layout/form-layout.md +43 -0
- package/docs/src/core/components/ui/form/input/input.md +168 -0
- package/docs/src/core/components/ui/form/input-autocomplete/input-autocomplete.md +130 -0
- package/docs/src/core/components/ui/form/radio/radio.md +86 -0
- package/docs/src/core/components/ui/form/select/select.md +99 -0
- package/docs/src/core/components/ui/form/textarea/textarea.md +65 -0
- package/docs/src/core/components/ui/group/group.md +75 -0
- package/docs/src/core/components/ui/icon/icon.md +125 -0
- package/docs/src/core/components/ui/icon/icons.json +1 -0
- package/docs/src/core/components/ui/image/image.md +107 -0
- package/docs/src/core/components/ui/link/link.md +43 -0
- package/docs/src/core/components/ui/loader/loader.md +37 -0
- package/docs/src/core/components/ui/menu/menu.md +288 -0
- package/docs/src/core/components/ui/modal/modal.md +123 -0
- package/docs/src/core/components/ui/pop/pop.md +79 -0
- package/docs/src/core/components/ui/progress/progress.md +63 -0
- package/docs/src/core/components/ui/table/table.md +455 -0
- package/docs/src/core/components/ui/tooltip/tooltip.md +82 -0
- package/docs/src/docs/_core-concept/overview.md +57 -0
- package/docs/src/docs/_core-concept/subscriber.md +76 -0
- package/docs/src/docs/_getting-started/concorde-outside.md +143 -0
- package/docs/src/docs/_getting-started/create-a-component.md +137 -0
- package/docs/src/docs/_getting-started/my-first-subscriber.md +174 -0
- package/docs/src/docs/_getting-started/pubsub.md +150 -0
- package/docs/src/docs/_getting-started/start.md +39 -0
- package/docs/src/docs/_getting-started/theming.md +91 -0
- package/docs/src/docs/search/docs-search.json +3887 -0
- package/docs/src/tag-list.json +1 -0
- package/docs/src/tsconfig-model.json +23 -0
- package/docs/src/tsconfig.json +808 -0
- package/docs/svg/regular/plane.svg +1 -0
- package/docs/svg/solid/plane.svg +1 -0
- package/index.html +0 -0
- package/package.json +1 -1
- package/scripts/pre-build.mjs +0 -0
- package/scripts/pre-publish.mjs +0 -0
- package/src/core/_types/types.ts +0 -0
- package/src/core/components/functional/queue/queue.ts +22 -15
- package/src/core/components/functional/router/router.md +0 -0
- package/src/core/components/functional/router/router.ts +0 -0
- package/src/core/components/functional/sonic-scope/sonic-scope.ts +0 -0
- package/src/core/components/functional/states/states.md +0 -0
- package/src/core/components/functional/states/states.ts +0 -0
- package/src/core/components/functional/submit/submit.md +0 -0
- package/src/core/components/functional/submit/submit.ts +0 -0
- package/src/core/components/ui/alert/alert.md +0 -0
- package/src/core/components/ui/alert-messages/alert-messages.ts +0 -0
- package/src/core/components/ui/badge/badge.md +0 -0
- package/src/core/components/ui/form/checkbox/checkbox.md +0 -0
- package/src/core/components/ui/form/fieldset/fieldset.ts +0 -0
- package/src/core/components/ui/form/input/password-helper.ts +0 -0
- package/src/core/components/ui/form/input/same-value-helper.ts +0 -0
- package/src/core/components/ui/form/radio/radio.md +0 -0
- package/src/core/components/ui/form/select/select.md +0 -0
- package/src/core/components/ui/group/group.ts +0 -0
- package/src/core/components/ui/image/image.ts +0 -0
- package/src/core/components/ui/menu/menu.ts +0 -0
- package/src/core/components/ui/modal/modal.md +0 -0
- package/src/core/components/ui/theme/theme-collection/dark.ts +0 -0
- package/src/core/components/ui/toast/message-subscriber.ts +0 -0
- package/src/core/components/ui/toast/toast.ts +0 -0
- package/src/core/components/ui/ui.ts +0 -0
- package/src/core/core.ts +0 -0
- package/src/core/mixins/FormCheckable.ts +0 -0
- package/src/core/mixins/Subscriber.ts +0 -0
- package/src/core/utils/HTML.ts +0 -0
- package/src/core/utils/LocationHandler.ts +0 -0
- package/src/core/utils/Objects.ts +0 -0
- package/src/core/utils/PublisherProxy.ts +0 -0
- package/src/core/utils/Utils.ts +5 -5
- package/src/core/utils/api.ts +46 -0
- package/src/core/utils/route.ts +0 -0
- package/src/docs/docs.ts +0 -0
- package/src/docs/search/docs-search.json +0 -0
- package/src/docs/search/page.ts +0 -0
- package/src/tsconfig-model.json +0 -0
- package/vite/config.js +0 -0
package/build-infos.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"date":
|
|
1
|
+
{"date":1731680772}
|
package/concorde-core.bundle.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(G){typeof define=="function"&&define.amd?define(G):G()})(function(){"use strict";var St,k,L,So,t,Z;let G=class Rt{static getLanguage(){const t=document.documentElement.lang;return localStorage.getItem("SonicSelectedLanguage")||t}static getCookies(){return document.cookie.split(";").reduce((t,s)=>{const i=s.indexOf("=");return t[s.substring(0,i).trim()]=s.substring(i+1),t},{})}static everyAncestors(t,s){for(;t;){if(!s(t))return;t=t.parentNode||t.host}}static getScrollableAncestor(t){for(;t;){const s=t;if(s.nodeType===1){const i=window.getComputedStyle(s);if((i==null?void 0:i.overflowY)==="hidden"||(i==null?void 0:i.overflowX)==="hidden")return t}t=t.parentNode||t.host}return null}static getAncestorAttributeValue(t,s){if(!t)return null;for(;!("hasAttribute"in t&&t.hasAttribute(s))&&(t.parentNode||t.host);)t=t.parentNode||t.host;return"hasAttribute"in t?t.getAttribute(s):null}static getApiConfiguration(t){const s=Rt.getAncestorAttributeValue(t,"token"),i=Rt.getAncestorAttributeValue(t,"addHTTPResponse")!=null,e=Rt.getAncestorAttributeValue(t,"serviceURL");let o=null,n=null;const a=Rt.getAncestorAttributeValue(t,"tokenProvider"),c=Rt.getAncestorAttributeValue(t,"eventsApiToken");s||(o=Rt.getAncestorAttributeValue(t,"userName"),n=Rt.getAncestorAttributeValue(t,"password"));const h=Rt.getAncestorAttributeValue(t,"credentials")||void 0,d=t.getAttribute("cache"),p=t.hasAttribute("blockUntilDone");return{serviceURL:e,token:s,userName:o,password:n,authToken:c,tokenProvider:a,addHTTPResponse:i,credentials:h,cache:d,blockUntilDone:p}}static getClosestElement(t,s){for(;!(t.nodeName&&t.nodeName.toLowerCase()===s)&&(t.parentNode||t.host);)t=t.parentNode||t.host;return t.nodeName?t:null}static getClosestForm(t){return Rt.getClosestElement(t,"form")}static async loadJS(t){return new Promise(async i=>{const e=document.createElement("script");e.src=t,e.onload=()=>i(!0),e.onerror=()=>i(!0),document.head.appendChild(e)})}static async loadCSS(t){return new Promise(async i=>{const e=document.createElement("link");e.type="text/css",e.rel="stylesheet",e.href=t,e.onload=()=>i(!0),e.onerror=()=>i(!0),document.head.appendChild(e)})}};const ti=r=>{const t=document.documentElement,s=new MutationObserver(e=>{for(let o of e)o.type==="attributes"&&o.attributeName==="lang"&&r()}),i={attributes:!0,attributeFilter:["lang"]};s.observe(t,i)};let vs=class{static ucFirst(t){return typeof t!="string"?t:t.charAt(0).toUpperCase()+t.substring(1)}static minutesDuration(t,s="",i="long"){s||(s=G.getLanguage());const e=(h,d)=>[Math.floor(h/d),h%d];function o(h,d,p){return new Intl.NumberFormat(h,{style:"unit",unit:d,unitDisplay:p}).format}const[n,a]=e(t,60),c=[];return n&&c.push(o(s,"hour",i)(n)),a&&c.push(o(s,"minute",i)(a)),new Intl.ListFormat(s,{style:"long",type:"conjunction"}).format(c)}static js(t){try{return Function("return "+t)()}catch{return""}}},Lo=class{static async queueTaskPromise(){return new Promise(t=>{window.queueMicrotask(()=>t(null))})}static async delayPromise(t){return new Promise(s=>{setTimeout(s,t)})}},ir="sonic";typeof __SONIC_PREFIX__<"u"&&(ir=__SONIC_PREFIX__);let rr=ir.replace(/-([a-z])/g,r=>r[1].toUpperCase());const ys=rr.charAt(0).toUpperCase()+rr.slice(1);function _s(r){return Object.prototype.hasOwnProperty.call(r,"__value")}function Ve(r){return typeof r=="object"&&r!=null}let De="sonic";typeof __SONIC_PREFIX__>"u"&&(De="sonic"+Math.floor(Math.random()*1e6));const ei=De=="sonic"?"publisher-proxies-data":De+"-publisher-proxies-data";let si=(St=class{constructor(t,s,i){for(this._proxies_=new Map,this._is_savable_=!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_=t,this.parent=s||null,this._parentKey_=i,this.root=this,this._instanceCounter_=0;this.root.parent;)this.root=this.root.parent}delete(){var t;for(const s in this._proxies_.keys())s!="_parent_"&&((t=this._proxies_.get(s))==null||t.delete());this._invalidateListeners_.clear(),this._formInvalidateListeners_.clear(),this._assignListeners_.clear(),this._mutationListeners_.clear(),this._fillListeners_.clear(),this._templateFillListeners_.clear(),this._proxies_.clear(),St.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_(t=!1){if(this._mutationListeners_.forEach(s=>s()),this._is_savable_&&!N.changed){N.changed=!0,N.saveId++;const s=N.saveId;setTimeout(()=>N.getInstance().saveToLocalStorage(s),1e3)}t||this.parent&&this.parent._publishInternalMutation_()}async _publishAssignement_(t=!1){if(this._assignmentId_++,this._assignmentId_!==this._assignmentId_)return;const i=this.get();this._assignListeners_.forEach(e=>{e(i)}),this._publishInternalMutation_(t)}_publishInvalidation_(){this._invalidateListeners_.forEach(t=>t())}_publishFormInvalidation_(){this._formInvalidateListeners_.forEach(t=>t())}_publishDynamicFilling_(t,s){this._fillListeners_.forEach(i=>{i[t]!==s&&(i[t]=s)}),this._publishTemplateFilling_(t,s)}_publishTemplateFilling_(t,s){this._templateFillListeners_.forEach(i=>{const e=Object.getOwnPropertyDescriptor(i,t);e&&!e.set&&!e.writable||(i.propertyMap&&i.propertyMap[t]&&(t=i.propertyMap[t]),typeof i[t]<"u"&&i[t]!==s&&(i[t]=s))})}onAssign(t,s=!0){typeof t=="function"&&(this._assignListeners_.has(t)||(this._assignListeners_.add(t),s&&t(this.get())))}offAssign(t){this._assignListeners_.delete(t)}onInvalidate(t){typeof t=="function"&&this._invalidateListeners_.add(t)}offInvalidate(t){typeof t=="function"&&this._invalidateListeners_.delete(t)}invalidate(){this._publishInvalidation_()}onFormInvalidate(t){typeof t=="function"&&this._formInvalidateListeners_.add(t)}offFormInvalidate(t){typeof t=="function"&&this._formInvalidateListeners_.delete(t)}invalidateForm(){this._publishFormInvalidation_()}onInternalMutation(t){typeof t=="function"&&(this._mutationListeners_.add(t),t())}offInternalMutation(t){typeof t=="function"&&this._mutationListeners_.delete(t)}startTemplateFilling(t){if(this._templateFillListeners_.add(t),typeof this._value_=="object")for(const s in this._value_){let i=s;const e=this._value_[s];t.propertyMap&&t.propertyMap[s]&&(i=t.propertyMap[s]),typeof t[s]<"u"&&t[s]!==e&&(t[i]=e)}}stopTemplateFilling(t){this._templateFillListeners_.delete(t)}startDynamicFilling(t){this._fillListeners_.add(t);for(const s in this._value_){const i=this._value_[s];t[s]!==i&&(t[s]=i)}}stopDynamicFilling(t){this._fillListeners_.delete(t)}set(t,s=!1){var e,o,n;if(this._value_===t||this._value_&&t&&_s(this._value_)&&_s(t)&&this._value_.__value===t.__value)return!0;this._value_=Ve(t)?t:{__value:t},this._cachedGet_=void 0;const i=_s(this._value_);if(this._parentKey_&&this.parent){const a=_s(this._value_)?this._value_.__value:this._value_;if(((e=this.parent)==null?void 0:e.get())==null&&((o=this.parent)==null?void 0:o.get())==null)if(isNaN(Number(this._parentKey_)))this.parent.set({[this._parentKey_]:a});else{const c=[];c[Number(this._parentKey_)]=a,this.parent.set(c)}else this.parent._value_[this._parentKey_]=a}if(i)return this._publishAssignement_(s),this.parent&&this._parentKey_&&this.parent._publishDynamicFilling_(this._parentKey_,this._value_.__value),!0;for(const a in this._value_)this._value_[a]===void 0&&delete this._value_[a];if(this._proxies_.forEach((a,c)=>{const h=this._value_[c];c!="_parent_"&&h===void 0&&h!==null&&isNaN(Number(c))&&(a.set(null),this._publishDynamicFilling_(c,null))}),this._publishAssignement_(),this.parent&&this._parentKey_&&this.parent._publishDynamicFilling_(this._parentKey_,this._value_),Ve(this._value_))for(const a in this._value_){const c=t[a],d=Ve(c)?c:{__value:c};if(!this._proxies_.has(a)){this._publishDynamicFilling_(a,c);continue}(n=this._proxies_.get(a))==null||n.set(d,!0),this._publishDynamicFilling_(a,c)}return!0}get(){if(this._cachedGet_!==void 0)return this._cachedGet_;if(N.modifiedCollectore.length>0&&N.modifiedCollectore[0].add(this),Object.prototype.hasOwnProperty.call(this._value_,"__value")){const t=this._value_.__value;return this._cachedGet_=t??null}return this._cachedGet_=this._value_!=null?this._value_:null}get $tag(){return this._instanceCounter_||(St.instancesCounter++,this._instanceCounter_=St.instancesCounter),St.instances.set(this._instanceCounter_,this),"<"+De+'-publisher-proxy publisher="'+this._instanceCounter_+'"></'+De+"-publisher-proxy>"}},St.instances=new Map,St.instancesCounter=0,St),N=(k=class{constructor(){if(this.enabledLocaStorageProxies=[],this.publishers=new Map,this.localStorageData={},this.isLocalStrorageReady=null,this.initialisedData=[],k.instance!=null)throw"Singleton / use getInstance";k.instance=this,this.isLocalStrorageReady=this.cleanStorageData()}async cleanStorageData(){return new Promise(t=>{(async()=>{try{let i=localStorage.getItem(ei),e=null;if(i&&(e=await this.decompress(i,"gzip")),e)try{this.localStorageData=JSON.parse(e)}catch{this.localStorageData={}}else i=await this.compress("{}","gzip"),localStorage.setItem(ei,i),this.localStorageData={};const o=new Date().getTime()-1e3*60*60*12;for(const n in this.localStorageData)this.localStorageData[n].lastModifiationMS<o&&delete this.localStorageData[n];t(!0)}catch{window.requestAnimationFrame(()=>{t(!1)}),console.warn("no publisher cache in this browser")}})()})}static getInstance(t){if(t){const s=k.instances.get(t);return s||(console.warn("No PublisherManager instance registered with id:",t,"creating new one"),new k)}return k.instance==null?new k:k.instance}static registerInstance(t,s){k.instances.has(t)&&console.warn("PublisherManager instance already registered with id: ",t),k.instances.set(t,s)}static get(t,s){return k.getInstance().get(t,s)}static collectModifiedPublisher(){k.modifiedCollectore.unshift(new Set)}static getModifiedPublishers(){return k.modifiedCollectore.shift()}static delete(t){return t?k.getInstance().delete(t):!1}async setLocalData(t,s){var i;await this.isLocalStrorageReady,t.set(((i=this.localStorageData[s+"¤lang_"+G.getLanguage()])==null?void 0:i.data)||t.get())}get(t,s){const i=(s==null?void 0:s.localStorageMode)==="enabled";if(!this.publishers.has(t)){const o={},n=new He(o);this.set(t,n)}const e=this.publishers.get(t);return i&&this.initialisedData.indexOf(t)===-1&&(e._is_savable_=!0,this.initialisedData.push(t),this.setLocalData(e,t)),this.publishers.get(t)}set(t,s){this.publishers.set(t,s)}delete(t){return this.publishers.has(t)?(this.publishers.delete(t),!0):!1}async saveToLocalStorage(t=0){if(!(t!==k.saveId&&t%10!=0))try{if(!k.changed||k.saving)return;k.saving=!0,k.changed=!1;const s=Array.from(this.publishers.keys());let i=!1;for(const e of s){const o=this.publishers.get(e);if(!(o!=null&&o._is_savable_))continue;const n=o==null?void 0:o.get();n&&(this.localStorageData[e+"¤lang_"+G.getLanguage()]={lastModifiationMS:new Date().getTime(),data:n},i=!0)}if(i){const e=await this.compress(JSON.stringify(this.localStorageData),"gzip");localStorage.setItem(ei,e)}if(k.saving=!1,k.changed){k.saveId++;const e=k.saveId;setTimeout(()=>this.saveToLocalStorage(e),1e3)}}catch{k.saving=!1}}async compress(t,s){const i=new TextEncoder().encode(t),e=window,o=new e.CompressionStream(s),n=o.writable.getWriter();n.write(i),n.close();const a=await new Response(o.readable).arrayBuffer(),c=new Uint8Array(a);let h="";for(let d=0;d<c.length;d++)h+=String.fromCharCode(c[d]);return btoa(h)}async decompress(t,s){const i=atob(t),o=Uint8Array.from(i,d=>d.charCodeAt(0)).buffer,n=window,a=new n.DecompressionStream(s),c=a.writable.getWriter();c.write(o),c.close();const h=await new Response(a.readable).arrayBuffer();return new TextDecoder().decode(h)}},k.buildDate="Fri Nov 15 2024 11:59:24 GMT+0100 (Central European Standard Time)",k.changed=!1,k.saving=!1,k.saveId=0,k.instance=null,k.instances=new Map,k.modifiedCollectore=[],k);if(typeof window<"u"){const r=window;r[ys+"PublisherManager"]=r[ys+"PublisherManager"]||N}const Eo=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_","_lockInternalMutationPublishing_","_instanceCounter_","_assignmentId_"]);class He extends si{constructor(t,s=null,i){super(t,s,i);const e=new Proxy(this,{get:function(o,n){if(Eo.has(n))return o[n];if(n==Symbol.toPrimitive)return()=>e.get();if(!o._proxies_.has(n)){const a=o._value_[n],c=new He(Ve(a)?a:{__value:a},o,n);c._proxies_.set("_parent_",e),o._proxies_.set(n,c)}return o._proxies_.get(n)},set:function(o,n,a){var h;if(n=="_value_")return o._value_=a,!0;if(n=="_cachedGet_")return o._cachedGet_=a,!0;if(n=="_assignmentId_")return o._assignmentId_=a,!0;if(n=="_is_savable_")return o._is_savable_=a,!0;if(n=="_instanceCounter_")return o._instanceCounter_=a,!0;if(!o._proxies_.has(n)){const d=new He({},o,n);d._proxies_.set("_parent_",e),o._proxies_.set(n,d)}return o._value_[n]!==a&&(o._value_[n]=a,o._publishDynamicFilling_(n,a),(h=o._proxies_.get(n))==null||h.set(Ve(a)?a:{__value:a})),!0},deleteProperty:function(o,n){var a;return o._publishDynamicFilling_(n,null),(a=o._proxies_.get(n))==null||a.set(null),delete o._value_[n]},has:function(o,n){return n in o._value_&&n!="_lockInternalMutationPublishing_"},defineProperty:function(o,n,a){return a&&"value"in a&&(o._value_[n]=a.value),!0},getOwnPropertyDescriptor:function(o,n){return{enumerable:!0,configurable:!0}},ownKeys:function(o){return o._value_.__value?Object.keys(o._value_.__value):Object.keys(o._value_)}});return e}getProperty(t,s){return t[s]}}class No extends HTMLElement{constructor(){super(),this.publisherId="",this.onAssign=t=>{this.innerHTML=t.toString()}}connectedCallback(){var t;this.publisherId=this.getAttribute("publisher")||"",this.publisher=si.instances.get(parseInt(this.publisherId)),(t=this.publisher)==null||t.onAssign(this.onAssign)}disconnectedCallback(){var t;(t=this.publisher)==null||t.offAssign(this.onAssign)}}try{customElements.define(De+"-publisher-proxy",No)}catch{}let ws=(L=class{static disable(){this.enabled&&(this.enabled=!1,Array.from(L.observedElements.keys()).forEach(t=>L.unObserve(t)))}static observe(t){if(!t||!L.enabled||L.observedElements.has(t))return;const s=new MutationObserver(L.onMutation),i={};i.childList=!0,i.subtree=!0,i.attributes=!0,i.attributeFilter=["data-bind"],s.observe(t,i),t.querySelectorAll("[data-bind]").forEach(e=>L.addPublisherListeners(e)),L.observedElements.set(t,s)}static unObserve(t){if(!t)return;const s=this.observedElements.get(t);s&&(s.disconnect(),t.querySelectorAll("[data-bind]").forEach(i=>L.removePublisherListeners(i)))}static onAdded(t){t.hasAttribute&&t.hasAttribute("data-bind")&&L.addPublisherListeners(t),t.querySelectorAll?t.querySelectorAll("[data-bind]").forEach(s=>L.addPublisherListeners(s)):t.childNodes.forEach(s=>L.onAdded(s))}static onRemoved(t){t.hasAttribute&&t.hasAttribute("data-bind")&&L.removePublisherListeners(t),t.querySelectorAll?t.querySelectorAll("[data-bind]").forEach(s=>L.removePublisherListeners(s)):t.childNodes.forEach(s=>L.onRemoved(s))}static onMutation(t){for(const s of t)switch(s.type){case"attributes":L.addPublisherListeners(s.target);break;case"childList":s.addedNodes.forEach(i=>{L.onAdded(i)}),s.removedNodes.forEach(i=>{L.onRemoved(i)});break}}static removePublisherListeners(t){const s=L.publisherListeners.get(t);s&&(L.publisherListeners.delete(t),s.forEach(i=>{var e;(e=i.publisher)==null||e.offAssign(i.onAssign)}))}static getVariablesDescriptor(t){let s=t.match(/(\$(?:\w+\\?\.?)+)/g);return s?s=s.map(i=>i.replace("$","")):s=[t],s=s.filter(i=>i.length>0),{expression:t.replace("\\",""),variables:s.map(i=>i.split(/\b\.\b/).map(e=>e.replace("\\","")))}}static getDataBindItems(t){return"attributes"in t?Array.from(t.attributes).filter(s=>s.name.indexOf("::")==0).map(s=>({propertyToUpdate:s.name.substring(2).replace(/-((html)|\w)/g,e=>e.substring(1).toUpperCase()),bindedVariablesDescriptor:L.getVariablesDescriptor(s.value)})):[]}static getSubPublisher(t,s){if(!s)return t;for(const i of s)if(i!="_self_"){if(!t)return null;t=t[i]}return t}static addPublisherListeners(t){L.removePublisherListeners(t);const s=G.getAncestorAttributeValue(t.parentNode||t.host||t,"dataProvider");if(!s)return;const i=N.getInstance().get(s),e=L.getDataBindItems(t),o=[];e.forEach(n=>{const a=n.bindedVariablesDescriptor,c=n.propertyToUpdate;for(const h of a.variables){const d=h;let p=i;p=L.getSubPublisher(i,d);const m=t,b={publisher:p,onAssign:()=>{const v=a.variables.map(D=>{var u;return(u=L.getSubPublisher(i,D))==null?void 0:u.get()});let P=a.expression,S=!1;if(v.length==1&&a.variables[0].join(".")==P.substring(1)){let D=v[0];D===null&&(D=""),m[c]=D;return}for(let D=0;D<v.length;D++){let u=v[D];const f=a.variables[D];u===null&&(S=!0,u=void 0),P=P.replace("$"+f.join("."),u)}if(P.indexOf("|")!=-1){const D=P.indexOf("|");if(D==0)P=vs.js(P.substring(1));else{const u=P.substring(0,D),f=P.substring(D+1),y=vs[u];P=S?"":y?y(f):P}}else P=S?"":P;m[c]=P}};p==null||p.onAssign(b.onAssign),o.push(b)}}),L.publisherListeners.set(t,o)}},L.observedElements=new Map,L.enabled=!0,L.publisherListeners=new Map,L);ws.observe(document.documentElement),window.SonicDataBindObserver||(window.SonicDataBindObserver=ws);let J=class qt{static shallowEqual(t,s,i=!0){const e=Object.keys(t),o=Object.keys(s);if(e.length!==o.length&&i)return!1;for(const n of e){const a=t[n],c=s[n];if(i?a!==c:a!=c)return!1}return!0}static deepEqual(t,s,i=!0){const e=Object.keys(t),o=Object.keys(s);if(e.length!==o.length&&i)return!1;for(const n of e){const a=t[n],c=s[n],h=qt.isObject(a)&&qt.isObject(c),d=i?a!==c:a!=c;if(h&&!qt.deepEqual(a,c)||!h&&d)return!1}return!0}static isObject(t){return t!=null&&typeof t=="object"}static isUndefindOrNull(t){return t==null}static isEmpty(t){return qt.isUndefindOrNull(t)?!0:Object.keys(t).length===0}static traverse(t,s,i=!1){for(const e of s){const o=t[e];if(o===void 0)return;i&&qt.isObject(o)?t=Object.assign(Array.isArray(o)?[]:{},t,o):t=t[e]}return t}static traverseDotNotation(t,s,i=!1){return qt.traverse(t,s.split("."),i)}static getURLSearchArray(t,s=""){let i=[];for(let e in t){const o=t[e];s&&(e=s+"["+e+"]"),qt.isObject(o)?i=[...i,...this.getURLSearchArray(o,e)]:i.push(`${e}=${o}`)}return i}static getURLSearchString(t){return qt.getURLSearchArray(t,"").join("&")}};const dt=J.traverseDotNotation;/**
|
|
1
|
+
(function(K){typeof define=="function"&&define.amd?define(K):K()})(function(){"use strict";var St,k,L,So,t,G;let K=class Rt{static getLanguage(){const t=document.documentElement.lang;return localStorage.getItem("SonicSelectedLanguage")||t}static getCookies(){return document.cookie.split(";").reduce((t,s)=>{const i=s.indexOf("=");return t[s.substring(0,i).trim()]=s.substring(i+1),t},{})}static everyAncestors(t,s){for(;t;){if(!s(t))return;t=t.parentNode||t.host}}static getScrollableAncestor(t){for(;t;){const s=t;if(s.nodeType===1){const i=window.getComputedStyle(s);if((i==null?void 0:i.overflowY)==="hidden"||(i==null?void 0:i.overflowX)==="hidden")return t}t=t.parentNode||t.host}return null}static getAncestorAttributeValue(t,s){if(!t)return null;for(;!("hasAttribute"in t&&t.hasAttribute(s))&&(t.parentNode||t.host);)t=t.parentNode||t.host;return"hasAttribute"in t?t.getAttribute(s):null}static getApiConfiguration(t){const s=Rt.getAncestorAttributeValue(t,"token"),i=Rt.getAncestorAttributeValue(t,"addHTTPResponse")!=null,e=Rt.getAncestorAttributeValue(t,"serviceURL");let o=null,n=null;const a=Rt.getAncestorAttributeValue(t,"tokenProvider"),c=Rt.getAncestorAttributeValue(t,"eventsApiToken");s||(o=Rt.getAncestorAttributeValue(t,"userName"),n=Rt.getAncestorAttributeValue(t,"password"));const h=Rt.getAncestorAttributeValue(t,"credentials")||void 0,d=t.getAttribute("cache"),p=t.hasAttribute("blockUntilDone");return{serviceURL:e,token:s,userName:o,password:n,authToken:c,tokenProvider:a,addHTTPResponse:i,credentials:h,cache:d,blockUntilDone:p}}static getClosestElement(t,s){for(;!(t.nodeName&&t.nodeName.toLowerCase()===s)&&(t.parentNode||t.host);)t=t.parentNode||t.host;return t.nodeName?t:null}static getClosestForm(t){return Rt.getClosestElement(t,"form")}static async loadJS(t){return new Promise(async i=>{const e=document.createElement("script");e.src=t,e.onload=()=>i(!0),e.onerror=()=>i(!0),document.head.appendChild(e)})}static async loadCSS(t){return new Promise(async i=>{const e=document.createElement("link");e.type="text/css",e.rel="stylesheet",e.href=t,e.onload=()=>i(!0),e.onerror=()=>i(!0),document.head.appendChild(e)})}};const ti=r=>{const t=document.documentElement,s=new MutationObserver(e=>{for(let o of e)o.type==="attributes"&&o.attributeName==="lang"&&r()}),i={attributes:!0,attributeFilter:["lang"]};s.observe(t,i)};let vs=class{static ucFirst(t){return typeof t!="string"?t:t.charAt(0).toUpperCase()+t.substring(1)}static minutesDuration(t,s="",i="long"){s||(s=K.getLanguage());const e=(h,d)=>[Math.floor(h/d),h%d];function o(h,d,p){return new Intl.NumberFormat(h,{style:"unit",unit:d,unitDisplay:p}).format}const[n,a]=e(t,60),c=[];return n&&c.push(o(s,"hour",i)(n)),a&&c.push(o(s,"minute",i)(a)),new Intl.ListFormat(s,{style:"long",type:"conjunction"}).format(c)}static js(t){try{return Function("return "+t)()}catch{return""}}},Lo=class{static async queueTaskPromise(){return new Promise(t=>{window.queueMicrotask(()=>t(null))})}static async delayPromise(t){return new Promise(s=>{setTimeout(s,t)})}},ir="sonic";typeof __SONIC_PREFIX__<"u"&&(ir=__SONIC_PREFIX__);let rr=ir.replace(/-([a-z])/g,r=>r[1].toUpperCase());const ys=rr.charAt(0).toUpperCase()+rr.slice(1);function _s(r){return Object.prototype.hasOwnProperty.call(r,"__value")}function Ve(r){return typeof r=="object"&&r!=null}let De="sonic";typeof __SONIC_PREFIX__>"u"&&(De="sonic"+Math.floor(Math.random()*1e6));const ei=De=="sonic"?"publisher-proxies-data":De+"-publisher-proxies-data";let si=(St=class{constructor(t,s,i){for(this._proxies_=new Map,this._is_savable_=!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_=t,this.parent=s||null,this._parentKey_=i,this.root=this,this._instanceCounter_=0;this.root.parent;)this.root=this.root.parent}delete(){var t;for(const s in this._proxies_.keys())s!="_parent_"&&((t=this._proxies_.get(s))==null||t.delete());this._invalidateListeners_.clear(),this._formInvalidateListeners_.clear(),this._assignListeners_.clear(),this._mutationListeners_.clear(),this._fillListeners_.clear(),this._templateFillListeners_.clear(),this._proxies_.clear(),St.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_(t=!1){if(this._mutationListeners_.forEach(s=>s()),this._is_savable_&&!N.changed){N.changed=!0,N.saveId++;const s=N.saveId;setTimeout(()=>N.getInstance().saveToLocalStorage(s),1e3)}t||this.parent&&this.parent._publishInternalMutation_()}async _publishAssignement_(t=!1){if(this._assignmentId_++,this._assignmentId_!==this._assignmentId_)return;const i=this.get();this._assignListeners_.forEach(e=>{e(i)}),this._publishInternalMutation_(t)}_publishInvalidation_(){this._invalidateListeners_.forEach(t=>t())}_publishFormInvalidation_(){this._formInvalidateListeners_.forEach(t=>t())}_publishDynamicFilling_(t,s){this._fillListeners_.forEach(i=>{i[t]!==s&&(i[t]=s)}),this._publishTemplateFilling_(t,s)}_publishTemplateFilling_(t,s){this._templateFillListeners_.forEach(i=>{const e=Object.getOwnPropertyDescriptor(i,t);e&&!e.set&&!e.writable||(i.propertyMap&&i.propertyMap[t]&&(t=i.propertyMap[t]),typeof i[t]<"u"&&i[t]!==s&&(i[t]=s))})}onAssign(t,s=!0){typeof t=="function"&&(this._assignListeners_.has(t)||(this._assignListeners_.add(t),s&&t(this.get())))}offAssign(t){this._assignListeners_.delete(t)}onInvalidate(t){typeof t=="function"&&this._invalidateListeners_.add(t)}offInvalidate(t){typeof t=="function"&&this._invalidateListeners_.delete(t)}invalidate(){this._publishInvalidation_()}onFormInvalidate(t){typeof t=="function"&&this._formInvalidateListeners_.add(t)}offFormInvalidate(t){typeof t=="function"&&this._formInvalidateListeners_.delete(t)}invalidateForm(){this._publishFormInvalidation_()}onInternalMutation(t){typeof t=="function"&&(this._mutationListeners_.add(t),t())}offInternalMutation(t){typeof t=="function"&&this._mutationListeners_.delete(t)}startTemplateFilling(t){if(this._templateFillListeners_.add(t),typeof this._value_=="object")for(const s in this._value_){let i=s;const e=this._value_[s];t.propertyMap&&t.propertyMap[s]&&(i=t.propertyMap[s]),typeof t[s]<"u"&&t[s]!==e&&(t[i]=e)}}stopTemplateFilling(t){this._templateFillListeners_.delete(t)}startDynamicFilling(t){this._fillListeners_.add(t);for(const s in this._value_){const i=this._value_[s];t[s]!==i&&(t[s]=i)}}stopDynamicFilling(t){this._fillListeners_.delete(t)}set(t,s=!1){var e,o,n;if(this._value_===t||this._value_&&t&&_s(this._value_)&&_s(t)&&this._value_.__value===t.__value)return!0;this._value_=Ve(t)?t:{__value:t},this._cachedGet_=void 0;const i=_s(this._value_);if(this._parentKey_&&this.parent){const a=_s(this._value_)?this._value_.__value:this._value_;if(((e=this.parent)==null?void 0:e.get())==null&&((o=this.parent)==null?void 0:o.get())==null)if(isNaN(Number(this._parentKey_)))this.parent.set({[this._parentKey_]:a});else{const c=[];c[Number(this._parentKey_)]=a,this.parent.set(c)}else this.parent._value_[this._parentKey_]=a}if(i)return this._publishAssignement_(s),this.parent&&this._parentKey_&&this.parent._publishDynamicFilling_(this._parentKey_,this._value_.__value),!0;for(const a in this._value_)this._value_[a]===void 0&&delete this._value_[a];if(this._proxies_.forEach((a,c)=>{const h=this._value_[c];c!="_parent_"&&h===void 0&&h!==null&&isNaN(Number(c))&&(a.set(null),this._publishDynamicFilling_(c,null))}),this._publishAssignement_(),this.parent&&this._parentKey_&&this.parent._publishDynamicFilling_(this._parentKey_,this._value_),Ve(this._value_))for(const a in this._value_){const c=t[a],d=Ve(c)?c:{__value:c};if(!this._proxies_.has(a)){this._publishDynamicFilling_(a,c);continue}(n=this._proxies_.get(a))==null||n.set(d,!0),this._publishDynamicFilling_(a,c)}return!0}get(){if(this._cachedGet_!==void 0)return this._cachedGet_;if(N.modifiedCollectore.length>0&&N.modifiedCollectore[0].add(this),Object.prototype.hasOwnProperty.call(this._value_,"__value")){const t=this._value_.__value;return this._cachedGet_=t??null}return this._cachedGet_=this._value_!=null?this._value_:null}get $tag(){return this._instanceCounter_||(St.instancesCounter++,this._instanceCounter_=St.instancesCounter),St.instances.set(this._instanceCounter_,this),"<"+De+'-publisher-proxy publisher="'+this._instanceCounter_+'"></'+De+"-publisher-proxy>"}},St.instances=new Map,St.instancesCounter=0,St),N=(k=class{constructor(){if(this.enabledLocaStorageProxies=[],this.publishers=new Map,this.localStorageData={},this.isLocalStrorageReady=null,this.initialisedData=[],k.instance!=null)throw"Singleton / use getInstance";k.instance=this,this.isLocalStrorageReady=this.cleanStorageData()}async cleanStorageData(){return new Promise(t=>{(async()=>{try{let i=localStorage.getItem(ei),e=null;if(i&&(e=await this.decompress(i,"gzip")),e)try{this.localStorageData=JSON.parse(e)}catch{this.localStorageData={}}else i=await this.compress("{}","gzip"),localStorage.setItem(ei,i),this.localStorageData={};const o=new Date().getTime()-1e3*60*60*12;for(const n in this.localStorageData)this.localStorageData[n].lastModifiationMS<o&&delete this.localStorageData[n];t(!0)}catch{window.requestAnimationFrame(()=>{t(!1)}),console.warn("no publisher cache in this browser")}})()})}static getInstance(t){if(t){const s=k.instances.get(t);return s||(console.warn("No PublisherManager instance registered with id:",t,"creating new one"),new k)}return k.instance==null?new k:k.instance}static registerInstance(t,s){k.instances.has(t)&&console.warn("PublisherManager instance already registered with id: ",t),k.instances.set(t,s)}static get(t,s){return k.getInstance().get(t,s)}static collectModifiedPublisher(){k.modifiedCollectore.unshift(new Set)}static getModifiedPublishers(){return k.modifiedCollectore.shift()}static delete(t){return t?k.getInstance().delete(t):!1}async setLocalData(t,s){var i;await this.isLocalStrorageReady,t.set(((i=this.localStorageData[s+"¤lang_"+K.getLanguage()])==null?void 0:i.data)||t.get())}get(t,s){const i=(s==null?void 0:s.localStorageMode)==="enabled";if(!this.publishers.has(t)){const o={},n=new He(o);this.set(t,n)}const e=this.publishers.get(t);return i&&this.initialisedData.indexOf(t)===-1&&(e._is_savable_=!0,this.initialisedData.push(t),this.setLocalData(e,t)),this.publishers.get(t)}set(t,s){this.publishers.set(t,s)}delete(t){return this.publishers.has(t)?(this.publishers.delete(t),!0):!1}async saveToLocalStorage(t=0){if(!(t!==k.saveId&&t%10!=0))try{if(!k.changed||k.saving)return;k.saving=!0,k.changed=!1;const s=Array.from(this.publishers.keys());let i=!1;for(const e of s){const o=this.publishers.get(e);if(!(o!=null&&o._is_savable_))continue;const n=o==null?void 0:o.get();n&&(this.localStorageData[e+"¤lang_"+K.getLanguage()]={lastModifiationMS:new Date().getTime(),data:n},i=!0)}if(i){const e=await this.compress(JSON.stringify(this.localStorageData),"gzip");localStorage.setItem(ei,e)}if(k.saving=!1,k.changed){k.saveId++;const e=k.saveId;setTimeout(()=>this.saveToLocalStorage(e),1e3)}}catch{k.saving=!1}}async compress(t,s){const i=new TextEncoder().encode(t),e=window,o=new e.CompressionStream(s),n=o.writable.getWriter();n.write(i),n.close();const a=await new Response(o.readable).arrayBuffer(),c=new Uint8Array(a);let h="";for(let d=0;d<c.length;d++)h+=String.fromCharCode(c[d]);return btoa(h)}async decompress(t,s){const i=atob(t),o=Uint8Array.from(i,d=>d.charCodeAt(0)).buffer,n=window,a=new n.DecompressionStream(s),c=a.writable.getWriter();c.write(o),c.close();const h=await new Response(a.readable).arrayBuffer();return new TextDecoder().decode(h)}},k.buildDate="Fri Nov 15 2024 15:26:12 GMT+0100 (Central European Standard Time)",k.changed=!1,k.saving=!1,k.saveId=0,k.instance=null,k.instances=new Map,k.modifiedCollectore=[],k);if(typeof window<"u"){const r=window;r[ys+"PublisherManager"]=r[ys+"PublisherManager"]||N}const Eo=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_","_lockInternalMutationPublishing_","_instanceCounter_","_assignmentId_"]);class He extends si{constructor(t,s=null,i){super(t,s,i);const e=new Proxy(this,{get:function(o,n){if(Eo.has(n))return o[n];if(n==Symbol.toPrimitive)return()=>e.get();if(!o._proxies_.has(n)){const a=o._value_[n],c=new He(Ve(a)?a:{__value:a},o,n);c._proxies_.set("_parent_",e),o._proxies_.set(n,c)}return o._proxies_.get(n)},set:function(o,n,a){var h;if(n=="_value_")return o._value_=a,!0;if(n=="_cachedGet_")return o._cachedGet_=a,!0;if(n=="_assignmentId_")return o._assignmentId_=a,!0;if(n=="_is_savable_")return o._is_savable_=a,!0;if(n=="_instanceCounter_")return o._instanceCounter_=a,!0;if(!o._proxies_.has(n)){const d=new He({},o,n);d._proxies_.set("_parent_",e),o._proxies_.set(n,d)}return o._value_[n]!==a&&(o._value_[n]=a,o._publishDynamicFilling_(n,a),(h=o._proxies_.get(n))==null||h.set(Ve(a)?a:{__value:a})),!0},deleteProperty:function(o,n){var a;return o._publishDynamicFilling_(n,null),(a=o._proxies_.get(n))==null||a.set(null),delete o._value_[n]},has:function(o,n){return n in o._value_&&n!="_lockInternalMutationPublishing_"},defineProperty:function(o,n,a){return a&&"value"in a&&(o._value_[n]=a.value),!0},getOwnPropertyDescriptor:function(o,n){return{enumerable:!0,configurable:!0}},ownKeys:function(o){return o._value_.__value?Object.keys(o._value_.__value):Object.keys(o._value_)}});return e}getProperty(t,s){return t[s]}}class No extends HTMLElement{constructor(){super(),this.publisherId="",this.onAssign=t=>{this.innerHTML=t.toString()}}connectedCallback(){var t;this.publisherId=this.getAttribute("publisher")||"",this.publisher=si.instances.get(parseInt(this.publisherId)),(t=this.publisher)==null||t.onAssign(this.onAssign)}disconnectedCallback(){var t;(t=this.publisher)==null||t.offAssign(this.onAssign)}}try{customElements.define(De+"-publisher-proxy",No)}catch{}let ws=(L=class{static disable(){this.enabled&&(this.enabled=!1,Array.from(L.observedElements.keys()).forEach(t=>L.unObserve(t)))}static observe(t){if(!t||!L.enabled||L.observedElements.has(t))return;const s=new MutationObserver(L.onMutation),i={};i.childList=!0,i.subtree=!0,i.attributes=!0,i.attributeFilter=["data-bind"],s.observe(t,i),t.querySelectorAll("[data-bind]").forEach(e=>L.addPublisherListeners(e)),L.observedElements.set(t,s)}static unObserve(t){if(!t)return;const s=this.observedElements.get(t);s&&(s.disconnect(),t.querySelectorAll("[data-bind]").forEach(i=>L.removePublisherListeners(i)))}static onAdded(t){t.hasAttribute&&t.hasAttribute("data-bind")&&L.addPublisherListeners(t),t.querySelectorAll?t.querySelectorAll("[data-bind]").forEach(s=>L.addPublisherListeners(s)):t.childNodes.forEach(s=>L.onAdded(s))}static onRemoved(t){t.hasAttribute&&t.hasAttribute("data-bind")&&L.removePublisherListeners(t),t.querySelectorAll?t.querySelectorAll("[data-bind]").forEach(s=>L.removePublisherListeners(s)):t.childNodes.forEach(s=>L.onRemoved(s))}static onMutation(t){for(const s of t)switch(s.type){case"attributes":L.addPublisherListeners(s.target);break;case"childList":s.addedNodes.forEach(i=>{L.onAdded(i)}),s.removedNodes.forEach(i=>{L.onRemoved(i)});break}}static removePublisherListeners(t){const s=L.publisherListeners.get(t);s&&(L.publisherListeners.delete(t),s.forEach(i=>{var e;(e=i.publisher)==null||e.offAssign(i.onAssign)}))}static getVariablesDescriptor(t){let s=t.match(/(\$(?:\w+\\?\.?)+)/g);return s?s=s.map(i=>i.replace("$","")):s=[t],s=s.filter(i=>i.length>0),{expression:t.replace("\\",""),variables:s.map(i=>i.split(/\b\.\b/).map(e=>e.replace("\\","")))}}static getDataBindItems(t){return"attributes"in t?Array.from(t.attributes).filter(s=>s.name.indexOf("::")==0).map(s=>({propertyToUpdate:s.name.substring(2).replace(/-((html)|\w)/g,e=>e.substring(1).toUpperCase()),bindedVariablesDescriptor:L.getVariablesDescriptor(s.value)})):[]}static getSubPublisher(t,s){if(!s)return t;for(const i of s)if(i!="_self_"){if(!t)return null;t=t[i]}return t}static addPublisherListeners(t){L.removePublisherListeners(t);const s=K.getAncestorAttributeValue(t.parentNode||t.host||t,"dataProvider");if(!s)return;const i=N.getInstance().get(s),e=L.getDataBindItems(t),o=[];e.forEach(n=>{const a=n.bindedVariablesDescriptor,c=n.propertyToUpdate;for(const h of a.variables){const d=h;let p=i;p=L.getSubPublisher(i,d);const m=t,b={publisher:p,onAssign:()=>{const v=a.variables.map(D=>{var u;return(u=L.getSubPublisher(i,D))==null?void 0:u.get()});let P=a.expression,S=!1;if(v.length==1&&a.variables[0].join(".")==P.substring(1)){let D=v[0];D===null&&(D=""),m[c]=D;return}for(let D=0;D<v.length;D++){let u=v[D];const f=a.variables[D];u===null&&(S=!0,u=void 0),P=P.replace("$"+f.join("."),u)}if(P.indexOf("|")!=-1){const D=P.indexOf("|");if(D==0)P=vs.js(P.substring(1));else{const u=P.substring(0,D),f=P.substring(D+1),y=vs[u];P=S?"":y?y(f):P}}else P=S?"":P;m[c]=P}};p==null||p.onAssign(b.onAssign),o.push(b)}}),L.publisherListeners.set(t,o)}},L.observedElements=new Map,L.enabled=!0,L.publisherListeners=new Map,L);ws.observe(document.documentElement),window.SonicDataBindObserver||(window.SonicDataBindObserver=ws);let J=class qt{static shallowEqual(t,s,i=!0){const e=Object.keys(t),o=Object.keys(s);if(e.length!==o.length&&i)return!1;for(const n of e){const a=t[n],c=s[n];if(i?a!==c:a!=c)return!1}return!0}static deepEqual(t,s,i=!0){const e=Object.keys(t),o=Object.keys(s);if(e.length!==o.length&&i)return!1;for(const n of e){const a=t[n],c=s[n],h=qt.isObject(a)&&qt.isObject(c),d=i?a!==c:a!=c;if(h&&!qt.deepEqual(a,c)||!h&&d)return!1}return!0}static isObject(t){return t!=null&&typeof t=="object"}static isUndefindOrNull(t){return t==null}static isEmpty(t){return qt.isUndefindOrNull(t)?!0:Object.keys(t).length===0}static traverse(t,s,i=!1){for(const e of s){const o=t[e];if(o===void 0)return;i&&qt.isObject(o)?t=Object.assign(Array.isArray(o)?[]:{},t,o):t=t[e]}return t}static traverseDotNotation(t,s,i=!1){return qt.traverse(t,s.split("."),i)}static getURLSearchArray(t,s=""){let i=[];for(let e in t){const o=t[e];s&&(e=s+"["+e+"]"),qt.isObject(o)?i=[...i,...this.getURLSearchArray(o,e)]:i.push(`${e}=${o}`)}return i}static getURLSearchString(t){return qt.getURLSearchArray(t,"").join("&")}};const dt=J.traverseDotNotation;/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2017 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -56,20 +56,20 @@
|
|
|
56
56
|
* @license
|
|
57
57
|
* Copyright 2017 Google LLC
|
|
58
58
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
59
|
-
*/let _=class extends ke{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var s;const t=super.createRenderRoot();return(s=this.renderOptions).renderBefore??(s.renderBefore=t.firstChild),t}update(t){const s=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=Yo(s,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return vt}};_._$litElement$=!0,_.finalized=!0,(So=globalThis.litElementHydrateSupport)==null||So.call(globalThis,{LitElement:_});const gi=globalThis.litElementPolyfillSupport;gi==null||gi({LitElement:_}),(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.1.1");function Ss(r){if(typeof r=="function"){const t=r;return N.collectModifiedPublisher(),t(),N.getModifiedPublishers()||new Set}if(typeof r=="string"){const t=r.split("."),s=t.shift()||"";let i=N.get(s);i=J.traverse(i,t);const e=new Set;return e.add(i),e}return new Set([r])}class rn extends Sr{constructor(t){var s;super(t),this.observables=new Set,this.onAssign=i=>{this.setValue(i)},this.node=(s=t.options)==null?void 0:s.host}unsubscribe(){this.observables.forEach(t=>t.offAssign(this.onAssign))}render(t){return this.observable!==t&&(this.observable=t,this.isConnected&&this.subscribe(t)),vt}subscribe(t){this.unsubscribe(),typeof t=="function"?this.onAssign=()=>{this.setValue(t())}:this.onAssign=s=>{this.setValue(s)},this.observables=Ss(t),this.observables.forEach(s=>{s.onAssign(this.onAssign)})}disconnected(){this.unsubscribe()}reconnected(){this.observable&&this.subscribe(this.observable)}}const Or=pe(rn),on=Or,nn=Or,an=r=>{var t;return(t=Ss(r).values().next().value)==null?void 0:t.get()},Dr=(r,t)=>{const s=Ss(r).values().next().value;if(t!==void 0&&s){const i=s.get();J.isEmpty(i)&&s.set(t)}return s},ln=Dr,kr=Dr,cn=(r,t)=>{var s;(s=Ss(r).values().next().value)==null||s.set(t)},R=class R{constructor(t){this.addHTTPResponse=!1,this.cache="default",this.isServiceSimulated=!1,this.blockUntilDone=!1,this.serviceURL=t.serviceURL,this.blockUntilDone=t.blockUntilDone||!1,this.serviceURL=="publisher://"&&(this.isServiceSimulated=!0),this.serviceURL||(this.serviceURL=document.location.origin),this.userName=t.userName,this.password=t.password,t.token&&(this.token=t.token),this.tokenProvider=t.tokenProvider,this.authToken=t.authToken,this.addHTTPResponse=t.addHTTPResponse||!1,this.credentials=t.credentials,this.cache=t.cache||"default"}set token(t){if(this._token=t,!t){R.tokens.delete(this.serviceURL);return}R.invalidTokens.includes(t)||R.tokens.set(this.serviceURL,t)}get token(){return R.invalidTokens.includes(this._token)?R.tokens.get(this.serviceURL):this._token}handleInvalidToken(t){t&&(R.invalidTokens.includes(t)||(R.invalidTokens.push(t),this.token=null))}async handleResult(t,s){var a;R.firstCallDoneFlags.set(this.serviceURL,"done"),this.lastResult=t;const i=(a=t.headers.get("content-type"))==null?void 0:a.toLowerCase(),e=t.status;let o={};if(!i||i.indexOf("text/")==0)o={text:await t.text()};else try{o=await t.json()}catch{o={}}this.addHTTPResponse&&J.isObject(o)&&(o._sonic_http_response_=t),e===498&&!R.failledTokenUpdates.has(this.serviceURL)&&(this.handleInvalidToken(this.token),s.apiMethod==="get"?o=await this[s.apiMethod](s.path,s.additionalHeaders):o=await this[s.apiMethod](s.path,s.data,s.method,s.additionalHeaders));const n=N.get("sonic-api");return n.lastResponse={http:t,processed:o},o}async auth(){if(this.token)return;if(R.tokens.has(this.serviceURL)){this.token=R.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});const s=new URL(this.serviceURL),i=s.protocol+"//"+s.host,e=await fetch(this.computeURL(this.tokenProvider,{serviceHost:i}),{headers:t,credentials:this.credentials});try{const o=await e.json();o.token?this.token=o.token:R.failledTokenUpdates.set(this.serviceURL,!0)}catch{R.failledTokenUpdates.set(this.serviceURL,!0)}}async localGet(t,s){var p;const i=N.get(t),e=new URLSearchParams(s.split("?")[1]||""),o=i.get();let n=[];Array.isArray(o)?n=o:n=[o];const a=[];let c=Number.POSITIVE_INFINITY,h=0,d=0;if(e.has("limit")&&(c=parseInt(e.get("limit")||"0"),d++),e.has("offset")&&(h=parseInt(e.get("offset")||"0"),d++),d>0&&(e.delete("limit"),e.delete("offset")),e.size===0)return n.slice(h,h+c);for(const[m,b]of e.entries()){const v=b.split(",").map(P=>P.trim());for(const P of v)for(const S of n)if(typeof S!="object")isNaN(+S)?S.toString().toLowerCase().includes(b.toLowerCase())&&a.push(S):S===b&&a.push(S);else{const D=S;if(!D[m])continue;isNaN(+D[m])?(p=D[m])!=null&&p.toString().toLowerCase().includes(P.toLowerCase())&&a.push(S):D[m]===P&&a.push(S)}}return a.slice(h,h+c)}firstCallDone(){return new Promise(t=>{if(!R.firstCallDoneFlags.has(this.serviceURL))R.firstCallDoneFlags.set(this.serviceURL,"loading"),t(!0);else{const s=()=>{[void 0,"loading"].includes(R.firstCallDoneFlags.get(this.serviceURL))?window.requestAnimationFrame(s):t(!0)};s()}})}async get(t,s){await this.firstCallDone(),this.blockUntilDone&&R.firstCallDoneFlags.set(this.serviceURL,"loading");const i=/dataProvider\((.*?)\)(.*?)$/;if(i.test(t)){const h=t.match(i);if(!h)throw new Error("dataProvider path is not valid");return await this.localGet(h[1],h[2])}const e={apiMethod:"get",path:t,additionalHeaders:s},o=await this.createHeaders(s),n=this.computeURL(t),a=JSON.stringify({url:n,headers:o});if(!R.loadingGetPromises.has(a)){const h=new Promise(async d=>{try{const p=await fetch(n,{headers:o,credentials:this.credentials,cache:this.cache}),m=await this.handleResult(p,e);d(m)}catch{d(null)}});R.loadingGetPromises.set(a,h)}const c=await R.loadingGetPromises.get(a);return R.loadingGetPromises.delete(a),c}async createHeaders(t){await this.auth();const s={};return this.token&&(s.Authorization="Bearer "+this.token),s["Accept-Language"]=
|
|
59
|
+
*/let _=class extends ke{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var s;const t=super.createRenderRoot();return(s=this.renderOptions).renderBefore??(s.renderBefore=t.firstChild),t}update(t){const s=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=Yo(s,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return vt}};_._$litElement$=!0,_.finalized=!0,(So=globalThis.litElementHydrateSupport)==null||So.call(globalThis,{LitElement:_});const gi=globalThis.litElementPolyfillSupport;gi==null||gi({LitElement:_}),(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.1.1");function Ss(r){if(typeof r=="function"){const t=r;return N.collectModifiedPublisher(),t(),N.getModifiedPublishers()||new Set}if(typeof r=="string"){const t=r.split("."),s=t.shift()||"";let i=N.get(s);i=J.traverse(i,t);const e=new Set;return e.add(i),e}return new Set([r])}class rn extends Sr{constructor(t){var s;super(t),this.observables=new Set,this.onAssign=i=>{this.setValue(i)},this.node=(s=t.options)==null?void 0:s.host}unsubscribe(){this.observables.forEach(t=>t.offAssign(this.onAssign))}render(t){return this.observable!==t&&(this.observable=t,this.isConnected&&this.subscribe(t)),vt}subscribe(t){this.unsubscribe(),typeof t=="function"?this.onAssign=()=>{this.setValue(t())}:this.onAssign=s=>{this.setValue(s)},this.observables=Ss(t),this.observables.forEach(s=>{s.onAssign(this.onAssign)})}disconnected(){this.unsubscribe()}reconnected(){this.observable&&this.subscribe(this.observable)}}const Or=pe(rn),on=Or,nn=Or,an=r=>{var t;return(t=Ss(r).values().next().value)==null?void 0:t.get()},Dr=(r,t)=>{const s=Ss(r).values().next().value;if(t!==void 0&&s){const i=s.get();J.isEmpty(i)&&s.set(t)}return s},ln=Dr,kr=Dr,cn=(r,t)=>{var s;(s=Ss(r).values().next().value)==null||s.set(t)},R=class R{constructor(t){this.addHTTPResponse=!1,this.cache="default",this.isServiceSimulated=!1,this.blockUntilDone=!1,this.serviceURL=t.serviceURL,this.blockUntilDone=t.blockUntilDone||!1,this.serviceURL=="publisher://"&&(this.isServiceSimulated=!0),this.serviceURL||(this.serviceURL=document.location.origin),this.userName=t.userName,this.password=t.password,t.token&&(this.token=t.token),this.tokenProvider=t.tokenProvider,this.authToken=t.authToken,this.addHTTPResponse=t.addHTTPResponse||!1,this.credentials=t.credentials,this.cache=t.cache||"default"}set token(t){if(this._token=t,!t){R.tokens.delete(this.serviceURL);return}R.invalidTokens.includes(t)||R.tokens.set(this.serviceURL,t)}get token(){return R.invalidTokens.includes(this._token)?R.tokens.get(this.serviceURL):this._token}handleInvalidToken(t){t&&(R.invalidTokens.includes(t)||(R.invalidTokens.push(t),this.token=null))}async handleResult(t,s){var a;R.firstCallDoneFlags.set(this.serviceURL,"done"),this.lastResult=t;const i=(a=t.headers.get("content-type"))==null?void 0:a.toLowerCase(),e=t.status;let o={};if(!i||i.indexOf("text/")==0)o={text:await t.text()};else try{o=await t.json()}catch{o={}}this.addHTTPResponse&&J.isObject(o)&&(o._sonic_http_response_=t),e===498&&!R.failledTokenUpdates.has(this.serviceURL)&&(this.handleInvalidToken(this.token),s.apiMethod==="get"?o=await this[s.apiMethod](s.path,s.additionalHeaders):o=await this[s.apiMethod](s.path,s.data,s.method,s.additionalHeaders));const n=N.get("sonic-api");return n.lastResponse={http:t,processed:o},o}async auth(){if(this.token)return;if(R.tokens.has(this.serviceURL)){this.token=R.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});const s=new URL(this.serviceURL),i=s.protocol+"//"+s.host,e=await fetch(this.computeURL(this.tokenProvider,{serviceHost:i}),{headers:t,credentials:this.credentials});try{const o=await e.json();o.token?this.token=o.token:R.failledTokenUpdates.set(this.serviceURL,!0)}catch{R.failledTokenUpdates.set(this.serviceURL,!0)}}async localGet(t,s){var p;const i=N.get(t),e=new URLSearchParams(s.split("?")[1]||""),o=i.get();let n=[];Array.isArray(o)?n=o:n=[o];const a=[];let c=Number.POSITIVE_INFINITY,h=0,d=0;if(e.has("limit")&&(c=parseInt(e.get("limit")||"0"),d++),e.has("offset")&&(h=parseInt(e.get("offset")||"0"),d++),d>0&&(e.delete("limit"),e.delete("offset")),e.size===0)return n.slice(h,h+c);for(const[m,b]of e.entries()){const v=b.split(",").map(P=>P.trim());for(const P of v)for(const S of n)if(typeof S!="object")isNaN(+S)?S.toString().toLowerCase().includes(b.toLowerCase())&&a.push(S):S===b&&a.push(S);else{const D=S;if(!D[m])continue;isNaN(+D[m])?(p=D[m])!=null&&p.toString().toLowerCase().includes(P.toLowerCase())&&a.push(S):D[m]===P&&a.push(S)}}return a.slice(h,h+c)}firstCallDone(){return new Promise(t=>{if(!R.firstCallDoneFlags.has(this.serviceURL))R.firstCallDoneFlags.set(this.serviceURL,"loading"),t(!0);else{const s=()=>{[void 0,"loading"].includes(R.firstCallDoneFlags.get(this.serviceURL))?window.requestAnimationFrame(s):t(!0)};s()}})}async get(t,s){await this.firstCallDone(),this.blockUntilDone&&R.firstCallDoneFlags.set(this.serviceURL,"loading");const i=/dataProvider\((.*?)\)(.*?)$/;if(i.test(t)){const h=t.match(i);if(!h)throw new Error("dataProvider path is not valid");return await this.localGet(h[1],h[2])}const e={apiMethod:"get",path:t,additionalHeaders:s},o=await this.createHeaders(s),n=this.computeURL(t),a=JSON.stringify({url:n,headers:o});if(!R.loadingGetPromises.has(a)){const h=new Promise(async d=>{try{const p=await fetch(n,{headers:o,credentials:this.credentials,cache:this.cache}),m=await this.handleResult(p,e);d(m)}catch{d(null)}});R.loadingGetPromises.set(a,h)}const c=await R.loadingGetPromises.get(a);return R.loadingGetPromises.delete(a),c}async createHeaders(t){await this.auth();const s={};return this.token&&(s.Authorization="Bearer "+this.token),s["Accept-Language"]=K.getLanguage(),t&&Object.assign(s,t),s}computeURL(t,s={}){let i="";t.startsWith("http")?i=t:i=this.serviceURL+"/"+t,i.startsWith("http")||(i=window.location.origin+i);const e=new URL(i);for(const o in s)e.searchParams.set(o,s[o]);return e.toString().replace(/([^(https?:)])\/{2,}/g,"$1/")}async send(t,s,i="POST",e){const o={apiMethod:"send",path:t,additionalHeaders:e,method:i,data:s},n=await this.createHeaders(e);n.Accept="application/json",n["Content-Type"]="application/json";const a=await fetch(this.computeURL(t),{headers:n,credentials:this.credentials,method:i,body:JSON.stringify(s)});return await this.handleResult(a,o)}async submitFormData(t,s,i="POST",e){const o={apiMethod:"submitFormData",path:t,additionalHeaders:e,method:i,data:s},n=await this.createHeaders(e);n.Accept="application/json";const a=new FormData,c=s;for(const d in c)a.set(d,c[d]);const h=await fetch(this.computeURL(t),{headers:n,credentials:this.credentials,method:i,body:a});return await this.handleResult(h,o)}async put(t,s,i){return this.send(t,s,"PUT",i)}async post(t,s,i){return this.send(t,s,"POST",i)}async patch(t,s,i){return this.send(t,s,"PATCH",i)}async delete(t,s,i){return this.send(t,s,"delete",i)}};R.loadingGetPromises=new Map,R.tokens=new Map,R.invalidTokens=[],R.failledTokenUpdates=new Map,R.firstCallDoneFlags=new Map;let Ne=R;K.getApiConfiguration(document.body||document.documentElement);/**
|
|
60
60
|
* @license
|
|
61
61
|
* Copyright 2017 Google LLC
|
|
62
62
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
63
|
-
*/let mi=class extends Ee{constructor(t){if(super(t),this.it=A,t.type!==Le.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===A||t==null)return this._t=void 0,this.it=t;if(t===vt)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const s=[t];return s.raw=s,this._t={_$litType$:this.constructor.resultType,strings:s,values:[]}}};mi.directiveName="unsafeHTML",mi.resultType=1;const F=pe(mi),bi=new Map,Lr=r=>{if(!r)return null;const t=
|
|
63
|
+
*/let mi=class extends Ee{constructor(t){if(super(t),this.it=A,t.type!==Le.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===A||t==null)return this._t=void 0,this.it=t;if(t===vt)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const s=[t];return s.raw=s,this._t={_$litType$:this.constructor.resultType,strings:s,values:[]}}};mi.directiveName="unsafeHTML",mi.resultType=1;const F=pe(mi),bi=new Map,Lr=r=>{if(!r)return null;const t=K.getApiConfiguration(r),s=K.getAncestorAttributeValue(r,"wordingProvider"),i=K.getAncestorAttributeValue(r,"wordingVersionProvider"),e={apiConfiguration:t,wordingProvider:s,wordingVersionProvider:i};let o=null;for(const[n,a]of bi)if(J.deepEqual(n,e)){o=a;break}return o||(o={api:new Ne(t),keysToTranslate:new Set,translatedKeys:new Set,wordingProvider:s,callIndex:0,wordingVersionProvider:i,apiCallKey:e},bi.set(e,o)),o},Er="",H=class H extends Sr{constructor(t){super(t),this.useUnsafeHTML=!1,this.onAssign=s=>{const i=this.useUnsafeHTML?F(s):s;this.setValue(i)},this.node=t.options.host}unsubscribe(){H.publisher["wording_"+this.key].offAssign(this.onAssign)}render(t,s=!1){return this.useUnsafeHTML=s,this.key!==t&&(this.key=t,this.isConnected&&this.subscribe(t)),vt}static async callApi(t,s,i=!0,e){if(await N.getInstance().isLocalStrorageReady,H.firstCall){H.firstCall=!1,ti(H.reloadWordings);const d=Object.keys(H.publisher.get());for(const p of d)H.publisher.get()[p]===Er&&delete H.publisher[p]}if(t){const d=K.getAncestorAttributeValue(t,"wordingVersionProvider");d&&kr(d).onAssign(H.handleVersionProvider(t))}let o=H.publisher.get()["wording_"+s]!=null;const n=e||Lr(t);if(!n)return;if(o&&s!==""){n.translatedKeys.add(s);return}n.callIndex++;const a=n.callIndex,c=n.wordingProvider??"";if(!c&&i){window.setTimeout(async()=>{H.callApi(null,s,!1,n)},1e3);return}const h=n.api;window.queueMicrotask(async()=>{if(o=H.publisher["wording_"+s].get()!=null,!o&&s!==""&&(n.keysToTranslate.add(s),H.publisher["wording_"+s]=Er),a!==n.callIndex)return;const d=Array.from(n.keysToTranslate);if(!d.length)return;const p=c.split("?"),m=p.shift(),b=(p.length>0?p.join("?")+"&":"")+"labels[]="+d.join("&labels[]="),v=m+"?"+b;n.translatedKeys=new Set([...n.translatedKeys,...n.keysToTranslate]),n.keysToTranslate.clear();const P=await h.get(v);for(const S in P)H.publisher["wording_"+S]=P[S]})}static reloadWordings(){for(const t of bi.values())t.keysToTranslate=new Set(t.translatedKeys),t.keysToTranslate.size>0&&H.callApi(null,"",!1,t)}static handleVersionProvider(t){const s=Lr(t),i=o=>{};if(!s)return i;if(H.versionProviderHandlers.has(s))return H.versionProviderHandlers.get(s)||i;const e=function(o){if(!s.wordingVersionProvider)return;const a=H.publisher.get().__wording_versions__??[];if(o==null)return;const c=a.find(h=>h.serviceURL===s.api.serviceURL)||{serviceURL:s.api.serviceURL,version:0};a.includes(c)||a.push(c),o!==c.version&&(c.version=o,H.publisher.set({__wording_versions__:a}),H.reloadWordings())};return H.versionProviderHandlers.set(s,e),e}subscribe(t){this.unsubscribe(),H.publisher["wording_"+t].onAssign(this.onAssign),H.callApi(this.node,t)}disconnected(){this.unsubscribe()}reconnected(){this.key&&this.subscribe(this.key)}};H.publisher=N.get("sonic-wording",{localStorageMode:"enabled"}),H.firstCall=!0,H.versionProviderHandlers=new Map;let Te=H;const hn=pe(Te);var dn=Object.defineProperty,pn=Object.getOwnPropertyDescriptor,Dt=(r,t,s,i)=>{for(var e=i>1?void 0:i?pn(t,s):t,o=r.length-1,n;o>=0;o--)(n=r[o])&&(e=(i?n(t,s,e):n(e))||e);return i&&e&&dn(t,s,e),e};let Os=!1,vi=new Set;const Q=(r,t)=>{var e;const s=(e=class extends r{constructor(...n){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=a=>{this.props=a}}hasAncestorAttribute(n){return this.getAncestorAttributeValue(n)!=null}getAncestorAttributeValue(n){return K.getAncestorAttributeValue(this,n)}get props(){return this._props!==null||!this.publisher?this._props:this.publisher.get()}set props(n){typeof n=="string"&&["{","["].includes(n.trim().charAt(0))&&(n=JSON.parse(n)),n!=this._props&&(this._props=n,this.publisher&&this.publisher.get()!=n&&this.publisher.set(n),this.requestUpdate())}updated(n){super.updated(n);const c=[...(this.shadowRoot||this).children].filter(d=>d.tagName!="STYLE"),h=this.displayContents?"contents":c.length==0?"none":null;h?this.style.display=h:this.style.removeProperty("display")}connectedCallback(){if(e.instanceCounter++,this.hasAttribute("lazyRendering")){const n={root:null,threshold:.9};let a=!0;const c=new IntersectionObserver(h=>{for(const d of h)if(a&&d.isIntersecting){a=!1,c.disconnect(),this.initWording(),this.shouldRenderLazy=!1,this.startPublisher();break}},n);c.observe(this)}else this.initWording(),this.shouldRenderLazy=!1;this.initPublisher(),this.addDebugger(),super.connectedCallback()}disconnectedCallback(){var n;this.removeDebugger(),super.disconnectedCallback(),this.publisher&&(this.publisher.stopTemplateFilling(this),this.publisher.offInternalMutation(this.requestUpdate)),Te.publisher.stopTemplateFilling(this),this.onAssign&&((n=this.publisher)==null||n.offAssign(this.onAssign))}addDebugger(){var n;if(this.hasAttribute("debug")&&!this.defferedDebug){if(!this.debug){this.debug=document.createElement("div");const a=this.debug.style;a.position="fixed",a.top="0",a.right="0",a.margin="auto",a.borderRadius=".7rem",a.backgroundColor="#0f1729",a.color="#c5d4f9",a.padding="16px 16px",a.margin="16px 16px",a.boxShadow="0 10px 30px -18px rgba(0,0,0,.3)",a.overflowY="auto",a.zIndex="99999999",a.maxHeight="calc(100vh - 32px)",a.fontFamily="Consolas, monospace",a.maxWidth="min(50vw,25rem)",a.fontSize="12px",a.minWidth="300px",a.overflowWrap="break-word",a.resize="vertical"}this.addEventListener("click",a=>{a.ctrlKey&&(a.preventDefault(),Os=!Os)}),this.dataProvider&&(window[this.dataProvider]=this.publisher),this.addEventListener("mouseover",()=>{Os||this.removeDebugger(),document.body.appendChild(this.debug),vi.add(this.debug)}),this.addEventListener("mouseout",()=>{Os||this.removeDebugger()}),(n=this.publisher)==null||n.onInternalMutation(()=>{var a;this.debug.innerHTML=`🤖 DataProvider : "<b style="font-weight:bold;color:#fff;">${this.dataProvider}</b>"<br>
|
|
64
64
|
<div style="font-size:10px;border-top:1px dashed;margin-top:5px;padding-left:23px;opacity:.6;padding-top:5px;">
|
|
65
65
|
Variable disponible dans la console<br>
|
|
66
66
|
ctrl + Clique : épingler / désépingler
|
|
67
67
|
</div>
|
|
68
|
-
<pre style="margin-top:10px;background:transparent;padding:0;font-size:inherit;color:inherit;">${JSON.stringify((a=this.publisher)==null?void 0:a.get(),null," ")}</pre>`})}}removeDebugger(){vi.forEach(n=>{document.body.contains(n)&&document.body.removeChild(n)}),vi=new Set}getApiConfiguration(){return
|
|
68
|
+
<pre style="margin-top:10px;background:transparent;padding:0;font-size:inherit;color:inherit;">${JSON.stringify((a=this.publisher)==null?void 0:a.get(),null," ")}</pre>`})}}removeDebugger(){vi.forEach(n=>{document.body.contains(n)&&document.body.removeChild(n)}),vi=new Set}getApiConfiguration(){return K.getApiConfiguration(this)}async initWording(){const n=Object.getOwnPropertyNames(this.constructor.prototype);for(const a of n)a.indexOf("wording_")==0&&Te.callApi(this,a.substring(8));Te.publisher.startTemplateFilling(this)}createRenderRoot(){if(this.noShadowDom===""||this.getAttribute("noShadowDom")==="")return this;const n=super.createRenderRoot();return ws.observe(n),n}initPublisher(){if(!document)return;this.publisher&&(this.publisher.stopTemplateFilling(this),this.publisher.offInternalMutation(this.requestUpdate),this.onAssign&&this.publisher.offAssign(this.onAssign));const n=N.getInstance();this.dataProvider||(this.dataProvider=this.getAncestorAttributeValue("dataProvider"));let a=this.dataProvider;if(!a&&this._props&&(this.dataProvider=a="__subscriber__"+e.instanceCounter),a){this.bindPublisher&&n.set(a,this.bindPublisher());let c=n.get(a,{localStorageMode:this.getAttribute("localStorage")||"disabled"});if(this.dataProvider=a,this.hasAttribute("subDataProvider")){const h=this.getAttribute("subDataProvider");this.dataProvider=a+"/"+h,c=J.traverse(c,h.split(".")),n.set(this.dataProvider,c),this.publisher=c}this.publisher=c}this.hasAttribute("lazyRendering")||this.startPublisher()}startPublisher(){this.publisher&&(this._props&&this.publisher.set(this._props),this.noAutoFill||this.publisher.startTemplateFilling(this),this.renderOnPropsInternalChange&&this.publisher.onInternalMutation(this.requestUpdate),this.publisher.onAssign(this.onAssign))}},e.instanceCounter=0,e);return Dt([l({type:Number})],s.prototype,"collectDependenciesVersion",2),Dt([l({type:Boolean})],s.prototype,"displayContents",2),Dt([l({type:Boolean})],s.prototype,"noAutoFill",2),Dt([l({type:Boolean})],s.prototype,"forceAutoFill",2),Dt([l({type:Object})],s.prototype,"propertyMap",2),Dt([l({type:String,attribute:"data-title"})],s.prototype,"title",2),Dt([l({reflect:!0})],s.prototype,"dataProvider",2),Dt([l()],s.prototype,"bindPublisher",2),Dt([l()],s.prototype,"props",1),Dt([T()],s.prototype,"shouldRenderLazy",2),s};var un=Object.defineProperty,fn=(r,t,s,i)=>{for(var e=void 0,o=r.length-1,n;o>=0;o--)(n=r[o])&&(e=n(t,s,e)||e);return e&&un(t,s,e),e};const Xe=r=>{class t extends r{constructor(){super(...arguments),this.templates=null,this.templateValueAttribute="data-value",this.templateList=[],this.templateParts={},this.templatePartsList=[]}connectedCallback(){const i=this.templates||[...this.querySelectorAll("template")];for(const e of i)e.hasAttribute(this.templateValueAttribute)&&(this.templateParts[e.getAttribute(this.templateValueAttribute)]=e,this.templatePartsList.push(e)),e.hasAttribute("skeleton")&&(this.templateParts.skeleton=e),e.hasAttribute("no-result")&&(this.templateParts["no-result"]=e),e.hasAttribute("no-item")&&(this.templateParts["no-item"]=e);this.templateList=i.filter(e=>!e.getAttribute("data-value")),this.templateList.length==0&&(this.templateList=i),super.connectedCallback()}}return fn([l({type:Array})],t.prototype,"templates"),t};var gn=Object.defineProperty,mn=Object.getOwnPropertyDescriptor,Y=(r,t,s,i)=>{for(var e=i>1?void 0:i?mn(t,s):t,o=r.length-1,n;o>=0;o--)(n=r[o])&&(e=(i?n(t,s,e):n(e))||e);return i&&e&&gn(t,s,e),e};const bn="sonic-date";ti(()=>z.updateComponentsLanguage());let z=class extends Q(Xe(_)){constructor(){super(...arguments),this.pageLanguage="fr",this.duAu=[],this._wording_billet_periode_validite="",this.designMode=null,this.time_zone=null,this.date=null,this.date_string=null,this.start_date_string=null,this.end_date_string=null,this.start_date=0,this.hide_hours=!1,this.end_date=0,this.era="",this.year="numeric",this.month="short",this.day="2-digit",this.weekday="short",this.hour="2-digit",this.hour12=!1,this.minute="2-digit",this.language="",this.renderIf=!0,this.now=!1,this.startDateObject=new Date,this.endDateObject=new Date}static updateComponentsLanguage(){z.dateCompnents.forEach(r=>r.pageLanguage=K.getLanguage())}get wording_billet_periode_validite(){return this._wording_billet_periode_validite}set wording_billet_periode_validite(r){var t;r||(r="Du %s au %s"),this._wording_billet_periode_validite=r,this.duAu=(t=this.wording_billet_periode_validite)==null?void 0:t.split("%s").map(s=>s.trim()),this.duAu.pop(),this.requestUpdate()}connectedCallback(){this.hasAttribute("wording_billet_periode_validite")||(this.wording_billet_periode_validite="Du %s au %s"),this.pageLanguage=K.getLanguage(),z.dateCompnents.add(this),super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback(),z.dateCompnents.delete(this)}getDatesParts(r,t,s){const i=this.startDateObject;i.setTime(r*1e3);let e=[];if(t>0){const o=this.endDateObject;o.setTime(t*1e3);const n=i.toDateString()==o.toDateString();if((!n||this.hide_hours)&&(delete s.hour,delete s.minute),e=new Intl.DateTimeFormat(this.language||this.pageLanguage,s).formatRangeToParts(i,o),!n){const c=e.find(h=>h.type=="literal"&&h.source=="shared"&&h.value.trim().length>0);c&&(c.value=" "+this.duAu[1]+" ",c.type="to"),this.designMode||e.unshift({type:"from",value:this.duAu[0]+" ",source:"shared"})}}else e=new Intl.DateTimeFormat(this.language||this.pageLanguage,s).formatToParts(i);return this.designMode&&e.forEach(o=>o.value=o.value.replace(/,/g," ")),e[0].value=vs.ucFirst(e[0].value),e.filter(o=>o.hidden!==!0)}dateStringToSeconds(r){return new Date(r).getTime()/1e3}willUpdate(r){if(this.date_string&&(this.date=this.dateStringToSeconds(this.date_string)),this.date&&(this.start_date=this.date),this.start_date_string&&(this.start_date=this.dateStringToSeconds(this.start_date_string)),this.end_date_string&&(this.end_date=this.dateStringToSeconds(this.end_date_string)),!(!this.start_date&&!this.now&&!this.end_date)&&(this.start_date||(this.start_date=Date.now()/1e3),this.end_date>0&&this.end_date<this.start_date)){const t=this.start_date;this.start_date=this.end_date,this.end_date=t}}render(){if(!this.renderIf||!this.start_date&&!this.now&&!this.end_date)return A;const r={year:this.year||"numeric",month:this.month||"short",day:this.day||"2-digit",hour12:this.hour12||!1};this.weekday!=="hidden"&&(r.weekday=this.weekday||"short"),this.hour!=="hidden"&&(r.hour=this.hour||"2-digit"),this.minute!=="hidden"&&(r.minute=this.minute||"2-digit"),this.era&&(r.era=this.era),this.time_zone&&(r.timeZone=this.time_zone);const t=this.getDatesParts(this.start_date,this.end_date,r);return F(`${t.map(s=>{const i=this.templateParts[s.type];if(i){const n=document.importNode(i.content,!0).children[0];return n.innerText.trim()==""&&(n.innerText=s.value),n.outerHTML}const e=document.createElement("span");return e.innerText=s.value,e.className=s.type,`<span class="${s.type}">${s.value}</span>`}).join("")}`)}};z.dateCompnents=new Set,Y([l()],z.prototype,"wording_billet_periode_validite",1),Y([l({type:Boolean})],z.prototype,"designMode",2),Y([l({type:String})],z.prototype,"time_zone",2),Y([l({type:Number})],z.prototype,"date",2),Y([l({type:String})],z.prototype,"date_string",2),Y([l({type:String})],z.prototype,"start_date_string",2),Y([l({type:String})],z.prototype,"end_date_string",2),Y([l({type:Number})],z.prototype,"start_date",2),Y([l({type:Boolean})],z.prototype,"hide_hours",2),Y([l({type:Number})],z.prototype,"end_date",2),Y([l({type:String})],z.prototype,"era",2),Y([l({type:String})],z.prototype,"year",2),Y([l({type:String})],z.prototype,"month",2),Y([l({type:String})],z.prototype,"day",2),Y([l({type:String})],z.prototype,"weekday",2),Y([l({type:String})],z.prototype,"hour",2),Y([l({type:Boolean})],z.prototype,"hour12",2),Y([l({type:String})],z.prototype,"minute",2),Y([l({type:String})],z.prototype,"language",2),Y([l({type:Boolean})],z.prototype,"renderIf",2),Y([l({type:Boolean})],z.prototype,"now",2),z=Y([w(bn)],z);let ot=(G=class{static listen(){var s;if(!G.listening)return;const t=(s=document.location)==null?void 0:s.href.replace(document.location.origin,"");G.prevURL&&G.prevURL!=t&&(G.prevURL=t,G.listeners.forEach(i=>{i.location=t})),window.requestAnimationFrame(G.listen)}static offChange(t){const s=G.listeners.indexOf(t);s!=-1&&(G.listeners.splice(s,1),G.listeners.length==0&&(G.listening=!1))}static onChange(t){G.listening||(G.listening=!0,G.listen()),G.listeners.push(t),t.location=this.prevURL}static changeFromComponent(t){var h;const s=t.goBack,i=document.referrer;if(s!=null){const d=document.location.origin,p=(s||d).toString(),b=i.indexOf("http")==0?new URL(i).origin!=d:!1,v=i=="",P=history.length<3,S=v&&P,D=p!=document.location.href;if(b&&D||S){const f=history.state||{};f.concorde=f.concorde||{},f.concorde.hasDoneHistoryBack=!0,history.pushState(f,document.title),history.back(),document.location.replace(p)}else history.back();return}let e=t.getAttribute("to")||"";if(e||(e=((h=t.href)==null?void 0:h.toString())||""),!e)return;if(e.indexOf("#")==0){document.location.hash=e.substring(1);return}const o=new URL(e,document.location.href),n=o.pathname.split("/"),a=[];let c="";for(const d of n)d!=c&&a.push(d),c=d;e="/"+a.join("/")+o.search+(o.hash?+o.hash:""),t.hasAttribute("pushState")?history.pushState(null,"",e):t.hasAttribute("replaceState")?history.replaceState(null,"",e):document.location.href=e}static updateComponentActiveState(t){var i;if(t.autoActive=="disabled")return;const s=((i=t.href)==null?void 0:i.toString())||"";if(t.href&&s.indexOf("http")!=0){const e=new URL(s,document.location.href),o=new URL(t.location||"",document.location.origin);let n=!1;t.autoActive=="strict"?n=e.pathname==o.pathname&&e.hash==o.hash&&e.search==o.search:n=o.href.indexOf(e.href)==0,n?t.setAttribute("active","true"):t.removeAttribute("active")}}},G.listeners=[],G.listening=!1,G.prevURL=(t=document.location)==null?void 0:t.href.replace(document.location.origin,""),G);/**
|
|
69
69
|
* @license
|
|
70
70
|
* Copyright 2018 Google LLC
|
|
71
71
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
72
|
-
*/const Nr="important",vn=" !"+Nr,ft=pe(class extends Ee{constructor(r){var t;if(super(r),r.type!==Le.ATTRIBUTE||r.name!=="style"||((t=r.strings)==null?void 0:t.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(r){return Object.keys(r).reduce((t,s)=>{const i=r[s];return i==null?t:t+`${s=s.includes("-")?s:s.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`},"")}update(r,[t]){const{style:s}=r.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(t)),this.render(t);for(const i of this.ft)t[i]==null&&(this.ft.delete(i),i.includes("-")?s.removeProperty(i):s[i]=null);for(const i in t){const e=t[i];if(e!=null){this.ft.add(i);const o=typeof e=="string"&&e.endsWith(vn);i.includes("-")||o?s.setProperty(i,o?e.slice(0,-11):e,o?Nr:""):s[i]=e}}return vt}});var yn=Object.defineProperty,_n=Object.getOwnPropertyDescriptor,kt=(r,t,s,i)=>{for(var e=i>1?void 0:i?_n(t,s):t,o=r.length-1,n;o>=0;o--)(n=r[o])&&(e=(i?n(t,s,e):n(e))||e);return i&&e&&yn(t,s,e),e};const Ds=new Map,Me=r=>{class t extends r{constructor(...i){super(),this.touched=!1,this.error=!1,this.autofocus=!1,this.required=!1,this.forceAutoFill=!1,this.disabled=null,this.formDataProvider="",this._name="",this._value="",this.onValueAssign=e=>{this.setValueFromPublisher(e)},this.onFormValueAssign=async e=>{this.setFormValueFromPublisher(e)},this.onFormDataInValidate=()=>{const e=this.getFormPublisher();e&&e.isFormValid.get()&&this.validateFormElement()}}get name(){return this._name}set name(i){this.hasAttribute("name")&&!this.forceAutoFill&&(i=this.getAttribute("name")),this._name=i,this.requestUpdate()}validateFormElement(){}updateDataValue(){this.getAttribute("name")&&this.getFormPublisher()&&(this.setFormPublisherValue(this.getValueForFormPublisher()),this.setFormValueFromPublisher(this.getFormPublisherValue()))}getFormPublisher(){return this.formDataProvider||(this.formDataProvider=this.getAncestorAttributeValue("formDataProvider")),this.formDataProvider?N.get(this.formDataProvider):null}setFormPublisherValue(i){const e=this.getFormPublisher();e&&dt(e,this.name).set(i)}getFormPublisherValue(){const i=this.getFormPublisher();return i?dt(i,this.name).get():null}getValueForFormPublisher(){return this.value}setValueFromPublisher(i){this.value=i}setFormValueFromPublisher(i){this.value=i}get value(){return this._value}set value(i){i==null&&(i=""),J.isObject(i)&&Object.prototype.hasOwnProperty.call(i,"__value")&&i._value==null&&(i=""),this._value!=i&&(this._value=i,this.updateDataValue(),this.requestUpdate())}initPublisher(){let i=this.getFormPublisher();const e=this.hasAncestorAttribute("initFromPublisher")&&this._name&&this.getFormPublisherValue()?this.getFormPublisherValue():this.getAttribute("value");this._name&&this.publisher&&dt(this.publisher,this._name).offAssign(this.onValueAssign),this._name&&i&&dt(i,this._name).offAssign(this.onFormValueAssign),super.initPublisher(),this.name||(this._name=this.getAttribute("name")),this.value||(this._value=this.getAttribute("value")),this.publisher&&this._name&&dt(this.publisher,this._name).onAssign(this.onValueAssign),i=this.getFormPublisher(),this._name&&i&&(dt(i,this._name).onAssign(this.onFormValueAssign),i.onFormInvalidate(this.onFormDataInValidate)),this.updateDataValue(),e&&(this.value=e)}handleBlur(){this.touched=!0}handleChange(i){this.value=i.target.value;const e=new Event("change");this.dispatchEvent(e)}addKeyboardNavigation(){const i=this.getAncestorAttributeValue("data-keyboard-nav");if(!i)return;const e=i.split(" "),o=e[0];if(!o)return;for(const a of e){Ds.has(a)||Ds.set(a,[]);const c=Ds.get(a);(c==null?void 0:c.indexOf(this))==-1&&c.push(this)}const n=Ds.get(o);this.addEventListener("keydown",a=>{var b;const c=a;if(!["ArrowDown","ArrowUp"].includes(c.key))return;const h="input:not([disabled]), button:not([disabled]), select:not([disabled]), textarea:not([disabled])",d=n==null?void 0:n.filter(v=>{var D;const P=(D=v.shadowRoot)==null?void 0:D.querySelector(h);if(!P)return!1;const S=window.getComputedStyle(P);return S.display!=="none"&&S.display!==""&&S.pointerEvents!="none"&&S.visibility!=="hidden"&&P.getBoundingClientRect().width>0});let p=null;if(c.key=="ArrowDown"&&d){const v=d.indexOf(this);v==d.length-1?p=d[0]:p=d[v+1]}else if(c.key=="ArrowUp"&&d){const v=d.indexOf(this);v==0?p=d[d.length-1]:p=d[v-1]}const m=(b=p==null?void 0:p.shadowRoot)==null?void 0:b.querySelector(h);m&&m.focus&&(m.focus(),a.preventDefault(),a.stopPropagation())})}focus(){var e;const i=(e=this.shadowRoot)==null?void 0:e.querySelector("[data-form-element]");i==null||i.focus()}connectedCallback(){this.formDataProvider=this.getAncestorAttributeValue("formDataProvider"),super.connectedCallback(),this.addKeyboardNavigation()}disconnectedCallback(){super.disconnectedCallback(),this._name&&this.publisher&&dt(this.publisher,this._name).offAssign(this.onValueAssign);const i=this.getFormPublisher();this._name&&i&&(dt(i,this._name).offAssign(this.onFormValueAssign),i.offFormInvalidate(this.onFormDataInValidate))}}return kt([l({type:Boolean,reflect:!0})],t.prototype,"touched",2),kt([l({type:Boolean})],t.prototype,"error",2),kt([l({type:Boolean})],t.prototype,"autofocus",2),kt([l({type:Boolean})],t.prototype,"required",2),kt([l({type:Boolean})],t.prototype,"forceAutoFill",2),kt([l({type:Boolean})],t.prototype,"disabled",2),kt([l({type:String,attribute:"data-aria-label"})],t.prototype,"ariaLabel",2),kt([l({type:String,attribute:"data-aria-labelledby"})],t.prototype,"ariaLabelledby",2),kt([l()],t.prototype,"name",1),kt([l()],t.prototype,"value",1),t};let wn=class Oe{static areEqual(t,s){return t.length===s.length?t.every((i,e)=>i===s[e]):!1}static from2d(t){return{to1D:()=>{let s=[];return t.forEach(i=>s=s.concat(i)),this.from(s)}}}static from(t){return{get:()=>t||[],everyItem:()=>({has:()=>({same:()=>({value:()=>({forKey:s=>{if(t.length<1)return!0;const i=(t[0]||{})[s];return t.every(e=>(e||{})[s]==i)}})})}),value:()=>({forKey:s=>Oe.from(t.map(i=>i[s]))}),copy:()=>({fromKey:s=>({toKey:i=>{t.forEach(e=>{e[i]=Array.isArray(e[s])?[...e[s]]:typeof e[s]=="object"&&e[s]!=null?{...e[s]}:e[s]})}})})}),map:s=>Oe.from(t.map(s)),filter:s=>Oe.from(t.filter(s)),find:s=>t.find(s),some:s=>t.some(s),every:s=>t.every(s),group:()=>({byKey:s=>{const i=[],e=new Map;for(const o of t){const n=o[s];if(!e.has(n)){const a=i.length;e.set(n,a);const c={items:[]};c[s]=n,i.push(c)}i[e.get(n)].items.push(o)}return Oe.from(i)}}),without:()=>({duplicates:()=>({forKey:s=>{const i=[...new Set(t.map(e=>e[s]))];return Oe.from(i.map(e=>t.find(o=>o[s]==e)))}}),itemsIn:s=>({havingSameValue:()=>({forKey:i=>{const e=(o,n)=>a=>o[n]!=a[n];return Oe.from(t.filter(o=>s.every(e(o,i))))}})})})}}};var $n=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function xn(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var yi={exports:{}};(function(r,t){var s=[].slice;(function(i,e){return t!==null?r.exports=e():i.UrlPattern=e()})($n,function(){var i,e,o,n,a,c,h,d,p,m,b,v,P,S,D;return p=function(u){return u.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")},h=function(u,f){var y,C,O;for(O=[],y=-1,C=u.length;++y<C;)O=O.concat(f(u[y]));return O},S=function(u,f){var y,C,O;for(O="",y=-1,C=u.length;++y<C;)O+=f(u[y]);return O},P=function(u){return new RegExp(u.toString()+"|").exec("").length-1},b=function(u,f){var y,C,O,E,B;for(E={},y=-1,O=u.length;++y<O;)C=u[y],B=f[y],B!=null&&(E[C]!=null?(Array.isArray(E[C])||(E[C]=[E[C]]),E[C].push(B)):E[C]=B);return E},i={},i.Result=function(u,f){this.value=u,this.rest=f},i.Tagged=function(u,f){this.tag=u,this.value=f},i.tag=function(u,f){return function(y){var C,O;if(C=f(y),C!=null)return O=new i.Tagged(u,C.value),new i.Result(O,C.rest)}},i.regex=function(u){return function(f){var y,C;if(y=u.exec(f),y!=null)return C=y[0],new i.Result(C,f.slice(C.length))}},i.sequence=function(){var u;return u=1<=arguments.length?s.call(arguments,0):[],function(f){var y,C,O,E,B,W;for(y=-1,C=u.length,W=[],E=f;++y<C;){if(O=u[y],B=O(E),B==null)return;W.push(B.value),E=B.rest}return new i.Result(W,E)}},i.pick=function(){var u,f;return u=arguments[0],f=2<=arguments.length?s.call(arguments,1):[],function(y){var C,O;if(O=i.sequence.apply(i,f)(y),O!=null)return C=O.value,O.value=C[u],O}},i.string=function(u){var f;return f=u.length,function(y){if(y.slice(0,f)===u)return new i.Result(u,y.slice(f))}},i.lazy=function(u){var f;return f=null,function(y){return f==null&&(f=u()),f(y)}},i.baseMany=function(u,f,y,C,O){var E,B,W,Ot;for(W=O,Ot=y?"":[];!(f!=null&&(E=f(W),E!=null)||(B=u(W),B==null));)y?Ot+=B.value:Ot.push(B.value),W=B.rest;if(!(C&&Ot.length===0))return new i.Result(Ot,W)},i.many1=function(u){return function(f){return i.baseMany(u,null,!1,!0,f)}},i.concatMany1Till=function(u,f){return function(y){return i.baseMany(u,f,!0,!0,y)}},i.firstChoice=function(){var u;return u=1<=arguments.length?s.call(arguments,0):[],function(f){var y,C,O,E;for(y=-1,C=u.length;++y<C;)if(O=u[y],E=O(f),E!=null)return E}},v=function(u){var f;return f={},f.wildcard=i.tag("wildcard",i.string(u.wildcardChar)),f.optional=i.tag("optional",i.pick(1,i.string(u.optionalSegmentStartChar),i.lazy(function(){return f.pattern}),i.string(u.optionalSegmentEndChar))),f.name=i.regex(new RegExp("^["+u.segmentNameCharset+"]+")),f.named=i.tag("named",i.pick(1,i.string(u.segmentNameStartChar),i.lazy(function(){return f.name}))),f.escapedChar=i.pick(1,i.string(u.escapeChar),i.regex(/^./)),f.static=i.tag("static",i.concatMany1Till(i.firstChoice(i.lazy(function(){return f.escapedChar}),i.regex(/^./)),i.firstChoice(i.string(u.segmentNameStartChar),i.string(u.optionalSegmentStartChar),i.string(u.optionalSegmentEndChar),f.wildcard))),f.token=i.lazy(function(){return i.firstChoice(f.wildcard,f.optional,f.named,f.static)}),f.pattern=i.many1(i.lazy(function(){return f.token})),f},d={escapeChar:"\\",segmentNameStartChar:":",segmentValueCharset:"a-zA-Z0-9-_~ %",segmentNameCharset:"a-zA-Z0-9",optionalSegmentStartChar:"(",optionalSegmentEndChar:")",wildcardChar:"*"},c=function(u,f){if(Array.isArray(u))return S(u,function(y){return c(y,f)});switch(u.tag){case"wildcard":return"(.*?)";case"named":return"(["+f+"]+)";case"static":return p(u.value);case"optional":return"(?:"+c(u.value,f)+")?"}},a=function(u,f){return f==null&&(f=d.segmentValueCharset),"^"+c(u,f)+"$"},n=function(u){if(Array.isArray(u))return h(u,n);switch(u.tag){case"wildcard":return["_"];case"named":return[u.value];case"static":return[];case"optional":return n(u.value)}},m=function(u,f,y,C){var O,E,B,W;if(C==null&&(C=!1),W=u[f],W==null){if(C)throw new Error("no values provided for key `"+f+"`");return}if(O=y[f]||0,E=Array.isArray(W)?W.length-1:0,O>E){if(C)throw new Error("too few values provided for key `"+f+"`");return}return B=Array.isArray(W)?W[O]:W,C&&(y[f]=O+1),B},o=function(u,f,y){var C,O;if(Array.isArray(u)){for(C=-1,O=u.length;++C<O;)if(o(u[C],f,y))return!0;return!1}switch(u.tag){case"wildcard":return m(f,"_",y,!1)!=null;case"named":return m(f,u.value,y,!1)!=null;case"static":return!1;case"optional":return o(u.value,f,y)}},D=function(u,f,y){if(Array.isArray(u))return S(u,function(C){return D(C,f,y)});switch(u.tag){case"wildcard":return m(f,"_",y,!0);case"named":return m(f,u.value,y,!0);case"static":return u.value;case"optional":return o(u.value,f,y)?D(u.value,f,y):""}},e=function(u,f){var y,C,O,E,B;if(u instanceof e){this.isRegex=u.isRegex,this.regex=u.regex,this.ast=u.ast,this.names=u.names;return}if(this.isRegex=u instanceof RegExp,!(typeof u=="string"||this.isRegex))throw new TypeError("argument must be a regex or a string");if(this.isRegex){if(this.regex=u,f!=null){if(!Array.isArray(f))throw new Error("if first argument is a regex the second argument may be an array of group names but you provided something else");if(y=P(this.regex),f.length!==y)throw new Error("regex contains "+y+" groups but array of group names contains "+f.length);this.names=f}return}if(u==="")throw new Error("argument must not be the empty string");if(B=u.replace(/\s+/g,""),B!==u)throw new Error("argument must not contain whitespace");if(C={escapeChar:(f!=null?f.escapeChar:void 0)||d.escapeChar,segmentNameStartChar:(f!=null?f.segmentNameStartChar:void 0)||d.segmentNameStartChar,segmentNameCharset:(f!=null?f.segmentNameCharset:void 0)||d.segmentNameCharset,segmentValueCharset:(f!=null?f.segmentValueCharset:void 0)||d.segmentValueCharset,optionalSegmentStartChar:(f!=null?f.optionalSegmentStartChar:void 0)||d.optionalSegmentStartChar,optionalSegmentEndChar:(f!=null?f.optionalSegmentEndChar:void 0)||d.optionalSegmentEndChar,wildcardChar:(f!=null?f.wildcardChar:void 0)||d.wildcardChar},E=v(C),O=E.pattern(u),O==null)throw new Error("couldn't parse pattern");if(O.rest!=="")throw new Error("could only partially parse pattern");this.ast=O.value,this.regex=new RegExp(a(this.ast,C.segmentValueCharset)),this.names=n(this.ast)},e.prototype.match=function(u){var f,y;return y=this.regex.exec(u),y==null?null:(f=y.slice(1),this.names?b(this.names,f):f)},e.prototype.stringify=function(u){if(u==null&&(u={}),this.isRegex)throw new Error("can't stringify patterns generated from a regex");if(u!==Object(u))throw new Error("argument must be an object or undefined");return D(this.ast,u,{})},e.escapeForRegex=p,e.concatMap=h,e.stringConcatMap=S,e.regexGroupCount=P,e.keysAndValuesToObject=b,e.P=i,e.newParser=v,e.defaultOptions=d,e.astNodeToRegexString=a,e.astNodeToNames=n,e.getParam=m,e.astNodeContainsSegmentsForProvidedParams=o,e.stringify=D,e})})(yi,yi.exports);var Pn=yi.exports;const ue=xn(Pn),An=Lo,Cn=wn,Sn=ws,On=vs,fe=G,Dn=ot,Je=J,kn=He,st=N,Ln=Ne,En=ue;window["concorde-utils"]=window["concorde-utils"]||{},window["concorde-utils"]={Utils:An,Arrays:Cn,DataBindObserver:Sn,Format:On,HTML:fe,LocationHandler:Dn,Objects:Je,PublisherProxy:kn,PublisherManager:st,api:Ln,URLPattern:En};var Nn=Object.defineProperty,Tn=Object.getOwnPropertyDescriptor,Ie=(r,t,s,i)=>{for(var e=i>1?void 0:i?Tn(t,s):t,o=r.length-1,n;o>=0;o--)(n=r[o])&&(e=(i?n(t,s,e):n(e))||e);return i&&e&&Nn(t,s,e),e};const _i=r=>{class t extends r{constructor(){super(...arguments),this._value="",this.forceAutoFill=!1,this.unique=null,this.radio=null,this.unCheckOnDisconnect=!1,this._checked=null,this.updateAllChecked=()=>{var n;const i=this.getAttribute("name"),e=this.getCheckAllPublisher(),o=this.getFormPublisher();if(e!=null&&e.hasCheckAll.get()&&!this.checksAll()&&e&&o&&i){if((n=this.getFormPublisherValue())!=null&&n.length)(this.checked===null||e.checkMode.get()=="noneChecked"||e.checkMode.get()==null)&&(e.checkMode="someUnchecked");else{e.checkMode="noneChecked";return}const a=this.getFormPublisherValue(),c=e.values.get();if(c&&c.length){let h=c.length;for(const d of c)a.indexOf(d)==-1&&(h-=1);h==c.length&&(e.checkMode="allChecked"),h==0&&(e.checkMode="noneChecked")}c.indexOf(this.value)==-1&&(this.checked=null)}},this.onChecksAllRequest=i=>{this.removeAttribute("allChecked"),this.removeAttribute("indeterminate"),i=="allChecked"&&(this.checked=!0,this.setAttribute("allChecked","")),i=="noneChecked"&&(this.checked=null),i=="someUnchecked"&&(this.checksAll()&&(this.checked="indeterminate"),this.setAttribute("indeterminate",""))}}get value(){return this._value}set value(i){if(this.value==i||(this.hasAttribute("value")&&!this.forceAutoFill&&(i=this.getAttribute("value")),this._value==i)||i==null||(this._value=i,!this.value))return;if(this.getFormPublisher()&&this.name){let o=this.getFormPublisherValue();(this.radio||this.unique)&&(this.checked=o==i?!0:null),Array.isArray(o)||(o=[]),o.indexOf(i)!=-1&&(this.checked=!0)}this.checked==!0&&this.updateDataValue(),this.requestUpdate()}get checked(){return this._checked}set checked(i){if(this.setCheckedValue(i),this.checksAll()){const e=this.getCheckAllPublisher();e&&(this.checked===!0?e.checkMode="allChecked":this.checked===null&&(e.checkMode="noneChecked",this.getFormPublisher()&&this.setFormPublisherValue([])))}this.requestUpdate()}validateFormElement(){var o;const i=(o=this.shadowRoot)==null?void 0:o.querySelector("input");if(!i||i.checkValidity())return;const e=this.getFormPublisher();if(e){const n=this.getFormPublisherValue();if((this.unique||this.radio)&&n!==null&&n!==void 0&&n.toString().length>0)return;e.isFormValid=!1,i.reportValidity()}}checksAll(){return this.hasAttribute("checksAll")}setCheckedValue(i){this._checked!=i&&(this._checked=i,this.updateDataValue(),this.requestUpdate(),setTimeout(()=>this.updateAllChecked(),1))}handleChange(){const i=this.checked===!0?this.radio?!0:null:!0;this.checked=i;const e=new Event("change");this.dispatchEvent(e)}getValueForFormPublisher(){let i=this.getFormPublisherValue();if(this.radio)return this.checked===!0&&this.value!=null?this.value:i;if(this.unique)return this.checked===!0&&this.value!=null?this.value:null;Array.isArray(i)||(i=[]);const e=i.slice(0),o=e.indexOf(this.value);return this.checked===!0&&o===-1&&!this.checksAll()&&e.push(this.value),this.checked===null&&o!==-1&&e.splice(o,1),e}setFormValueFromPublisher(i){if(this.unique||this.radio){this.checked=this.value==i?!0:null;return}Array.isArray(i)||(i=[]),!this.checksAll()&&(this.checked=i.indexOf(this.value)!==-1?!0:null)}getCheckAllPublisher(){this.formDataProvider||(this.formDataProvider=this.getAncestorAttributeValue("formDataProvider"));const i=this.formDataProvider,e=this.getAttribute("name");return!i||!e?null:st.get(i+"/"+e+"/_available_values_")}disconnectedCallback(){super.disconnectedCallback();const i=this.getCheckAllPublisher();if(i&&(i.checkMode.offAssign(this.onChecksAllRequest),!this.checksAll())){const e=i.values.get().slice(0),o=e.indexOf(this.value);o!=-1&&(e.splice(o,1),i.values=e)}setTimeout(()=>this.updateAllChecked(),1)}connectedCallback(){if(super.connectedCallback(),this.getFormPublisher()&&this.name){const o=this.getFormPublisherValue();o&&Array.isArray(o)&&o.indexOf(this.value)!==-1&&(this.checked=!0)}const e=this.getCheckAllPublisher();e&&(e.checkMode.onAssign(this.onChecksAllRequest),this.checksAll()&&(e.hasCheckAll=!0),e.values.get()||(e.values=[]),this.checksAll()||(e.values=[...e.values.get(),this.value])),this.hasAttribute("checked")&&(!this.publisher||this.publisher.get().checked!==!1)&&setTimeout(()=>this.checked=!0,1)}}return Ie([l()],t.prototype,"value",1),Ie([l()],t.prototype,"forceAutoFill",2),Ie([l({type:Boolean})],t.prototype,"unique",2),Ie([l({type:Boolean})],t.prototype,"radio",2),Ie([l({type:Boolean})],t.prototype,"unCheckOnDisconnect",2),Ie([l()],t.prototype,"checked",1),t};/**
|
|
72
|
+
*/const Nr="important",vn=" !"+Nr,ft=pe(class extends Ee{constructor(r){var t;if(super(r),r.type!==Le.ATTRIBUTE||r.name!=="style"||((t=r.strings)==null?void 0:t.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(r){return Object.keys(r).reduce((t,s)=>{const i=r[s];return i==null?t:t+`${s=s.includes("-")?s:s.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`},"")}update(r,[t]){const{style:s}=r.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(t)),this.render(t);for(const i of this.ft)t[i]==null&&(this.ft.delete(i),i.includes("-")?s.removeProperty(i):s[i]=null);for(const i in t){const e=t[i];if(e!=null){this.ft.add(i);const o=typeof e=="string"&&e.endsWith(vn);i.includes("-")||o?s.setProperty(i,o?e.slice(0,-11):e,o?Nr:""):s[i]=e}}return vt}});var yn=Object.defineProperty,_n=Object.getOwnPropertyDescriptor,kt=(r,t,s,i)=>{for(var e=i>1?void 0:i?_n(t,s):t,o=r.length-1,n;o>=0;o--)(n=r[o])&&(e=(i?n(t,s,e):n(e))||e);return i&&e&&yn(t,s,e),e};const Ds=new Map,Me=r=>{class t extends r{constructor(...i){super(),this.touched=!1,this.error=!1,this.autofocus=!1,this.required=!1,this.forceAutoFill=!1,this.disabled=null,this.formDataProvider="",this._name="",this._value="",this.onValueAssign=e=>{this.setValueFromPublisher(e)},this.onFormValueAssign=async e=>{this.setFormValueFromPublisher(e)},this.onFormDataInValidate=()=>{const e=this.getFormPublisher();e&&e.isFormValid.get()&&this.validateFormElement()}}get name(){return this._name}set name(i){this.hasAttribute("name")&&!this.forceAutoFill&&(i=this.getAttribute("name")),this._name=i,this.requestUpdate()}validateFormElement(){}updateDataValue(){this.getAttribute("name")&&this.getFormPublisher()&&(this.setFormPublisherValue(this.getValueForFormPublisher()),this.setFormValueFromPublisher(this.getFormPublisherValue()))}getFormPublisher(){return this.formDataProvider||(this.formDataProvider=this.getAncestorAttributeValue("formDataProvider")),this.formDataProvider?N.get(this.formDataProvider):null}setFormPublisherValue(i){const e=this.getFormPublisher();e&&dt(e,this.name).set(i)}getFormPublisherValue(){const i=this.getFormPublisher();return i?dt(i,this.name).get():null}getValueForFormPublisher(){return this.value}setValueFromPublisher(i){this.value=i}setFormValueFromPublisher(i){this.value=i}get value(){return this._value}set value(i){i==null&&(i=""),J.isObject(i)&&Object.prototype.hasOwnProperty.call(i,"__value")&&i._value==null&&(i=""),this._value!=i&&(this._value=i,this.updateDataValue(),this.requestUpdate())}initPublisher(){let i=this.getFormPublisher();const e=this.hasAncestorAttribute("initFromPublisher")&&this._name&&this.getFormPublisherValue()?this.getFormPublisherValue():this.getAttribute("value");this._name&&this.publisher&&dt(this.publisher,this._name).offAssign(this.onValueAssign),this._name&&i&&dt(i,this._name).offAssign(this.onFormValueAssign),super.initPublisher(),this.name||(this._name=this.getAttribute("name")),this.value||(this._value=this.getAttribute("value")),this.publisher&&this._name&&dt(this.publisher,this._name).onAssign(this.onValueAssign),i=this.getFormPublisher(),this._name&&i&&(dt(i,this._name).onAssign(this.onFormValueAssign),i.onFormInvalidate(this.onFormDataInValidate)),this.updateDataValue(),e&&(this.value=e)}handleBlur(){this.touched=!0}handleChange(i){this.value=i.target.value;const e=new Event("change");this.dispatchEvent(e)}addKeyboardNavigation(){const i=this.getAncestorAttributeValue("data-keyboard-nav");if(!i)return;const e=i.split(" "),o=e[0];if(!o)return;for(const a of e){Ds.has(a)||Ds.set(a,[]);const c=Ds.get(a);(c==null?void 0:c.indexOf(this))==-1&&c.push(this)}const n=Ds.get(o);this.addEventListener("keydown",a=>{var b;const c=a;if(!["ArrowDown","ArrowUp"].includes(c.key))return;const h="input:not([disabled]), button:not([disabled]), select:not([disabled]), textarea:not([disabled])",d=n==null?void 0:n.filter(v=>{var D;const P=(D=v.shadowRoot)==null?void 0:D.querySelector(h);if(!P)return!1;const S=window.getComputedStyle(P);return S.display!=="none"&&S.display!==""&&S.pointerEvents!="none"&&S.visibility!=="hidden"&&P.getBoundingClientRect().width>0});let p=null;if(c.key=="ArrowDown"&&d){const v=d.indexOf(this);v==d.length-1?p=d[0]:p=d[v+1]}else if(c.key=="ArrowUp"&&d){const v=d.indexOf(this);v==0?p=d[d.length-1]:p=d[v-1]}const m=(b=p==null?void 0:p.shadowRoot)==null?void 0:b.querySelector(h);m&&m.focus&&(m.focus(),a.preventDefault(),a.stopPropagation())})}focus(){var e;const i=(e=this.shadowRoot)==null?void 0:e.querySelector("[data-form-element]");i==null||i.focus()}connectedCallback(){this.formDataProvider=this.getAncestorAttributeValue("formDataProvider"),super.connectedCallback(),this.addKeyboardNavigation()}disconnectedCallback(){super.disconnectedCallback(),this._name&&this.publisher&&dt(this.publisher,this._name).offAssign(this.onValueAssign);const i=this.getFormPublisher();this._name&&i&&(dt(i,this._name).offAssign(this.onFormValueAssign),i.offFormInvalidate(this.onFormDataInValidate))}}return kt([l({type:Boolean,reflect:!0})],t.prototype,"touched",2),kt([l({type:Boolean})],t.prototype,"error",2),kt([l({type:Boolean})],t.prototype,"autofocus",2),kt([l({type:Boolean})],t.prototype,"required",2),kt([l({type:Boolean})],t.prototype,"forceAutoFill",2),kt([l({type:Boolean})],t.prototype,"disabled",2),kt([l({type:String,attribute:"data-aria-label"})],t.prototype,"ariaLabel",2),kt([l({type:String,attribute:"data-aria-labelledby"})],t.prototype,"ariaLabelledby",2),kt([l()],t.prototype,"name",1),kt([l()],t.prototype,"value",1),t};let wn=class Oe{static areEqual(t,s){return t.length===s.length?t.every((i,e)=>i===s[e]):!1}static from2d(t){return{to1D:()=>{let s=[];return t.forEach(i=>s=s.concat(i)),this.from(s)}}}static from(t){return{get:()=>t||[],everyItem:()=>({has:()=>({same:()=>({value:()=>({forKey:s=>{if(t.length<1)return!0;const i=(t[0]||{})[s];return t.every(e=>(e||{})[s]==i)}})})}),value:()=>({forKey:s=>Oe.from(t.map(i=>i[s]))}),copy:()=>({fromKey:s=>({toKey:i=>{t.forEach(e=>{e[i]=Array.isArray(e[s])?[...e[s]]:typeof e[s]=="object"&&e[s]!=null?{...e[s]}:e[s]})}})})}),map:s=>Oe.from(t.map(s)),filter:s=>Oe.from(t.filter(s)),find:s=>t.find(s),some:s=>t.some(s),every:s=>t.every(s),group:()=>({byKey:s=>{const i=[],e=new Map;for(const o of t){const n=o[s];if(!e.has(n)){const a=i.length;e.set(n,a);const c={items:[]};c[s]=n,i.push(c)}i[e.get(n)].items.push(o)}return Oe.from(i)}}),without:()=>({duplicates:()=>({forKey:s=>{const i=[...new Set(t.map(e=>e[s]))];return Oe.from(i.map(e=>t.find(o=>o[s]==e)))}}),itemsIn:s=>({havingSameValue:()=>({forKey:i=>{const e=(o,n)=>a=>o[n]!=a[n];return Oe.from(t.filter(o=>s.every(e(o,i))))}})})})}}};var $n=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function xn(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var yi={exports:{}};(function(r,t){var s=[].slice;(function(i,e){return t!==null?r.exports=e():i.UrlPattern=e()})($n,function(){var i,e,o,n,a,c,h,d,p,m,b,v,P,S,D;return p=function(u){return u.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")},h=function(u,f){var y,C,O;for(O=[],y=-1,C=u.length;++y<C;)O=O.concat(f(u[y]));return O},S=function(u,f){var y,C,O;for(O="",y=-1,C=u.length;++y<C;)O+=f(u[y]);return O},P=function(u){return new RegExp(u.toString()+"|").exec("").length-1},b=function(u,f){var y,C,O,E,B;for(E={},y=-1,O=u.length;++y<O;)C=u[y],B=f[y],B!=null&&(E[C]!=null?(Array.isArray(E[C])||(E[C]=[E[C]]),E[C].push(B)):E[C]=B);return E},i={},i.Result=function(u,f){this.value=u,this.rest=f},i.Tagged=function(u,f){this.tag=u,this.value=f},i.tag=function(u,f){return function(y){var C,O;if(C=f(y),C!=null)return O=new i.Tagged(u,C.value),new i.Result(O,C.rest)}},i.regex=function(u){return function(f){var y,C;if(y=u.exec(f),y!=null)return C=y[0],new i.Result(C,f.slice(C.length))}},i.sequence=function(){var u;return u=1<=arguments.length?s.call(arguments,0):[],function(f){var y,C,O,E,B,W;for(y=-1,C=u.length,W=[],E=f;++y<C;){if(O=u[y],B=O(E),B==null)return;W.push(B.value),E=B.rest}return new i.Result(W,E)}},i.pick=function(){var u,f;return u=arguments[0],f=2<=arguments.length?s.call(arguments,1):[],function(y){var C,O;if(O=i.sequence.apply(i,f)(y),O!=null)return C=O.value,O.value=C[u],O}},i.string=function(u){var f;return f=u.length,function(y){if(y.slice(0,f)===u)return new i.Result(u,y.slice(f))}},i.lazy=function(u){var f;return f=null,function(y){return f==null&&(f=u()),f(y)}},i.baseMany=function(u,f,y,C,O){var E,B,W,Ot;for(W=O,Ot=y?"":[];!(f!=null&&(E=f(W),E!=null)||(B=u(W),B==null));)y?Ot+=B.value:Ot.push(B.value),W=B.rest;if(!(C&&Ot.length===0))return new i.Result(Ot,W)},i.many1=function(u){return function(f){return i.baseMany(u,null,!1,!0,f)}},i.concatMany1Till=function(u,f){return function(y){return i.baseMany(u,f,!0,!0,y)}},i.firstChoice=function(){var u;return u=1<=arguments.length?s.call(arguments,0):[],function(f){var y,C,O,E;for(y=-1,C=u.length;++y<C;)if(O=u[y],E=O(f),E!=null)return E}},v=function(u){var f;return f={},f.wildcard=i.tag("wildcard",i.string(u.wildcardChar)),f.optional=i.tag("optional",i.pick(1,i.string(u.optionalSegmentStartChar),i.lazy(function(){return f.pattern}),i.string(u.optionalSegmentEndChar))),f.name=i.regex(new RegExp("^["+u.segmentNameCharset+"]+")),f.named=i.tag("named",i.pick(1,i.string(u.segmentNameStartChar),i.lazy(function(){return f.name}))),f.escapedChar=i.pick(1,i.string(u.escapeChar),i.regex(/^./)),f.static=i.tag("static",i.concatMany1Till(i.firstChoice(i.lazy(function(){return f.escapedChar}),i.regex(/^./)),i.firstChoice(i.string(u.segmentNameStartChar),i.string(u.optionalSegmentStartChar),i.string(u.optionalSegmentEndChar),f.wildcard))),f.token=i.lazy(function(){return i.firstChoice(f.wildcard,f.optional,f.named,f.static)}),f.pattern=i.many1(i.lazy(function(){return f.token})),f},d={escapeChar:"\\",segmentNameStartChar:":",segmentValueCharset:"a-zA-Z0-9-_~ %",segmentNameCharset:"a-zA-Z0-9",optionalSegmentStartChar:"(",optionalSegmentEndChar:")",wildcardChar:"*"},c=function(u,f){if(Array.isArray(u))return S(u,function(y){return c(y,f)});switch(u.tag){case"wildcard":return"(.*?)";case"named":return"(["+f+"]+)";case"static":return p(u.value);case"optional":return"(?:"+c(u.value,f)+")?"}},a=function(u,f){return f==null&&(f=d.segmentValueCharset),"^"+c(u,f)+"$"},n=function(u){if(Array.isArray(u))return h(u,n);switch(u.tag){case"wildcard":return["_"];case"named":return[u.value];case"static":return[];case"optional":return n(u.value)}},m=function(u,f,y,C){var O,E,B,W;if(C==null&&(C=!1),W=u[f],W==null){if(C)throw new Error("no values provided for key `"+f+"`");return}if(O=y[f]||0,E=Array.isArray(W)?W.length-1:0,O>E){if(C)throw new Error("too few values provided for key `"+f+"`");return}return B=Array.isArray(W)?W[O]:W,C&&(y[f]=O+1),B},o=function(u,f,y){var C,O;if(Array.isArray(u)){for(C=-1,O=u.length;++C<O;)if(o(u[C],f,y))return!0;return!1}switch(u.tag){case"wildcard":return m(f,"_",y,!1)!=null;case"named":return m(f,u.value,y,!1)!=null;case"static":return!1;case"optional":return o(u.value,f,y)}},D=function(u,f,y){if(Array.isArray(u))return S(u,function(C){return D(C,f,y)});switch(u.tag){case"wildcard":return m(f,"_",y,!0);case"named":return m(f,u.value,y,!0);case"static":return u.value;case"optional":return o(u.value,f,y)?D(u.value,f,y):""}},e=function(u,f){var y,C,O,E,B;if(u instanceof e){this.isRegex=u.isRegex,this.regex=u.regex,this.ast=u.ast,this.names=u.names;return}if(this.isRegex=u instanceof RegExp,!(typeof u=="string"||this.isRegex))throw new TypeError("argument must be a regex or a string");if(this.isRegex){if(this.regex=u,f!=null){if(!Array.isArray(f))throw new Error("if first argument is a regex the second argument may be an array of group names but you provided something else");if(y=P(this.regex),f.length!==y)throw new Error("regex contains "+y+" groups but array of group names contains "+f.length);this.names=f}return}if(u==="")throw new Error("argument must not be the empty string");if(B=u.replace(/\s+/g,""),B!==u)throw new Error("argument must not contain whitespace");if(C={escapeChar:(f!=null?f.escapeChar:void 0)||d.escapeChar,segmentNameStartChar:(f!=null?f.segmentNameStartChar:void 0)||d.segmentNameStartChar,segmentNameCharset:(f!=null?f.segmentNameCharset:void 0)||d.segmentNameCharset,segmentValueCharset:(f!=null?f.segmentValueCharset:void 0)||d.segmentValueCharset,optionalSegmentStartChar:(f!=null?f.optionalSegmentStartChar:void 0)||d.optionalSegmentStartChar,optionalSegmentEndChar:(f!=null?f.optionalSegmentEndChar:void 0)||d.optionalSegmentEndChar,wildcardChar:(f!=null?f.wildcardChar:void 0)||d.wildcardChar},E=v(C),O=E.pattern(u),O==null)throw new Error("couldn't parse pattern");if(O.rest!=="")throw new Error("could only partially parse pattern");this.ast=O.value,this.regex=new RegExp(a(this.ast,C.segmentValueCharset)),this.names=n(this.ast)},e.prototype.match=function(u){var f,y;return y=this.regex.exec(u),y==null?null:(f=y.slice(1),this.names?b(this.names,f):f)},e.prototype.stringify=function(u){if(u==null&&(u={}),this.isRegex)throw new Error("can't stringify patterns generated from a regex");if(u!==Object(u))throw new Error("argument must be an object or undefined");return D(this.ast,u,{})},e.escapeForRegex=p,e.concatMap=h,e.stringConcatMap=S,e.regexGroupCount=P,e.keysAndValuesToObject=b,e.P=i,e.newParser=v,e.defaultOptions=d,e.astNodeToRegexString=a,e.astNodeToNames=n,e.getParam=m,e.astNodeContainsSegmentsForProvidedParams=o,e.stringify=D,e})})(yi,yi.exports);var Pn=yi.exports;const ue=xn(Pn),An=Lo,Cn=wn,Sn=ws,On=vs,fe=K,Dn=ot,Je=J,kn=He,st=N,Ln=Ne,En=ue;window["concorde-utils"]=window["concorde-utils"]||{},window["concorde-utils"]={Utils:An,Arrays:Cn,DataBindObserver:Sn,Format:On,HTML:fe,LocationHandler:Dn,Objects:Je,PublisherProxy:kn,PublisherManager:st,api:Ln,URLPattern:En};var Nn=Object.defineProperty,Tn=Object.getOwnPropertyDescriptor,Ie=(r,t,s,i)=>{for(var e=i>1?void 0:i?Tn(t,s):t,o=r.length-1,n;o>=0;o--)(n=r[o])&&(e=(i?n(t,s,e):n(e))||e);return i&&e&&Nn(t,s,e),e};const _i=r=>{class t extends r{constructor(){super(...arguments),this._value="",this.forceAutoFill=!1,this.unique=null,this.radio=null,this.unCheckOnDisconnect=!1,this._checked=null,this.updateAllChecked=()=>{var n;const i=this.getAttribute("name"),e=this.getCheckAllPublisher(),o=this.getFormPublisher();if(e!=null&&e.hasCheckAll.get()&&!this.checksAll()&&e&&o&&i){if((n=this.getFormPublisherValue())!=null&&n.length)(this.checked===null||e.checkMode.get()=="noneChecked"||e.checkMode.get()==null)&&(e.checkMode="someUnchecked");else{e.checkMode="noneChecked";return}const a=this.getFormPublisherValue(),c=e.values.get();if(c&&c.length){let h=c.length;for(const d of c)a.indexOf(d)==-1&&(h-=1);h==c.length&&(e.checkMode="allChecked"),h==0&&(e.checkMode="noneChecked")}c.indexOf(this.value)==-1&&(this.checked=null)}},this.onChecksAllRequest=i=>{this.removeAttribute("allChecked"),this.removeAttribute("indeterminate"),i=="allChecked"&&(this.checked=!0,this.setAttribute("allChecked","")),i=="noneChecked"&&(this.checked=null),i=="someUnchecked"&&(this.checksAll()&&(this.checked="indeterminate"),this.setAttribute("indeterminate",""))}}get value(){return this._value}set value(i){if(this.value==i||(this.hasAttribute("value")&&!this.forceAutoFill&&(i=this.getAttribute("value")),this._value==i)||i==null||(this._value=i,!this.value))return;if(this.getFormPublisher()&&this.name){let o=this.getFormPublisherValue();(this.radio||this.unique)&&(this.checked=o==i?!0:null),Array.isArray(o)||(o=[]),o.indexOf(i)!=-1&&(this.checked=!0)}this.checked==!0&&this.updateDataValue(),this.requestUpdate()}get checked(){return this._checked}set checked(i){if(this.setCheckedValue(i),this.checksAll()){const e=this.getCheckAllPublisher();e&&(this.checked===!0?e.checkMode="allChecked":this.checked===null&&(e.checkMode="noneChecked",this.getFormPublisher()&&this.setFormPublisherValue([])))}this.requestUpdate()}validateFormElement(){var o;const i=(o=this.shadowRoot)==null?void 0:o.querySelector("input");if(!i||i.checkValidity())return;const e=this.getFormPublisher();if(e){const n=this.getFormPublisherValue();if((this.unique||this.radio)&&n!==null&&n!==void 0&&n.toString().length>0)return;e.isFormValid=!1,i.reportValidity()}}checksAll(){return this.hasAttribute("checksAll")}setCheckedValue(i){this._checked!=i&&(this._checked=i,this.updateDataValue(),this.requestUpdate(),setTimeout(()=>this.updateAllChecked(),1))}handleChange(){const i=this.checked===!0?this.radio?!0:null:!0;this.checked=i;const e=new Event("change");this.dispatchEvent(e)}getValueForFormPublisher(){let i=this.getFormPublisherValue();if(this.radio)return this.checked===!0&&this.value!=null?this.value:i;if(this.unique)return this.checked===!0&&this.value!=null?this.value:null;Array.isArray(i)||(i=[]);const e=i.slice(0),o=e.indexOf(this.value);return this.checked===!0&&o===-1&&!this.checksAll()&&e.push(this.value),this.checked===null&&o!==-1&&e.splice(o,1),e}setFormValueFromPublisher(i){if(this.unique||this.radio){this.checked=this.value==i?!0:null;return}Array.isArray(i)||(i=[]),!this.checksAll()&&(this.checked=i.indexOf(this.value)!==-1?!0:null)}getCheckAllPublisher(){this.formDataProvider||(this.formDataProvider=this.getAncestorAttributeValue("formDataProvider"));const i=this.formDataProvider,e=this.getAttribute("name");return!i||!e?null:st.get(i+"/"+e+"/_available_values_")}disconnectedCallback(){super.disconnectedCallback();const i=this.getCheckAllPublisher();if(i&&(i.checkMode.offAssign(this.onChecksAllRequest),!this.checksAll())){const e=i.values.get().slice(0),o=e.indexOf(this.value);o!=-1&&(e.splice(o,1),i.values=e)}setTimeout(()=>this.updateAllChecked(),1)}connectedCallback(){if(super.connectedCallback(),this.getFormPublisher()&&this.name){const o=this.getFormPublisherValue();o&&Array.isArray(o)&&o.indexOf(this.value)!==-1&&(this.checked=!0)}const e=this.getCheckAllPublisher();e&&(e.checkMode.onAssign(this.onChecksAllRequest),this.checksAll()&&(e.hasCheckAll=!0),e.values.get()||(e.values=[]),this.checksAll()||(e.values=[...e.values.get(),this.value])),this.hasAttribute("checked")&&(!this.publisher||this.publisher.get().checked!==!1)&&setTimeout(()=>this.checked=!0,1)}}return Ie([l()],t.prototype,"value",1),Ie([l()],t.prototype,"forceAutoFill",2),Ie([l({type:Boolean})],t.prototype,"unique",2),Ie([l({type:Boolean})],t.prototype,"radio",2),Ie([l({type:Boolean})],t.prototype,"unCheckOnDisconnect",2),Ie([l()],t.prototype,"checked",1),t};/**
|
|
73
73
|
* @license
|
|
74
74
|
* Copyright 2018 Google LLC
|
|
75
75
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -1220,7 +1220,7 @@
|
|
|
1220
1220
|
* @license
|
|
1221
1221
|
* Copyright 2021 Google LLC
|
|
1222
1222
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1223
|
-
*/function*po(r,t){if(r!==void 0){let s=0;for(const i of r)yield t(i,s++)}}var Za=Object.defineProperty,Ga=Object.getOwnPropertyDescriptor,gt=(r,t,s,i)=>{for(var e=i>1?void 0:i?Ga(t,s):t,o=r.length-1,n;o>=0;o--)(n=r[o])&&(e=(i?n(t,s,e):n(e))||e);return i&&e&&Za(t,s,e),e};const Qa="sonic-queue";let it=class extends Q(_){constructor(){super(...arguments),this.templates=null,this.lastRequestTime=0,this.key="",this.itemPropertyMap=null,this.cache="default",this.targetRequestDuration=500,this.limit=5,this.lazyBoundsRatio=1,this.offset=0,this.resultCount=0,this.noLazyload=!1,this.loader="inline",this.filteredFields="",this.instanceId=0,this.localStorage="disabled",this.filterPublisher=null,this.filterTimeoutMs=400,this.searchHash="",this.requestId=0,this.isFirstRequest=!0,this.updateFilteredContent=()=>{var n;const t=this.dataProviderExpression.split("?");t.shift();const s=new URLSearchParams(t.join("?")),i=(n=this.filterPublisher)==null?void 0:n.get(),e=this.filteredFields.split(" ");for(const a in i){let c=i[a];Array.isArray(c)&&(c=c.filter(h=>h!==null)),!(this.filteredFields&&!e.includes(a)||c==null||c.toString()==="")&&s.set(a,i[a].toString())}const o=s.toString();if(!(o==this.searchHash&&!this.isFirstRequest)){this.searchHash=o;for(const a of this.listDataProviders)N.delete(a);this.listDataProviders=[],clearTimeout(this.filterTimeoutId),this.filterTimeoutId=setTimeout(async()=>{const a=this.resultCount;this.props=null,this.requestId++,this.resultCount=a,await N.getInstance().isLocalStrorageReady,window.requestAnimationFrame(()=>this.next())},this.isFirstRequest?0:this.filterTimeoutMs),this.isFirstRequest=!1}},this.dataProviderExpression="",this.idKey="id",this.listDataProviders=[],this.nextHadEvent=!1,this.
|
|
1223
|
+
*/function*po(r,t){if(r!==void 0){let s=0;for(const i of r)yield t(i,s++)}}var Za=Object.defineProperty,Ga=Object.getOwnPropertyDescriptor,gt=(r,t,s,i)=>{for(var e=i>1?void 0:i?Ga(t,s):t,o=r.length-1,n;o>=0;o--)(n=r[o])&&(e=(i?n(t,s,e):n(e))||e);return i&&e&&Za(t,s,e),e};const Qa="sonic-queue";let it=class extends Q(_){constructor(){super(...arguments),this.templates=null,this.lastRequestTime=0,this.key="",this.itemPropertyMap=null,this.cache="default",this.targetRequestDuration=500,this.limit=5,this.lazyBoundsRatio=1,this.offset=0,this.resultCount=0,this.noLazyload=!1,this.loader="inline",this.filteredFields="",this.instanceId=0,this.localStorage="disabled",this.filterPublisher=null,this.filterTimeoutMs=400,this.searchHash="",this.requestId=0,this.isFirstRequest=!0,this.updateFilteredContent=()=>{var n;const t=this.dataProviderExpression.split("?");t.shift();const s=new URLSearchParams(t.join("?")),i=(n=this.filterPublisher)==null?void 0:n.get(),e=this.filteredFields.split(" ");for(const a in i){let c=i[a];Array.isArray(c)&&(c=c.filter(h=>h!==null)),!(this.filteredFields&&!e.includes(a)||c==null||c.toString()==="")&&s.set(a,i[a].toString())}const o=s.toString();if(!(o==this.searchHash&&!this.isFirstRequest)){this.searchHash=o;for(const a of this.listDataProviders)N.delete(a);this.listDataProviders=[],clearTimeout(this.filterTimeoutId),this.filterTimeoutId=setTimeout(async()=>{this.storeScrollPosition();const a=this.resultCount;this.props=null,this.requestId++,this.resultCount=a,await N.getInstance().isLocalStrorageReady,window.requestAnimationFrame(()=>this.next())},this.isFirstRequest?0:this.filterTimeoutMs),this.isFirstRequest=!1}},this.dataProviderExpression="",this.idKey="id",this.listDataProviders=[],this.nextHadEvent=!1,this.storedScrollY=0,this.storedScrollX=0}disconnectedCallback(){var r;for(const t of this.listDataProviders)N.delete(t),this.listDataProviders=[];(r=this.filterPublisher)==null||r.offInternalMutation(this.updateFilteredContent),this.props=null,this.limit=5,this.offset=0,this.resultCount=0,this.searchHash="",this.requestId=0,this.isFirstRequest=!0,this.nextHadEvent=!1,this.publisher.set({}),super.disconnectedCallback()}async connectedCallback(){this.instanceId=it.instanceCounter++,this.localStorage=this.getAttribute("localStorage")||this.localStorage,this.filterTimeoutMs=parseInt(this.getAttribute("filterTimeoutMs")||"400"),this.removeAttribute("localStorage"),this.noShadowDom="",this.defferedDebug=this.hasAttribute("debug")||null,this.dataProvider||(this.dataProvider=this.dataProviderExpression||"sonic-queue-"+this.instanceId+"-"+Math.random().toString(36).substring(7)),this.dataProviderExpression||(this.dataProviderExpression=fe.getAncestorAttributeValue(this.parentElement,"dataProvider")||""),this.storeScrollPosition(),super.connectedCallback(),this.publisher.set({}),this.key=this.getAttribute("key"),await N.getInstance().isLocalStrorageReady,this.templates||(this.templates=Array.from(this.querySelectorAll("template"))),this.lastRequestTime=new Date().getTime(),this.configFilter()}configFilter(){var t;const r=this.getAncestorAttributeValue("dataFilterProvider");if(!r){this.next();return}this.filterPublisher=N.getInstance().get(r),(t=this.filterPublisher)==null||t.onInternalMutation(this.updateFilteredContent)}storeScrollPosition(){this.storedScrollX=window.scrollX,this.storedScrollY=window.scrollY}updated(r){(Math.abs(this.storedScrollX-window.scrollX)>10||Math.abs(this.storedScrollY-window.scrollY)>10)&&window.scrollTo(this.storedScrollX,this.storedScrollY),window.requestAnimationFrame(()=>{(Math.abs(this.storedScrollX-window.scrollX)>10||Math.abs(this.storedScrollY-window.scrollY)>10)&&window.scrollTo(this.storedScrollX,this.storedScrollY)}),super.updated(r)}resetDuration(){this.lastRequestTime=new Date().getTime()}next(r){var p,m,b;let t=this.offset;const i=new Date().getTime()-this.lastRequestTime;if(!this.nextHadEvent&&r&&(this.publisher.resultCount=0,this.resultCount=0),this.nextHadEvent=!!r,r){if(this.publisher.lastFetchedData=r.detail.fetchedData,r.detail.requestId<this.requestId)return;if(this.resultCount+=((p=r.detail.props)==null?void 0:p.length)||0,!r.detail.isFirstLoad||!((m=r.detail.props)!=null&&m.length)||this.dataProviderExpression.indexOf("$offset")==-1){this.publisher.resultCount=this.resultCount;return}}if(Array.isArray(this.props)){const v=this.props,P=v[v.length-1];t=parseInt(P.offset.toString())+parseInt(P.limit.toString())}else{const v=[];v.resultCount=this.resultCount,v.lastFetchedData=(r==null?void 0:r.detail.fetchedData)||{},this.props=v}i>0&&r&&!this.localStorage&&(this.limit=Math.round(this.limit/i*this.targetRequestDuration)),this.limit<1&&(this.limit=1),this.limit>15&&(this.limit=15);let e=this.dataProviderExpression.replace("$offset",t+"").replace("$limit",this.limit+"");const o=e.split("?");let n=o.shift();const a=new URLSearchParams(o.join("?")),c=(b=this.filterPublisher)==null?void 0:b.get(),h=this.filteredFields.split(" ");for(const v in c)this.filteredFields&&h.includes(v)||c[v]==null||c[v]==""||a.set(v,c[v]);this.searchHash||(this.searchHash=a.toString()),n=n+"?"+a.toString(),e=e+"_item_from_queue_"+this.instanceId,this.listDataProviders.push(e);const d=[...this.props,{id:a.toString()+"/"+this.props.length,dataProvider:e,endPoint:n,offset:t,limit:this.limit}];d.resultCount=this.resultCount,d.lastFetchedData=(r==null?void 0:r.detail.fetchedData)||{},this.props=d,this.lastRequestTime=new Date().getTime()}render(){if(!Array.isArray(this.props))return A;this.storeScrollPosition();let r=!this.noLazyload;return this.props.length==1&&(r=!1),this.style.display="block",g`
|
|
1224
1224
|
${po(this.props,(t,s)=>{var e;const i=s==0?this.templates:(e=this.templates)==null?void 0:e.filter(o=>o.getAttribute("data-value")!="no-item");return g`
|
|
1225
1225
|
<sonic-list
|
|
1226
1226
|
fetch
|
|
@@ -2012,7 +2012,7 @@
|
|
|
2012
2012
|
:host([shadow="none"]) .shadowable {
|
|
2013
2013
|
box-shadow: none;
|
|
2014
2014
|
}
|
|
2015
|
-
`;var Wl=Object.defineProperty,Kl=Object.getOwnPropertyDescriptor,te=(r,t,s,i)=>{for(var e=i>1?void 0:i?Kl(t,s):t,o=r.length-1,n;o>=0;o--)(n=r[o])&&(e=(i?n(t,s,e):n(e))||e);return i&&e&&Wl(t,s,e),e};const Yl="sonic-pop";let at=class extends _{constructor(){super(...arguments),this.open=!1,this.noToggle=!1,this.inline=!1,this.shadow="lg",this.placement="bottom",this.positioningRuns=!1,this.lastContentX=0,this.lastContentY=0,this.resizeObserver=new ResizeObserver(()=>this.computePosition(this.placement)),this.ancestorsHavingZIndex=new Set}runPositioningLoop(){this.positioningRuns&&(this.positioningRuns=!0,this.computePosition(this.placement),window.requestAnimationFrame(()=>this.runPositioningLoop()))}toggle(r){if(this.open&&this.noToggle)return;const t=r;r.type=="keydown"&&(t.key!="ArrowDown"||this.open)||(this.open=!this.open,this.open?this.show():this.hide())}show(){this.setMaxZindex(),this.popContent.style.removeProperty("display"),this.open=!0,this.popContent.setAttribute("tabindex","0"),this.popBtn&&this.popContent&&!this.positioningRuns&&(this.positioningRuns=!0,this.lastContentX=0,this.lastContentY=0,this.runPositioningLoop()),this.dispatchEvent(new CustomEvent("show"))}hide(){this.resetZindexes(),this.open=!1,this.popContent.setAttribute("tabindex","-1"),this.positioningRuns=!1,this.dispatchEvent(new CustomEvent("hide"))}setMaxZindex(){
|
|
2015
|
+
`;var Wl=Object.defineProperty,Kl=Object.getOwnPropertyDescriptor,te=(r,t,s,i)=>{for(var e=i>1?void 0:i?Kl(t,s):t,o=r.length-1,n;o>=0;o--)(n=r[o])&&(e=(i?n(t,s,e):n(e))||e);return i&&e&&Wl(t,s,e),e};const Yl="sonic-pop";let at=class extends _{constructor(){super(...arguments),this.open=!1,this.noToggle=!1,this.inline=!1,this.shadow="lg",this.placement="bottom",this.positioningRuns=!1,this.lastContentX=0,this.lastContentY=0,this.resizeObserver=new ResizeObserver(()=>this.computePosition(this.placement)),this.ancestorsHavingZIndex=new Set}runPositioningLoop(){this.positioningRuns&&(this.positioningRuns=!0,this.computePosition(this.placement),window.requestAnimationFrame(()=>this.runPositioningLoop()))}toggle(r){if(this.open&&this.noToggle)return;const t=r;r.type=="keydown"&&(t.key!="ArrowDown"||this.open)||(this.open=!this.open,this.open?this.show():this.hide())}show(){this.setMaxZindex(),this.popContent.style.removeProperty("display"),this.open=!0,this.popContent.setAttribute("tabindex","0"),this.popBtn&&this.popContent&&!this.positioningRuns&&(this.positioningRuns=!0,this.lastContentX=0,this.lastContentY=0,this.runPositioningLoop()),this.dispatchEvent(new CustomEvent("show"))}hide(){this.resetZindexes(),this.open=!1,this.popContent.setAttribute("tabindex","-1"),this.positioningRuns=!1,this.dispatchEvent(new CustomEvent("hide"))}setMaxZindex(){K.everyAncestors(this,r=>{const t=r;if(!t.className)return!0;if([...t.classList].includes("@container")){const s=t.style;s.zIndex="999999999";const i=getComputedStyle(t);return i.position!=="relative"&&i.position!=="absolute"&&(s.position="relative"),this.ancestorsHavingZIndex.add(r),!1}return!0})}resetZindexes(){this.ancestorsHavingZIndex.forEach(r=>{r.style.removeProperty("position"),r.style.removeProperty("z-index")}),this.ancestorsHavingZIndex.clear()}_handleClosePop(r){const t=r.composedPath(),s=t[0];at.pops.forEach(i=>{const e=t.includes(i),o=t.includes(i.querySelector('[slot="content"]')),n=K.getAncestorAttributeValue(s,"data-on-select")==="keep";r.type=="pointerdown"&&e||r.type=="click"&&(e&&n||!o)||i.hide()})}connectedCallback(){super.connectedCallback(),at.pops.size==0&&(document.addEventListener("pointerdown",this._handleClosePop),document.addEventListener("click",this._handleClosePop)),at.pops.add(this)}firstUpdated(r){super.firstUpdated(r),this.resizeObserver.observe(this.popContent)}disconnectedCallback(){this.popContent&&this.resizeObserver.unobserve(this.popContent),super.disconnectedCallback(),at.pops.delete(this),at.pops.size==0&&(document.removeEventListener("pointerdown",this._handleClosePop),document.removeEventListener("click",this._handleClosePop))}computePosition(r){var E,B,W,Ot;const t=r.split(" "),s=t[0];let i=t[1],e=(E=this.popContent)==null?void 0:E.getBoundingClientRect();const o=5,n=this.getBoundingClientRect(),a=K.getScrollableAncestor(this.popContent),c=a==null?void 0:a.getBoundingClientRect(),h=Math.max(0,(c==null?void 0:c.left)||0)+o,d=Math.max(0,(c==null?void 0:c.top)||0)+o,p=Math.min(window.innerWidth,(c==null?void 0:c.right)||window.innerWidth)-o,m=Math.min(window.innerHeight,(c==null?void 0:c.bottom)||window.innerHeight)-o,b=n.left,v=n.top;let P=b,S=v;const D=v-e.height,u=b-e.width,f=b+n.width,y=v+n.height,C=b+(n.width-e.width)*.5,O=v+(n.height-e.height)*.5;switch(s){case"bottom":S=y,i=="center"&&(P=C);break;case"top":S=D,i=="center"&&(P=C);break;case"left":P=u,i=="center"&&(S=O);break;case"right":P=f,i=="center"&&(S=O);break}this.lastContentX+=P-e.x,this.lastContentY+=S-e.y,Object.assign(this.popContent.style,{left:`${this.lastContentX}px`,top:`${this.lastContentY}px`}),e=(B=this.popContent)==null?void 0:B.getBoundingClientRect(),e.x<h&&s=="left"&&(P=f),e.y<d&&s=="top"&&(S=y),e.x+e.width>p&&s=="right"&&(P=u),e.y+e.height>m&&s=="bottom"&&(S=D),this.lastContentX+=P-e.x,this.lastContentY+=S-e.y,Object.assign(this.popContent.style,{left:`${this.lastContentX}px`,top:`${this.lastContentY}px`}),e=(W=this.popContent)==null?void 0:W.getBoundingClientRect(),e.x<h&&(this.lastContentX+=h-e.x),e.y<d&&(this.lastContentY+=d-e.y),Object.assign(this.popContent.style,{left:`${this.lastContentX}px`,top:`${this.lastContentY}px`}),e=(Ot=this.popContent)==null?void 0:Ot.getBoundingClientRect(),e.x+e.width>p&&(this.lastContentX+=p-(e.x+e.width)),e.y+e.height>m&&(this.lastContentY+=m-(e.y+e.height)),Object.assign(this.popContent.style,{left:`${this.lastContentX}px`,top:`${this.lastContentY}px`})}render(){return g`
|
|
2016
2016
|
<slot
|
|
2017
2017
|
@click=${this.toggle}
|
|
2018
2018
|
@keydown=${this.toggle}
|
|
@@ -2329,7 +2329,7 @@
|
|
|
2329
2329
|
width: 0.6em;
|
|
2330
2330
|
width: round(0.6em, 1px);
|
|
2331
2331
|
}
|
|
2332
|
-
`],zi=pc([w(uc)],zi);var fc=Object.defineProperty,gc=Object.getOwnPropertyDescriptor,X=(r,t,s,i)=>{for(var e=i>1?void 0:i?gc(t,s):t,o=r.length-1,n;o>=0;o--)(n=r[o])&&(e=(i?n(t,s,e):n(e))||e);return i&&e&&fc(t,s,e),e};const mc="sonic-select";let
|
|
2332
|
+
`],zi=pc([w(uc)],zi);var fc=Object.defineProperty,gc=Object.getOwnPropertyDescriptor,X=(r,t,s,i)=>{for(var e=i>1?void 0:i?gc(t,s):t,o=r.length-1,n;o>=0;o--)(n=r[o])&&(e=(i?n(t,s,e):n(e))||e);return i&&e&&fc(t,s,e),e};const mc="sonic-select";let Z=class extends Me(Q(_)){constructor(){super(...arguments),this.valueKey="value",this.wordingKey="wording",this.multiple=!1,this.status="default",this._options=[],this.hasDoneFirstUpdate=!1,this._value="",this.updateOptions=()=>{const r=this.querySelectorAll("option");r.length>0&&(this.options=Array.from(r).map(t=>({value:t.value,wording:t.text,selected:t.hasAttribute("selected")})))},this.forceAutoFill=!1,this.hasDescription=!1,this.hasLabel=!1,this.hasSuffix=!1,this.hasPrefix=!1}set options(r){this._options=r;for(const s of r)s.selected&&(this.value=s.value||"");!(this.value||this.getAttribute("value"))&&this._options.length>0&&(this.value=this._options[0][this.valueKey]),this.requestUpdate()}get options(){return this._options}firstUpdated(r){this.hasDoneFirstUpdate=!0,super.firstUpdated(r)}set value(r){r==null&&!this.hasDoneFirstUpdate||(r||(r=""),this._value!=r&&(this._value=r,this.updateFormPublisherValue(),this.requestUpdate()))}get value(){return this._value}updateFormPublisherValue(){this.setFormPublisherValue(this.value)}connectedCallback(){super.connectedCallback(),this.hasSlotOrProps(),this.updateOptions()}get description(){return this._description}set description(r){this.hasAttribute("description")&&!this.forceAutoFill&&(r=this.getAttribute("description")),this._description=r,this.requestUpdate()}get label(){return this._label}set label(r){this.hasAttribute("label")&&!this.forceAutoFill&&(r=this.getAttribute("label")),this._label=r,this.requestUpdate()}willUpdate(r){this.hasSlotOrProps(),super.willUpdate(r)}hasSlotOrProps(){var r,t,s,i;this.hasLabel=!!(this.label||(r=this.slotLabelNodes)!=null&&r.length),this.hasDescription=!!(this.description||(t=this.slotDescriptionNodes)!=null&&t.length),this.hasSuffix=!!((s=this.slotSuffixNodes)!=null&&s.length),this.hasPrefix=!!((i=this.slotPrefixNodes)!=null&&i.length)}validateFormElement(){var s;const r=(s=this.shadowRoot)==null?void 0:s.querySelector("select");if(!r||r.checkValidity())return;const t=this.getFormPublisher();t&&(t.isFormValid=!1),r.reportValidity()}render(){const r={"has-prefix":this.hasPrefix,"has-suffix":this.hasSuffix};return g`
|
|
2333
2333
|
<label
|
|
2334
2334
|
for="form-element"
|
|
2335
2335
|
class="${this.hasLabel?"form-label":"hidden"}"
|
|
@@ -2380,7 +2380,7 @@
|
|
|
2380
2380
|
class="${this.hasDescription?"form-description":"hidden"}"
|
|
2381
2381
|
>${this.description?g`${F(this.description)}`:""}</slot
|
|
2382
2382
|
>
|
|
2383
|
-
`}};
|
|
2383
|
+
`}};Z.styles=[Lt,ji,Ks,Ys,$`
|
|
2384
2384
|
.form-element {
|
|
2385
2385
|
appearance: none;
|
|
2386
2386
|
}
|
|
@@ -2425,7 +2425,7 @@
|
|
|
2425
2425
|
background: transparent;
|
|
2426
2426
|
padding: 0;
|
|
2427
2427
|
}
|
|
2428
|
-
`],X([l({type:String})],
|
|
2428
|
+
`],X([l({type:String})],Z.prototype,"valueKey",2),X([l({type:String})],Z.prototype,"wordingKey",2),X([l({type:Boolean})],Z.prototype,"multiple",2),X([l({type:String,reflect:!0})],Z.prototype,"size",2),X([l({type:Number})],Z.prototype,"selectSize",2),X([l({type:String,reflect:!0})],Z.prototype,"status",2),X([l({type:Array})],Z.prototype,"options",1),X([l({reflect:!0})],Z.prototype,"value",1),X([l({type:Boolean})],Z.prototype,"forceAutoFill",2),X([l()],Z.prototype,"description",1),X([l()],Z.prototype,"label",1),X([rt({slot:"label",flatten:!0})],Z.prototype,"slotLabelNodes",2),X([rt({slot:"description",flatten:!0})],Z.prototype,"slotDescriptionNodes",2),X([rt({slot:"suffix",flatten:!0})],Z.prototype,"slotSuffixNodes",2),X([rt({slot:"prefix",flatten:!0})],Z.prototype,"slotPrefixNodes",2),X([T()],Z.prototype,"hasDescription",2),X([T()],Z.prototype,"hasLabel",2),X([T()],Z.prototype,"hasSuffix",2),X([T()],Z.prototype,"hasPrefix",2),Z=X([w(mc)],Z);var bc=Object.defineProperty,vc=Object.getOwnPropertyDescriptor,bt=(r,t,s,i)=>{for(var e=i>1?void 0:i?vc(t,s):t,o=r.length-1,n;o>=0;o--)(n=r[o])&&(e=(i?n(t,s,e):n(e))||e);return i&&e&&bc(t,s,e),e};const yc="sonic-textarea";let ht=class extends zs(Me(Q(_))){constructor(){super(...arguments),this.size="md",this.readonly=!1,this.resize="vertical",this.hasDescription=!1,this.hasLabel=!1}connectedCallback(){super.connectedCallback(),this.hasSlotOrProps()}willUpdate(r){this.hasSlotOrProps(),super.willUpdate(r)}hasSlotOrProps(){var r,t;this.hasLabel=!!(this.label||(r=this.slotLabelNodes)!=null&&r.length),this.hasDescription=!!(this.description||(t=this.slotDescriptionNodes)!=null&&t.length)}validateFormElement(){var s;const r=(s=this.shadowRoot)==null?void 0:s.querySelector("textarea");if(!r||r.checkValidity())return;const t=this.getFormPublisher();t&&(t.isFormValid=!1),r.reportValidity()}render(){const r={resize:this.resize};return g`
|
|
2429
2429
|
<label
|
|
2430
2430
|
for="${this.id||"form-element"}"
|
|
2431
2431
|
class="${this.hasLabel?"form-label":"hidden"}"
|
|
@@ -2911,7 +2911,7 @@ ${this.value}</textarea
|
|
|
2911
2911
|
}
|
|
2912
2912
|
`],wo([ne({selector:"sonic-button"})],Zs.prototype,"buttons",2),Zs=wo([w(Wc)],Zs);var Kc=Object.defineProperty,Yc=Object.getOwnPropertyDescriptor,$o=(r,t,s,i)=>{for(var e=i>1?void 0:i?Yc(t,s):t,o=r.length-1,n;o>=0;o--)(n=r[o])&&(e=(i?n(t,s,e):n(e))||e);return i&&e&&Kc(t,s,e),e};const Zc="sonic-modal-close";let Gs=class extends _{render(){return g`<sonic-button reset=${x(this.reset)} shape="circle" @click=${this.handleClick}
|
|
2913
2913
|
><sonic-icon name="cancel" size="lg"></sonic-icon
|
|
2914
|
-
></sonic-button>`}handleClick(){
|
|
2914
|
+
></sonic-button>`}handleClick(){K.getClosestElement(this,"sonic-modal").hide()}};Gs.styles=[$`
|
|
2915
2915
|
:host {
|
|
2916
2916
|
position: sticky;
|
|
2917
2917
|
display: block;
|