@trintel/zooy 1.0.1 → 1.0.6
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/chunks/{button-B1jzfT-Z.js → button-B0pHcmMI.js} +4 -4
- package/dist/chunks/{button-C-oX8EmF.js → button-ipPZo47H.js} +1 -1
- package/dist/chunks/{button-skeleton-CK3BHdja.js → button-skeleton-B6LNPMkm.js} +1 -1
- package/dist/chunks/{button-skeleton-DoCp6sBb.js → button-skeleton-k3oSeCNN.js} +4 -4
- package/dist/chunks/{checkbox-CgFjYxQ_.js → checkbox-CbojCj7Q.js} +5 -5
- package/dist/chunks/{checkbox-t3G-H1NN.js → checkbox-DIl3-QIU.js} +1 -1
- package/dist/chunks/{class-map-D6tjF27Y.js → class-map-CzV93n0F.js} +1 -1
- package/dist/chunks/{class-map-FWQBIzSx.js → class-map-YDvRldcS.js} +1 -1
- package/dist/chunks/{content-switcher-item-c4WBWz31.js → content-switcher-item-BImKB6ec.js} +1 -1
- package/dist/chunks/{content-switcher-item-CedjjtvP.js → content-switcher-item-ITN6pSnn.js} +4 -4
- package/dist/chunks/{dropdown-item-Dh5IEXDr.js → dropdown-item-CsDrcPOQ.js} +171 -160
- package/dist/chunks/dropdown-item-kRfkvScw.js +69 -0
- package/dist/chunks/{icon-loader-ChKeNR4s.js → icon-loader-Dow8ZZc6.js} +1 -1
- package/dist/chunks/{icon-loader-CJxyg-lp.js → icon-loader-mGBPivE_.js} +1 -1
- package/dist/chunks/{icon-loader-utils-BwViqIXz.js → icon-loader-utils-Bu4uywG7.js} +1 -1
- package/dist/chunks/{icon-loader-utils-DK8DViXt.js → icon-loader-utils-DyTEZTmU.js} +1 -1
- package/dist/chunks/{if-defined-DYWhlnlE.js → if-defined-8Z59Lgbt.js} +1 -1
- package/dist/chunks/{if-defined-eJcDYClo.js → if-defined-BDPFnNTF.js} +1 -1
- package/dist/chunks/if-non-empty-D97PxarH.js +1 -0
- package/dist/chunks/{if-non-empty-COTeEFkK.js → if-non-empty-PXsZdrZY.js} +1 -1
- package/dist/chunks/{index-C2oV5vU3.js → index--36H8tEu.js} +1 -1
- package/dist/chunks/{index-pc36PiDY.js → index-0GgWrbOC.js} +1 -1
- package/dist/chunks/{index-CIiIAqrQ.js → index-3DFPYYjC.js} +130 -120
- package/dist/chunks/{index-CFqKkC5Z.js → index-6SYj2oOF.js} +1 -1
- package/dist/chunks/{index-yzFU-E6F.js → index-7GkEyUE1.js} +7 -7
- package/dist/chunks/{index-hn76Yo-L.js → index-AIOAeqkA.js} +1 -1
- package/dist/chunks/{index-i9jyrFc9.js → index-B-Yx5Hy2.js} +1 -1
- package/dist/chunks/{index-BAAA4wkE.js → index-B1HY13ji.js} +2 -2
- package/dist/chunks/{index-ClE0uX_c.js → index-B2gykqN9.js} +7 -7
- package/dist/chunks/{index-BwRxBdeg.js → index-B6dAUFGm.js} +1 -1
- package/dist/chunks/{index-CWlg_Hu2.js → index-B9EQl0eG.js} +4 -4
- package/dist/chunks/{index-BBWp83R-.js → index-BAoe1j9r.js} +1 -1
- package/dist/chunks/{index-Bb_1S0pr.js → index-BI5zwXiD.js} +5 -5
- package/dist/chunks/{index-BRnzFxjk.js → index-BI6a_hyH.js} +1 -1
- package/dist/chunks/{index-BQnyeVHX.js → index-BKZY1peh.js} +1 -1
- package/dist/chunks/{index-TJL02uup.js → index-BMibCYm9.js} +143 -139
- package/dist/chunks/{index-uxZPrL2m.js → index-BMwdiru1.js} +6 -6
- package/dist/chunks/{index-DrDKdYFJ.js → index-BN3-hMLP.js} +1 -1
- package/dist/chunks/{index-BBap1uCI.js → index-BNHMp_x_.js} +1 -1
- package/dist/chunks/{index-OgL1A9Rm.js → index-BWFaxGTp.js} +26 -24
- package/dist/chunks/{index-DfFx1Jz3.js → index-BWRKkjuC.js} +3 -3
- package/dist/chunks/{index-DSOPjl5x.js → index-BX6awuOJ.js} +7 -7
- package/dist/chunks/{index-BvdNKhJw.js → index-BXU45N6f.js} +1 -1
- package/dist/chunks/{index-9fmHblh5.js → index-BXkpcsH3.js} +1 -1
- package/dist/chunks/{index-CJdEJ8pY.js → index-BYEi67oz.js} +1 -1
- package/dist/chunks/index-BZa4lAPZ.js +4 -0
- package/dist/chunks/{index-DGw1TVFB.js → index-BbbS7f42.js} +2 -2
- package/dist/chunks/{index-Bls8zdHV.js → index-BbkJWRo0.js} +5 -5
- package/dist/chunks/{index-DYvD9xjl.js → index-BbzTQivK.js} +1 -1
- package/dist/chunks/{index-CV7TVQ4T.js → index-Bc6QDBfO.js} +5 -5
- package/dist/chunks/{index-qgl9W8eF.js → index-BfNg6Bfq.js} +39 -39
- package/dist/chunks/{index-DUtoSCTU.js → index-Bg7fp8eN.js} +10 -10
- package/dist/chunks/{index-BMquNDkd.js → index-BgL2QyGL.js} +7 -7
- package/dist/chunks/{index-cuMoh7qn.js → index-BnGRdxLM.js} +1 -1
- package/dist/chunks/{index-du3RQU31.js → index-BrES15QR.js} +7 -7
- package/dist/chunks/{index-QzojJs5M.js → index-Bsg-X5g6.js} +2 -2
- package/dist/chunks/{index-D8LE8G2j.js → index-BvewYlR6.js} +18 -18
- package/dist/chunks/{index-0AElqkkj.js → index-Bwg9JvxU.js} +1 -1
- package/dist/chunks/{index-CYIcfuAW.js → index-BxGnpgtA.js} +3 -3
- package/dist/chunks/{index-Dh4LYLg5.js → index-BxYuKaia.js} +11 -11
- package/dist/chunks/{index-C6bOvXSf.js → index-BzEYhXCp.js} +4 -4
- package/dist/chunks/{index-DyO3Wdy_.js → index-C4_lq5Gk.js} +1 -1
- package/dist/chunks/{index-CsjJntyD.js → index-C78nOW55.js} +1 -1
- package/dist/chunks/{index-Bt7v-zqV.js → index-C7bMRqDp.js} +1 -1
- package/dist/chunks/{index-C572_UKV.js → index-C8U2hhih.js} +1 -1
- package/dist/chunks/{index-7cXLLw89.js → index-CDogTzrE.js} +5 -5
- package/dist/chunks/{index-C-pfDP7B.js → index-CGgfnUw2.js} +1 -1
- package/dist/chunks/{index-CzAwJhyQ.js → index-CM5SpejK.js} +3 -3
- package/dist/chunks/{index-4XJJobHw.js → index-CTCHzPo9.js} +5 -5
- package/dist/chunks/{index-GbWz6fuF.js → index-CakpnEVH.js} +5 -5
- package/dist/chunks/index-Ck0UGXjG.js +25 -0
- package/dist/chunks/{index-CqQZpHti.js → index-CnMeUAwm.js} +1 -1
- package/dist/chunks/{index-4WNeLsiw.js → index-Cogd5TV0.js} +3 -3
- package/dist/chunks/index-Cp8R3aIT.js +2 -0
- package/dist/chunks/{index-CEy6bu7P.js → index-Cp8qvks4.js} +1 -1
- package/dist/chunks/{index-JWULDURW.js → index-Cqq6DFEH.js} +1 -1
- package/dist/chunks/{index-DWjrCygZ.js → index-CwGCzAjy.js} +34 -26
- package/dist/chunks/{index-CIZ3Gnmm.js → index-D0YPAPQg.js} +1 -1
- package/dist/chunks/{index-CKYRBtLC.js → index-D1nMSslt.js} +1 -1
- package/dist/chunks/{index-Bunat0DP.js → index-D6A8xmd2.js} +6 -6
- package/dist/chunks/{index-Bo2QmpPO.js → index-D9QkLbZ1.js} +1 -1
- package/dist/chunks/{index-Ctna95NT.js → index-DAp9FO-q.js} +4 -4
- package/dist/chunks/{index-BGGDxbLL.js → index-DDrcJDBe.js} +5 -5
- package/dist/chunks/{index-Bff6B9vY.js → index-DH3GxHNZ.js} +105 -75
- package/dist/chunks/{index-B8Ze9ISK.js → index-DHoTp3xF.js} +1 -1
- package/dist/chunks/{index-GDVDUQtg.js → index-DKAiRnw5.js} +86 -68
- package/dist/chunks/{index-Cp3P3KaW.js → index-DLLtonpF.js} +1 -1
- package/dist/chunks/{index-CTsGb3mD.js → index-DNAwj4nV.js} +7 -7
- package/dist/chunks/{index-Dk3tlz8Q.js → index-DQpYsYAB.js} +1 -1
- package/dist/chunks/index-DUgugnka.js +1 -0
- package/dist/chunks/{index-DZabSr3s.js → index-DWBna1oy.js} +3 -3
- package/dist/chunks/{index-CBICHiFD.js → index-DaPLGBBg.js} +219 -218
- package/dist/chunks/{index-Bymsj9gH.js → index-DhmD363c.js} +1 -1
- package/dist/chunks/{index-B4SxU_Hu.js → index-DjiQpWrp.js} +7 -7
- package/dist/chunks/{index-Dd9iSSXa.js → index-DlGr9Xg0.js} +3 -3
- package/dist/chunks/{index-MgWriQfr.js → index-DmO2xqTL.js} +1 -1
- package/dist/chunks/{index-CoAT1iC6.js → index-DnkzqA37.js} +1 -1
- package/dist/chunks/{index-Cv6qE9qP.js → index-DnqBivkj.js} +1 -1
- package/dist/chunks/{index-Cwb1pbm9.js → index-DotbnSU-.js} +5 -5
- package/dist/chunks/{index-DBsASlZI.js → index-DqcQzBNJ.js} +1 -1
- package/dist/chunks/{index-Z4ar01y-.js → index-DrqxeFX2.js} +4 -4
- package/dist/chunks/{index-_xRytR0j.js → index-Ds7klCOs.js} +1 -1
- package/dist/chunks/{index-Cnsy7Qk3.js → index-DtEEVxFL.js} +5 -5
- package/dist/chunks/{index-DbAeG1nY.js → index-DwyQjc9z.js} +1 -1
- package/dist/chunks/{index-BseD7Jzt.js → index-DxLh8qIT.js} +1 -1
- package/dist/chunks/{index-lFqOe0IJ.js → index-HDrN-36Q.js} +1 -1
- package/dist/chunks/{index-uwN33H1P.js → index-HZx30Dhs.js} +6 -6
- package/dist/chunks/{index-BeMnerDj.js → index-IFR1tBYd.js} +8 -8
- package/dist/chunks/{index-D9sRIKMQ.js → index-Ibt0J2Et.js} +5 -5
- package/dist/chunks/{index-BwFE4R87.js → index-LXKAODF5.js} +3 -3
- package/dist/chunks/{index-DNWjc2SJ.js → index-PFLnPKPE.js} +2 -2
- package/dist/chunks/{index-BbJQIwkY.js → index-QGOiUcMf.js} +9 -9
- package/dist/chunks/{index-CQl4NaPS.js → index-S--lY3tt.js} +1 -1
- package/dist/chunks/{index-DyyLrVDY.js → index-WZTepZq8.js} +4 -4
- package/dist/chunks/{index-B5GB0rQW.js → index-XQC8MAEe.js} +168 -152
- package/dist/chunks/{index-hH_m653R.js → index-Xu24xEY5.js} +5 -5
- package/dist/chunks/{index-Bi9WliCA.js → index-aYMyslt1.js} +6 -6
- package/dist/chunks/{index-pS6-humH.js → index-ahaFzumj.js} +1 -1
- package/dist/chunks/{index-i4heE-wx.js → index-dvBCRXrm.js} +3 -3
- package/dist/chunks/{index-CR3DrmQi.js → index-kxMxVHET.js} +8 -8
- package/dist/chunks/{index-Cu1u3Mjn.js → index-qE5bNTwO.js} +4 -4
- package/dist/chunks/{index-C3n83pM3.js → index-stqanTdz.js} +1 -1
- package/dist/chunks/{index-Dc51G1mo.js → index-uX8xG4Vo.js} +1 -1
- package/dist/chunks/{index-CkxGsCJy.js → index-xA7Xy6rP.js} +7 -7
- package/dist/chunks/{loading-icon-CPvmJvpZ.js → loading-icon-Du-W6uYg.js} +1 -1
- package/dist/chunks/{loading-icon-DdwpAk8-.js → loading-icon-cx8c6lGR.js} +1 -1
- package/dist/chunks/{main-Bx21zlkN.js → main-CzT-ERU9.js} +7 -7
- package/dist/chunks/{main-BGOPab-5.js → main-drDSYMFZ.js} +214 -168
- package/dist/chunks/{property-DAFv3PCb.js → property-BCpjYZvp.js} +1 -1
- package/dist/chunks/{property-BkjBVRuu.js → property-D_322E-w.js} +1 -1
- package/dist/chunks/{register-Bkr1UKav.js → register-BccP7PcJ.js} +1 -1
- package/dist/chunks/{register-BCEOkbXG.js → register-CkIAvkFm.js} +415 -376
- package/dist/chunks/{register-DTXmg-gw.js → register-D2Du9nP6.js} +1 -1
- package/dist/chunks/register-c8kclAIe.js +1 -0
- package/dist/chunks/{search-DDFN8-Mz.js → search-W_YGbHlx.js} +2 -1
- package/dist/chunks/{search-npG8ywjx.js → search-cMvVciXy.js} +8 -7
- package/dist/chunks/{select-DkCpQORs.js → select-CqHLAMa8.js} +105 -98
- package/dist/chunks/{select-CFy3MvH6.js → select-D504gjBr.js} +41 -37
- package/dist/chunks/{state-BdgD82MZ.js → state-BMCv3deJ.js} +1 -1
- package/dist/chunks/{state-uF7CZaP5.js → state-CSz_uJVe.js} +1 -1
- package/dist/chunks/{text-input-BUdM-ojg.js → text-input--Eu83Ioh.js} +1 -1
- package/dist/chunks/{text-input-DVdkm07X.js → text-input-Bj0yhsyz.js} +5 -5
- package/dist/chunks/{tooltip-content-BXcBmMsV.js → tooltip-content-BJ9-iov_.js} +1 -1
- package/dist/chunks/{tooltip-content-CWRE_NqH.js → tooltip-content-vhQrj4r2.js} +3 -3
- package/dist/chunks/{unsafe-html-Bg0eM3hS.js → unsafe-html-CDTy78HP.js} +1 -1
- package/dist/chunks/{unsafe-html-CpAqmPyx.js → unsafe-html-CjIbXhDp.js} +1 -1
- package/dist/zooy.cjs.js +1 -1
- package/dist/zooy.es.js +3 -3
- package/package.json +2 -2
- package/src/sass/carbon.scss +46 -13
- package/dist/chunks/dropdown-item-C0SHr4st.js +0 -69
- package/dist/chunks/if-non-empty-CxMysAQW.js +0 -1
- package/dist/chunks/index-B0nToMRj.js +0 -25
- package/dist/chunks/index-B5DpS-cb.js +0 -2
- package/dist/chunks/index-DIsXKJDH.js +0 -4
- package/dist/chunks/index-Do1DszoZ.js +0 -1
- package/dist/chunks/register-D_CXtGy1.js +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { _ as x } from "./tslib.es6-C5gLNDSD.js";
|
|
2
|
-
import { a as Xt, i as Ie, x as re,
|
|
3
|
-
import { n as S } from "./property-
|
|
2
|
+
import { a as Xt, i as Ie, x as re, k as st } from "./main-drDSYMFZ.js";
|
|
3
|
+
import { n as S } from "./property-D_322E-w.js";
|
|
4
4
|
import { e as Ke } from "./query-CbRg6ZGy.js";
|
|
5
5
|
import { p as k } from "./settings-jvP7vP60.js";
|
|
6
6
|
import { F as Jt } from "./form-DpI-v6DA.js";
|
|
@@ -8,16 +8,16 @@ import { H as Gt } from "./host-listener-CN245INl.js";
|
|
|
8
8
|
import { H as Zt } from "./host-listener-DD3oGxvg.js";
|
|
9
9
|
import { f as Be, b as Qt } from "./collection-helpers-Bk68Vaau.js";
|
|
10
10
|
import { o as Q } from "./on-BPhwbVf3.js";
|
|
11
|
-
import { e as xe } from "./class-map-
|
|
12
|
-
import { r as en } from "./state-
|
|
13
|
-
import { o as ct } from "./if-defined-
|
|
11
|
+
import { e as xe } from "./class-map-YDvRldcS.js";
|
|
12
|
+
import { r as en } from "./state-CSz_uJVe.js";
|
|
13
|
+
import { o as ct } from "./if-defined-BDPFnNTF.js";
|
|
14
14
|
import { F as tn } from "./focus-WnKGH_xB.js";
|
|
15
|
-
import { I as nn } from "./text-input-
|
|
15
|
+
import { I as nn } from "./text-input-Bj0yhsyz.js";
|
|
16
16
|
import { F as an } from "./shared-enums-DALKjQ7e.js";
|
|
17
17
|
import { _ as rn } from "./16-BiShwKPX.js";
|
|
18
18
|
import { _ as on } from "./16-BwDdccyH.js";
|
|
19
19
|
import { c as Ue } from "./carbon-element-DzDuXiyl.js";
|
|
20
|
-
import { i as me } from "./icon-loader-
|
|
20
|
+
import { i as me } from "./icon-loader-mGBPivE_.js";
|
|
21
21
|
import { _ as sn } from "./16-CqC9427V.js";
|
|
22
22
|
import { _ as cn } from "./16-Drl9-5Gn.js";
|
|
23
23
|
function dn(a) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const n=require("./main-
|
|
1
|
+
"use strict";const n=require("./main-CzT-ERU9.js"),e=require("./settings-Bgpv8zuU.js");var s=({description:i,small:c})=>{const r=c?"42":"44";return n.x`
|
|
2
2
|
<svg class="${e.prefix}--loading__svg" viewBox="0 0 100 100">
|
|
3
3
|
${i?n.x` <title>${i}</title> `:void 0}
|
|
4
4
|
<circle
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";const numericString="0123456789".split("");[...numericString];const alphaLower="abcdefghijklmnopqrstuvwxyz".split(""),alphaUpper="ABCDEFGHIJKLMNOPQRSTUVWXYZ".split("");[...alphaLower,...alphaUpper,...numericString];new Map().set("true",!0).set("false",!1);const compose=(...O)=>(...w)=>O.reduce((D,U)=>F=>D(U(F)))(...w),identity=O=>O,whatType=O=>typeof O,isDef=O=>O!==void 0,isUndefined=O=>O===void 0,isDefAndNotNull=O=>O!=null,isString=O=>whatType(O)==="string",isNumber=O=>whatType(O)==="number"&&!Number.isNaN(O),isObject=O=>(O&&typeof O=="object"&&!(O instanceof Array)&&!(O instanceof Set)&&!(O instanceof Map)&&!(O instanceof Date))===!0,isArray=O=>O instanceof Array,reverse=O=>Array.from(O).reduce((w,D)=>[D,...w],[]),toLowerCase=O=>O.toLowerCase(),toString$1=O=>O+"",toNumber=O=>+O;compose(toLowerCase,toString$1);const makeRandomString=()=>{let O=2147483648;return Math.floor(Math.random()*O).toString(36)+Math.abs(Math.floor(Math.random()*O)^Date.now()).toString(36)},stripLeadingChar=O=>w=>w.startsWith(O)?w.slice(O.length):w,join=O=>w=>w.join(O);compose(join(""),reverse);const pathOr=(O,w)=>D=>{const U=w.reduce((F,q)=>{try{return F[maybeNumber(q)]}catch{return}},D);return U===void 0?O:U},objToPaths=(O,w=[],D=[])=>(Object.entries(O).forEach(([U,F])=>{isObject(F)?objToPaths(F,[...w,U],D):D.push([[...w,U],F])}),D),randomId=O=>{const w=makeRandomString();return O?w.substr(0,O):w},maybeNumber=O=>{if(O===null||whatType(O)==="string"&&O.length>1&&O.startsWith("0")&&!O.startsWith("0."))return O;const w=1*O;return w>Number.MAX_SAFE_INTEGER||Number.isNaN(w)?O:w};compose(toNumber,join(""),reverse,toString$1);class Evt extends EventTarget{#t=!1;#e=!1;#s=new Map;#r=new Set;#n=new Set;static makeEvent(w,D){return new CustomEvent(w,{detail:D})}set debugMode(w){if(typeof w!="boolean")throw new Error("This must be a boolean");this.#t=w}get debugMode(){return this.#t}get disposed(){return this.#e}get listeningTo(){return this.#s}get isObservedBy(){return this.#r}get activeIntervals(){return this.#n}debugMe(...w){this.#t&&console.log.apply(null,[this.constructor.name,"DEBUG:",...w])}isListenedToBy(w){this.#r.add(w)}listen(w,D,U,F=!1){w.addEventListener(D,U,F);const q=this.listeningTo.get(w)||{};q[D]=()=>w.removeEventListener(D,U,F),this.listeningTo.set(w,q),isDef(w.isListenedToBy)&&w.isListenedToBy(this)}stopBeingListenedTo(){for(const w of this.isObservedBy)w.stopListeningTo(this),this.isObservedBy.delete(w)}stopListeningTo(w,D){w&&this.listeningTo.has(w)&&(isDef(w.isObservedBy)&&w.isObservedBy.delete(this),isDef(D)?(Object.entries(this.listeningTo.get(w)).forEach(([U,F])=>{U===D&&F()}),Object.keys(this.listeningTo.get(w)).length||this.listeningTo.delete(w)):(Object.values(this.listeningTo.get(w)).forEach(U=>U()),this.listeningTo.delete(w)))}removeAllListener(){for(const w of this.listeningTo.keys())this.stopListeningTo(w)}clearAllIntervals(){for(const w of this.activeIntervals)clearInterval(w),this.activeIntervals.delete(w)}doOnBeat(w,D){const U=setInterval(w,D);this.activeIntervals.add(U)}disposeInternal(){this.stopBeingListenedTo(),this.removeAllListener(),this.clearAllIntervals(),this.#e=!0}dispose(){this.disposeInternal()}}class ZooyEventData{constructor(w,D){this.value_=w,this.data_=D||{}}getValue(){return this.value_}getData(){return this.data_}}const UiEventType={COMP:randomId(),COMP_DRAG_START:randomId(),COMP_DRAG_MOVE:randomId(),COMP_DRAG_END:randomId(),PANEL:randomId(),VIEW:randomId(),SPLIT:randomId(),SPLIT_WILL_OPEN:randomId(),SPLIT_DID_OPEN:randomId(),SPLIT_WILL_CLOSE:randomId(),SPLIT_DID_CLOSE:randomId(),SPLIT_TRANSITION_END:randomId(),READY:randomId(),PANEL_MINIMIZE:randomId(),FORM_SUBMIT_SUCCESS:randomId()};var EN_US=["second","minute","hour","day","week","month","year"];function en_US(O,w){if(w===0)return["just now","right now"];var D=EN_US[Math.floor(w/2)];return O>1&&(D+="s"),[O+" "+D+" ago","in "+O+" "+D]}var ZH_CN=["秒","分钟","小时","天","周","个月","年"];function zh_CN(O,w){if(w===0)return["刚刚","片刻后"];var D=ZH_CN[~~(w/2)];return[O+" "+D+"前",O+" "+D+"后"]}var Locales={},register=function(O,w){Locales[O]=w},getLocale=function(O){return Locales[O]||Locales.en_US},SEC_ARRAY=[60,60,24,7,365/7/12,12];function toDate(O){return O instanceof Date?O:!isNaN(O)||/^\d+$/.test(O)?new Date(parseInt(O)):(O=(O||"").trim().replace(/\.\d+/,"").replace(/-/,"/").replace(/-/,"/").replace(/(\d)T(\d)/,"$1 $2").replace(/Z/," UTC").replace(/([+-]\d\d):?(\d\d)/," $1$2"),new Date(O))}function formatDiff(O,w){var D=O<0?1:0;O=Math.abs(O);for(var U=O,F=0;O>=SEC_ARRAY[F]&&F<SEC_ARRAY.length;F++)O/=SEC_ARRAY[F];return O=Math.floor(O),F*=2,O>(F===0?9:1)&&(F+=1),w(O,F,U)[D].replace("%s",O.toString())}function diffSec(O,w){var D=new Date;return(+D-+toDate(O))/1e3}var format=function(O,w,D){var U=diffSec(O);return formatDiff(U,getLocale(w))};register("en_US",en_US);register("zh_CN",zh_CN);const getInputChecked_=function(O){return O.checked?O.value:null},getSelectSingle_=function(O){const w=O.selectedIndex;return w>=0?O.options[w].value:null},getSelectMultiple_=function(O){const w=[];for(let D,U=0;D=O.options[U];U++)D.selected&&w.push(D.value);return w.length?w:null},getValue=function(O){const w=O.type;switch(isString(w)&&w.toLowerCase()){case"checkbox":case"radio":return getInputChecked_(O);case"select-one":return getSelectSingle_(O);case"select-multiple":return getSelectMultiple_(O);default:return O.value!==null&&O.value!==void 0?O.value:null}},formToJSON=O=>[...O].reduce((w,D)=>(w[D.name]=D.value,w),{}),replaceNode=(O,w)=>{const D=w.parentNode;D&&D.replaceChild(O,w)},removeNode=O=>O&&O.parentNode?O.parentNode.removeChild(O):null,insertSiblingAfter=(O,w)=>{w.parentNode&&w.parentNode.insertBefore(O,w.nextSibling)},isInPage=O=>O===document.body?!1:document.body.contains(O),getPos=O=>[O.offsetLeft,O.offsetTop],randomColour=O=>[1,2,3].map(()=>Math.floor(Math.random()*256)+1).reduce((w,D)=>`${w}${D},`,"rgba(")+`${O||.5}`,totalWidth=O=>{const w=window.getComputedStyle(O),D=O.offsetWidth,U=parseFloat(w.marginLeft)+parseFloat(w.marginRight),F=parseFloat(w.paddingLeft)+parseFloat(w.paddingRight),q=parseFloat(w.borderLeftWidth)+parseFloat(w.borderRightWidth);return D+U-F+q},totalHeight=O=>{const w=window.getComputedStyle(O),D=O.offsetHeight,U=parseFloat(w.marginTop)+parseFloat(w.marginBottom),F=parseFloat(w.paddingTop)+parseFloat(w.paddingBottom),q=parseFloat(w.borderTopWidth)+parseFloat(w.borderBottomWidth);return D+U-F+q},evalScripts=comp=>arr=>{arr&&Array.from(arr).forEach(s=>{(function(){eval(s.text)}).bind(comp)()})},evalModules=O=>w=>{w&&Array.from(w).forEach(D=>{(function(){const U=document.createElement("script");U.type="module",U.textContent=D.textContent;const F=O.getElement(),q=getElDataMap(D).zv_comp_access;q&&(F.zvComponent=O,F.classList.add(q)),F.appendChild(U)}).bind(O)()})},splitScripts=O=>{const D=new DOMParser().parseFromString(O,"text/html");return{html:D.body.firstElementChild,scripts:D.querySelectorAll('script:not([type="module"])'),modules:D.querySelectorAll('script[type="module"]')}},handleTemplateProm=O=>Promise.resolve(splitScripts(O)),enableClass=(O,w,D)=>{D?O.classList.add(w):O.classList.remove(w)},toggleClass=(O,w)=>{const D=!Array.from(O.classList).includes(w);return enableClass(O,w,D),D},getElDataMap=O=>O?Object.assign({},O.dataset||{}):{},dtFormatter={year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"},dFormatter={year:"numeric",month:"short",day:"numeric"},dtf=new Intl.DateTimeFormat("en",{day:"2-digit",month:"short",year:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hourCycle:"h23"}),dateToZooyStdTimeString=O=>{const[{value:w},,{value:D},,{value:U},,{value:F},,{value:q},,{value:W},,]=dtf.formatToParts(O);return`${D} ${w} ${U} ${F}:${q}:${W}`},parseMomentAgo=(O,w="both",D=void 0)=>{let U=O;isNumber(U)&&U<9466848e5?U=U*1e3:D&&(U=U+D);const F=new Date(U),q=format(F),W=dateToZooyStdTimeString(F);switch(w){case"time|ago":return`${W}|${q}`;case"ago":return`${q}`;case"datetime":case"time":return`${W}`;case"both":case"ago (time)":default:return`${q} (${W})`}},parseObfuscated=O=>{const D=(F=>q=>q<F.length-4)(O);return(F=>F.split("").map((q,W)=>D(W)?"*":q).join(""))(O)},parseMap=new Map().set(void 0,(O,w,D)=>identity(O)).set("",(O,w,D)=>identity(O)).set("class_update_only",(O,w,D)=>identity(O)).set("frac_100",(O,w,D)=>Math.round(O*100*100)/100).set("date_and_time",(O,w,D)=>new Date(O).toLocaleString(void 0,dtFormatter)).set("date",(O,w,D)=>new Date(O).toLocaleString(void 0,dFormatter)).set("moment_ago",(O,w,D)=>parseMomentAgo(O,"both",D.zdd_date_tz||void 0)).set("moment_ago_only",(O,w,D)=>parseMomentAgo(O,"ago",D.zdd_date_tz||void 0)).set("moment_ago_datetime",(O,w,D)=>parseMomentAgo(O,"datetime",D.zdd_date_tz||void 0)).set("pretty-json",(O,w,D)=>JSON.stringify(O,null,4)).set("obfuscated",(O,w,D)=>parseObfuscated(O)).set("linear-progress",(O,w,D)=>{const U=toNumber(D.zpmax),F=w.linProg;return U&&F&&(F.progress=O/U,O=void 0),O}),parseDataPropKvDef=O=>O.trim().split(",").map(U=>U.trim()).map(U=>{const[F,q]=U.split(":").map(W=>W.trim());return[F,q]}).filter(([U,F])=>U!==""&&F!==""),parseDataProps=(O,w)=>{const D=getElDataMap(O);delete O.dataset.zoodatapropkv;const U=D.zoodatapropkv||"";return parseDataPropKvDef(U).forEach(([q,W])=>{O.dataset[q]=pathOr(void 0,W.split("."))(w)}),O},mapDataToEls=(O,w,D=new Map,U=void 0)=>{if(!w)return;const F=new Map([...parseMap,...D]);[...O.querySelectorAll("[data-zdd],[data-zdd_class_update],[data-zdd_template_loop_index]")].forEach(q=>{const W=getElDataMap(q),Y=W.zdd||"",G=W.zdd_parse_as,Z=W.zdd_render_effect||"",Q=W.zdd_class_update,tt=W.zdd_template_loop_index,J=W.zdd_units||"";let X=pathOr(void 0,Y.split("."))(w);if(isDefAndNotNull(X)&&(X=F.has(G)?F.get(G)(X,q,W):X),tt&&isNumber(U)&&(console.log("loopIndex: ",tt," opt_loopIndex: ",U),tt==="zero_indexed"?q.innerHTML=U:tt==="one_indexed"?q.innerHTML=U+1:q.innerHTML=U),Q){const[K,et,st]=Q.split(":"),rt=pathOr(void 0,K.split("."))(w);if(isDefAndNotNull(rt))switch(et){case"swap":{const nt=/\{}/gi,ot=st.replace(nt,""),ct=st.replace(nt,rt);q.classList.remove(...[...q.classList].filter(ht=>ht.includes(ot))),q.classList.add(ct);break}case"remove_on_data":q.classList.remove(st);break;case"choice_map":st.split("|").filter(nt=>nt!=="").forEach(nt=>{const[ot,ct]=nt.split(">");ot===rt+""?q.classList.add.apply(q.classList,ct.split(".")):q.classList.remove.apply(q.classList,ct.split("."))});break}}if(G==="templated-array"&&isArray(X))if(X.length===0)q.classList.add("display__none");else{q.classList.remove("display__none"),X=X||[];const K=q.firstElementChild;K.classList.remove("display__none"),q.replaceChildren(...X.map((et,st)=>{const rt=K.cloneNode(!0),nt=parseDataProps(rt,et);return mapDataToEls(nt,et,void 0,st),nt}))}else if(isDefAndNotNull(X))if(Z==="typewriter"){let K=0;const et=X+J,st=5,rt=()=>{K<et.length&&(q.innerHTML+=et.charAt(K),K++,setTimeout(rt,st))};q.innerHTML="",rt()}else q.innerHTML=X+J})},domUtils=Object.freeze(Object.defineProperty({__proto__:null,dateToZooyStdTimeString,dtf,enableClass,evalModules,evalScripts,formToJSON,getElDataMap,getPos,getValue,handleTemplateProm,insertSiblingAfter,isInPage,mapDataToEls,parseDataPropKvDef,parseMap,parseMomentAgo,randomColour,removeNode,replaceNode,splitScripts,toggleClass,totalHeight,totalWidth},Symbol.toStringTag,{value:"Module"}));class ComponentLibraryRegistry{static#t=new Map;static register(w,D){if(!D.render)throw new Error(`Component library '${w}' must provide a render function`);this.#t.set(w,{...D,dispose:D.dispose||null,cache:new Map,config:D.config||{}}),console.debug(`[ComponentLibraryRegistry] Registered: ${w}`)}static get(w){if(!this.#t.has(w)){const D=Array.from(this.#t.keys()).join(", ");throw new Error(`Component library '${w}' is not registered. Available: ${D||"none"}`)}return this.#t.get(w)}static has(w){return this.#t.has(w)}static getRegisteredLibraries(){return Array.from(this.#t.keys())}static getCacheStats(){const w={};for(const[D,U]of this.#t.entries())w[D]={cacheSize:U.cache.size,config:U.config};return w}static clearAllCaches(){for(const[w,D]of this.#t.entries())D.cache.clear(),console.debug(`[ComponentLibraryRegistry] Cleared cache for: ${w}`)}static clearCache(w){this.get(w).cache.clear(),console.debug(`[ComponentLibraryRegistry] Cleared cache for: ${w}`)}static unregister(w){return this.#t.delete(w)}static unregisterAll(){this.#t.clear()}}const ComponentError={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"};class Component extends Evt{static compEventCode(){return UiEventType.COMP}static compReadyCode(){return UiEventType.READY}static compErrors(){return ComponentError}#t;#e;#s;#r;#n;#i;#o;#a;constructor(){super(),this.#t=()=>document.createElement("div"),this.#e=!1,this.#s=void 0,this.#r=void 0,this.#n=void 0,this.#i=void 0,this.#o=new Map,this.outOfTreeElements=[],this.placeholderDom=void 0,this.#a=()=>{}}set target(w){this.#n=w}get target(){return this.#n}set model(w){this.#r=w}get model(){return this.#r}set isInDocument(w){this.#e=w}get isInDocument(){return this.#e}set domFunc(w){this.#t=w}set readyFunc(w){this.#a=w}setElementInternal_(w){this.#s=w}getElement(){return this.#s}createDom(){this.#s=this.#t()}assertCanRenderAsync(){if(this.disposed)throw new Error(ComponentError.ALREADY_DISPOSED)}render(w){this.render_(w)}render_(w){if(this.disposed)throw new Error(ComponentError.ALREADY_DISPOSED);if(this.isInDocument)throw new Error(ComponentError.ALREADY_RENDERED);this.#s||this.createDom();const D=this.#s;w&&(this.#n=w),this.placeholderDom&&removeNode(this.placeholderDom),this.#n?isInPage(D)||this.#n.insertBefore(D,null):isInPage(D)||document.body.appendChild(D),(!this.#i||this.#i.isInDocument)&&this.enterDocument()}hoist(w,D=void 0){D||(D=document.querySelector("body")),D.appendChild(w),this.outOfTreeElements.push(w)}executeBeforeReady(){this.#a()}enterDocument(){this.disposed?removeNode(this.getElement()):(this.isInDocument=!0,[...this.#o.values()].forEach(w=>{!w.isInDocument&&w.getElement()&&w.enterDocument()}),this.executeBeforeReady(),this.dispatchCompEvent(UiEventType.READY))}exitDocument(){[...this.#o.values()].forEach(w=>{w.isInDocument&&w.exitDocument()}),this.stopBeingListenedTo(),this.removeAllListener(),this.isInDocument=!1,removeNode(this.getElement()),this.placeholderDom&&removeNode(this.placeholderDom)}disposeInternal(){this.isInDocument&&this.exitDocument(),this.#o&&[...this.#o.values()].forEach(w=>w.disposeInternal()),this.outOfTreeElements.forEach(removeNode),this.#s&&removeNode(this.#s),this.placeholderDom&&removeNode(this.placeholderDom),this.#o=null,this.#s=void 0,this.#r=null,this.#i=null,super.disposeInternal()}dispose(){this.abortController&&this.abortController.abort();const w=this.getElement();if(w)for(const D of ComponentLibraryRegistry.getRegisteredLibraries())try{const U=ComponentLibraryRegistry.get(D);U.dispose&&U.dispose(w)}catch(U){console.debug(`[${D}] Cleanup error during component disposal (non-critical):`,U)}super.dispose()}dispatchCompEvent(w,D){const U=new ZooyEventData(w,D),F=Evt.makeEvent(UiEventType.COMP,U);return this.dispatchEvent(F)}}const EV={CLICK:"click",DBLCLICK:"dblclick",MOUSEDOWN:"mousedown",MOUSEUP:"mouseup",MOUSEMOVE:"mousemove",TOUCHSTART:"touchstart",TOUCHMOVE:"touchmove",TOUCHEND:"touchend",SUBMIT:"submit",CHANGE:"change",INPUT:"input",INVALID:"invalid",DRAGSTART:"dragstart",DRAGEND:"dragend",DRAGOVER:"dragover",DRAGENTER:"dragenter",DRAGEXIT:"dragexit",DRAGLEAVE:"dragleave",DROP:"drop",TRANSITIONEND:"transitionend"},touchEvents=[EV.TOUCHMOVE,EV.TOUCHSTART,EV.TOUCHEND],isTouchEvent=O=>touchEvents.includes(O.type),normalizeEvent=O=>(isTouchEvent(O)&&(O.clientX=O.targetTouches[0].clientX,O.clientY=O.targetTouches[0].clientY),O),dragStartListener=(O,w,D,U)=>F=>{F.preventDefault();const q=normalizeEvent(F),W=q.currentTarget,[Y,G]=getPos(W),Z=q.clientX-Y,Q=q.clientY-G,tt=O(Y,G,Z,Q,W),J=D(Y,G,Z,Q,W),X=w(Y,G,Z,Q,W);let K=freeMoveListener(X,W,Z,Q);["x","ew"].includes(U)?K=xMoveOnlyListener(X,W,Z):["y","ns"].includes(U)&&(K=yMoveOnlyListener(X,W,Z,Q));let et=!1;const st=nt=>{et=!0,K(nt)},rt=nt=>{document.removeEventListener(EV.MOUSEMOVE,st,!0),document.removeEventListener(EV.TOUCHMOVE,st,!0),document.removeEventListener(EV.MOUSEUP,rt,!0),document.removeEventListener(EV.TOUCHEND,rt,!0),et&&J(nt)};return document.addEventListener(EV.MOUSEUP,rt,!0),document.addEventListener(EV.TOUCHEND,rt,!0),document.addEventListener(EV.MOUSEMOVE,st,!0),document.addEventListener(EV.TOUCHMOVE,st,!0),tt(F),rt},freeMoveListener=(O,w,D,U)=>F=>{F.preventDefault();const q=normalizeEvent(F);w.style.left=`${q.clientX-D}px`,w.style.top=`${q.clientY-U}px`,O(q)},xMoveOnlyListener=(O,w,D,U)=>F=>{F.preventDefault();const q=normalizeEvent(F);w.style.left=`${q.clientX-D}px`,O(q)},yMoveOnlyListener=(O,w,D,U)=>F=>{F.preventDefault();const q=normalizeEvent(F);w.style.top=`${q.clientY-U}px`,O(q)},makeEmitter=(O,w)=>(D,U,F,q,W)=>Y=>{O.dispatchCompEvent(w,{component:O,browserEvent:Y,left:D,top:U,clientX:Y.clientX,clientY:Y.clientY,xOrg:F,yOrg:q,deltaX:Y.clientX-F-D,deltaY:Y.clientY-q-U,target:W})};class Dragger extends Component{#t;#e;#s;#r;constructor(w="xy"){super(),this.#t=["x","y","xy","ew","ns"].includes(w.toLowerCase())?w.toLowerCase():"xy",this.#e=void 0,this.#s=!0,this.#r=D=>null}cancelDrag(w){this.#r(w)}set moveFreedom(w){this.#t=w,this.#s||(this.lock(),this.unlock())}get moveFreedom(){return this.#t}executeBeforeReady(){this.unlock(),super.executeBeforeReady()}unlock(){const w=D=>U=>{this.#r=D(U)};if(this.isInDocument&&this.#s){const D=makeEmitter(this,UiEventType.COMP_DRAG_MOVE),U=makeEmitter(this,UiEventType.COMP_DRAG_START),F=makeEmitter(this,UiEventType.COMP_DRAG_END),q=dragStartListener(U,D,F,this.#t);this.#s=!1,this.#e=this.#e||this.getElement(),this.listen(this.#e,EV.MOUSEDOWN,w(q)),this.listen(this.#e,EV.TOUCHSTART,q),this.#e.classList.remove("locked")}}lock(){this.stopListeningTo(this.#e,EV.MOUSEDOWN),this.stopListeningTo(this.#e,EV.TOUCHSTART),this.#s=!0,this.#e.classList.add("locked")}}const splitRe_=new RegExp("^(?:([^:/?#.]+):)?(?://(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$"),ComponentIndex={PATH:5,QUERY_DATA:6},split=O=>O.match(splitRe_),decodeOrEmpty_=(O,w)=>O?decodeURI(O.replace(/%25/g,"%2525")):"",getPath=O=>decodeOrEmpty_(split(O)[ComponentIndex.PATH]),getQueryData=O=>decodeOrEmpty_(split(O)[ComponentIndex.QUERY_DATA]),objectToUrlParms=O=>[...Object.entries(O)].map(w=>`${w[0]}=${w[1]}`).join("&"),isValidValue=O=>O!=null&&O!=="",queryDataToMap=O=>O.split("&").reduce((w,D)=>{const[U,F]=D.split("=");return isValidValue(U)&&isValidValue(F)&&w.set(U,F),w},new Map),uriUtils=Object.freeze(Object.defineProperty({__proto__:null,getPath,getQueryData,objectToUrlParms,queryDataToMap},Symbol.toStringTag,{value:"Module"})),stripLeadingSpace=stripLeadingChar(" "),stripLeadingSlash=stripLeadingChar("/"),getCookieByName=O=>document.cookie.split(";").map(w=>w.split("=")).reduce((w,D)=>w.set(stripLeadingSpace(D[0]),D[1]),new Map).get(O),spinner=O=>{let w=0,D;const U=F=>{const q=F>0;return q?w+=1:w-=1,q?w===1:w===0};return F=>{D=D||document.getElementById(O),D&&U(F)&&D.classList.toggle("viz",w>0)}},spin=spinner("the_loader"),startSpin=()=>Promise.resolve(spin(1)),stopSpin=O=>(spin(0),Promise.resolve(O)),checkStatus=O=>O.ok?Promise.resolve(O):Promise.reject(new Error(`${O.url} ${O.status} (${O.statusText})`)),checkStatusTwo=O=>w=>{if(w.type==="opaqueredirect"||w.redirected){const D=stripLeadingSlash(getPath(w.url));O.setIsRedirected(!0,D),console.log("Redirect detected",D)}return checkStatus(w)},getJson=O=>O.json(),getText=O=>O.text().then(w=>Promise.resolve(w),w=>Promise.reject(new Error(`Could not get text from response: ${w}`))),getTextOrJson=O=>O.headers.get("Content-Type")==="application/json"?getJson(O):getText(O),jsonInit=(O,w,D="POST",U=void 0)=>{const F=new Headers;F.append("Content-type","application/json"),F.append("X-Requested-With","XMLHttpRequest"),O&&O!==""&&F.append("Authorization",`Bearer ${O}`);const q={cache:"no-cache",method:D,headers:F,credentials:"include",body:JSON.stringify(w)};return U&&(q.signal=U),q},basicPutPostPatchInit=(O,w,D=!1,U=void 0)=>{const F=new Headers;if(w&&w!==""&&F.append("Authorization",`Bearer ${w}`),F.append("X-Requested-With","XMLHttpRequest"),D){const W=getCookieByName("csrftoken");W&&D&&F.append("X-CSRFToken",W)}const q={cache:"no-cache",method:O,headers:F,redirect:"follow",credentials:"include"};return U&&(q.signal=U),q},formPostInit=(O,w,D=void 0)=>{const F=basicPutPostPatchInit("POST",O,!1,D);return F.body=new FormData(w.formEl),F},basicGetInit=(O,w=void 0)=>{const D=new Headers;D.append("Authorization",`Bearer ${O}`),D.append("X-Requested-With","XMLHttpRequest");const U={cache:"no-cache",headers:D,credentials:"include"};return w&&(U.signal=w),U},putPostPatchNobody=(O,w)=>{const D=new Request(O);return fetch(D,w).then(checkStatus).then(getText)},genCatchClause=(O,w=void 0)=>D=>(stopSpin("").then(identity),D.name==="AbortError"?console.info(O,"ABORTED!"):console.error(O,D),w);class UserManager{constructor(w){this.user_={},this.jwt="",w&&this.updateProfileFromJwt(w).then(()=>{})}updateProfileFromJwt(w,D=!1){return D&&this.jwt!==""?Promise.resolve("User Profile Already exists"):w.non_field_errors?Promise.reject(new Error(`JWT ${w.non_field_errors}`)):(this.updateToken(w.token),this.updateProfile(w.user),Promise.resolve("User Profile Updated"))}updateProfile(w){this.user_=w}updateToken(w){this.jwt=w}get id(){return this.user_.id}get name(){return this.user_.name}get surname(){return this.user_.surname}get salutation(){let w=this.name;const D=this.surname;return D&&(w=w+" "+D),w}formSubmit(w){const D=new Request(w.uri.toString()),U=w.processSubmitReply.bind(w),F=genCatchClause("Form submit error");return startSpin().then(()=>fetch(D,formPostInit(this.jwt,w,w.abortController.signal))).then(checkStatusTwo(w)).then(stopSpin).then(getTextOrJson).then(U).catch(F)}putNoBody(w,D=void 0,U=!1){const F=genCatchClause("putNobody error"),q=basicPutPostPatchInit("PUT",this.jwt,U,D);return putPostPatchNobody(w,q).catch(F)}fetch(w,D=void 0){const U=new Request(w.toString()),F=genCatchClause(`UMan Text GET Fetch: ${w}`);return startSpin().then(()=>fetch(U,basicGetInit(this.jwt,D))).then(checkStatus).then(stopSpin).then(getText).catch(F)}fetchAndSplit(w,D=void 0){const U=genCatchClause(`fetchAndSplit: ${w}`);return this.fetch(w,D).then(handleTemplateProm).catch(U)}async fetchJson(w,D=void 0){const U=new Request(w.toString()),F=genCatchClause(`fetchJson: ${w}`,{}),q=basicGetInit(this.jwt,D);await startSpin();let W={};try{W=await(await fetch(U,q)).json()}catch(Y){return F(Y)}return await stopSpin(),W}patchJson(w,D,U=void 0){const F=new Request(w.toString()),q=genCatchClause(`patchJson: ${w}`),W=jsonInit(this.jwt,D,"PATCH",U);return fetch(F,W).then(checkStatus).then(getJson).catch(q)}postJson(w,D,U=void 0){const F=new Request(w.toString()),q=genCatchClause(`postJson: ${w}`),W=jsonInit(this.jwt,D,"POST",U);return fetch(F,W).then(checkStatus).then(getJson).catch(q)}putJson(w,D,U=void 0){const F=new Request(w.toString()),q=genCatchClause(`putJson: ${w}`),W=jsonInit(this.jwt,D,"PUT",U);return fetch(F,W).then(checkStatus).then(getJson).catch(q)}delJson(w,D,U=void 0){const F=new Request(w.toString()),q=genCatchClause(`delJson: ${w}`),W=jsonInit(this.jwt,D,"DELETE",U);return fetch(F,W).then(checkStatus).then(getJson).catch(q)}}class Panel extends Component{static panelEventCode(){return UiEventType.PANEL}static compReadyCode(){return UiEventType.READY}constructor(w){super(),this.qParamMap_=new Map,this.uri_="",w&&this.parseUri(w),this.evalScripts=evalScripts(this),this.evalModules=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 w=this.qParamMap_.size>0?"?"+objectToUrlParms(Object.fromEntries(this.qParamMap_)):"";return this.uri_+w}set user(w){this.user_=w}get user(){return this.user_||(this.user_=new UserManager),this.user_}parseUri(w){this.uri_=getPath(w),this.qParamMap_=queryDataToMap(getQueryData(w))}addToQParams(w,D){this.qParamMap_.set(w,D)}removeFromQParams(w){this.qParamMap_.delete(w)}clearQParams(){this.qParamMap_.clear()}getCarbonComponents(w){return this.carbonComponents?.get(w)||[]}getCarbonComponentById(w){if(this.carbonComponents)for(const D of this.carbonComponents.values()){const U=D.find(F=>F.id===w);if(U)return U}}renderPlaceHolder(w){this.target&&(this.placeholderDom=w,this.target.insertBefore(this.placeholderDom,null))}renderWithTemplate(w){const D=this.user;return D?D.fetch(this.uri,this.abortController.signal).then(U=>(this.assertCanRenderAsync(),w&&w(this),this.onRenderWithTemplateReply(U).catch(F=>{F.message!==Component.compErrors().ALREADY_DISPOSED&&console.error("RenderWithTemplate Err:",F)}),this)).catch(U=>{throw console.error("Panel.renderWithTemplate fetch failed:",U),U}):Promise.reject(new Error("No UserManager instance available for Panel.renderWithTemplate()"))}onRenderWithTemplateReply(w){return this.responseObject=splitScripts(w),this.domFunc=()=>this.responseObject.html,this.render(),Promise.resolve(this)}onReplacePartialDom(w,D){const U=this.getElement();if(isUndefined(U))return;const F=w.html;if(D.startsWith("."))[...U.querySelectorAll(D)].filter(q=>isDefAndNotNull(q.id)).map(q=>[q,F.querySelector(`#${q.id}`)]).filter(([q,W])=>isDefAndNotNull(W)).forEach(([q,W])=>{q.parentNode.replaceChild(W,q),this.parseContent(W)});else if(D.startsWith("#")){const q=F.querySelector(D),W=U.querySelector(D);W.parentNode.replaceChild(q,W),this.parseContent(q)}this.evalScripts(w.scripts),this.evalModules(w.modules)}renderWithJSON(w){return this.user?this.user.fetchJson(this.uri_,this.abortController.signal).then(U=>{this.assertCanRenderAsync(),w&&w(U,this),this.onRenderWithJSON(U).then(identity)}).catch(U=>{throw console.error("Panel.renderWithJSON fetch failed:",U),U}):Promise.reject(new Error("No UserManager instance available for Panel.renderWithJSON()"))}onRenderWithJSON(w){return Promise.resolve(this)}onAsyncJsonReply(w,D,U){}onAsyncHtmlReply(w,D){}onViewDataBroadcast(w){}parseContent(w){if(this.debugMe("Enable interactions. Panel:",w),typeof window.customElements<"u"&&ComponentLibraryRegistry.has("carbon")){const J=ComponentLibraryRegistry.get("carbon");J.render.call(this,w,J.cache).catch(X=>console.error("[Zooy] Carbon initialization failed:",X))}if(ComponentLibraryRegistry.has("mdc")){const J=ComponentLibraryRegistry.get("mdc");J.render.call(this,w,J.cache)}w.classList.contains("zoo__modal-base")&&w.classList.contains("close_on_click")&&this.listen(w,EV.CLICK,J=>{J.target===w&&this.dispatchPanelEvent("destroy_me")}),[...w.querySelectorAll(".zoo__button:not(.external):not(.mdc-data-table__row)")].forEach(J=>{this.listen(J,EV.CLICK,X=>{X.stopPropagation();const K=X.currentTarget,et=getElDataMap(K);this.dispatchPanelEvent(et.zv,Object.assign({orgEvt:X,trigger:K,href:K.href||et.href},et))})}),[...w.querySelectorAll("[href]:not(.external)")].forEach(J=>{this.listen(J,EV.CLICK,X=>{const K=X.currentTarget;X.preventDefault(),X.stopPropagation();const et=getElDataMap(K),st=et.zv||"href";this.dispatchPanelEvent(st,Object.assign({orgEvt:X,trigger:X.target,href:K.href||et.href},et))})}),[...w.querySelectorAll("form.intercept_submit")].forEach(J=>{J.noValidate=!0,this.listen(J,EV.SUBMIT,X=>{X.preventDefault(),X.stopPropagation();const K=getElDataMap(J),et=formToJSON(J.elements);this.dispatchPanelEvent(K.zv,Object.assign({orgEvt:X,trigger:X.target,formData:et,href:K.href},K))})}),[...w.querySelectorAll(".zoo__toggle_class_driver")].forEach(J=>{const X=getElDataMap(J),K=X.toggle_class_target_id,et=X.toggle_class,st=w.querySelector(`#${K}`);st&&et&&J.addEventListener(EV.CLICK,rt=>{rt.stopPropagation(),st.classList.toggle(et)})});const D=Array.from(w.querySelectorAll(".folder_drop_zone")),U=Array.from(w.querySelectorAll("[draggable]")),F=J=>{J.preventDefault(),J.target.classList.add("drag_over")},q=J=>{J.preventDefault()},W=J=>{J.preventDefault(),J.target.classList.remove("drag_over")},Y=J=>{J.preventDefault(),J.target.classList.remove("drag_over")},G=J=>{J.preventDefault(),J.target.classList.remove("drag_over")},Z=J=>{J.dataTransfer.dropEffect="move";const X=getElDataMap(J.target);J.dataTransfer.setData("text/plain",JSON.stringify(X)),J.target.classList.add("drag_in_progress")},Q=J=>{J.target.classList.remove("drag_in_progress")},tt=J=>{G(J),J.stopPropagation();const X=JSON.parse(J.dataTransfer.getData("text/plain")),K=getElDataMap(J.target);return this.dispatchPanelEvent("drop_on",{custom:{on:K,from:X}}),!1};D.forEach(J=>{this.listen(J,EV.DRAGOVER,q),this.listen(J,EV.DRAGENTER,F),this.listen(J,EV.DRAGEXIT,Y),this.listen(J,EV.DRAGLEAVE,W),this.listen(J,EV.DROP,tt)}),U.forEach(J=>{this.listen(J,EV.DRAGSTART,Z),this.listen(J,EV.DRAGEND,Q)}),[...w.querySelectorAll(".zoo_async_json")].forEach(J=>{const X=getElDataMap(J),K=X.href,et=this.onAsyncJsonReply.bind(this,J,X);this.user.fetchJson(K,this.abortController.signal).then(et);const st=X.z_json_reusable;st&&(this.jsonCallFuncs=this.jsonCallFuncs||{},this.jsonCallFuncs[st]=()=>{this.user.fetchJson(K,this.abortController.signal).then(et)});const rt=toNumber(X.z_interval);isNumber(rt)&&this.doOnBeat(()=>{this.user.fetchJson(K,this.abortController.signal).then(et)},rt*60*1e3)}),[...w.querySelectorAll(".zoo_async_html")].forEach(J=>{const X=getElDataMap(J),K=X.href;this.user.fetchAndSplit(K,this.abortController.signal).then(st=>{J.appendChild(st.html),this.parseContent(J),this.evalScripts(st.scripts),this.evalModules(st.modules),this.onAsyncHtmlReply(J,X)});const et=toNumber(X.z_interval);isNumber(et)&&this.doOnBeat(()=>{this.user.fetchAndSplit(K,this.abortController.signal).then(st=>{J.replaceChildren(st.html),this.parseContent(J),this.evalScripts(st.scripts),this.evalModules(st.modules)})},et*60*1e3)})}enterDocument(){const w=this.getElement();this.parseContent(w),this.evalScripts(this.responseObject.scripts),this.evalModules(this.responseObject.modules),super.enterDocument()}exitDocument(){this.abortController.abort(),super.exitDocument()}setIsRedirected(w,D){this.redirected=w,this.redirected&&D&&(this.uri_=D)}dispatchPanelEvent(w,D){const U=new ZooyEventData(w,D),F=Evt.makeEvent(UiEventType.PANEL,U);return this.debugMe(`PANEL EVENT FIRED:
|
|
1
|
+
"use strict";const numericString="0123456789".split("");[...numericString];const alphaLower="abcdefghijklmnopqrstuvwxyz".split(""),alphaUpper="ABCDEFGHIJKLMNOPQRSTUVWXYZ".split("");[...alphaLower,...alphaUpper,...numericString];new Map().set("true",!0).set("false",!1);const compose=(...O)=>(...w)=>O.reduce((D,U)=>F=>D(U(F)))(...w),identity=O=>O,whatType=O=>typeof O,isDef=O=>O!==void 0,isUndefined=O=>O===void 0,isDefAndNotNull=O=>O!=null,isString=O=>whatType(O)==="string",isNumber=O=>whatType(O)==="number"&&!Number.isNaN(O),isObject=O=>(O&&typeof O=="object"&&!(O instanceof Array)&&!(O instanceof Set)&&!(O instanceof Map)&&!(O instanceof Date))===!0,isArray=O=>O instanceof Array,reverse=O=>Array.from(O).reduce((w,D)=>[D,...w],[]),toLowerCase=O=>O.toLowerCase(),toString$1=O=>O+"",toNumber=O=>+O;compose(toLowerCase,toString$1);const makeRandomString=()=>{let O=2147483648;return Math.floor(Math.random()*O).toString(36)+Math.abs(Math.floor(Math.random()*O)^Date.now()).toString(36)},stripLeadingChar=O=>w=>w.startsWith(O)?w.slice(O.length):w,join=O=>w=>w.join(O);compose(join(""),reverse);const pathOr=(O,w)=>D=>{const U=w.reduce((F,q)=>{try{return F[maybeNumber(q)]}catch{return}},D);return U===void 0?O:U},objToPaths=(O,w=[],D=[])=>(Object.entries(O).forEach(([U,F])=>{isObject(F)?objToPaths(F,[...w,U],D):D.push([[...w,U],F])}),D),randomId=O=>{const w=makeRandomString();return O?w.substr(0,O):w},maybeNumber=O=>{if(O===null||whatType(O)==="string"&&O.length>1&&O.startsWith("0")&&!O.startsWith("0."))return O;const w=1*O;return w>Number.MAX_SAFE_INTEGER||Number.isNaN(w)?O:w};compose(toNumber,join(""),reverse,toString$1);class Evt extends EventTarget{#t=!1;#e=!1;#s=new Map;#r=new Set;#n=new Set;static makeEvent(w,D){return new CustomEvent(w,{detail:D})}set debugMode(w){if(typeof w!="boolean")throw new Error("This must be a boolean");this.#t=w}get debugMode(){return this.#t}get disposed(){return this.#e}get listeningTo(){return this.#s}get isObservedBy(){return this.#r}get activeIntervals(){return this.#n}debugMe(...w){this.#t&&console.log.apply(null,[this.constructor.name,"DEBUG:",...w])}isListenedToBy(w){this.#r.add(w)}listen(w,D,U,F=!1){w.addEventListener(D,U,F);const q=this.listeningTo.get(w)||{};q[D]=()=>w.removeEventListener(D,U,F),this.listeningTo.set(w,q),isDef(w.isListenedToBy)&&w.isListenedToBy(this)}stopBeingListenedTo(){for(const w of this.isObservedBy)w.stopListeningTo(this),this.isObservedBy.delete(w)}stopListeningTo(w,D){w&&this.listeningTo.has(w)&&(isDef(w.isObservedBy)&&w.isObservedBy.delete(this),isDef(D)?(Object.entries(this.listeningTo.get(w)).forEach(([U,F])=>{U===D&&F()}),Object.keys(this.listeningTo.get(w)).length||this.listeningTo.delete(w)):(Object.values(this.listeningTo.get(w)).forEach(U=>U()),this.listeningTo.delete(w)))}removeAllListener(){for(const w of this.listeningTo.keys())this.stopListeningTo(w)}clearAllIntervals(){for(const w of this.activeIntervals)clearInterval(w),this.activeIntervals.delete(w)}doOnBeat(w,D){const U=setInterval(w,D);this.activeIntervals.add(U)}disposeInternal(){this.stopBeingListenedTo(),this.removeAllListener(),this.clearAllIntervals(),this.#e=!0}dispose(){this.disposeInternal()}}class ZooyEventData{constructor(w,D){this.value_=w,this.data_=D||{}}getValue(){return this.value_}getData(){return this.data_}}const UiEventType={COMP:randomId(),COMP_DRAG_START:randomId(),COMP_DRAG_MOVE:randomId(),COMP_DRAG_END:randomId(),PANEL:randomId(),VIEW:randomId(),SPLIT:randomId(),SPLIT_WILL_OPEN:randomId(),SPLIT_DID_OPEN:randomId(),SPLIT_WILL_CLOSE:randomId(),SPLIT_DID_CLOSE:randomId(),SPLIT_TRANSITION_END:randomId(),READY:randomId(),PANEL_MINIMIZE:randomId(),FORM_SUBMIT_SUCCESS:randomId()};var EN_US=["second","minute","hour","day","week","month","year"];function en_US(O,w){if(w===0)return["just now","right now"];var D=EN_US[Math.floor(w/2)];return O>1&&(D+="s"),[O+" "+D+" ago","in "+O+" "+D]}var ZH_CN=["秒","分钟","小时","天","周","个月","年"];function zh_CN(O,w){if(w===0)return["刚刚","片刻后"];var D=ZH_CN[~~(w/2)];return[O+" "+D+"前",O+" "+D+"后"]}var Locales={},register=function(O,w){Locales[O]=w},getLocale=function(O){return Locales[O]||Locales.en_US},SEC_ARRAY=[60,60,24,7,365/7/12,12];function toDate(O){return O instanceof Date?O:!isNaN(O)||/^\d+$/.test(O)?new Date(parseInt(O)):(O=(O||"").trim().replace(/\.\d+/,"").replace(/-/,"/").replace(/-/,"/").replace(/(\d)T(\d)/,"$1 $2").replace(/Z/," UTC").replace(/([+-]\d\d):?(\d\d)/," $1$2"),new Date(O))}function formatDiff(O,w){var D=O<0?1:0;O=Math.abs(O);for(var U=O,F=0;O>=SEC_ARRAY[F]&&F<SEC_ARRAY.length;F++)O/=SEC_ARRAY[F];return O=Math.floor(O),F*=2,O>(F===0?9:1)&&(F+=1),w(O,F,U)[D].replace("%s",O.toString())}function diffSec(O,w){var D=new Date;return(+D-+toDate(O))/1e3}var format=function(O,w,D){var U=diffSec(O);return formatDiff(U,getLocale(w))};register("en_US",en_US);register("zh_CN",zh_CN);const getInputChecked_=function(O){return O.checked?O.value:null},getSelectSingle_=function(O){const w=O.selectedIndex;return w>=0?O.options[w].value:null},getSelectMultiple_=function(O){const w=[];for(let D,U=0;D=O.options[U];U++)D.selected&&w.push(D.value);return w.length?w:null},getValue=function(O){const w=O.type;switch(isString(w)&&w.toLowerCase()){case"checkbox":case"radio":return getInputChecked_(O);case"select-one":return getSelectSingle_(O);case"select-multiple":return getSelectMultiple_(O);default:return O.value!==null&&O.value!==void 0?O.value:null}},formToJSON=O=>[...O].reduce((w,D)=>(w[D.name]=D.value,w),{}),replaceNode=(O,w)=>{const D=w.parentNode;D&&D.replaceChild(O,w)},removeNode=O=>O&&O.parentNode?O.parentNode.removeChild(O):null,insertSiblingAfter=(O,w)=>{w.parentNode&&w.parentNode.insertBefore(O,w.nextSibling)},isInPage=O=>O===document.body?!1:document.body.contains(O),getPos=O=>[O.offsetLeft,O.offsetTop],randomColour=O=>[1,2,3].map(()=>Math.floor(Math.random()*256)+1).reduce((w,D)=>`${w}${D},`,"rgba(")+`${O||.5}`,totalWidth=O=>{const w=window.getComputedStyle(O),D=O.offsetWidth,U=parseFloat(w.marginLeft)+parseFloat(w.marginRight),F=parseFloat(w.paddingLeft)+parseFloat(w.paddingRight),q=parseFloat(w.borderLeftWidth)+parseFloat(w.borderRightWidth);return D+U-F+q},totalHeight=O=>{const w=window.getComputedStyle(O),D=O.offsetHeight,U=parseFloat(w.marginTop)+parseFloat(w.marginBottom),F=parseFloat(w.paddingTop)+parseFloat(w.paddingBottom),q=parseFloat(w.borderTopWidth)+parseFloat(w.borderBottomWidth);return D+U-F+q},evalScripts=comp=>arr=>{arr&&Array.from(arr).forEach(s=>{(function(){eval(s.text)}).bind(comp)()})},evalModules=O=>w=>{w&&Array.from(w).forEach(D=>{(function(){const U=document.createElement("script");U.type="module",U.textContent=D.textContent;const F=O.getElement(),q=getElDataMap(D).zv_comp_access;q&&(F.zvComponent=O,F.classList.add(q)),F.appendChild(U)}).bind(O)()})},splitScripts=O=>{const D=new DOMParser().parseFromString(O,"text/html");return{html:D.body.firstElementChild,scripts:D.querySelectorAll('script:not([type="module"])'),modules:D.querySelectorAll('script[type="module"]')}},handleTemplateProm=O=>Promise.resolve(splitScripts(O)),enableClass=(O,w,D)=>{D?O.classList.add(w):O.classList.remove(w)},toggleClass=(O,w)=>{const D=!Array.from(O.classList).includes(w);return enableClass(O,w,D),D},getElDataMap=O=>O?Object.assign({},O.dataset||{}):{},dtFormatter={year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"},dFormatter={year:"numeric",month:"short",day:"numeric"},dtf=new Intl.DateTimeFormat("en",{day:"2-digit",month:"short",year:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hourCycle:"h23"}),dateToZooyStdTimeString=O=>{const[{value:w},,{value:D},,{value:U},,{value:F},,{value:q},,{value:W},,]=dtf.formatToParts(O);return`${D} ${w} ${U} ${F}:${q}:${W}`},parseMomentAgo=(O,w="both",D=void 0)=>{let U=O;isNumber(U)&&U<9466848e5?U=U*1e3:D&&(U=U+D);const F=new Date(U),q=format(F),W=dateToZooyStdTimeString(F);switch(w){case"time|ago":return`${W}|${q}`;case"ago":return`${q}`;case"datetime":case"time":return`${W}`;case"both":case"ago (time)":default:return`${q} (${W})`}},parseObfuscated=O=>{const D=(F=>q=>q<F.length-4)(O);return(F=>F.split("").map((q,W)=>D(W)?"*":q).join(""))(O)},parseMap=new Map().set(void 0,(O,w,D)=>identity(O)).set("",(O,w,D)=>identity(O)).set("class_update_only",(O,w,D)=>identity(O)).set("frac_100",(O,w,D)=>Math.round(O*100*100)/100).set("date_and_time",(O,w,D)=>new Date(O).toLocaleString(void 0,dtFormatter)).set("date",(O,w,D)=>new Date(O).toLocaleString(void 0,dFormatter)).set("moment_ago",(O,w,D)=>parseMomentAgo(O,"both",D.zdd_date_tz||void 0)).set("moment_ago_only",(O,w,D)=>parseMomentAgo(O,"ago",D.zdd_date_tz||void 0)).set("moment_ago_datetime",(O,w,D)=>parseMomentAgo(O,"datetime",D.zdd_date_tz||void 0)).set("pretty-json",(O,w,D)=>JSON.stringify(O,null,4)).set("obfuscated",(O,w,D)=>parseObfuscated(O)).set("linear-progress",(O,w,D)=>{const U=toNumber(D.zpmax),F=w.linProg;return U&&F&&(F.progress=O/U,O=void 0),O}),parseDataPropKvDef=O=>O.trim().split(",").map(U=>U.trim()).map(U=>{const[F,q]=U.split(":").map(W=>W.trim());return[F,q]}).filter(([U,F])=>U!==""&&F!==""),parseDataProps=(O,w)=>{const D=getElDataMap(O);delete O.dataset.zoodatapropkv;const U=D.zoodatapropkv||"";return parseDataPropKvDef(U).forEach(([q,W])=>{O.dataset[q]=pathOr(void 0,W.split("."))(w)}),O},mapDataToEls=(O,w,D=new Map,U=void 0)=>{if(!w)return;const F=new Map([...parseMap,...D]);[...O.querySelectorAll("[data-zdd],[data-zdd_class_update],[data-zdd_template_loop_index]")].forEach(q=>{const W=getElDataMap(q),X=W.zdd||"",G=W.zdd_parse_as,K=W.zdd_render_effect||"",Q=W.zdd_class_update,tt=W.zdd_template_loop_index,J=W.zdd_units||"";let Y=pathOr(void 0,X.split("."))(w);if(isDefAndNotNull(Y)&&(Y=F.has(G)?F.get(G)(Y,q,W):Y),tt&&isNumber(U)&&(console.log("loopIndex: ",tt," opt_loopIndex: ",U),tt==="zero_indexed"?q.innerHTML=U:tt==="one_indexed"?q.innerHTML=U+1:q.innerHTML=U),Q){const[Z,et,st]=Q.split(":"),rt=pathOr(void 0,Z.split("."))(w);if(isDefAndNotNull(rt))switch(et){case"swap":{const nt=/\{}/gi,ot=st.replace(nt,""),ct=st.replace(nt,rt);q.classList.remove(...[...q.classList].filter(ht=>ht.includes(ot))),q.classList.add(ct);break}case"remove_on_data":q.classList.remove(st);break;case"choice_map":st.split("|").filter(nt=>nt!=="").forEach(nt=>{const[ot,ct]=nt.split(">");ot===rt+""?q.classList.add.apply(q.classList,ct.split(".")):q.classList.remove.apply(q.classList,ct.split("."))});break}}if(G==="templated-array"&&isArray(Y))if(Y.length===0)q.classList.add("display__none");else{q.classList.remove("display__none"),Y=Y||[];const Z=q.firstElementChild;Z.classList.remove("display__none"),q.replaceChildren(...Y.map((et,st)=>{const rt=Z.cloneNode(!0),nt=parseDataProps(rt,et);return mapDataToEls(nt,et,void 0,st),nt}))}else if(isDefAndNotNull(Y))if(K==="typewriter"){let Z=0;const et=Y+J,st=5,rt=()=>{Z<et.length&&(q.innerHTML+=et.charAt(Z),Z++,setTimeout(rt,st))};q.innerHTML="",rt()}else q.innerHTML=Y+J})},domUtils=Object.freeze(Object.defineProperty({__proto__:null,dateToZooyStdTimeString,dtf,enableClass,evalModules,evalScripts,formToJSON,getElDataMap,getPos,getValue,handleTemplateProm,insertSiblingAfter,isInPage,mapDataToEls,parseDataPropKvDef,parseMap,parseMomentAgo,randomColour,removeNode,replaceNode,splitScripts,toggleClass,totalHeight,totalWidth},Symbol.toStringTag,{value:"Module"}));class ComponentLibraryRegistry{static#t=new Map;static register(w,D){if(!D.render)throw new Error(`Component library '${w}' must provide a render function`);this.#t.set(w,{...D,dispose:D.dispose||null,cache:new Map,config:D.config||{}}),console.debug(`[ComponentLibraryRegistry] Registered: ${w}`)}static get(w){if(!this.#t.has(w)){const D=Array.from(this.#t.keys()).join(", ");throw new Error(`Component library '${w}' is not registered. Available: ${D||"none"}`)}return this.#t.get(w)}static has(w){return this.#t.has(w)}static getRegisteredLibraries(){return Array.from(this.#t.keys())}static getCacheStats(){const w={};for(const[D,U]of this.#t.entries())w[D]={cacheSize:U.cache.size,config:U.config};return w}static clearAllCaches(){for(const[w,D]of this.#t.entries())D.cache.clear(),console.debug(`[ComponentLibraryRegistry] Cleared cache for: ${w}`)}static clearCache(w){this.get(w).cache.clear(),console.debug(`[ComponentLibraryRegistry] Cleared cache for: ${w}`)}static unregister(w){return this.#t.delete(w)}static unregisterAll(){this.#t.clear()}}const ComponentError={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"};class Component extends Evt{static compEventCode(){return UiEventType.COMP}static compReadyCode(){return UiEventType.READY}static compErrors(){return ComponentError}#t;#e;#s;#r;#n;#i;#o;#a;constructor(){super(),this.#t=()=>document.createElement("div"),this.#e=!1,this.#s=void 0,this.#r=void 0,this.#n=void 0,this.#i=void 0,this.#o=new Map,this.outOfTreeElements=[],this.placeholderDom=void 0,this.#a=()=>{}}set target(w){this.#n=w}get target(){return this.#n}set model(w){this.#r=w}get model(){return this.#r}set isInDocument(w){this.#e=w}get isInDocument(){return this.#e}set domFunc(w){this.#t=w}set readyFunc(w){this.#a=w}setElementInternal_(w){this.#s=w}getElement(){return this.#s}createDom(){this.#s=this.#t()}assertCanRenderAsync(){if(this.disposed)throw new Error(ComponentError.ALREADY_DISPOSED)}render(w){this.render_(w)}render_(w){if(this.disposed)throw new Error(ComponentError.ALREADY_DISPOSED);if(this.isInDocument)throw new Error(ComponentError.ALREADY_RENDERED);this.#s||this.createDom();const D=this.#s;w&&(this.#n=w),this.placeholderDom&&removeNode(this.placeholderDom),this.#n?isInPage(D)||this.#n.insertBefore(D,null):isInPage(D)||document.body.appendChild(D),(!this.#i||this.#i.isInDocument)&&this.enterDocument()}hoist(w,D=void 0){D||(D=document.querySelector("body")),D.appendChild(w),this.outOfTreeElements.push(w)}executeBeforeReady(){this.#a()}enterDocument(){this.disposed?removeNode(this.getElement()):(this.isInDocument=!0,[...this.#o.values()].forEach(w=>{!w.isInDocument&&w.getElement()&&w.enterDocument()}),this.executeBeforeReady(),this.dispatchCompEvent(UiEventType.READY))}exitDocument(){[...this.#o.values()].forEach(w=>{w.isInDocument&&w.exitDocument()}),this.stopBeingListenedTo(),this.removeAllListener(),this.isInDocument=!1,removeNode(this.getElement()),this.placeholderDom&&removeNode(this.placeholderDom)}disposeInternal(){this.isInDocument&&this.exitDocument(),this.#o&&[...this.#o.values()].forEach(w=>w.disposeInternal()),this.outOfTreeElements.forEach(removeNode),this.#s&&removeNode(this.#s),this.placeholderDom&&removeNode(this.placeholderDom),this.#o=null,this.#s=void 0,this.#r=null,this.#i=null,super.disposeInternal()}dispose(){this.abortController&&this.abortController.abort();const w=this.getElement();if(w)for(const D of ComponentLibraryRegistry.getRegisteredLibraries())try{const U=ComponentLibraryRegistry.get(D);U.dispose&&U.dispose(w)}catch(U){console.debug(`[${D}] Cleanup error during component disposal (non-critical):`,U)}super.dispose()}dispatchCompEvent(w,D){const U=new ZooyEventData(w,D),F=Evt.makeEvent(UiEventType.COMP,U);return this.dispatchEvent(F)}}const EV={CLICK:"click",DBLCLICK:"dblclick",MOUSEDOWN:"mousedown",MOUSEUP:"mouseup",MOUSEMOVE:"mousemove",TOUCHSTART:"touchstart",TOUCHMOVE:"touchmove",TOUCHEND:"touchend",SUBMIT:"submit",CHANGE:"change",INPUT:"input",INVALID:"invalid",DRAGSTART:"dragstart",DRAGEND:"dragend",DRAGOVER:"dragover",DRAGENTER:"dragenter",DRAGEXIT:"dragexit",DRAGLEAVE:"dragleave",DROP:"drop",TRANSITIONEND:"transitionend"},touchEvents=[EV.TOUCHMOVE,EV.TOUCHSTART,EV.TOUCHEND],isTouchEvent=O=>touchEvents.includes(O.type),normalizeEvent=O=>(isTouchEvent(O)&&(O.clientX=O.targetTouches[0].clientX,O.clientY=O.targetTouches[0].clientY),O),dragStartListener=(O,w,D,U)=>F=>{F.preventDefault();const q=normalizeEvent(F),W=q.currentTarget,[X,G]=getPos(W),K=q.clientX-X,Q=q.clientY-G,tt=O(X,G,K,Q,W),J=D(X,G,K,Q,W),Y=w(X,G,K,Q,W);let Z=freeMoveListener(Y,W,K,Q);["x","ew"].includes(U)?Z=xMoveOnlyListener(Y,W,K):["y","ns"].includes(U)&&(Z=yMoveOnlyListener(Y,W,K,Q));let et=!1;const st=nt=>{et=!0,Z(nt)},rt=nt=>{document.removeEventListener(EV.MOUSEMOVE,st,!0),document.removeEventListener(EV.TOUCHMOVE,st,!0),document.removeEventListener(EV.MOUSEUP,rt,!0),document.removeEventListener(EV.TOUCHEND,rt,!0),et&&J(nt)};return document.addEventListener(EV.MOUSEUP,rt,!0),document.addEventListener(EV.TOUCHEND,rt,!0),document.addEventListener(EV.MOUSEMOVE,st,!0),document.addEventListener(EV.TOUCHMOVE,st,!0),tt(F),rt},freeMoveListener=(O,w,D,U)=>F=>{F.preventDefault();const q=normalizeEvent(F);w.style.left=`${q.clientX-D}px`,w.style.top=`${q.clientY-U}px`,O(q)},xMoveOnlyListener=(O,w,D,U)=>F=>{F.preventDefault();const q=normalizeEvent(F);w.style.left=`${q.clientX-D}px`,O(q)},yMoveOnlyListener=(O,w,D,U)=>F=>{F.preventDefault();const q=normalizeEvent(F);w.style.top=`${q.clientY-U}px`,O(q)},makeEmitter=(O,w)=>(D,U,F,q,W)=>X=>{O.dispatchCompEvent(w,{component:O,browserEvent:X,left:D,top:U,clientX:X.clientX,clientY:X.clientY,xOrg:F,yOrg:q,deltaX:X.clientX-F-D,deltaY:X.clientY-q-U,target:W})};class Dragger extends Component{#t;#e;#s;#r;constructor(w="xy"){super(),this.#t=["x","y","xy","ew","ns"].includes(w.toLowerCase())?w.toLowerCase():"xy",this.#e=void 0,this.#s=!0,this.#r=D=>null}cancelDrag(w){this.#r(w)}set moveFreedom(w){this.#t=w,this.#s||(this.lock(),this.unlock())}get moveFreedom(){return this.#t}executeBeforeReady(){this.unlock(),super.executeBeforeReady()}unlock(){const w=D=>U=>{this.#r=D(U)};if(this.isInDocument&&this.#s){const D=makeEmitter(this,UiEventType.COMP_DRAG_MOVE),U=makeEmitter(this,UiEventType.COMP_DRAG_START),F=makeEmitter(this,UiEventType.COMP_DRAG_END),q=dragStartListener(U,D,F,this.#t);this.#s=!1,this.#e=this.#e||this.getElement(),this.listen(this.#e,EV.MOUSEDOWN,w(q)),this.listen(this.#e,EV.TOUCHSTART,q),this.#e.classList.remove("locked")}}lock(){this.stopListeningTo(this.#e,EV.MOUSEDOWN),this.stopListeningTo(this.#e,EV.TOUCHSTART),this.#s=!0,this.#e.classList.add("locked")}}const splitRe_=new RegExp("^(?:([^:/?#.]+):)?(?://(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$"),ComponentIndex={PATH:5,QUERY_DATA:6},split=O=>O.match(splitRe_),decodeOrEmpty_=(O,w)=>O?decodeURI(O.replace(/%25/g,"%2525")):"",getPath=O=>decodeOrEmpty_(split(O)[ComponentIndex.PATH]),getQueryData=O=>decodeOrEmpty_(split(O)[ComponentIndex.QUERY_DATA]),objectToUrlParms=O=>[...Object.entries(O)].map(w=>`${w[0]}=${w[1]}`).join("&"),isValidValue=O=>O!=null&&O!=="",queryDataToMap=O=>O.split("&").reduce((w,D)=>{const[U,F]=D.split("=");return isValidValue(U)&&isValidValue(F)&&w.set(U,F),w},new Map),uriUtils=Object.freeze(Object.defineProperty({__proto__:null,getPath,getQueryData,objectToUrlParms,queryDataToMap},Symbol.toStringTag,{value:"Module"})),stripLeadingSpace=stripLeadingChar(" "),stripLeadingSlash=stripLeadingChar("/"),getCookieByName=O=>document.cookie.split(";").map(w=>w.split("=")).reduce((w,D)=>w.set(stripLeadingSpace(D[0]),D[1]),new Map).get(O),spinner=O=>{let w=0,D;const U=F=>{const q=F>0;return q?w+=1:w-=1,q?w===1:w===0};return F=>{D=D||document.getElementById(O),D&&U(F)&&D.classList.toggle("viz",w>0)}},spin=spinner("the_loader"),startSpin=()=>Promise.resolve(spin(1)),stopSpin=O=>(spin(0),Promise.resolve(O)),checkStatus=O=>O.ok?Promise.resolve(O):Promise.reject(new Error(`${O.url} ${O.status} (${O.statusText})`)),checkStatusTwo=O=>w=>{if(w.type==="opaqueredirect"||w.redirected){const D=stripLeadingSlash(getPath(w.url));O.setIsRedirected(!0,D),console.log("Redirect detected",D)}return checkStatus(w)},getJson=O=>O.json(),getText=O=>O.text().then(w=>Promise.resolve(w),w=>Promise.reject(new Error(`Could not get text from response: ${w}`))),getTextOrJson=O=>O.headers.get("Content-Type")==="application/json"?getJson(O):getText(O),jsonInit=(O,w,D="POST",U=void 0)=>{const F=new Headers;F.append("Content-type","application/json"),F.append("X-Requested-With","XMLHttpRequest"),O&&O!==""&&F.append("Authorization",`Bearer ${O}`);const q={cache:"no-cache",method:D,headers:F,credentials:"include",body:JSON.stringify(w)};return U&&(q.signal=U),q},basicPutPostPatchInit=(O,w,D=!1,U=void 0)=>{const F=new Headers;if(w&&w!==""&&F.append("Authorization",`Bearer ${w}`),F.append("X-Requested-With","XMLHttpRequest"),D){const W=getCookieByName("csrftoken");W&&D&&F.append("X-CSRFToken",W)}const q={cache:"no-cache",method:O,headers:F,redirect:"follow",credentials:"include"};return U&&(q.signal=U),q},formPostInit=(O,w,D=void 0)=>{const F=basicPutPostPatchInit("POST",O,!1,D);return F.body=new FormData(w.formEl),F},basicGetInit=(O,w=void 0)=>{const D=new Headers;D.append("Authorization",`Bearer ${O}`),D.append("X-Requested-With","XMLHttpRequest");const U={cache:"no-cache",headers:D,credentials:"include"};return w&&(U.signal=w),U},putPostPatchNobody=(O,w)=>{const D=new Request(O);return fetch(D,w).then(checkStatus).then(getText)},genCatchClause=(O,w=void 0)=>D=>(stopSpin("").then(identity),D.name==="AbortError"?console.info(O,"ABORTED!"):console.error(O,D),w);class UserManager{constructor(w){this.user_={},this.jwt="",w&&this.updateProfileFromJwt(w).then(()=>{})}updateProfileFromJwt(w,D=!1){return D&&this.jwt!==""?Promise.resolve("User Profile Already exists"):w.non_field_errors?Promise.reject(new Error(`JWT ${w.non_field_errors}`)):(this.updateToken(w.token),this.updateProfile(w.user),Promise.resolve("User Profile Updated"))}updateProfile(w){this.user_=w}updateToken(w){this.jwt=w}get id(){return this.user_.id}get name(){return this.user_.name}get surname(){return this.user_.surname}get salutation(){let w=this.name;const D=this.surname;return D&&(w=w+" "+D),w}formSubmit(w){const D=new Request(w.uri.toString()),U=w.processSubmitReply.bind(w),F=genCatchClause("Form submit error");return startSpin().then(()=>fetch(D,formPostInit(this.jwt,w,w.abortController.signal))).then(checkStatusTwo(w)).then(stopSpin).then(getTextOrJson).then(U).catch(F)}putNoBody(w,D=void 0,U=!1){const F=genCatchClause("putNobody error"),q=basicPutPostPatchInit("PUT",this.jwt,U,D);return putPostPatchNobody(w,q).catch(F)}fetch(w,D=void 0){const U=new Request(w.toString()),F=genCatchClause(`UMan Text GET Fetch: ${w}`);return startSpin().then(()=>fetch(U,basicGetInit(this.jwt,D))).then(checkStatus).then(stopSpin).then(getText).catch(F)}fetchAndSplit(w,D=void 0){const U=genCatchClause(`fetchAndSplit: ${w}`);return this.fetch(w,D).then(handleTemplateProm).catch(U)}async fetchJson(w,D=void 0){const U=new Request(w.toString()),F=genCatchClause(`fetchJson: ${w}`,{}),q=basicGetInit(this.jwt,D);await startSpin();let W={};try{W=await(await fetch(U,q)).json()}catch(X){return F(X)}return await stopSpin(),W}patchJson(w,D,U=void 0){const F=new Request(w.toString()),q=genCatchClause(`patchJson: ${w}`),W=jsonInit(this.jwt,D,"PATCH",U);return fetch(F,W).then(checkStatus).then(getJson).catch(q)}postJson(w,D,U=void 0){const F=new Request(w.toString()),q=genCatchClause(`postJson: ${w}`),W=jsonInit(this.jwt,D,"POST",U);return fetch(F,W).then(checkStatus).then(getJson).catch(q)}putJson(w,D,U=void 0){const F=new Request(w.toString()),q=genCatchClause(`putJson: ${w}`),W=jsonInit(this.jwt,D,"PUT",U);return fetch(F,W).then(checkStatus).then(getJson).catch(q)}delJson(w,D,U=void 0){const F=new Request(w.toString()),q=genCatchClause(`delJson: ${w}`),W=jsonInit(this.jwt,D,"DELETE",U);return fetch(F,W).then(checkStatus).then(getJson).catch(q)}}class Panel extends Component{static panelEventCode(){return UiEventType.PANEL}static compReadyCode(){return UiEventType.READY}constructor(w){super(),this.qParamMap_=new Map,this.uri_="",w&&this.parseUri(w),this.evalScripts=evalScripts(this),this.evalModules=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 w=this.qParamMap_.size>0?"?"+objectToUrlParms(Object.fromEntries(this.qParamMap_)):"";return this.uri_+w}set user(w){this.user_=w}get user(){return this.user_||(this.user_=new UserManager),this.user_}parseUri(w){this.uri_=getPath(w),this.qParamMap_=queryDataToMap(getQueryData(w))}addToQParams(w,D){this.qParamMap_.set(w,D)}removeFromQParams(w){this.qParamMap_.delete(w)}clearQParams(){this.qParamMap_.clear()}getCarbonComponents(w){return this.carbonComponents?.get(w)||[]}getCarbonComponentById(w){if(this.carbonComponents)for(const D of this.carbonComponents.values()){const U=D.find(F=>F.id===w);if(U)return U}}renderPlaceHolder(w){this.target&&(this.placeholderDom=w,this.target.insertBefore(this.placeholderDom,null))}renderWithTemplate(w){const D=this.user;return D?D.fetch(this.uri,this.abortController.signal).then(U=>(this.assertCanRenderAsync(),w&&w(this),this.onRenderWithTemplateReply(U).catch(F=>{F.message!==Component.compErrors().ALREADY_DISPOSED&&console.error("RenderWithTemplate Err:",F)}),this)).catch(U=>{throw console.error("Panel.renderWithTemplate fetch failed:",U),U}):Promise.reject(new Error("No UserManager instance available for Panel.renderWithTemplate()"))}onRenderWithTemplateReply(w){return this.responseObject=splitScripts(w),this.domFunc=()=>this.responseObject.html,this.render(),Promise.resolve(this)}onReplacePartialDom(w,D){const U=this.getElement();if(isUndefined(U))return;const F=w.html;if(D.startsWith("."))[...U.querySelectorAll(D)].filter(q=>isDefAndNotNull(q.id)).map(q=>[q,F.querySelector(`#${q.id}`)]).filter(([q,W])=>isDefAndNotNull(W)).forEach(([q,W])=>{q.parentNode.replaceChild(W,q),this.parseContent(W)});else if(D.startsWith("#")){const q=F.querySelector(D),W=U.querySelector(D);W.parentNode.replaceChild(q,W),this.parseContent(q)}this.evalScripts(w.scripts),this.evalModules(w.modules)}renderWithJSON(w){return this.user?this.user.fetchJson(this.uri_,this.abortController.signal).then(U=>{this.assertCanRenderAsync(),w&&w(U,this),this.onRenderWithJSON(U).then(identity)}).catch(U=>{throw console.error("Panel.renderWithJSON fetch failed:",U),U}):Promise.reject(new Error("No UserManager instance available for Panel.renderWithJSON()"))}onRenderWithJSON(w){return Promise.resolve(this)}onAsyncJsonReply(w,D,U){}onAsyncHtmlReply(w,D){}onViewDataBroadcast(w){}parseContent(w){if(this.debugMe("Enable interactions. Panel:",w),typeof window.customElements<"u"&&ComponentLibraryRegistry.has("carbon")){const J=ComponentLibraryRegistry.get("carbon");J.render.call(this,w,J.cache).catch(Y=>console.error("[Zooy] Carbon initialization failed:",Y))}if(ComponentLibraryRegistry.has("mdc")){const J=ComponentLibraryRegistry.get("mdc");J.render.call(this,w,J.cache)}w.classList.contains("zoo__modal-base")&&w.classList.contains("close_on_click")&&this.listen(w,EV.CLICK,J=>{J.target===w&&this.dispatchPanelEvent("destroy_me")}),[...w.querySelectorAll(".zoo__button:not(.external):not(.mdc-data-table__row)")].forEach(J=>{this.listen(J,EV.CLICK,Y=>{Y.stopPropagation();const Z=Y.currentTarget,et=getElDataMap(Z);this.dispatchPanelEvent(et.zv,Object.assign({orgEvt:Y,trigger:Z,href:Z.href||et.href},et))})}),[...w.querySelectorAll("[href]:not(.external)")].forEach(J=>{this.listen(J,EV.CLICK,Y=>{const Z=Y.currentTarget;Y.preventDefault(),Y.stopPropagation();const et=getElDataMap(Z),st=et.zv||"href";this.dispatchPanelEvent(st,Object.assign({orgEvt:Y,trigger:Y.target,href:Z.href||et.href},et))})}),[...w.querySelectorAll("form.intercept_submit")].forEach(J=>{J.noValidate=!0,this.listen(J,EV.SUBMIT,Y=>{Y.preventDefault(),Y.stopPropagation();const Z=getElDataMap(J),et=formToJSON(J.elements);this.dispatchPanelEvent(Z.zv,Object.assign({orgEvt:Y,trigger:Y.target,formData:et,href:Z.href},Z))})}),[...w.querySelectorAll(".zoo__toggle_class_driver")].forEach(J=>{const Y=getElDataMap(J),Z=Y.toggle_class_target_id,et=Y.toggle_class,st=w.querySelector(`#${Z}`);st&&et&&J.addEventListener(EV.CLICK,rt=>{rt.stopPropagation(),st.classList.toggle(et)})});const D=Array.from(w.querySelectorAll(".folder_drop_zone")),U=Array.from(w.querySelectorAll("[draggable]")),F=J=>{J.preventDefault(),J.target.classList.add("drag_over")},q=J=>{J.preventDefault()},W=J=>{J.preventDefault(),J.target.classList.remove("drag_over")},X=J=>{J.preventDefault(),J.target.classList.remove("drag_over")},G=J=>{J.preventDefault(),J.target.classList.remove("drag_over")},K=J=>{J.dataTransfer.dropEffect="move";const Y=getElDataMap(J.target);J.dataTransfer.setData("text/plain",JSON.stringify(Y)),J.target.classList.add("drag_in_progress")},Q=J=>{J.target.classList.remove("drag_in_progress")},tt=J=>{G(J),J.stopPropagation();const Y=JSON.parse(J.dataTransfer.getData("text/plain")),Z=getElDataMap(J.target);return this.dispatchPanelEvent("drop_on",{custom:{on:Z,from:Y}}),!1};D.forEach(J=>{this.listen(J,EV.DRAGOVER,q),this.listen(J,EV.DRAGENTER,F),this.listen(J,EV.DRAGEXIT,X),this.listen(J,EV.DRAGLEAVE,W),this.listen(J,EV.DROP,tt)}),U.forEach(J=>{this.listen(J,EV.DRAGSTART,K),this.listen(J,EV.DRAGEND,Q)}),[...w.querySelectorAll(".zoo_async_json")].forEach(J=>{const Y=getElDataMap(J),Z=Y.href,et=this.onAsyncJsonReply.bind(this,J,Y);this.user.fetchJson(Z,this.abortController.signal).then(et);const st=Y.z_json_reusable;st&&(this.jsonCallFuncs=this.jsonCallFuncs||{},this.jsonCallFuncs[st]=()=>{this.user.fetchJson(Z,this.abortController.signal).then(et)});const rt=toNumber(Y.z_interval);isNumber(rt)&&this.doOnBeat(()=>{this.user.fetchJson(Z,this.abortController.signal).then(et)},rt*60*1e3)}),[...w.querySelectorAll(".zoo_async_html")].forEach(J=>{const Y=getElDataMap(J),Z=Y.href;this.user.fetchAndSplit(Z,this.abortController.signal).then(st=>{J.appendChild(st.html),this.parseContent(J),this.evalScripts(st.scripts),this.evalModules(st.modules),this.onAsyncHtmlReply(J,Y)});const et=toNumber(Y.z_interval);isNumber(et)&&this.doOnBeat(()=>{this.user.fetchAndSplit(Z,this.abortController.signal).then(st=>{J.replaceChildren(st.html),this.parseContent(J),this.evalScripts(st.scripts),this.evalModules(st.modules)})},et*60*1e3)})}enterDocument(){const w=this.getElement();this.parseContent(w),this.evalScripts(this.responseObject.scripts),this.evalModules(this.responseObject.modules),super.enterDocument()}exitDocument(){this.abortController.abort(),super.exitDocument()}setIsRedirected(w,D){this.redirected=w,this.redirected&&D&&(this.uri_=D)}dispatchPanelEvent(w,D){const U=new ZooyEventData(w,D),F=Evt.makeEvent(UiEventType.PANEL,U);return this.debugMe(`PANEL EVENT FIRED:
|
|
2
2
|
value:${w}
|
|
3
|
-
data:${D}`),this.dispatchEvent(F)}}class FormPanel extends Panel{#t=null;#e=new Map;#s=!0;constructor(w,D=!0){super(w),this.#s=D,this.
|
|
3
|
+
data:${D}`),this.dispatchEvent(F)}}class FormPanel extends Panel{#t=null;#e=new Map;#s=!0;constructor(w,D=!0){super(w),this.#s=D,this.onSubmitSucFunc=(U,F)=>null}get formEl(){return this.#t}enterDocument(){super.enterDocument(),this.formIdElementToForm_()}formIdElementToForm_(){this.#t=this.getFormFromId(),this.#t&&(this.#a(this.#t),this.#r())}getFormFromId(w){let D=null,U=this.getElement().querySelector("form");return w&&(U=document.getElementById(w)||U),U&&U.tagName.toLowerCase()==="form"&&(D=U),D}#r(){this.#t&&(this.listen(this.#t,EV.CHANGE,w=>{this.#o(w)},{passive:!0}),this.listen(this.#t,EV.INPUT,w=>{this.clearAllValidationErrors(),this.#o(w)}),this.listen(this.#t,EV.INVALID,w=>{w.preventDefault();const D=w.target;this.#i(D),this.displayFieldError(D)},{passive:!0}))}checkAllFields(){const w=[...this.#t.elements].map(D=>[this.#n(D),D]).filter(D=>!D[0]);return w.forEach(D=>this.displayFieldError(D[1])),w.length===0}clearAllValidationErrors(){[...this.#t?this.#t.elements:[]].forEach(U=>this.#i(U)),[...this.#t.querySelectorAll(".non-field-errors")].forEach(U=>U.classList.remove("alert-error"))}displayAlert_(w,D,U){const F=document.getElementById(`${w.id}-helper-text`)||document.createElement("p");F.textContent=D,this.#e.set(w,F)}#n(w){this.#i(w);let D=!w.willValidate;return w.willValidate&&(D=w.checkValidity()),D}#i(w){w.classList.remove("error"),this.#e.has(w)&&(this.#e.get(w).textContent=""),this.#e.delete(w)}displayFieldError(w,D){const U=D||w.validationMessage;w.classList.add("error"),this.displayAlert_(w,U,"alert-error")}displayFieldSuccess(w,D){this.displayAlert_(w,D,"alert-success")}displayFieldInfo(w,D){this.displayAlert_(w,D,"alert-info")}#o(w){this.#n(w.target)}#a(w){if(w&&this.#s){w.noValidate=!0;const D=this.user;this.listen(w,EV.SUBMIT,U=>{U.preventDefault(),this.debugMe("Intercepted from SUBMIT"),this.checkAllFields()&&D&&D.formSubmit(this)})}return w}onSubmitSuccess(w){this.onSubmitSucFunc=w}replaceForm(w){if(this.responseObject=splitScripts(w),this.responseObject.html){if(this.redirected){this.removeAllListener();const D=this.getElement(),U=D.parentNode;this.setElementInternal_(this.responseObject.html),U.replaceChild(this.getElement(),D)}else{const D=this.responseObject.html.querySelector("form");D&&replaceNode(D,this.#t);const U=this.responseObject.html.querySelector('button[type="submit"]'),F=this.getElement().querySelector('button[type="submit"]');U&&F&&replaceNode(U,F)}this.enterDocument()}}refreshFromFromServer(){const w=this.user,D=this.uri;return w?w.fetch(D,this.abortController.signal).then(U=>this.replaceForm(U)):Promise.reject(new Error("No UserManager instance available for FormPanel.refreshFromFromServer()"))}processSubmitReply(w){this.clearAllValidationErrors();let D=!1;if(whatType(w)==="object"&&w.success)return Promise.resolve(this).then(()=>{this.onSubmitSucFunc(this,w),this.dispatchCompEvent(UiEventType.FORM_SUBMIT_SUCCESS)});if(w==="success"?(this.debugMe(`
|
|
4
4
|
1.REDIRECTED: ${this.redirected}
|
|
5
5
|
REPLY: ${w}`),D=!0):w===`redirected_success
|
|
6
6
|
`?(this.debugMe(`
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
5.REDIRECTED: ${this.redirected}
|
|
14
14
|
SUCCESS: ${D}`),Promise.resolve(this).then(()=>{this.onSubmitSucFunc(this),this.dispatchCompEvent(UiEventType.FORM_SUBMIT_SUCCESS)});this.debugMe(`
|
|
15
15
|
6.REDIRECTED: ${this.redirected}
|
|
16
|
-
SUCCESS: ${D}`)}}class Split extends Component{static splitEventCode(){return UiEventType.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(([w,{nestEl:D}])=>D)}getNest(w){return this.nestMap_.get(w)?.nestEl}get nestNames(){return[...this.nestMap_.entries()].filter(([w,D])=>!this.splitNests_.has(D)).map(([w])=>w)}closeAndLockAll(w=identity,D=!1){this.nestNames.forEach(U=>this.closeAndLock(U,w,D))}openAndUnlockAll(w=identity,D=!1){this.nestNames.forEach(U=>this.openAndUnlock(U,w,D))}lock(w){const{dragEl:D}=this.nestMap_.get(w);D.classList.add("locked")}unlock(w){const{dragEl:D}=this.nestMap_.get(w);D.classList.remove("locked")}resize(w,D,U=identity,F=!1){const{sizeNow:q,nestEl:W,canResize:Y}=this.nestMap_.get(w);Y&&(F||q===D?(W.classList.remove("animated"),W.style.flexBasis=`${D}px`,this.nestMap_.get(w).sizeNow=D,U()):(W.classList.add("animated"),this.nestCallbackMap_.set(w,()=>{W.classList.remove("animated"),this.nestMap_.get(w).sizeNow=D,U()}),W.style.flexBasis=`${D}px`))}closeAndLock(w,D=identity,U=!1){const{nestEl:F,dragEl:q,canResize:W}=this.nestMap_.get(w);if(!W)return;const Y=()=>{q.classList.add("locked","closed"),F.classList.add("closed"),D()};this.resize(w,0,Y,U)}closeAndUnlock(w,D=identity,U=!1){const{nestEl:F,dragEl:q,canResize:W}=this.nestMap_.get(w);if(!W)return;const Y=()=>{F.classList.remove("closed"),q.classList.remove("closed","locked"),q.classList.add("collapsed"),D()};this.resize(w,0,Y,U)}openAndUnlock(w,D,U,F=!1){const{nestEl:q,dragEl:W,defSize:Y,lastSize:G,canResize:Z}=this.nestMap_.get(w);if(!Z)return;const Q=D||G||Y;q.classList.remove("closed"),W.classList.remove("closed","locked","collapsed"),setTimeout(()=>{this.resize(w,Q,U,F)},50)}openAndLock(w,D,U,F=!1){const{nestEl:q,dragEl:W,defSize:Y,lastSize:G,canResize:Z}=this.nestMap_.get(w);if(!Z)return;const Q=D||G||Y;q.classList.remove("closed"),W.classList.remove("closed","collapsed"),setTimeout(()=>{this.resize(w,Q,U,F)},50)}close(w,D=identity,U=!1){const{dragEl:F,canResize:q,nestEl:W}=this.nestMap_.get(w);if(!q)return;this.dispatchSplitEvent(UiEventType.SPLIT_WILL_CLOSE,{nestName:w,nestEl:W});const Y=()=>{F.classList.add("collapsed"),this.dispatchSplitEvent(UiEventType.SPLIT_DID_CLOSE,{nestName:w,nestEl:W}),D()};this.resize(w,0,Y,U)}open(w,D=identity,U=!1){const{defSize:F,lastSize:q,dragEl:W,canResize:Y,nestEl:G}=this.nestMap_.get(w);if(!Y)return;this.dispatchSplitEvent(UiEventType.SPLIT_WILL_OPEN,{nestName:w,nestEl:G}),W.classList.remove("collapsed","closed");const Z=q||F,Q=()=>{this.dispatchSplitEvent(UiEventType.SPLIT_DID_OPEN,{nestName:w,nestEl:G}),D()};this.resize(w,Z,Q,U)}toggle(w,D,U=!1){this.nestMap_.get(w).sizeNow===0?this.open(w,D,U):this.close(w,D,U)}addSplit(w=void 0,D="EW",U=100,F=100,q=[],W=[],Y=[],G=[],Z=[]){const Q=w||this.getElement();if(this.splitNests_.has(Q))return["Already used!",Q];convertElToSplit(Q,D),this.splitNests_.add(Q);let tt="";if(w){const it=[...this.nestMap_.entries()].find(([at,{nestEl:lt}])=>lt===w);if(it)tt=it[0];else return["Element not managed by this component",w]}const J=`${tt}A`,X=makeOuterNest(U,["zoo_nest__A",J,...q]),K=new Dragger(D);K.domFunc=makeDraggerEl([`zoo_drag_${J}`,...G],Z),K.render(Q),this.nestMap_.set(J,{side:"A",nestEl:X,dragger:K,dragEl:K.getElement(),defSize:U,sizeNow:-1,canResize:!0});const et=`${tt}B`,st=makeInnerNest(["zoo_nest__B",et,...W]);this.nestMap_.set(et,{nestEl:st,canResize:!1});const rt=`${tt}C`,nt=new Dragger(D);nt.domFunc=makeDraggerEl([`zoo_drag_${rt}`,...G],Z),nt.render(Q);const ot=makeOuterNest(F,["zoo_nest__C",rt,...Y]);this.nestMap_.set(rt,{side:"C",nestEl:ot,dragger:nt,dragEl:nt.getElement(),defSize:F,sizeNow:-1,canResize:!0}),[X,K.getElement(),st,nt.getElement(),ot].forEach(it=>Q.appendChild(it));let ct=0;const ht=(it,at,lt,ft)=>{let ut;const dt=it==="NS"?"height":"width",mt=it==="NS"?"deltaY":"deltaX";return pt=>{switch(pt.detail.value_){case UiEventType.COMP_DRAG_START:ut=at.getBoundingClientRect()[dt],ct=st.getBoundingClientRect()[dt]+ut,this.nestMap_.get(lt).dragEl.classList.remove("collapsed");break;case UiEventType.COMP_DRAG_MOVE:{const gt=Math.min(ct,ut+ft*pt.detail.data_[mt]);this.nestMap_.get(lt).lastSize=gt,at.style.flexBasis=gt+"px";break}case UiEventType.COMP_DRAG_END:this.dispatchSplitEvent(UiEventType.COMP_DRAG_END,this.nestMap_.get(lt));break}}};this.listen(K,Component.compEventCode(),ht(D,X,J,1)),this.listen(nt,Component.compEventCode(),ht(D,ot,rt,-1)),this.listen(K.getElement(),EV.DBLCLICK,()=>this.toggle(J)),this.listen(nt.getElement(),EV.DBLCLICK,()=>this.toggle(rt)),this.listen(K.getElement().querySelector(".zoo_grabber"),EV.CLICK,()=>this.toggle(J)),this.listen(nt.getElement().querySelector(".zoo_grabber"),EV.CLICK,()=>this.toggle(rt)),this.listen(X,EV.TRANSITIONEND,it=>{if(it.propertyName==="flex-basis"&&it.target===X){const at=this.nestCallbackMap_.get(J);this.nestCallbackMap_.delete(J),at&&at(),this.dispatchSplitEvent(UiEventType.SPLIT_TRANSITION_END,this.nestMap_.get(J))}}),this.listen(ot,EV.TRANSITIONEND,it=>{if(it.propertyName==="flex-basis"&&it.target===ot){const at=this.nestCallbackMap_.get(rt);this.nestCallbackMap_.delete(rt),at&&at(),this.dispatchSplitEvent(UiEventType.SPLIT_TRANSITION_END,this.nestMap_.get(rt))}})}dispatchSplitEvent(w,D){const U=new ZooyEventData(w,D),F=Evt.makeEvent(UiEventType.SPLIT,U);return this.dispatchEvent(F)}}const convertElToSplit=(O,w)=>(O.classList.add("zoo_split",`zoo_split__${w.toLowerCase()}`),O),makeOuterNest=(O,w=[])=>{const D=document.createElement("div");return D.setAttribute("id",randomId(7)),D.classList.add("zoo_nest","zoo_nest__outer",...w),D.style.flexBasis=O+"px",D},makeInnerNest=(O=[])=>{const w=document.createElement("div");return w.setAttribute("id",randomId(7)),w.classList.add("zoo_nest","zoo_nest__inner",...O),w},makeDraggerEl=(O=[],w=[])=>()=>{const D=document.createElement("div");D.setAttribute("id",randomId(7)),D.classList.add("zoo_dragger",...O);const U=document.createElement("div");return U.classList.add("zoo_grabber",...w),D.appendChild(U),D},needsToScroll=O=>{const D=O.getBoundingClientRect().bottom;return U=>U.getBoundingClientRect().bottom>D},treeNodeSelect=O=>w=>{const D=O.getElement().querySelector(".zv_tree_container"),U=needsToScroll(D),F=O.getElement().querySelectorAll(".tree-node");let q;[...F].forEach(W=>{enableClass(W,"mdc-deprecated-list-item--activated",W.id===`tree-node_${w}`),W.id===`tree-node_${w}`&&(q=W)}),q&&U(q)&&q.scrollIntoView(!1)},toggleTree=(O,w)=>{const D=w.getElement().querySelector(".children"),U=O.isOn,F=w.getElement().querySelectorAll(".children"),q=w.getElement().querySelectorAll(".zoo__reveal_icon");[...F].forEach(W=>enableClass(W,"zoo__tree-children__hidden",W!==D&&!U)),[...q].forEach(W=>enableClass(W,"zoo__icon_rotated",W!==D&&!U))},toggleTreeChildren=(O,w)=>{const D=w.trigger,U=D.getAttribute("data-child-id"),F=O.getElement().querySelector(`#${U}`);toggleClass(F,"zoo__tree-children__hidden"),toggleClass(D,"zoo__icon_rotated")},_openTreeFromNodeUp=(O,w)=>{const D=w.parentElement;D.classList.contains("children")&&(enableClass(D,"zoo__tree-children__hidden",!1),_openTreeFromNodeUp(O,D))},treeUtils=Object.freeze(Object.defineProperty({__proto__:null,_openTreeFromNodeUp,toggleTree,toggleTreeChildren,treeNodeSelect},Symbol.toStringTag,{value:"Module"})),MdcTreeHandlers={toggle_tree:function(O,w){toggleTree(O,w)},"tree_toggle-children":function(O,w){toggleTreeChildren(w,O)}},SearchHandlers={search:function(O,w){let D=`${O.href}`;const U=O.formData.q,F=O.targetval;if(U!==""&&(D=`${D}?q=${U}`),F!==""){let q=F;F.includes("page=")&&(q=F.split("&").filter(W=>!W.includes("page=")).join("&")),D=U!==""?`${D}&${q}`:`${D}?${q}`}this.user.fetchAndSplit(D,w.abortController.signal).then(q=>w.onReplacePartialDom(q,O.zvptarget))},reset_search:function(O,w){const D=O.trigger.closest("form");w.removeFromQParams("q"),D.elements.q.value="",D.dispatchEvent(new Event("submit"))}},QueryParamHandlers={paginate:function(O,w){const D=`${O.href}?${O.targetval}`;this.user.fetchAndSplit(D,w.abortController.signal).then(U=>w.onReplacePartialDom(U,O.zvptarget))},list_filter:function(O,w){const D=`${O.href}?${O.targetval}`;this.user.fetchAndSplit(D,w.abortController.signal).then(U=>w.onReplacePartialDom(U,O.zvptarget))}},handlers=Object.freeze(Object.defineProperty({__proto__:null,MdcTreeHandlers,QueryParamHandlers,SearchHandlers},Symbol.toStringTag,{value:"Module"}));class View extends Evt{#t=void 0;#e=void 0;static viewEventCode(){return UiEventType.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(w){this.#e=w}get recordHistory(){return this.#e}set registerViewConstructor(w){this.#t=w}get registerViewConstructor(){return this.#t}set split(w){this.split_=w,this.listen(this.split_,UiEventType.SPLIT,D=>{const U=D.detail.getValue(),F=D.detail.getData();switch(U){case UiEventType.SPLIT_WILL_OPEN:this.onSplitWillOpen(F);break;case UiEventType.SPLIT_WILL_CLOSE:this.onSplitWillClose(F);break;case UiEventType.SPLIT_DID_CLOSE:this.onSplitDidClose(F);break;case UiEventType.SPLIT_DID_OPEN:this.onSplitDidOpen(F);break;case UiEventType.SPLIT_TRANSITION_END:break}})}get split(){if(!this.split_)throw new Error("No SPLIT component available");return this.split_}set user(w){this.user_=w,this.panelMap.forEach(D=>D.user=w)}get user(){return this.user_||(this.user_=new UserManager),this.user_}render(){this.initPanelEvents(),this.preRender(),this.configurePanels(),this.displayPanels(),this.postRender()}initPanelEvents(){}preRender(){}configurePanels(){}displayPanels(){}postRender(){}dispose(){[...this.panelMap.values()].forEach(w=>w.dispose()),super.dispose()}addPanelToView(w,D){D.user=this.user,this.removePanelByName(w),this.panelMap.set(w,D),this.listen(D,Panel.panelEventCode(),this.onPanelEvent.bind(this))}removePanelByName(w){this.panelMap.has(w)&&this.panelMap.get(w).dispose()}removePanel(w){const[D,U]=[...this.panelMap.entries()].find(([F,q])=>q===w);D&&U&&(U.dispose(),this.panelMap.delete(D))}getPanelByName(w){return this.panelMap.get(w)}broadcastToPanels(w){[...this.panelMap.values()].forEach(D=>D.onViewDataBroadcast(w))}initPanelEventsInternal_(){const w=new Map;return w.set("destroy_me",(D,U)=>{this.removePanel(U)}),w.set("switch_view",(D,U)=>{this.debugMe("switch_view received: eventData",D);const F=D.view;this.switchViewMap_.has(F)?this.switchViewMap_.get(F)(D,U):this.debugMe("NO VIEW FOUND FOR:",F,this.switchViewMap_)}),Object.entries({...SearchHandlers,...QueryParamHandlers}).forEach(([D,U])=>{w.set(D,U.bind(this))}),w}mapPanEv(w,D){this.panelEventMap_.set(w,D)}mapSwitchView(w,D){this.switchViewMap_.set(w,D)}onPanelEvent(w){let D=w.detail.getValue();const U=w.detail.getData();D.startsWith("switch_view:")&&(U.view=D.split(":")[1],D="switch_view");const F=w.target;this.panelEventMap_.has(D)?this.panelEventMap_.get(D)(U,F):this.debugMe(`NO EVENT MATCH - This usually you are missing
|
|
16
|
+
SUCCESS: ${D}`)}}class Split extends Component{static splitEventCode(){return UiEventType.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(([w,{nestEl:D}])=>D)}getNest(w){return this.nestMap_.get(w)?.nestEl}get nestNames(){return[...this.nestMap_.entries()].filter(([w,D])=>!this.splitNests_.has(D)).map(([w])=>w)}closeAndLockAll(w=identity,D=!1){this.nestNames.forEach(U=>this.closeAndLock(U,w,D))}openAndUnlockAll(w=identity,D=!1){this.nestNames.forEach(U=>this.openAndUnlock(U,w,D))}lock(w){const{dragEl:D}=this.nestMap_.get(w);D.classList.add("locked")}unlock(w){const{dragEl:D}=this.nestMap_.get(w);D.classList.remove("locked")}resize(w,D,U=identity,F=!1){const{sizeNow:q,nestEl:W,canResize:X}=this.nestMap_.get(w);X&&(F||q===D?(W.classList.remove("animated"),W.style.flexBasis=`${D}px`,this.nestMap_.get(w).sizeNow=D,U()):(W.classList.add("animated"),this.nestCallbackMap_.set(w,()=>{W.classList.remove("animated"),this.nestMap_.get(w).sizeNow=D,U()}),W.style.flexBasis=`${D}px`))}closeAndLock(w,D=identity,U=!1){const{nestEl:F,dragEl:q,canResize:W}=this.nestMap_.get(w);if(!W)return;const X=()=>{q.classList.add("locked","closed"),F.classList.add("closed"),D()};this.resize(w,0,X,U)}closeAndUnlock(w,D=identity,U=!1){const{nestEl:F,dragEl:q,canResize:W}=this.nestMap_.get(w);if(!W)return;const X=()=>{F.classList.remove("closed"),q.classList.remove("closed","locked"),q.classList.add("collapsed"),D()};this.resize(w,0,X,U)}openAndUnlock(w,D,U,F=!1){const{nestEl:q,dragEl:W,defSize:X,lastSize:G,canResize:K}=this.nestMap_.get(w);if(!K)return;const Q=D||G||X;q.classList.remove("closed"),W.classList.remove("closed","locked","collapsed"),setTimeout(()=>{this.resize(w,Q,U,F)},50)}openAndLock(w,D,U,F=!1){const{nestEl:q,dragEl:W,defSize:X,lastSize:G,canResize:K}=this.nestMap_.get(w);if(!K)return;const Q=D||G||X;q.classList.remove("closed"),W.classList.remove("closed","collapsed"),setTimeout(()=>{this.resize(w,Q,U,F)},50)}close(w,D=identity,U=!1){const{dragEl:F,canResize:q,nestEl:W}=this.nestMap_.get(w);if(!q)return;this.dispatchSplitEvent(UiEventType.SPLIT_WILL_CLOSE,{nestName:w,nestEl:W});const X=()=>{F.classList.add("collapsed"),this.dispatchSplitEvent(UiEventType.SPLIT_DID_CLOSE,{nestName:w,nestEl:W}),D()};this.resize(w,0,X,U)}open(w,D=identity,U=!1){const{defSize:F,lastSize:q,dragEl:W,canResize:X,nestEl:G}=this.nestMap_.get(w);if(!X)return;this.dispatchSplitEvent(UiEventType.SPLIT_WILL_OPEN,{nestName:w,nestEl:G}),W.classList.remove("collapsed","closed");const K=q||F,Q=()=>{this.dispatchSplitEvent(UiEventType.SPLIT_DID_OPEN,{nestName:w,nestEl:G}),D()};this.resize(w,K,Q,U)}toggle(w,D,U=!1){this.nestMap_.get(w).sizeNow===0?this.open(w,D,U):this.close(w,D,U)}addSplit(w=void 0,D="EW",U=100,F=100,q=[],W=[],X=[],G=[],K=[]){const Q=w||this.getElement();if(this.splitNests_.has(Q))return["Already used!",Q];convertElToSplit(Q,D),this.splitNests_.add(Q);let tt="";if(w){const it=[...this.nestMap_.entries()].find(([at,{nestEl:lt}])=>lt===w);if(it)tt=it[0];else return["Element not managed by this component",w]}const J=`${tt}A`,Y=makeOuterNest(U,["zoo_nest__A",J,...q]),Z=new Dragger(D);Z.domFunc=makeDraggerEl([`zoo_drag_${J}`,...G],K),Z.render(Q),this.nestMap_.set(J,{side:"A",nestEl:Y,dragger:Z,dragEl:Z.getElement(),defSize:U,sizeNow:-1,canResize:!0});const et=`${tt}B`,st=makeInnerNest(["zoo_nest__B",et,...W]);this.nestMap_.set(et,{nestEl:st,canResize:!1});const rt=`${tt}C`,nt=new Dragger(D);nt.domFunc=makeDraggerEl([`zoo_drag_${rt}`,...G],K),nt.render(Q);const ot=makeOuterNest(F,["zoo_nest__C",rt,...X]);this.nestMap_.set(rt,{side:"C",nestEl:ot,dragger:nt,dragEl:nt.getElement(),defSize:F,sizeNow:-1,canResize:!0}),[Y,Z.getElement(),st,nt.getElement(),ot].forEach(it=>Q.appendChild(it));let ct=0;const ht=(it,at,lt,ft)=>{let ut;const dt=it==="NS"?"height":"width",mt=it==="NS"?"deltaY":"deltaX";return pt=>{switch(pt.detail.value_){case UiEventType.COMP_DRAG_START:ut=at.getBoundingClientRect()[dt],ct=st.getBoundingClientRect()[dt]+ut,this.nestMap_.get(lt).dragEl.classList.remove("collapsed");break;case UiEventType.COMP_DRAG_MOVE:{const gt=Math.min(ct,ut+ft*pt.detail.data_[mt]);this.nestMap_.get(lt).lastSize=gt,at.style.flexBasis=gt+"px";break}case UiEventType.COMP_DRAG_END:this.dispatchSplitEvent(UiEventType.COMP_DRAG_END,this.nestMap_.get(lt));break}}};this.listen(Z,Component.compEventCode(),ht(D,Y,J,1)),this.listen(nt,Component.compEventCode(),ht(D,ot,rt,-1)),this.listen(Z.getElement(),EV.DBLCLICK,()=>this.toggle(J)),this.listen(nt.getElement(),EV.DBLCLICK,()=>this.toggle(rt)),this.listen(Z.getElement().querySelector(".zoo_grabber"),EV.CLICK,()=>this.toggle(J)),this.listen(nt.getElement().querySelector(".zoo_grabber"),EV.CLICK,()=>this.toggle(rt)),this.listen(Y,EV.TRANSITIONEND,it=>{if(it.propertyName==="flex-basis"&&it.target===Y){const at=this.nestCallbackMap_.get(J);this.nestCallbackMap_.delete(J),at&&at(),this.dispatchSplitEvent(UiEventType.SPLIT_TRANSITION_END,this.nestMap_.get(J))}}),this.listen(ot,EV.TRANSITIONEND,it=>{if(it.propertyName==="flex-basis"&&it.target===ot){const at=this.nestCallbackMap_.get(rt);this.nestCallbackMap_.delete(rt),at&&at(),this.dispatchSplitEvent(UiEventType.SPLIT_TRANSITION_END,this.nestMap_.get(rt))}})}dispatchSplitEvent(w,D){const U=new ZooyEventData(w,D),F=Evt.makeEvent(UiEventType.SPLIT,U);return this.dispatchEvent(F)}}const convertElToSplit=(O,w)=>(O.classList.add("zoo_split",`zoo_split__${w.toLowerCase()}`),O),makeOuterNest=(O,w=[])=>{const D=document.createElement("div");return D.setAttribute("id",randomId(7)),D.classList.add("zoo_nest","zoo_nest__outer",...w),D.style.flexBasis=O+"px",D},makeInnerNest=(O=[])=>{const w=document.createElement("div");return w.setAttribute("id",randomId(7)),w.classList.add("zoo_nest","zoo_nest__inner",...O),w},makeDraggerEl=(O=[],w=[])=>()=>{const D=document.createElement("div");D.setAttribute("id",randomId(7)),D.classList.add("zoo_dragger",...O);const U=document.createElement("div");return U.classList.add("zoo_grabber",...w),D.appendChild(U),D},needsToScroll=O=>{const D=O.getBoundingClientRect().bottom;return U=>U.getBoundingClientRect().bottom>D},treeNodeSelect=O=>w=>{const D=O.getElement().querySelector(".zv_tree_container"),U=needsToScroll(D),F=O.getElement().querySelectorAll(".tree-node");let q;[...F].forEach(W=>{enableClass(W,"mdc-deprecated-list-item--activated",W.id===`tree-node_${w}`),W.id===`tree-node_${w}`&&(q=W)}),q&&U(q)&&q.scrollIntoView(!1)},toggleTree=(O,w)=>{const D=w.getElement().querySelector(".children"),U=O.isOn,F=w.getElement().querySelectorAll(".children"),q=w.getElement().querySelectorAll(".zoo__reveal_icon");[...F].forEach(W=>enableClass(W,"zoo__tree-children__hidden",W!==D&&!U)),[...q].forEach(W=>enableClass(W,"zoo__icon_rotated",W!==D&&!U))},toggleTreeChildren=(O,w)=>{const D=w.trigger,U=D.getAttribute("data-child-id"),F=O.getElement().querySelector(`#${U}`);toggleClass(F,"zoo__tree-children__hidden"),toggleClass(D,"zoo__icon_rotated")},_openTreeFromNodeUp=(O,w)=>{const D=w.parentElement;D.classList.contains("children")&&(enableClass(D,"zoo__tree-children__hidden",!1),_openTreeFromNodeUp(O,D))},treeUtils=Object.freeze(Object.defineProperty({__proto__:null,_openTreeFromNodeUp,toggleTree,toggleTreeChildren,treeNodeSelect},Symbol.toStringTag,{value:"Module"})),MdcTreeHandlers={toggle_tree:function(O,w){toggleTree(O,w)},"tree_toggle-children":function(O,w){toggleTreeChildren(w,O)}},SearchHandlers={search:function(O,w){let D=`${O.href}`;const U=O.formData.q,F=O.targetval;if(U!==""&&(D=`${D}?q=${U}`),F!==""){let q=F;F.includes("page=")&&(q=F.split("&").filter(W=>!W.includes("page=")).join("&")),D=U!==""?`${D}&${q}`:`${D}?${q}`}this.user.fetchAndSplit(D,w.abortController.signal).then(q=>w.onReplacePartialDom(q,O.zvptarget))},reset_search:function(O,w){const D=O.trigger.closest("form");w.removeFromQParams("q"),D.elements.q.value="",D.dispatchEvent(new Event("submit"))}},QueryParamHandlers={paginate:function(O,w){const D=`${O.href}?${O.targetval}`;this.user.fetchAndSplit(D,w.abortController.signal).then(U=>w.onReplacePartialDom(U,O.zvptarget))},list_filter:function(O,w){const D=`${O.href}?${O.targetval}`;this.user.fetchAndSplit(D,w.abortController.signal).then(U=>w.onReplacePartialDom(U,O.zvptarget))}},handlers=Object.freeze(Object.defineProperty({__proto__:null,MdcTreeHandlers,QueryParamHandlers,SearchHandlers},Symbol.toStringTag,{value:"Module"}));class View extends Evt{#t=void 0;#e=void 0;static viewEventCode(){return UiEventType.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(w){this.#e=w}get recordHistory(){return this.#e}set registerViewConstructor(w){this.#t=w}get registerViewConstructor(){return this.#t}set split(w){this.split_=w,this.listen(this.split_,UiEventType.SPLIT,D=>{const U=D.detail.getValue(),F=D.detail.getData();switch(U){case UiEventType.SPLIT_WILL_OPEN:this.onSplitWillOpen(F);break;case UiEventType.SPLIT_WILL_CLOSE:this.onSplitWillClose(F);break;case UiEventType.SPLIT_DID_CLOSE:this.onSplitDidClose(F);break;case UiEventType.SPLIT_DID_OPEN:this.onSplitDidOpen(F);break;case UiEventType.SPLIT_TRANSITION_END:break}})}get split(){if(!this.split_)throw new Error("No SPLIT component available");return this.split_}set user(w){this.user_=w,this.panelMap.forEach(D=>D.user=w)}get user(){return this.user_||(this.user_=new UserManager),this.user_}render(){this.initPanelEvents(),this.preRender(),this.configurePanels(),this.displayPanels(),this.postRender()}initPanelEvents(){}preRender(){}configurePanels(){}displayPanels(){}postRender(){}dispose(){[...this.panelMap.values()].forEach(w=>w.dispose()),super.dispose()}addPanelToView(w,D){D.user=this.user,this.removePanelByName(w),this.panelMap.set(w,D),this.listen(D,Panel.panelEventCode(),this.onPanelEvent.bind(this))}removePanelByName(w){this.panelMap.has(w)&&this.panelMap.get(w).dispose()}removePanel(w){const[D,U]=[...this.panelMap.entries()].find(([F,q])=>q===w);D&&U&&(U.dispose(),this.panelMap.delete(D))}getPanelByName(w){return this.panelMap.get(w)}broadcastToPanels(w){[...this.panelMap.values()].forEach(D=>D.onViewDataBroadcast(w))}initPanelEventsInternal_(){const w=new Map;return w.set("destroy_me",(D,U)=>{this.removePanel(U)}),w.set("switch_view",(D,U)=>{this.debugMe("switch_view received: eventData",D);const F=D.view;this.switchViewMap_.has(F)?this.switchViewMap_.get(F)(D,U):this.debugMe("NO VIEW FOUND FOR:",F,this.switchViewMap_)}),Object.entries({...SearchHandlers,...QueryParamHandlers}).forEach(([D,U])=>{w.set(D,U.bind(this))}),w}mapPanEv(w,D){this.panelEventMap_.set(w,D)}mapSwitchView(w,D){this.switchViewMap_.set(w,D)}onPanelEvent(w){let D=w.detail.getValue();const U=w.detail.getData();D.startsWith("switch_view:")&&(U.view=D.split(":")[1],D="switch_view");const F=w.target;this.panelEventMap_.has(D)?this.panelEventMap_.get(D)(U,F):this.debugMe(`NO EVENT MATCH - This usually you are missing
|
|
17
17
|
a "mapPanEv(${D} ..." statement in your panel JS
|
|
18
|
-
or you have a "event='${D}'" attribute in your panel HTML`,{event:w,eventValue:D,eventData:U,panel:F.constructor.name})}onSplitWillOpen(w){}onSplitWillClose(w){}onSplitDidClose(w){}onSplitDidOpen(w){}dispatchViewEvent(w,D){const U=new ZooyEventData(w,D),F=Evt.makeEvent(UiEventType.VIEW,U);return this.dispatchEvent(F)}get metaData(){return this.metaData_}setMetaData(w,D){return this.metaData_.set(w,D),this.metaData}getMetaData(w){return this.metaData_.get(w)}hasMetaData(w){return this.metaData_.has(w)}}class Conductor extends Evt{#t=new Map;#e=null;#s=void 0;#r=void 0;#n=new Map;constructor(){super(),this.#n=this.#i(),window.addEventListener("popstate",w=>{w.state!==null&&this.navTo(w.state)})}set split(w){this.#r=w}get split(){if(!this.#r)throw new Error("No SPLIT component available");return this.#r}set user(w){this.#s=w,this.#e&&(this.#e.user=this.user)}get user(){return this.#s||(this.#s=new UserManager),this.#s}#i(){return new Map().set("switch_view",(w,D)=>{if(this.#t.has(w.view)){const U=this.#t.get(w.view)(w.pk||w.recordId,w);this.switchView(U)}})}mapViewEv(w,D){this.#n.set(w,D)}registerViewConstructor(w,D){this.#t.set(w,D)}onViewEvent(w){const D=w.detail.getValue(),U=w.detail.getData(),F=w.target;this.#n.has(D)?this.#n.get(D)(U,F):console.warn("Unhandled VIEW Event:",w,D,U,F)}setActiveView(w){this.#e&&(this.stopListeningTo(this.#e),this.#e.dispose(),this.#e=null),this.#e=w,this.#e.render()}initView(w){return w.user=this.user,w.split=this.split,w.recordHistory=this.recordHistory.bind(this),w.registerViewConstructor=this.registerViewConstructor.bind(this),this.listen(w,View.viewEventCode(),this.onViewEvent.bind(this)),w}switchView(w){this.setActiveView(this.initView(w))}recordHistory(w){this.debugMe("HISTORY",w),w.init?history.replaceState(w,"",document.location.href):w.history||history.pushState(w,"",null)}navTo=w=>{w.history=!0;const D=w.view,U=this.#e;if(U.switchViewMap_.has(D))this.debugMe("NAV:VIEW:MAP",w),U.switchViewMap_.get(D)(w);else if(this.#t.has(D)){const F=this.#t.get(D)(w.pk,w);this.debugMe("NAV:NEW:VIEW",w),this.switchView(F)}}}function _isPlaceholder(O){return O!=null&&typeof O=="object"&&O["@@functional/placeholder"]===!0}function _curry1(O){return function w(D){return arguments.length===0||_isPlaceholder(D)?w:O.apply(this,arguments)}}function _curry2(O){return function w(D,U){switch(arguments.length){case 0:return w;case 1:return _isPlaceholder(D)?w:_curry1(function(F){return O(D,F)});default:return _isPlaceholder(D)&&_isPlaceholder(U)?w:_isPlaceholder(D)?_curry1(function(F){return O(F,U)}):_isPlaceholder(U)?_curry1(function(F){return O(D,F)}):O(D,U)}}}function _concat(O,w){O=O||[],w=w||[];var D,U=O.length,F=w.length,q=[];for(D=0;D<U;)q[q.length]=O[D],D+=1;for(D=0;D<F;)q[q.length]=w[D],D+=1;return q}function _arity(O,w){switch(O){case 0:return function(){return w.apply(this,arguments)};case 1:return function(D){return w.apply(this,arguments)};case 2:return function(D,U){return w.apply(this,arguments)};case 3:return function(D,U,F){return w.apply(this,arguments)};case 4:return function(D,U,F,q){return w.apply(this,arguments)};case 5:return function(D,U,F,q,W){return w.apply(this,arguments)};case 6:return function(D,U,F,q,W,Y){return w.apply(this,arguments)};case 7:return function(D,U,F,q,W,Y,G){return w.apply(this,arguments)};case 8:return function(D,U,F,q,W,Y,G,Z){return w.apply(this,arguments)};case 9:return function(D,U,F,q,W,Y,G,Z,Q){return w.apply(this,arguments)};case 10:return function(D,U,F,q,W,Y,G,Z,Q,tt){return w.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}}function _curryN(O,w,D){return function(){for(var U=[],F=0,q=O,W=0,Y=!1;W<w.length||F<arguments.length;){var G;W<w.length&&(!_isPlaceholder(w[W])||F>=arguments.length)?G=w[W]:(G=arguments[F],F+=1),U[W]=G,_isPlaceholder(G)?Y=!0:q-=1,W+=1}return!Y&&q<=0?D.apply(this,U):_arity(Math.max(0,q),_curryN(O,U,D))}}var curryN=_curry2(function O(w,D){return w===1?_curry1(D):_arity(w,_curryN(w,[],D))});function _curry3(O){return function w(D,U,F){switch(arguments.length){case 0:return w;case 1:return _isPlaceholder(D)?w:_curry2(function(q,W){return O(D,q,W)});case 2:return _isPlaceholder(D)&&_isPlaceholder(U)?w:_isPlaceholder(D)?_curry2(function(q,W){return O(q,U,W)}):_isPlaceholder(U)?_curry2(function(q,W){return O(D,q,W)}):_curry1(function(q){return O(D,U,q)});default:return _isPlaceholder(D)&&_isPlaceholder(U)&&_isPlaceholder(F)?w:_isPlaceholder(D)&&_isPlaceholder(U)?_curry2(function(q,W){return O(q,W,F)}):_isPlaceholder(D)&&_isPlaceholder(F)?_curry2(function(q,W){return O(q,U,W)}):_isPlaceholder(U)&&_isPlaceholder(F)?_curry2(function(q,W){return O(D,q,W)}):_isPlaceholder(D)?_curry1(function(q){return O(q,U,F)}):_isPlaceholder(U)?_curry1(function(q){return O(D,q,F)}):_isPlaceholder(F)?_curry1(function(q){return O(D,U,q)}):O(D,U,F)}}}const _isArray=Array.isArray||function O(w){return w!=null&&w.length>=0&&Object.prototype.toString.call(w)==="[object Array]"};function _isTransformer(O){return O!=null&&typeof O["@@transducer/step"]=="function"}function _dispatchable(O,w,D){return function(){if(arguments.length===0)return D();var U=arguments[arguments.length-1];if(!_isArray(U)){for(var F=0;F<O.length;){if(typeof U[O[F]]=="function")return U[O[F]].apply(U,Array.prototype.slice.call(arguments,0,-1));F+=1}if(_isTransformer(U)){var q=w.apply(null,Array.prototype.slice.call(arguments,0,-1));return q(U)}}return D.apply(this,arguments)}}const _xfBase={init:function(){return this.xf["@@transducer/init"]()},result:function(O){return this.xf["@@transducer/result"](O)}};function _has(O,w){return Object.prototype.hasOwnProperty.call(w,O)}var toString=Object.prototype.toString,_isArguments=(function(){return toString.call(arguments)==="[object Arguments]"?function(w){return toString.call(w)==="[object Arguments]"}:function(w){return _has("callee",w)}})(),hasEnumBug=!{toString:null}.propertyIsEnumerable("toString"),nonEnumerableProps=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],hasArgsEnumBug=(function(){return arguments.propertyIsEnumerable("length")})(),contains=function O(w,D){for(var U=0;U<w.length;){if(w[U]===D)return!0;U+=1}return!1},keys=_curry1(typeof Object.keys=="function"&&!hasArgsEnumBug?function O(w){return Object(w)!==w?[]:Object.keys(w)}:function O(w){if(Object(w)!==w)return[];var D,U,F=[],q=hasArgsEnumBug&&_isArguments(w);for(D in w)_has(D,w)&&(!q||D!=="length")&&(F[F.length]=D);if(hasEnumBug)for(U=nonEnumerableProps.length-1;U>=0;)D=nonEnumerableProps[U],_has(D,w)&&!contains(F,D)&&(F[F.length]=D),U-=1;return F});function _map(O,w){for(var D=0,U=w.length,F=Array(U);D<U;)F[D]=O(w[D]),D+=1;return F}function _arrayReduce(O,w,D){for(var U=0,F=D.length;U<F;)w=O(w,D[U]),U+=1;return w}var XMap=(function(){function O(w,D){this.xf=D,this.f=w}return O.prototype["@@transducer/init"]=_xfBase.init,O.prototype["@@transducer/result"]=_xfBase.result,O.prototype["@@transducer/step"]=function(w,D){return this.xf["@@transducer/step"](w,this.f(D))},O})(),_xmap=function O(w){return function(D){return new XMap(w,D)}},map=_curry2(_dispatchable(["fantasy-land/map","map"],_xmap,function O(w,D){switch(Object.prototype.toString.call(D)){case"[object Function]":return curryN(D.length,function(){return w.call(this,D.apply(this,arguments))});case"[object Object]":return _arrayReduce(function(U,F){return U[F]=w(D[F]),U},{},keys(D));default:return _map(w,D)}}));const _isInteger=Number.isInteger||function O(w){return w<<0===w};function _nth(O,w){var D=O<0?w.length+O:O;return w[D]}function _prop(O,w){if(w!=null)return _isInteger(O)?_nth(O,w):w[O]}function _isString(O){return Object.prototype.toString.call(O)==="[object String]"}var _isArrayLike=_curry1(function O(w){return _isArray(w)?!0:!w||typeof w!="object"||_isString(w)?!1:w.length===0?!0:w.length>0?w.hasOwnProperty(0)&&w.hasOwnProperty(w.length-1):!1}),symIterator=typeof Symbol<"u"?Symbol.iterator:"@@iterator";function _createReduce(O,w,D){return function(F,q,W){if(_isArrayLike(W))return O(F,q,W);if(W==null)return q;if(typeof W["fantasy-land/reduce"]=="function")return w(F,q,W,"fantasy-land/reduce");if(W[symIterator]!=null)return D(F,q,W[symIterator]());if(typeof W.next=="function")return D(F,q,W);if(typeof W.reduce=="function")return w(F,q,W,"reduce");throw new TypeError("reduce: list must be array or iterable")}}var and=_curry2(function O(w,D){return w&&D});function _iterableReduce(O,w,D){for(var U=D.next();!U.done;)w=O(w,U.value),U=D.next();return w}function _methodReduce(O,w,D,U){return D[U](O,w)}var _reduce=_createReduce(_arrayReduce,_methodReduce,_iterableReduce),ap=_curry2(function O(w,D){return typeof D["fantasy-land/ap"]=="function"?D["fantasy-land/ap"](w):typeof w.ap=="function"?w.ap(D):typeof w=="function"?function(U){return w(U)(D(U))}:_reduce(function(U,F){return _concat(U,map(F,D))},[],w)});function _assoc(O,w,D){if(_isInteger(O)&&_isArray(D)){var U=O<0?D.length+O:O,F=[].concat(D);return F[U]=w,F}var q={};for(var W in D)q[W]=D[W];return q[O]=w,q}var isNil=_curry1(function O(w){return w==null}),assocPath=_curry3(function O(w,D,U){if(w.length===0)return D;var F=w[0];if(w.length>1){var q=_prop(F,U);(isNil(q)||typeof q!="object")&&(q=_isInteger(w[1])?[]:{}),D=O(Array.prototype.slice.call(w,1),D,q)}return _assoc(F,D,U)});function _isFunction(O){var w=Object.prototype.toString.call(O);return w==="[object Function]"||w==="[object AsyncFunction]"||w==="[object GeneratorFunction]"||w==="[object AsyncGeneratorFunction]"}var liftN=_curry2(function O(w,D){var U=curryN(w,D);return curryN(w,function(){return _arrayReduce(ap,map(U,arguments[0]),Array.prototype.slice.call(arguments,1))})}),lift=_curry1(function O(w){return liftN(w.length,w)}),both=_curry2(function O(w,D){return _isFunction(w)?function(){return w.apply(this,arguments)&&D.apply(this,arguments)}:lift(and)(w,D)}),hasPath=_curry2(function O(w,D){if(w.length===0||isNil(D))return!1;for(var U=D,F=0;F<w.length;)if(!isNil(U)&&_has(w[F],U))U=U[w[F]],F+=1;else return!1;return!0}),has=_curry2(function O(w,D){return hasPath([w],D)});function _path(O,w){for(var D=w,U=0;U<O.length;U+=1){if(D==null)return;var F=O[U];_isInteger(F)?D=_nth(F,D):D=D[F]}return D}var path=_curry2(_path);const DEFAULT_FORMATTERS={json:O=>JSON.stringify(O,null,2),date:O=>{if(!O)return"";const w=O instanceof Date?O:new Date(O);return isNaN(w.getTime())?(console.warn("[Binder] Invalid date value:",O),""):dateToZooyStdTimeString(w)}};class Binder{#t;#e;#s;#r=null;#n;constructor(w,D,U,F={}){if(!D)throw new Error("Binder requires a URL");if(!U||!(U instanceof Element))throw new Error("Binder requires a valid rootEl Element");this.#t=w,this.#e=new URL(D,window.location.origin),this.#s=U,this.#n={...DEFAULT_FORMATTERS,...F.formatters},F.urlParams&&this.#i(F.urlParams)}get url(){return this.#e}get data(){return this.#r}get limit(){return parseInt(this.#e.searchParams.get("limit")||"0",10)}get offset(){return parseInt(this.#e.searchParams.get("offset")||"0",10)}get isPaginated(){return both(has("count"),has("results"))(this.#r)}#i(w){return Object.entries(w).forEach(([D,U])=>{if(U==null||U===""){this.#e.searchParams.delete(D);return}if(Array.isArray(U)){this.#e.searchParams.set(D,U.join(","));return}this.#e.searchParams.set(D,U)}),this.#e}async fetchData(w={}){const D=await this.#t.user.fetchJson(this.#i(w).toString(),this.#t.abortController.signal);this.setData(D)}setData(w){this.#r=w,this.render()}render(){if(!isDefAndNotNull(this.#r)){console.warn("[Binder] No data to render");return}this.#o(this.#s,this.#r,0),this.#a()}#o(w,D,U=0,F={}){const q=F.removeAttributes??!1;w.querySelectorAll("[zoo-bind-attr]").forEach(W=>{if(W.closest("[zoo-template]"))return;W.getAttribute("zoo-bind-attr").split(",").forEach(G=>{const[Z,Q]=G.split(":").map(J=>J.trim()),tt=this.#c(D,Q,U);isDefAndNotNull(tt)&&W.setAttribute(Z,tt)}),q&&W.removeAttribute("zoo-bind-attr")}),w.querySelectorAll("[zoo-bind]").forEach(W=>{if(W.closest("[zoo-template]"))return;const Y=W.getAttribute("zoo-bind"),G=W.getAttribute("zoo-bind-format");let Z=this.#c(D,Y,U);G&&this.#n[G]&&(Z=this.#n[G](Z,D)),W.textContent=Z??"",q&&(W.removeAttribute("zoo-bind"),W.removeAttribute("zoo-bind-format"))})}#a(){this.#s.querySelectorAll("[zoo-template]").forEach(D=>{const U=D.getAttribute("zoo-template"),F=D.getAttribute("zoo-template-bind");if(!U){console.warn("[Binder] Consumer missing template ID",D);return}const q=this.#s.querySelector(`#${U}`);if(!q||q.tagName!=="TEMPLATE"){console.error(`[DataBinder] Template not found or invalid: ${U}`);return}const W=F?path(F.split("."),this.#r):this.#r;if(!W){console.warn(`[DataBinder] Data slice is undefined. Path: ${F}. Skipping render for this consumer.`);return}if(!Array.isArray(W)){console.error(`[DataBinder] Data slice is not an array. Path: ${F}`,W);return}D.innerHTML="",W.forEach((Y,G)=>{const Z=this.#l(q,Y,G);D.appendChild(Z)})})}#l(w,D,U){const F=w.content.cloneNode(!0);return this.#o(F,D,U,{removeAttributes:!0}),F}#c(w,D,U){const F={$index:()=>U,$index__paged:()=>this.offset+U,$index1:()=>U+1,$index1__paged:()=>this.offset+U+1};return F[D]?F[D]():path(D.split("."),w)}}const SEMANTIC_ATTRS=new Map(Object.entries({event:"event",endpoint:"endpoint",href:"href",url:"url",target:"target","record-id":"recordId","zoo-sort-field":"sortField","zoo-view":"view"})),getSemanticAttributes=O=>{let w={};return Array.from(O.attributes).forEach(D=>{const U=D.name,F=D.value;SEMANTIC_ATTRS.has(U)?w[SEMANTIC_ATTRS.get(U)]=F:(U.startsWith("data-")||U.startsWith("zoo-"))&&(w=assocPath(U.split("-"),F,w))}),w},getEventAttribute=(O,w,D="event")=>O.getAttribute(w)||O.getAttribute(D);/**
|
|
18
|
+
or you have a "event='${D}'" attribute in your panel HTML`,{event:w,eventValue:D,eventData:U,panel:F.constructor.name})}onSplitWillOpen(w){}onSplitWillClose(w){}onSplitDidClose(w){}onSplitDidOpen(w){}dispatchViewEvent(w,D){const U=new ZooyEventData(w,D),F=Evt.makeEvent(UiEventType.VIEW,U);return this.dispatchEvent(F)}get metaData(){return this.metaData_}setMetaData(w,D){return this.metaData_.set(w,D),this.metaData}getMetaData(w){return this.metaData_.get(w)}hasMetaData(w){return this.metaData_.has(w)}}class Conductor extends Evt{#t=new Map;#e=null;#s=void 0;#r=void 0;#n=new Map;constructor(){super(),this.#n=this.#i(),window.addEventListener("popstate",w=>{w.state!==null&&this.navTo(w.state)})}set split(w){this.#r=w}get split(){if(!this.#r)throw new Error("No SPLIT component available");return this.#r}set user(w){this.#s=w,this.#e&&(this.#e.user=this.user)}get user(){return this.#s||(this.#s=new UserManager),this.#s}#i(){return new Map().set("switch_view",(w,D)=>{if(this.#t.has(w.view)){const U=this.#t.get(w.view)(w.pk||w.recordId,w);this.switchView(U)}})}mapViewEv(w,D){this.#n.set(w,D)}registerViewConstructor(w,D){this.#t.set(w,D)}onViewEvent(w){const D=w.detail.getValue(),U=w.detail.getData(),F=w.target;this.#n.has(D)?this.#n.get(D)(U,F):console.warn("Unhandled VIEW Event:",w,D,U,F)}setActiveView(w){this.#e&&(this.stopListeningTo(this.#e),this.#e.dispose(),this.#e=null),this.#e=w,this.#e.render()}initView(w){return w.user=this.user,w.split=this.split,w.recordHistory=this.recordHistory.bind(this),w.registerViewConstructor=this.registerViewConstructor.bind(this),this.listen(w,View.viewEventCode(),this.onViewEvent.bind(this)),w}switchView(w){this.setActiveView(this.initView(w))}recordHistory(w){this.debugMe("HISTORY",w),w.init?history.replaceState(w,"",document.location.href):w.history||history.pushState(w,"",null)}navTo=w=>{w.history=!0;const D=w.view,U=this.#e;if(U.switchViewMap_.has(D))this.debugMe("NAV:VIEW:MAP",w),U.switchViewMap_.get(D)(w);else if(this.#t.has(D)){const F=this.#t.get(D)(w.pk,w);this.debugMe("NAV:NEW:VIEW",w),this.switchView(F)}}}function _isPlaceholder(O){return O!=null&&typeof O=="object"&&O["@@functional/placeholder"]===!0}function _curry1(O){return function w(D){return arguments.length===0||_isPlaceholder(D)?w:O.apply(this,arguments)}}function _curry2(O){return function w(D,U){switch(arguments.length){case 0:return w;case 1:return _isPlaceholder(D)?w:_curry1(function(F){return O(D,F)});default:return _isPlaceholder(D)&&_isPlaceholder(U)?w:_isPlaceholder(D)?_curry1(function(F){return O(F,U)}):_isPlaceholder(U)?_curry1(function(F){return O(D,F)}):O(D,U)}}}function _concat(O,w){O=O||[],w=w||[];var D,U=O.length,F=w.length,q=[];for(D=0;D<U;)q[q.length]=O[D],D+=1;for(D=0;D<F;)q[q.length]=w[D],D+=1;return q}function _arity(O,w){switch(O){case 0:return function(){return w.apply(this,arguments)};case 1:return function(D){return w.apply(this,arguments)};case 2:return function(D,U){return w.apply(this,arguments)};case 3:return function(D,U,F){return w.apply(this,arguments)};case 4:return function(D,U,F,q){return w.apply(this,arguments)};case 5:return function(D,U,F,q,W){return w.apply(this,arguments)};case 6:return function(D,U,F,q,W,X){return w.apply(this,arguments)};case 7:return function(D,U,F,q,W,X,G){return w.apply(this,arguments)};case 8:return function(D,U,F,q,W,X,G,K){return w.apply(this,arguments)};case 9:return function(D,U,F,q,W,X,G,K,Q){return w.apply(this,arguments)};case 10:return function(D,U,F,q,W,X,G,K,Q,tt){return w.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}}function _curryN(O,w,D){return function(){for(var U=[],F=0,q=O,W=0,X=!1;W<w.length||F<arguments.length;){var G;W<w.length&&(!_isPlaceholder(w[W])||F>=arguments.length)?G=w[W]:(G=arguments[F],F+=1),U[W]=G,_isPlaceholder(G)?X=!0:q-=1,W+=1}return!X&&q<=0?D.apply(this,U):_arity(Math.max(0,q),_curryN(O,U,D))}}var curryN=_curry2(function O(w,D){return w===1?_curry1(D):_arity(w,_curryN(w,[],D))});function _curry3(O){return function w(D,U,F){switch(arguments.length){case 0:return w;case 1:return _isPlaceholder(D)?w:_curry2(function(q,W){return O(D,q,W)});case 2:return _isPlaceholder(D)&&_isPlaceholder(U)?w:_isPlaceholder(D)?_curry2(function(q,W){return O(q,U,W)}):_isPlaceholder(U)?_curry2(function(q,W){return O(D,q,W)}):_curry1(function(q){return O(D,U,q)});default:return _isPlaceholder(D)&&_isPlaceholder(U)&&_isPlaceholder(F)?w:_isPlaceholder(D)&&_isPlaceholder(U)?_curry2(function(q,W){return O(q,W,F)}):_isPlaceholder(D)&&_isPlaceholder(F)?_curry2(function(q,W){return O(q,U,W)}):_isPlaceholder(U)&&_isPlaceholder(F)?_curry2(function(q,W){return O(D,q,W)}):_isPlaceholder(D)?_curry1(function(q){return O(q,U,F)}):_isPlaceholder(U)?_curry1(function(q){return O(D,q,F)}):_isPlaceholder(F)?_curry1(function(q){return O(D,U,q)}):O(D,U,F)}}}const _isArray=Array.isArray||function O(w){return w!=null&&w.length>=0&&Object.prototype.toString.call(w)==="[object Array]"};function _isTransformer(O){return O!=null&&typeof O["@@transducer/step"]=="function"}function _dispatchable(O,w,D){return function(){if(arguments.length===0)return D();var U=arguments[arguments.length-1];if(!_isArray(U)){for(var F=0;F<O.length;){if(typeof U[O[F]]=="function")return U[O[F]].apply(U,Array.prototype.slice.call(arguments,0,-1));F+=1}if(_isTransformer(U)){var q=w.apply(null,Array.prototype.slice.call(arguments,0,-1));return q(U)}}return D.apply(this,arguments)}}const _xfBase={init:function(){return this.xf["@@transducer/init"]()},result:function(O){return this.xf["@@transducer/result"](O)}};function _has(O,w){return Object.prototype.hasOwnProperty.call(w,O)}var toString=Object.prototype.toString,_isArguments=(function(){return toString.call(arguments)==="[object Arguments]"?function(w){return toString.call(w)==="[object Arguments]"}:function(w){return _has("callee",w)}})(),hasEnumBug=!{toString:null}.propertyIsEnumerable("toString"),nonEnumerableProps=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],hasArgsEnumBug=(function(){return arguments.propertyIsEnumerable("length")})(),contains=function O(w,D){for(var U=0;U<w.length;){if(w[U]===D)return!0;U+=1}return!1},keys=_curry1(typeof Object.keys=="function"&&!hasArgsEnumBug?function O(w){return Object(w)!==w?[]:Object.keys(w)}:function O(w){if(Object(w)!==w)return[];var D,U,F=[],q=hasArgsEnumBug&&_isArguments(w);for(D in w)_has(D,w)&&(!q||D!=="length")&&(F[F.length]=D);if(hasEnumBug)for(U=nonEnumerableProps.length-1;U>=0;)D=nonEnumerableProps[U],_has(D,w)&&!contains(F,D)&&(F[F.length]=D),U-=1;return F});function _map(O,w){for(var D=0,U=w.length,F=Array(U);D<U;)F[D]=O(w[D]),D+=1;return F}function _arrayReduce(O,w,D){for(var U=0,F=D.length;U<F;)w=O(w,D[U]),U+=1;return w}var XMap=(function(){function O(w,D){this.xf=D,this.f=w}return O.prototype["@@transducer/init"]=_xfBase.init,O.prototype["@@transducer/result"]=_xfBase.result,O.prototype["@@transducer/step"]=function(w,D){return this.xf["@@transducer/step"](w,this.f(D))},O})(),_xmap=function O(w){return function(D){return new XMap(w,D)}},map=_curry2(_dispatchable(["fantasy-land/map","map"],_xmap,function O(w,D){switch(Object.prototype.toString.call(D)){case"[object Function]":return curryN(D.length,function(){return w.call(this,D.apply(this,arguments))});case"[object Object]":return _arrayReduce(function(U,F){return U[F]=w(D[F]),U},{},keys(D));default:return _map(w,D)}}));const _isInteger=Number.isInteger||function O(w){return w<<0===w};function _nth(O,w){var D=O<0?w.length+O:O;return w[D]}function _prop(O,w){if(w!=null)return _isInteger(O)?_nth(O,w):w[O]}function _isString(O){return Object.prototype.toString.call(O)==="[object String]"}var _isArrayLike=_curry1(function O(w){return _isArray(w)?!0:!w||typeof w!="object"||_isString(w)?!1:w.length===0?!0:w.length>0?w.hasOwnProperty(0)&&w.hasOwnProperty(w.length-1):!1}),symIterator=typeof Symbol<"u"?Symbol.iterator:"@@iterator";function _createReduce(O,w,D){return function(F,q,W){if(_isArrayLike(W))return O(F,q,W);if(W==null)return q;if(typeof W["fantasy-land/reduce"]=="function")return w(F,q,W,"fantasy-land/reduce");if(W[symIterator]!=null)return D(F,q,W[symIterator]());if(typeof W.next=="function")return D(F,q,W);if(typeof W.reduce=="function")return w(F,q,W,"reduce");throw new TypeError("reduce: list must be array or iterable")}}var and=_curry2(function O(w,D){return w&&D});function _iterableReduce(O,w,D){for(var U=D.next();!U.done;)w=O(w,U.value),U=D.next();return w}function _methodReduce(O,w,D,U){return D[U](O,w)}var _reduce=_createReduce(_arrayReduce,_methodReduce,_iterableReduce),ap=_curry2(function O(w,D){return typeof D["fantasy-land/ap"]=="function"?D["fantasy-land/ap"](w):typeof w.ap=="function"?w.ap(D):typeof w=="function"?function(U){return w(U)(D(U))}:_reduce(function(U,F){return _concat(U,map(F,D))},[],w)});function _assoc(O,w,D){if(_isInteger(O)&&_isArray(D)){var U=O<0?D.length+O:O,F=[].concat(D);return F[U]=w,F}var q={};for(var W in D)q[W]=D[W];return q[O]=w,q}var isNil=_curry1(function O(w){return w==null}),assocPath=_curry3(function O(w,D,U){if(w.length===0)return D;var F=w[0];if(w.length>1){var q=_prop(F,U);(isNil(q)||typeof q!="object")&&(q=_isInteger(w[1])?[]:{}),D=O(Array.prototype.slice.call(w,1),D,q)}return _assoc(F,D,U)});function _isFunction(O){var w=Object.prototype.toString.call(O);return w==="[object Function]"||w==="[object AsyncFunction]"||w==="[object GeneratorFunction]"||w==="[object AsyncGeneratorFunction]"}var liftN=_curry2(function O(w,D){var U=curryN(w,D);return curryN(w,function(){return _arrayReduce(ap,map(U,arguments[0]),Array.prototype.slice.call(arguments,1))})}),lift=_curry1(function O(w){return liftN(w.length,w)}),both=_curry2(function O(w,D){return _isFunction(w)?function(){return w.apply(this,arguments)&&D.apply(this,arguments)}:lift(and)(w,D)}),hasPath=_curry2(function O(w,D){if(w.length===0||isNil(D))return!1;for(var U=D,F=0;F<w.length;)if(!isNil(U)&&_has(w[F],U))U=U[w[F]],F+=1;else return!1;return!0}),has=_curry2(function O(w,D){return hasPath([w],D)});function _path(O,w){for(var D=w,U=0;U<O.length;U+=1){if(D==null)return;var F=O[U];_isInteger(F)?D=_nth(F,D):D=D[F]}return D}var path=_curry2(_path);const DEFAULT_FORMATTERS={json:O=>JSON.stringify(O,null,2),date:O=>{if(!O)return"";const w=O instanceof Date?O:new Date(O);return isNaN(w.getTime())?(console.warn("[Binder] Invalid date value:",O),""):dateToZooyStdTimeString(w)},tpl:(O,w,D)=>{const U=D?.getAttribute("zoo-bind-attr-tpl");if(!U)return O;try{return new Function("value","data",`return \`${U}\`;`)(O,w)}catch(F){return console.warn("[Binder] Invalid template:",U,F),O}}};class Binder{#t;#e;#s;#r=null;#n;constructor(w,D,U,F={}){if(!D)throw new Error("Binder requires a URL");if(!U||!(U instanceof Element))throw new Error("Binder requires a valid rootEl Element");this.#t=w,this.#e=new URL(D,window.location.origin),this.#s=U,this.#n={...DEFAULT_FORMATTERS,...F.formatters},F.urlParams?this.#i(F.urlParams):this.#o()}get url(){return this.#e}get data(){return this.#r}get limit(){return parseInt(this.#e.searchParams.get("limit")||"0",10)}get offset(){return parseInt(this.#e.searchParams.get("offset")||"0",10)}get isPaginated(){return both(has("count"),has("results"))(this.#r)}#i(w){return Object.entries(w).forEach(([D,U])=>{if(!isDefAndNotNull(U)||U===""||Array.isArray(U)&&U.length<1){this.#e.searchParams.delete(D);return}if(Array.isArray(U)){this.#e.searchParams.set(D,U.join(","));return}this.#e.searchParams.set(D,U)}),this.#o(),this.#e}#o(){const w=this.#e.href.split(this.url.origin)[1].slice(1);this.#s.querySelectorAll("[zoo-bind-binderurl]").forEach(D=>{D.setAttribute("zoo-bind-binderurl",w)})}async fetchData(w={}){const D=await this.#t.user.fetchJson(this.#i(w).toString(),this.#t.abortController.signal);this.setData(D)}setData(w){this.#r=w,this.render()}render(){if(!isDefAndNotNull(this.#r)){console.warn("[Binder] No data to render");return}this.#o(),this.#a(this.#s,this.#r,0),this.#l()}#a(w,D,U=0,F={}){const q=F.removeAttributes??!1;w.querySelectorAll("[zoo-bind-attr]").forEach(W=>{if(W.closest("[zoo-template]"))return;W.getAttribute("zoo-bind-attr").split(",").forEach(G=>{const[K,Q]=G.split(":").map(Z=>Z.trim()),[tt,J]=Q.split("|").map(Z=>Z.trim());let Y=this.#c(D,tt,U);J&&this.#n[J]&&(Y=this.#n[J](Y,D,W)),isDefAndNotNull(Y)&&W.setAttribute(K,Y)}),q&&(W.removeAttribute("zoo-bind-attr"),W.removeAttribute("zoo-bind-attr-tpl"))}),w.querySelectorAll("[zoo-bind]").forEach(W=>{if(W.closest("[zoo-template]"))return;const X=W.getAttribute("zoo-bind"),[G,K]=X.split("|").map(tt=>tt.trim());let Q=this.#c(D,G,U);K&&this.#n[K]&&(Q=this.#n[K](Q,D,W)),W.textContent=Q??"",q&&(W.removeAttribute("zoo-bind"),W.removeAttribute("zoo-bind-tpl"))})}#l(){this.#s.querySelectorAll("[zoo-template]").forEach(D=>{const U=D.getAttribute("zoo-template"),F=D.getAttribute("zoo-template-bind");if(!U){console.warn("[Binder] Consumer missing template ID",D);return}const q=this.#s.querySelector(`#${U}`);if(!q||q.tagName!=="TEMPLATE"){console.error(`[DataBinder] Template not found or invalid: ${U}`);return}const W=F?path(F.split("."),this.#r):this.#r;if(!W){console.warn(`[DataBinder] Data slice is undefined. Path: ${F}. Skipping render for this consumer.`);return}if(!Array.isArray(W)){console.error(`[DataBinder] Data slice is not an array. Path: ${F}`,W);return}D.innerHTML="",W.forEach((X,G)=>{const K=this.#h(q,X,G);D.appendChild(K)})})}#h(w,D,U){const F=w.content.cloneNode(!0);return this.#a(F,D,U,{removeAttributes:!0}),F}#c(w,D,U){const F={$index:()=>U,$index__paged:()=>this.offset+U,$index1:()=>U+1,$index1__paged:()=>this.offset+U+1};return F[D]?F[D]():path(D.split("."),w)}}const SEMANTIC_ATTRS=new Map(Object.entries({event:"event",endpoint:"endpoint",href:"href",url:"url",target:"target","record-id":"recordId","zoo-sort-field":"sortField","zoo-view":"view","zoo-event":"event","zoo-href":"href"})),getSemanticAttributes=O=>{let w={};return Array.from(O.attributes).forEach(D=>{const U=D.name,F=D.value;SEMANTIC_ATTRS.has(U)?w[SEMANTIC_ATTRS.get(U)]=F:(U.startsWith("data-")||U.startsWith("zoo-"))&&(w=assocPath(U.split("-"),F,w))}),w},getEventAttribute=(O,w,D="event")=>O.getAttribute(w)||O.getAttribute(D);/**
|
|
19
19
|
* @license
|
|
20
20
|
* Copyright 2019 Google LLC
|
|
21
21
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -23,13 +23,13 @@
|
|
|
23
23
|
* @license
|
|
24
24
|
* Copyright 2017 Google LLC
|
|
25
25
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
26
|
-
*/const{is:i$2,defineProperty:e$1,getOwnPropertyDescriptor:h$1,getOwnPropertyNames:r$1,getOwnPropertySymbols:o$2,getPrototypeOf:n$1}=Object,a$1=globalThis,c$1=a$1.trustedTypes,l$1=c$1?c$1.emptyScript:"",p$1=a$1.reactiveElementPolyfillSupport,d$1=(O,w)=>O,u$1={toAttribute(O,w){switch(w){case Boolean:O=O?l$1:null;break;case Object:case Array:O=O==null?O:JSON.stringify(O)}return O},fromAttribute(O,w){let D=O;switch(w){case Boolean:D=O!==null;break;case Number:D=O===null?null:Number(O);break;case Object:case Array:try{D=JSON.parse(O)}catch{D=null}}return D}},f$1=(O,w)=>!i$2(O,w),b$1={attribute:!0,type:String,converter:u$1,reflect:!1,useDefault:!1,hasChanged:f$1};Symbol.metadata??=Symbol("metadata"),a$1.litPropertyMetadata??=new WeakMap;let y$1=class extends HTMLElement{static addInitializer(w){this._$Ei(),(this.l??=[]).push(w)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(w,D=b$1){if(D.state&&(D.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(w)&&((D=Object.create(D)).wrapped=!0),this.elementProperties.set(w,D),!D.noAccessor){const U=Symbol(),F=this.getPropertyDescriptor(w,U,D);F!==void 0&&e$1(this.prototype,w,F)}}static getPropertyDescriptor(w,D,U){const{get:F,set:q}=h$1(this.prototype,w)??{get(){return this[D]},set(W){this[D]=W}};return{get:F,set(W){const
|
|
26
|
+
*/const{is:i$2,defineProperty:e$1,getOwnPropertyDescriptor:h$1,getOwnPropertyNames:r$1,getOwnPropertySymbols:o$2,getPrototypeOf:n$1}=Object,a$1=globalThis,c$1=a$1.trustedTypes,l$1=c$1?c$1.emptyScript:"",p$1=a$1.reactiveElementPolyfillSupport,d$1=(O,w)=>O,u$1={toAttribute(O,w){switch(w){case Boolean:O=O?l$1:null;break;case Object:case Array:O=O==null?O:JSON.stringify(O)}return O},fromAttribute(O,w){let D=O;switch(w){case Boolean:D=O!==null;break;case Number:D=O===null?null:Number(O);break;case Object:case Array:try{D=JSON.parse(O)}catch{D=null}}return D}},f$1=(O,w)=>!i$2(O,w),b$1={attribute:!0,type:String,converter:u$1,reflect:!1,useDefault:!1,hasChanged:f$1};Symbol.metadata??=Symbol("metadata"),a$1.litPropertyMetadata??=new WeakMap;let y$1=class extends HTMLElement{static addInitializer(w){this._$Ei(),(this.l??=[]).push(w)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(w,D=b$1){if(D.state&&(D.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(w)&&((D=Object.create(D)).wrapped=!0),this.elementProperties.set(w,D),!D.noAccessor){const U=Symbol(),F=this.getPropertyDescriptor(w,U,D);F!==void 0&&e$1(this.prototype,w,F)}}static getPropertyDescriptor(w,D,U){const{get:F,set:q}=h$1(this.prototype,w)??{get(){return this[D]},set(W){this[D]=W}};return{get:F,set(W){const X=F?.call(this);q?.call(this,W),this.requestUpdate(w,X,U)},configurable:!0,enumerable:!0}}static getPropertyOptions(w){return this.elementProperties.get(w)??b$1}static _$Ei(){if(this.hasOwnProperty(d$1("elementProperties")))return;const w=n$1(this);w.finalize(),w.l!==void 0&&(this.l=[...w.l]),this.elementProperties=new Map(w.elementProperties)}static finalize(){if(this.hasOwnProperty(d$1("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(d$1("properties"))){const D=this.properties,U=[...r$1(D),...o$2(D)];for(const F of U)this.createProperty(F,D[F])}const w=this[Symbol.metadata];if(w!==null){const D=litPropertyMetadata.get(w);if(D!==void 0)for(const[U,F]of D)this.elementProperties.set(U,F)}this._$Eh=new Map;for(const[D,U]of this.elementProperties){const F=this._$Eu(D,U);F!==void 0&&this._$Eh.set(F,D)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(w){const D=[];if(Array.isArray(w)){const U=new Set(w.flat(1/0).reverse());for(const F of U)D.unshift(c$2(F))}else w!==void 0&&D.push(c$2(w));return D}static _$Eu(w,D){const U=D.attribute;return U===!1?void 0:typeof U=="string"?U:typeof w=="string"?w.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((w=>this.enableUpdating=w)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((w=>w(this)))}addController(w){(this._$EO??=new Set).add(w),this.renderRoot!==void 0&&this.isConnected&&w.hostConnected?.()}removeController(w){this._$EO?.delete(w)}_$E_(){const w=new Map,D=this.constructor.elementProperties;for(const U of D.keys())this.hasOwnProperty(U)&&(w.set(U,this[U]),delete this[U]);w.size>0&&(this._$Ep=w)}createRenderRoot(){const w=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return S$1(w,this.constructor.elementStyles),w}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((w=>w.hostConnected?.()))}enableUpdating(w){}disconnectedCallback(){this._$EO?.forEach((w=>w.hostDisconnected?.()))}attributeChangedCallback(w,D,U){this._$AK(w,U)}_$ET(w,D){const U=this.constructor.elementProperties.get(w),F=this.constructor._$Eu(w,U);if(F!==void 0&&U.reflect===!0){const q=(U.converter?.toAttribute!==void 0?U.converter:u$1).toAttribute(D,U.type);this._$Em=w,q==null?this.removeAttribute(F):this.setAttribute(F,q),this._$Em=null}}_$AK(w,D){const U=this.constructor,F=U._$Eh.get(w);if(F!==void 0&&this._$Em!==F){const q=U.getPropertyOptions(F),W=typeof q.converter=="function"?{fromAttribute:q.converter}:q.converter?.fromAttribute!==void 0?q.converter:u$1;this._$Em=F;const X=W.fromAttribute(D,q.type);this[F]=X??this._$Ej?.get(F)??X,this._$Em=null}}requestUpdate(w,D,U){if(w!==void 0){const F=this.constructor,q=this[w];if(U??=F.getPropertyOptions(w),!((U.hasChanged??f$1)(q,D)||U.useDefault&&U.reflect&&q===this._$Ej?.get(w)&&!this.hasAttribute(F._$Eu(w,U))))return;this.C(w,D,U)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(w,D,{useDefault:U,reflect:F,wrapped:q},W){U&&!(this._$Ej??=new Map).has(w)&&(this._$Ej.set(w,W??D??this[w]),q!==!0||W!==void 0)||(this._$AL.has(w)||(this.hasUpdated||U||(D=void 0),this._$AL.set(w,D)),F===!0&&this._$Em!==w&&(this._$Eq??=new Set).add(w))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(D){Promise.reject(D)}const w=this.scheduleUpdate();return w!=null&&await w,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[F,q]of this._$Ep)this[F]=q;this._$Ep=void 0}const U=this.constructor.elementProperties;if(U.size>0)for(const[F,q]of U){const{wrapped:W}=q,X=this[F];W!==!0||this._$AL.has(F)||X===void 0||this.C(F,void 0,q,X)}}let w=!1;const D=this._$AL;try{w=this.shouldUpdate(D),w?(this.willUpdate(D),this._$EO?.forEach((U=>U.hostUpdate?.())),this.update(D)):this._$EM()}catch(U){throw w=!1,this._$EM(),U}w&&this._$AE(D)}willUpdate(w){}_$AE(w){this._$EO?.forEach((D=>D.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(w)),this.updated(w)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(w){return!0}update(w){this._$Eq&&=this._$Eq.forEach((D=>this._$ET(D,this[D]))),this._$EM()}updated(w){}firstUpdated(w){}};y$1.elementStyles=[],y$1.shadowRootOptions={mode:"open"},y$1[d$1("elementProperties")]=new Map,y$1[d$1("finalized")]=new Map,p$1?.({ReactiveElement:y$1}),(a$1.reactiveElementVersions??=[]).push("2.1.1");/**
|
|
27
27
|
* @license
|
|
28
28
|
* Copyright 2017 Google LLC
|
|
29
29
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
30
30
|
*/const t=globalThis,i$1=t.trustedTypes,s$1=i$1?i$1.createPolicy("lit-html",{createHTML:O=>O}):void 0,e="$lit$",h=`lit$${Math.random().toFixed(9).slice(2)}$`,o$1="?"+h,n=`<${o$1}>`,r=document,l=()=>r.createComment(""),c=O=>O===null||typeof O!="object"&&typeof O!="function",a=Array.isArray,u=O=>a(O)||typeof O?.[Symbol.iterator]=="function",d=`[
|
|
31
31
|
\f\r]`,f=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,v=/-->/g,_=/>/g,m=RegExp(`>|${d}(?:([^\\s"'>=/]+)(${d}*=${d}*(?:[^
|
|
32
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),p=/'/g,g=/"/g,$=/^(?:script|style|textarea|title)$/i,y=O=>(w,...D)=>({_$litType$:O,strings:w,values:D}),x=y(1),b=y(2),T=Symbol.for("lit-noChange"),E=Symbol.for("lit-nothing"),A=new WeakMap,C=r.createTreeWalker(r,129);function P(O,w){if(!a(O)||!O.hasOwnProperty("raw"))throw Error("invalid template strings array");return s$1!==void 0?s$1.createHTML(w):w}const V=(O,w)=>{const D=O.length-1,U=[];let F,q=w===2?"<svg>":w===3?"<math>":"",W=f;for(let
|
|
32
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),p=/'/g,g=/"/g,$=/^(?:script|style|textarea|title)$/i,y=O=>(w,...D)=>({_$litType$:O,strings:w,values:D}),x=y(1),b=y(2),T=Symbol.for("lit-noChange"),E=Symbol.for("lit-nothing"),A=new WeakMap,C=r.createTreeWalker(r,129);function P(O,w){if(!a(O)||!O.hasOwnProperty("raw"))throw Error("invalid template strings array");return s$1!==void 0?s$1.createHTML(w):w}const V=(O,w)=>{const D=O.length-1,U=[];let F,q=w===2?"<svg>":w===3?"<math>":"",W=f;for(let X=0;X<D;X++){const G=O[X];let K,Q,tt=-1,J=0;for(;J<G.length&&(W.lastIndex=J,Q=W.exec(G),Q!==null);)J=W.lastIndex,W===f?Q[1]==="!--"?W=v:Q[1]!==void 0?W=_:Q[2]!==void 0?($.test(Q[2])&&(F=RegExp("</"+Q[2],"g")),W=m):Q[3]!==void 0&&(W=m):W===m?Q[0]===">"?(W=F??f,tt=-1):Q[1]===void 0?tt=-2:(tt=W.lastIndex-Q[2].length,K=Q[1],W=Q[3]===void 0?m:Q[3]==='"'?g:p):W===g||W===p?W=m:W===v||W===_?W=f:(W=m,F=void 0);const Y=W===m&&O[X+1].startsWith("/>")?" ":"";q+=W===f?G+n:tt>=0?(U.push(K),G.slice(0,tt)+e+G.slice(tt)+h+Y):G+h+(tt===-2?X:Y)}return[P(O,q+(O[D]||"<?>")+(w===2?"</svg>":w===3?"</math>":"")),U]};class N{constructor({strings:w,_$litType$:D},U){let F;this.parts=[];let q=0,W=0;const X=w.length-1,G=this.parts,[K,Q]=V(w,D);if(this.el=N.createElement(K,U),C.currentNode=this.el.content,D===2||D===3){const tt=this.el.content.firstChild;tt.replaceWith(...tt.childNodes)}for(;(F=C.nextNode())!==null&&G.length<X;){if(F.nodeType===1){if(F.hasAttributes())for(const tt of F.getAttributeNames())if(tt.endsWith(e)){const J=Q[W++],Y=F.getAttribute(tt).split(h),Z=/([.?@])?(.*)/.exec(J);G.push({type:1,index:q,name:Z[2],strings:Y,ctor:Z[1]==="."?H:Z[1]==="?"?I:Z[1]==="@"?L:k}),F.removeAttribute(tt)}else tt.startsWith(h)&&(G.push({type:6,index:q}),F.removeAttribute(tt));if($.test(F.tagName)){const tt=F.textContent.split(h),J=tt.length-1;if(J>0){F.textContent=i$1?i$1.emptyScript:"";for(let Y=0;Y<J;Y++)F.append(tt[Y],l()),C.nextNode(),G.push({type:2,index:++q});F.append(tt[J],l())}}}else if(F.nodeType===8)if(F.data===o$1)G.push({type:2,index:q});else{let tt=-1;for(;(tt=F.data.indexOf(h,tt+1))!==-1;)G.push({type:7,index:q}),tt+=h.length-1}q++}}static createElement(w,D){const U=r.createElement("template");return U.innerHTML=w,U}}function S(O,w,D=O,U){if(w===T)return w;let F=U!==void 0?D._$Co?.[U]:D._$Cl;const q=c(w)?void 0:w._$litDirective$;return F?.constructor!==q&&(F?._$AO?.(!1),q===void 0?F=void 0:(F=new q(O),F._$AT(O,D,U)),U!==void 0?(D._$Co??=[])[U]=F:D._$Cl=F),F!==void 0&&(w=S(O,F._$AS(O,w.values),F,U)),w}class M{constructor(w,D){this._$AV=[],this._$AN=void 0,this._$AD=w,this._$AM=D}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(w){const{el:{content:D},parts:U}=this._$AD,F=(w?.creationScope??r).importNode(D,!0);C.currentNode=F;let q=C.nextNode(),W=0,X=0,G=U[0];for(;G!==void 0;){if(W===G.index){let K;G.type===2?K=new R(q,q.nextSibling,this,w):G.type===1?K=new G.ctor(q,G.name,G.strings,this,w):G.type===6&&(K=new z(q,this,w)),this._$AV.push(K),G=U[++X]}W!==G?.index&&(q=C.nextNode(),W++)}return C.currentNode=r,F}p(w){let D=0;for(const U of this._$AV)U!==void 0&&(U.strings!==void 0?(U._$AI(w,U,D),D+=U.strings.length-2):U._$AI(w[D])),D++}}class R{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(w,D,U,F){this.type=2,this._$AH=E,this._$AN=void 0,this._$AA=w,this._$AB=D,this._$AM=U,this.options=F,this._$Cv=F?.isConnected??!0}get parentNode(){let w=this._$AA.parentNode;const D=this._$AM;return D!==void 0&&w?.nodeType===11&&(w=D.parentNode),w}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(w,D=this){w=S(this,w,D),c(w)?w===E||w==null||w===""?(this._$AH!==E&&this._$AR(),this._$AH=E):w!==this._$AH&&w!==T&&this._(w):w._$litType$!==void 0?this.$(w):w.nodeType!==void 0?this.T(w):u(w)?this.k(w):this._(w)}O(w){return this._$AA.parentNode.insertBefore(w,this._$AB)}T(w){this._$AH!==w&&(this._$AR(),this._$AH=this.O(w))}_(w){this._$AH!==E&&c(this._$AH)?this._$AA.nextSibling.data=w:this.T(r.createTextNode(w)),this._$AH=w}$(w){const{values:D,_$litType$:U}=w,F=typeof U=="number"?this._$AC(w):(U.el===void 0&&(U.el=N.createElement(P(U.h,U.h[0]),this.options)),U);if(this._$AH?._$AD===F)this._$AH.p(D);else{const q=new M(F,this),W=q.u(this.options);q.p(D),this.T(W),this._$AH=q}}_$AC(w){let D=A.get(w.strings);return D===void 0&&A.set(w.strings,D=new N(w)),D}k(w){a(this._$AH)||(this._$AH=[],this._$AR());const D=this._$AH;let U,F=0;for(const q of w)F===D.length?D.push(U=new R(this.O(l()),this.O(l()),this,this.options)):U=D[F],U._$AI(q),F++;F<D.length&&(this._$AR(U&&U._$AB.nextSibling,F),D.length=F)}_$AR(w=this._$AA.nextSibling,D){for(this._$AP?.(!1,!0,D);w!==this._$AB;){const U=w.nextSibling;w.remove(),w=U}}setConnected(w){this._$AM===void 0&&(this._$Cv=w,this._$AP?.(w))}}class k{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(w,D,U,F,q){this.type=1,this._$AH=E,this._$AN=void 0,this.element=w,this.name=D,this._$AM=F,this.options=q,U.length>2||U[0]!==""||U[1]!==""?(this._$AH=Array(U.length-1).fill(new String),this.strings=U):this._$AH=E}_$AI(w,D=this,U,F){const q=this.strings;let W=!1;if(q===void 0)w=S(this,w,D,0),W=!c(w)||w!==this._$AH&&w!==T,W&&(this._$AH=w);else{const X=w;let G,K;for(w=q[0],G=0;G<q.length-1;G++)K=S(this,X[U+G],D,G),K===T&&(K=this._$AH[G]),W||=!c(K)||K!==this._$AH[G],K===E?w=E:w!==E&&(w+=(K??"")+q[G+1]),this._$AH[G]=K}W&&!F&&this.j(w)}j(w){w===E?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,w??"")}}class H extends k{constructor(){super(...arguments),this.type=3}j(w){this.element[this.name]=w===E?void 0:w}}class I extends k{constructor(){super(...arguments),this.type=4}j(w){this.element.toggleAttribute(this.name,!!w&&w!==E)}}class L extends k{constructor(w,D,U,F,q){super(w,D,U,F,q),this.type=5}_$AI(w,D=this){if((w=S(this,w,D,0)??E)===T)return;const U=this._$AH,F=w===E&&U!==E||w.capture!==U.capture||w.once!==U.once||w.passive!==U.passive,q=w!==E&&(U===E||F);F&&this.element.removeEventListener(this.name,this,U),q&&this.element.addEventListener(this.name,this,w),this._$AH=w}handleEvent(w){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,w):this._$AH.handleEvent(w)}}class z{constructor(w,D,U){this.element=w,this.type=6,this._$AN=void 0,this._$AM=D,this.options=U}get _$AU(){return this._$AM._$AU}_$AI(w){S(this,w)}}const j=t.litHtmlPolyfillSupport;j?.(N,R),(t.litHtmlVersions??=[]).push("3.3.1");const B=(O,w,D)=>{const U=D?.renderBefore??w;let F=U._$litPart$;if(F===void 0){const q=D?.renderBefore??null;U._$litPart$=F=new R(w.insertBefore(l(),q),q,void 0,D??{})}return F._$AI(O),F};/**
|
|
33
33
|
* @license
|
|
34
34
|
* Copyright 2017 Google LLC
|
|
35
35
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -62,4 +62,4 @@
|
|
|
62
62
|
>
|
|
63
63
|
<slot></slot>
|
|
64
64
|
</span>
|
|
65
|
-
`}}customElements.get("zoo-tag")||customElements.define("zoo-tag",ZooTag);const zoo=Object.freeze(Object.defineProperty({__proto__:null,ZooTag,getEventAttribute,getSemanticAttributes},Symbol.toStringTag,{value:"Module"}));async function registerCarbonLibrary(){const{registerCarbonLibrary:O}=await Promise.resolve().then(()=>require("./register-
|
|
65
|
+
`}}customElements.get("zoo-tag")||customElements.define("zoo-tag",ZooTag);const zoo=Object.freeze(Object.defineProperty({__proto__:null,ZooTag,getEventAttribute,getSemanticAttributes},Symbol.toStringTag,{value:"Module"}));async function registerCarbonLibrary(){const{registerCarbonLibrary:O}=await Promise.resolve().then(()=>require("./register-c8kclAIe.js"));return O()}async function registerMdcLibrary(){const{registerMdcLibrary:O}=await Promise.resolve().then(()=>require("./register-D2Du9nP6.js"));return O()}const zooy={Evt,Component,Dragger,Panel,FormPanel,Split,UserManager,View,Conductor,DataBinder:Binder,UiEventType,domUtils,uriUtils,registerCarbonLibrary,registerMdcLibrary,ComponentLibraryRegistry,handlers,zoo};exports.B=B;exports.Binder=Binder;exports.Component=Component;exports.ComponentLibraryRegistry=ComponentLibraryRegistry;exports.Conductor=Conductor;exports.Dragger=Dragger;exports.E=E;exports.Evt=Evt;exports.FormPanel=FormPanel;exports.Panel=Panel;exports.Split=Split;exports.T=T;exports.UiEventType=UiEventType;exports.UserManager=UserManager;exports.View=View;exports._curry2=_curry2;exports._curry3=_curry3;exports._path=_path;exports.b=b;exports.domUtils=domUtils;exports.f=f$1;exports.getElDataMap=getElDataMap;exports.getEventAttribute=getEventAttribute;exports.getSemanticAttributes=getSemanticAttributes;exports.handlers=handlers;exports.hasPath=hasPath;exports.i=i;exports.i$1=i$3;exports.isDefAndNotNull=isDefAndNotNull;exports.objToPaths=objToPaths;exports.path=path;exports.registerCarbonLibrary=registerCarbonLibrary;exports.registerMdcLibrary=registerMdcLibrary;exports.toLowerCase=toLowerCase;exports.treeUtils=treeUtils;exports.u=u$1;exports.uriUtils=uriUtils;exports.x=x;exports.zoo=zoo;exports.zooy=zooy;
|