@trintel/zooy 1.14.0 → 1.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/zooy.cjs.js CHANGED
@@ -1,6 +1,6 @@
1
- Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const b=require("./chunks/component-library-registry-DS_liKzL.js"),p=require("./chunks/tree-utils-Dzrq9O-e.js"),P=require("./chunks/zoo-bQS5G6fe.js");let l=require("badu"),De=require("ramda");var L=class extends EventTarget{#e=!1;#t=!1;#s=new Map;#r=new Set;#i=new Set;static makeEvent(e,t){return new CustomEvent(e,{detail:t})}set debugMode(e){if(typeof e!="boolean")throw new Error("This must be a boolean");this.#e=e}get debugMode(){return this.#e}get disposed(){return this.#t}get listeningTo(){return this.#s}get isObservedBy(){return this.#r}get activeIntervals(){return this.#i}debugMe(...e){this.#e&&console.log.apply(null,[this.constructor.name,"DEBUG:",...e])}isListenedToBy(e){this.#r.add(e)}listen(e,t,s,r=!1){e.addEventListener(t,s,r);const i=this.listeningTo.get(e)||{};i[t]=()=>e.removeEventListener(t,s,r),this.listeningTo.set(e,i),(0,l.isDef)(e.isListenedToBy)&&e.isListenedToBy(this)}stopBeingListenedTo(){for(const e of this.isObservedBy)e.stopListeningTo(this),this.isObservedBy.delete(e)}stopListeningTo(e,t){e&&this.listeningTo.has(e)&&((0,l.isDef)(e.isObservedBy)&&e.isObservedBy.delete(this),(0,l.isDef)(t)?(Object.entries(this.listeningTo.get(e)).forEach(([s,r])=>{s===t&&r()}),Object.keys(this.listeningTo.get(e)).length||this.listeningTo.delete(e)):(Object.values(this.listeningTo.get(e)).forEach(s=>s()),this.listeningTo.delete(e)))}removeAllListener(){for(const e of this.listeningTo.keys())this.stopListeningTo(e)}clearAllIntervals(){for(const e of this.activeIntervals)clearInterval(e),this.activeIntervals.delete(e)}doOnBeat(e,t){const s=setInterval(e,t);this.activeIntervals.add(s)}disposeInternal(){this.stopBeingListenedTo(),this.removeAllListener(),this.clearAllIntervals(),this.#t=!0}dispose(){this.disposeInternal()}},k=class{constructor(e,t){this.value_=e,this.data_=t||{}}getValue(){return this.value_}getData(){return this.data_}},u={COMP:(0,l.randomId)(),COMP_DRAG_START:(0,l.randomId)(),COMP_DRAG_MOVE:(0,l.randomId)(),COMP_DRAG_END:(0,l.randomId)(),PANEL:(0,l.randomId)(),VIEW:(0,l.randomId)(),SPLIT:(0,l.randomId)(),SPLIT_WILL_OPEN:(0,l.randomId)(),SPLIT_DID_OPEN:(0,l.randomId)(),SPLIT_WILL_CLOSE:(0,l.randomId)(),SPLIT_DID_CLOSE:(0,l.randomId)(),SPLIT_TRANSITION_END:(0,l.randomId)(),READY:(0,l.randomId)(),PANEL_MINIMIZE:(0,l.randomId)(),FORM_SUBMIT_SUCCESS:(0,l.randomId)()},N={NOT_SUPPORTED:"Method not supported",DECORATE_INVALID:"Invalid element to decorate",ALREADY_RENDERED:"Component already rendered",ALREADY_DISPOSED:"Component already disposed",PARENT_UNABLE_TO_BE_SET:"Unable to set parent component",CHILD_INDEX_OUT_OF_BOUNDS:"Child component index out of bounds",NOT_OUR_CHILD:"Child is not in parent component",NOT_IN_DOCUMENT:"Operation not supported while component is not in document",STATE_INVALID:"Invalid component state"},w=class extends L{static compEventCode(){return u.COMP}static compReadyCode(){return u.READY}static compErrors(){return N}#e;#t;#s;#r;#i;#n;#o;#a;constructor(){super(),this.#e=()=>document.createElement("div"),this.#t=!1,this.#s=void 0,this.#r=void 0,this.#i=void 0,this.#n=void 0,this.#o=new Map,this.outOfTreeElements=[],this.placeholderDom=void 0,this.#a=()=>{}}set target(e){this.#i=e}get target(){return this.#i}set model(e){this.#r=e}get model(){return this.#r}set isInDocument(e){this.#t=e}get isInDocument(){return this.#t}set domFunc(e){this.#e=e}set readyFunc(e){this.#a=e}setElementInternal_(e){this.#s=e}getElement(){return this.#s}createDom(){this.#s=this.#e()}assertCanRenderAsync(){if(this.disposed)throw new Error(N.ALREADY_DISPOSED)}render(e){this.render_(e)}render_(e){if(this.disposed)throw new Error(N.ALREADY_DISPOSED);if(this.isInDocument)throw new Error(N.ALREADY_RENDERED);this.#s||this.createDom();const t=this.#s;e&&(this.#i=e),this.placeholderDom&&p.removeNode(this.placeholderDom),this.#i?p.isInPage(t)||this.#i.insertBefore(t,null):p.isInPage(t)||document.body.appendChild(t),(!this.#n||this.#n.isInDocument)&&this.enterDocument()}hoist(e,t=void 0){t||(t=document.querySelector("body")),t.appendChild(e),this.outOfTreeElements.push(e)}executeBeforeReady(){this.#a()}enterDocument(){this.disposed?p.removeNode(this.getElement()):(this.isInDocument=!0,[...this.#o.values()].forEach(e=>{!e.isInDocument&&e.getElement()&&e.enterDocument()}),this.executeBeforeReady(),this.dispatchCompEvent(u.READY))}exitDocument(){[...this.#o.values()].forEach(e=>{e.isInDocument&&e.exitDocument()}),this.stopBeingListenedTo(),this.removeAllListener(),this.isInDocument=!1,p.removeNode(this.getElement()),this.placeholderDom&&p.removeNode(this.placeholderDom)}disposeInternal(){this.isInDocument&&this.exitDocument(),this.#o&&[...this.#o.values()].forEach(e=>e.disposeInternal()),this.outOfTreeElements.forEach(p.removeNode),this.#s&&p.removeNode(this.#s),this.placeholderDom&&p.removeNode(this.placeholderDom),this.#o=null,this.#s=void 0,this.#r=null,this.#n=null,super.disposeInternal()}dispose(){this.abortController&&this.abortController.abort();const e=this.getElement();if(e)for(const t of b.ComponentLibraryRegistry.getRegisteredLibraries())try{const s=b.ComponentLibraryRegistry.get(t);s.dispose&&s.dispose(e)}catch(s){console.debug(`[${t}] Cleanup error during component disposal (non-critical):`,s)}super.dispose()}dispatchCompEvent(e,t){const s=new k(e,t),r=L.makeEvent(u.COMP,s);return this.dispatchEvent(r)}},h={CLICK:"click",RIGHTCLICK:"rightclick",DBLCLICK:"dblclick",MOUSEDOWN:"mousedown",MOUSEUP:"mouseup",MOUSEOVER:"mouseover",MOUSEOUT:"mouseout",MOUSEMOVE:"mousemove",MOUSEENTER:"mouseenter",MOUSELEAVE:"mouseleave",TOUCHSTART:"touchstart",TOUCHMOVE:"touchmove",TOUCHEND:"touchend",TOUCHCANCEL:"touchcancel",SUBMIT:"submit",CHANGE:"change",INPUT:"input",INVALID:"invalid",DRAGSTART:"dragstart",DRAGEND:"dragend",DRAGOVER:"dragover",DRAGENTER:"dragenter",DRAGEXIT:"dragexit",DRAGLEAVE:"dragleave",DROP:"drop",TRANSITIONEND:"transitionend",ANIMATIONEND:"animationend"},Ce=[h.TOUCHMOVE,h.TOUCHSTART,h.TOUCHEND],be=e=>Ce.includes(e.type),B=e=>(be(e)&&(e.clientX=e.targetTouches[0].clientX,e.clientY=e.targetTouches[0].clientY),e),Me=(e,t,s,r)=>i=>{i.preventDefault();const o=B(i),d=o.currentTarget,[g,_]=p.getPos(d),E=o.clientX-g,D=o.clientY-_,n=e(g,_,E,D,d),a=s(g,_,E,D,d),c=t(g,_,E,D,d);let m=Te(c,d,E,D);["x","ew"].includes(r)?m=ye(c,d,E,D):["y","ns"].includes(r)&&(m=Le(c,d,E,D));let f=!1;const v=M=>{f=!0,m(M)},S=M=>{document.removeEventListener(h.MOUSEMOVE,v,!0),document.removeEventListener(h.TOUCHMOVE,v,!0),document.removeEventListener(h.MOUSEUP,S,!0),document.removeEventListener(h.TOUCHEND,S,!0),f&&a(M)};return document.addEventListener(h.MOUSEUP,S,!0),document.addEventListener(h.TOUCHEND,S,!0),document.addEventListener(h.MOUSEMOVE,v,!0),document.addEventListener(h.TOUCHMOVE,v,!0),n(i),S},Te=(e,t,s,r)=>i=>{i.preventDefault();const o=B(i);t.style.left=`${o.clientX-s}px`,t.style.top=`${o.clientY-r}px`,e(o)},ye=(e,t,s,r)=>i=>{i.preventDefault();const o=B(i);t.style.left=`${o.clientX-s}px`,e(o)},Le=(e,t,s,r)=>i=>{i.preventDefault();const o=B(i);t.style.top=`${o.clientY-r}px`,e(o)},F=(e,t)=>(s,r,i,o,d)=>g=>{e.dispatchCompEvent(t,{component:e,browserEvent:g,left:s,top:r,clientX:g.clientX,clientY:g.clientY,xOrg:i,yOrg:o,deltaX:g.clientX-i-s,deltaY:g.clientY-o-r,target:d})},z=class extends w{#e;#t;#s;#r;constructor(e="xy"){super(),this.#e=["x","y","xy","ew","ns"].includes(e.toLowerCase())?e.toLowerCase():"xy",this.#t=void 0,this.#s=!0,this.#r=t=>null}cancelDrag(e){this.#r(e)}set moveFreedom(e){this.#e=e,this.#s||(this.lock(),this.unlock())}get moveFreedom(){return this.#e}executeBeforeReady(){this.unlock(),super.executeBeforeReady()}unlock(){const e=t=>s=>{this.#r=t(s)};if(this.isInDocument&&this.#s){const t=F(this,u.COMP_DRAG_MOVE),s=F(this,u.COMP_DRAG_START),r=F(this,u.COMP_DRAG_END),i=Me(s,t,r,this.#e);this.#s=!1,this.#t=this.#t||this.getElement(),this.listen(this.#t,h.MOUSEDOWN,e(i)),this.listen(this.#t,h.TOUCHSTART,i),this.#t.classList.remove("locked")}}lock(){this.stopListeningTo(this.#t,h.MOUSEDOWN),this.stopListeningTo(this.#t,h.TOUCHSTART),this.#s=!0,this.#t.classList.add("locked")}},se=b.__exportAll({getPath:()=>j,getQueryData:()=>oe,objectToUrlParms:()=>ae,queryDataToMap:()=>le}),we=new RegExp("^(?:([^:/?#.]+):)?(?://(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$"),re={SCHEME:1,USER_INFO:2,DOMAIN:3,PORT:4,PATH:5,QUERY_DATA:6,FRAGMENT:7},ie=e=>e.match(we),ne=(e,t)=>e?t?decodeURI(e.replace(/%25/g,"%2525")):decodeURIComponent(e):"",j=e=>ne(ie(e)[re.PATH],!0),oe=e=>ne(ie(e)[re.QUERY_DATA],!0),ae=e=>Object.entries(e).map(t=>`${t[0]}=${t[1]}`).join("&"),Q=e=>e!=null&&e!=="",le=e=>e.split("&").reduce((t,s)=>{const[r,i]=s.split("=");return Q(r)&&Q(i)&&t.set(r,i),t},new Map),Ie=(0,l.stripLeadingChar)(" "),Oe=(0,l.stripLeadingChar)("/"),Re=e=>document.cookie.split(";").map(t=>t.split("=")).reduce((t,s)=>t.set(Ie(s[0]),s[1]),new Map).get(e),Pe=e=>{let t=0,s;const r=i=>{const o=i>0;return o?t+=1:t-=1,o?t===1:t===0};return i=>{s=s||document.getElementById(e),s&&r(i)&&s.classList.toggle("viz",t>0)}},ce=Pe("the_loader"),$=()=>Promise.resolve(ce(1)),U=e=>(ce(0),Promise.resolve(e)),I=e=>e.ok?Promise.resolve(e):Promise.reject(new Error(`${e.url} ${e.status} (${e.statusText})`)),Ae=e=>t=>{if(t.type==="opaqueredirect"||t.redirected){const s=Oe(j(t.url));e.setIsRedirected(!0,s),console.log("Redirect detected",s)}return I(t)},R=e=>e.json(),H=e=>e.text().then(t=>Promise.resolve(t),t=>Promise.reject(new Error(`Could not get text from response: ${t}`))),Ne=e=>e.headers.get("Content-Type")==="application/json"?R(e):H(e),V=(e,t,s="POST",r=void 0)=>{const i=new Headers;i.append("Content-type","application/json"),i.append("X-Requested-With","XMLHttpRequest"),e&&e!==""&&i.append("Authorization",`Bearer ${e}`);const o={cache:"no-cache",method:s,headers:i,credentials:"include",body:JSON.stringify(t)};return r&&(o.signal=r),o},he=(e,t,s=!1,r=void 0)=>{const i=new Headers;if(t&&t!==""&&i.append("Authorization",`Bearer ${t}`),i.append("X-Requested-With","XMLHttpRequest"),s){const d=Re("csrftoken");d&&s&&i.append("X-CSRFToken",d)}const o={cache:"no-cache",method:e,headers:i,redirect:"follow",credentials:"include"};return r&&(o.signal=r),o},Ve=(e,t,s=void 0)=>{const r=he("POST",e,!1,s);return r.body=new FormData(t.formEl),r},Z=(e,t=void 0)=>{const s=new Headers;s.append("Authorization",`Bearer ${e}`),s.append("X-Requested-With","XMLHttpRequest");const r={cache:"no-cache",headers:s,credentials:"include"};return t&&(r.signal=t),r},Ue=(e,t)=>{const s=new Request(e);return fetch(s,t).then(I).then(H)},y=(e,t=void 0)=>s=>(U("").then(l.identity),s.name==="AbortError"?console.info(e,"ABORTED!"):console.error(e,s),t),A=class{constructor(e){this.user_={},this.jwt="",e&&this.updateProfileFromJwt(e).then(()=>{})}updateProfileFromJwt(e,t=!1){return t&&this.jwt!==""?Promise.resolve("User Profile Already exists"):e.non_field_errors?Promise.reject(new Error(`JWT ${e.non_field_errors}`)):(this.updateToken(e.token),this.updateProfile(e.user),Promise.resolve("User Profile Updated"))}updateProfile(e){this.user_=e}updateToken(e){this.jwt=e}get id(){return this.user_.id}get name(){return this.user_.name}get surname(){return this.user_.surname}get salutation(){let e=this.name;const t=this.surname;return t&&(e=e+" "+t),e}formSubmit(e){const t=new Request(e.uri.toString()),s=e.processSubmitReply.bind(e),r=y("Form submit error");return $().then(()=>fetch(t,Ve(this.jwt,e,e.abortController.signal))).then(Ae(e)).then(U).then(Ne).then(s).catch(r)}putNoBody(e,t=void 0,s=!1){const r=y("putNobody error"),i=he("PUT",this.jwt,s,t);return Ue(e,i).catch(r)}fetch(e,t=void 0){const s=new Request(e.toString()),r=y(`UMan Text GET Fetch: ${e}`);return $().then(()=>fetch(s,Z(this.jwt,t))).then(I).then(U).then(H).catch(r)}fetchAndSplit(e,t=void 0){const s=y(`fetchAndSplit: ${e}`);return this.fetch(e,t).then(p.handleTemplateProm).catch(s)}async fetchJson(e,t=void 0,s=void 0){const r=new Request(e.toString()),i=y(`fetchJson: ${e}`,s),o=Z(this.jwt,t);await $();let d;try{d=await(await fetch(r,o)).json()}catch(g){return i(g)}return await U(),d}patchJson(e,t,s=void 0){const r=new Request(e.toString()),i=y(`patchJson: ${e}`),o=V(this.jwt,t,"PATCH",s);return fetch(r,o).then(I).then(R).catch(i)}postJson(e,t,s=void 0){const r=new Request(e.toString()),i=y(`postJson: ${e}`),o=V(this.jwt,t,"POST",s);return fetch(r,o).then(I).then(R).catch(i)}putJson(e,t,s=void 0){const r=new Request(e.toString()),i=y(`putJson: ${e}`),o=V(this.jwt,t,"PUT",s);return fetch(r,o).then(I).then(R).catch(i)}delJson(e,t,s=void 0){const r=new Request(e.toString()),i=y(`delJson: ${e}`),o=V(this.jwt,t,"DELETE",s);return fetch(r,o).then(I).then(R).catch(i)}},q=class extends w{static panelEventCode(){return u.PANEL}static compReadyCode(){return u.READY}constructor(e){super(),this.qParamMap_=new Map,this.uri_="",e&&this.parseUri(e),this.evalScripts=p.evalScripts(this),this.evalModules=p.evalModules(this),this.redirected=!1,this.responseObject={html:null,scripts:null},this.user_=void 0,"AbortController"in window?this.abortController=new AbortController:this.abortController={signal:void 0,abort:()=>{}},this.listMap=new Map}get uri(){const e=this.qParamMap_.size>0?"?"+ae(Object.fromEntries(this.qParamMap_)):"";return this.uri_+e}set user(e){this.user_=e}get user(){return this.user_||(this.user_=new A),this.user_}parseUri(e){this.uri_=j(e),this.qParamMap_=le(oe(e))}addToQParams(e,t){this.qParamMap_.set(e,t)}removeFromQParams(e){this.qParamMap_.delete(e)}clearQParams(){this.qParamMap_.clear()}getCarbonComponents(e){return this.carbonComponents?.get(e)||[]}getCarbonComponentById(e){if(this.carbonComponents)for(const t of this.carbonComponents.values()){const s=t.find(r=>r.id===e);if(s)return s}}renderPlaceHolder(e){this.target&&(this.placeholderDom=e,this.target.insertBefore(this.placeholderDom,null))}renderWithTemplate(e){const t=this.user;return t?t.fetch(this.uri,this.abortController.signal).then(s=>(this.assertCanRenderAsync(),e&&e(this),this.onRenderWithTemplateReply(s).catch(r=>{r.message!==w.compErrors().ALREADY_DISPOSED&&console.error("RenderWithTemplate Err:",r)}),this)).catch(s=>{throw console.error("Panel.renderWithTemplate fetch failed:",s),s}):Promise.reject(new Error("No UserManager instance available for Panel.renderWithTemplate()"))}onRenderWithTemplateReply(e){return this.responseObject=p.splitScripts(e),this.domFunc=()=>this.responseObject.html,this.render(),Promise.resolve(this)}onReplacePartialDom(e,t){const s=this.getElement();if((0,l.isUndefined)(s))return;const r=e.html;if(t.startsWith("."))[...s.querySelectorAll(t)].filter(i=>(0,l.isDefAndNotNull)(i.id)).map(i=>[i,r.querySelector(`#${i.id}`)]).filter(([i,o])=>(0,l.isDefAndNotNull)(o)).forEach(([i,o])=>{i.parentNode.replaceChild(o,i),this.parseContent(o)});else if(t.startsWith("#")){const i=r.querySelector(t),o=s.querySelector(t);o.parentNode.replaceChild(i,o),this.parseContent(i)}this.evalScripts(e.scripts),this.evalModules(e.modules)}renderWithJSON(e){return this.user?this.user.fetchJson(this.uri_,this.abortController.signal).then(t=>{this.assertCanRenderAsync(),e&&e(t,this),this.onRenderWithJSON(t).then(l.identity)}).catch(t=>{throw console.error("Panel.renderWithJSON fetch failed:",t),t}):Promise.reject(new Error("No UserManager instance available for Panel.renderWithJSON()"))}onRenderWithJSON(e){return Promise.resolve(this)}onAsyncJsonReply(e,t,s){}onAsyncHtmlReply(e,t){}onViewDataBroadcast(e){}parseContent(e){if(this.debugMe("Enable interactions. Panel:",e),typeof window.customElements<"u"&&b.ComponentLibraryRegistry.has("carbon")){const n=b.ComponentLibraryRegistry.get("carbon");n.render.call(this,e,n.cache).catch(a=>console.error("[Zooy] Carbon initialization failed:",a))}if(b.ComponentLibraryRegistry.has("mdc")){const n=b.ComponentLibraryRegistry.get("mdc");n.render.call(this,e,n.cache)}e.classList.contains("zoo__modal-base")&&e.classList.contains("close_on_click")&&this.listen(e,h.CLICK,n=>{n.target===e&&this.dispatchPanelEvent("destroy_me")}),[...e.querySelectorAll(".zoo__button:not(.external):not(.mdc-data-table__row)")].forEach(n=>{this.listen(n,h.CLICK,a=>{a.stopPropagation();const c=a.currentTarget,m=p.getElDataMap(c);this.dispatchPanelEvent(m.zv,Object.assign({orgEvt:a,trigger:c,href:c.href||m.href},m))})}),[...e.querySelectorAll("[href]:not(.external):not([event])")].forEach(n=>{this.listen(n,h.CLICK,a=>{const c=a.currentTarget;a.preventDefault(),a.stopPropagation();const m=p.getElDataMap(c),f=m.zv||"href";this.dispatchPanelEvent(f,Object.assign({orgEvt:a,trigger:a.target,href:c.href||m.href},m))})}),[...e.querySelectorAll("form.intercept_submit")].forEach(n=>{n.noValidate=!0,this.listen(n,h.SUBMIT,a=>{a.preventDefault(),a.stopPropagation();const c=p.getElDataMap(n),m=p.formToJSON(n.elements);this.dispatchPanelEvent(c.zv,Object.assign({orgEvt:a,trigger:a.target,formData:m,href:c.href},c))})}),[...e.querySelectorAll(".zoo__toggle_class_driver")].forEach(n=>{const a=p.getElDataMap(n),c=a.toggle_class_target_id,m=a.toggle_class,f=e.querySelector(`#${c}`);f&&m&&n.addEventListener(h.CLICK,v=>{v.stopPropagation(),f.classList.toggle(m)})});const t=Array.from(e.querySelectorAll(".folder_drop_zone")),s=Array.from(e.querySelectorAll("[draggable]")),r=n=>{n.preventDefault(),n.target.classList.add("drag_over")},i=n=>{n.preventDefault()},o=n=>{n.preventDefault(),n.target.classList.remove("drag_over")},d=n=>{n.preventDefault(),n.target.classList.remove("drag_over")},g=n=>{n.preventDefault(),n.target.classList.remove("drag_over")},_=n=>{n.dataTransfer.dropEffect="move";const a=p.getElDataMap(n.target);n.dataTransfer.setData("text/plain",JSON.stringify(a)),n.target.classList.add("drag_in_progress")},E=n=>{n.target.classList.remove("drag_in_progress")},D=n=>{g(n),n.stopPropagation();const a=JSON.parse(n.dataTransfer.getData("text/plain")),c=p.getElDataMap(n.target);return this.dispatchPanelEvent("drop_on",{custom:{on:c,from:a}}),!1};t.forEach(n=>{this.listen(n,h.DRAGOVER,i),this.listen(n,h.DRAGENTER,r),this.listen(n,h.DRAGEXIT,d),this.listen(n,h.DRAGLEAVE,o),this.listen(n,h.DROP,D)}),s.forEach(n=>{this.listen(n,h.DRAGSTART,_),this.listen(n,h.DRAGEND,E)}),[...e.querySelectorAll(".zoo_async_json")].forEach(n=>{const a=p.getElDataMap(n),c=a.href,m=this.onAsyncJsonReply.bind(this,n,a);this.user.fetchJson(c,this.abortController.signal).then(m);const f=a.z_json_reusable;f&&(this.jsonCallFuncs=this.jsonCallFuncs||{},this.jsonCallFuncs[f]=()=>{this.user.fetchJson(c,this.abortController.signal).then(m)});const v=(0,l.toNumber)(a.z_interval);(0,l.isNumber)(v)&&this.doOnBeat(()=>{this.user.fetchJson(c,this.abortController.signal).then(m)},v*60*1e3)}),[...e.querySelectorAll(".zoo_async_html")].forEach(n=>{const a=p.getElDataMap(n),c=a.href;this.user.fetchAndSplit(c,this.abortController.signal).then(f=>{n.appendChild(f.html),this.parseContent(n),this.evalScripts(f.scripts),this.evalModules(f.modules),this.onAsyncHtmlReply(n,a)});const m=(0,l.toNumber)(a.z_interval);(0,l.isNumber)(m)&&this.doOnBeat(()=>{this.user.fetchAndSplit(c,this.abortController.signal).then(f=>{n.replaceChildren(f.html),this.parseContent(n),this.evalScripts(f.scripts),this.evalModules(f.modules)})},m*60*1e3)}),[...e.querySelectorAll("[zoo-url-api]")].forEach(n=>{if(n.tagName==="CDS-TABLE"||n.classList.contains("zoo_async_json")||n.dataBinder)return;const a=n.getAttribute("zoo-url-api");if(!a||!n.querySelector("[zoo-bind], [zoo-bind-attr], [zoo-template]"))return;const c=new P.Binder(this,a,n);n.dataBinder=c,c.fetchData().catch(m=>{console.error("[Panel] zoo-url-api auto-bind fetch failed:",m)})})}enterDocument(){const e=this.getElement();this.parseContent(e),this.evalScripts(this.responseObject.scripts),this.evalModules(this.responseObject.modules),super.enterDocument()}exitDocument(){this.abortController.abort(),super.exitDocument()}setIsRedirected(e,t){this.redirected=e,this.redirected&&t&&(this.uri_=t)}dispatchPanelEvent(e,t){const s=new k(e,t),r=L.makeEvent(u.PANEL,s);return this.debugMe(`PANEL EVENT FIRED:
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const T=require("./chunks/component-library-registry-BZI0_XM_.js"),p=require("./chunks/tree-utils-CExeKLzH.js"),A=require("./chunks/attributes-D6kBA8su.js");let l=require("badu"),Ce=require("ramda"),L=require("lit");var w=class extends EventTarget{#e=!1;#t=!1;#s=new Map;#i=new Set;#r=new Set;static makeEvent(e,t){return new CustomEvent(e,{detail:t})}set debugMode(e){if(typeof e!="boolean")throw new Error("This must be a boolean");this.#e=e}get debugMode(){return this.#e}get disposed(){return this.#t}get listeningTo(){return this.#s}get isObservedBy(){return this.#i}get activeIntervals(){return this.#r}debugMe(...e){this.#e&&console.log.apply(null,[this.constructor.name,"DEBUG:",...e])}isListenedToBy(e){this.#i.add(e)}listen(e,t,s,i=!1){e.addEventListener(t,s,i);const r=this.listeningTo.get(e)||{};r[t]=()=>e.removeEventListener(t,s,i),this.listeningTo.set(e,r),(0,l.isDef)(e.isListenedToBy)&&e.isListenedToBy(this)}stopBeingListenedTo(){for(const e of this.isObservedBy)e.stopListeningTo(this),this.isObservedBy.delete(e)}stopListeningTo(e,t){e&&this.listeningTo.has(e)&&((0,l.isDef)(e.isObservedBy)&&e.isObservedBy.delete(this),(0,l.isDef)(t)?(Object.entries(this.listeningTo.get(e)).forEach(([s,i])=>{s===t&&i()}),Object.keys(this.listeningTo.get(e)).length||this.listeningTo.delete(e)):(Object.values(this.listeningTo.get(e)).forEach(s=>s()),this.listeningTo.delete(e)))}removeAllListener(){for(const e of this.listeningTo.keys())this.stopListeningTo(e)}clearAllIntervals(){for(const e of this.activeIntervals)clearInterval(e),this.activeIntervals.delete(e)}doOnBeat(e,t){const s=setInterval(e,t);this.activeIntervals.add(s)}disposeInternal(){this.stopBeingListenedTo(),this.removeAllListener(),this.clearAllIntervals(),this.#t=!0}dispose(){this.disposeInternal()}},U=class{constructor(e,t){this.value_=e,this.data_=t||{}}getValue(){return this.value_}getData(){return this.data_}},u={COMP:(0,l.randomId)(),COMP_DRAG_START:(0,l.randomId)(),COMP_DRAG_MOVE:(0,l.randomId)(),COMP_DRAG_END:(0,l.randomId)(),PANEL:(0,l.randomId)(),VIEW:(0,l.randomId)(),SPLIT:(0,l.randomId)(),SPLIT_WILL_OPEN:(0,l.randomId)(),SPLIT_DID_OPEN:(0,l.randomId)(),SPLIT_WILL_CLOSE:(0,l.randomId)(),SPLIT_DID_CLOSE:(0,l.randomId)(),SPLIT_TRANSITION_END:(0,l.randomId)(),READY:(0,l.randomId)(),PANEL_MINIMIZE:(0,l.randomId)(),FORM_SUBMIT_SUCCESS:(0,l.randomId)()},k={NOT_SUPPORTED:"Method not supported",DECORATE_INVALID:"Invalid element to decorate",ALREADY_RENDERED:"Component already rendered",ALREADY_DISPOSED:"Component already disposed",PARENT_UNABLE_TO_BE_SET:"Unable to set parent component",CHILD_INDEX_OUT_OF_BOUNDS:"Child component index out of bounds",NOT_OUR_CHILD:"Child is not in parent component",NOT_IN_DOCUMENT:"Operation not supported while component is not in document",STATE_INVALID:"Invalid component state"},I=class extends w{static compEventCode(){return u.COMP}static compReadyCode(){return u.READY}static compErrors(){return k}#e;#t;#s;#i;#r;#n;#o;#a;constructor(){super(),this.#e=()=>document.createElement("div"),this.#t=!1,this.#s=void 0,this.#i=void 0,this.#r=void 0,this.#n=void 0,this.#o=new Map,this.outOfTreeElements=[],this.placeholderDom=void 0,this.#a=()=>{}}set target(e){this.#r=e}get target(){return this.#r}set model(e){this.#i=e}get model(){return this.#i}set isInDocument(e){this.#t=e}get isInDocument(){return this.#t}set domFunc(e){this.#e=e}set readyFunc(e){this.#a=e}setElementInternal_(e){this.#s=e}getElement(){return this.#s}createDom(){this.#s=this.#e()}assertCanRenderAsync(){if(this.disposed)throw new Error(k.ALREADY_DISPOSED)}render(e){this.render_(e)}render_(e){if(this.disposed)throw new Error(k.ALREADY_DISPOSED);if(this.isInDocument)throw new Error(k.ALREADY_RENDERED);this.#s||this.createDom();const t=this.#s;e&&(this.#r=e),this.placeholderDom&&p.removeNode(this.placeholderDom),this.#r?p.isInPage(t)||this.#r.insertBefore(t,null):p.isInPage(t)||document.body.appendChild(t),(!this.#n||this.#n.isInDocument)&&this.enterDocument()}hoist(e,t=void 0){t||(t=document.querySelector("body")),t.appendChild(e),this.outOfTreeElements.push(e)}executeBeforeReady(){this.#a()}enterDocument(){this.disposed?p.removeNode(this.getElement()):(this.isInDocument=!0,[...this.#o.values()].forEach(e=>{!e.isInDocument&&e.getElement()&&e.enterDocument()}),this.executeBeforeReady(),this.dispatchCompEvent(u.READY))}exitDocument(){[...this.#o.values()].forEach(e=>{e.isInDocument&&e.exitDocument()}),this.stopBeingListenedTo(),this.removeAllListener(),this.isInDocument=!1,p.removeNode(this.getElement()),this.placeholderDom&&p.removeNode(this.placeholderDom)}disposeInternal(){this.isInDocument&&this.exitDocument(),this.#o&&[...this.#o.values()].forEach(e=>e.disposeInternal()),this.outOfTreeElements.forEach(p.removeNode),this.#s&&p.removeNode(this.#s),this.placeholderDom&&p.removeNode(this.placeholderDom),this.#o=null,this.#s=void 0,this.#i=null,this.#n=null,super.disposeInternal()}dispose(){this.abortController&&this.abortController.abort();const e=this.getElement();if(e)for(const t of T.ComponentLibraryRegistry.getRegisteredLibraries())try{const s=T.ComponentLibraryRegistry.get(t);s.dispose&&s.dispose(e)}catch(s){console.debug(`[${t}] Cleanup error during component disposal (non-critical):`,s)}super.dispose()}dispatchCompEvent(e,t){const s=new U(e,t),i=w.makeEvent(u.COMP,s);return this.dispatchEvent(i)}},d={CLICK:"click",RIGHTCLICK:"rightclick",DBLCLICK:"dblclick",MOUSEDOWN:"mousedown",MOUSEUP:"mouseup",MOUSEOVER:"mouseover",MOUSEOUT:"mouseout",MOUSEMOVE:"mousemove",MOUSEENTER:"mouseenter",MOUSELEAVE:"mouseleave",TOUCHSTART:"touchstart",TOUCHMOVE:"touchmove",TOUCHEND:"touchend",TOUCHCANCEL:"touchcancel",SUBMIT:"submit",CHANGE:"change",INPUT:"input",INVALID:"invalid",DRAGSTART:"dragstart",DRAGEND:"dragend",DRAGOVER:"dragover",DRAGENTER:"dragenter",DRAGEXIT:"dragexit",DRAGLEAVE:"dragleave",DROP:"drop",TRANSITIONEND:"transitionend",ANIMATIONEND:"animationend"},Me=[d.TOUCHMOVE,d.TOUCHSTART,d.TOUCHEND],Le=e=>Me.includes(e.type),$=e=>(Le(e)&&(e.clientX=e.targetTouches[0].clientX,e.clientY=e.targetTouches[0].clientY),e),we=(e,t,s,i)=>r=>{r.preventDefault();const n=$(r),c=n.currentTarget,[g,_]=p.getPos(c),f=n.clientX-g,b=n.clientY-_,o=e(g,_,f,b,c),a=s(g,_,f,b,c),h=t(g,_,f,b,c);let m=Ie(h,c,f,b);["x","ew"].includes(i)?m=Oe(h,c,f,b):["y","ns"].includes(i)&&(m=Re(h,c,f,b));let v=!1;const E=D=>{v=!0,m(D)},y=D=>{document.removeEventListener(d.MOUSEMOVE,E,!0),document.removeEventListener(d.TOUCHMOVE,E,!0),document.removeEventListener(d.MOUSEUP,y,!0),document.removeEventListener(d.TOUCHEND,y,!0),v&&a(D)};return document.addEventListener(d.MOUSEUP,y,!0),document.addEventListener(d.TOUCHEND,y,!0),document.addEventListener(d.MOUSEMOVE,E,!0),document.addEventListener(d.TOUCHMOVE,E,!0),o(r),y},Ie=(e,t,s,i)=>r=>{r.preventDefault();const n=$(r);t.style.left=`${n.clientX-s}px`,t.style.top=`${n.clientY-i}px`,e(n)},Oe=(e,t,s,i)=>r=>{r.preventDefault();const n=$(r);t.style.left=`${n.clientX-s}px`,e(n)},Re=(e,t,s,i)=>r=>{r.preventDefault();const n=$(r);t.style.top=`${n.clientY-i}px`,e(n)},q=(e,t)=>(s,i,r,n,c)=>g=>{e.dispatchCompEvent(t,{component:e,browserEvent:g,left:s,top:i,clientX:g.clientX,clientY:g.clientY,xOrg:r,yOrg:n,deltaX:g.clientX-r-s,deltaY:g.clientY-n-i,target:c})},V=class extends I{#e;#t;#s;#i;constructor(e="xy"){super(),this.#e=["x","y","xy","ew","ns"].includes(e.toLowerCase())?e.toLowerCase():"xy",this.#t=void 0,this.#s=!0,this.#i=t=>null}cancelDrag(e){this.#i(e)}set moveFreedom(e){this.#e=e,this.#s||(this.lock(),this.unlock())}get moveFreedom(){return this.#e}executeBeforeReady(){this.unlock(),super.executeBeforeReady()}unlock(){const e=t=>s=>{this.#i=t(s)};if(this.isInDocument&&this.#s){const t=q(this,u.COMP_DRAG_MOVE),s=q(this,u.COMP_DRAG_START),i=q(this,u.COMP_DRAG_END),r=we(s,t,i,this.#e);this.#s=!1,this.#t=this.#t||this.getElement(),this.listen(this.#t,d.MOUSEDOWN,e(r)),this.listen(this.#t,d.TOUCHSTART,r),this.#t.classList.remove("locked")}}lock(){this.stopListeningTo(this.#t,d.MOUSEDOWN),this.stopListeningTo(this.#t,d.TOUCHSTART),this.#s=!0,this.#t.classList.add("locked")}},ie=T.__exportAll({getPath:()=>H,getQueryData:()=>ae,objectToUrlParms:()=>le,queryDataToMap:()=>ce}),Pe=new RegExp("^(?:([^:/?#.]+):)?(?://(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$"),re={SCHEME:1,USER_INFO:2,DOMAIN:3,PORT:4,PATH:5,QUERY_DATA:6,FRAGMENT:7},ne=e=>e.match(Pe),oe=(e,t)=>e?t?decodeURI(e.replace(/%25/g,"%2525")):decodeURIComponent(e):"",H=e=>oe(ne(e)[re.PATH],!0),ae=e=>oe(ne(e)[re.QUERY_DATA],!0),le=e=>Object.entries(e).map(t=>`${t[0]}=${t[1]}`).join("&"),Z=e=>e!=null&&e!=="",ce=e=>e.split("&").reduce((t,s)=>{const[i,r]=s.split("=");return Z(i)&&Z(r)&&t.set(i,r),t},new Map),Ae=(0,l.stripLeadingChar)(" "),Ne=(0,l.stripLeadingChar)("/"),ke=e=>document.cookie.split(";").map(t=>t.split("=")).reduce((t,s)=>t.set(Ae(s[0]),s[1]),new Map).get(e),ze=e=>{let t=0,s;const i=r=>{const n=r>0;return n?t+=1:t-=1,n?t===1:t===0};return r=>{s=s||document.getElementById(e),s&&i(r)&&s.classList.toggle("viz",t>0)}},he=ze("the_loader"),j=()=>Promise.resolve(he(1)),x=e=>(he(0),Promise.resolve(e)),O=e=>e.ok?Promise.resolve(e):Promise.reject(new Error(`${e.url} ${e.status} (${e.statusText})`)),xe=e=>t=>{if(t.type==="opaqueredirect"||t.redirected){const s=Ne(H(t.url));e.setIsRedirected(!0,s),console.log("Redirect detected",s)}return O(t)},P=e=>e.json(),W=e=>e.text().then(t=>Promise.resolve(t),t=>Promise.reject(new Error(`Could not get text from response: ${t}`))),Ve=e=>e.headers.get("Content-Type")==="application/json"?P(e):W(e),z=(e,t,s="POST",i=void 0)=>{const r=new Headers;r.append("Content-type","application/json"),r.append("X-Requested-With","XMLHttpRequest"),e&&e!==""&&r.append("Authorization",`Bearer ${e}`);const n={cache:"no-cache",method:s,headers:r,credentials:"include",body:JSON.stringify(t)};return i&&(n.signal=i),n},de=(e,t,s=!1,i=void 0)=>{const r=new Headers;if(t&&t!==""&&r.append("Authorization",`Bearer ${t}`),r.append("X-Requested-With","XMLHttpRequest"),s){const c=ke("csrftoken");c&&s&&r.append("X-CSRFToken",c)}const n={cache:"no-cache",method:e,headers:r,redirect:"follow",credentials:"include"};return i&&(n.signal=i),n},Ue=(e,t,s=void 0)=>{const i=de("POST",e,!1,s);return i.body=new FormData(t.formEl),i},ee=(e,t=void 0)=>{const s=new Headers;s.append("Authorization",`Bearer ${e}`),s.append("X-Requested-With","XMLHttpRequest");const i={cache:"no-cache",headers:s,credentials:"include"};return t&&(i.signal=t),i},$e=(e,t)=>{const s=new Request(e);return fetch(s,t).then(O).then(W)},M=(e,t=void 0)=>s=>(x("").then(l.identity),s.name==="AbortError"?console.info(e,"ABORTED!"):console.error(e,s),t),N=class{constructor(e){this.user_={},this.jwt="",e&&this.updateProfileFromJwt(e).then(()=>{})}updateProfileFromJwt(e,t=!1){return t&&this.jwt!==""?Promise.resolve("User Profile Already exists"):e.non_field_errors?Promise.reject(new Error(`JWT ${e.non_field_errors}`)):(this.updateToken(e.token),this.updateProfile(e.user),Promise.resolve("User Profile Updated"))}updateProfile(e){this.user_=e}updateToken(e){this.jwt=e}get id(){return this.user_.id}get name(){return this.user_.name}get surname(){return this.user_.surname}get salutation(){let e=this.name;const t=this.surname;return t&&(e=e+" "+t),e}formSubmit(e){const t=new Request(e.uri.toString()),s=e.processSubmitReply.bind(e),i=M("Form submit error");return j().then(()=>fetch(t,Ue(this.jwt,e,e.abortController.signal))).then(xe(e)).then(x).then(Ve).then(s).catch(i)}putNoBody(e,t=void 0,s=!1){const i=M("putNobody error"),r=de("PUT",this.jwt,s,t);return $e(e,r).catch(i)}fetch(e,t=void 0){const s=new Request(e.toString()),i=M(`UMan Text GET Fetch: ${e}`);return j().then(()=>fetch(s,ee(this.jwt,t))).then(O).then(x).then(W).catch(i)}fetchAndSplit(e,t=void 0){const s=M(`fetchAndSplit: ${e}`);return this.fetch(e,t).then(p.handleTemplateProm).catch(s)}async fetchJson(e,t=void 0,s=void 0){const i=new Request(e.toString()),r=M(`fetchJson: ${e}`,s),n=ee(this.jwt,t);await j();let c;try{c=await(await fetch(i,n)).json()}catch(g){return r(g)}return await x(),c}patchJson(e,t,s=void 0){const i=new Request(e.toString()),r=M(`patchJson: ${e}`),n=z(this.jwt,t,"PATCH",s);return fetch(i,n).then(O).then(P).catch(r)}postJson(e,t,s=void 0){const i=new Request(e.toString()),r=M(`postJson: ${e}`),n=z(this.jwt,t,"POST",s);return fetch(i,n).then(O).then(P).catch(r)}putJson(e,t,s=void 0){const i=new Request(e.toString()),r=M(`putJson: ${e}`),n=z(this.jwt,t,"PUT",s);return fetch(i,n).then(O).then(P).catch(r)}delJson(e,t,s=void 0){const i=new Request(e.toString()),r=M(`delJson: ${e}`),n=z(this.jwt,t,"DELETE",s);return fetch(i,n).then(O).then(P).catch(r)}},F=class extends I{static panelEventCode(){return u.PANEL}static compReadyCode(){return u.READY}constructor(e){super(),this.qParamMap_=new Map,this.uri_="",e&&this.parseUri(e),this.evalScripts=p.evalScripts(this),this.evalModules=p.evalModules(this),this.redirected=!1,this.responseObject={html:null,scripts:null},this.user_=void 0,"AbortController"in window?this.abortController=new AbortController:this.abortController={signal:void 0,abort:()=>{}},this.listMap=new Map}get uri(){const e=this.qParamMap_.size>0?"?"+le(Object.fromEntries(this.qParamMap_)):"";return this.uri_+e}set user(e){this.user_=e}get user(){return this.user_||(this.user_=new N),this.user_}parseUri(e){this.uri_=H(e),this.qParamMap_=ce(ae(e))}addToQParams(e,t){this.qParamMap_.set(e,t)}removeFromQParams(e){this.qParamMap_.delete(e)}clearQParams(){this.qParamMap_.clear()}getCarbonComponents(e){return this.carbonComponents?.get(e)||[]}getCarbonComponentById(e){if(this.carbonComponents)for(const t of this.carbonComponents.values()){const s=t.find(i=>i.id===e);if(s)return s}}renderPlaceHolder(e){this.target&&(this.placeholderDom=e,this.target.insertBefore(this.placeholderDom,null))}renderWithTemplate(e){const t=this.user;return t?t.fetch(this.uri,this.abortController.signal).then(s=>(this.assertCanRenderAsync(),e&&e(this),this.onRenderWithTemplateReply(s).catch(i=>{i.message!==I.compErrors().ALREADY_DISPOSED&&console.error("RenderWithTemplate Err:",i)}),this)).catch(s=>{throw console.error("Panel.renderWithTemplate fetch failed:",s),s}):Promise.reject(new Error("No UserManager instance available for Panel.renderWithTemplate()"))}onRenderWithTemplateReply(e){return this.responseObject=p.splitScripts(e),this.domFunc=()=>this.responseObject.html,this.render(),Promise.resolve(this)}onReplacePartialDom(e,t){const s=this.getElement();if((0,l.isUndefined)(s))return;const i=e.html;if(t.startsWith("."))[...s.querySelectorAll(t)].filter(r=>(0,l.isDefAndNotNull)(r.id)).map(r=>[r,i.querySelector(`#${r.id}`)]).filter(([r,n])=>(0,l.isDefAndNotNull)(n)).forEach(([r,n])=>{r.parentNode.replaceChild(n,r),this.parseContent(n)});else if(t.startsWith("#")){const r=i.querySelector(t),n=s.querySelector(t);n.parentNode.replaceChild(r,n),this.parseContent(r)}this.evalScripts(e.scripts),this.evalModules(e.modules)}renderWithJSON(e){return this.user?this.user.fetchJson(this.uri_,this.abortController.signal).then(t=>{this.assertCanRenderAsync(),e&&e(t,this),this.onRenderWithJSON(t).then(l.identity)}).catch(t=>{throw console.error("Panel.renderWithJSON fetch failed:",t),t}):Promise.reject(new Error("No UserManager instance available for Panel.renderWithJSON()"))}onRenderWithJSON(e){return Promise.resolve(this)}onAsyncJsonReply(e,t,s){}onAsyncHtmlReply(e,t){}onViewDataBroadcast(e){}parseContent(e){if(this.debugMe("Enable interactions. Panel:",e),typeof window.customElements<"u"&&T.ComponentLibraryRegistry.has("carbon")){const o=T.ComponentLibraryRegistry.get("carbon");o.render.call(this,e,o.cache).catch(a=>console.error("[Zooy] Carbon initialization failed:",a))}if(T.ComponentLibraryRegistry.has("mdc")){const o=T.ComponentLibraryRegistry.get("mdc");o.render.call(this,e,o.cache)}e.classList.contains("zoo__modal-base")&&e.classList.contains("close_on_click")&&this.listen(e,d.CLICK,o=>{o.target===e&&this.dispatchPanelEvent("destroy_me")}),[...e.querySelectorAll(".zoo__button:not(.external):not(.mdc-data-table__row)")].forEach(o=>{this.listen(o,d.CLICK,a=>{a.stopPropagation();const h=a.currentTarget,m=p.getElDataMap(h);this.dispatchPanelEvent(m.zv,Object.assign({orgEvt:a,trigger:h,href:h.href||m.href},m))})}),[...e.querySelectorAll("[href]:not(.external):not([event])")].forEach(o=>{this.listen(o,d.CLICK,a=>{const h=a.currentTarget;a.preventDefault(),a.stopPropagation();const m=p.getElDataMap(h),v=m.zv||"href";this.dispatchPanelEvent(v,Object.assign({orgEvt:a,trigger:a.target,href:h.href||m.href},m))})}),[...e.querySelectorAll("form.intercept_submit")].forEach(o=>{o.noValidate=!0,this.listen(o,d.SUBMIT,a=>{a.preventDefault(),a.stopPropagation();const h=p.getElDataMap(o),m=p.formToJSON(o.elements);this.dispatchPanelEvent(h.zv,Object.assign({orgEvt:a,trigger:a.target,formData:m,href:h.href},h))})}),[...e.querySelectorAll(".zoo__toggle_class_driver")].forEach(o=>{const a=p.getElDataMap(o),h=a.toggle_class_target_id,m=a.toggle_class,v=e.querySelector(`#${h}`);v&&m&&o.addEventListener(d.CLICK,E=>{E.stopPropagation(),v.classList.toggle(m)})});const t=Array.from(e.querySelectorAll(".folder_drop_zone")),s=Array.from(e.querySelectorAll("[draggable]")),i=o=>{o.preventDefault(),o.target.classList.add("drag_over")},r=o=>{o.preventDefault()},n=o=>{o.preventDefault(),o.target.classList.remove("drag_over")},c=o=>{o.preventDefault(),o.target.classList.remove("drag_over")},g=o=>{o.preventDefault(),o.target.classList.remove("drag_over")},_=o=>{o.dataTransfer.dropEffect="move";const a=p.getElDataMap(o.target);o.dataTransfer.setData("text/plain",JSON.stringify(a)),o.target.classList.add("drag_in_progress")},f=o=>{o.target.classList.remove("drag_in_progress")},b=o=>{g(o),o.stopPropagation();const a=JSON.parse(o.dataTransfer.getData("text/plain")),h=p.getElDataMap(o.target);return this.dispatchPanelEvent("drop_on",{custom:{on:h,from:a}}),!1};t.forEach(o=>{this.listen(o,d.DRAGOVER,r),this.listen(o,d.DRAGENTER,i),this.listen(o,d.DRAGEXIT,c),this.listen(o,d.DRAGLEAVE,n),this.listen(o,d.DROP,b)}),s.forEach(o=>{this.listen(o,d.DRAGSTART,_),this.listen(o,d.DRAGEND,f)}),[...e.querySelectorAll(".zoo_async_json")].forEach(o=>{const a=p.getElDataMap(o),h=a.href,m=this.onAsyncJsonReply.bind(this,o,a);this.user.fetchJson(h,this.abortController.signal).then(m);const v=a.z_json_reusable;v&&(this.jsonCallFuncs=this.jsonCallFuncs||{},this.jsonCallFuncs[v]=()=>{this.user.fetchJson(h,this.abortController.signal).then(m)});const E=(0,l.toNumber)(a.z_interval);(0,l.isNumber)(E)&&this.doOnBeat(()=>{this.user.fetchJson(h,this.abortController.signal).then(m)},E*60*1e3)}),[...e.querySelectorAll(".zoo_async_html")].forEach(o=>{const a=p.getElDataMap(o),h=a.href;this.user.fetchAndSplit(h,this.abortController.signal).then(v=>{o.appendChild(v.html),this.parseContent(o),this.evalScripts(v.scripts),this.evalModules(v.modules),this.onAsyncHtmlReply(o,a)});const m=(0,l.toNumber)(a.z_interval);(0,l.isNumber)(m)&&this.doOnBeat(()=>{this.user.fetchAndSplit(h,this.abortController.signal).then(v=>{o.replaceChildren(v.html),this.parseContent(o),this.evalScripts(v.scripts),this.evalModules(v.modules)})},m*60*1e3)}),[...e.querySelectorAll("[zoo-url-api]")].forEach(o=>{if(o.tagName==="CDS-TABLE"||o.classList.contains("zoo_async_json")||o.dataBinder)return;const a=o.getAttribute("zoo-url-api");if(!a||!o.querySelector("[zoo-bind], [zoo-bind-attr], [zoo-template]"))return;const h=new A.Binder(this,a,o);o.dataBinder=h,h.fetchData().catch(m=>{console.error("[Panel] zoo-url-api auto-bind fetch failed:",m)})})}enterDocument(){const e=this.getElement();this.parseContent(e),this.evalScripts(this.responseObject.scripts),this.evalModules(this.responseObject.modules),super.enterDocument()}exitDocument(){this.abortController.abort(),super.exitDocument()}setIsRedirected(e,t){this.redirected=e,this.redirected&&t&&(this.uri_=t)}dispatchPanelEvent(e,t){const s=new U(e,t),i=w.makeEvent(u.PANEL,s);return this.debugMe(`PANEL EVENT FIRED:
2
2
  value:${e}
3
- data:${t}`),this.dispatchEvent(r)}},de=class extends q{#e=null;#t=new Map;#s=!0;constructor(e,t=!0){super(e),this.#s=t,this.onSubmitSucFunc=(s,r)=>null}get formEl(){return this.#e}enterDocument(){super.enterDocument(),this.formIdElementToForm_()}formIdElementToForm_(){this.#e=this.getFormFromId(),this.#e&&(this.#a(this.#e),this.#r())}getFormFromId(e){let t=null,s=this.getElement().querySelector("form");return e&&(s=document.getElementById(e)||s),s&&s.tagName.toLowerCase()==="form"&&(t=s),t}#r(){this.#e&&(this.listen(this.#e,h.CHANGE,e=>{this.#o(e)},{passive:!0}),this.listen(this.#e,h.INPUT,e=>{this.clearAllValidationErrors(),this.#o(e)}),this.listen(this.#e,h.INVALID,e=>{e.preventDefault();const t=e.target;this.#n(t),this.displayFieldError(t)},{passive:!0}))}checkAllFields(){const e=[...this.#e.elements].map(t=>[this.#i(t),t]).filter(t=>!t[0]);return e.forEach(t=>this.displayFieldError(t[1])),e.length===0}clearAllValidationErrors(){[...this.#e?this.#e.elements:[]].forEach(e=>this.#n(e)),[...this.#e.querySelectorAll(".non-field-errors")].forEach(e=>e.classList.remove("alert-error"))}displayAlert_(e,t,s){const r=document.getElementById(`${e.id}-helper-text`)||document.createElement("p");r.textContent=t,this.#t.set(e,r)}#i(e){this.#n(e);let t=!e.willValidate;return e.willValidate&&(t=e.checkValidity()),t}#n(e){e.classList.remove("error"),this.#t.has(e)&&(this.#t.get(e).textContent=""),this.#t.delete(e)}displayFieldError(e,t){const s=t||e.validationMessage;e.classList.add("error"),this.displayAlert_(e,s,"alert-error")}displayFieldSuccess(e,t){this.displayAlert_(e,t,"alert-success")}displayFieldInfo(e,t){this.displayAlert_(e,t,"alert-info")}#o(e){this.#i(e.target)}#a(e){if(e&&this.#s){e.noValidate=!0;const t=this.user;this.listen(e,h.SUBMIT,s=>{s.preventDefault(),this.debugMe("Intercepted from SUBMIT"),this.checkAllFields()&&t&&t.formSubmit(this)})}return e}onSubmitSuccess(e){this.onSubmitSucFunc=e}replaceForm(e){if(this.responseObject=p.splitScripts(e),this.responseObject.html){if(this.redirected){this.removeAllListener();const t=this.getElement(),s=t.parentNode;this.setElementInternal_(this.responseObject.html),s.replaceChild(this.getElement(),t)}else{const t=this.responseObject.html.querySelector("form");t&&p.replaceNode(t,this.#e);const s=this.responseObject.html.querySelector('[type="submit"]'),r=this.getElement().querySelector('[type="submit"]');s&&r&&p.replaceNode(s,r)}this.enterDocument()}}refreshFromFromServer(){const e=this.user,t=this.uri;return e?e.fetch(t,this.abortController.signal).then(s=>this.replaceForm(s)):Promise.reject(new Error("No UserManager instance available for FormPanel.refreshFromFromServer()"))}processSubmitReply(e){this.clearAllValidationErrors();let t=!1;if((0,l.whatType)(e)==="object"&&e.success)return Promise.resolve(this).then(()=>{this.onSubmitSucFunc(this,e),this.dispatchCompEvent(u.FORM_SUBMIT_SUCCESS)});if(e==="success"?(this.debugMe(`
3
+ data:${t}`),this.dispatchEvent(i)}},ue=class extends F{#e=null;#t=new Map;#s=!0;constructor(e,t=!0){super(e),this.#s=t,this.onSubmitSucFunc=(s,i)=>null}get formEl(){return this.#e}enterDocument(){super.enterDocument(),this.formIdElementToForm_()}formIdElementToForm_(){this.#e=this.getFormFromId(),this.#e&&(this.#a(this.#e),this.#i())}getFormFromId(e){let t=null,s=this.getElement().querySelector("form");return e&&(s=document.getElementById(e)||s),s&&s.tagName.toLowerCase()==="form"&&(t=s),t}#i(){this.#e&&(this.listen(this.#e,d.CHANGE,e=>{this.#o(e)},{passive:!0}),this.listen(this.#e,d.INPUT,e=>{this.clearAllValidationErrors(),this.#o(e)}),this.listen(this.#e,d.INVALID,e=>{e.preventDefault();const t=e.target;this.#n(t),this.displayFieldError(t)},{passive:!0}))}checkAllFields(){const e=[...this.#e.elements].map(t=>[this.#r(t),t]).filter(t=>!t[0]);return e.forEach(t=>this.displayFieldError(t[1])),e.length===0}clearAllValidationErrors(){[...this.#e?this.#e.elements:[]].forEach(e=>this.#n(e)),[...this.#e.querySelectorAll(".non-field-errors")].forEach(e=>e.classList.remove("alert-error"))}displayAlert_(e,t,s){const i=document.getElementById(`${e.id}-helper-text`)||document.createElement("p");i.textContent=t,this.#t.set(e,i)}#r(e){this.#n(e);let t=!e.willValidate;return e.willValidate&&(t=e.checkValidity()),t}#n(e){e.classList.remove("error"),this.#t.has(e)&&(this.#t.get(e).textContent=""),this.#t.delete(e)}displayFieldError(e,t){const s=t||e.validationMessage;e.classList.add("error"),this.displayAlert_(e,s,"alert-error")}displayFieldSuccess(e,t){this.displayAlert_(e,t,"alert-success")}displayFieldInfo(e,t){this.displayAlert_(e,t,"alert-info")}#o(e){this.#r(e.target)}#a(e){if(e&&this.#s){e.noValidate=!0;const t=this.user;this.listen(e,d.SUBMIT,s=>{s.preventDefault(),this.debugMe("Intercepted from SUBMIT"),this.checkAllFields()&&t&&t.formSubmit(this)})}return e}onSubmitSuccess(e){this.onSubmitSucFunc=e}replaceForm(e){if(this.responseObject=p.splitScripts(e),this.responseObject.html){if(this.redirected){this.removeAllListener();const t=this.getElement(),s=t.parentNode;this.setElementInternal_(this.responseObject.html),s.replaceChild(this.getElement(),t)}else{const t=this.responseObject.html.querySelector("form");t&&p.replaceNode(t,this.#e);const s=this.responseObject.html.querySelector('[type="submit"]'),i=this.getElement().querySelector('[type="submit"]');s&&i&&p.replaceNode(s,i)}this.enterDocument()}}refreshFromFromServer(){const e=this.user,t=this.uri;return e?e.fetch(t,this.abortController.signal).then(s=>this.replaceForm(s)):Promise.reject(new Error("No UserManager instance available for FormPanel.refreshFromFromServer()"))}processSubmitReply(e){this.clearAllValidationErrors();let t=!1;if((0,l.whatType)(e)==="object"&&e.success)return Promise.resolve(this).then(()=>{this.onSubmitSucFunc(this,e),this.dispatchCompEvent(u.FORM_SUBMIT_SUCCESS)});if(e==="success"?(this.debugMe(`
4
4
  1.REDIRECTED: ${this.redirected}
5
5
  REPLY: ${e}`),t=!0):e===`redirected_success
6
6
  `?(this.debugMe(`
@@ -13,7 +13,70 @@ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{val
13
13
  5.REDIRECTED: ${this.redirected}
14
14
  SUCCESS: ${t}`),Promise.resolve(this).then(()=>{this.onSubmitSucFunc(this),this.dispatchCompEvent(u.FORM_SUBMIT_SUCCESS)});this.debugMe(`
15
15
  6.REDIRECTED: ${this.redirected}
16
- SUCCESS: ${t}`)}},ue=class extends w{static splitEventCode(){return u.SPLIT}constructor(){super(),this.dragImage_=document.createElement("canvas"),this.nestMap_=new Map,this.nestCallbackMap_=new Map,this.splitNests_=new Set}get nests(){return[...this.nestMap_.entries()].filter(([e,{nestEl:t}])=>t)}getNest(e){return this.nestMap_.get(e)?.nestEl}get nestNames(){return[...this.nestMap_.entries()].filter(([e,t])=>!this.splitNests_.has(t)).map(([e])=>e)}closeAndLockAll(e=l.identity,t=!1){this.nestNames.forEach(s=>this.closeAndLock(s,e,t))}openAndUnlockAll(e=l.identity,t=!1){this.nestNames.forEach(s=>this.openAndUnlock(s,e,t))}lock(e){const{dragEl:t}=this.nestMap_.get(e);t.classList.add("locked")}unlock(e){const{dragEl:t}=this.nestMap_.get(e);t.classList.remove("locked")}resize(e,t,s=l.identity,r=!1){const{sizeNow:i,nestEl:o,canResize:d}=this.nestMap_.get(e);d&&(r||i===t?(o.classList.remove("animated"),o.style.flexBasis=`${t}px`,this.nestMap_.get(e).sizeNow=t,s()):(o.classList.add("animated"),this.nestCallbackMap_.set(e,()=>{o.classList.remove("animated"),this.nestMap_.get(e).sizeNow=t,s()}),o.style.flexBasis=`${t}px`))}closeAndLock(e,t=l.identity,s=!1){const{nestEl:r,dragEl:i,canResize:o}=this.nestMap_.get(e);if(!o)return;const d=()=>{i.classList.add("locked","closed"),r.classList.add("closed"),t()};this.resize(e,0,d,s)}closeAndUnlock(e,t=l.identity,s=!1){const{nestEl:r,dragEl:i,canResize:o}=this.nestMap_.get(e);if(!o)return;const d=()=>{r.classList.remove("closed"),i.classList.remove("closed","locked"),i.classList.add("collapsed"),t()};this.resize(e,0,d,s)}openAndUnlock(e,t,s,r=!1){const{nestEl:i,dragEl:o,defSize:d,lastSize:g,canResize:_}=this.nestMap_.get(e);if(!_)return;const E=t||g||d;i.classList.remove("closed"),o.classList.remove("closed","locked","collapsed"),setTimeout(()=>{this.resize(e,E,s,r)},50)}openAndLock(e,t,s,r=!1){const{nestEl:i,dragEl:o,defSize:d,lastSize:g,canResize:_}=this.nestMap_.get(e);if(!_)return;const E=t||g||d;i.classList.remove("closed"),o.classList.remove("closed","collapsed"),setTimeout(()=>{this.resize(e,E,s,r)},50)}close(e,t=l.identity,s=!1){const{dragEl:r,canResize:i,nestEl:o}=this.nestMap_.get(e);if(!i)return;this.dispatchSplitEvent(u.SPLIT_WILL_CLOSE,{nestName:e,nestEl:o});const d=()=>{r.classList.add("collapsed"),this.dispatchSplitEvent(u.SPLIT_DID_CLOSE,{nestName:e,nestEl:o}),t()};this.resize(e,0,d,s)}open(e,t=l.identity,s=!1){const{defSize:r,lastSize:i,dragEl:o,canResize:d,nestEl:g}=this.nestMap_.get(e);if(!d)return;this.dispatchSplitEvent(u.SPLIT_WILL_OPEN,{nestName:e,nestEl:g}),o.classList.remove("collapsed","closed");const _=i||r,E=()=>{this.dispatchSplitEvent(u.SPLIT_DID_OPEN,{nestName:e,nestEl:g}),t()};this.resize(e,_,E,s)}toggle(e,t,s=!1){this.nestMap_.get(e).sizeNow===0?this.open(e,t,s):this.close(e,t,s)}addSplit(e=void 0,t="EW",s=100,r=100,i=[],o=[],d=[],g=[],_=[]){const E=e||this.getElement();if(this.splitNests_.has(E))return["Already used!",E];ze(E,t),this.splitNests_.add(E);let D="";if(e){const C=[...this.nestMap_.entries()].find(([T,{nestEl:O}])=>O===e);if(C)D=C[0];else return["Element not managed by this component",e]}const n=`${D}A`,a=ee(s,["zoo_nest__A",n,...i]),c=new z(t);c.domFunc=te([`zoo_drag_${n}`,...g],_),c.render(E),this.nestMap_.set(n,{side:"A",nestEl:a,dragger:c,dragEl:c.getElement(),defSize:s,sizeNow:-1,canResize:!0});const m=`${D}B`,f=ke(["zoo_nest__B",m,...o]);this.nestMap_.set(m,{nestEl:f,canResize:!1});const v=`${D}C`,S=new z(t);S.domFunc=te([`zoo_drag_${v}`,...g],_),S.render(E);const M=ee(r,["zoo_nest__C",v,...d]);this.nestMap_.set(v,{side:"C",nestEl:M,dragger:S,dragEl:S.getElement(),defSize:r,sizeNow:-1,canResize:!0}),[a,c.getElement(),f,S.getElement(),M].forEach(C=>E.appendChild(C));let J=0;const G=(C,T,O,_e)=>{let x;const Y=C==="NS"?"height":"width",Se=C==="NS"?"deltaY":"deltaX";return X=>{switch(X.detail.value_){case u.COMP_DRAG_START:x=T.getBoundingClientRect()[Y],J=f.getBoundingClientRect()[Y]+x,this.nestMap_.get(O).dragEl.classList.remove("collapsed");break;case u.COMP_DRAG_MOVE:{const K=Math.min(J,x+_e*X.detail.data_[Se]);this.nestMap_.get(O).lastSize=K,T.style.flexBasis=K+"px";break}case u.COMP_DRAG_END:this.dispatchSplitEvent(u.COMP_DRAG_END,this.nestMap_.get(O));break;default:break}}};this.listen(c,w.compEventCode(),G(t,a,n,1)),this.listen(S,w.compEventCode(),G(t,M,v,-1)),this.listen(c.getElement(),h.DBLCLICK,()=>this.toggle(n)),this.listen(S.getElement(),h.DBLCLICK,()=>this.toggle(v)),this.listen(c.getElement().querySelector(".zoo_grabber"),h.CLICK,()=>this.toggle(n)),this.listen(S.getElement().querySelector(".zoo_grabber"),h.CLICK,()=>this.toggle(v)),this.listen(a,h.TRANSITIONEND,C=>{if(C.propertyName==="flex-basis"&&C.target===a){const T=this.nestCallbackMap_.get(n);this.nestCallbackMap_.delete(n),T&&T(),this.dispatchSplitEvent(u.SPLIT_TRANSITION_END,this.nestMap_.get(n))}}),this.listen(M,h.TRANSITIONEND,C=>{if(C.propertyName==="flex-basis"&&C.target===M){const T=this.nestCallbackMap_.get(v);this.nestCallbackMap_.delete(v),T&&T(),this.dispatchSplitEvent(u.SPLIT_TRANSITION_END,this.nestMap_.get(v))}})}dispatchSplitEvent(e,t){const s=new k(e,t),r=L.makeEvent(u.SPLIT,s);return this.dispatchEvent(r)}},ze=(e,t)=>(e.classList.add("zoo_split",`zoo_split__${t.toLowerCase()}`),e),ee=(e,t=[])=>{const s=document.createElement("div");return s.setAttribute("id",(0,l.randomId)(7)),s.classList.add("zoo_nest","zoo_nest__outer",...t),s.style.flexBasis=e+"px",s},ke=(e=[])=>{const t=document.createElement("div");return t.setAttribute("id",(0,l.randomId)(7)),t.classList.add("zoo_nest","zoo_nest__inner",...e),t},te=(e=[],t=[])=>()=>{const s=document.createElement("div");s.setAttribute("id",(0,l.randomId)(7)),s.classList.add("zoo_dragger",...e);const r=document.createElement("div");return r.classList.add("zoo_grabber",...t),s.appendChild(r),s},Be={toggle_tree:function(e,t){p.toggleTree(e,t)},"tree_toggle-children":function(e,t){p.toggleTreeChildren(t,e)}},pe={search:function(e,t){let s=`${e.href}`;const r=e.formData.q,i=e.targetval;if(r!==""&&(s=`${s}?q=${r}`),i!==""){let o=i;i.includes("page=")&&(o=i.split("&").filter(d=>!d.includes("page=")).join("&")),s=r!==""?`${s}&${o}`:`${s}?${o}`}this.user.fetchAndSplit(s,t.abortController.signal).then(o=>t.onReplacePartialDom(o,e.zvptarget))},reset_search:function(e,t){const s=e.trigger.closest("form");t.removeFromQParams("q"),s.elements.q.value="",s.dispatchEvent(new Event("submit"))}},me={paginate:function(e,t){const s=`${e.href}?${e.targetval}`;this.user.fetchAndSplit(s,t.abortController.signal).then(r=>t.onReplacePartialDom(r,e.zvptarget))},list_filter:function(e,t){const s=`${e.href}?${e.targetval}`;this.user.fetchAndSplit(s,t.abortController.signal).then(r=>t.onReplacePartialDom(r,e.zvptarget))}},ge=b.__exportAll({MdcTreeHandlers:()=>Be,QueryParamHandlers:()=>me,SearchHandlers:()=>pe}),W=class extends L{#e=void 0;#t=void 0;#s={};static viewEventCode(){return u.VIEW}constructor(){super(),this.panelMap=new Map,this.user_=void 0,this.split_=void 0,this.panelEventMap_=this.initPanelEventsInternal_(),this.switchViewMap_=new Map,this.metaData_=new Map}set recordHistory(e){this.#t=e}get recordHistory(){return this.#t}set registerViewConstructor(e){this.#e=e}get registerViewConstructor(){return this.#e}set utils(e){this.#s=e}get utils(){return this.#s}set split(e){this.split_=e,this.listen(this.split_,u.SPLIT,t=>{const s=t.detail.getValue(),r=t.detail.getData();switch(s){case u.SPLIT_WILL_OPEN:this.onSplitWillOpen(r);break;case u.SPLIT_WILL_CLOSE:this.onSplitWillClose(r);break;case u.SPLIT_DID_CLOSE:this.onSplitDidClose(r);break;case u.SPLIT_DID_OPEN:this.onSplitDidOpen(r);break;case u.SPLIT_TRANSITION_END:break;default:(0,l.identity)()}})}get split(){if(!this.split_)throw new Error("No SPLIT component available");return this.split_}set user(e){this.user_=e,this.panelMap.forEach(t=>t.user=e)}get user(){return this.user_||(this.user_=new A),this.user_}render(){this.initPanelEvents(),this.preRender(),this.configurePanels(),this.displayPanels(),this.postRender()}initPanelEvents(){}preRender(){}configurePanels(){}displayPanels(){}postRender(){}dispose(){[...this.panelMap.values()].forEach(e=>e.dispose()),super.dispose()}addPanelToView(e,t){t.user=this.user,this.removePanelByName(e),this.panelMap.set(e,t),this.listen(t,q.panelEventCode(),this.onPanelEvent.bind(this))}removePanelByName(e){this.panelMap.has(e)&&this.panelMap.get(e).dispose()}removePanel(e){const[t,s]=[...this.panelMap.entries()].find(([r,i])=>i===e);t&&s&&(s.dispose(),this.panelMap.delete(t))}getPanelByName(e){return this.panelMap.get(e)}broadcastToPanels(e){[...this.panelMap.values()].forEach(t=>t.onViewDataBroadcast(e))}initPanelEventsInternal_(){const e=new Map;return e.set("destroy_me",(t,s)=>{this.removePanel(s)}),e.set("switch_view",(t,s)=>{this.debugMe("switch_view received: eventData",t);const r=t.view;this.switchViewMap_.has(r)?this.switchViewMap_.get(r)(t,s):this.debugMe("NO VIEW FOUND FOR:",r,this.switchViewMap_)}),Object.entries({...pe,...me}).forEach(([t,s])=>{e.set(t,s.bind(this))}),e}mapPanEv(e,t){this.panelEventMap_.set(e,t)}mapSwitchView(e,t){this.switchViewMap_.set(e,t)}onPanelEvent(e){let t=e.detail.getValue();if(this.debugMe(`PanelEvent Value: ${t}`),!(0,l.isDefAndNotNull)(t)){this.debugMe(`The panel received an event without a value.
17
- There is nothing we can do with that.`);return}const s=e.detail.getData();t?.startsWith("switch_view:")&&(s.view=t.split(":")[1],t="switch_view");const r=e.target;this.panelEventMap_.has(t)?this.panelEventMap_.get(t)(s,r):this.debugMe(`NO EVENT MATCH - This usually you are missing
16
+ SUCCESS: ${t}`)}},pe=class extends I{static splitEventCode(){return u.SPLIT}constructor(){super(),this.dragImage_=document.createElement("canvas"),this.nestMap_=new Map,this.nestCallbackMap_=new Map,this.splitNests_=new Set}get nests(){return[...this.nestMap_.entries()].filter(([e,{nestEl:t}])=>t)}getNest(e){return this.nestMap_.get(e)?.nestEl}get nestNames(){return[...this.nestMap_.entries()].filter(([e,t])=>!this.splitNests_.has(t)).map(([e])=>e)}closeAndLockAll(e=l.identity,t=!1){this.nestNames.forEach(s=>this.closeAndLock(s,e,t))}openAndUnlockAll(e=l.identity,t=!1){this.nestNames.forEach(s=>this.openAndUnlock(s,e,t))}lock(e){const{dragEl:t}=this.nestMap_.get(e);t.classList.add("locked")}unlock(e){const{dragEl:t}=this.nestMap_.get(e);t.classList.remove("locked")}resize(e,t,s=l.identity,i=!1){const{sizeNow:r,nestEl:n,canResize:c}=this.nestMap_.get(e);c&&(i||r===t?(n.classList.remove("animated"),n.style.flexBasis=`${t}px`,this.nestMap_.get(e).sizeNow=t,s()):(n.classList.add("animated"),this.nestCallbackMap_.set(e,()=>{n.classList.remove("animated"),this.nestMap_.get(e).sizeNow=t,s()}),n.style.flexBasis=`${t}px`))}closeAndLock(e,t=l.identity,s=!1){const{nestEl:i,dragEl:r,canResize:n}=this.nestMap_.get(e);if(!n)return;const c=()=>{r.classList.add("locked","closed"),i.classList.add("closed"),t()};this.resize(e,0,c,s)}closeAndUnlock(e,t=l.identity,s=!1){const{nestEl:i,dragEl:r,canResize:n}=this.nestMap_.get(e);if(!n)return;const c=()=>{i.classList.remove("closed"),r.classList.remove("closed","locked"),r.classList.add("collapsed"),t()};this.resize(e,0,c,s)}openAndUnlock(e,t,s,i=!1){const{nestEl:r,dragEl:n,defSize:c,lastSize:g,canResize:_}=this.nestMap_.get(e);if(!_)return;const f=t||g||c;r.classList.remove("closed"),n.classList.remove("closed","locked","collapsed"),setTimeout(()=>{this.resize(e,f,s,i)},50)}openAndLock(e,t,s,i=!1){const{nestEl:r,dragEl:n,defSize:c,lastSize:g,canResize:_}=this.nestMap_.get(e);if(!_)return;const f=t||g||c;r.classList.remove("closed"),n.classList.remove("closed","collapsed"),setTimeout(()=>{this.resize(e,f,s,i)},50)}close(e,t=l.identity,s=!1){const{dragEl:i,canResize:r,nestEl:n}=this.nestMap_.get(e);if(!r)return;this.dispatchSplitEvent(u.SPLIT_WILL_CLOSE,{nestName:e,nestEl:n});const c=()=>{i.classList.add("collapsed"),this.dispatchSplitEvent(u.SPLIT_DID_CLOSE,{nestName:e,nestEl:n}),t()};this.resize(e,0,c,s)}open(e,t=l.identity,s=!1){const{defSize:i,lastSize:r,dragEl:n,canResize:c,nestEl:g}=this.nestMap_.get(e);if(!c)return;this.dispatchSplitEvent(u.SPLIT_WILL_OPEN,{nestName:e,nestEl:g}),n.classList.remove("collapsed","closed");const _=r||i,f=()=>{this.dispatchSplitEvent(u.SPLIT_DID_OPEN,{nestName:e,nestEl:g}),t()};this.resize(e,_,f,s)}toggle(e,t,s=!1){this.nestMap_.get(e).sizeNow===0?this.open(e,t,s):this.close(e,t,s)}addSplit(e=void 0,t="EW",s=100,i=100,r=[],n=[],c=[],g=[],_=[]){const f=e||this.getElement();if(this.splitNests_.has(f))return["Already used!",f];Fe(f,t),this.splitNests_.add(f);let b="";if(e){const S=[...this.nestMap_.entries()].find(([C,{nestEl:R}])=>R===e);if(S)b=S[0];else return["Element not managed by this component",e]}const o=`${b}A`,a=te(s,["zoo_nest__A",o,...r]),h=new V(t);h.domFunc=se([`zoo_drag_${o}`,...g],_),h.render(f),this.nestMap_.set(o,{side:"A",nestEl:a,dragger:h,dragEl:h.getElement(),defSize:s,sizeNow:-1,canResize:!0});const m=`${b}B`,v=Be(["zoo_nest__B",m,...n]);this.nestMap_.set(m,{nestEl:v,canResize:!1});const E=`${b}C`,y=new V(t);y.domFunc=se([`zoo_drag_${E}`,...g],_),y.render(f);const D=te(i,["zoo_nest__C",E,...c]);this.nestMap_.set(E,{side:"C",nestEl:D,dragger:y,dragEl:y.getElement(),defSize:i,sizeNow:-1,canResize:!0}),[a,h.getElement(),v,y.getElement(),D].forEach(S=>f.appendChild(S));let G=0;const Y=(S,C,R,Te)=>{let B;const X=S==="NS"?"height":"width",De=S==="NS"?"deltaY":"deltaX";return K=>{switch(K.detail.value_){case u.COMP_DRAG_START:B=C.getBoundingClientRect()[X],G=v.getBoundingClientRect()[X]+B,this.nestMap_.get(R).dragEl.classList.remove("collapsed");break;case u.COMP_DRAG_MOVE:{const Q=Math.min(G,B+Te*K.detail.data_[De]);this.nestMap_.get(R).lastSize=Q,C.style.flexBasis=Q+"px";break}case u.COMP_DRAG_END:this.dispatchSplitEvent(u.COMP_DRAG_END,this.nestMap_.get(R))}}};this.listen(h,I.compEventCode(),Y(t,a,o,1)),this.listen(y,I.compEventCode(),Y(t,D,E,-1)),this.listen(h.getElement(),d.DBLCLICK,()=>this.toggle(o)),this.listen(y.getElement(),d.DBLCLICK,()=>this.toggle(E)),this.listen(h.getElement().querySelector(".zoo_grabber"),d.CLICK,()=>this.toggle(o)),this.listen(y.getElement().querySelector(".zoo_grabber"),d.CLICK,()=>this.toggle(E)),this.listen(a,d.TRANSITIONEND,S=>{if(S.propertyName==="flex-basis"&&S.target===a){const C=this.nestCallbackMap_.get(o);this.nestCallbackMap_.delete(o),C&&C(),this.dispatchSplitEvent(u.SPLIT_TRANSITION_END,this.nestMap_.get(o))}}),this.listen(D,d.TRANSITIONEND,S=>{if(S.propertyName==="flex-basis"&&S.target===D){const C=this.nestCallbackMap_.get(E);this.nestCallbackMap_.delete(E),C&&C(),this.dispatchSplitEvent(u.SPLIT_TRANSITION_END,this.nestMap_.get(E))}})}dispatchSplitEvent(e,t){const s=new U(e,t),i=w.makeEvent(u.SPLIT,s);return this.dispatchEvent(i)}},Fe=(e,t)=>(e.classList.add("zoo_split",`zoo_split__${t.toLowerCase()}`),e),te=(e,t=[])=>{const s=document.createElement("div");return s.setAttribute("id",(0,l.randomId)(7)),s.classList.add("zoo_nest","zoo_nest__outer",...t),s.style.flexBasis=e+"px",s},Be=(e=[])=>{const t=document.createElement("div");return t.setAttribute("id",(0,l.randomId)(7)),t.classList.add("zoo_nest","zoo_nest__inner",...e),t},se=(e=[],t=[])=>()=>{const s=document.createElement("div");s.setAttribute("id",(0,l.randomId)(7)),s.classList.add("zoo_dragger",...e);const i=document.createElement("div");return i.classList.add("zoo_grabber",...t),s.appendChild(i),s},qe={toggle_tree:function(e,t){p.toggleTree(e,t)},"tree_toggle-children":function(e,t){p.toggleTreeChildren(t,e)}},me={search:function(e,t){let s=`${e.href}`;const i=e.formData.q,r=e.targetval;if(i!==""&&(s=`${s}?q=${i}`),r!==""){let n=r;r.includes("page=")&&(n=r.split("&").filter(c=>!c.includes("page=")).join("&")),s=i!==""?`${s}&${n}`:`${s}?${n}`}this.user.fetchAndSplit(s,t.abortController.signal).then(n=>t.onReplacePartialDom(n,e.zvptarget))},reset_search:function(e,t){const s=e.trigger.closest("form");t.removeFromQParams("q"),s.elements.q.value="",s.dispatchEvent(new Event("submit"))}},ge={paginate:function(e,t){const s=`${e.href}?${e.targetval}`;this.user.fetchAndSplit(s,t.abortController.signal).then(i=>t.onReplacePartialDom(i,e.zvptarget))},list_filter:function(e,t){const s=`${e.href}?${e.targetval}`;this.user.fetchAndSplit(s,t.abortController.signal).then(i=>t.onReplacePartialDom(i,e.zvptarget))}},fe=T.__exportAll({MdcTreeHandlers:()=>qe,QueryParamHandlers:()=>ge,SearchHandlers:()=>me}),J=class extends w{#e=void 0;#t=void 0;#s={};static viewEventCode(){return u.VIEW}constructor(){super(),this.panelMap=new Map,this.user_=void 0,this.split_=void 0,this.panelEventMap_=this.initPanelEventsInternal_(),this.switchViewMap_=new Map,this.metaData_=new Map}set recordHistory(e){this.#t=e}get recordHistory(){return this.#t}set registerViewConstructor(e){this.#e=e}get registerViewConstructor(){return this.#e}set utils(e){this.#s=e}get utils(){return this.#s}set split(e){this.split_=e,this.listen(this.split_,u.SPLIT,t=>{const s=t.detail.getValue(),i=t.detail.getData();switch(s){case u.SPLIT_WILL_OPEN:this.onSplitWillOpen(i);break;case u.SPLIT_WILL_CLOSE:this.onSplitWillClose(i);break;case u.SPLIT_DID_CLOSE:this.onSplitDidClose(i);break;case u.SPLIT_DID_OPEN:this.onSplitDidOpen(i);break;case u.SPLIT_TRANSITION_END:break;default:(0,l.identity)()}})}get split(){if(!this.split_)throw new Error("No SPLIT component available");return this.split_}set user(e){this.user_=e,this.panelMap.forEach(t=>t.user=e)}get user(){return this.user_||(this.user_=new N),this.user_}render(){this.initPanelEvents(),this.preRender(),this.configurePanels(),this.displayPanels(),this.postRender()}initPanelEvents(){}preRender(){}configurePanels(){}displayPanels(){}postRender(){}dispose(){[...this.panelMap.values()].forEach(e=>e.dispose()),super.dispose()}addPanelToView(e,t){t.user=this.user,this.removePanelByName(e),this.panelMap.set(e,t),this.listen(t,F.panelEventCode(),this.onPanelEvent.bind(this))}removePanelByName(e){this.panelMap.has(e)&&this.panelMap.get(e).dispose()}removePanel(e){const[t,s]=[...this.panelMap.entries()].find(([i,r])=>r===e);t&&s&&(s.dispose(),this.panelMap.delete(t))}getPanelByName(e){return this.panelMap.get(e)}broadcastToPanels(e){[...this.panelMap.values()].forEach(t=>t.onViewDataBroadcast(e))}initPanelEventsInternal_(){const e=new Map;return e.set("destroy_me",(t,s)=>{this.removePanel(s)}),e.set("switch_view",(t,s)=>{this.debugMe("switch_view received: eventData",t);const i=t.view;this.switchViewMap_.has(i)?this.switchViewMap_.get(i)(t,s):this.debugMe("NO VIEW FOUND FOR:",i,this.switchViewMap_)}),Object.entries({...me,...ge}).forEach(([t,s])=>{e.set(t,s.bind(this))}),e}mapPanEv(e,t){this.panelEventMap_.set(e,t)}mapSwitchView(e,t){this.switchViewMap_.set(e,t)}onPanelEvent(e){let t=e.detail.getValue();if(this.debugMe(`PanelEvent Value: ${t}`),!(0,l.isDefAndNotNull)(t)){this.debugMe(`The panel received an event without a value.
17
+ There is nothing we can do with that.`);return}const s=e.detail.getData();t?.startsWith("switch_view:")&&(s.view=t.split(":")[1],t="switch_view");const i=e.target;this.panelEventMap_.has(t)?this.panelEventMap_.get(t)(s,i):this.debugMe(`NO EVENT MATCH - This usually you are missing
18
18
  a "mapPanEv(${t} ..." statement in your panel JS
19
- or you have a "event='${t}'" attribute in your panel HTML`,{event:e,eventValue:t,eventData:s,panel:r.constructor.name})}onSplitWillOpen(e){}onSplitWillClose(e){}onSplitDidClose(e){}onSplitDidOpen(e){}dispatchViewEvent(e,t){const s=new k(e,t),r=L.makeEvent(u.VIEW,s);return this.dispatchEvent(r)}get metaData(){return this.metaData_}setMetaData(e,t){return this.metaData_.set(e,t),this.metaData}getMetaData(e){return this.metaData_.get(e)}hasMetaData(e){return this.metaData_.has(e)}},Ee=class extends L{#e=new Map;#t=null;#s=void 0;#r=void 0;#i=new Map;#n={};constructor(){super(),this.#i=this.#o(),window.addEventListener("popstate",e=>{e.state!==null&&this.navTo(e.state)}),this.doOnBeat(()=>{document.dispatchEvent(new CustomEvent("zoo-tick-60",{detail:{timestamp:Date.now()}}))},6e4)}set split(e){this.#r=e}get split(){if(!this.#r)throw new Error("No SPLIT component available");return this.#r}set user(e){this.#s=e,this.#t&&(this.#t.user=this.user)}get user(){return this.#s||(this.#s=new A),this.#s}get utils(){return this.#n}registerUtil(e){this.#n=(0,De.mergeRight)(this.#n,e)}#o(){return new Map().set("switch_view",(e,t)=>{if(this.#e.has(e.view)){const s=this.#e.get(e.view)(e.pk||e.recordId,e);this.switchView(s)}})}mapViewEv(e,t){this.#i.set(e,t)}registerViewConstructor(e,t){this.#e.set(e,t)}onViewEvent(e){const t=e.detail.getValue(),s=e.detail.getData(),r=e.target;this.#i.has(t)?this.#i.get(t)(s,r):console.warn("Unhandled VIEW Event:",e,t,s,r)}setActiveView(e){this.#t&&(this.stopListeningTo(this.#t),this.#t.dispose(),this.#t=null),this.#t=e,this.#t.render()}initView(e){return e.user=this.user,e.split=this.split,e.utils=this.utils,e.recordHistory=this.recordHistory.bind(this),e.registerViewConstructor=this.registerViewConstructor.bind(this),this.listen(e,W.viewEventCode(),this.onViewEvent.bind(this)),e}switchView(e){this.setActiveView(this.initView(e))}recordHistory(e){this.debugMe("HISTORY",e),e.init?history.replaceState(e,"",document.location.href):e.history||history.pushState(e,"",null)}navTo=e=>{e.history=!0;const t=e.view,s=this.#t;if(s.switchViewMap_.has(t))this.debugMe("NAV:VIEW:MAP",e),s.switchViewMap_.get(t)(e);else if(this.#e.has(t)){const r=this.#e.get(t)(e.pk,e);this.debugMe("NAV:NEW:VIEW",e),this.switchView(r)}}};async function fe(e={}){const{registerCarbonLibrary:t}=await Promise.resolve().then(()=>require("./chunks/register-aC3Bk1C3.js"));return t(e)}async function ve(){const{registerMdcLibrary:e}=await Promise.resolve().then(()=>require("./chunks/register-BToVLXl9.js"));return e()}var qe={Evt:L,Component:w,Dragger:z,Panel:q,FormPanel:de,Split:ue,UserManager:A,View:W,Conductor:Ee,DataBinder:P.Binder,UiEventType:u,domUtils:p.utils_exports,uriUtils:se,registerCarbonLibrary:fe,registerMdcLibrary:ve,ComponentLibraryRegistry:b.ComponentLibraryRegistry,handlers:ge,zoo:P.zoo_exports};exports.Binder=P.Binder;exports.Component=w;exports.ComponentLibraryRegistry=b.ComponentLibraryRegistry;exports.Conductor=Ee;exports.Dragger=z;exports.Evt=L;exports.FormPanel=de;exports.Panel=q;exports.Split=ue;exports.UiEventType=u;exports.UserManager=A;exports.View=W;exports.default=qe;Object.defineProperty(exports,"domUtils",{enumerable:!0,get:function(){return p.utils_exports}});Object.defineProperty(exports,"handlers",{enumerable:!0,get:function(){return ge}});exports.registerCarbonLibrary=fe;exports.registerMdcLibrary=ve;Object.defineProperty(exports,"uriUtils",{enumerable:!0,get:function(){return se}});Object.defineProperty(exports,"zoo",{enumerable:!0,get:function(){return P.zoo_exports}});
19
+ or you have a "event='${t}'" attribute in your panel HTML`,{event:e,eventValue:t,eventData:s,panel:i.constructor.name})}onSplitWillOpen(e){}onSplitWillClose(e){}onSplitDidClose(e){}onSplitDidOpen(e){}dispatchViewEvent(e,t){const s=new U(e,t),i=w.makeEvent(u.VIEW,s);return this.dispatchEvent(i)}get metaData(){return this.metaData_}setMetaData(e,t){return this.metaData_.set(e,t),this.metaData}getMetaData(e){return this.metaData_.get(e)}hasMetaData(e){return this.metaData_.has(e)}},ve=class extends w{#e=new Map;#t=null;#s=void 0;#i=void 0;#r=new Map;#n={};constructor(){super(),this.#r=this.#o(),window.addEventListener("popstate",e=>{e.state!==null&&this.navTo(e.state)}),this.doOnBeat(()=>{document.dispatchEvent(new CustomEvent("zoo-tick-60",{detail:{timestamp:Date.now()}}))},6e4)}set split(e){this.#i=e}get split(){if(!this.#i)throw new Error("No SPLIT component available");return this.#i}set user(e){this.#s=e,this.#t&&(this.#t.user=this.user)}get user(){return this.#s||(this.#s=new N),this.#s}get utils(){return this.#n}registerUtil(e){this.#n=(0,Ce.mergeRight)(this.#n,e)}#o(){return new Map().set("switch_view",(e,t)=>{if(this.#e.has(e.view)){const s=this.#e.get(e.view)(e.pk||e.recordId,e);this.switchView(s)}})}mapViewEv(e,t){this.#r.set(e,t)}registerViewConstructor(e,t){this.#e.set(e,t)}onViewEvent(e){const t=e.detail.getValue(),s=e.detail.getData(),i=e.target;this.#r.has(t)?this.#r.get(t)(s,i):console.warn("Unhandled VIEW Event:",e,t,s,i)}setActiveView(e){this.#t&&(this.stopListeningTo(this.#t),this.#t.dispose(),this.#t=null),this.#t=e,this.#t.render()}initView(e){return e.user=this.user,e.split=this.split,e.utils=this.utils,e.recordHistory=this.recordHistory.bind(this),e.registerViewConstructor=this.registerViewConstructor.bind(this),this.listen(e,J.viewEventCode(),this.onViewEvent.bind(this)),e}switchView(e){this.setActiveView(this.initView(e))}recordHistory(e){this.debugMe("HISTORY",e),e.init?history.replaceState(e,"",document.location.href):e.history||history.pushState(e,"",null)}navTo=e=>{e.history=!0;const t=e.view,s=this.#t;if(s.switchViewMap_.has(t))this.debugMe("NAV:VIEW:MAP",e),s.switchViewMap_.get(t)(e);else if(this.#e.has(t)){const i=this.#e.get(t)(e.pk,e);this.debugMe("NAV:NEW:VIEW",e),this.switchView(i)}}},Ee=class extends L.LitElement{static properties={token:{type:String},prefix:{type:String},postfix:{type:String}};static styles=L.css`
20
+ :host {
21
+ display: inline-block;
22
+ }
23
+
24
+ .tag {
25
+ text-align: center;
26
+ display: inline-flex;
27
+ align-items: center;
28
+ justify-content: center;
29
+ line-height: initial;
30
+ width: max-content;
31
+ padding: 0.2em 1em;
32
+ border-radius: 1em;
33
+ font-size: var(--zoo-theme-chips-font-size, 0.75rem);
34
+ white-space: nowrap;
35
+ word-break: break-word;
36
+ box-sizing: border-box;
37
+ }
38
+ `;render(){const e=`${this.prefix??""}${this.token??"default"}${this.postfix??""}`;return L.html`
39
+ <span
40
+ class="tag"
41
+ style="
42
+ background-color: var(--zoo-tag-${e}-bg, var(--zoo-tag-default-bg, #9e9e9e));
43
+ color: var(--zoo-tag-${e}-fg, var(--zoo-tag-default-fg, #ffffff));
44
+ "
45
+ >
46
+ <slot></slot>
47
+ </span>
48
+ `}};customElements.get("zoo-tag")||customElements.define("zoo-tag",Ee);var je=e=>{const t=Math.floor((new Date-e)/1e3),s=[{name:"year",seconds:31536e3},{name:"month",seconds:2592e3},{name:"week",seconds:604800},{name:"day",seconds:86400},{name:"hour",seconds:3600},{name:"minute",seconds:60},{name:"second",seconds:1}];if(t<0){const i=Math.abs(t);for(const r of s){const n=Math.floor(i/r.seconds);if(n>=1)return new Intl.RelativeTimeFormat("en",{numeric:"auto"}).format(n,r.name)}return"just now"}for(const i of s){const r=Math.floor(t/i.seconds);if(r>=1)return new Intl.RelativeTimeFormat("en",{numeric:"auto"}).format(-r,i.name)}return"just now"},He=e=>{const[{value:t},,{value:s},,{value:i},,{value:r},,{value:n},,{value:c}]=new Intl.DateTimeFormat("en",{day:"2-digit",month:"short",year:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hourCycle:"h23"}).formatToParts(e);return`${s} ${t} ${i} ${r}:${n}:${c}`},We=e=>{const[{value:t},,{value:s},,{value:i}]=new Intl.DateTimeFormat("en",{day:"2-digit",month:"short",year:"2-digit"}).formatToParts(e);return`${s} ${t} ${i}`},_e=class extends L.LitElement{static properties={timestamp:{type:Number},kind:{type:String},concat:{type:String}};static styles=L.css`
49
+ :host {
50
+ display: inline;
51
+ }
52
+
53
+ .relative {
54
+ color: var(--zoo-timestamp-relative-color, inherit);
55
+ font-weight: var(--zoo-timestamp-relative-weight, inherit);
56
+ font-size: var(--zoo-timestamp-relative-size, inherit);
57
+ }
58
+
59
+ .static {
60
+ color: var(--zoo-timestamp-static-color, inherit);
61
+ font-weight: var(--zoo-timestamp-static-weight, inherit);
62
+ font-size: var(--zoo-timestamp-static-size, inherit);
63
+ }
64
+
65
+ .separator {
66
+ color: var(--zoo-timestamp-separator-color, inherit);
67
+ }
68
+
69
+ :host([kind="stack"]) {
70
+ display: inline-block;
71
+ vertical-align: middle;
72
+ }
73
+
74
+ :host([kind="stack"]) time {
75
+ display: flex;
76
+ flex-direction: column;
77
+ gap: var(--zoo-timestamp-stack-gap, 0);
78
+ align-items: var(--zoo-timestamp-stack-align, stretch);
79
+ }
80
+ `;constructor(){super(),this.timestamp=Date.now(),this.kind="both",this.concat="r (s)",this._boundTickHandler=this._onTimeTick.bind(this),this._isListening=!1}_shouldListenToTicks(){return this.kind==="relative"||this.kind==="both"||this.kind==="stack"}connectedCallback(){super.connectedCallback(),this._updateTickListener()}disconnectedCallback(){this._removeTickListener(),super.disconnectedCallback()}updated(e){super.updated(e),e.has("kind")&&this._updateTickListener()}_updateTickListener(){const e=this._shouldListenToTicks();e&&!this._isListening?(document.addEventListener("zoo-tick-60",this._boundTickHandler),this._isListening=!0):!e&&this._isListening&&this._removeTickListener()}_removeTickListener(){this._isListening&&(document.removeEventListener("zoo-tick-60",this._boundTickHandler),this._isListening=!1)}_onTimeTick(){this.requestUpdate()}_parseTemplate(e){const t=[];let s=e;for(;s.length>0;){const i=s.indexOf("r"),r=s.indexOf("s"),n=[i,r,s.indexOf("d")].filter(c=>c!==-1).sort((c,g)=>c-g)[0];if(n===void 0){s.length>0&&t.push({type:"text",value:s});break}n>0&&t.push({type:"text",value:s.substring(0,n)}),n===i?t.push({type:"relative",value:""}):n===r?t.push({type:"static",value:""}):t.push({type:"dateOnly",value:""}),s=s.substring(n+1)}return t}_parseStackOrder(e){const t=e.indexOf("r"),s=e.indexOf("s"),i=e.indexOf("d");let r=-1,n=null;return s!==-1&&(i===-1||s<i)?(r=s,n="static"):i!==-1&&(r=i,n="dateOnly"),t!==-1&&r!==-1?t<r?["relative",n]:[n,"relative"]:t!==-1?["relative"]:r!==-1?[n]:["relative","static"]}_getFormattedParts(){let e=this.timestamp;e<9466848e5&&(e=e*1e3);const t=new Date(e),s=je(t),i=He(t),r=We(t);switch(this.kind){case"relative":return[{type:"relative",value:s}];case"datetime":return[{type:"static",value:i}];case"date":return[{type:"static",value:r}];case"both":return this._parseTemplate(this.concat).map(n=>n.type==="relative"?{type:"relative",value:s}:n.type==="static"?{type:"static",value:i}:n.type==="dateOnly"?{type:"static",value:r}:n);case"stack":return this._parseStackOrder(this.concat).map(n=>n==="relative"?{type:"relative",value:s}:n==="dateOnly"?{type:"static",value:r}:{type:"static",value:i});default:return this._parseTemplate(this.concat).map(n=>n.type==="relative"?{type:"relative",value:s}:n.type==="static"?{type:"static",value:i}:n.type==="dateOnly"?{type:"static",value:r}:n)}}render(){let e=this.timestamp;e<9466848e5&&(e=e*1e3);const t=new Date(e),s=this._getFormattedParts();return L.html`<time datetime="${t.toISOString()}">
81
+ ${s.map(i=>i.type==="relative"?L.html`<span class="relative">${i.value}</span>`:i.type==="static"?L.html`<span class="static">${i.value}</span>`:L.html`<span class="separator">${i.value}</span>`)}
82
+ </time>`}};customElements.get("zoo-timestamp")||customElements.define("zoo-timestamp",_e);var ye=T.__exportAll({ZooTag:()=>Ee,ZooTimestamp:()=>_e,getEventAttribute:()=>A.getEventAttribute,getSemanticAttributes:()=>A.getSemanticAttributes});async function be(e={}){const{registerCarbonLibrary:t}=await Promise.resolve().then(()=>require("./chunks/register-Cvf7s1Ds.js"));return t(e)}async function Se(){const{registerMdcLibrary:e}=await Promise.resolve().then(()=>require("./chunks/register-Kldh2rNG.js"));return e()}var Je={Evt:w,Component:I,Dragger:V,Panel:F,FormPanel:ue,Split:pe,UserManager:N,View:J,Conductor:ve,DataBinder:A.Binder,UiEventType:u,domUtils:p.utils_exports,uriUtils:ie,registerCarbonLibrary:be,registerMdcLibrary:Se,ComponentLibraryRegistry:T.ComponentLibraryRegistry,handlers:fe,zoo:ye};exports.Binder=A.Binder;exports.Component=I;exports.ComponentLibraryRegistry=T.ComponentLibraryRegistry;exports.Conductor=ve;exports.Dragger=V;exports.Evt=w;exports.FormPanel=ue;exports.Panel=F;exports.Split=pe;exports.UiEventType=u;exports.UserManager=N;exports.View=J;exports.default=Je;Object.defineProperty(exports,"domUtils",{enumerable:!0,get:function(){return p.utils_exports}});Object.defineProperty(exports,"handlers",{enumerable:!0,get:function(){return fe}});exports.registerCarbonLibrary=be;exports.registerMdcLibrary=Se;Object.defineProperty(exports,"uriUtils",{enumerable:!0,get:function(){return ie}});Object.defineProperty(exports,"zoo",{enumerable:!0,get:function(){return ye}});