@supersoniks/concorde 3.1.6 → 3.1.7
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
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"date":
|
|
1
|
+
{"date":1719322801}
|
package/concorde-core.bundle.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(J){typeof define=="function"&&define.amd?define(J):J()})(function(){"use strict";var jt,k,L,Er,t,Y;let J=class Mt{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 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=Mt.getAncestorAttributeValue(t,"token"),i=Mt.getAncestorAttributeValue(t,"addHTTPResponse")!=null,e=Mt.getAncestorAttributeValue(t,"serviceURL");let o=null,n=null;const l=Mt.getAncestorAttributeValue(t,"tokenProvider"),c=Mt.getAncestorAttributeValue(t,"eventsApiToken");s||(o=Mt.getAncestorAttributeValue(t,"userName"),n=Mt.getAncestorAttributeValue(t,"password"));const h=Mt.getAncestorAttributeValue(t,"credentials")||void 0,d=t.getAttribute("cache"),f=t.hasAttribute("blockUntilDone");return{serviceURL:e,token:s,userName:o,password:n,authToken:c,tokenProvider:l,addHTTPResponse:i,credentials:h,cache:d,blockUntilDone:f}}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 Mt.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)})}},os=class{static ucFirst(t){return typeof t!="string"?t:t.charAt(0).toUpperCase()+t.substring(1)}static minutesDuration(t,s="",i="long"){s||(s=J.getLanguage());const e=(h,d)=>[Math.floor(h/d),h%d];function o(h,d,f){return new Intl.NumberFormat(h,{style:"unit",unit:d,unitDisplay:f}).format}const[n,l]=e(t,60),c=[];return n&&c.push(o(s,"hour",i)(n)),l&&c.push(o(s,"minute",i)(l)),new Intl.ListFormat(s,{style:"long",type:"conjunction"}).format(c)}static js(t){try{return Function("return "+t)()}catch{return""}}};function Te(r){return typeof r=="object"&&r!=null}const Tr=async()=>new Promise(r=>{window.queueMicrotask(()=>r(null))});let Pe="sonic";typeof __SONIC_PREFIX__>"u"&&(Pe="sonic"+Math.floor(Math.random()*1e6));const Es=Pe=="sonic"?"publisher-proxies-data":Pe+"-publisher-proxies-data";let Ns=(jt=class{constructor(t,s){for(this._proxies_=new Map,this._is_savable_=!1,this._invalidateListeners_=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.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._assignListeners_.clear(),this._mutationListeners_.clear(),this._fillListeners_.clear(),this._templateFillListeners_.clear(),this._proxies_.clear(),jt.instances.delete(this._instanceCounter_)}hasListener(){return this._templateFillListeners_.size>0||this._assignListeners_.size>0||this._invalidateListeners_.size>0||this._mutationListeners_.size>0||this._fillListeners_.size>0}_publishInternalMutation_(t=!1){if(this._mutationListeners_.forEach(s=>s()),this._is_savable_&&!E.changed){E.changed=!0,E.saveId++;const s=E.saveId;setTimeout(()=>E.getInstance().saveToLocalStorage(s),1e3)}t||this.parent&&this.parent._publishInternalMutation_()}async _publishAssignement_(t=!1){this._assignmentId_++;const s=this._assignmentId_;if(await Tr(),s!==this._assignmentId_)return;const i=this.get();this._assignListeners_.forEach(e=>e(i)),this._publishInternalMutation_(t)}_publishInvalidation_(){this._invalidateListeners_.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_()}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)}async set(t,s=!1){var o;if(this._value_===t||this._value_&&t&&Object.prototype.hasOwnProperty.call(this._value_,"__value")&&Object.prototype.hasOwnProperty.call(t,"__value")&&this._value_.__value===t.__value)return!0;const i=this._value_;if(this._value_=Te(t)?t:{__value:t},this._cachedGet_=void 0,Object.prototype.hasOwnProperty.call(this._value_,"__value"))return await this._publishAssignement_(s),!0;for(const n in this._value_)this._value_[n]===void 0&&delete this._value_[n];if(this._proxies_.forEach((n,l)=>{this._value_[l]===void 0&&l!="_parent_"&&i[l]&&(this._value_[l]=null)}),await this._publishAssignement_(),Te(this._value_))for(const n in this._value_){const l=t[n],h=Te(l)?l:{__value:l};if(!this._proxies_.has(n)){this._publishDynamicFilling_(n,l);continue}await((o=this._proxies_.get(n))==null?void 0:o.set(h,!0)),this._publishDynamicFilling_(n,l)}return!0}get(){if(this._cachedGet_!==void 0)return this._cachedGet_;if(E.modifiedCollectore.length>0&&E.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_}get $tag(){return this._instanceCounter_||(jt.instancesCounter++,this._instanceCounter_=jt.instancesCounter),jt.instances.set(this._instanceCounter_,this),"<"+Pe+'-publisher-proxy publisher="'+this._instanceCounter_+'"></'+Pe+"-publisher-proxy>"}},jt.instances=new Map,jt.instancesCounter=0,jt),E=(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(Es),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(Es,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.log("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_"+J.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 je(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_"+J.getLanguage()]={lastModifiationMS:new Date().getTime(),data:n},i=!0)}if(i){const e=await this.compress(JSON.stringify(this.localStorageData),"gzip");localStorage.setItem(Es,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 l=await new Response(o.readable).arrayBuffer(),c=new Uint8Array(l);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,l=new n.DecompressionStream(s),c=l.writable.getWriter();c.write(o),c.close();const h=await new Response(l.readable).arrayBuffer();return new TextDecoder().decode(h)}},k.buildDate="Tue Jun 25 2024 13:03:13 GMT+0200 (Central European Summer Time)",k.changed=!1,k.saving=!1,k.saveId=0,k.instance=null,k.instances=new Map,k.modifiedCollectore=[],k);const Ts=window;Ts.SonicPublisherManager||(Ts.SonicPublisherManager=E),Ts.SonicPublisherManager.registerInstance(E.getInstance());const jr=new Set(["invalidate","onInvalidate","offInvalidate","onAssign","offAssign","startDynamicFilling","stopDynamicFilling","startTemplateFilling","stopTemplateFilling","onInternalMutation","offInternalMutation","set","get","$tag","_cachedGet_","_templateFillListeners_","_fillListeners_","_assignListeners_","_invalidateListeners_","_publishInternalMutation_","hasListener","delete","_mutationListeners_","_publishDynamicFilling_","_publishInvalidation_","_publishTemplateFilling_","_publishAssignement_","_proxies_","parent","_value_","_is_savable_","_lockInternalMutationPublishing_","_instanceCounter_","_assignmentId_"]);class je extends Ns{constructor(t,s=null){super(t,s);const i=new Proxy(this,{get:function(e,o){if(o==Symbol.toPrimitive)return()=>i.get();if(jr.has(o))return e[o];if(!e._proxies_.has(o)){const n=e._value_[o],l=new je(Te(n)?n:{__value:n},e);l._proxies_.set("_parent_",i),e._proxies_.set(o,l)}return e._proxies_.get(o)},set:function(e,o,n){var c;if(o=="_value_")return e._value_=n,!0;if(o=="_cachedGet_")return e._cachedGet_=n,!0;if(o=="_assignmentId_")return e._assignmentId_=n,!0;if(o=="_is_savable_")return e._is_savable_=n,!0;if(o=="_instanceCounter_")return e._instanceCounter_=n,!0;if(!e._proxies_.has(o)){const h=new je({},e);h._proxies_.set("_parent_",i),e._proxies_.set(o,h)}return e._value_[o]!==n&&(e._value_[o]=n,e._publishDynamicFilling_(o,n),(c=e._proxies_.get(o))==null||c.set(Te(n)?n:{__value:n})),!0},deleteProperty:function(e,o){var n;return e._publishDynamicFilling_(o,null),(n=e._proxies_.get(o))==null||n.set(null),delete e._value_[o]},has:function(e,o){return o in e._value_&&o!="_lockInternalMutationPublishing_"},defineProperty:function(e,o,n){return n&&"value"in n&&(e._value_[o]=n.value),!0},getOwnPropertyDescriptor:function(e,o){return{enumerable:!0,configurable:!0}},ownKeys:function(e){return e._value_.__value?Object.keys(e._value_.__value):Object.keys(e._value_)}});return i}toString(){return"hey"}valueOf(){return 2}getProperty(t,s){return t[s]}}class Mr extends HTMLElement{constructor(){super(),this.publisherId="",this.onAssign=t=>{this.innerHTML=t.toString()}}connectedCallback(){var t;this.publisherId=this.getAttribute("publisher")||"",this.publisher=Ns.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(Pe+"-publisher-proxy",Mr)}catch{}let ns=(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=J.getAncestorAttributeValue(t.parentNode||t.host||t,"dataProvider");if(!s)return;const i=E.getInstance().get(s),e=L.getDataBindItems(t),o=[];e.forEach(n=>{const l=n.bindedVariablesDescriptor,c=n.propertyToUpdate;for(const h of l.variables){const d=h;let f=i;f=L.getSubPublisher(i,d);const m=t,b={publisher:f,onAssign:()=>{const _=l.variables.map(D=>{var p;return(p=L.getSubPublisher(i,D))==null?void 0:p.get()});let C=l.expression,O=!1;if(_.length==1&&l.variables[0].join(".")==C.substring(1)){let D=_[0];D===null&&(D=""),m[c]=D;return}for(let D=0;D<_.length;D++){let p=_[D];const u=l.variables[D];p===null&&(O=!0,p=void 0),C=C.replace("$"+u.join("."),p)}if(C.indexOf("|")!=-1){const D=C.indexOf("|");if(D==0)C=os.js(C.substring(1));else{const p=C.substring(0,D),u=C.substring(D+1),y=os[p];C=O?"":y?y(u):C}}else C=O?"":C;m[c]=C}};f==null||f.onAssign(b.onAssign),o.push(b)}}),L.publisherListeners.set(t,o)}},L.observedElements=new Map,L.enabled=!0,L.publisherListeners=new Map,L);ns.observe(document.documentElement),window.SonicDataBindObserver||(window.SonicDataBindObserver=ns);let X=class te{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 l=t[n],c=s[n];if(i?l!==c:l!=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 l=t[n],c=s[n],h=te.isObject(l)&&te.isObject(c),d=i?l!==c:l!=c;if(h&&!te.deepEqual(l,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 te.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&&te.isObject(o)?t=Object.assign(Array.isArray(o)?[]:{},t,o):t=t[e]}return t}static getURLSearchArray(t,s=""){let i=[];for(let e in t){const o=t[e];s&&(e=s+"["+e+"]"),te.isObject(o)?i=[...i,...this.getURLSearchArray(o,e)]:i.push(`${e}=${o}`)}return i}static getURLSearchString(t){return te.getURLSearchArray(t,"").join("&")}};/**
|
|
1
|
+
(function(J){typeof define=="function"&&define.amd?define(J):J()})(function(){"use strict";var jt,k,L,Er,t,Y;let J=class Mt{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 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=Mt.getAncestorAttributeValue(t,"token"),i=Mt.getAncestorAttributeValue(t,"addHTTPResponse")!=null,e=Mt.getAncestorAttributeValue(t,"serviceURL");let o=null,n=null;const l=Mt.getAncestorAttributeValue(t,"tokenProvider"),c=Mt.getAncestorAttributeValue(t,"eventsApiToken");s||(o=Mt.getAncestorAttributeValue(t,"userName"),n=Mt.getAncestorAttributeValue(t,"password"));const h=Mt.getAncestorAttributeValue(t,"credentials")||void 0,d=t.getAttribute("cache"),f=t.hasAttribute("blockUntilDone");return{serviceURL:e,token:s,userName:o,password:n,authToken:c,tokenProvider:l,addHTTPResponse:i,credentials:h,cache:d,blockUntilDone:f}}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 Mt.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)})}},os=class{static ucFirst(t){return typeof t!="string"?t:t.charAt(0).toUpperCase()+t.substring(1)}static minutesDuration(t,s="",i="long"){s||(s=J.getLanguage());const e=(h,d)=>[Math.floor(h/d),h%d];function o(h,d,f){return new Intl.NumberFormat(h,{style:"unit",unit:d,unitDisplay:f}).format}const[n,l]=e(t,60),c=[];return n&&c.push(o(s,"hour",i)(n)),l&&c.push(o(s,"minute",i)(l)),new Intl.ListFormat(s,{style:"long",type:"conjunction"}).format(c)}static js(t){try{return Function("return "+t)()}catch{return""}}};function Te(r){return typeof r=="object"&&r!=null}const Tr=async()=>new Promise(r=>{window.queueMicrotask(()=>r(null))});let Pe="sonic";typeof __SONIC_PREFIX__>"u"&&(Pe="sonic"+Math.floor(Math.random()*1e6));const Es=Pe=="sonic"?"publisher-proxies-data":Pe+"-publisher-proxies-data";let Ns=(jt=class{constructor(t,s){for(this._proxies_=new Map,this._is_savable_=!1,this._invalidateListeners_=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.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._assignListeners_.clear(),this._mutationListeners_.clear(),this._fillListeners_.clear(),this._templateFillListeners_.clear(),this._proxies_.clear(),jt.instances.delete(this._instanceCounter_)}hasListener(){return this._templateFillListeners_.size>0||this._assignListeners_.size>0||this._invalidateListeners_.size>0||this._mutationListeners_.size>0||this._fillListeners_.size>0}_publishInternalMutation_(t=!1){if(this._mutationListeners_.forEach(s=>s()),this._is_savable_&&!E.changed){E.changed=!0,E.saveId++;const s=E.saveId;setTimeout(()=>E.getInstance().saveToLocalStorage(s),1e3)}t||this.parent&&this.parent._publishInternalMutation_()}async _publishAssignement_(t=!1){this._assignmentId_++;const s=this._assignmentId_;if(await Tr(),s!==this._assignmentId_)return;const i=this.get();this._assignListeners_.forEach(e=>e(i)),this._publishInternalMutation_(t)}_publishInvalidation_(){this._invalidateListeners_.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_()}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)}async set(t,s=!1){var o;if(this._value_===t||this._value_&&t&&Object.prototype.hasOwnProperty.call(this._value_,"__value")&&Object.prototype.hasOwnProperty.call(t,"__value")&&this._value_.__value===t.__value)return!0;const i=this._value_;if(this._value_=Te(t)?t:{__value:t},this._cachedGet_=void 0,Object.prototype.hasOwnProperty.call(this._value_,"__value"))return await this._publishAssignement_(s),!0;for(const n in this._value_)this._value_[n]===void 0&&delete this._value_[n];if(this._proxies_.forEach((n,l)=>{this._value_[l]===void 0&&l!="_parent_"&&i[l]&&(this._value_[l]=null)}),await this._publishAssignement_(),Te(this._value_))for(const n in this._value_){const l=t[n],h=Te(l)?l:{__value:l};if(!this._proxies_.has(n)){this._publishDynamicFilling_(n,l);continue}await((o=this._proxies_.get(n))==null?void 0:o.set(h,!0)),this._publishDynamicFilling_(n,l)}return!0}get(){if(this._cachedGet_!==void 0)return this._cachedGet_;if(E.modifiedCollectore.length>0&&E.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_}get $tag(){return this._instanceCounter_||(jt.instancesCounter++,this._instanceCounter_=jt.instancesCounter),jt.instances.set(this._instanceCounter_,this),"<"+Pe+'-publisher-proxy publisher="'+this._instanceCounter_+'"></'+Pe+"-publisher-proxy>"}},jt.instances=new Map,jt.instancesCounter=0,jt),E=(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(Es),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(Es,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.log("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_"+J.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 je(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_"+J.getLanguage()]={lastModifiationMS:new Date().getTime(),data:n},i=!0)}if(i){const e=await this.compress(JSON.stringify(this.localStorageData),"gzip");localStorage.setItem(Es,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 l=await new Response(o.readable).arrayBuffer(),c=new Uint8Array(l);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,l=new n.DecompressionStream(s),c=l.writable.getWriter();c.write(o),c.close();const h=await new Response(l.readable).arrayBuffer();return new TextDecoder().decode(h)}},k.buildDate="Tue Jun 25 2024 15:40:01 GMT+0200 (Central European Summer Time)",k.changed=!1,k.saving=!1,k.saveId=0,k.instance=null,k.instances=new Map,k.modifiedCollectore=[],k);const Ts=window;Ts.SonicPublisherManager||(Ts.SonicPublisherManager=E),Ts.SonicPublisherManager.registerInstance(E.getInstance());const jr=new Set(["invalidate","onInvalidate","offInvalidate","onAssign","offAssign","startDynamicFilling","stopDynamicFilling","startTemplateFilling","stopTemplateFilling","onInternalMutation","offInternalMutation","set","get","$tag","_cachedGet_","_templateFillListeners_","_fillListeners_","_assignListeners_","_invalidateListeners_","_publishInternalMutation_","hasListener","delete","_mutationListeners_","_publishDynamicFilling_","_publishInvalidation_","_publishTemplateFilling_","_publishAssignement_","_proxies_","parent","_value_","_is_savable_","_lockInternalMutationPublishing_","_instanceCounter_","_assignmentId_"]);class je extends Ns{constructor(t,s=null){super(t,s);const i=new Proxy(this,{get:function(e,o){if(o==Symbol.toPrimitive)return()=>i.get();if(jr.has(o))return e[o];if(!e._proxies_.has(o)){const n=e._value_[o],l=new je(Te(n)?n:{__value:n},e);l._proxies_.set("_parent_",i),e._proxies_.set(o,l)}return e._proxies_.get(o)},set:function(e,o,n){var c;if(o=="_value_")return e._value_=n,!0;if(o=="_cachedGet_")return e._cachedGet_=n,!0;if(o=="_assignmentId_")return e._assignmentId_=n,!0;if(o=="_is_savable_")return e._is_savable_=n,!0;if(o=="_instanceCounter_")return e._instanceCounter_=n,!0;if(!e._proxies_.has(o)){const h=new je({},e);h._proxies_.set("_parent_",i),e._proxies_.set(o,h)}return e._value_[o]!==n&&(e._value_[o]=n,e._publishDynamicFilling_(o,n),(c=e._proxies_.get(o))==null||c.set(Te(n)?n:{__value:n})),!0},deleteProperty:function(e,o){var n;return e._publishDynamicFilling_(o,null),(n=e._proxies_.get(o))==null||n.set(null),delete e._value_[o]},has:function(e,o){return o in e._value_&&o!="_lockInternalMutationPublishing_"},defineProperty:function(e,o,n){return n&&"value"in n&&(e._value_[o]=n.value),!0},getOwnPropertyDescriptor:function(e,o){return{enumerable:!0,configurable:!0}},ownKeys:function(e){return e._value_.__value?Object.keys(e._value_.__value):Object.keys(e._value_)}});return i}toString(){return"hey"}valueOf(){return 2}getProperty(t,s){return t[s]}}class Mr extends HTMLElement{constructor(){super(),this.publisherId="",this.onAssign=t=>{this.innerHTML=t.toString()}}connectedCallback(){var t;this.publisherId=this.getAttribute("publisher")||"",this.publisher=Ns.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(Pe+"-publisher-proxy",Mr)}catch{}let ns=(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=J.getAncestorAttributeValue(t.parentNode||t.host||t,"dataProvider");if(!s)return;const i=E.getInstance().get(s),e=L.getDataBindItems(t),o=[];e.forEach(n=>{const l=n.bindedVariablesDescriptor,c=n.propertyToUpdate;for(const h of l.variables){const d=h;let f=i;f=L.getSubPublisher(i,d);const m=t,b={publisher:f,onAssign:()=>{const _=l.variables.map(D=>{var p;return(p=L.getSubPublisher(i,D))==null?void 0:p.get()});let C=l.expression,O=!1;if(_.length==1&&l.variables[0].join(".")==C.substring(1)){let D=_[0];D===null&&(D=""),m[c]=D;return}for(let D=0;D<_.length;D++){let p=_[D];const u=l.variables[D];p===null&&(O=!0,p=void 0),C=C.replace("$"+u.join("."),p)}if(C.indexOf("|")!=-1){const D=C.indexOf("|");if(D==0)C=os.js(C.substring(1));else{const p=C.substring(0,D),u=C.substring(D+1),y=os[p];C=O?"":y?y(u):C}}else C=O?"":C;m[c]=C}};f==null||f.onAssign(b.onAssign),o.push(b)}}),L.publisherListeners.set(t,o)}},L.observedElements=new Map,L.enabled=!0,L.publisherListeners=new Map,L);ns.observe(document.documentElement),window.SonicDataBindObserver||(window.SonicDataBindObserver=ns);let X=class te{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 l=t[n],c=s[n];if(i?l!==c:l!=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 l=t[n],c=s[n],h=te.isObject(l)&&te.isObject(c),d=i?l!==c:l!=c;if(h&&!te.deepEqual(l,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 te.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&&te.isObject(o)?t=Object.assign(Array.isArray(o)?[]:{},t,o):t=t[e]}return t}static getURLSearchArray(t,s=""){let i=[];for(let e in t){const o=t[e];s&&(e=s+"["+e+"]"),te.isObject(o)?i=[...i,...this.getURLSearchArray(o,e)]:i.push(`${e}=${o}`)}return i}static getURLSearchString(t){return te.getURLSearchArray(t,"").join("&")}};/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2017 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -2339,7 +2339,7 @@
|
|
|
2339
2339
|
background: transparent;
|
|
2340
2340
|
padding: 0;
|
|
2341
2341
|
}
|
|
2342
|
-
`],Q([a({type:String})],K.prototype,"valueKey",2),Q([a({type:String})],K.prototype,"wordingKey",2),Q([a({type:Boolean})],K.prototype,"multiple",2),Q([a({type:String,reflect:!0})],K.prototype,"size",2),Q([a({type:Number})],K.prototype,"selectSize",2),Q([a({type:String,reflect:!0})],K.prototype,"status",2),Q([a({type:Array})],K.prototype,"options",1),Q([a({reflect:!0})],K.prototype,"value",1),Q([a({type:Boolean})],K.prototype,"forceAutoFill",2),Q([a()],K.prototype,"description",1),Q([a()],K.prototype,"label",1),Q([st({slot:"label",flatten:!0})],K.prototype,"slotLabelNodes",2),Q([st({slot:"description",flatten:!0})],K.prototype,"slotDescriptionNodes",2),Q([st({slot:"suffix",flatten:!0})],K.prototype,"slotSuffixNodes",2),Q([st({slot:"prefix",flatten:!0})],K.prototype,"slotPrefixNodes",2),Q([j()],K.prototype,"hasDescription",2),Q([j()],K.prototype,"hasLabel",2),Q([j()],K.prototype,"hasSuffix",2),Q([j()],K.prototype,"hasPrefix",2),K=Q([w(nl)],K);var al=Object.defineProperty,ll=Object.getOwnPropertyDescriptor,ut=(r,t,s,i)=>{for(var e=i>1?void 0:i?ll(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&&al(t,s,e),e};const cl="sonic-textarea";let lt=class extends ys(Oe(G(v))){constructor(){super(...arguments),this.size="",this.readonly=!1,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`
|
|
2342
|
+
`],Q([a({type:String})],K.prototype,"valueKey",2),Q([a({type:String})],K.prototype,"wordingKey",2),Q([a({type:Boolean})],K.prototype,"multiple",2),Q([a({type:String,reflect:!0})],K.prototype,"size",2),Q([a({type:Number})],K.prototype,"selectSize",2),Q([a({type:String,reflect:!0})],K.prototype,"status",2),Q([a({type:Array})],K.prototype,"options",1),Q([a({reflect:!0})],K.prototype,"value",1),Q([a({type:Boolean})],K.prototype,"forceAutoFill",2),Q([a()],K.prototype,"description",1),Q([a()],K.prototype,"label",1),Q([st({slot:"label",flatten:!0})],K.prototype,"slotLabelNodes",2),Q([st({slot:"description",flatten:!0})],K.prototype,"slotDescriptionNodes",2),Q([st({slot:"suffix",flatten:!0})],K.prototype,"slotSuffixNodes",2),Q([st({slot:"prefix",flatten:!0})],K.prototype,"slotPrefixNodes",2),Q([j()],K.prototype,"hasDescription",2),Q([j()],K.prototype,"hasLabel",2),Q([j()],K.prototype,"hasSuffix",2),Q([j()],K.prototype,"hasPrefix",2),K=Q([w(nl)],K);var al=Object.defineProperty,ll=Object.getOwnPropertyDescriptor,ut=(r,t,s,i)=>{for(var e=i>1?void 0:i?ll(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&&al(t,s,e),e};const cl="sonic-textarea";let lt=class extends ys(Oe(G(v))){constructor(){super(...arguments),this.size="md",this.readonly=!1,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`
|
|
2343
2343
|
<label
|
|
2344
2344
|
for="${this.id||"form-element"}"
|
|
2345
2345
|
class="${this.hasLabel?"form-label":"hidden"}"
|
package/concorde-core.es.js
CHANGED
|
@@ -463,7 +463,7 @@ let N = (k = class {
|
|
|
463
463
|
const h = await new Response(l.readable).arrayBuffer();
|
|
464
464
|
return new TextDecoder().decode(h);
|
|
465
465
|
}
|
|
466
|
-
}, k.buildDate = "Tue Jun 25 2024
|
|
466
|
+
}, k.buildDate = "Tue Jun 25 2024 15:40:01 GMT+0200 (Central European Summer Time)", k.changed = !1, k.saving = !1, k.saveId = 0, k.instance = null, k.instances = /* @__PURE__ */ new Map(), k.modifiedCollectore = [], k);
|
|
467
467
|
const Us = window;
|
|
468
468
|
Us.SonicPublisherManager || (Us.SonicPublisherManager = N);
|
|
469
469
|
Us.SonicPublisherManager.registerInstance(
|
|
@@ -8923,7 +8923,7 @@ var Ol = Object.defineProperty, Dl = Object.getOwnPropertyDescriptor, ut = (r, t
|
|
|
8923
8923
|
const kl = "sonic-textarea";
|
|
8924
8924
|
let at = class extends Os(De(Y(y))) {
|
|
8925
8925
|
constructor() {
|
|
8926
|
-
super(...arguments), this.size = "", this.readonly = !1, this.hasDescription = !1, this.hasLabel = !1;
|
|
8926
|
+
super(...arguments), this.size = "md", this.readonly = !1, this.hasDescription = !1, this.hasLabel = !1;
|
|
8927
8927
|
}
|
|
8928
8928
|
connectedCallback() {
|
|
8929
8929
|
super.connectedCallback(), this.hasSlotOrProps();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(J){typeof define=="function"&&define.amd?define(J):J()})(function(){"use strict";var jt,k,L,Er,t,Y;let J=class Mt{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 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=Mt.getAncestorAttributeValue(t,"token"),i=Mt.getAncestorAttributeValue(t,"addHTTPResponse")!=null,e=Mt.getAncestorAttributeValue(t,"serviceURL");let o=null,n=null;const l=Mt.getAncestorAttributeValue(t,"tokenProvider"),c=Mt.getAncestorAttributeValue(t,"eventsApiToken");s||(o=Mt.getAncestorAttributeValue(t,"userName"),n=Mt.getAncestorAttributeValue(t,"password"));const h=Mt.getAncestorAttributeValue(t,"credentials")||void 0,d=t.getAttribute("cache"),f=t.hasAttribute("blockUntilDone");return{serviceURL:e,token:s,userName:o,password:n,authToken:c,tokenProvider:l,addHTTPResponse:i,credentials:h,cache:d,blockUntilDone:f}}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 Mt.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)})}},os=class{static ucFirst(t){return typeof t!="string"?t:t.charAt(0).toUpperCase()+t.substring(1)}static minutesDuration(t,s="",i="long"){s||(s=J.getLanguage());const e=(h,d)=>[Math.floor(h/d),h%d];function o(h,d,f){return new Intl.NumberFormat(h,{style:"unit",unit:d,unitDisplay:f}).format}const[n,l]=e(t,60),c=[];return n&&c.push(o(s,"hour",i)(n)),l&&c.push(o(s,"minute",i)(l)),new Intl.ListFormat(s,{style:"long",type:"conjunction"}).format(c)}static js(t){try{return Function("return "+t)()}catch{return""}}};function Te(r){return typeof r=="object"&&r!=null}const Tr=async()=>new Promise(r=>{window.queueMicrotask(()=>r(null))});let Pe="sonic";typeof __SONIC_PREFIX__>"u"&&(Pe="sonic"+Math.floor(Math.random()*1e6));const Es=Pe=="sonic"?"publisher-proxies-data":Pe+"-publisher-proxies-data";let Ns=(jt=class{constructor(t,s){for(this._proxies_=new Map,this._is_savable_=!1,this._invalidateListeners_=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.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._assignListeners_.clear(),this._mutationListeners_.clear(),this._fillListeners_.clear(),this._templateFillListeners_.clear(),this._proxies_.clear(),jt.instances.delete(this._instanceCounter_)}hasListener(){return this._templateFillListeners_.size>0||this._assignListeners_.size>0||this._invalidateListeners_.size>0||this._mutationListeners_.size>0||this._fillListeners_.size>0}_publishInternalMutation_(t=!1){if(this._mutationListeners_.forEach(s=>s()),this._is_savable_&&!E.changed){E.changed=!0,E.saveId++;const s=E.saveId;setTimeout(()=>E.getInstance().saveToLocalStorage(s),1e3)}t||this.parent&&this.parent._publishInternalMutation_()}async _publishAssignement_(t=!1){this._assignmentId_++;const s=this._assignmentId_;if(await Tr(),s!==this._assignmentId_)return;const i=this.get();this._assignListeners_.forEach(e=>e(i)),this._publishInternalMutation_(t)}_publishInvalidation_(){this._invalidateListeners_.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_()}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)}async set(t,s=!1){var o;if(this._value_===t||this._value_&&t&&Object.prototype.hasOwnProperty.call(this._value_,"__value")&&Object.prototype.hasOwnProperty.call(t,"__value")&&this._value_.__value===t.__value)return!0;const i=this._value_;if(this._value_=Te(t)?t:{__value:t},this._cachedGet_=void 0,Object.prototype.hasOwnProperty.call(this._value_,"__value"))return await this._publishAssignement_(s),!0;for(const n in this._value_)this._value_[n]===void 0&&delete this._value_[n];if(this._proxies_.forEach((n,l)=>{this._value_[l]===void 0&&l!="_parent_"&&i[l]&&(this._value_[l]=null)}),await this._publishAssignement_(),Te(this._value_))for(const n in this._value_){const l=t[n],h=Te(l)?l:{__value:l};if(!this._proxies_.has(n)){this._publishDynamicFilling_(n,l);continue}await((o=this._proxies_.get(n))==null?void 0:o.set(h,!0)),this._publishDynamicFilling_(n,l)}return!0}get(){if(this._cachedGet_!==void 0)return this._cachedGet_;if(E.modifiedCollectore.length>0&&E.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_}get $tag(){return this._instanceCounter_||(jt.instancesCounter++,this._instanceCounter_=jt.instancesCounter),jt.instances.set(this._instanceCounter_,this),"<"+Pe+'-publisher-proxy publisher="'+this._instanceCounter_+'"></'+Pe+"-publisher-proxy>"}},jt.instances=new Map,jt.instancesCounter=0,jt),E=(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(Es),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(Es,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.log("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_"+J.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 je(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_"+J.getLanguage()]={lastModifiationMS:new Date().getTime(),data:n},i=!0)}if(i){const e=await this.compress(JSON.stringify(this.localStorageData),"gzip");localStorage.setItem(Es,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 l=await new Response(o.readable).arrayBuffer(),c=new Uint8Array(l);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,l=new n.DecompressionStream(s),c=l.writable.getWriter();c.write(o),c.close();const h=await new Response(l.readable).arrayBuffer();return new TextDecoder().decode(h)}},k.buildDate="Tue Jun 25 2024 13:03:13 GMT+0200 (Central European Summer Time)",k.changed=!1,k.saving=!1,k.saveId=0,k.instance=null,k.instances=new Map,k.modifiedCollectore=[],k);const Ts=window;Ts.SonicPublisherManager||(Ts.SonicPublisherManager=E),Ts.SonicPublisherManager.registerInstance(E.getInstance());const jr=new Set(["invalidate","onInvalidate","offInvalidate","onAssign","offAssign","startDynamicFilling","stopDynamicFilling","startTemplateFilling","stopTemplateFilling","onInternalMutation","offInternalMutation","set","get","$tag","_cachedGet_","_templateFillListeners_","_fillListeners_","_assignListeners_","_invalidateListeners_","_publishInternalMutation_","hasListener","delete","_mutationListeners_","_publishDynamicFilling_","_publishInvalidation_","_publishTemplateFilling_","_publishAssignement_","_proxies_","parent","_value_","_is_savable_","_lockInternalMutationPublishing_","_instanceCounter_","_assignmentId_"]);class je extends Ns{constructor(t,s=null){super(t,s);const i=new Proxy(this,{get:function(e,o){if(o==Symbol.toPrimitive)return()=>i.get();if(jr.has(o))return e[o];if(!e._proxies_.has(o)){const n=e._value_[o],l=new je(Te(n)?n:{__value:n},e);l._proxies_.set("_parent_",i),e._proxies_.set(o,l)}return e._proxies_.get(o)},set:function(e,o,n){var c;if(o=="_value_")return e._value_=n,!0;if(o=="_cachedGet_")return e._cachedGet_=n,!0;if(o=="_assignmentId_")return e._assignmentId_=n,!0;if(o=="_is_savable_")return e._is_savable_=n,!0;if(o=="_instanceCounter_")return e._instanceCounter_=n,!0;if(!e._proxies_.has(o)){const h=new je({},e);h._proxies_.set("_parent_",i),e._proxies_.set(o,h)}return e._value_[o]!==n&&(e._value_[o]=n,e._publishDynamicFilling_(o,n),(c=e._proxies_.get(o))==null||c.set(Te(n)?n:{__value:n})),!0},deleteProperty:function(e,o){var n;return e._publishDynamicFilling_(o,null),(n=e._proxies_.get(o))==null||n.set(null),delete e._value_[o]},has:function(e,o){return o in e._value_&&o!="_lockInternalMutationPublishing_"},defineProperty:function(e,o,n){return n&&"value"in n&&(e._value_[o]=n.value),!0},getOwnPropertyDescriptor:function(e,o){return{enumerable:!0,configurable:!0}},ownKeys:function(e){return e._value_.__value?Object.keys(e._value_.__value):Object.keys(e._value_)}});return i}toString(){return"hey"}valueOf(){return 2}getProperty(t,s){return t[s]}}class Mr extends HTMLElement{constructor(){super(),this.publisherId="",this.onAssign=t=>{this.innerHTML=t.toString()}}connectedCallback(){var t;this.publisherId=this.getAttribute("publisher")||"",this.publisher=Ns.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(Pe+"-publisher-proxy",Mr)}catch{}let ns=(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=J.getAncestorAttributeValue(t.parentNode||t.host||t,"dataProvider");if(!s)return;const i=E.getInstance().get(s),e=L.getDataBindItems(t),o=[];e.forEach(n=>{const l=n.bindedVariablesDescriptor,c=n.propertyToUpdate;for(const h of l.variables){const d=h;let f=i;f=L.getSubPublisher(i,d);const m=t,b={publisher:f,onAssign:()=>{const _=l.variables.map(D=>{var p;return(p=L.getSubPublisher(i,D))==null?void 0:p.get()});let C=l.expression,O=!1;if(_.length==1&&l.variables[0].join(".")==C.substring(1)){let D=_[0];D===null&&(D=""),m[c]=D;return}for(let D=0;D<_.length;D++){let p=_[D];const u=l.variables[D];p===null&&(O=!0,p=void 0),C=C.replace("$"+u.join("."),p)}if(C.indexOf("|")!=-1){const D=C.indexOf("|");if(D==0)C=os.js(C.substring(1));else{const p=C.substring(0,D),u=C.substring(D+1),y=os[p];C=O?"":y?y(u):C}}else C=O?"":C;m[c]=C}};f==null||f.onAssign(b.onAssign),o.push(b)}}),L.publisherListeners.set(t,o)}},L.observedElements=new Map,L.enabled=!0,L.publisherListeners=new Map,L);ns.observe(document.documentElement),window.SonicDataBindObserver||(window.SonicDataBindObserver=ns);let X=class te{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 l=t[n],c=s[n];if(i?l!==c:l!=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 l=t[n],c=s[n],h=te.isObject(l)&&te.isObject(c),d=i?l!==c:l!=c;if(h&&!te.deepEqual(l,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 te.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&&te.isObject(o)?t=Object.assign(Array.isArray(o)?[]:{},t,o):t=t[e]}return t}static getURLSearchArray(t,s=""){let i=[];for(let e in t){const o=t[e];s&&(e=s+"["+e+"]"),te.isObject(o)?i=[...i,...this.getURLSearchArray(o,e)]:i.push(`${e}=${o}`)}return i}static getURLSearchString(t){return te.getURLSearchArray(t,"").join("&")}};/**
|
|
1
|
+
(function(J){typeof define=="function"&&define.amd?define(J):J()})(function(){"use strict";var jt,k,L,Er,t,Y;let J=class Mt{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 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=Mt.getAncestorAttributeValue(t,"token"),i=Mt.getAncestorAttributeValue(t,"addHTTPResponse")!=null,e=Mt.getAncestorAttributeValue(t,"serviceURL");let o=null,n=null;const l=Mt.getAncestorAttributeValue(t,"tokenProvider"),c=Mt.getAncestorAttributeValue(t,"eventsApiToken");s||(o=Mt.getAncestorAttributeValue(t,"userName"),n=Mt.getAncestorAttributeValue(t,"password"));const h=Mt.getAncestorAttributeValue(t,"credentials")||void 0,d=t.getAttribute("cache"),f=t.hasAttribute("blockUntilDone");return{serviceURL:e,token:s,userName:o,password:n,authToken:c,tokenProvider:l,addHTTPResponse:i,credentials:h,cache:d,blockUntilDone:f}}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 Mt.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)})}},os=class{static ucFirst(t){return typeof t!="string"?t:t.charAt(0).toUpperCase()+t.substring(1)}static minutesDuration(t,s="",i="long"){s||(s=J.getLanguage());const e=(h,d)=>[Math.floor(h/d),h%d];function o(h,d,f){return new Intl.NumberFormat(h,{style:"unit",unit:d,unitDisplay:f}).format}const[n,l]=e(t,60),c=[];return n&&c.push(o(s,"hour",i)(n)),l&&c.push(o(s,"minute",i)(l)),new Intl.ListFormat(s,{style:"long",type:"conjunction"}).format(c)}static js(t){try{return Function("return "+t)()}catch{return""}}};function Te(r){return typeof r=="object"&&r!=null}const Tr=async()=>new Promise(r=>{window.queueMicrotask(()=>r(null))});let Pe="sonic";typeof __SONIC_PREFIX__>"u"&&(Pe="sonic"+Math.floor(Math.random()*1e6));const Es=Pe=="sonic"?"publisher-proxies-data":Pe+"-publisher-proxies-data";let Ns=(jt=class{constructor(t,s){for(this._proxies_=new Map,this._is_savable_=!1,this._invalidateListeners_=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.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._assignListeners_.clear(),this._mutationListeners_.clear(),this._fillListeners_.clear(),this._templateFillListeners_.clear(),this._proxies_.clear(),jt.instances.delete(this._instanceCounter_)}hasListener(){return this._templateFillListeners_.size>0||this._assignListeners_.size>0||this._invalidateListeners_.size>0||this._mutationListeners_.size>0||this._fillListeners_.size>0}_publishInternalMutation_(t=!1){if(this._mutationListeners_.forEach(s=>s()),this._is_savable_&&!E.changed){E.changed=!0,E.saveId++;const s=E.saveId;setTimeout(()=>E.getInstance().saveToLocalStorage(s),1e3)}t||this.parent&&this.parent._publishInternalMutation_()}async _publishAssignement_(t=!1){this._assignmentId_++;const s=this._assignmentId_;if(await Tr(),s!==this._assignmentId_)return;const i=this.get();this._assignListeners_.forEach(e=>e(i)),this._publishInternalMutation_(t)}_publishInvalidation_(){this._invalidateListeners_.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_()}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)}async set(t,s=!1){var o;if(this._value_===t||this._value_&&t&&Object.prototype.hasOwnProperty.call(this._value_,"__value")&&Object.prototype.hasOwnProperty.call(t,"__value")&&this._value_.__value===t.__value)return!0;const i=this._value_;if(this._value_=Te(t)?t:{__value:t},this._cachedGet_=void 0,Object.prototype.hasOwnProperty.call(this._value_,"__value"))return await this._publishAssignement_(s),!0;for(const n in this._value_)this._value_[n]===void 0&&delete this._value_[n];if(this._proxies_.forEach((n,l)=>{this._value_[l]===void 0&&l!="_parent_"&&i[l]&&(this._value_[l]=null)}),await this._publishAssignement_(),Te(this._value_))for(const n in this._value_){const l=t[n],h=Te(l)?l:{__value:l};if(!this._proxies_.has(n)){this._publishDynamicFilling_(n,l);continue}await((o=this._proxies_.get(n))==null?void 0:o.set(h,!0)),this._publishDynamicFilling_(n,l)}return!0}get(){if(this._cachedGet_!==void 0)return this._cachedGet_;if(E.modifiedCollectore.length>0&&E.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_}get $tag(){return this._instanceCounter_||(jt.instancesCounter++,this._instanceCounter_=jt.instancesCounter),jt.instances.set(this._instanceCounter_,this),"<"+Pe+'-publisher-proxy publisher="'+this._instanceCounter_+'"></'+Pe+"-publisher-proxy>"}},jt.instances=new Map,jt.instancesCounter=0,jt),E=(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(Es),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(Es,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.log("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_"+J.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 je(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_"+J.getLanguage()]={lastModifiationMS:new Date().getTime(),data:n},i=!0)}if(i){const e=await this.compress(JSON.stringify(this.localStorageData),"gzip");localStorage.setItem(Es,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 l=await new Response(o.readable).arrayBuffer(),c=new Uint8Array(l);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,l=new n.DecompressionStream(s),c=l.writable.getWriter();c.write(o),c.close();const h=await new Response(l.readable).arrayBuffer();return new TextDecoder().decode(h)}},k.buildDate="Tue Jun 25 2024 15:40:01 GMT+0200 (Central European Summer Time)",k.changed=!1,k.saving=!1,k.saveId=0,k.instance=null,k.instances=new Map,k.modifiedCollectore=[],k);const Ts=window;Ts.SonicPublisherManager||(Ts.SonicPublisherManager=E),Ts.SonicPublisherManager.registerInstance(E.getInstance());const jr=new Set(["invalidate","onInvalidate","offInvalidate","onAssign","offAssign","startDynamicFilling","stopDynamicFilling","startTemplateFilling","stopTemplateFilling","onInternalMutation","offInternalMutation","set","get","$tag","_cachedGet_","_templateFillListeners_","_fillListeners_","_assignListeners_","_invalidateListeners_","_publishInternalMutation_","hasListener","delete","_mutationListeners_","_publishDynamicFilling_","_publishInvalidation_","_publishTemplateFilling_","_publishAssignement_","_proxies_","parent","_value_","_is_savable_","_lockInternalMutationPublishing_","_instanceCounter_","_assignmentId_"]);class je extends Ns{constructor(t,s=null){super(t,s);const i=new Proxy(this,{get:function(e,o){if(o==Symbol.toPrimitive)return()=>i.get();if(jr.has(o))return e[o];if(!e._proxies_.has(o)){const n=e._value_[o],l=new je(Te(n)?n:{__value:n},e);l._proxies_.set("_parent_",i),e._proxies_.set(o,l)}return e._proxies_.get(o)},set:function(e,o,n){var c;if(o=="_value_")return e._value_=n,!0;if(o=="_cachedGet_")return e._cachedGet_=n,!0;if(o=="_assignmentId_")return e._assignmentId_=n,!0;if(o=="_is_savable_")return e._is_savable_=n,!0;if(o=="_instanceCounter_")return e._instanceCounter_=n,!0;if(!e._proxies_.has(o)){const h=new je({},e);h._proxies_.set("_parent_",i),e._proxies_.set(o,h)}return e._value_[o]!==n&&(e._value_[o]=n,e._publishDynamicFilling_(o,n),(c=e._proxies_.get(o))==null||c.set(Te(n)?n:{__value:n})),!0},deleteProperty:function(e,o){var n;return e._publishDynamicFilling_(o,null),(n=e._proxies_.get(o))==null||n.set(null),delete e._value_[o]},has:function(e,o){return o in e._value_&&o!="_lockInternalMutationPublishing_"},defineProperty:function(e,o,n){return n&&"value"in n&&(e._value_[o]=n.value),!0},getOwnPropertyDescriptor:function(e,o){return{enumerable:!0,configurable:!0}},ownKeys:function(e){return e._value_.__value?Object.keys(e._value_.__value):Object.keys(e._value_)}});return i}toString(){return"hey"}valueOf(){return 2}getProperty(t,s){return t[s]}}class Mr extends HTMLElement{constructor(){super(),this.publisherId="",this.onAssign=t=>{this.innerHTML=t.toString()}}connectedCallback(){var t;this.publisherId=this.getAttribute("publisher")||"",this.publisher=Ns.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(Pe+"-publisher-proxy",Mr)}catch{}let ns=(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=J.getAncestorAttributeValue(t.parentNode||t.host||t,"dataProvider");if(!s)return;const i=E.getInstance().get(s),e=L.getDataBindItems(t),o=[];e.forEach(n=>{const l=n.bindedVariablesDescriptor,c=n.propertyToUpdate;for(const h of l.variables){const d=h;let f=i;f=L.getSubPublisher(i,d);const m=t,b={publisher:f,onAssign:()=>{const _=l.variables.map(D=>{var p;return(p=L.getSubPublisher(i,D))==null?void 0:p.get()});let C=l.expression,O=!1;if(_.length==1&&l.variables[0].join(".")==C.substring(1)){let D=_[0];D===null&&(D=""),m[c]=D;return}for(let D=0;D<_.length;D++){let p=_[D];const u=l.variables[D];p===null&&(O=!0,p=void 0),C=C.replace("$"+u.join("."),p)}if(C.indexOf("|")!=-1){const D=C.indexOf("|");if(D==0)C=os.js(C.substring(1));else{const p=C.substring(0,D),u=C.substring(D+1),y=os[p];C=O?"":y?y(u):C}}else C=O?"":C;m[c]=C}};f==null||f.onAssign(b.onAssign),o.push(b)}}),L.publisherListeners.set(t,o)}},L.observedElements=new Map,L.enabled=!0,L.publisherListeners=new Map,L);ns.observe(document.documentElement),window.SonicDataBindObserver||(window.SonicDataBindObserver=ns);let X=class te{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 l=t[n],c=s[n];if(i?l!==c:l!=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 l=t[n],c=s[n],h=te.isObject(l)&&te.isObject(c),d=i?l!==c:l!=c;if(h&&!te.deepEqual(l,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 te.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&&te.isObject(o)?t=Object.assign(Array.isArray(o)?[]:{},t,o):t=t[e]}return t}static getURLSearchArray(t,s=""){let i=[];for(let e in t){const o=t[e];s&&(e=s+"["+e+"]"),te.isObject(o)?i=[...i,...this.getURLSearchArray(o,e)]:i.push(`${e}=${o}`)}return i}static getURLSearchString(t){return te.getURLSearchArray(t,"").join("&")}};/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2017 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -2339,7 +2339,7 @@
|
|
|
2339
2339
|
background: transparent;
|
|
2340
2340
|
padding: 0;
|
|
2341
2341
|
}
|
|
2342
|
-
`],Q([a({type:String})],K.prototype,"valueKey",2),Q([a({type:String})],K.prototype,"wordingKey",2),Q([a({type:Boolean})],K.prototype,"multiple",2),Q([a({type:String,reflect:!0})],K.prototype,"size",2),Q([a({type:Number})],K.prototype,"selectSize",2),Q([a({type:String,reflect:!0})],K.prototype,"status",2),Q([a({type:Array})],K.prototype,"options",1),Q([a({reflect:!0})],K.prototype,"value",1),Q([a({type:Boolean})],K.prototype,"forceAutoFill",2),Q([a()],K.prototype,"description",1),Q([a()],K.prototype,"label",1),Q([st({slot:"label",flatten:!0})],K.prototype,"slotLabelNodes",2),Q([st({slot:"description",flatten:!0})],K.prototype,"slotDescriptionNodes",2),Q([st({slot:"suffix",flatten:!0})],K.prototype,"slotSuffixNodes",2),Q([st({slot:"prefix",flatten:!0})],K.prototype,"slotPrefixNodes",2),Q([j()],K.prototype,"hasDescription",2),Q([j()],K.prototype,"hasLabel",2),Q([j()],K.prototype,"hasSuffix",2),Q([j()],K.prototype,"hasPrefix",2),K=Q([w(nl)],K);var al=Object.defineProperty,ll=Object.getOwnPropertyDescriptor,ut=(r,t,s,i)=>{for(var e=i>1?void 0:i?ll(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&&al(t,s,e),e};const cl="sonic-textarea";let lt=class extends ys(Oe(G(v))){constructor(){super(...arguments),this.size="",this.readonly=!1,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`
|
|
2342
|
+
`],Q([a({type:String})],K.prototype,"valueKey",2),Q([a({type:String})],K.prototype,"wordingKey",2),Q([a({type:Boolean})],K.prototype,"multiple",2),Q([a({type:String,reflect:!0})],K.prototype,"size",2),Q([a({type:Number})],K.prototype,"selectSize",2),Q([a({type:String,reflect:!0})],K.prototype,"status",2),Q([a({type:Array})],K.prototype,"options",1),Q([a({reflect:!0})],K.prototype,"value",1),Q([a({type:Boolean})],K.prototype,"forceAutoFill",2),Q([a()],K.prototype,"description",1),Q([a()],K.prototype,"label",1),Q([st({slot:"label",flatten:!0})],K.prototype,"slotLabelNodes",2),Q([st({slot:"description",flatten:!0})],K.prototype,"slotDescriptionNodes",2),Q([st({slot:"suffix",flatten:!0})],K.prototype,"slotSuffixNodes",2),Q([st({slot:"prefix",flatten:!0})],K.prototype,"slotPrefixNodes",2),Q([j()],K.prototype,"hasDescription",2),Q([j()],K.prototype,"hasLabel",2),Q([j()],K.prototype,"hasSuffix",2),Q([j()],K.prototype,"hasPrefix",2),K=Q([w(nl)],K);var al=Object.defineProperty,ll=Object.getOwnPropertyDescriptor,ut=(r,t,s,i)=>{for(var e=i>1?void 0:i?ll(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&&al(t,s,e),e};const cl="sonic-textarea";let lt=class extends ys(Oe(G(v))){constructor(){super(...arguments),this.size="md",this.readonly=!1,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`
|
|
2343
2343
|
<label
|
|
2344
2344
|
for="${this.id||"form-element"}"
|
|
2345
2345
|
class="${this.hasLabel?"form-label":"hidden"}"
|
package/dist/concorde-core.es.js
CHANGED
|
@@ -463,7 +463,7 @@ let N = (k = class {
|
|
|
463
463
|
const h = await new Response(l.readable).arrayBuffer();
|
|
464
464
|
return new TextDecoder().decode(h);
|
|
465
465
|
}
|
|
466
|
-
}, k.buildDate = "Tue Jun 25 2024
|
|
466
|
+
}, k.buildDate = "Tue Jun 25 2024 15:40:01 GMT+0200 (Central European Summer Time)", k.changed = !1, k.saving = !1, k.saveId = 0, k.instance = null, k.instances = /* @__PURE__ */ new Map(), k.modifiedCollectore = [], k);
|
|
467
467
|
const Us = window;
|
|
468
468
|
Us.SonicPublisherManager || (Us.SonicPublisherManager = N);
|
|
469
469
|
Us.SonicPublisherManager.registerInstance(
|
|
@@ -8923,7 +8923,7 @@ var Ol = Object.defineProperty, Dl = Object.getOwnPropertyDescriptor, ut = (r, t
|
|
|
8923
8923
|
const kl = "sonic-textarea";
|
|
8924
8924
|
let at = class extends Os(De(Y(y))) {
|
|
8925
8925
|
constructor() {
|
|
8926
|
-
super(...arguments), this.size = "", this.readonly = !1, this.hasDescription = !1, this.hasLabel = !1;
|
|
8926
|
+
super(...arguments), this.size = "md", this.readonly = !1, this.hasDescription = !1, this.hasLabel = !1;
|
|
8927
8927
|
}
|
|
8928
8928
|
connectedCallback() {
|
|
8929
8929
|
super.connectedCallback(), this.hasSlotOrProps();
|
package/package.json
CHANGED
|
@@ -16,7 +16,10 @@ import FormElement from "@supersoniks/concorde/core/mixins/FormElement";
|
|
|
16
16
|
import FormInput from "@supersoniks/concorde/core/mixins/FormInput";
|
|
17
17
|
import { customScroll } from "@supersoniks/concorde/core/components/ui/_css/scroll";
|
|
18
18
|
import { unsafeHTML } from "lit/directives/unsafe-html.js";
|
|
19
|
-
import {
|
|
19
|
+
import {
|
|
20
|
+
fontSize,
|
|
21
|
+
Size,
|
|
22
|
+
} from "@supersoniks/concorde/core/components/ui/_css/size";
|
|
20
23
|
import { styleMap } from "lit/directives/style-map.js";
|
|
21
24
|
|
|
22
25
|
const tagName = "sonic-textarea";
|
|
@@ -40,7 +43,7 @@ export class Textarea extends FormInput(FormElement(Subscriber(LitElement))) {
|
|
|
40
43
|
// @property({ type: String })
|
|
41
44
|
// type: "" | "primary" | "warning" | "danger" | "success" | "info" = "";
|
|
42
45
|
// @property({ type: String }) variant: "" | "ghost" | "outline" = "";
|
|
43
|
-
@property({ type: String }) size:
|
|
46
|
+
@property({ type: String }) size: Size = "md";
|
|
44
47
|
@property({ type: Number }) rows?: number;
|
|
45
48
|
@property({ type: Number }) cols?: number;
|
|
46
49
|
@property({ type: Number }) maxlength?: number;
|