x4js 2.0.12 → 2.0.13

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.
Files changed (108) hide show
  1. package/README.md +15 -15
  2. package/lib/README.txt +15 -15
  3. package/lib/cjs/x4.css +1 -1
  4. package/lib/cjs/x4.js +1 -1
  5. package/lib/esm/x4.css +1 -1
  6. package/lib/esm/x4.mjs +1 -1
  7. package/lib/src/components/base.scss +25 -26
  8. package/lib/src/components/boxes/boxes.module.scss +37 -37
  9. package/lib/src/components/boxes/boxes.ts +129 -125
  10. package/lib/src/components/breadcrumb/breadcrumb.scss +28 -0
  11. package/lib/src/components/breadcrumb/breadcrumb.ts +84 -0
  12. package/lib/src/components/breadcrumb/chevron-right.svg +1 -0
  13. package/lib/src/components/btngroup/btngroup.module.scss +28 -28
  14. package/lib/src/components/btngroup/btngroup.ts +119 -101
  15. package/lib/src/components/button/button.module.scss +154 -153
  16. package/lib/src/components/button/button.ts +117 -117
  17. package/lib/src/components/calendar/calendar.module.scss +162 -162
  18. package/lib/src/components/calendar/calendar.ts +326 -325
  19. package/lib/src/components/checkbox/check.svg +3 -3
  20. package/lib/src/components/checkbox/checkbox.module.scss +141 -141
  21. package/lib/src/components/checkbox/checkbox.ts +125 -124
  22. package/lib/src/components/colorinput/colorinput.module.scss +64 -64
  23. package/lib/src/components/colorinput/colorinput.ts +90 -87
  24. package/lib/src/components/colorpicker/colorpicker.module.scss +132 -132
  25. package/lib/src/components/colorpicker/colorpicker.ts +481 -476
  26. package/lib/src/components/combobox/combobox.module.scss +123 -120
  27. package/lib/src/components/combobox/combobox.ts +192 -190
  28. package/lib/src/components/combobox/updown.svg +3 -3
  29. package/lib/src/components/components.ts +34 -0
  30. package/lib/src/components/dialog/dialog.module.scss +71 -71
  31. package/lib/src/components/dialog/dialog.ts +94 -92
  32. package/lib/src/components/form/form.module.scss +34 -34
  33. package/lib/src/components/form/form.ts +41 -36
  34. package/lib/src/components/grid/datastore.ts +1298 -0
  35. package/lib/src/components/grid/gridview.ts +1108 -0
  36. package/lib/src/components/grid/memdb.ts +325 -0
  37. package/lib/src/components/header/header.module.scss +39 -39
  38. package/lib/src/components/header/header.ts +129 -123
  39. package/lib/src/components/icon/icon.module.scss +29 -29
  40. package/lib/src/components/icon/icon.ts +136 -134
  41. package/lib/src/components/image/image.module.scss +20 -20
  42. package/lib/src/components/image/image.ts +68 -66
  43. package/lib/src/components/input/input.module.scss +69 -69
  44. package/lib/src/components/input/input.ts +275 -274
  45. package/lib/src/components/label/label.module.scss +58 -52
  46. package/lib/src/components/label/label.ts +64 -55
  47. package/lib/src/components/link/link.ts +78 -0
  48. package/lib/src/components/listbox/listbox.module.scss +103 -103
  49. package/lib/src/components/listbox/listbox.ts +431 -427
  50. package/lib/src/components/menu/menu.module.scss +107 -107
  51. package/lib/src/components/menu/menu.ts +171 -168
  52. package/lib/src/components/messages/messages.module.scss +48 -47
  53. package/lib/src/components/messages/messages.ts +68 -63
  54. package/lib/src/components/normalize.scss +386 -386
  55. package/lib/src/components/notification/notification.module.scss +81 -81
  56. package/lib/src/components/notification/notification.ts +109 -108
  57. package/lib/src/components/panel/panel.module.scss +47 -47
  58. package/lib/src/components/panel/panel.ts +57 -56
  59. package/lib/src/components/popup/popup.module.scss +43 -43
  60. package/lib/src/components/popup/popup.ts +396 -395
  61. package/lib/src/components/progress/progress.module.scss +56 -56
  62. package/lib/src/components/progress/progress.ts +43 -42
  63. package/lib/src/components/rating/rating.module.scss +22 -22
  64. package/lib/src/components/rating/rating.ts +131 -125
  65. package/lib/src/components/shared.scss +90 -76
  66. package/lib/src/components/sizers/sizer.module.scss +89 -89
  67. package/lib/src/components/sizers/sizer.ts +123 -119
  68. package/lib/src/components/slider/slider.module.scss +70 -70
  69. package/lib/src/components/slider/slider.ts +147 -142
  70. package/lib/src/components/switch/switch.module.scss +126 -126
  71. package/lib/src/components/switch/switch.ts +61 -55
  72. package/lib/src/components/tabs/tabs.module.scss +46 -46
  73. package/lib/src/components/tabs/tabs.ts +168 -157
  74. package/lib/src/components/textarea/textarea.module.scss +59 -59
  75. package/lib/src/components/textarea/textarea.ts +60 -54
  76. package/lib/src/components/textedit/textedit.module.scss +113 -113
  77. package/lib/src/components/textedit/textedit.ts +83 -82
  78. package/lib/src/components/themes.scss +81 -77
  79. package/lib/src/components/tooltips/tooltips.scss +50 -50
  80. package/lib/src/components/tooltips/tooltips.ts +103 -102
  81. package/lib/src/components/treeview/treeview.module.scss +115 -115
  82. package/lib/src/components/treeview/treeview.ts +410 -403
  83. package/lib/src/components/viewport/viewport.module.scss +24 -24
  84. package/lib/src/components/viewport/viewport.ts +41 -38
  85. package/lib/src/core/component.ts +1002 -979
  86. package/lib/src/core/core_application.ts +44 -0
  87. package/lib/src/core/core_colors.ts +249 -249
  88. package/lib/src/core/core_dom.ts +471 -471
  89. package/lib/src/core/core_dragdrop.ts +200 -200
  90. package/lib/src/core/core_element.ts +97 -97
  91. package/lib/src/core/core_events.ts +149 -149
  92. package/lib/src/core/core_i18n.ts +377 -377
  93. package/lib/src/core/core_router.ts +221 -221
  94. package/lib/src/core/core_styles.ts +214 -214
  95. package/lib/src/core/core_svg.ts +550 -550
  96. package/lib/src/core/core_tools.ts +688 -673
  97. package/lib/src/demo/assets/radio.svg +3 -3
  98. package/lib/src/demo/index.html +11 -11
  99. package/lib/src/demo/main.scss +21 -21
  100. package/lib/src/demo/main.tsx +323 -323
  101. package/lib/src/types/scss.d.ts +4 -4
  102. package/lib/src/types/x4react.d.ts +8 -8
  103. package/lib/src/x4.scss +18 -18
  104. package/lib/src/x4.ts +31 -62
  105. package/lib/styles/x4.css +1 -1
  106. package/lib/types/x4js.d.ts +100 -49
  107. package/package.json +2 -3
  108. package/src/x4.ts +31 -62
package/lib/cjs/x4.js CHANGED
@@ -1 +1 @@
1
- "use strict";var we=Object.defineProperty;var En=Object.getOwnPropertyDescriptor;var kn=Object.getOwnPropertyNames;var In=Object.prototype.hasOwnProperty;var Fo=s=>{throw TypeError(s)};var i=(s,e)=>we(s,"name",{value:e,configurable:!0});var Mn=(s,e)=>{for(var t in e)we(s,t,{get:e[t],enumerable:!0})},Pn=(s,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of kn(e))!In.call(s,n)&&n!==t&&we(s,n,{get:()=>e[n],enumerable:!(o=En(e,n))||o.enumerable});return s};var Tn=s=>Pn(we({},"__esModule",{value:!0}),s);var Uo=(s,e,t)=>e.has(s)||Fo("Cannot "+t);var S=(s,e,t)=>(Uo(s,e,"read from private field"),t?t.call(s):e.get(s)),Ne=(s,e,t)=>e.has(s)?Fo("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(s):e.set(s,t),Fe=(s,e,t,o)=>(Uo(s,e,"write to private field"),o?o.call(s,t):e.set(s,t),t);var wr={};Mn(wr,{Box:()=>y,BtnGroup:()=>ue,Button:()=>v,CSizer:()=>P,Calendar:()=>Ht,Checkbox:()=>Ft,Color:()=>M,ColorInput:()=>Vt,ColorPicker:()=>Gt,Combobox:()=>oo,Component:()=>d,ComputedStyle:()=>Je,CoreElement:()=>se,Dialog:()=>be,EventSource:()=>G,Flex:()=>Y,Form:()=>ge,HBox:()=>h,Header:()=>ao,Icon:()=>_,Image:()=>co,Input:()=>C,Label:()=>u,Listbox:()=>xe,Menu:()=>oe,MessageBox:()=>ho,Notification:()=>uo,Panel:()=>xo,Popup:()=>T,Progress:()=>go,Rating:()=>_o,Rect:()=>z,Router:()=>ct,Saturation:()=>Re,ScrollView:()=>me,Slider:()=>wo,StackBox:()=>he,Stylesheet:()=>Ze,SvgBuilder:()=>ht,SvgComponent:()=>ut,SvgGradient:()=>Pe,SvgGroup:()=>pe,SvgPath:()=>Ie,SvgShape:()=>de,SvgText:()=>Me,Switch:()=>Co,Tabs:()=>Mo,TextArea:()=>So,TextEdit:()=>Ao,Timer:()=>$,Treeview:()=>Bo,UnsafeHtml:()=>q,VBox:()=>f,Viewport:()=>Oe,_date_set_locale:()=>Fn,_tr:()=>m,addEvent:()=>le,addTranslation:()=>qe,asap:()=>Ke,calcAge:()=>Gn,camelCase:()=>Bn,clamp:()=>D,componentFromDOM:()=>g,createLanguage:()=>Ue,date_calc_weeknum:()=>$e,date_clone:()=>K,date_diff:()=>Vn,date_format:()=>Un,date_hash:()=>N,date_sql_utc:()=>$n,date_to_sql:()=>qn,dispatchEvent:()=>jo,dragManager:()=>er,formatIntlDate:()=>H,getAvailableLanguages:()=>An,getCurrentLanguage:()=>Ln,initTooltips:()=>gr,isArray:()=>Ee,isFeatureAvailable:()=>ie,isFunction:()=>zn,isLanguage:()=>Ve,isNumber:()=>B,isString:()=>k,isUnitLess:()=>Qe,kbNav:()=>Qt,kbTreeNav:()=>fn,makeUniqueComponentId:()=>L,pad:()=>O,parseIntlDate:()=>Kn,pascalCase:()=>Hn,selectLanguage:()=>Ko,sprintf:()=>Ce,svgLoader:()=>De,unbubbleEvents:()=>Go,unitless:()=>ae,unsafeHtml:()=>re,wrapDOM:()=>nt});module.exports=Tn(wr);var Vo=Symbol("i18n"),Z={};function Ue(s,e){Z[s]={name:s,base:e,src_translations:{},translations:{}}}i(Ue,"createLanguage");function Ve(s){return Z[s]!==void 0}i(Ve,"isLanguage");function qe(s,...e){if(!Ve(s))return;let t=Z[s];e.forEach(o=>{qo(t.src_translations,o)}),t.translations=$o(t.src_translations,t.base,!0)}i(qe,"addTranslation");function qo(s,e){for(let t in e){let o=e[t];typeof o=="string"?s[t]=o:Array.isArray(o)&&(!s[t]||!Array.isArray(s[t]))?s[t]=[...o]:!s[t]||typeof s[t]!="object"?s[t]={...o}:qo(s[t],e[t])}}i(qo,"_patch");function $o(s,e,t){let o={};for(let n in s)typeof s[n]!="string"&&!Array.isArray(s[n])?o[n]=$o(s[n],e,!1):o[n]=s[n];return Dn(o,e,t)}i($o,"_proxyfy");function Dn(s,e,t){return new Proxy(s,{get:i((o,n)=>{t?ye=[n]:ye.push(n);let r=o[n];return r===void 0&&(e&&(r=Sn(e)),r===void 0&&console.error("I18N error: unable to find","_tr."+ye.join("."))),r},"get")})}i(Dn,"_mk_proxy");var ye;function Sn(s){for(;s;){let e=Z[s],t=e.translations,o;for(let n of ye){if(o=t[n],o===void 0)break;t=o}if(o!==void 0)return t;s=e.base}}i(Sn,"_findBaseTrans");var m={};function Ko(s){if(Ve(s))return m=Z[s].translations,m[Vo]=s,m}i(Ko,"selectLanguage");function Ln(){return m[Vo]}i(Ln,"getCurrentLanguage");function An(){return Object.keys(Z)}i(An,"getAvailableLanguages");var Rn={global:{ok:"OK",cancel:"Annuler",ignore:"Ignorer",yes:"Oui",no:"Non",abort:"Abandonner",retry:"Réessayer",error:"Erreur",today:"Aujourd'hui",open:"Ouvrir",new:"Nouveau",delete:"Supprimer",close:"Fermer",save:"Enregistrer",search:"Rechercher",search_tip:"Saisissez le texte à rechercher. <b>Enter</b> pour lancer la recherche. <b>Esc</b> pour annuler.",required_field:"information requise",invalid_format:"format invalide",invalid_email:"adresse mail invalide",invalid_number:"valeur numérique invalide",diff_date_seconds:"{0} secondes",diff_date_minutes:"{0} minutes",diff_date_hours:"{0} heures",invalid_date:"Date non reconnue ({0})",empty_list:"Liste vide",date_input_formats:"d/m/y|d.m.y|d m y|d-m-y|dmy",date_format:"D/M/Y",day_short:["dim","lun","mar","mer","jeu","ven","sam"],day_long:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],month_short:["jan","fév","mar","avr","mai","jun","jui","aoû","sep","oct","nov","déc"],month_long:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"],property:"Propriété",value:"Valeur",err_403:"Vous n'avez pas les droits suffisants pour effectuer cette action",copy:"Copier",cut:"Couper",paste:"Coller"}},On={global:{ok:"OK",cancel:"Cancel",ignore:"Ignore",yes:"Yes",no:"No",abort:"Abort",retry:"Retry",error:"Error",today:"Today",open:"Open",new:"New",delete:"Delete",close:"Close",save:"Save",search:"Search",search_tip:"Type in the text to search. <b>Enter</b> to start the search. <b>Esc</b> to cancel.",required_field:"missing information",invalid_format:"invalid format",invalid_email:"invalid email address",invalid_number:"bad numeric value",diff_date_seconds:"{0} seconds",diff_date_minutes:"{0} minutes",diff_date_hours:"{0} hours",invalid_date:"Unrecognized date({0})",empty_list:"Empty list",date_input_formats:"m/d/y|m.d.y|m d y|m-d-y|mdy",date_format:"M/D/Y",day_short:["sun","mon","tue","wed","thu","fri","sat"],day_long:["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],month_short:["jan","feb","mar","apr","may","jun","jui","aug","sep","oct","nov","dec"],month_long:["january","february","march","april","mau","june","jully","august","september","october","november","december"],property:"Property",value:"Value",err_403:"You do not have sufficient rights to do that action",copy:"Copy",cut:"Cut",paste:"Paste"}};Ue("fr",null);qe("fr",Rn);Ue("en","fr");qe("en",On);Ko("fr");function k(s){return typeof s=="string"}i(k,"isString");function B(s){return typeof s=="number"&&isFinite(s)}i(B,"isNumber");function Ee(s){return s instanceof Array}i(Ee,"isArray");function zn(s){return s instanceof Function}i(zn,"isFunction");var Ge=class Ge extends String{constructor(e){super(e)}};i(Ge,"UnsafeHtml");var q=Ge;function re(s){return new q(s)}i(re,"unsafeHtml");function D(s,e,t){return s<e?e:s>t?t:s}i(D,"clamp");var je=class je{constructor(e,t,o,n){e!==void 0&&(B(e)?(this.left=e,this.top=t,this.width=o,this.height=n):Object.assign(this,e))}get right(){return this.left+this.width}get bottom(){return this.top+this.height}};i(je,"Rect");var z=je;function ie(s){switch(s){case"eyedropper":return"EyeDropper"in window}return!1}i(ie,"isFeatureAvailable");var Ye=class Ye{setTimeout(e,t,o){this._timers?this.clearTimeout(e):this._timers=new Map;let n=setTimeout(o,t);return this._timers.set(e,n),n}clearTimeout(e){this._timers&&this._timers.has(e)&&(clearTimeout(this._timers.get(e)),this._timers.delete(e))}setInterval(e,t,o){this._timers?this.clearInterval(e):this._timers=new Map;let n=setInterval(o,t);return this._timers.set(e,n),n}clearInterval(e){this._timers&&this._timers.has(e)&&(clearInterval(this._timers.get(e)),this._timers.delete(e))}clearAllTimeouts(){var e;(e=this._timers)==null||e.forEach(t=>{clearTimeout(t)}),this._timers=null}};i(Ye,"Timer");var $=Ye;function Ke(s){return requestAnimationFrame(s)}i(Ke,"asap");function O(s,e,t="0"){let o;return k(s)?o=s:o=""+s,e>0?o.padEnd(e,t):o.padStart(-e,t)}i(O,"pad");function Ce(s,...e){return s.replace(/{(\d+)}/g,function(t,o){return typeof e[o]<"u"?e[o]:t})}i(Ce,"sprintf");function Hn(s){let e=s;return e=e.replace(/([a-z])([A-Z])/g,"$1 $2"),e=e.toLowerCase(),e=e.replace(/[^- a-z0-9]+/g," "),e.indexOf(" ")<0?e:(e=e.trim(),e.replace(/ /g,"-"))}i(Hn,"pascalCase");function Bn(s){let e=s.toLowerCase();return e=e.replace(/[^a-zA-Z0-9]+(.)/g,(t,o)=>o.toUpperCase()),e}i(Bn,"camelCase");var Nn="fr-FR";function Fn(s){Nn=s}i(Fn,"_date_set_locale");function Un(s,e){return H(s)}i(Un,"date_format");function Vn(s,e,t){var o=(s.getTime()-e.getTime())/1e3;let n=o;if(n<60)return Ce(m.global.diff_date_seconds,Math.round(n));let r=Math.floor(n/60);if(r<60)return Ce(m.global.diff_date_minutes,Math.round(r));let a=Math.floor(r/60);return Ce(m.global.diff_date_hours,a,r%60)}i(Vn,"date_diff");function qn(s,e){return e?H(s,"Y-M-D H:I:S"):H(s,"Y-M-D")}i(qn,"date_to_sql");function $n(s){return new Date(s+" GMT")}i($n,"date_sql_utc");function N(s){return s.getFullYear()<<16|s.getMonth()<<8|s.getDate()}i(N,"date_hash");function K(s){return new Date(s.getTime())}i(K,"date_clone");function $e(s){let e=new Date(s.getFullYear(),0,1),t=(s.valueOf()-e.valueOf())/864e5;return Math.floor((t+e.getDay()+1)/7)}i($e,"date_calc_weeknum");function Kn(s,e=m.global.date_input_formats){var o,n,r,a,l,c;let t=e.split("|");for(let p of t){let x="";for(let b of p)b=="d"||b=="D"?x+="(?<day>\\d{1,2})":b=="m"||b=="M"?x+="(?<month>\\d{1,2})":b=="y"||b=="Y"?x+="(?<year>\\d{1,4})":b=="h"||b=="H"?x+="(?<hour>\\d{1,2})":b=="i"||b=="I"?x+="(?<min>\\d{1,2})":b=="s"||b=="S"?x+="(?<sec>\\d{1,2})":b==" "?x+="\\s+":x+="\\s*\\"+b+"\\s*";let w=new RegExp("^"+x+"$","m").exec(s);if(w){let b=new Date,ne=parseInt((o=w.groups.day)!=null?o:"1"),U=parseInt((n=w.groups.month)!=null?n:"1"),V=parseInt((r=w.groups.year)!=null?r:b.getFullYear()+""),_e=parseInt((a=w.groups.hour)!=null?a:"0"),_n=parseInt((l=w.groups.min)!=null?l:"0"),vn=parseInt((c=w.groups.sec)!=null?c:"0");V>0&&V<100&&(V+=2e3);let ve=new Date(V,U-1,ne,_e,_n,vn,0),wn=ve.getFullYear(),yn=ve.getMonth()+1,Cn=ve.getDate();return wn!=V||yn!=U||Cn!=ne?null:ve}}return null}i(Kn,"parseIntlDate");function H(s,e=m.global.date_format){if(!s)return"";let t={year:s.getFullYear(),month:s.getMonth()+1,day:s.getDate(),wday:s.getDay(),hours:s.getHours(),minutes:s.getMinutes(),seconds:s.getSeconds(),milli:s.getMilliseconds()},o="",n=0;for(let r of e){if(r=="{"){if(++n==1)continue}else if(r=="}"&&--n==0)continue;if(n){o+=r;continue}r=="d"?o+=t.day:r=="D"?o+=O(t.day,-2):r=="j"?o+=m.global.day_short[t.wday]:r=="J"?o+=m.global.day_long[t.wday]:r=="w"?o+=$e(s):r=="W"?o+=O($e(s),-2):r=="m"?o+=t.month:r=="M"?o+=O(t.month,-2):r=="o"?o+=m.global.month_short[t.month-1]:r=="O"?o+=m.global.month_long[t.month-1]:r=="y"||r=="Y"?o+=O(t.year,-4):r=="a"||r=="A"?o+=t.hours<12?"am":"pm":r=="h"?o+=t.hours:r=="H"?o+=O(t.hours,-2):r=="i"?o+=t.minutes:r=="I"?o+=O(t.minutes,-2):r=="s"?o+=t.seconds:r=="S"?o+=O(t.seconds,-2):r=="l"?o+=t.milli:r=="L"?o+=O(t.milli,-3):o+=r}return o}i(H,"formatIntlDate");function Gn(s,e){if(e===void 0&&(e=new Date),!s)return 0;let t=e.getFullYear()-s.getFullYear();return(e.getMonth()<s.getMonth()||e.getMonth()==s.getMonth()&&e.getDate()<s.getDate())&&t--,t}i(Gn,"calcAge");var jn=i(function(){this.propagationStopped=!0},"stopPropagation"),Yn=i(function(){this.defaultPrevented=!0},"preventDefault"),We=class We{constructor(e=null){this._source=e!=null?e:this}addListener(e,t,o=!1){this._registry||(this._registry=new Map);let n=this._registry.get(e);n||(n=[],this._registry.set(e,n));let r=t;n.indexOf(r)==-1&&(o?n.unshift(r):n.push(r))}fire(e,t){var n;let o=(n=this._registry)==null?void 0:n.get(e);if(o&&o.length){let r=t;if(r||(r={}),r.source||(r.source=this._source),r.type||(r.type=e),r.preventDefault||(r.preventDefault=Yn),r.stopPropagation||(r.stopPropagation=jn),o.length==1)o[0](r);else{let a=o.slice();for(let l=0,c=a.length;l<c&&(a[l](r),!r.propagationStopped);l++);}}}};i(We,"EventSource");var G=We;var F,R,Xe=class Xe{constructor(){Ne(this,F);Ne(this,R)}__startTimer(e,t,o,n){S(this,R)?this.__stopTimer(e):Fe(this,R,new Map);let r=(o?setInterval:setTimeout)(n,t);S(this,R).set(e,()=>{(o?clearInterval:clearTimeout)(r),S(this,R).delete(e)})}__stopTimer(e){let t=S(this,R).get(e);t&&t()}setTimeout(e,t,o){this.__startTimer(e,t,!1,o)}clearTimeout(e){this.__stopTimer(e)}setInterval(e,t,o){this.__startTimer(e,t,!0,o)}clearInterval(e){this.__stopTimer(e)}clearTimeouts(){for(let[e,t]of S(this,R))t();S(this,R).clear()}on(e,t){console.assert(t!=null),S(this,F)||Fe(this,F,new G(this)),S(this,F).addListener(e,t)}fire(e,t){S(this,F)&&S(this,F).fire(e,t)}};F=new WeakMap,R=new WeakMap,i(Xe,"CoreElement");var se=Xe;var ae={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function Qe(s){return!!ae[s]}i(Qe,"isUnitLess");var j=class j{constructor(){this.m_rules=new Map;function e(t){for(let o=0;o<document.styleSheets.length;o++){let n=document.styleSheets[o];if(n.title===t)return n}}if(i(e,"getStyleSheet"),this.m_sheet=e("x4-dynamic-css"),!this.m_sheet){let t=document.createElement("style");t.setAttribute("id","x4-dynamic-css"),document.head.appendChild(t),this.m_sheet=t.sheet}}setRule(e,t){if(k(t)){let o=this.m_rules.get(e);o!==void 0?this.m_sheet.deleteRule(o):o=this.m_sheet.cssRules.length,this.m_rules.set(e,this.m_sheet.insertRule(t,o))}else{let o=1;for(let n in t){let r=n+" { ",a=t[n];for(let l in a){let c=a[l];for(let p=0;p<c.length;p++)r+=l+": "+c[p]+"; "}r+="}",this.setRule(e+"--"+o,r),o++}}}static getVar(e){return j.doc_style||(j.doc_style=getComputedStyle(document.documentElement)),e.startsWith("--")||(e="--"+e),j.doc_style.getPropertyValue(e)}};i(j,"Stylesheet"),j.guid=1;var Ze=j,et=class et{constructor(e){this.m_style=e}value(e){return this.m_style[e]}parse(e){return parseInt(this.m_style[e])}get style(){return this.m_style}};i(et,"ComputedStyle");var Je=et;var Go={mouseleave:1,mouseenter:1,load:1,unload:1,scroll:1,focus:1,blur:1,rowexit:1,beforeunload:1,stop:1,dragdrop:1,dragenter:1,dragexit:1,draggesture:1,dragover:1,contextmenu:1,created:2,removed:2,sizechange:2},ke=new WeakMap,tt=null,Wn=i((s,e)=>{let t=i((n,r)=>{let a=ke.get(n);a&&a[r]&&n.dispatchEvent(new Event(r,{}))},"sendEvent"),o=i((n,r)=>{r&&t(n,"created");for(let a=n.firstChild;a;a=a.nextSibling)o(a,r);r||t(n,"removed")},"notify");for(let n of s)n.type=="childList"&&(n.addedNodes&&n.addedNodes.forEach(r=>{o(r,!0)}),n.removedNodes&&n.removedNodes.forEach(r=>{o(r,!1)}))},"observeMutation"),ot=null;function Xn(s){s.forEach(e=>{let t=e.target;t.offsetParent!==null&&t.dispatchEvent(new Event("resized"))})}i(Xn,"observeSize");function jo(s){let e=s.target,t=Go[s.type]===2;for(;e;){let o=ke.get(e);if(o){let n=o[s.type];if(n&&(Array.isArray(n)?n.some(r=>r(s)):n(s),s.stopPropagation||s.defaultPrevented||t))break}if(e=e.parentNode,e==document)break}}i(jo,"dispatchEvent");function le(s,e,t,o=!1){e=="removed"||e=="created"?tt||(tt=new MutationObserver(Wn),tt.observe(document.body,{childList:!0,subtree:!0})):e=="resized"&&(ot||(ot=new ResizeObserver(Xn)),ot.observe(s));let n=ke.get(s);if(n||(n={},ke.set(s,n)),!n[e])n[e]=t,s.addEventListener(e,jo);else{let r=n[e];Array.isArray(r)?r.push(t):n[e]=[r,t]}}i(le,"addEvent");var Yo=Symbol("fragment"),Wo=Symbol("component"),Zn=/^-?\d+(\.\d*)?$/;function Jn(s){let e=[],t=Object.getPrototypeOf(s);for(;t&&t.constructor!==d;){let o=t.constructor.name;e.push("x4"+o.toLowerCase()),t=Object.getPrototypeOf(t)}return e}i(Jn,"genClassNames");var Qn=1e3,L=i(()=>`x4-${Qn++}`,"makeUniqueComponentId"),J=class J extends se{constructor(e){var t,o;if(super(),this.props=e,e.existingDOM)this.dom=e.existingDOM;else{e.ns?this.dom=document.createElementNS(e.ns,(t=e.tag)!=null?t:"div"):this.dom=document.createElement((o=e.tag)!=null?o:"div"),e.attrs&&this.setAttributes(e.attrs),e.cls&&this.addClass(e.cls),e.hidden&&this.show(!1),e.id!==void 0&&this.setAttribute("id",e.id),e.width!==void 0&&this.setStyleValue("width",e.width),e.height!==void 0&&this.setStyleValue("height",e.height),e.tooltip&&this.setAttribute("tooltip",e.tooltip),e.style&&this.setStyle(e.style),e.content&&this.setContent(e.content),e.dom_events&&this.setDOMEvents(e.dom_events);let n=Jn(this);this.dom.classList.add(...n),e.disabled&&this.addDOMEvent("created",()=>{this.enable(!1)})}this.dom[Wo]=this}hasClass(e){return this.dom.classList.contains(e)}addClass(e){if(e)if(e.indexOf(" ")>=0){let t=e.split(" ");this.dom.classList.add(...t)}else this.dom.classList.add(e)}removeClass(e){if(e)if(e.indexOf(" ")>=0){let t=e.split(" ");this.dom.classList.remove(...t)}else this.dom.classList.remove(e)}toggleClass(e){if(!e)return;let t=i(o=>{this.dom.classList.toggle(o)},"toggle");e.indexOf(" ")>=0?e.split(" ").forEach(t):t(e)}setClass(e,t=!0){t?this.addClass(e):this.removeClass(e)}setAttributes(e){for(let t in e){let o=e[t];this.setAttribute(t,o)}}setAttribute(e,t){t==null?this.dom.removeAttribute(e):this.dom.setAttribute(e,""+t)}getAttribute(e){return this.dom.getAttribute(e)}getData(e){return this.getAttribute("data-"+e)}setData(e,t){return this.setAttribute("data-"+e,t)}setInternalData(e,t){return this.store||(this.store=new Map),this.store.set(e,t),this}getInternalData(e){var t;return(t=this.store)==null?void 0:t.get(e)}addDOMEvent(e,t,o=!1){le(this.dom,e,t,o)}setDOMEvents(e){for(let t in e)this.addDOMEvent(t,e[t])}mapPropEvents(e,...t){let o=e;t.forEach(n=>{o.hasOwnProperty(n)&&this.on(n,o[n])})}clearContent(){let e=this.dom;for(;e.firstChild;)e.removeChild(e.firstChild)}setContent(e){this.clearContent(),this.appendContent(e)}appendContent(e){let t=i((o,n)=>{if(n instanceof J)o.appendChild(n.dom);else if(n instanceof q)o.insertAdjacentHTML("beforeend",n.toString());else if(typeof n=="string"||typeof n=="number"){let r=document.createTextNode(n.toString());o.appendChild(r)}else n&&console.warn("Unknown type to append: ",n)},"set");if(!Ee(e))t(this.dom,e);else if(e.length<=8)for(let o of e)t(this.dom,o);else{let o=document.createDocumentFragment();for(let n of e)t(o,n);this.dom.appendChild(o)}}prependContent(e){let t=this.dom,o=i(n=>{if(n instanceof J)t.insertBefore(t.firstChild,n.dom);else if(n instanceof q)t.insertAdjacentHTML("beforebegin",n.toString());else if(typeof n=="string"||typeof n=="number"){let r=document.createTextNode(n.toString());t.insertBefore(t.firstChild,r)}else console.warn("Unknown type to append: ",n)},"set");if(!Ee(e))o(e);else{let n=document.createDocumentFragment();for(let r of e)o(r);t.insertBefore(t.firstChild,n)}}removeChild(e){this.dom.removeChild(e.dom)}queryAll(e){let t=this.dom.querySelectorAll(e),o=new Array(t.length);return t.forEach((n,r)=>o[r]=g(n)),o}query(e){let t=this.dom.querySelector(e);return g(t)}setAria(e,t){return this.setAttribute(e,t),this}setStyle(e){let t=this.dom.style;for(let o in e){let n=e[o];!ae[o]&&(B(n)||Zn.test(n))&&(n+="px"),t[o]=n}return this}setStyleValue(e,t){let o=this.dom.style;if(B(t)){let n=t+"";ae[e]||(n+="px"),o[e]=n}else o[e]=t;return this}getStyleValue(e){return this.dom.style[e]}setWidth(e){this.setStyleValue("width",B(e)?e+"px":e)}setHeight(e){this.setStyleValue("height",B(e)?e+"px":e)}setStyleVariable(e,t){this.dom.style.setProperty(e,t)}getStyleVariable(e){return this.getComputedStyle().getPropertyValue(e)}getComputedStyle(){return getComputedStyle(this.dom)}setCapture(e){this.dom.setPointerCapture(e)}releaseCapture(e){this.dom.releasePointerCapture(e)}getBoundingRect(){let e=this.dom.getBoundingClientRect();return new z(e.x,e.y,e.width,e.height)}focus(){this.dom.focus()}scrollIntoView(e){this.dom.scrollIntoView(e)}isVisible(){return this.dom.offsetParent!==null}show(e=!0){this.setClass("x4hidden",!e)}hide(){this.show(!1)}enable(e=!0){this.setAttribute("disabled",!e),this.enumChildNodes(!0).forEach(o=>{o instanceof HTMLInputElement&&(o.disabled=!e)})}disable(){this.enable(!1)}isDisabled(){return this.getAttribute("disabled")}nextElement(){let e=this.dom.nextElementSibling;return g(e)}prevElement(){let e=this.dom.previousElementSibling;return g(e)}parentElement(e){let t=this.dom;for(;t.parentElement;){let o=g(t.parentElement);if(!e||o&&o instanceof e)return o;t=t.parentElement}return null}firstChild(){let e=this.dom.firstElementChild;return g(e)}lastChild(){let e=this.dom.lastElementChild;return g(e)}enumChildComponents(e){let t=[];return this.enumChildNodes(e).forEach(n=>{let r=g(n);r&&t.push(r)}),t}enumChildNodes(e){return Array.from(e?this.dom.querySelectorAll("*"):this.dom.children)}animate(e,t){this.dom.animate(e,t)}static createElement(e,t,...o){let n;return e==this.createFragment||e===Yo?o:(e instanceof Function?(t=t!=null?t:{},!t.children&&o&&o.length&&(t.content=o),n=new e(t!=null?t:{})):n=new J({tag:e,content:o,...t}),o&&o.length,n)}static createFragment(){return this.createElement(Yo,null)}queryInterface(e){return null}};i(J,"Component");var d=J;function g(s){return s?s[Wo]:null}i(g,"componentFromDOM");function nt(s){let e=g(s);return e||new d({existingDOM:s})}i(nt,"wrapDOM");var rt=class rt extends d{constructor(){super({})}};i(rt,"Flex");var Y=rt;function W(s){return s.toString(16).padStart(2,"0")}i(W,"hx");function Q(s){return Math.round(s)}i(Q,"round");var it=class it{constructor(...e){this.rgb=[0,0,0,1];this.invalid=!1;k(e[0])?this.setValue(e[0]):this.setRgb(e[0],e[1],e[2],e[3])}setValue(e){if(this.invalid=!1,e.length==4&&/#[0-9a-fA-F]{3}/.test(e)){let t=parseInt(e[1],16),o=parseInt(e[2],16),n=parseInt(e[3],16);return this.setRgb(t<<4|t,o<<4|o,n<<4|n,1)}if(e.length==7&&/#[0-9a-fA-F]{6}/.test(e)){let t=parseInt(e[1],16),o=parseInt(e[2],16),n=parseInt(e[3],16),r=parseInt(e[4],16),a=parseInt(e[5],16),l=parseInt(e[6],16);return this.setRgb(t<<4|o,n<<4|r,a<<4|l,1)}if(e.length==9&&/#[0-9a-fA-F]{8}/.test(e)){let t=parseInt(e[1],16),o=parseInt(e[2],16),n=parseInt(e[3],16),r=parseInt(e[4],16),a=parseInt(e[5],16),l=parseInt(e[6],16),c=parseInt(e[7],16),p=parseInt(e[8],16);return this.setRgb(t<<4|o,n<<4|r,a<<4|l,(c<<4|p)/255)}if(e.startsWith("rgba")){let o=/rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*((\d+)|(\d*\.\d+)|(\.\d+))\s*\)/.exec(e);if(o)return this.setRgb(parseInt(o[1]),parseInt(o[2]),parseInt(o[3]),parseFloat(o[4]))}else if(e.startsWith("rgb")){let o=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(e);if(o)return this.setRgb(parseInt(o[1]),parseInt(o[2]),parseInt(o[3]),1)}else if(e.startsWith("var")){let o=/var\s*\(([^)]*)\)/.exec(e);if(o){let n=o[1].trim(),a=getComputedStyle(document.documentElement).getPropertyValue(n);return this.setValue(a)}}return this.invalid=!0,this.setRgb(255,0,0,1)}setHsv(e,t,o,n=1){let r=Math.min(5,Math.floor(e*6)),a=e*6-r,l=o*(1-t),c=o*(1-a*t),p=o*(1-(1-a)*t),x,E,w;switch(r){case 0:x=o,E=p,w=l;break;case 1:x=c,E=o,w=l;break;case 2:x=l,E=o,w=p;break;case 3:x=l,E=c,w=o;break;case 4:x=p,E=l,w=o;break;case 5:x=o,E=l,w=c;break}return this.setRgb(x*255,E*255,w*255,n)}setRgb(e,t,o,n){return this.rgb=[D(e,0,255),D(t,0,255),D(o,0,255),D(n,0,1)],this}toRgbString(e){let t=this.rgb;return e===!1||t[3]==1?`rgb(${Q(t[0])},${Q(t[1])},${Q(t[2])})`:`rgba(${Q(t[0])},${Q(t[1])},${Q(t[2])},${t[3].toFixed(3)})`}toHexString(){let e=this.rgb;return e[3]==1?`#(${W(e[0])},${W(e[1])},${W(e[2])})`:`rgba(${W(e[0])},${W(e[1])},${W(e[2])},${W(e[3]*255)})`}toRgb(){let e=this.rgb;return{red:e[0],green:e[1],blue:e[2],alpha:e[3]}}toHsv(){let e=this.toRgb();e.red/=255,e.green/=255,e.blue/=255;let t=Math.max(e.red,e.green,e.blue),o=Math.min(e.red,e.green,e.blue),n=t-o,r=t===0?0:n/t,a=t,l;if(n===0)l=0;else switch(t){case e.red:l=(e.green-e.blue)/n/6+(e.green<e.blue?1:0);break;case e.green:l=(e.blue-e.red)/n/6+1/3;break;case e.blue:l=(e.red-e.green)/n/6+2/3;break}return{hue:l,saturation:r,value:a,alpha:e.alpha}}getAlpha(){return this.rgb[3]}setAlpha(e){return this.rgb[3]=D(e,0,1),this}isInvalid(){return this.invalid}};i(it,"Color");var M=it;var st=Symbol("x-drag-cb"),lt=class lt{registerDraggableElement(e){e.addDOMEvent("dragstart",t=>{this.dragSource=e,this.dragGhost=e.dom.cloneNode(!0),this.dragGhost.classList.add("dragged"),document.body.appendChild(this.dragGhost),e.addClass("dragging"),t.dataTransfer.setData("text/string","1"),t.dataTransfer.setDragImage(new Image,0,0),t.stopPropagation()}),e.addDOMEvent("drag",t=>{this.dragGhost.style.left=t.pageX+"px",this.dragGhost.style.top=t.pageY+"px"}),e.addDOMEvent("dragend",t=>{e.removeClass("dragging"),this.dragGhost.remove()}),e.setAttribute("draggable","true")}registerDropTarget(e,t,o){let n=i(c=>{if(o&&!o(this.dragSource)){console.log("reject ",e),c.dataTransfer.dropEffect="none";return}console.log("accepted ",e),c.preventDefault(),c.dataTransfer.dropEffect="copy"},"dragEnter"),r=i(c=>{if(o&&!o(this.dragSource)){console.log("reject ",e),c.dataTransfer.dropEffect="none";return}if(c.preventDefault(),this.dropTarget!=e&&(this.dropTarget=e,this._startCheck()),this.dropTarget){let p={pt:{x:c.pageX,y:c.pageY},data:c.dataTransfer};t("drag",this.dragSource,p)}c.dataTransfer.dropEffect="copy"},"dragOver"),a=i(c=>{this.dropTarget=null,c.preventDefault()},"dragLeave"),l=i(c=>{let p={pt:{x:c.pageX,y:c.pageY},data:c.dataTransfer};t("drop",this.dragSource,p),this.dropTarget=null,e.removeClass("drop-over"),c.preventDefault()},"drop");e.addDOMEvent("dragenter",n),e.addDOMEvent("dragover",r),e.addDOMEvent("dragleave",a),e.addDOMEvent("drop",l),e.setInternalData(st,t)}_startCheck(){this.timer&&(clearInterval(this.timer),this._check()),this.timer=setInterval(()=>this._check(),300)}_check(){let e=i(o=>{o.removeClass("drop-over"),o.getInternalData(st)("leave",this.dragSource)},"leaving"),t=i(o=>{o.addClass("drop-over"),o.getInternalData(st)("enter",this.dragSource)},"entering");this.dropTarget?(!this.notified||this.notified!=this.dropTarget)&&(this.notified&&e(this.notified),this.notified=this.dropTarget,t(this.notified)):this.notified&&(e(this.notified),this.notified=null,clearInterval(this.timer))}};i(lt,"DragManager");var at=lt,er=new at;function tr(s,e=!1){if(s instanceof RegExp)return{keys:null,pattern:s};let t=s.split("/"),o=[],n="";t[0]==""&&t.shift();for(let r of t){let a=r[0];if(a==="*")o.push("wild"),n+="/(.*)";else if(a===":"){let l=r.indexOf("?",1),c=r.indexOf(".",1);o.push(r.substring(1,l>=0?l:c>=0?c:r.length)),n+=l>=0&&c<0?"(?:/([^/]+?))?":"/([^/]+?)",c>=0&&(n+=(l>=0?"?":"")+"\\"+r.substring(c))}else n+="/"+r}return{keys:o,pattern:new RegExp(`^${n}${e?"(?=$|/)":"/?$"}`,"i")}}i(tr,"parseRoute");var dt=class dt extends G{constructor(e=!0){super(),this.m_routes=[],this.m_useHash=e,window.addEventListener("popstate",t=>{let o=this._getLocation(),n=this._find(o);n.handlers.forEach(r=>{r(n.params,o)})})}get(e,t){let{keys:o,pattern:n}=tr(e);this.m_routes.push({keys:o,pattern:n,handler:t})}init(){this.navigate(this._getLocation())}_getLocation(){return this.m_useHash?"/"+document.location.hash.substring(1):document.location.pathname}navigate(e,t=!0,o=!1){e.startsWith("/")||(e="/"+e);let n=this._find(e);if(!n||n.handlers.length==0){console.log("route not found: "+e),this.fire("error",{code:404,message:"route not found"});return}if(this.m_useHash){for(;e.at(0)=="/";)e=e.substring(1);e="#"+e}o?window.history.replaceState({},"",e):window.history.pushState({},"",e),t&&n.handlers.forEach(r=>{r(n.params,e)})}_find(e){let t=[],o={},n=[];for(let r of this.m_routes)if(r.keys)if(r.keys.length>0){if(t=r.pattern.exec(e),t===null)continue;for(let a=0;a<r.keys.length;)o[r.keys[a]]=t[++a];n=[...n,r.handler]}else r.pattern.test(e)&&(n=[...n,r.handler]);else{if(t=r.pattern.exec(e),!t)continue;if(t.groups)for(let a in t.groups)o[a]=t.groups[a];n=[...n,r.handler]}return{params:o,handlers:n}}};i(dt,"Router");var ct=dt;var Xo="http://www.w3.org/2000/svg";function or(s){return s*Math.PI/180}i(or,"d2r");function Zo(s,e,t,o){let n=or(o);return{x:s+t*Math.cos(n),y:e+t*Math.sin(n)}}i(Zo,"p2c");function I(s){return Math.round(s*1e3)/1e3}i(I,"num");function pt(s,...e){return e=e.map(t=>typeof t=="number"&&isFinite(t)?I(t):t),String.raw(s,...e)}i(pt,"clean");var mt=class mt{constructor(e){this._dom=document.createElementNS("http://www.w3.org/2000/svg",e)}getDom(){return this._dom}stroke(e,t){return this.setAttr("stroke",e),t!==void 0&&this.setAttr("stroke-width",t+"px"),this}strokeWidth(e){return this.setAttr("stroke-width",e+"px"),this}strokeCap(e){return this.setAttr("stroke-linecap",e)}strokeOpacity(e){return this.setAttr("stroke-opacity",e+"")}antiAlias(e){return this.setAttr("shape-rendering",e?"auto":"crispEdges")}fill(e){return this.setAttr("fill",e),this}no_fill(){return this.setAttr("fill","transparent"),this}setAttr(e,t){return this._dom.setAttribute(e,t),this}setStyle(e,t){let o=this._dom.style;if(B(t)){let n=t+"";Qe(e)||(n+="px"),o[e]=n}else o[e]=t;return this}addClass(e){if(e)if(e.indexOf(" ")>=0){let t=e.split(" ");this._dom.classList.add(...t)}else this._dom.classList.add(e)}clip(e){return this.setAttr("clip-path",`url(#${e})`),this}transform(e){return this.setAttr("transform",e),this}rotate(e,t,o){return this.transform(`rotate( ${e} ${t} ${o} )`),this}translate(e,t){return this.transform(`translate( ${e} ${t} )`),this}scale(e){return this.transform(`scale( ${e} )`),this}addDOMEvent(e,t,o=!1){return le(this._dom,e,t,o),this}};i(mt,"SvgItem");var X=mt,xt=class xt extends X{constructor(){super("path"),this._path=""}_update(){return this.setAttr("d",this._path),this}moveTo(e,t){return this._path+=pt`M${e},${t}`,this._update()}lineTo(e,t){return this._path+=pt`L${e},${t}`,this._update()}closePath(){return this._path+="Z",this._update()}arc(e,t,o,n,r){let a=Zo(e,t,o,n-90),l=Zo(e,t,o,r-90),c=r-n<=180?"0":"1";return this._path+=pt`M${a.x},${a.y}A${o},${o} 0 ${c} 1 ${l.x},${l.y}`,this._update()}};i(xt,"SvgPath");var Ie=xt,bt=class bt extends X{constructor(e,t,o){super("text"),this.setAttr("x",I(e)+""),this.setAttr("y",I(t)+""),this._dom.innerHTML=o}font(e){return this.setAttr("font-family",e)}fontSize(e){return this.setAttr("font-size",e+"")}fontWeight(e){return this.setAttr("font-weight",e)}textAlign(e){let t;switch(e){case"left":t="start";break;case"center":t="middle";break;case"right":t="end";break;default:return this}return this.setAttr("text-anchor",t)}verticalAlign(e){let t;switch(e){case"top":t="hanging";break;case"center":t="middle";break;case"bottom":t="baseline";break;case"baseline":t="mathematical";break;default:return}return this.setAttr("alignment-baseline",t)}};i(bt,"SvgText");var Me=bt,gt=class gt extends X{constructor(e){super(e)}};i(gt,"SvgShape");var de=gt,ee=class ee extends X{constructor(e,t,o,n){super("linearGradient"),this._id="gx-"+ee.g_id,ee.g_id++,this.setAttr("id",this._id),this.setAttr("x1",k(e)?e:I(e)+""),this.setAttr("x2",k(o)?o:I(o)+""),this.setAttr("y1",k(t)?t:I(t)+""),this.setAttr("y2",k(n)?n:I(n)+""),this._stops=[]}get id(){return"url(#"+this._id+")"}addStop(e,t){return this._dom.insertAdjacentHTML("beforeend",`<stop offset="${e}%" stop-color="${t}"></stop>`),this}};i(ee,"SvgGradient"),ee.g_id=1;var Pe=ee,Te=class Te extends X{constructor(e="g"){super(e)}append(e){return this._dom.appendChild(e.getDom()),e}path(){let e=new Ie;return this.append(e)}text(e,t,o){let n=new Me(e,t,o);return this.append(n)}ellipse(e,t,o,n=o){let r=new de("ellipse");return r.setAttr("cx",I(e)+""),r.setAttr("cy",I(t)+""),r.setAttr("rx",I(o)+""),r.setAttr("ry",I(n)+""),this.append(r)}rect(e,t,o,n){n<0&&(t=t+n,n=-n);let r=new de("rect");return r.setAttr("x",I(e)+""),r.setAttr("y",I(t)+""),r.setAttr("width",I(o)+""),r.setAttr("height",I(n)+""),this.append(r)}group(){let e=new Te;return this.append(e)}linear_gradient(e,t,o,n){let r=new Pe(e,t,o,n);return this.append(r)}clear(){let e=this._dom;for(;e.firstChild;)e.removeChild(e.firstChild)}};i(Te,"SvgGroup");var pe=Te,ce=class ce extends pe{constructor(){super()}addClip(e,t,o,n){let r="c-"+ce.g_clip_id++,a=new pe("clipPath");return a.setAttr("id",r),a.rect(e,t,o,n),this.append(a),r}};i(ce,"SvgBuilder"),ce.g_clip_id=1;var ht=ce,ft=class ft extends d{constructor(e){super({...e,tag:"svg",ns:Xo}),this.setAttribute("xmlns",Xo),e.viewbox&&this.setAttribute("viewbox",e.viewbox),e.svg&&this.dom.appendChild(e.svg.getDom())}};i(ft,"SvgComponent");var ut=ft;var _t=class _t extends d{};i(_t,"Box");var y=_t,vt=class vt extends y{};i(vt,"HBox");var h=vt,wt=class wt extends y{constructor(e){super(e)}};i(wt,"VBox");var f=wt,yt=class yt extends y{constructor(e){var t;super(e),this._items=(t=e.items)==null?void 0:t.map(o=>({...o,page:null})),e.default?this.select(e.default):this._items.length&&this.select(this._items[0].name)}select(e){let t=this.query(".selected");t&&t.setClass("selected",!1);let o=this._items.find(n=>n.name==e);o&&(o.page||(o.page=this._createPage(o),this.appendContent(o.page)),t=o.page,t&&t.setClass("selected",!0))}_createPage(e){let t;return t=e.content,t==null||t.setData("stackname",e.name),t}};i(yt,"StackBox");var he=yt;var Et=class Et{constructor(){this.cache=new Map,this.waiters=new Map}async load(e){return this.cache.has(e)?Promise.resolve(this.cache.get(e)):new Promise((t,o)=>{this.waiters.has(e)?this.waiters.get(e).push(t):(this.waiters.set(e,[t]),this._load(e).then(n=>{console.timeEnd(e),this.cache.set(e,n),this.waiters.get(e).forEach(a=>a(n))}))})}async _load(e){console.time(e);let t=await fetch(e);if(t.ok)return t.text()}};i(Et,"SvgLoader");var Ct=Et,De=new Ct,kt=class kt extends d{constructor(e){super(e),this.setIcon(e.iconId)}setIcon(e){if(e){if(e.startsWith("var:"))do{let t=e.substring(4);e=document.documentElement.style.getPropertyValue(t)}while(e.startsWith("var:"));e.startsWith("data:image/svg+xml,<svg")?this.dom.insertAdjacentHTML("beforeend",e.substring(19)):e.endsWith(".svg")?De.load(e).then(t=>{this.clearContent(),this.dom.insertAdjacentHTML("beforeend",t)}):this.setContent(new d({tag:"img",attrs:{src:e}}))}else this.clearContent(),this.addClass("empty")}};i(kt,"Icon");var _=kt;var It=class It extends d{constructor(e){super({...e,tag:"button",content:null}),this.mapPropEvents(e,"click"),this.addDOMEvent("click",t=>this._on_click(t)),this.setContent([new _({id:"icon",iconId:this.props.icon}),new d({id:"label",content:this.props.label})])}_on_click(e){this.fire("click",{}),e.preventDefault(),e.stopPropagation()}setText(e){this.query("#label").setContent(e)}setIcon(e){this.query("#icon").setIcon(e)}};i(It,"Button");var v=It;var Mt=class Mt extends y{constructor(e){super(e),e.align&&this.addClass("align-"+e.align),this.addClass(e.vertical?"x4vbox":"x4hbox"),e.items&&this.setButtons(e.items),this.mapPropEvents(e,"btnclick")}setButtons(e){this.clearContent();let t=[];e==null||e.forEach(o=>{if(o==="-")o=new Y;else if(k(o)){let n,r=o;switch(o){case"ok":n=m.global.ok;break;case"cancel":n=m.global.cancel;break;case"abort":n=m.global.abort;break;case"no":n=m.global.no;break;case"yes":n=m.global.yes;break;case"retry":n=m.global.retry;break}o=new v({label:n,click:i(()=>{this.fire("btnclick",{button:r})},"click")})}t.push(o)}),super.setContent(t)}};i(Mt,"BtnGroup");var ue=Mt;var Pt=class Pt extends d{constructor(e){var t;super({...e,content:null}),this.setContent([new _({id:"icon",iconId:this.props.icon}),new d({tag:"span",id:"text",content:(t=this.props.text)!=null?t:e.content})]),e.labelFor&&this.setAttribute("for",e.labelFor)}setText(e){this.query("#text").setContent(e)}setIcon(e){this.query("#icon").setIcon(e)}};i(Pt,"Label");var u=Pt;var Tt=class Tt extends d{constructor(e,t){super({}),this._type=e,this.addClass(e),this.addDOMEvent("pointerdown",o=>{this.setCapture(o.pointerId),this._ref=t!=null?t:g(this.dom.parentElement),this._delta={x:0,y:0};let n=this._ref.getBoundingRect();this._type.includes("left")?this._delta.x=o.pageX-n.left:this._delta.x=o.pageX-(n.left+n.width),this._type.includes("top")?this._delta.y=o.pageY-n.top:this._delta.y=o.pageY-(n.top+n.height)}),this.addDOMEvent("pointerup",o=>{this.releaseCapture(o.pointerId),this._ref=null}),this.addDOMEvent("pointermove",o=>{this._onMouseMove(o)})}_onMouseMove(e){if(!this._ref)return;let t={x:e.pageX-this._delta.x,y:e.pageY-this._delta.y},o=this._ref.getBoundingRect(),n={},r=!0;this._type.includes("top")&&(n.top=t.y,n.height=o.top+o.height-t.y,r=!1),this._type.includes("bottom")&&(n.height=t.y-o.top,r=!1),this._type.includes("left")&&(n.left=t.x,n.width=o.left+o.width-t.x),this._type.includes("right")&&(n.width=t.x-o.left),this._ref.setStyle(n);let a=this._ref.getBoundingRect();this.fire("resize",{size:r?a.width:a.height}),e.preventDefault(),e.stopPropagation()}};i(Tt,"CSizer");var P=Tt;var te,Jo=0,Qo=[],A=[],Dt=[],St=class St extends d{constructor(t){super(t);this._isopen=!1;this._isshown=!1;this._dismiss=i(t=>{A.some(n=>n.dom.contains(t.target))||(t.preventDefault(),t.stopPropagation(),this.dismiss())},"_dismiss");this.props.sizable&&this._createSizers()}displayNear(t,o="top left",n="top left",r={x:0,y:0}){this.setStyle({left:"0px",top:"0px"}),this._show();let a=this.getBoundingRect(),l=t.left,c=t.top;n.indexOf("right")>=0?l=t.left+t.width:n.indexOf("center")>=0&&(l=t.left+t.width/2),n.indexOf("bottom")>=0?c=t.bottom:n.indexOf("middle")>=0&&(c=t.top+t.height/2);let p="l";o.indexOf("right")>=0?l-=a.width:o.indexOf("center")>=0&&(l-=a.width/2);let x="t";o.indexOf("bottom")>=0?c-=a.height:o.indexOf("middle")>=0&&(c-=a.height/2),r&&(l+=r.x,c+=r.y),l+=document.scrollingElement.scrollLeft,c+=document.scrollingElement.scrollTop,this.displayAt(l,c)}displayCenter(){this.displayNear(new z(window.innerWidth/2,window.innerHeight/2,0,0),"center middle")}displayAt(t,o){this.setStyle({left:t+"px",top:o+"px"}),this._show();let n=this.getBoundingRect(),r=window.innerWidth-16,a=window.innerHeight-16;n.right>r&&this.setStyleValue("left",r-n.width),n.bottom>a&&this.setStyleValue("top",a-n.height),this.props.movable&&(this.queryAll(".caption-element").forEach(c=>new Se(c,this)),this.hasClass("popup-caption")&&new Se(this,this)),this.fire("opened",{})}_show(){this.props.modal&&!this._isshown&&(this._showModalMask(),Qo.push(this),Jo++),this._isshown=!0,this.props.autoClose&&(A.length==0&&document.addEventListener("pointerdown",this._dismiss),A.push(this),this.setData("close",this.props.autoClose===!0?L():this.props.autoClose)),Dt.push(this),document.body.appendChild(this.dom),this.show()}show(t=!0){this._isopen=t,super.show(t)}isOpen(){return this._isopen}close(){document.body.removeChild(this.dom);let t=Dt.indexOf(this);if(console.assert(t>=0),Dt.splice(t,1),this.props.autoClose){let o=A.indexOf(this);o>=0&&(A.splice(o,1),A.length==0&&document.removeEventListener("pointerdown",this._dismiss))}if(this.props.modal){let o=Qo.pop();console.assert(o==this),this._updateModalMask()}this._isshown=!1,this.fire("closed",{})}dismiss(t=!1){if(A.length==0)return;let o=this.getData("close"),n=[],r=[],a=-1;t&&(a=A.indexOf(this)),A.forEach((c,p)=>{c.getData("close")==o&&p>a?n.push(c):r.push(c)});let l=n.reverse();A=r,A.length==0&&document.removeEventListener("pointerdown",this._dismiss),l.forEach(c=>c.close())}_showModalMask(){te||(te=new d({cls:"x4modal-mask",domEvents:{click:this._dismiss}})),te.show(!0),document.body.insertAdjacentElement("beforeend",te.dom)}_updateModalMask(){--Jo==0?te.show(!1):this.dom.insertAdjacentElement("beforebegin",te.dom)}_createSizers(){this.appendContent([new P("top"),new P("bottom"),new P("left"),new P("right"),new P("top-left"),new P("bottom-left"),new P("top-right"),new P("bottom-right")])}};i(St,"Popup");var T=St,Lt=class Lt{constructor(e,t){this.self=!!t,e.addDOMEvent("pointerdown",o=>{if(this.self&&o.target!=e.dom)return;e.setCapture(o.pointerId),this.ref=t!=null?t:g(e.dom.parentElement),this.delta={x:0,y:0};let n=this.ref.getBoundingRect();this.delta.x=o.pageX-n.left,this.delta.y=o.pageY-n.top}),e.addDOMEvent("pointerup",o=>{e.releaseCapture(o.pointerId),this.ref=null}),e.addDOMEvent("pointermove",o=>{this._onMouseMove(o)})}_onMouseMove(e){if(!this.ref)return;let t={x:e.pageX-this.delta.x,y:e.pageY-this.delta.y},o=this.ref.getBoundingRect(),n={};this.ref.setStyle({top:t.y+"",left:t.x+""}),e.preventDefault(),e.stopPropagation()}};i(Lt,"CMover");var Se=Lt;var en=400,Rt=class Rt extends d{constructor(){super({})}};i(Rt,"CMenuSep");var At=Rt,Le=new $,Ot=class Ot extends d{constructor(e){super({disabled:e.disabled,cls:e.cls}),e.menu&&this.addClass("popup"),this.setContent([new _({id:"icon",iconId:e.icon}),new d({id:"text",content:e.text})]),e.menu?(this.menu=e.menu,this.addDOMEvent("mouseenter",()=>this.openSub(!0)),this.addDOMEvent("click",()=>this.openSub(!1)),this.addDOMEvent("mouseleave",()=>this.closeSub()),this.menu.on("opened",()=>this.addClass("opened")),this.menu.on("closed",()=>this.removeClass("opened"))):(this.addDOMEvent("mouseenter",()=>{Le.setTimeout("open",en,()=>{this.dismiss(!0)})}),this.addDOMEvent("click",()=>{this.dismiss(!1),e.click&&e.click(new Event("click"))}))}dismiss(e){let t=this.parentElement(oe);t&&t.dismiss(e)}openSub(e){let t=i(()=>{this.dismiss(!0);let o=this.getBoundingRect();this.menu.displayAt(o.right-4,o.top)},"open");e?Le.setTimeout("open",en,t):(Le.clearTimeout("open"),t())}closeSub(){Le.clearTimeout("open")}};i(Ot,"CMenuItem");var Ae=Ot,zt=class zt extends T{constructor(e){var o;super({...e,autoClose:"menu",modal:!1}),this.addClass("x4vbox");let t=(o=e.items)==null?void 0:o.map(n=>n==="-"?new At:k(n)?new Ae({text:n,click:null,cls:"title"}):n instanceof d?n:new Ae(n));this.setContent(t)}};i(zt,"Menu");var oe=zt;var tn='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512" fill="currentColor"><!--!Font Awesome Pro 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path d="M9.4 256l11.3-11.3 192-192L224 41.4 246.6 64 235.3 75.3 54.6 256 235.3 436.7 246.6 448 224 470.6l-11.3-11.3-192-192L9.4 256z"/></svg>';var on='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" fill="currentColor"><!--!Font Awesome Pro 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path d="M128 16l0-16L96 0l0 16 0 48L32 64 0 64 0 96l0 64 0 32L0 480l0 32 32 0 384 0 32 0 0-32 0-288 0-32 0-64 0-32-32 0-64 0 0-48 0-16L320 0l0 16 0 48L128 64l0-48zM32 192l384 0 0 288L32 480l0-288zm0-96l384 0 0 64L32 160l0-64zM331.3 283.3L342.6 272 320 249.4l-11.3 11.3L208 361.4l-52.7-52.7L144 297.4 121.4 320l11.3 11.3 64 64L208 406.6l11.3-11.3 112-112z"/></svg>';var nn='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512" fill="currentColor"><!--!Font Awesome Pro 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path d="M310.6 256l-11.3 11.3-192 192L96 470.6 73.4 448l11.3-11.3L265.4 256 84.7 75.3 73.4 64 96 41.4l11.3 11.3 192 192L310.6 256z"/></svg>';var Bt=class Bt extends f{constructor(e){super(e),this.mapPropEvents(e,"change"),this.m_date=e.date?K(e.date):new Date,this._update()}_update(){let e=K(this.m_date);e.setDate(1);let t=e.getDay();t==0&&(t=7),e.setDate(-t+1+1);let o=K(e),n=N(this.m_date),r=N(new Date),a=K(this.m_date);a.setDate(1),a.setMonth(a.getMonth()+1),a.setDate(0);let l=N(a),c=[],p=new h({cls:"month-sel",content:[new u({cls:"month",text:H(this.m_date,"O"),dom_events:{click:i(()=>this._choose("month"),"click")}}),new u({cls:"year",text:H(this.m_date,"Y"),dom_events:{click:i(()=>this._choose("year"),"click")}}),new Y,new v({icon:tn,click:i(()=>this._next(!1),"click")}),new v({icon:on,click:i(()=>this.setDate(new Date),"click"),tooltip:m.global.today}),new v({icon:nn,click:i(()=>this._next(!0),"click")})]});c.push(p);let x=[];x.push(new h({cls:"weeknum cell"}));for(let b=0;b<7;b++)x.push(new u({cls:"cell",text:m.global.day_short[(b+1)%7]}));c.push(new h({cls:"week header",content:x}));let E=this.m_date.getMonth(),w=!0;for(;N(o)<=l;){let b=[new h({cls:"weeknum cell",content:new d({tag:"span",content:H(o,"w")})})];for(let ne=0;ne<7;ne++){let U="cell day";N(o)==n&&(U+=" selection"),N(o)==r&&(U+=" today"),o.getMonth()!=E&&(U+=" out");let V=i(_e=>new h({cls:U,flex:1,content:new d({cls:"text",content:re(`<span>${H(_e,"d")}</span>`)}),dom_events:{click:i(()=>this.select(_e),"click")}}),"mkItem");b.push(V(K(o))),o.setDate(o.getDate()+1),w=!1}c.push(new h({cls:"week",flex:1,content:b}))}this.setContent(c)}select(e){this.m_date=e,this.fire("change",{value:e}),this._update()}_next(e){this.m_date.setMonth(this.m_date.getMonth()+(e?1:-1)),this._update()}_choose(e){var r,a,l,c;let t=[];if(e=="month")for(let p=0;p<12;p++)t.push({text:m.global.month_long[p],click:i(()=>{this.m_date.setMonth(p),this._update()},"click")});else if(e=="year"){let p=(a=(r=this.props.minDate)==null?void 0:r.getFullYear())!=null?a:1900,x=(c=(l=this.props.maxDate)==null?void 0:l.getFullYear())!=null?c:2037;for(let E=x;E>=p;E--)t.push({text:""+E,click:i(()=>{this.m_date.setFullYear(E),this._update()},"click")})}let o=new oe({items:t}),n=this.getBoundingRect();o.displayAt(n.left,n.top)}getDate(){return this.m_date}setDate(e){this.m_date=e,this._update()}};i(Bt,"Calendar");var Ht=Bt;var Nt=class Nt extends d{constructor(e){var t;switch(super({tag:"input",...e}),this.setAttribute("type",(t=e.type)!=null?t:"text"),this.setAttribute("name",e.name),e.type){case"checkbox":case"radio":{let o=this.dom;o.checked=e.checked,o.value=e.value+"";break}case"range":{this.setAttribute("min",e.min),this.setAttribute("max",e.max),this.setAttribute("step",e.step),this.setAttribute("value",e.value);break}case"number":{this.setAttribute("required",e.required),this.setAttribute("readonly",e.readonly),this.setAttribute("min",e.min),this.setAttribute("max",e.max),this.setAttribute("step",e.step),this.setAttribute("value",e.value+"");break}case"date":{this.setAttribute("required",e.required);let o=e.value;o instanceof Date||this.setAttribute("value",o);break}case"file":{let o;Array.isArray(e.accept)?o=e.accept.join(","):o=e.accept,this.setAttribute("accept",o);break}default:{this.setAttribute("required",e.required),this.setAttribute("readonly",e.readonly),e.value!==null&&e.value!==void 0&&this.setAttribute("value",e.value),e.pattern!==null&&e.pattern!==void 0&&this.setAttribute("pattern",e.pattern),e.placeholder!==null&&e.placeholder!==void 0&&this.setAttribute("placeholder",e.placeholder),e.spellcheck===!1&&this.setAttribute("spellcheck",!1);break}}}getValue(){return this.dom.value}setValue(e){this.dom.value=e+""}getNumValue(){return parseFloat(this.getValue())}setNumValue(e){this.setValue(e+"")}setReadOnly(e){let t=this.dom;t.readOnly=e}selectAll(){this.dom.select()}select(e,t=9999){this.dom.setSelectionRange(e,e+t)}getSelection(){let e=this.dom;return{start:e.selectionStart,length:e.selectionEnd-e.selectionStart}}queryInterface(e){return e=="form-element"?{getRawValue:i(()=>this.getValue(),"getRawValue"),setRawValue:i(o=>{this.setValue(o)},"setRawValue")}:super.queryInterface(e)}};i(Nt,"Input");var C=Nt;var rn='data:image/svg+xml,<svg viewBox="0 0 10 7" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">%0A%09<path d="M4 4.586L1.707 2.293A1 1 0 1 0 .293 3.707l3 3a.997.997 0 0 0 1.414 0l5-5A1 1 0 1 0 8.293.293L4 4.586z" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd">%0A%09</path>%0A</svg>';var Ut=class Ut extends d{constructor(e){super(e);let t=L();this.mapPropEvents(e,"change"),this.setContent([new d({cls:"inner",content:[this._input=new C({type:"checkbox",id:t,checked:e.checked,dom_events:{change:i(()=>this._on_change(),"change")}})]}),new u({tag:"label",text:e.label,labelFor:t,id:void 0})]),De.load(rn).then(o=>{this.query(".inner").dom.insertAdjacentHTML("beforeend",o)})}_on_change(){this.fire("change",{value:this.getCheck()})}getCheck(){return this._input.dom.checked}setCheck(e){let t=this._input.dom;t.checked=e}setLabel(e){this.query("label").setText(e)}toggle(){this.setCheck(!this.getCheck())}};i(Ut,"Checkbox");var Ft=Ut;var sn='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor"><!--!Font Awesome Pro 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path d="M479.4 240L384 240l-16 0 0 32 16 0 95.4 0C471.6 383 383 471.6 272 479.4l0-95.4 0-16-32 0 0 16 0 95.4C129 471.6 40.4 383 32.6 272l95.4 0 16 0 0-32-16 0-95.4 0C40.4 129 129 40.4 240 32.6l0 95.4 0 16 32 0 0-16 0-95.4C383 40.4 471.6 129 479.4 240zM256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512z"/></svg>';var qt=class qt extends h{constructor(e){super(e);let t,o;this.setContent([t=new d({cls:"swatch"}),o=new C({type:"text",value:"",spellcheck:!1}),ie("eyedropper")?new v({icon:sn,click:i(()=>{new window.EyeDropper().open().then(l=>{r=new M(l.sRGBHex),n(r)})},"click")}):null]),o.addDOMEvent("input",()=>{let a=o.getValue(),l=new M(a);l.isInvalid()||(r=l,n(r))});let n=i(a=>{t.setStyleValue("backgroundColor",a.toRgbString(!1)),o.setValue(a.toRgbString(!1))},"updateColor"),r;e.color instanceof M?r=e.color:r=new M(e.color),n(r)}};i(qt,"ColorInput");var Vt=qt;var jt=class jt extends y{constructor(t,o){super(t);this.mdown=!1;this.hsv={hue:1,saturation:1,value:1,alpha:1};this.setContent([this.color=new d({cls:"overlay"}),new d({cls:"overlay",style:{backgroundImage:"linear-gradient(90deg, rgb(255, 255, 255), transparent)"}}),new d({cls:"overlay",style:{backgroundImage:"linear-gradient(0deg, rgb(0, 0, 0), transparent)"}}),this.thumb=new d({cls:"thumb"})]),this.setDOMEvents({pointerdown:i(n=>this.mousedown(n),"pointerdown"),pointermove:i(n=>this.mousemove(n),"pointermove"),pointerup:i(n=>this.mouseup(n),"pointerup"),created:i(()=>this.updateThumbMarker(),"created")}),this.updateBaseColor(o)}mousedown(t){this.mdown=!0,this.irect=this.getBoundingRect(),this.setCapture(t.pointerId)}mousemove(t){if(this.mdown){let o=this.irect,r=D(t.clientX-o.left,0,o.width)/o.width,l=D(t.clientY-o.top,0,o.height)/o.height;this.hsv.saturation=r,this.hsv.value=1-l,this.updateThumbMarker(),this.fire("sat_change",{saturation:this.hsv.saturation,value:this.hsv.value})}}mouseup(t){this.mdown&&(this.releaseCapture(t.pointerId),this.mdown=!1)}updateThumbMarker(){let t=this.color.getBoundingRect();this.thumb.setStyle({left:this.hsv.saturation*t.width+"px",bottom:this.hsv.value*t.height+"px"})}updateBaseColor(t){let o=new M(0,0,0);o.setHsv(t.hue,1,1,1),this.color.setStyleValue("backgroundColor",o.toRgbString(!1))}move(t,o){switch(t){case"saturation":{this.hsv.saturation+=o,this.hsv.saturation<0?this.hsv.saturation=0:this.hsv.saturation>1&&(this.hsv.saturation=1),this.fire("sat_change",{saturation:this.hsv.saturation,value:this.hsv.value}),this.updateThumbMarker();break}case"value":{this.hsv.value+=o,this.hsv.value<0?this.hsv.value=0:this.hsv.value>1&&(this.hsv.value=1),this.fire("sat_change",{saturation:this.hsv.saturation,value:this.hsv.value}),this.updateThumbMarker();break}}}};i(jt,"Saturation");var Re=jt,Yt=class Yt extends y{constructor(t,o){super(t);this.hsv={hue:1,saturation:1,value:1,alpha:1};this.mdown=!1;this.setContent([this.thumb=new d({cls:"thumb",left:"50%"})]),this.setDOMEvents({pointerdown:i(n=>this.mousedown(n),"pointerdown"),pointermove:i(n=>this.mousemove(n),"pointermove"),pointerup:i(n=>this.mouseup(n),"pointerup")}),this.updateHue(o)}mousedown(t){this.mdown=!0,this.irect=this.getBoundingRect(),this.setCapture(t.pointerId)}mousemove(t){if(this.mdown){let o=this.irect,r=D(t.clientX-o.left,0,o.width)/o.width;this.hsv.hue=r,this.updateHue(this.hsv),this.fire("hue_change",{hue:this.hsv.hue})}}mouseup(t){this.mdown&&(this.releaseCapture(t.pointerId),this.mdown=!1)}updateHue(t){this.hsv.hue=t.hue,this.thumb.setStyleValue("left",t.hue*100+"%")}move(t){this.hsv.hue+=t,this.hsv.hue<0?this.hsv.hue=0:this.hsv.hue>1&&(this.hsv.hue=1),this.fire("hue_change",{hue:this.hsv.hue}),this.updateHue(this.hsv)}};i(Yt,"HueSlider");var $t=Yt,Wt=class Wt extends y{constructor(t,o){super(t);this.hsv={hue:1,saturation:1,value:1,alpha:1};this.mdown=!1;this.setContent([new d({cls:"overlay checkers"}),this.color=new d({cls:"overlay color"}),this.thumb=new d({cls:"thumb",left:"50%"})]),this.setDOMEvents({pointerdown:i(n=>this._on_mousedown(n),"pointerdown"),pointermove:i(n=>this._on_mousemove(n),"pointermove"),pointerup:i(n=>this._on_mouseup(n),"pointerup")}),this.updateAlpha(),this.updateBaseColor(o)}_on_mousedown(t){this.mdown=!0,this.irect=this.getBoundingRect(),this.setCapture(t.pointerId)}_on_mousemove(t){if(this.mdown){let o=this.irect,r=D(t.clientX-o.left,0,o.width)/o.width;this.hsv.alpha=r,this.updateAlpha(),this.fire("alpha_change",{alpha:this.hsv.alpha})}}_on_mouseup(t){this.mdown&&(this.releaseCapture(t.pointerId),this.mdown=!1)}updateAlpha(){this.thumb.setStyleValue("left",this.hsv.alpha*100+"%")}updateBaseColor(t){let o=new M(0,0,0);o.setHsv(t.hue,t.saturation,t.value,1),this.color.setStyleValue("backgroundImage",`linear-gradient(90deg, transparent, ${o.toRgbString(!1)})`)}setColor(t){this.hsv=t,this.updateBaseColor(t),this.updateAlpha()}move(t){this.hsv.alpha+=t,this.hsv.alpha<0?this.hsv.alpha=0:this.hsv.alpha>1&&(this.hsv.alpha=1),this.fire("alpha_change",{alpha:this.hsv.alpha}),this.updateAlpha()}};i(Wt,"AlphaSlider");var Kt=Wt,Xt=class Xt extends f{constructor(e){super(e),e.color instanceof M?this._base=e.color:this._base=new M(e.color);let t=this._base.toHsv();this.setAttribute("tabindex",0),this.setContent([this._sat=new Re({},t),new h({cls:"body",content:[new f({cls:"x4flex",content:[this._hue=new $t({},t),this._alpha=new Kt({},t)]}),new y({cls:"swatch",content:[new d({cls:"overlay checkers"}),this._swatch=new d({cls:"overlay"})]})]})]),this._sat.on("sat_change",n=>{t.saturation=n.saturation,t.value=n.value,o(),this._alpha.updateBaseColor(t)}),this._hue.on("hue_change",n=>{t.hue=n.hue,this._sat.updateBaseColor(t),this._alpha.updateBaseColor(t),o()}),this._alpha.on("alpha_change",n=>{t.alpha=n.alpha,o()});let o=i(()=>{this._base.setHsv(t.hue,t.saturation,t.value,t.alpha),this._swatch.setStyleValue("backgroundColor",this._base.toRgbString()),this._swatch.setAttribute("tooltip",this._base.toRgbString()),this.fire("change",{color:this._base})},"updateColor");ie("eyedropper")&&this._swatch.addDOMEvent("click",n=>{new window.EyeDropper().open().then(a=>{t=new M(a.sRGBHex).toHsv(),this._alpha.setColor(t),this._sat.updateBaseColor(t),this._hue.updateHue(t),o()})}),this.addDOMEvent("keydown",n=>this._onkey(n)),o()}_onkey(e){switch(e.key){case"ArrowLeft":{e.ctrlKey?this._hue.move(-.01):this._sat.move("saturation",-.01);break}case"ArrowRight":{e.ctrlKey?this._hue.move(.01):this._sat.move("saturation",.01);break}case"ArrowUp":{e.ctrlKey?this._alpha.move(.01):this._sat.move("value",.01);break}case"ArrowDown":{e.ctrlKey?this._alpha.move(-.01):this._sat.move("value",-.01);break}}}};i(Xt,"ColorPicker");var Gt=Xt;var Zt=class Zt extends d{constructor(e){super(e)}};i(Zt,"Viewport");var Oe=Zt,Jt=class Jt extends d{constructor(e){super(e),this.setContent(new Oe({}))}getViewport(){return this.firstChild()}};i(Jt,"ScrollView");var me=Jt;var Qt=(n=>(n[n.first=0]="first",n[n.prev=1]="prev",n[n.next=2]="next",n[n.last=3]="last",n))(Qt||{}),eo=class eo extends d{constructor(t){super({...t});this.preventFocus=!1;this.setAttribute("tabindex",0);let o=new me({cls:"body"});this._view=o.getViewport(),this.setContent([o]),this.setDOMEvents({click:i(n=>this._on_click(n),"click"),keydown:i(n=>this._on_key(n),"keydown"),dblclick:i(n=>this._on_click(n),"dblclick"),contextmenu:i(n=>this._on_ctx_menu(n),"contextmenu")}),t.items&&this.setItems(t.items)}_on_key(t){if(!this.isDisabled()){switch(t.key){case"ArrowDown":{this.navigate(2);break}case"ArrowUp":{this.navigate(1);break}case"Home":{this.navigate(0);break}case"End":{this.navigate(3);break}default:return}t.preventDefault(),t.stopPropagation()}}navigate(t){this._selitem||(t==2?t=0:t=3);let o=i((n,r)=>{for(;n&&!n.isVisible();)n=r?n.nextElement():n.prevElement();return n},"next_visible");if(t==0||t==3){let n=t==0?this._view.firstChild():this._view.lastChild();if(n=o(n,t==0),n){let r=n.getData("id");return this._selectItem(r,n),!0}}else{let n=t==2?this._selitem.nextElement():this._selitem.prevElement();if(n=o(n,t==2),n){let r=n.getData("id");return this._selectItem(r,n),!0}}return!1}_on_click(t){t.stopImmediatePropagation(),t.preventDefault();let o=t.target;for(;o&&o!=this.dom;){let n=g(o);if(n&&n.hasClass("x4item")){let r=n.getData("id"),a={context:r};t.type=="click"?this.fire("click",a):this.fire("dblClick",a),a.defaultPrevented||this._selectItem(r,n);return}o=o.parentElement}this.clearSelection()}_on_ctx_menu(t){t.preventDefault();let o=t.target;for(;o&&o!=this.dom;){let n=g(o);if(n&&n.hasClass("x4item")){let r=n.getData("id");this._selectItem(r,n),this.fire("contextMenu",{uievent:t,context:r});return}o=o.parentElement}this.fire("contextMenu",{uievent:t,context:null})}_selectItem(t,o){this._selitem&&(this._selitem.removeClass("selected"),this._selitem=void 0),this._selitem=o,this._selection=t,o&&(o.addClass("selected"),o.scrollIntoView({behavior:"smooth",block:"nearest"}));let n=this._findItem(t);this.fire("selectionChange",{selection:n})}_findItem(t){return this._items.find(o=>o.id==t)}_findItemIndex(t){return this._items.findIndex(o=>o.id==t)}clearSelection(){this._selitem&&(this._selitem.removeClass("selected"),this._selitem=void 0),this._selection=void 0,this.fire("selectionChange",{selection:void 0})}setItems(t){if(this.clearSelection(),this._view.clearContent(),this._items=t,t){let o=t.map(n=>this.renderItem(n));this._view.setContent(o)}}renderItem(t){var r;let n=((r=this.props.renderer)!=null?r:this.defaultRenderer)(t);return n.addClass("x4item"),n.setData("id",t.id+""),n}defaultRenderer(t){return new h({cls:t.cls,content:new u({icon:t.iconId,text:t.text})})}filter(t){let o=this._view.enumChildComponents(!1);if(!t)o.forEach(n=>n.show(!0));else{let n=this._items.filter(r=>r.text.includes(t)).map(r=>r.id+"");o.forEach(r=>{r.show(n.includes(r.getData("id")))})}}appendItem(t,o=!1,n=!0){n&&this.clearSelection();let r=this.renderItem(t);o?(this._items.unshift(t),this._view.prependContent(r)):(this._items.push(t),this._view.appendContent(r)),n&&this._selectItem(t.id,r)}updateItem(t,o){var l;let n=this._findItemIndex(t);if(n<0)return;let r=!1;this._selection&&this._selection===t&&(r=!0),this._items[n]=o;let a=(l=this.query(`[data-id="${o.id}"]`))==null?void 0:l.dom;if(a){let c=this.renderItem(o);this._view.dom.replaceChild(c.dom,a),r&&this._selectItem(o.id,c)}}};i(eo,"Listbox");var xe=eo;var an='data:image/svg+xml,<svg viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg">%0A%09<path d="M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd">%0A%09</path>%0A</svg>';var no=class no extends T{constructor(e,t){super(e),this._list=new xe({items:e.items}),this.setContent(this._list),this.addDOMEvent("mousedown",o=>{console.log("trap"),o.stopImmediatePropagation(),o.stopPropagation(),o.preventDefault()},!0),this._list.on("selectionChange",o=>{this.fire("selectionChange",o)})}getList(){return this._list}};i(no,"Dropdown");var to=no,ro=class ro extends d{constructor(t){super(t);this._prevent_close=!1;let o=L();this.setContent([new h({id:"label",content:new u({tag:"label",text:t.label,labelFor:o,width:t.labelWidth})}),this._edit=new h({id:"edit",content:[this._input=new C({type:"text",value:"",readonly:t.readonly}),this._button=new v({icon:an})]})]),this._dropdown=new to({items:t.items}),this._dropdown.on("selectionChange",n=>{let r=n.selection;this._input.setValue(r?r.text:""),this._prevent_close||this._dropdown.show(!1)}),this._button.addDOMEvent("click",()=>this._on_click()),this._input.addDOMEvent("input",()=>this._on_input()),this._input.addDOMEvent("keydown",n=>this._on_key(n)),this.setDOMEvents({focusout:i(()=>this._on_focusout(),"focusout"),click:i(()=>this._on_click(),"click")})}_on_key(t){switch(t.key){case"Enter":case"Escape":{this._dropdown.show(!1);break}case"ArrowUp":this._prevent_close=!0,this._dropdown.isOpen()?this._dropdown.getList().navigate(1):this.showDropDown(),this._prevent_close=!1;break;case"ArrowDown":this._prevent_close=!0,this._dropdown.isOpen()?this._dropdown.getList().navigate(2):this.showDropDown(),this._prevent_close=!1;break;default:return}t.preventDefault(),t.stopPropagation()}_on_input(){this._dropdown.isOpen()||this.showDropDown(),this._dropdown.getList().filter(this._input.getValue())}_on_focusout(){this._dropdown.show(!1)}_on_click(){this.showDropDown()}showDropDown(){if(this.isDisabled())return;let t=this._edit.getBoundingRect();this._dropdown.setStyleValue("width",t.width+"px"),this._dropdown.displayNear(t,"top left","bottom left",{x:0,y:6})}};i(ro,"Combobox");var oo=ro;var ln='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512" fill="currentColor"><!--!Font Awesome Pro 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path d="M192 233.4L59.5 100.9 36.9 123.5 169.4 256 36.9 388.5l22.6 22.6L192 278.6 324.5 411.1l22.6-22.6L214.6 256 347.1 123.5l-22.6-22.6L192 233.4z"/></svg>';var io=class io extends T{constructor(e){super(e),this.appendContent([new h({cls:"caption",content:[new u({id:"title",cls:"caption-element",icon:e.icon,text:e.title}),e.closable?new v({id:"closebox",icon:ln,click:i(()=>{this.close()},"click")}):null]}),e.form,new ue({id:"btnbar",reverse:!0,items:e.buttons,btnclick:i(t=>{this.fire("btnclick",t)},"btnclick")})])}display(){super.displayCenter()}close(){this.fire("close",{}),super.close()}};i(io,"Dialog");var be=io;var so=class so extends y{setValues(e){let t=this.queryAll("input[name]");console.log(t)}getValues(){return{}}};i(so,"Form");var ge=so;var lo=class lo extends h{constructor(e){var t;super(e),this._els=(t=e.items)==null?void 0:t.map(o=>{let n=new u({cls:"cell",text:o.title,icon:o.iconId}),r=new P("right");return o.width>0?(n.setStyleValue("width",o.width+"px"),n.setInternalData("width",o.width)):o.width<0?n.setInternalData("flex",-o.width):n.setInternalData("width",0),r.addDOMEvent("dblclick",a=>{n.setInternalData("flex",1),this._calc_sizes()}),r.on("resize",a=>{n.setInternalData("flex",0),n.setInternalData("width",a.size),this._calc_sizes()}),n.appendContent(r),n.setInternalData("data",o),n}),this.addDOMEvent("resized",()=>this._on_resize()),this.addDOMEvent("created",()=>this._calc_sizes()),this._vwp=new h({content:this._els}),this.setContent(this._vwp)}_calc_sizes(){let e=0,t=0;this._els.forEach(l=>{let c=l.getInternalData("flex");if(c)e+=c;else{let p=l.getInternalData("width");if(p==0){let x=l.getBoundingRect();p=Math.ceil(x.width)+2,l.setInternalData("width",p)}t+=p}});let n=this.getBoundingRect().width-t,r=Math.ceil(n/e);console.log("filled",t),console.log("count",e),console.log("rest",n),console.log("unit",r);let a=0;this._els.forEach(l=>{let c=0,p=l.getInternalData("flex");p?(c=Math.min(r*p,n),n-=c):c=l.getInternalData("width"),l.setWidth(c),a+=c}),this._vwp.setWidth(a)}_on_resize(){this._calc_sizes()}};i(lo,"Header");var ao=lo;var po=class po extends d{constructor(e){var t;super(e),this._img=new d({tag:"img",attrs:{loading:e.lazy,alt:e.alt,draggable:(t=e.draggable)!=null?t:!1},style:{width:"100%",height:"100%",objectFit:e.fit,objectPosition:e.position}}),this.setContent(this._img),this.setImage(e.src)}setImage(e){this._img.setAttribute("src",e)}};i(po,"Image");var co=po;var cn='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor"><!--!Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24l0 112c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-112c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"/></svg>';var ze=class ze extends be{constructor(e){super(e)}setText(e){this.m_label.setText(e)}static show(e){let t=new ze({modal:!0,title:m.global.error,movable:!0,form:new ge({content:[new h({content:[new _({iconId:cn}),new u({text:e})]})]}),buttons:["ok","cancel"]});return t.on("btnclick",o=>{Ke(()=>t.close())}),t.display(),t}};i(ze,"MessageBox");var ho=ze;var dn='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor"><!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209L241 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L335 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"/></svg>';var pn='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor"><!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24V264c0 13.3-10.7 24-24 24s-24-10.7-24-24V152c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"/></svg>';var hn='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor"><!--!Font Awesome Pro 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path d="M207.4 20.4c2.4 8.5-2.6 17.3-11.2 19.7C101.5 66.2 32 153 32 256c0 123.7 100.3 224 224 224s224-100.3 224-224c0-103-69.5-189.8-164.3-215.9c-8.5-2.4-13.5-11.2-11.2-19.7s11.2-13.5 19.7-11.2C432.5 39.1 512 138.2 512 256c0 141.4-114.6 256-256 256S0 397.4 0 256C0 138.2 79.5 39.1 187.7 9.2c8.5-2.4 17.3 2.6 19.7 11.2z"/></svg>';var un='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512" fill="currentColor"><!--!Font Awesome Pro 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path d="M192 233.4L59.5 100.9 36.9 123.5 169.4 256 36.9 388.5l22.6 22.6L192 278.6 324.5 411.1l22.6-22.6L214.6 256 347.1 123.5l-22.6-22.6L192 233.4z"/></svg>';var mo=class mo extends T{constructor(e){super({});let t=e.iconId;t||(e.loading?(t=hn,this.addClass("")):e.mode=="danger"?t=pn:t=dn),this.addClass(e.mode);let o=new _({iconId:t});e.loading&&(o.addClass("rotate"),this.props.modal=!0),this.setContent(new h({content:[o,new f({cls:"body",content:[new u({cls:"title",text:e.title}),new u({cls:"text",text:e.text})]}),new v({cls:"outline",icon:un,click:i(()=>{this.close()},"click")})]}))}close(){this.clearTimeout("close"),super.close()}display(e=0){let t=new z(0,0,window.innerWidth,window.innerHeight);this.displayNear(t,"bottom right","bottom right",{x:-20,y:-10}),e&&this.setTimeout("close",e*1e3,()=>{this.close()})}};i(mo,"Notification");var uo=mo;var bo=class bo extends f{constructor(e){var o;super({...e,content:void 0});let t=(o=e.bodyModel)!=null?o:f;super.setContent([this._title=new u({tag:"legend",text:e.title,icon:e.icon}),this._body=new t({cls:"body",content:e.content})])}setContent(e){this._body.setContent(e)}setTitle(e){this._title.setContent(e)}};i(bo,"Panel");var xo=bo;var fo=class fo extends d{constructor(e){super(e),this.setContent(this._bar=new d({cls:"bar"})),this.setValue(e.value)}setValue(e){let t=e/(this.props.max-this.props.min)*100;this._bar.setStyleValue("width",t+"%")}};i(fo,"Progress");var go=fo;var mn='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512" fill="currentColor"><!--!Font Awesome Pro 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path d="M288.1 0l86.5 164 182.7 31.6L428 328.5 454.4 512 288.1 430.2 121.7 512l26.4-183.5L18.9 195.6 201.5 164 288.1 0z"/></svg>';var vo=class vo extends h{constructor(e){var t;super(e),e.steps=(t=e.steps)!=null?t:5,this._update()}_update(){var n,r;let e=this.props,t=(n=e.icon)!=null?n:mn,o=(r=e.value)!=null?r:0;this.m_input=new C({type:"text",hidden:!0,name:e.name,value:""+o}),this.addDOMEvent("click",a=>this._on_click(a)),this.m_els=[];for(let a=0;a<e.steps;a++){let l="item";a+1<=o&&(l+=" checked");let c=new _({cls:l,iconId:t});c.setInternalData("value",a),this.m_els.push(c)}this.m_els.push(this.m_input),this.setContent(this.m_els)}getValue(){var e;return(e=this.props.value)!=null?e:0}setValue(e){this.props.value=e;for(let t=0;t<this.props.steps;t++)this.m_els[t].setClass("checked",this.m_els[t].getInternalData("value")<=e);this.m_input.setValue(""+this.props.value)}setSteps(e){this.props.steps=e,this._update()}setShape(e){this.removeClass(this.props.icon),this.props.icon=e}_on_click(e){let t=g(e.target);t=t.parentElement(_),t&&this.setValue(t.getInternalData("value")),this.fire("change",{value:this.props.value})}};i(vo,"Rating");var _o=vo;var yo=class yo extends d{constructor(t){super(t);this._mdown=!1;this._irect=null;this._thumb=null;this._bar=null;this._range=null;this.setContent([new h({cls:"track",content:[this._bar=new d({cls:"bar"}),this._thumb=new d({cls:"thumb"})]}),this._range=new C({type:"range",hidden:!0,value:t.value,min:t.min,max:t.max,step:t.step})]),this.setAttribute("tabindex",0),this.setDOMEvents({pointerdown:i(o=>this._on_mousedown(o),"pointerdown"),pointermove:i(o=>this._on_mousemove(o),"pointermove"),pointerup:i(o=>this._on_mouseup(o),"pointerup"),keydown:i(o=>this._on_key(o),"keydown")}),this._range.addDOMEvent("change",o=>{})}_on_mousedown(t){t.stopPropagation(),t.preventDefault(),this.focus(),this._mdown=!0,this._irect=this.getBoundingRect(),this.setCapture(t.pointerId)}_on_mousemove(t){if(this._mdown){let o=t.pageX-this._irect.left;o<0?o=0:o>this._irect.width&&(o=this._irect.width);let n=o/this._irect.width*100;this._range.setNumValue(n),this._update()}}_update(){let t=this._range.getNumValue(),o=t/(this.props.max-this.props.min)*100;this._thumb.setStyleValue("left",o+"%"),this._bar.setStyleValue("width",o+"%"),this.fire("change",{value:t})}_on_mouseup(t){this._mdown&&(this.releaseCapture(t.pointerId),this._mdown=!1)}_on_key(t){var r;console.log(t.key);let o=(r=this.props.step)!=null?r:1,n=0;switch(t.key){case"ArrowRight":case"ArrowUp":n=o;break;case"ArrowLeft":case"ArrowDown":n=-o;break}n&&(t.ctrlKey&&(n*=10),this._range.setNumValue(this._range.getNumValue()+n),this._update())}};i(yo,"Slider");var wo=yo;var Eo=class Eo extends h{constructor(e){super(e);let t=L();this.setContent([new d({cls:"switch",content:[new C({type:"checkbox",id:t,checked:e.checked}),new d({cls:"track"}),new d({cls:"thumb"})]}),new u({tag:"label",text:e.label,labelFor:t})])}};i(Eo,"Switch");var Co=Eo;var Po=class Po extends v{constructor(e,t){super(e),this.addClass("outline"),this.setIcon(t.icon),this.setText(t.title),this.setData("tabname",t.name)}};i(Po,"CTab");var ko=Po,To=class To extends h{constructor(e,t){super(e);let o=t.map(n=>new ko({click:i(r=>this._on_click(r),"click")},n));this.mapPropEvents(e,"click"),this.setContent(o)}_on_click(e){let t=e.source.getData("tabname");this.fire("click",{name:t})}select(e){let t=this.query(`[data-tabname="${e}"]`);this._selitem&&this._selitem.setClass("selected",!1),this._selitem=t,this._selection=e,this._selitem&&this._selitem.setClass("selected",!0)}};i(To,"CTabList");var Io=To,Do=class Do extends f{constructor(e){var o;super(e);let t=(o=e.items)==null?void 0:o.map(n=>({name:n.name,content:n.tab}));this.setContent([this._list=new Io({click:i(n=>this._onclick(n),"click")},e.items),this._stack=new he({cls:"body x4flex",default:e.default,items:t})]),e.default&&this.selectTab(e.default)}selectTab(e){this._list.select(e),this._stack.select(e)}_onclick(e){this.selectTab(e.name)}};i(Do,"Tabs");var Mo=Do;var Lo=class Lo extends f{constructor(e){super(e),this.setContent([new u({text:e.label}),this._input=new d({tag:"textarea"})]),this._input.setAttribute("name",e.name),this._input.setAttribute("value",e.value+""),e.resize||this._input.setAttribute("resize",!1)}};i(Lo,"TextArea");var So=Lo;var Ro=class Ro extends h{constructor(e){var o,n;super(e),e.inputId||(e.inputId=L()),e.required&&this.setAttribute("required",!0);let t=(o=e.inputGadgets)!=null?o:[];this.setContent([new h({id:"label",width:e.labelWidth,content:[new u({tag:"label",text:e.label,labelFor:e.inputId})]}),new h({id:"edit",content:[new C({type:(n=e.type)!=null?n:"text",readonly:e.readonly,value:e.value,id:e.inputId,required:e.required,disabled:e.disabled,placeholder:e.placeholder}),...t]})])}};i(Ro,"TextEdit");var Ao=Ro;var xn='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor"> <!--!Font Awesome Pro 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path d="M256 32a224 224 0 1 1 0 448 224 224 0 1 1 0-448zm0 480A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM192 352v32h16 96 16V352H304 272V240 224H256 216 200v32h16 24v96H208 192zm88-168V136H232v48h48z"/></svg>';var He=null,fe=null,bn=new $;function gr(){document.addEventListener("mouseenter",s=>{if(s.target===document)return;let e=nt(s.target),t=e.getAttribute("tooltip");if(t){He=s.target;let o=e.getBoundingRect();fr(t,o,{x:s.pageX,y:s.pageY})}},!0),document.addEventListener("mouseleave",s=>{He&&s.target==He&&(He=null,_r())},!0)}i(gr,"initTooltips");function fr(s,e,t){fe||(fe=new Oo({})),bn.setTimeout(null,300,()=>{fe.setText(re(s)),fe.displayAt(t.x,t.y)})}i(fr,"showTT");function _r(){fe.show(!1),bn.clearTimeout(null)}i(_r,"closeTT");var zo=class zo extends T{constructor(e){super(e),this.setContent(new h({content:[new _({iconId:xn}),new d({id:"text"})]}))}setText(e){this.query("#text").setContent(e)}};i(zo,"Tooltip");var Oo=zo;var gn='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor"><!--!Font Awesome Pro 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path d="M267.3 395.3c-6.2 6.2-16.4 6.2-22.6 0l-192-192c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0L256 361.4 436.7 180.7c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6l-192 192z"/></svg>';var fn=(p=>(p[p.first=0]="first",p[p.prev=1]="prev",p[p.next=2]="next",p[p.last=3]="last",p[p.parent=4]="parent",p[p.child=5]="child",p[p.expand=6]="expand",p[p.collapse=7]="collapse",p[p.toggle=8]="toggle",p))(fn||{}),Be=class Be extends y{constructor(e,t){super({...e}),this._item=t,t?(this._label=new h({cls:"label item",content:[this._icon=new _({iconId:t.children?gn:t.iconId}),new u({tag:"span",cls:"",text:t.text})]}),this._label.setData("id",t.id+""),t.children&&(this._childs=new f({cls:"body"}),t.open===void 0&&(t.open=!1),this.addClass("folder"),this.setClass("open",t.open),this.setItems(t.children),this._icon.addDOMEvent("click",o=>this.toggle(o)))):this._childs=new f({cls:"body"}),this.setContent([this._label,this._childs])}toggle(e){let t=this.hasClass("open");this.open(!t),e&&e.stopPropagation()}open(e=!0){this.setClass("open",e),this._item.open=e}setItems(e){if(e){let t=e.map(o=>new Be({},o));this._childs.setContent(t)}else this._childs.clearContent()}};i(Be,"CTreeViewItem");var Ho=Be,No=class No extends d{constructor(e){super(e),e.items&&this.setItems(e.items),this.setAttribute("tabindex",0),this.setDOMEvents({click:i(t=>this._onclick(t),"click"),keydown:i(t=>this._onkey(t),"keydown")})}setItems(e){this._items=e;let t=new Ho({cls:"root"},null);t.setItems(e),this.setContent(t)}_onclick(e){let t=e.target;for(;t&&t!=this.dom;){let o=g(t);if(o&&o.hasClass("item")){let n=o.getData("id");this._selectItem(n,o);return}t=t.parentElement}this.clearSelection()}_onkey(e){switch(e.key){case"ArrowDown":{this.navigate(2);break}case"ArrowUp":{this.navigate(1);break}case"Home":{this.navigate(0);break}case"End":{this.navigate(3);break}case"ArrowRight":{this.navigate(5);break}case"+":{this.navigate(6);break}case"ArrowLeft":{this.navigate(4);break}case"-":{this.navigate(7);break}case" ":{this.navigate(8);break}default:console.log(e.key);return}e.preventDefault(),e.stopPropagation()}navigate(e){var n;if(!this._items||this._items.length==0)return;if(!this._selitem)if(e==2||e==4)e=0;else if(e==1)e=3;else return;let t=(n=this._selitem)==null?void 0:n.parentElement(),o=t==null?void 0:t.hasClass("folder");if(t&&e==4&&o&&t.hasClass("open")?e=7:e==5&&(o?t.hasClass("open")?e=2:e=6:e=2),e==6||e==7||e==8){if(o)return e==8?(t.toggle(),!0):(t.open(e==6),!0)}else{let r=this._flattenOpenItems(),a=r.findIndex(c=>this._selection==c.id),l;if(e==0)l=r[0].id;else if(e==3)l=r[r.length-1].id;else if(a>=0){if(e==1)a>0&&(l=r[a-1].id);else if(e==2)a<r.length-1&&(l=r[a+1].id);else if(e==4){let c=r[a].level;for(;a>0;)if(a--,r[a].level<c){l=r[a].id;break}}}if(l){let c=this.query(`[data-id="${l}"]`);return this._selectItem(l,c),!0}}return!1}_flattenOpenItems(){let e=[],t=i((o,n)=>{e.push({id:o.id+"",level:n}),o.children&&o.open&&o.children.forEach(r=>t(r,n+1))},"build");return this._items.forEach(o=>t(o,0)),e}_flattenItems(){let e=[],t=i(o=>{e.push(o),o.children&&o.children.forEach(n=>t(n))},"build");return this._items.forEach(o=>t(o)),e}_selectItem(e,t){this._selitem&&(this._selitem.removeClass("selected"),this._selitem=void 0),this._selitem=t,this._selection=e,t&&(t.addClass("selected"),t.scrollIntoView({behavior:"smooth",block:"nearest"}));let o=this._findItem(e);this.fire("change",{selection:o})}_findItem(e){return this._flattenItems().find(o=>o.id==e)}clearSelection(){this._selitem&&(this._selitem.removeClass("selected"),this._selitem=void 0),this._selection=void 0,this.fire("change",{selection:void 0})}};i(No,"Treeview");var Bo=No;
1
+ "use strict";var Ke=Object.defineProperty;var Jt=Object.getOwnPropertyDescriptor;var No=Object.getOwnPropertyNames;var Fo=Object.prototype.hasOwnProperty;var eo=s=>{throw TypeError(s)};var i=(s,e)=>Ke(s,"name",{value:e,configurable:!0});var Uo=(s,e)=>{for(var t in e)Ke(s,t,{get:e[t],enumerable:!0})},Vo=(s,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of No(e))!Fo.call(s,r)&&r!==t&&Ke(s,r,{get:()=>e[r],enumerable:!(o=Jt(e,r))||o.enumerable});return s};var Ko=s=>Vo(Ke({},"__esModule",{value:!0}),s),h=(s,e,t,o)=>{for(var r=o>1?void 0:o?Jt(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(r=(o?a(e,t,r):a(r))||r);return o&&r&&Ke(e,t,r),r};var to=(s,e,t)=>e.has(s)||eo("Cannot "+t);var T=(s,e,t)=>(to(s,e,"read from private field"),t?t.call(s):e.get(s)),qe=(s,e,t)=>e.has(s)?eo("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(s):e.set(s,t),Ge=(s,e,t,o)=>(to(s,e,"write to private field"),o?o.call(s,t):e.set(s,t),t);var zr={};Uo(zr,{Box:()=>E,Breadcrumbs:()=>he,BtnGroup:()=>K,Button:()=>v,CSizer:()=>C,Calendar:()=>ue,Checkbox:()=>xe,Color:()=>L,ColorInput:()=>$,ColorPicker:()=>fe,Combobox:()=>_e,Component:()=>c,ComputedStyle:()=>It,CoreElement:()=>je,Dialog:()=>Q,EventSource:()=>ae,Flex:()=>ce,Form:()=>W,HBox:()=>u,Header:()=>we,Icon:()=>f,Image:()=>ye,Input:()=>k,Label:()=>x,Link:()=>Ee,Listbox:()=>G,Menu:()=>z,MessageBox:()=>ee,Notification:()=>ke,Panel:()=>Ce,Popup:()=>I,Progress:()=>Ae,Rating:()=>Ie,Rect:()=>N,Router:()=>Ht,Saturation:()=>X,ScrollView:()=>q,Slider:()=>Me,StackBox:()=>V,Stylesheet:()=>At,SvgBuilder:()=>Ut,SvgComponent:()=>Vt,SvgGradient:()=>dt,SvgGroup:()=>et,SvgPath:()=>lt,SvgShape:()=>Je,SvgText:()=>ct,Switch:()=>Pe,Tabs:()=>Le,TextArea:()=>Se,TextEdit:()=>Re,Timer:()=>ie,Treeview:()=>Be,UnsafeHtml:()=>ne,VBox:()=>_,Viewport:()=>J,_date_set_locale:()=>er,_tr:()=>b,addEvent:()=>$e,addTranslation:()=>ft,asap:()=>_t,beep:()=>ar,calcAge:()=>sr,camelCase:()=>Xo,clamp:()=>S,class_ns:()=>p,componentFromDOM:()=>y,createLanguage:()=>bt,date_calc_weeknum:()=>vt,date_clone:()=>se,date_diff:()=>or,date_format:()=>tr,date_hash:()=>Y,date_sql_utc:()=>nr,date_to_sql:()=>rr,dispatchEvent:()=>ao,dragManager:()=>xr,formatIntlDate:()=>F,getAvailableLanguages:()=>Wo,getCurrentLanguage:()=>Qo,initTooltips:()=>Sr,isArray:()=>st,isFeatureAvailable:()=>We,isFunction:()=>Zo,isLanguage:()=>gt,isNumber:()=>U,isString:()=>P,isUnitLess:()=>Mt,kbNav:()=>Xt,kbTreeNav:()=>So,makeUniqueComponentId:()=>R,pad:()=>H,parseIntlDate:()=>ir,pascalCase:()=>$o,selectLanguage:()=>io,sprintf:()=>it,svgLoader:()=>ht,unbubbleEvents:()=>so,unitless:()=>Ze,unsafeHtml:()=>Qe,wrapDOM:()=>Lt,x4_class_ns_sym:()=>Ye});module.exports=Ko(zr);var oo=Symbol("i18n"),ze={};function bt(s,e){ze[s]={name:s,base:e,src_translations:{},translations:{}}}i(bt,"createLanguage");function gt(s){return ze[s]!==void 0}i(gt,"isLanguage");function ft(s,...e){if(!gt(s))return;let t=ze[s];e.forEach(o=>{ro(t.src_translations,o)}),t.translations=no(t.src_translations,t.base,!0)}i(ft,"addTranslation");function ro(s,e){for(let t in e){let o=e[t];typeof o=="string"?s[t]=o:Array.isArray(o)&&(!s[t]||!Array.isArray(s[t]))?s[t]=[...o]:!s[t]||typeof s[t]!="object"?s[t]={...o}:ro(s[t],e[t])}}i(ro,"_patch");function no(s,e,t){let o={};for(let r in s)typeof s[r]!="string"&&!Array.isArray(s[r])?o[r]=no(s[r],e,!1):o[r]=s[r];return qo(o,e,t)}i(no,"_proxyfy");function qo(s,e,t){return new Proxy(s,{get:i((o,r)=>{t?nt=[r]:nt.push(r);let n=o[r];return n===void 0&&(e&&(n=Go(e)),n===void 0&&console.error("I18N error: unable to find","_tr."+nt.join("."))),n},"get")})}i(qo,"_mk_proxy");var nt;function Go(s){for(;s;){let e=ze[s],t=e.translations,o;for(let r of nt){if(o=t[r],o===void 0)break;t=o}if(o!==void 0)return t;s=e.base}}i(Go,"_findBaseTrans");var b={};function io(s){if(gt(s))return b=ze[s].translations,b[oo]=s,b}i(io,"selectLanguage");function Qo(){return b[oo]}i(Qo,"getCurrentLanguage");function Wo(){return Object.keys(ze)}i(Wo,"getAvailableLanguages");var Yo={global:{ok:"OK",cancel:"Annuler",ignore:"Ignorer",yes:"Oui",no:"Non",abort:"Abandonner",retry:"Réessayer",error:"Erreur",today:"Aujourd'hui",open:"Ouvrir",new:"Nouveau",delete:"Supprimer",close:"Fermer",save:"Enregistrer",search:"Rechercher",search_tip:"Saisissez le texte à rechercher. <b>Enter</b> pour lancer la recherche. <b>Esc</b> pour annuler.",required_field:"information requise",invalid_format:"format invalide",invalid_email:"adresse mail invalide",invalid_number:"valeur numérique invalide",diff_date_seconds:"{0} secondes",diff_date_minutes:"{0} minutes",diff_date_hours:"{0} heures",invalid_date:"Date non reconnue ({0})",empty_list:"Liste vide",date_input_formats:"d/m/y|d.m.y|d m y|d-m-y|dmy",date_format:"D/M/Y",day_short:["dim","lun","mar","mer","jeu","ven","sam"],day_long:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],month_short:["jan","fév","mar","avr","mai","jun","jui","aoû","sep","oct","nov","déc"],month_long:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"],property:"Propriété",value:"Valeur",err_403:"Vous n'avez pas les droits suffisants pour effectuer cette action",copy:"Copier",cut:"Couper",paste:"Coller"}},jo={global:{ok:"OK",cancel:"Cancel",ignore:"Ignore",yes:"Yes",no:"No",abort:"Abort",retry:"Retry",error:"Error",today:"Today",open:"Open",new:"New",delete:"Delete",close:"Close",save:"Save",search:"Search",search_tip:"Type in the text to search. <b>Enter</b> to start the search. <b>Esc</b> to cancel.",required_field:"missing information",invalid_format:"invalid format",invalid_email:"invalid email address",invalid_number:"bad numeric value",diff_date_seconds:"{0} seconds",diff_date_minutes:"{0} minutes",diff_date_hours:"{0} hours",invalid_date:"Unrecognized date({0})",empty_list:"Empty list",date_input_formats:"m/d/y|m.d.y|m d y|m-d-y|mdy",date_format:"M/D/Y",day_short:["sun","mon","tue","wed","thu","fri","sat"],day_long:["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],month_short:["jan","feb","mar","apr","may","jun","jui","aug","sep","oct","nov","dec"],month_long:["january","february","march","april","mau","june","jully","august","september","october","november","december"],property:"Property",value:"Value",err_403:"You do not have sufficient rights to do that action",copy:"Copy",cut:"Cut",paste:"Paste"}};bt("fr",null);ft("fr",Yo);bt("en","fr");ft("en",jo);io("fr");function P(s){return typeof s=="string"}i(P,"isString");function U(s){return typeof s=="number"&&isFinite(s)}i(U,"isNumber");function st(s){return s instanceof Array}i(st,"isArray");function Zo(s){return s instanceof Function}i(Zo,"isFunction");var wt=class wt extends String{constructor(e){super(e)}};i(wt,"UnsafeHtml");var ne=wt;function Qe(s){return new ne(s)}i(Qe,"unsafeHtml");function S(s,e,t){return s<e?e:s>t?t:s}i(S,"clamp");var yt=class yt{constructor(e,t,o,r){e!==void 0&&(U(e)?(this.left=e,this.top=t,this.width=o,this.height=r):Object.assign(this,e))}get right(){return this.left+this.width}get bottom(){return this.top+this.height}};i(yt,"Rect");var N=yt;function We(s){switch(s){case"eyedropper":return"EyeDropper"in window}return!1}i(We,"isFeatureAvailable");var Et=class Et{setTimeout(e,t,o){this._timers?this.clearTimeout(e):this._timers=new Map;let r=setTimeout(o,t);return this._timers.set(e,r),r}clearTimeout(e){this._timers&&this._timers.has(e)&&(clearTimeout(this._timers.get(e)),this._timers.delete(e))}setInterval(e,t,o){this._timers?this.clearInterval(e):this._timers=new Map;let r=setInterval(o,t);return this._timers.set(e,r),r}clearInterval(e){this._timers&&this._timers.has(e)&&(clearInterval(this._timers.get(e)),this._timers.delete(e))}clearAllTimeouts(){var e;(e=this._timers)==null||e.forEach(t=>{clearTimeout(t)}),this._timers=null}};i(Et,"Timer");var ie=Et;function _t(s){return requestAnimationFrame(s)}i(_t,"asap");function H(s,e,t="0"){let o;return P(s)?o=s:o=""+s,e>0?o.padEnd(e,t):o.padStart(-e,t)}i(H,"pad");function it(s,...e){return s.replace(/{(\d+)}/g,function(t,o){return typeof e[o]<"u"?e[o]:t})}i(it,"sprintf");function $o(s){let e=s;return e=e.replace(/([a-z])([A-Z])/g,"$1 $2"),e=e.toLowerCase(),e=e.replace(/[^- a-z0-9]+/g," "),e.indexOf(" ")<0?e:(e=e.trim(),e.replace(/ /g,"-"))}i($o,"pascalCase");function Xo(s){let e=s.toLowerCase();return e=e.replace(/[^a-zA-Z0-9]+(.)/g,(t,o)=>o.toUpperCase()),e}i(Xo,"camelCase");var Jo="fr-FR";function er(s){Jo=s}i(er,"_date_set_locale");function tr(s,e){return F(s)}i(tr,"date_format");function or(s,e,t){var o=(s.getTime()-e.getTime())/1e3;let r=o;if(r<60)return it(b.global.diff_date_seconds,Math.round(r));let n=Math.floor(r/60);if(n<60)return it(b.global.diff_date_minutes,Math.round(n));let a=Math.floor(n/60);return it(b.global.diff_date_hours,a,n%60)}i(or,"date_diff");function rr(s,e){return e?F(s,"Y-M-D H:I:S"):F(s,"Y-M-D")}i(rr,"date_to_sql");function nr(s){return new Date(s+" GMT")}i(nr,"date_sql_utc");function Y(s){return s.getFullYear()<<16|s.getMonth()<<8|s.getDate()}i(Y,"date_hash");function se(s){return new Date(s.getTime())}i(se,"date_clone");function vt(s){let e=new Date(s.getFullYear(),0,1),t=(s.valueOf()-e.valueOf())/864e5;return Math.floor((t+e.getDay()+1)/7)}i(vt,"date_calc_weeknum");function ir(s,e=b.global.date_input_formats){var o,r,n,a,l,d;let t=e.split("|");for(let m of t){let g="";for(let w of m)w=="d"||w=="D"?g+="(?<day>\\d{1,2})":w=="m"||w=="M"?g+="(?<month>\\d{1,2})":w=="y"||w=="Y"?g+="(?<year>\\d{1,4})":w=="h"||w=="H"?g+="(?<hour>\\d{1,2})":w=="i"||w=="I"?g+="(?<min>\\d{1,2})":w=="s"||w=="S"?g+="(?<sec>\\d{1,2})":w==" "?g+="\\s+":g+="\\s*\\"+w+"\\s*";let A=new RegExp("^"+g+"$","m").exec(s);if(A){let w=new Date,Ve=parseInt((o=A.groups.day)!=null?o:"1"),oe=parseInt((r=A.groups.month)!=null?r:"1"),re=parseInt((n=A.groups.year)!=null?n:w.getFullYear()+""),ot=parseInt((a=A.groups.hour)!=null?a:"0"),Ro=parseInt((l=A.groups.min)!=null?l:"0"),Oo=parseInt((d=A.groups.sec)!=null?d:"0");re>0&&re<100&&(re+=2e3);let rt=new Date(re,oe-1,Ve,ot,Ro,Oo,0),Bo=rt.getFullYear(),zo=rt.getMonth()+1,Ho=rt.getDate();return Bo!=re||zo!=oe||Ho!=Ve?null:rt}}return null}i(ir,"parseIntlDate");function F(s,e=b.global.date_format){if(!s)return"";let t={year:s.getFullYear(),month:s.getMonth()+1,day:s.getDate(),wday:s.getDay(),hours:s.getHours(),minutes:s.getMinutes(),seconds:s.getSeconds(),milli:s.getMilliseconds()},o="",r=0;for(let n of e){if(n=="{"){if(++r==1)continue}else if(n=="}"&&--r==0)continue;if(r){o+=n;continue}n=="d"?o+=t.day:n=="D"?o+=H(t.day,-2):n=="j"?o+=b.global.day_short[t.wday]:n=="J"?o+=b.global.day_long[t.wday]:n=="w"?o+=vt(s):n=="W"?o+=H(vt(s),-2):n=="m"?o+=t.month:n=="M"?o+=H(t.month,-2):n=="o"?o+=b.global.month_short[t.month-1]:n=="O"?o+=b.global.month_long[t.month-1]:n=="y"||n=="Y"?o+=H(t.year,-4):n=="a"||n=="A"?o+=t.hours<12?"am":"pm":n=="h"?o+=t.hours:n=="H"?o+=H(t.hours,-2):n=="i"?o+=t.minutes:n=="I"?o+=H(t.minutes,-2):n=="s"?o+=t.seconds:n=="S"?o+=H(t.seconds,-2):n=="l"?o+=t.milli:n=="L"?o+=H(t.milli,-3):o+=n}return o}i(F,"formatIntlDate");function sr(s,e){if(e===void 0&&(e=new Date),!s)return 0;let t=e.getFullYear()-s.getFullYear();return(e.getMonth()<s.getMonth()||e.getMonth()==s.getMonth()&&e.getDate()<s.getDate())&&t--,t}i(sr,"calcAge");function ar(){new Audio("data:audio/wav;base64,//uQRAAAAWMSLwUIYAAsYkXgoQwAEaYLWfkWgAI0wWs/ItAAAGDgYtAgAyN+QWaAAihwMWm4G8QQRDiMcCBcH3Cc+CDv/7xA4Tvh9Rz/y8QADBwMWgQAZG/ILNAARQ4GLTcDeIIIhxGOBAuD7hOfBB3/94gcJ3w+o5/5eIAIAAAVwWgQAVQ2ORaIQwEMAJiDg95G4nQL7mQVWI6GwRcfsZAcsKkJvxgxEjzFUgfHoSQ9Qq7KNwqHwuB13MA4a1q/DmBrHgPcmjiGoh//EwC5nGPEmS4RcfkVKOhJf+WOgoxJclFz3kgn//dBA+ya1GhurNn8zb//9NNutNuhz31f////9vt///z+IdAEAAAK4LQIAKobHItEIYCGAExBwe8jcToF9zIKrEdDYIuP2MgOWFSE34wYiR5iqQPj0JIeoVdlG4VD4XA67mAcNa1fhzA1jwHuTRxDUQ//iYBczjHiTJcIuPyKlHQkv/LHQUYkuSi57yQT//uggfZNajQ3Vmz+Zt//+mm3Wm3Q576v////+32///5/EOgAAADVghQAAAAA//uQZAUAB1WI0PZugAAAAAoQwAAAEk3nRd2qAAAAACiDgAAAAAAABCqEEQRLCgwpBGMlJkIz8jKhGvj4k6jzRnqasNKIeoh5gI7BJaC1A1AoNBjJgbyApVS4IDlZgDU5WUAxEKDNmmALHzZp0Fkz1FMTmGFl1FMEyodIavcCAUHDWrKAIA4aa2oCgILEBupZgHvAhEBcZ6joQBxS76AgccrFlczBvKLC0QI2cBoCFvfTDAo7eoOQInqDPBtvrDEZBNYN5xwNwxQRfw8ZQ5wQVLvO8OYU+mHvFLlDh05Mdg7BT6YrRPpCBznMB2r//xKJjyyOh+cImr2/4doscwD6neZjuZR4AgAABYAAAABy1xcdQtxYBYYZdifkUDgzzXaXn98Z0oi9ILU5mBjFANmRwlVJ3/6jYDAmxaiDG3/6xjQQCCKkRb/6kg/wW+kSJ5//rLobkLSiKmqP/0ikJuDaSaSf/6JiLYLEYnW/+kXg1WRVJL/9EmQ1YZIsv/6Qzwy5qk7/+tEU0nkls3/zIUMPKNX/6yZLf+kFgAfgGyLFAUwY//uQZAUABcd5UiNPVXAAAApAAAAAE0VZQKw9ISAAACgAAAAAVQIygIElVrFkBS+Jhi+EAuu+lKAkYUEIsmEAEoMeDmCETMvfSHTGkF5RWH7kz/ESHWPAq/kcCRhqBtMdokPdM7vil7RG98A2sc7zO6ZvTdM7pmOUAZTnJW+NXxqmd41dqJ6mLTXxrPpnV8avaIf5SvL7pndPvPpndJR9Kuu8fePvuiuhorgWjp7Mf/PRjxcFCPDkW31srioCExivv9lcwKEaHsf/7ow2Fl1T/9RkXgEhYElAoCLFtMArxwivDJJ+bR1HTKJdlEoTELCIqgEwVGSQ+hIm0NbK8WXcTEI0UPoa2NbG4y2K00JEWbZavJXkYaqo9CRHS55FcZTjKEk3NKoCYUnSQ0rWxrZbFKbKIhOKPZe1cJKzZSaQrIyULHDZmV5K4xySsDRKWOruanGtjLJXFEmwaIbDLX0hIPBUQPVFVkQkDoUNfSoDgQGKPekoxeGzA4DUvnn4bxzcZrtJyipKfPNy5w+9lnXwgqsiyHNeSVpemw4bWb9psYeq//uQZBoABQt4yMVxYAIAAAkQoAAAHvYpL5m6AAgAACXDAAAAD59jblTirQe9upFsmZbpMudy7Lz1X1DYsxOOSWpfPqNX2WqktK0DMvuGwlbNj44TleLPQ+Gsfb+GOWOKJoIrWb3cIMeeON6lz2umTqMXV8Mj30yWPpjoSa9ujK8SyeJP5y5mOW1D6hvLepeveEAEDo0mgCRClOEgANv3B9a6fikgUSu/DmAMATrGx7nng5p5iimPNZsfQLYB2sDLIkzRKZOHGAaUyDcpFBSLG9MCQALgAIgQs2YunOszLSAyQYPVC2YdGGeHD2dTdJk1pAHGAWDjnkcLKFymS3RQZTInzySoBwMG0QueC3gMsCEYxUqlrcxK6k1LQQcsmyYeQPdC2YfuGPASCBkcVMQQqpVJshui1tkXQJQV0OXGAZMXSOEEBRirXbVRQW7ugq7IM7rPWSZyDlM3IuNEkxzCOJ0ny2ThNkyRai1b6ev//3dzNGzNb//4uAvHT5sURcZCFcuKLhOFs8mLAAEAt4UWAAIABAAAAAB4qbHo0tIjVkUU//uQZAwABfSFz3ZqQAAAAAngwAAAE1HjMp2qAAAAACZDgAAAD5UkTE1UgZEUExqYynN1qZvqIOREEFmBcJQkwdxiFtw0qEOkGYfRDifBui9MQg4QAHAqWtAWHoCxu1Yf4VfWLPIM2mHDFsbQEVGwyqQoQcwnfHeIkNt9YnkiaS1oizycqJrx4KOQjahZxWbcZgztj2c49nKmkId44S71j0c8eV9yDK6uPRzx5X18eDvjvQ6yKo9ZSS6l//8elePK/Lf//IInrOF/FvDoADYAGBMGb7FtErm5MXMlmPAJQVgWta7Zx2go+8xJ0UiCb8LHHdftWyLJE0QIAIsI+UbXu67dZMjmgDGCGl1H+vpF4NSDckSIkk7Vd+sxEhBQMRU8j/12UIRhzSaUdQ+rQU5kGeFxm+hb1oh6pWWmv3uvmReDl0UnvtapVaIzo1jZbf/pD6ElLqSX+rUmOQNpJFa/r+sa4e/pBlAABoAAAAA3CUgShLdGIxsY7AUABPRrgCABdDuQ5GC7DqPQCgbbJUAoRSUj+NIEig0YfyWUho1VBBBA//uQZB4ABZx5zfMakeAAAAmwAAAAF5F3P0w9GtAAACfAAAAAwLhMDmAYWMgVEG1U0FIGCBgXBXAtfMH10000EEEEEECUBYln03TTTdNBDZopopYvrTTdNa325mImNg3TTPV9q3pmY0xoO6bv3r00y+IDGid/9aaaZTGMuj9mpu9Mpio1dXrr5HERTZSmqU36A3CumzN/9Robv/Xx4v9ijkSRSNLQhAWumap82WRSBUqXStV/YcS+XVLnSS+WLDroqArFkMEsAS+eWmrUzrO0oEmE40RlMZ5+ODIkAyKAGUwZ3mVKmcamcJnMW26MRPgUw6j+LkhyHGVGYjSUUKNpuJUQoOIAyDvEyG8S5yfK6dhZc0Tx1KI/gviKL6qvvFs1+bWtaz58uUNnryq6kt5RzOCkPWlVqVX2a/EEBUdU1KrXLf40GoiiFXK///qpoiDXrOgqDR38JB0bw7SoL+ZB9o1RCkQjQ2CBYZKd/+VJxZRRZlqSkKiws0WFxUyCwsKiMy7hUVFhIaCrNQsKkTIsLivwKKigsj8XYlwt/WKi2N4d//uQRCSAAjURNIHpMZBGYiaQPSYyAAABLAAAAAAAACWAAAAApUF/Mg+0aohSIRobBAsMlO//Kk4soosy1JSFRYWaLC4qZBYWFRGZdwqKiwkNBVmoWFSJkWFxX4FFRQWR+LsS4W/rFRb/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////VEFHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAU291bmRib3kuZGUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMjAwNGh0dHA6Ly93d3cuc291bmRib3kuZGUAAAAAAAAAACU=").play()}i(ar,"beep");var Ye=Symbol("class-ns");function p(s){return function(e){e[Ye]=s}}i(p,"class_ns");var lr=i(function(){this.propagationStopped=!0},"stopPropagation"),cr=i(function(){this.defaultPrevented=!0},"preventDefault"),kt=class kt{constructor(e=null){this._source=e!=null?e:this}addListener(e,t,o=!1){this._registry||(this._registry=new Map);let r=this._registry.get(e);r||(r=[],this._registry.set(e,r));let n=t;r.indexOf(n)==-1&&(o?r.unshift(n):r.push(n))}fire(e,t){var r;let o=(r=this._registry)==null?void 0:r.get(e);if(o&&o.length){let n=t;if(n||(n={}),n.source||(n.source=this._source),n.type||(n.type=e),n.preventDefault||(n.preventDefault=cr),n.stopPropagation||(n.stopPropagation=lr),o.length==1)o[0](n);else{let a=o.slice();for(let l=0,d=a.length;l<d&&(a[l](n),!n.propagationStopped);l++);}}}};i(kt,"EventSource");var ae=kt;var j,B,Ct=class Ct{constructor(){qe(this,j);qe(this,B)}__startTimer(e,t,o,r){T(this,B)?this.__stopTimer(e):Ge(this,B,new Map);let n=(o?setInterval:setTimeout)(r,t);T(this,B).set(e,()=>{(o?clearInterval:clearTimeout)(n),T(this,B).delete(e)})}__stopTimer(e){let t=T(this,B).get(e);t&&t()}setTimeout(e,t,o){this.__startTimer(e,t,!1,o)}clearTimeout(e){this.__stopTimer(e)}setInterval(e,t,o){this.__startTimer(e,t,!0,o)}clearInterval(e){this.__stopTimer(e)}clearTimeouts(){for(let[e,t]of T(this,B))t();T(this,B).clear()}on(e,t){console.assert(t!=null),T(this,j)||Ge(this,j,new ae(this)),T(this,j).addListener(e,t)}fire(e,t){T(this,j)&&T(this,j).fire(e,t)}};j=new WeakMap,B=new WeakMap,i(Ct,"CoreElement");var je=Ct;var Ze={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function Mt(s){return!!Ze[s]}i(Mt,"isUnitLess");var le=class le{constructor(){this.m_rules=new Map;function e(t){for(let o=0;o<document.styleSheets.length;o++){let r=document.styleSheets[o];if(r.title===t)return r}}if(i(e,"getStyleSheet"),this.m_sheet=e("x4-dynamic-css"),!this.m_sheet){let t=document.createElement("style");t.setAttribute("id","x4-dynamic-css"),document.head.appendChild(t),this.m_sheet=t.sheet}}setRule(e,t){if(P(t)){let o=this.m_rules.get(e);o!==void 0?this.m_sheet.deleteRule(o):o=this.m_sheet.cssRules.length,this.m_rules.set(e,this.m_sheet.insertRule(t,o))}else{let o=1;for(let r in t){let n=r+" { ",a=t[r];for(let l in a){let d=a[l];for(let m=0;m<d.length;m++)n+=l+": "+d[m]+"; "}n+="}",this.setRule(e+"--"+o,n),o++}}}static getVar(e){return le.doc_style||(le.doc_style=getComputedStyle(document.documentElement)),e.startsWith("--")||(e="--"+e),le.doc_style.getPropertyValue(e)}};i(le,"Stylesheet"),le.guid=1;var At=le,Pt=class Pt{constructor(e){this.m_style=e}value(e){return this.m_style[e]}parse(e){return parseInt(this.m_style[e])}get style(){return this.m_style}};i(Pt,"ComputedStyle");var It=Pt;var so={mouseleave:1,mouseenter:1,load:1,unload:1,scroll:1,focus:1,blur:1,rowexit:1,beforeunload:1,stop:1,dragdrop:1,dragenter:1,dragexit:1,draggesture:1,dragover:1,contextmenu:1,created:2,removed:2,sizechange:2},at=new WeakMap,Dt=null,dr=i((s,e)=>{let t=i((r,n)=>{let a=at.get(r);a&&a[n]&&r.dispatchEvent(new Event(n,{}))},"sendEvent"),o=i((r,n)=>{n&&t(r,"created");for(let a=r.firstChild;a;a=a.nextSibling)o(a,n);n||t(r,"removed")},"notify");for(let r of s)r.type=="childList"&&(r.addedNodes&&r.addedNodes.forEach(n=>{o(n,!0)}),r.removedNodes&&r.removedNodes.forEach(n=>{o(n,!1)}))},"observeMutation"),Tt=null;function pr(s){s.forEach(e=>{let t=e.target;t.offsetParent!==null&&t.dispatchEvent(new Event("resized"))})}i(pr,"observeSize");function ao(s){let e=s.target,t=so[s.type]===2;for(;e;){let o=at.get(e);if(o){let r=o[s.type];if(r&&(Array.isArray(r)?r.some(n=>n(s)):r(s),s.stopPropagation||s.defaultPrevented||t))break}if(e=e.parentNode,e==document)break}}i(ao,"dispatchEvent");function $e(s,e,t,o=!1){e=="removed"||e=="created"?Dt||(Dt=new MutationObserver(dr),Dt.observe(document.body,{childList:!0,subtree:!0})):e=="resized"&&(Tt||(Tt=new ResizeObserver(pr)),Tt.observe(s));let r=at.get(s);if(r||(r={},at.set(s,r)),!r[e])r[e]=t,s.addEventListener(e,ao);else{let n=r[e];Array.isArray(n)?n.push(t):r[e]=[n,t]}}i($e,"addEvent");var lo=Symbol("fragment"),co=Symbol("component"),hr=/^-?\d+(\.\d*)?$/;function mr(s){let e=[],t=Object.getPrototypeOf(s);for(;t&&t.constructor!==c;){let o=t.constructor.name,r=t.constructor.hasOwnProperty(Ye)?t.constructor[Ye]:"";e.push(r+o.toLowerCase()),t=Object.getPrototypeOf(t)}return e}i(mr,"genClassNames");var ur=1e3,R=i(()=>`x4-${ur++}`,"makeUniqueComponentId"),c=class extends je{constructor(e){var t,o;if(super(),this.props=e,e.existingDOM)this.dom=e.existingDOM;else{e.ns?this.dom=document.createElementNS(e.ns,(t=e.tag)!=null?t:"div"):this.dom=document.createElement((o=e.tag)!=null?o:"div"),e.attrs&&this.setAttributes(e.attrs),e.cls&&this.addClass(e.cls),e.hidden&&this.show(!1),e.id!==void 0&&this.setAttribute("id",e.id),e.width!==void 0&&this.setStyleValue("width",e.width),e.height!==void 0&&this.setStyleValue("height",e.height),e.tooltip&&this.setAttribute("tooltip",e.tooltip),e.style&&this.setStyle(e.style),e.content&&this.setContent(e.content),e.dom_events&&this.setDOMEvents(e.dom_events);let r=mr(this);this.dom.classList.add(...r),e.disabled&&this.addDOMEvent("created",()=>{this.enable(!1)})}this.dom[co]=this}hasClass(e){return this.dom.classList.contains(e)}addClass(e){if(e)if(e.indexOf(" ")>=0){let t=e.split(" ");this.dom.classList.add(...t)}else this.dom.classList.add(e)}removeClass(e){if(e)if(e.indexOf(" ")>=0){let t=e.split(" ");this.dom.classList.remove(...t)}else this.dom.classList.remove(e)}removeClassEx(e){Array.from(this.dom.classList).forEach(o=>{o.match(e)&&this.dom.classList.remove(o)})}toggleClass(e){if(!e)return;let t=i(o=>{this.dom.classList.toggle(o)},"toggle");e.indexOf(" ")>=0?e.split(" ").forEach(t):t(e)}setClass(e,t=!0){t?this.addClass(e):this.removeClass(e)}setAttributes(e){for(let t in e){let o=e[t];this.setAttribute(t,o)}}setAttribute(e,t){t==null?this.dom.removeAttribute(e):this.dom.setAttribute(e,""+t)}getAttribute(e){return this.dom.getAttribute(e)}getData(e){return this.getAttribute("data-"+e)}setData(e,t){return this.setAttribute("data-"+e,t)}setInternalData(e,t){return this.store||(this.store=new Map),this.store.set(e,t),this}getInternalData(e){var t;return(t=this.store)==null?void 0:t.get(e)}addDOMEvent(e,t,o=!1){$e(this.dom,e,t,o)}setDOMEvents(e){for(let t in e)this.addDOMEvent(t,e[t])}mapPropEvents(e,...t){let o=e;t.forEach(r=>{o.hasOwnProperty(r)&&this.on(r,o[r])})}clearContent(){let e=this.dom;for(;e.firstChild;)e.removeChild(e.firstChild)}setContent(e){this.clearContent(),this.appendContent(e)}appendContent(e){let t=i((o,r)=>{if(r instanceof c)o.appendChild(r.dom);else if(r instanceof ne)o.insertAdjacentHTML("beforeend",r.toString());else if(typeof r=="string"||typeof r=="number"){let n=document.createTextNode(r.toString());o.appendChild(n)}else r&&console.warn("Unknown type to append: ",r)},"set");if(!st(e))t(this.dom,e);else if(e.length<=8)for(let o of e)t(this.dom,o);else{let o=document.createDocumentFragment();for(let r of e)t(o,r);this.dom.appendChild(o)}}prependContent(e){let t=this.dom,o=i(r=>{if(r instanceof c)t.insertBefore(t.firstChild,r.dom);else if(r instanceof ne)t.insertAdjacentHTML("beforebegin",r.toString());else if(typeof r=="string"||typeof r=="number"){let n=document.createTextNode(r.toString());t.insertBefore(t.firstChild,n)}else console.warn("Unknown type to append: ",r)},"set");if(!st(e))o(e);else{let r=document.createDocumentFragment();for(let n of e)o(n);t.insertBefore(t.firstChild,r)}}removeChild(e){this.dom.removeChild(e.dom)}queryAll(e){let t=this.dom.querySelectorAll(e),o=new Array(t.length);return t.forEach((r,n)=>o[n]=y(r)),o}query(e){let t=this.dom.querySelector(e);return y(t)}setAria(e,t){return this.setAttribute(e,t),this}setStyle(e){let t=this.dom.style;for(let o in e){let r=e[o];!Ze[o]&&(U(r)||hr.test(r))&&(r+="px"),t[o]=r}return this}setStyleValue(e,t){let o=this.dom.style;if(U(t)){let r=t+"";Ze[e]||(r+="px"),o[e]=r}else o[e]=t;return this}getStyleValue(e){return this.dom.style[e]}setWidth(e){this.setStyleValue("width",U(e)?e+"px":e)}setHeight(e){this.setStyleValue("height",U(e)?e+"px":e)}setStyleVariable(e,t){this.dom.style.setProperty(e,t)}getStyleVariable(e){return this.getComputedStyle().getPropertyValue(e)}getComputedStyle(){return getComputedStyle(this.dom)}setCapture(e){this.dom.setPointerCapture(e)}releaseCapture(e){this.dom.releasePointerCapture(e)}getBoundingRect(){let e=this.dom.getBoundingClientRect();return new N(e.x,e.y,e.width,e.height)}focus(){this.dom.focus()}scrollIntoView(e){this.dom.scrollIntoView(e)}isVisible(){return this.dom.offsetParent!==null}show(e=!0){this.setClass("x4hidden",!e)}hide(){this.show(!1)}enable(e=!0){this.setAttribute("disabled",!e),this.enumChildNodes(!0).forEach(o=>{o instanceof HTMLInputElement&&(o.disabled=!e)})}disable(){this.enable(!1)}isDisabled(){return this.getAttribute("disabled")}nextElement(){let e=this.dom.nextElementSibling;return y(e)}prevElement(){let e=this.dom.previousElementSibling;return y(e)}parentElement(e){let t=this.dom;for(;t.parentElement;){let o=y(t.parentElement);if(!e||o&&o instanceof e)return o;t=t.parentElement}return null}firstChild(){let e=this.dom.firstElementChild;return y(e)}lastChild(){let e=this.dom.lastElementChild;return y(e)}enumChildComponents(e){let t=[];return this.enumChildNodes(e).forEach(r=>{let n=y(r);n&&t.push(n)}),t}enumChildNodes(e){return Array.from(e?this.dom.querySelectorAll("*"):this.dom.children)}animate(e,t){this.dom.animate(e,t)}static createElement(e,t,...o){let r;return e==this.createFragment||e===lo?o:(e instanceof Function?(t=t!=null?t:{},!t.children&&o&&o.length&&(t.content=o),r=new e(t!=null?t:{})):r=new c({tag:e,content:o,...t}),o&&o.length,r)}static createFragment(){return this.createElement(lo,null)}queryInterface(e){return null}};i(c,"Component"),c=h([p("x4")],c);function y(s){return s?s[co]:null}i(y,"componentFromDOM");function Lt(s){let e=y(s);return e||new c({existingDOM:s})}i(Lt,"wrapDOM");var St=class St extends c{constructor(){super({})}};i(St,"Flex");var ce=St;function de(s){return s.toString(16).padStart(2,"0")}i(de,"hx");function He(s){return Math.round(s)}i(He,"round");var Rt=class Rt{constructor(...e){this.rgb=[0,0,0,1];this.invalid=!1;P(e[0])?this.setValue(e[0]):this.setRgb(e[0],e[1],e[2],e[3])}setValue(e){if(this.invalid=!1,e.length==4&&/#[0-9a-fA-F]{3}/.test(e)){let t=parseInt(e[1],16),o=parseInt(e[2],16),r=parseInt(e[3],16);return this.setRgb(t<<4|t,o<<4|o,r<<4|r,1)}if(e.length==7&&/#[0-9a-fA-F]{6}/.test(e)){let t=parseInt(e[1],16),o=parseInt(e[2],16),r=parseInt(e[3],16),n=parseInt(e[4],16),a=parseInt(e[5],16),l=parseInt(e[6],16);return this.setRgb(t<<4|o,r<<4|n,a<<4|l,1)}if(e.length==9&&/#[0-9a-fA-F]{8}/.test(e)){let t=parseInt(e[1],16),o=parseInt(e[2],16),r=parseInt(e[3],16),n=parseInt(e[4],16),a=parseInt(e[5],16),l=parseInt(e[6],16),d=parseInt(e[7],16),m=parseInt(e[8],16);return this.setRgb(t<<4|o,r<<4|n,a<<4|l,(d<<4|m)/255)}if(e.startsWith("rgba")){let o=/rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*((\d+)|(\d*\.\d+)|(\.\d+))\s*\)/.exec(e);if(o)return this.setRgb(parseInt(o[1]),parseInt(o[2]),parseInt(o[3]),parseFloat(o[4]))}else if(e.startsWith("rgb")){let o=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(e);if(o)return this.setRgb(parseInt(o[1]),parseInt(o[2]),parseInt(o[3]),1)}else if(e.startsWith("var")){let o=/var\s*\(([^)]*)\)/.exec(e);if(o){let r=o[1].trim(),a=getComputedStyle(document.documentElement).getPropertyValue(r);return this.setValue(a)}}return this.invalid=!0,this.setRgb(255,0,0,1)}setHsv(e,t,o,r=1){let n=Math.min(5,Math.floor(e*6)),a=e*6-n,l=o*(1-t),d=o*(1-a*t),m=o*(1-(1-a)*t),g,M,A;switch(n){case 0:g=o,M=m,A=l;break;case 1:g=d,M=o,A=l;break;case 2:g=l,M=o,A=m;break;case 3:g=l,M=d,A=o;break;case 4:g=m,M=l,A=o;break;case 5:g=o,M=l,A=d;break}return this.setRgb(g*255,M*255,A*255,r)}setRgb(e,t,o,r){return this.rgb=[S(e,0,255),S(t,0,255),S(o,0,255),S(r,0,1)],this}toRgbString(e){let t=this.rgb;return e===!1||t[3]==1?`rgb(${He(t[0])},${He(t[1])},${He(t[2])})`:`rgba(${He(t[0])},${He(t[1])},${He(t[2])},${t[3].toFixed(3)})`}toHexString(){let e=this.rgb;return e[3]==1?`#(${de(e[0])},${de(e[1])},${de(e[2])})`:`rgba(${de(e[0])},${de(e[1])},${de(e[2])},${de(e[3]*255)})`}toRgb(){let e=this.rgb;return{red:e[0],green:e[1],blue:e[2],alpha:e[3]}}toHsv(){let e=this.toRgb();e.red/=255,e.green/=255,e.blue/=255;let t=Math.max(e.red,e.green,e.blue),o=Math.min(e.red,e.green,e.blue),r=t-o,n=t===0?0:r/t,a=t,l;if(r===0)l=0;else switch(t){case e.red:l=(e.green-e.blue)/r/6+(e.green<e.blue?1:0);break;case e.green:l=(e.blue-e.red)/r/6+1/3;break;case e.blue:l=(e.red-e.green)/r/6+2/3;break}return{hue:l,saturation:n,value:a,alpha:e.alpha}}getAlpha(){return this.rgb[3]}setAlpha(e){return this.rgb[3]=S(e,0,1),this}isInvalid(){return this.invalid}};i(Rt,"Color");var L=Rt;var Ot=Symbol("x-drag-cb"),zt=class zt{registerDraggableElement(e){e.addDOMEvent("dragstart",t=>{this.dragSource=e,this.dragGhost=e.dom.cloneNode(!0),this.dragGhost.classList.add("dragged"),document.body.appendChild(this.dragGhost),e.addClass("dragging"),t.dataTransfer.setData("text/string","1"),t.dataTransfer.setDragImage(new Image,0,0),t.stopPropagation()}),e.addDOMEvent("drag",t=>{this.dragGhost.style.left=t.pageX+"px",this.dragGhost.style.top=t.pageY+"px"}),e.addDOMEvent("dragend",t=>{e.removeClass("dragging"),this.dragGhost.remove()}),e.setAttribute("draggable","true")}registerDropTarget(e,t,o){let r=i(d=>{if(o&&!o(this.dragSource)){console.log("reject ",e),d.dataTransfer.dropEffect="none";return}console.log("accepted ",e),d.preventDefault(),d.dataTransfer.dropEffect="copy"},"dragEnter"),n=i(d=>{if(o&&!o(this.dragSource)){console.log("reject ",e),d.dataTransfer.dropEffect="none";return}if(d.preventDefault(),this.dropTarget!=e&&(this.dropTarget=e,this._startCheck()),this.dropTarget){let m={pt:{x:d.pageX,y:d.pageY},data:d.dataTransfer};t("drag",this.dragSource,m)}d.dataTransfer.dropEffect="copy"},"dragOver"),a=i(d=>{this.dropTarget=null,d.preventDefault()},"dragLeave"),l=i(d=>{let m={pt:{x:d.pageX,y:d.pageY},data:d.dataTransfer};t("drop",this.dragSource,m),this.dropTarget=null,e.removeClass("drop-over"),d.preventDefault()},"drop");e.addDOMEvent("dragenter",r),e.addDOMEvent("dragover",n),e.addDOMEvent("dragleave",a),e.addDOMEvent("drop",l),e.setInternalData(Ot,t)}_startCheck(){this.timer&&(clearInterval(this.timer),this._check()),this.timer=setInterval(()=>this._check(),300)}_check(){let e=i(o=>{o.removeClass("drop-over"),o.getInternalData(Ot)("leave",this.dragSource)},"leaving"),t=i(o=>{o.addClass("drop-over"),o.getInternalData(Ot)("enter",this.dragSource)},"entering");this.dropTarget?(!this.notified||this.notified!=this.dropTarget)&&(this.notified&&e(this.notified),this.notified=this.dropTarget,t(this.notified)):this.notified&&(e(this.notified),this.notified=null,clearInterval(this.timer))}};i(zt,"DragManager");var Bt=zt,xr=new Bt;function br(s,e=!1){if(s instanceof RegExp)return{keys:null,pattern:s};let t=s.split("/"),o=[],r="";t[0]==""&&t.shift();for(let n of t){let a=n[0];if(a==="*")o.push("wild"),r+="/(.*)";else if(a===":"){let l=n.indexOf("?",1),d=n.indexOf(".",1);o.push(n.substring(1,l>=0?l:d>=0?d:n.length)),r+=l>=0&&d<0?"(?:/([^/]+?))?":"/([^/]+?)",d>=0&&(r+=(l>=0?"?":"")+"\\"+n.substring(d))}else r+="/"+n}return{keys:o,pattern:new RegExp(`^${r}${e?"(?=$|/)":"/?$"}`,"i")}}i(br,"parseRoute");var Nt=class Nt extends ae{constructor(e=!0){super(),this.m_routes=[],this.m_useHash=e,window.addEventListener("popstate",t=>{let o=this._getLocation(),r=this._find(o);r.handlers.forEach(n=>{n(r.params,o)})})}get(e,t){let{keys:o,pattern:r}=br(e);this.m_routes.push({keys:o,pattern:r,handler:t})}init(){this.navigate(this._getLocation())}_getLocation(){return this.m_useHash?"/"+document.location.hash.substring(1):document.location.pathname}navigate(e,t=!0,o=!1){e.startsWith("/")||(e="/"+e);let r=this._find(e);if(!r||r.handlers.length==0){console.log("route not found: "+e),this.fire("error",{code:404,message:"route not found"});return}if(this.m_useHash){for(;e.at(0)=="/";)e=e.substring(1);e="#"+e}o?window.history.replaceState({},"",e):window.history.pushState({},"",e),t&&r.handlers.forEach(n=>{n(r.params,e)})}_find(e){let t=[],o={},r=[];for(let n of this.m_routes)if(n.keys)if(n.keys.length>0){if(t=n.pattern.exec(e),t===null)continue;for(let a=0;a<n.keys.length;)o[n.keys[a]]=t[++a];r=[...r,n.handler]}else n.pattern.test(e)&&(r=[...r,n.handler]);else{if(t=n.pattern.exec(e),!t)continue;if(t.groups)for(let a in t.groups)o[a]=t.groups[a];r=[...r,n.handler]}return{params:o,handlers:r}}};i(Nt,"Router");var Ht=Nt;var po="http://www.w3.org/2000/svg";function gr(s){return s*Math.PI/180}i(gr,"d2r");function ho(s,e,t,o){let r=gr(o);return{x:s+t*Math.cos(r),y:e+t*Math.sin(r)}}i(ho,"p2c");function D(s){return Math.round(s*1e3)/1e3}i(D,"num");function Ft(s,...e){return e=e.map(t=>typeof t=="number"&&isFinite(t)?D(t):t),String.raw(s,...e)}i(Ft,"clean");var Kt=class Kt{constructor(e){this._dom=document.createElementNS("http://www.w3.org/2000/svg",e)}getDom(){return this._dom}stroke(e,t){return this.setAttr("stroke",e),t!==void 0&&this.setAttr("stroke-width",t+"px"),this}strokeWidth(e){return this.setAttr("stroke-width",e+"px"),this}strokeCap(e){return this.setAttr("stroke-linecap",e)}strokeOpacity(e){return this.setAttr("stroke-opacity",e+"")}antiAlias(e){return this.setAttr("shape-rendering",e?"auto":"crispEdges")}fill(e){return this.setAttr("fill",e),this}no_fill(){return this.setAttr("fill","transparent"),this}setAttr(e,t){return this._dom.setAttribute(e,t),this}setStyle(e,t){let o=this._dom.style;if(U(t)){let r=t+"";Mt(e)||(r+="px"),o[e]=r}else o[e]=t;return this}addClass(e){if(e)if(e.indexOf(" ")>=0){let t=e.split(" ");this._dom.classList.add(...t)}else this._dom.classList.add(e)}clip(e){return this.setAttr("clip-path",`url(#${e})`),this}transform(e){return this.setAttr("transform",e),this}rotate(e,t,o){return this.transform(`rotate( ${e} ${t} ${o} )`),this}translate(e,t){return this.transform(`translate( ${e} ${t} )`),this}scale(e){return this.transform(`scale( ${e} )`),this}addDOMEvent(e,t,o=!1){return $e(this._dom,e,t,o),this}};i(Kt,"SvgItem");var pe=Kt,qt=class qt extends pe{constructor(){super("path"),this._path=""}_update(){return this.setAttr("d",this._path),this}moveTo(e,t){return this._path+=Ft`M${e},${t}`,this._update()}lineTo(e,t){return this._path+=Ft`L${e},${t}`,this._update()}closePath(){return this._path+="Z",this._update()}arc(e,t,o,r,n){let a=ho(e,t,o,r-90),l=ho(e,t,o,n-90),d=n-r<=180?"0":"1";return this._path+=Ft`M${a.x},${a.y}A${o},${o} 0 ${d} 1 ${l.x},${l.y}`,this._update()}};i(qt,"SvgPath");var lt=qt,Gt=class Gt extends pe{constructor(e,t,o){super("text"),this.setAttr("x",D(e)+""),this.setAttr("y",D(t)+""),this._dom.innerHTML=o}font(e){return this.setAttr("font-family",e)}fontSize(e){return this.setAttr("font-size",e+"")}fontWeight(e){return this.setAttr("font-weight",e)}textAlign(e){let t;switch(e){case"left":t="start";break;case"center":t="middle";break;case"right":t="end";break;default:return this}return this.setAttr("text-anchor",t)}verticalAlign(e){let t;switch(e){case"top":t="hanging";break;case"center":t="middle";break;case"bottom":t="baseline";break;case"baseline":t="mathematical";break;default:return}return this.setAttr("alignment-baseline",t)}};i(Gt,"SvgText");var ct=Gt,Qt=class Qt extends pe{constructor(e){super(e)}};i(Qt,"SvgShape");var Je=Qt,Ne=class Ne extends pe{constructor(e,t,o,r){super("linearGradient"),this._id="gx-"+Ne.g_id,Ne.g_id++,this.setAttr("id",this._id),this.setAttr("x1",P(e)?e:D(e)+""),this.setAttr("x2",P(o)?o:D(o)+""),this.setAttr("y1",P(t)?t:D(t)+""),this.setAttr("y2",P(r)?r:D(r)+""),this._stops=[]}get id(){return"url(#"+this._id+")"}addStop(e,t){return this._dom.insertAdjacentHTML("beforeend",`<stop offset="${e}%" stop-color="${t}"></stop>`),this}};i(Ne,"SvgGradient"),Ne.g_id=1;var dt=Ne,pt=class pt extends pe{constructor(e="g"){super(e)}append(e){return this._dom.appendChild(e.getDom()),e}path(){let e=new lt;return this.append(e)}text(e,t,o){let r=new ct(e,t,o);return this.append(r)}ellipse(e,t,o,r=o){let n=new Je("ellipse");return n.setAttr("cx",D(e)+""),n.setAttr("cy",D(t)+""),n.setAttr("rx",D(o)+""),n.setAttr("ry",D(r)+""),this.append(n)}rect(e,t,o,r){r<0&&(t=t+r,r=-r);let n=new Je("rect");return n.setAttr("x",D(e)+""),n.setAttr("y",D(t)+""),n.setAttr("width",D(o)+""),n.setAttr("height",D(r)+""),this.append(n)}group(){let e=new pt;return this.append(e)}linear_gradient(e,t,o,r){let n=new dt(e,t,o,r);return this.append(n)}clear(){let e=this._dom;for(;e.firstChild;)e.removeChild(e.firstChild)}};i(pt,"SvgGroup");var et=pt,Xe=class Xe extends et{constructor(){super()}addClip(e,t,o,r){let n="c-"+Xe.g_clip_id++,a=new et("clipPath");return a.setAttr("id",n),a.rect(e,t,o,r),this.append(a),n}};i(Xe,"SvgBuilder"),Xe.g_clip_id=1;var Ut=Xe,Wt=class Wt extends c{constructor(e){super({...e,tag:"svg",ns:po}),this.setAttribute("xmlns",po),e.viewbox&&this.setAttribute("viewbox",e.viewbox),e.svg&&this.dom.appendChild(e.svg.getDom())}};i(Wt,"SvgComponent");var Vt=Wt;var E=class extends c{};i(E,"Box"),E=h([p("x4")],E);var u=class extends E{};i(u,"HBox"),u=h([p("x4")],u);var _=class extends E{constructor(e){super(e)}};i(_,"VBox"),_=h([p("x4")],_);var V=class extends E{constructor(e){var t;super(e),this._items=(t=e.items)==null?void 0:t.map(o=>({...o,page:null})),e.default?this.select(e.default):this._items.length&&this.select(this._items[0].name)}select(e){let t=this.query(".selected");t&&t.setClass("selected",!1);let o=this._items.find(r=>r.name==e);o&&(o.page||(o.page=this._createPage(o),this.appendContent(o.page)),t=o.page,t&&t.setClass("selected",!0))}_createPage(e){let t;return t=e.content,t==null||t.setData("stackname",e.name),t}};i(V,"StackBox"),V=h([p("x4")],V);var mo='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!--!Font Awesome Pro 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path d="M299.3 244.7c6.2 6.2 6.2 16.4 0 22.6l-192 192c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6L265.4 256 84.7 75.3c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0l192 192z"/></svg>';var he=class extends u{constructor(e){var o;super(e),this.mapPropEvents(e,"click");let t=[];(o=e.items)==null||o.map((r,n)=>{t.push(new v({label:r.label,icon:r.icon,click:i(()=>{this.fire("click",{context:r.name})},"click")})),n!=e.items.length-1&&t.push(new f({iconId:mo}))}),this.setContent(t)}};i(he,"Breadcrumbs"),he=h([p("x4")],he);var jt=class jt{constructor(){this.cache=new Map,this.waiters=new Map}async load(e){return this.cache.has(e)?Promise.resolve(this.cache.get(e)):new Promise((t,o)=>{this.waiters.has(e)?this.waiters.get(e).push(t):(this.waiters.set(e,[t]),this._load(e).then(r=>{console.timeEnd(e),this.cache.set(e,r),this.waiters.get(e).forEach(a=>a(r))}))})}async _load(e){console.time(e);let t=await fetch(e);if(t.ok)return t.text()}};i(jt,"SvgLoader");var Yt=jt,ht=new Yt,f=class extends c{constructor(e){super(e),this.setIcon(e.iconId)}setIcon(e){if(e){if(e.startsWith("var:"))do{let t=e.substring(4);e=document.documentElement.style.getPropertyValue(t)}while(e.startsWith("var:"));e.startsWith("data:image/svg+xml,<svg")?this.dom.insertAdjacentHTML("beforeend",e.substring(19)):e.endsWith(".svg")?ht.load(e).then(t=>{this.clearContent(),this.dom.insertAdjacentHTML("beforeend",t)}):this.setContent(new c({tag:"img",attrs:{src:e}}))}else this.clearContent(),this.addClass("empty")}};i(f,"Icon"),f=h([p("x4")],f);var v=class extends c{constructor(e){super({...e,tag:"button",content:null}),this.mapPropEvents(e,"click"),this.addDOMEvent("click",t=>this._on_click(t)),this.setContent([new f({id:"icon",iconId:this.props.icon}),new c({id:"label",content:this.props.label})])}_on_click(e){this.fire("click",{}),e.preventDefault(),e.stopPropagation()}setText(e){this.query("#label").setContent(e)}setIcon(e){this.query("#icon").setIcon(e)}};i(v,"Button"),v=h([p("x4")],v);var K=class extends E{constructor(e){super(e),e.align&&this.addClass("align-"+e.align),this.addClass(e.vertical?"x4vbox":"x4hbox"),e.items&&this.setButtons(e.items),this.mapPropEvents(e,"btnclick")}setButtons(e){this.clearContent();let t=[];e==null||e.forEach(o=>{if(o==="-")o=new ce;else if(P(o)){let r,n=o,[a,l]=n.split(".");switch(a){case"ok":r=b.global.ok;break;case"cancel":r=b.global.cancel;break;case"abort":r=b.global.abort;break;case"no":r=b.global.no;break;case"yes":r=b.global.yes;break;case"retry":r=b.global.retry;break}o=new v({cls:l,label:r,click:i(()=>{this.fire("btnclick",{button:n})},"click")})}t.push(o)}),super.setContent(t)}};i(K,"BtnGroup"),K=h([p("x4")],K);var Fe,x=class extends c{constructor(t){super({...t,content:null});qe(this,Fe);this.setContent([new f({id:"icon",iconId:this.props.icon}),Ge(this,Fe,new c({tag:"span",id:"text"}))]);let o=this.props.text;this.setText(o),t.labelFor&&this.setAttribute("for",t.labelFor)}setText(t){T(this,Fe).setContent(t),T(this,Fe).setClass("empty",!t)}setIcon(t){this.query("#icon").setIcon(t)}};Fe=new WeakMap,i(x,"Label"),x=h([p("x4")],x);var C=class extends c{constructor(e,t){super({}),this._type=e,this.addClass(e),this.addDOMEvent("pointerdown",o=>{this.setCapture(o.pointerId),this._ref=t!=null?t:y(this.dom.parentElement),this._delta={x:0,y:0};let r=this._ref.getBoundingRect();this._type.includes("left")?this._delta.x=o.pageX-r.left:this._delta.x=o.pageX-(r.left+r.width),this._type.includes("top")?this._delta.y=o.pageY-r.top:this._delta.y=o.pageY-(r.top+r.height)}),this.addDOMEvent("pointerup",o=>{this.releaseCapture(o.pointerId),this._ref=null}),this.addDOMEvent("pointermove",o=>{this._onMouseMove(o)})}_onMouseMove(e){if(!this._ref)return;let t={x:e.pageX-this._delta.x,y:e.pageY-this._delta.y},o=this._ref.getBoundingRect(),r={},n=!0;this._type.includes("top")&&(r.top=t.y,r.height=o.top+o.height-t.y,n=!1),this._type.includes("bottom")&&(r.height=t.y-o.top,n=!1),this._type.includes("left")&&(r.left=t.x,r.width=o.left+o.width-t.x),this._type.includes("right")&&(r.width=t.x-o.left),this._ref.setStyle(r);let a=this._ref.getBoundingRect();this.fire("resize",{size:n?a.width:a.height}),e.preventDefault(),e.stopPropagation()}};i(C,"CSizer"),C=h([p("x4")],C);var Ue,uo=0,xo=[],O=[],Zt=[],I=class extends c{constructor(t){super(t);this._isopen=!1;this._isshown=!1;this._dismiss=i(t=>{O.some(r=>r.dom.contains(t.target))||(t.preventDefault(),t.stopPropagation(),this.dismiss())},"_dismiss");this.props.sizable&&this._createSizers()}displayNear(t,o="top left",r="top left",n={x:0,y:0}){this.setStyle({left:"0px",top:"0px"}),this._show();let a=this.getBoundingRect(),l=t.left,d=t.top;r.indexOf("right")>=0?l=t.left+t.width:r.indexOf("center")>=0&&(l=t.left+t.width/2),r.indexOf("bottom")>=0?d=t.bottom:r.indexOf("middle")>=0&&(d=t.top+t.height/2);let m="l";o.indexOf("right")>=0?l-=a.width:o.indexOf("center")>=0&&(l-=a.width/2);let g="t";o.indexOf("bottom")>=0?d-=a.height:o.indexOf("middle")>=0&&(d-=a.height/2),n&&(l+=n.x,d+=n.y),l+=document.scrollingElement.scrollLeft,d+=document.scrollingElement.scrollTop,this.displayAt(l,d)}displayCenter(){this.displayNear(new N(window.innerWidth/2,window.innerHeight/2,0,0),"center middle")}displayAt(t,o){this.setStyle({left:t+"px",top:o+"px"}),this._show();let r=this.getBoundingRect(),n=window.innerWidth-16,a=window.innerHeight-16;r.right>n&&this.setStyleValue("left",n-r.width),r.bottom>a&&this.setStyleValue("top",a-r.height),this.props.movable&&(this.queryAll(".caption-element").forEach(d=>new mt(d,this)),this.hasClass("popup-caption")&&new mt(this,this)),this.fire("opened",{})}_show(){this.props.modal&&!this._isshown&&(this._showModalMask(),xo.push(this),uo++),this._isshown=!0,this.props.autoClose&&(O.length==0&&document.addEventListener("pointerdown",this._dismiss),O.push(this),this.setData("close",this.props.autoClose===!0?R():this.props.autoClose)),Zt.push(this),document.body.appendChild(this.dom),this.show()}show(t=!0){this._isopen=t,super.show(t)}isOpen(){return this._isopen}close(){document.body.removeChild(this.dom);let t=Zt.indexOf(this);if(console.assert(t>=0),Zt.splice(t,1),this.props.autoClose){let o=O.indexOf(this);o>=0&&(O.splice(o,1),O.length==0&&document.removeEventListener("pointerdown",this._dismiss))}if(this.props.modal){let o=xo.pop();console.assert(o==this),this._updateModalMask()}this._isshown=!1,this.fire("closed",{})}dismiss(t=!1){if(O.length==0)return;let o=this.getData("close"),r=[],n=[],a=-1;t&&(a=O.indexOf(this)),O.forEach((d,m)=>{d.getData("close")==o&&m>a?r.push(d):n.push(d)});let l=r.reverse();O=n,O.length==0&&document.removeEventListener("pointerdown",this._dismiss),l.forEach(d=>d.close())}_showModalMask(){Ue||(Ue=new c({cls:"x4modal-mask",domEvents:{click:this._dismiss}})),Ue.show(!0),document.body.insertAdjacentElement("beforeend",Ue.dom)}_updateModalMask(){--uo==0?Ue.show(!1):this.dom.insertAdjacentElement("beforebegin",Ue.dom)}_createSizers(){this.appendContent([new C("top"),new C("bottom"),new C("left"),new C("right"),new C("top-left"),new C("bottom-left"),new C("top-right"),new C("bottom-right")])}};i(I,"Popup"),I=h([p("x4")],I);var $t=class $t{constructor(e,t){this.self=!!t,e.addDOMEvent("pointerdown",o=>{if(this.self&&o.target!=e.dom)return;e.setCapture(o.pointerId),this.ref=t!=null?t:y(e.dom.parentElement),this.delta={x:0,y:0};let r=this.ref.getBoundingRect();this.delta.x=o.pageX-r.left,this.delta.y=o.pageY-r.top}),e.addDOMEvent("pointerup",o=>{e.releaseCapture(o.pointerId),this.ref=null}),e.addDOMEvent("pointermove",o=>{this._onMouseMove(o)})}_onMouseMove(e){if(!this.ref)return;let t={x:e.pageX-this.delta.x,y:e.pageY-this.delta.y},o=this.ref.getBoundingRect(),r={};this.ref.setStyle({top:t.y+"",left:t.x+""}),e.preventDefault(),e.stopPropagation()}};i($t,"CMover");var mt=$t;var bo=400,me=class extends c{constructor(){super({})}};i(me,"CMenuSep"),me=h([p("x4")],me);var ut=new ie,Z=class extends c{constructor(e){super({disabled:e.disabled,cls:e.cls}),e.menu&&this.addClass("popup"),this.setContent([new f({id:"icon",iconId:e.icon}),new c({id:"text",content:e.text})]),e.menu?(this.menu=e.menu,this.addDOMEvent("mouseenter",()=>this.openSub(!0)),this.addDOMEvent("click",()=>this.openSub(!1)),this.addDOMEvent("mouseleave",()=>this.closeSub()),this.menu.on("opened",()=>this.addClass("opened")),this.menu.on("closed",()=>this.removeClass("opened"))):(this.addDOMEvent("mouseenter",()=>{ut.setTimeout("open",bo,()=>{this.dismiss(!0)})}),this.addDOMEvent("click",()=>{this.dismiss(!1),e.click&&e.click(new Event("click"))}))}dismiss(e){let t=this.parentElement(z);t&&t.dismiss(e)}openSub(e){let t=i(()=>{this.dismiss(!0);let o=this.getBoundingRect();this.menu.displayAt(o.right-4,o.top)},"open");e?ut.setTimeout("open",bo,t):(ut.clearTimeout("open"),t())}closeSub(){ut.clearTimeout("open")}};i(Z,"CMenuItem"),Z=h([p("x4")],Z);var z=class extends I{constructor(e){var o;super({...e,autoClose:"menu",modal:!1}),this.addClass("x4vbox");let t=(o=e.items)==null?void 0:o.map(r=>r==="-"?new me:P(r)?new Z({text:r,click:null,cls:"title"}):r instanceof c?r:new Z(r));this.setContent(t)}};i(z,"Menu"),z=h([p("x4")],z);var go='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512" fill="currentColor"><!--!Font Awesome Pro 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path d="M9.4 256l11.3-11.3 192-192L224 41.4 246.6 64 235.3 75.3 54.6 256 235.3 436.7 246.6 448 224 470.6l-11.3-11.3-192-192L9.4 256z"/></svg>';var fo='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" fill="currentColor"><!--!Font Awesome Pro 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path d="M128 16l0-16L96 0l0 16 0 48L32 64 0 64 0 96l0 64 0 32L0 480l0 32 32 0 384 0 32 0 0-32 0-288 0-32 0-64 0-32-32 0-64 0 0-48 0-16L320 0l0 16 0 48L128 64l0-48zM32 192l384 0 0 288L32 480l0-288zm0-96l384 0 0 64L32 160l0-64zM331.3 283.3L342.6 272 320 249.4l-11.3 11.3L208 361.4l-52.7-52.7L144 297.4 121.4 320l11.3 11.3 64 64L208 406.6l11.3-11.3 112-112z"/></svg>';var vo='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512" fill="currentColor"><!--!Font Awesome Pro 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path d="M310.6 256l-11.3 11.3-192 192L96 470.6 73.4 448l11.3-11.3L265.4 256 84.7 75.3 73.4 64 96 41.4l11.3 11.3 192 192L310.6 256z"/></svg>';var ue=class extends _{constructor(e){super(e),this.mapPropEvents(e,"change"),this.m_date=e.date?se(e.date):new Date,this._update()}_update(){let e=se(this.m_date);e.setDate(1);let t=e.getDay();t==0&&(t=7),e.setDate(-t+1+1);let o=se(e),r=Y(this.m_date),n=Y(new Date),a=se(this.m_date);a.setDate(1),a.setMonth(a.getMonth()+1),a.setDate(0);let l=Y(a),d=[],m=new u({cls:"month-sel",content:[new x({cls:"month",text:F(this.m_date,"O"),dom_events:{click:i(()=>this._choose("month"),"click")}}),new x({cls:"year",text:F(this.m_date,"Y"),dom_events:{click:i(()=>this._choose("year"),"click")}}),new ce,new v({icon:go,click:i(()=>this._next(!1),"click")}),new v({icon:fo,click:i(()=>this.setDate(new Date),"click"),tooltip:b.global.today}),new v({icon:vo,click:i(()=>this._next(!0),"click")})]});d.push(m);let g=[];g.push(new u({cls:"weeknum cell"}));for(let w=0;w<7;w++)g.push(new x({cls:"cell",text:b.global.day_short[(w+1)%7]}));d.push(new u({cls:"week header",content:g}));let M=this.m_date.getMonth(),A=!0;for(;Y(o)<=l;){let w=[new u({cls:"weeknum cell",content:new c({tag:"span",content:F(o,"w")})})];for(let Ve=0;Ve<7;Ve++){let oe="cell day";Y(o)==r&&(oe+=" selection"),Y(o)==n&&(oe+=" today"),o.getMonth()!=M&&(oe+=" out");let re=i(ot=>new u({cls:oe,flex:1,content:new c({cls:"text",content:Qe(`<span>${F(ot,"d")}</span>`)}),dom_events:{click:i(()=>this.select(ot),"click")}}),"mkItem");w.push(re(se(o))),o.setDate(o.getDate()+1),A=!1}d.push(new u({cls:"week",flex:1,content:w}))}this.setContent(d)}select(e){this.m_date=e,this.fire("change",{value:e}),this._update()}_next(e){this.m_date.setMonth(this.m_date.getMonth()+(e?1:-1)),this._update()}_choose(e){var n,a,l,d;let t=[];if(e=="month")for(let m=0;m<12;m++)t.push({text:b.global.month_long[m],click:i(()=>{this.m_date.setMonth(m),this._update()},"click")});else if(e=="year"){let m=(a=(n=this.props.minDate)==null?void 0:n.getFullYear())!=null?a:1900,g=(d=(l=this.props.maxDate)==null?void 0:l.getFullYear())!=null?d:2037;for(let M=g;M>=m;M--)t.push({text:""+M,click:i(()=>{this.m_date.setFullYear(M),this._update()},"click")})}let o=new z({items:t}),r=this.getBoundingRect();o.displayAt(r.left,r.top)}getDate(){return this.m_date}setDate(e){this.m_date=e,this._update()}};i(ue,"Calendar"),ue=h([p("x4")],ue);var k=class extends c{constructor(e){var t;switch(super({tag:"input",...e}),this.setAttribute("type",(t=e.type)!=null?t:"text"),this.setAttribute("name",e.name),e.type){case"checkbox":case"radio":{let o=this.dom;o.checked=e.checked,o.value=e.value+"";break}case"range":{this.setAttribute("min",e.min),this.setAttribute("max",e.max),this.setAttribute("step",e.step),this.setAttribute("value",e.value);break}case"number":{this.setAttribute("required",e.required),this.setAttribute("readonly",e.readonly),this.setAttribute("min",e.min),this.setAttribute("max",e.max),this.setAttribute("step",e.step),this.setAttribute("value",e.value+"");break}case"date":{this.setAttribute("required",e.required);let o=e.value;o instanceof Date||this.setAttribute("value",o);break}case"file":{let o;Array.isArray(e.accept)?o=e.accept.join(","):o=e.accept,this.setAttribute("accept",o);break}default:{this.setAttribute("required",e.required),this.setAttribute("readonly",e.readonly),e.value!==null&&e.value!==void 0&&this.setAttribute("value",e.value),e.pattern!==null&&e.pattern!==void 0&&this.setAttribute("pattern",e.pattern),e.placeholder!==null&&e.placeholder!==void 0&&this.setAttribute("placeholder",e.placeholder),e.spellcheck===!1&&this.setAttribute("spellcheck",!1);break}}}getValue(){return this.dom.value}setValue(e){this.dom.value=e+""}getNumValue(){return parseFloat(this.getValue())}setNumValue(e){this.setValue(e+"")}setReadOnly(e){let t=this.dom;t.readOnly=e}selectAll(){this.dom.select()}select(e,t=9999){this.dom.setSelectionRange(e,e+t)}getSelection(){let e=this.dom;return{start:e.selectionStart,length:e.selectionEnd-e.selectionStart}}queryInterface(e){return e=="form-element"?{getRawValue:i(()=>this.getValue(),"getRawValue"),setRawValue:i(o=>{this.setValue(o)},"setRawValue")}:super.queryInterface(e)}};i(k,"Input"),k=h([p("x4")],k);var _o='data:image/svg+xml,<svg viewBox="0 0 10 7" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">%0D%0A%09<path d="M4 4.586L1.707 2.293A1 1 0 1 0 .293 3.707l3 3a.997.997 0 0 0 1.414 0l5-5A1 1 0 1 0 8.293.293L4 4.586z" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd">%0D%0A%09</path>%0D%0A</svg>';var xe=class extends c{constructor(e){super(e);let t=R();this.mapPropEvents(e,"change"),this.setContent([new c({cls:"inner",content:[this._input=new k({type:"checkbox",id:t,checked:e.checked,dom_events:{change:i(()=>this._on_change(),"change")}})]}),new x({tag:"label",text:e.label,labelFor:t,id:void 0})]),ht.load(_o).then(o=>{this.query(".inner").dom.insertAdjacentHTML("beforeend",o)})}_on_change(){this.fire("change",{value:this.getCheck()})}getCheck(){return this._input.dom.checked}setCheck(e){let t=this._input.dom;t.checked=e}setLabel(e){this.query("label").setText(e)}toggle(){this.setCheck(!this.getCheck())}};i(xe,"Checkbox"),xe=h([p("x4")],xe);var wo='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor"><!--!Font Awesome Pro 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path d="M479.4 240L384 240l-16 0 0 32 16 0 95.4 0C471.6 383 383 471.6 272 479.4l0-95.4 0-16-32 0 0 16 0 95.4C129 471.6 40.4 383 32.6 272l95.4 0 16 0 0-32-16 0-95.4 0C40.4 129 129 40.4 240 32.6l0 95.4 0 16 32 0 0-16 0-95.4C383 40.4 471.6 129 479.4 240zM256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512z"/></svg>';var $=class extends u{constructor(e){super(e);let t,o;this.setContent([t=new c({cls:"swatch"}),o=new k({type:"text",value:"",spellcheck:!1}),We("eyedropper")?new v({icon:wo,click:i(()=>{new window.EyeDropper().open().then(l=>{n=new L(l.sRGBHex),r(n)})},"click")}):null]),o.addDOMEvent("input",()=>{let a=o.getValue(),l=new L(a);l.isInvalid()||(n=l,r(n))});let r=i(a=>{t.setStyleValue("backgroundColor",a.toRgbString(!1)),o.setValue(a.toRgbString(!1))},"updateColor"),n;e.color instanceof L?n=e.color:n=new L(e.color),r(n)}};i($,"ColorInput"),$["$cls-ns"]="x4",$=h([p("x4")],$);var X=class extends E{constructor(t,o){super(t);this.mdown=!1;this.hsv={hue:1,saturation:1,value:1,alpha:1};this.setContent([this.color=new c({cls:"overlay"}),new c({cls:"overlay",style:{backgroundImage:"linear-gradient(90deg, rgb(255, 255, 255), transparent)"}}),new c({cls:"overlay",style:{backgroundImage:"linear-gradient(0deg, rgb(0, 0, 0), transparent)"}}),this.thumb=new c({cls:"thumb"})]),this.setDOMEvents({pointerdown:i(r=>this.mousedown(r),"pointerdown"),pointermove:i(r=>this.mousemove(r),"pointermove"),pointerup:i(r=>this.mouseup(r),"pointerup"),created:i(()=>this.updateThumbMarker(),"created")}),this.updateBaseColor(o)}mousedown(t){this.mdown=!0,this.irect=this.getBoundingRect(),this.setCapture(t.pointerId)}mousemove(t){if(this.mdown){let o=this.irect,n=S(t.clientX-o.left,0,o.width)/o.width,l=S(t.clientY-o.top,0,o.height)/o.height;this.hsv.saturation=n,this.hsv.value=1-l,this.updateThumbMarker(),this.fire("sat_change",{saturation:this.hsv.saturation,value:this.hsv.value})}}mouseup(t){this.mdown&&(this.releaseCapture(t.pointerId),this.mdown=!1)}updateThumbMarker(){let t=this.color.getBoundingRect();this.thumb.setStyle({left:this.hsv.saturation*t.width+"px",bottom:this.hsv.value*t.height+"px"})}updateBaseColor(t){let o=new L(0,0,0);o.setHsv(t.hue,1,1,1),this.color.setStyleValue("backgroundColor",o.toRgbString(!1))}move(t,o){switch(t){case"saturation":{this.hsv.saturation+=o,this.hsv.saturation<0?this.hsv.saturation=0:this.hsv.saturation>1&&(this.hsv.saturation=1),this.fire("sat_change",{saturation:this.hsv.saturation,value:this.hsv.value}),this.updateThumbMarker();break}case"value":{this.hsv.value+=o,this.hsv.value<0?this.hsv.value=0:this.hsv.value>1&&(this.hsv.value=1),this.fire("sat_change",{saturation:this.hsv.saturation,value:this.hsv.value}),this.updateThumbMarker();break}}}};i(X,"Saturation"),X=h([p("x4")],X);var be=class extends E{constructor(t,o){super(t);this.hsv={hue:1,saturation:1,value:1,alpha:1};this.mdown=!1;this.setContent([this.thumb=new c({cls:"thumb",left:"50%"})]),this.setDOMEvents({pointerdown:i(r=>this.mousedown(r),"pointerdown"),pointermove:i(r=>this.mousemove(r),"pointermove"),pointerup:i(r=>this.mouseup(r),"pointerup")}),this.updateHue(o)}mousedown(t){this.mdown=!0,this.irect=this.getBoundingRect(),this.setCapture(t.pointerId)}mousemove(t){if(this.mdown){let o=this.irect,n=S(t.clientX-o.left,0,o.width)/o.width;this.hsv.hue=n,this.updateHue(this.hsv),this.fire("hue_change",{hue:this.hsv.hue})}}mouseup(t){this.mdown&&(this.releaseCapture(t.pointerId),this.mdown=!1)}updateHue(t){this.hsv.hue=t.hue,this.thumb.setStyleValue("left",t.hue*100+"%")}move(t){this.hsv.hue+=t,this.hsv.hue<0?this.hsv.hue=0:this.hsv.hue>1&&(this.hsv.hue=1),this.fire("hue_change",{hue:this.hsv.hue}),this.updateHue(this.hsv)}};i(be,"HueSlider"),be=h([p("x4")],be);var ge=class extends E{constructor(t,o){super(t);this.hsv={hue:1,saturation:1,value:1,alpha:1};this.mdown=!1;this.setContent([new c({cls:"overlay checkers"}),this.color=new c({cls:"overlay color"}),this.thumb=new c({cls:"thumb",left:"50%"})]),this.setDOMEvents({pointerdown:i(r=>this._on_mousedown(r),"pointerdown"),pointermove:i(r=>this._on_mousemove(r),"pointermove"),pointerup:i(r=>this._on_mouseup(r),"pointerup")}),this.updateAlpha(),this.updateBaseColor(o)}_on_mousedown(t){this.mdown=!0,this.irect=this.getBoundingRect(),this.setCapture(t.pointerId)}_on_mousemove(t){if(this.mdown){let o=this.irect,n=S(t.clientX-o.left,0,o.width)/o.width;this.hsv.alpha=n,this.updateAlpha(),this.fire("alpha_change",{alpha:this.hsv.alpha})}}_on_mouseup(t){this.mdown&&(this.releaseCapture(t.pointerId),this.mdown=!1)}updateAlpha(){this.thumb.setStyleValue("left",this.hsv.alpha*100+"%")}updateBaseColor(t){let o=new L(0,0,0);o.setHsv(t.hue,t.saturation,t.value,1),this.color.setStyleValue("backgroundImage",`linear-gradient(90deg, transparent, ${o.toRgbString(!1)})`)}setColor(t){this.hsv=t,this.updateBaseColor(t),this.updateAlpha()}move(t){this.hsv.alpha+=t,this.hsv.alpha<0?this.hsv.alpha=0:this.hsv.alpha>1&&(this.hsv.alpha=1),this.fire("alpha_change",{alpha:this.hsv.alpha}),this.updateAlpha()}};i(ge,"AlphaSlider"),ge=h([p("x4")],ge);var fe=class extends _{constructor(e){super(e),e.color instanceof L?this._base=e.color:this._base=new L(e.color);let t=this._base.toHsv();this.setAttribute("tabindex",0),this.setContent([this._sat=new X({},t),new u({cls:"body",content:[new _({cls:"x4flex",content:[this._hue=new be({},t),this._alpha=new ge({},t)]}),new E({cls:"swatch",content:[new c({cls:"overlay checkers"}),this._swatch=new c({cls:"overlay"})]})]})]),this._sat.on("sat_change",r=>{t.saturation=r.saturation,t.value=r.value,o(),this._alpha.updateBaseColor(t)}),this._hue.on("hue_change",r=>{t.hue=r.hue,this._sat.updateBaseColor(t),this._alpha.updateBaseColor(t),o()}),this._alpha.on("alpha_change",r=>{t.alpha=r.alpha,o()});let o=i(()=>{this._base.setHsv(t.hue,t.saturation,t.value,t.alpha),this._swatch.setStyleValue("backgroundColor",this._base.toRgbString()),this._swatch.setAttribute("tooltip",this._base.toRgbString()),this.fire("change",{color:this._base})},"updateColor");We("eyedropper")&&this._swatch.addDOMEvent("click",r=>{new window.EyeDropper().open().then(a=>{t=new L(a.sRGBHex).toHsv(),this._alpha.setColor(t),this._sat.updateBaseColor(t),this._hue.updateHue(t),o()})}),this.addDOMEvent("keydown",r=>this._onkey(r)),o()}_onkey(e){switch(e.key){case"ArrowLeft":{e.ctrlKey?this._hue.move(-.01):this._sat.move("saturation",-.01);break}case"ArrowRight":{e.ctrlKey?this._hue.move(.01):this._sat.move("saturation",.01);break}case"ArrowUp":{e.ctrlKey?this._alpha.move(.01):this._sat.move("value",.01);break}case"ArrowDown":{e.ctrlKey?this._alpha.move(-.01):this._sat.move("value",-.01);break}}}};i(fe,"ColorPicker"),fe=h([p("x4")],fe);var J=class extends c{constructor(e){super(e)}};i(J,"Viewport"),J=h([p("x4")],J);var q=class extends c{constructor(e){super(e),this.setContent(new J({}))}getViewport(){return this.firstChild()}};i(q,"ScrollView"),q=h([p("x4")],q);var Xt=(r=>(r[r.first=0]="first",r[r.prev=1]="prev",r[r.next=2]="next",r[r.last=3]="last",r))(Xt||{}),G=class extends c{constructor(t){super({...t});this.preventFocus=!1;this.setAttribute("tabindex",0);let o=new q({cls:"body"});this._view=o.getViewport(),this.setContent([o]),this.setDOMEvents({click:i(r=>this._on_click(r),"click"),keydown:i(r=>this._on_key(r),"keydown"),dblclick:i(r=>this._on_click(r),"dblclick"),contextmenu:i(r=>this._on_ctx_menu(r),"contextmenu")}),t.items&&this.setItems(t.items)}_on_key(t){if(!this.isDisabled()){switch(t.key){case"ArrowDown":{this.navigate(2);break}case"ArrowUp":{this.navigate(1);break}case"Home":{this.navigate(0);break}case"End":{this.navigate(3);break}default:return}t.preventDefault(),t.stopPropagation()}}navigate(t){this._selitem||(t==2?t=0:t=3);let o=i((r,n)=>{for(;r&&!r.isVisible();)r=n?r.nextElement():r.prevElement();return r},"next_visible");if(t==0||t==3){let r=t==0?this._view.firstChild():this._view.lastChild();if(r=o(r,t==0),r){let n=r.getData("id");return this._selectItem(n,r),!0}}else{let r=t==2?this._selitem.nextElement():this._selitem.prevElement();if(r=o(r,t==2),r){let n=r.getData("id");return this._selectItem(n,r),!0}}return!1}_on_click(t){t.stopImmediatePropagation(),t.preventDefault();let o=t.target;for(;o&&o!=this.dom;){let r=y(o);if(r&&r.hasClass("x4item")){let n=r.getData("id"),a={context:n};t.type=="click"?this.fire("click",a):this.fire("dblClick",a),a.defaultPrevented||this._selectItem(n,r);return}o=o.parentElement}this.clearSelection()}_on_ctx_menu(t){t.preventDefault();let o=t.target;for(;o&&o!=this.dom;){let r=y(o);if(r&&r.hasClass("x4item")){let n=r.getData("id");this._selectItem(n,r),this.fire("contextMenu",{uievent:t,context:n});return}o=o.parentElement}this.fire("contextMenu",{uievent:t,context:null})}_selectItem(t,o){this._selitem&&(this._selitem.removeClass("selected"),this._selitem=void 0),this._selitem=o,this._selection=t,o&&(o.addClass("selected"),o.scrollIntoView({behavior:"smooth",block:"nearest"}));let r=this._findItem(t);this.fire("selectionChange",{selection:r})}_findItem(t){return this._items.find(o=>o.id==t)}_findItemIndex(t){return this._items.findIndex(o=>o.id==t)}clearSelection(){this._selitem&&(this._selitem.removeClass("selected"),this._selitem=void 0),this._selection=void 0,this.fire("selectionChange",{selection:void 0})}setItems(t){if(this.clearSelection(),this._view.clearContent(),this._items=t,t){let o=t.map(r=>this.renderItem(r));this._view.setContent(o)}}renderItem(t){var n;let r=((n=this.props.renderer)!=null?n:this.defaultRenderer)(t);return r.addClass("x4item"),r.setData("id",t.id+""),r}defaultRenderer(t){return new u({cls:t.cls,content:new x({icon:t.iconId,text:t.text})})}filter(t){let o=this._view.enumChildComponents(!1);if(!t)o.forEach(r=>r.show(!0));else{let r=this._items.filter(n=>n.text.includes(t)).map(n=>n.id+"");o.forEach(n=>{n.show(r.includes(n.getData("id")))})}}appendItem(t,o=!1,r=!0){r&&this.clearSelection();let n=this.renderItem(t);o?(this._items.unshift(t),this._view.prependContent(n)):(this._items.push(t),this._view.appendContent(n)),r&&this._selectItem(t.id,n)}updateItem(t,o){var l;let r=this._findItemIndex(t);if(r<0)return;let n=!1;this._selection&&this._selection===t&&(n=!0),this._items[r]=o;let a=(l=this.query(`[data-id="${o.id}"]`))==null?void 0:l.dom;if(a){let d=this.renderItem(o);this._view.dom.replaceChild(d.dom,a),n&&this._selectItem(o.id,d)}}};i(G,"Listbox"),G=h([p("x4")],G);var yo='data:image/svg+xml,<svg viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg">%0D%0A%09<path d="M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd">%0D%0A%09</path>%0D%0A</svg>';var ve=class extends I{constructor(e,t){super(e),this._list=new G({items:e.items}),this.setContent(this._list),this.addDOMEvent("mousedown",o=>{console.log("trap"),o.stopImmediatePropagation(),o.stopPropagation(),o.preventDefault()},!0),this._list.on("selectionChange",o=>{this.fire("selectionChange",o)})}getList(){return this._list}};i(ve,"Dropdown"),ve=h([p("x4")],ve);var _e=class extends c{constructor(t){super(t);this._prevent_close=!1;let o=R();this.setContent([new u({id:"label",content:new x({tag:"label",text:t.label,labelFor:o,width:t.labelWidth})}),this._edit=new u({id:"edit",content:[this._input=new k({type:"text",value:"",readonly:t.readonly}),this._button=new v({icon:yo})]})]),this._dropdown=new ve({items:t.items}),this._dropdown.on("selectionChange",r=>{let n=r.selection;this._input.setValue(n?n.text:""),this._prevent_close||this._dropdown.show(!1)}),this._button.addDOMEvent("click",()=>this._on_click()),this._input.addDOMEvent("input",()=>this._on_input()),this._input.addDOMEvent("keydown",r=>this._on_key(r)),this.setDOMEvents({focusout:i(()=>this._on_focusout(),"focusout"),click:i(()=>this._on_click(),"click")})}_on_key(t){switch(t.key){case"Enter":case"Escape":{this._dropdown.show(!1);break}case"ArrowUp":this._prevent_close=!0,this._dropdown.isOpen()?this._dropdown.getList().navigate(1):this.showDropDown(),this._prevent_close=!1;break;case"ArrowDown":this._prevent_close=!0,this._dropdown.isOpen()?this._dropdown.getList().navigate(2):this.showDropDown(),this._prevent_close=!1;break;default:return}t.preventDefault(),t.stopPropagation()}_on_input(){this._dropdown.isOpen()||this.showDropDown(),this._dropdown.getList().filter(this._input.getValue())}_on_focusout(){this._dropdown.show(!1)}_on_click(){this.showDropDown()}showDropDown(){if(this.isDisabled())return;let t=this._edit.getBoundingRect();this._dropdown.setStyleValue("width",t.width+"px"),this._dropdown.displayNear(t,"top left","bottom left",{x:0,y:6})}};i(_e,"Combobox"),_e=h([p("x4")],_e);var Eo='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512" fill="currentColor"><!--!Font Awesome Pro 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path d="M192 233.4L59.5 100.9 36.9 123.5 169.4 256 36.9 388.5l22.6 22.6L192 278.6 324.5 411.1l22.6-22.6L214.6 256 347.1 123.5l-22.6-22.6L192 233.4z"/></svg>';var Q=class extends I{constructor(e){super(e),this.appendContent([new u({cls:"caption",content:[new x({id:"title",cls:"caption-element",icon:e.icon,text:e.title}),e.closable?new v({id:"closebox",icon:Eo,click:i(()=>{this.close()},"click")}):null]}),e.form,new K({id:"btnbar",reverse:!0,items:e.buttons,btnclick:i(t=>{this.fire("btnclick",t)},"btnclick")})])}display(){super.displayCenter()}close(){this.fire("close",{}),super.close()}};i(Q,"Dialog"),Q=h([p("x4")],Q);var W=class extends E{setValues(e){let t=this.queryAll("input[name]");console.log(t)}getValues(){return{}}};i(W,"Form"),W=h([p("x4")],W);var we=class extends u{constructor(e){var t;super(e),this._els=(t=e.items)==null?void 0:t.map(o=>{let r=new x({cls:"cell",text:o.title,icon:o.iconId}),n=new C("right");return o.width>0?(r.setStyleValue("width",o.width+"px"),r.setInternalData("width",o.width)):o.width<0?r.setInternalData("flex",-o.width):r.setInternalData("width",0),n.addDOMEvent("dblclick",a=>{r.setInternalData("flex",1),this._calc_sizes()}),n.on("resize",a=>{r.setInternalData("flex",0),r.setInternalData("width",a.size),this._calc_sizes()}),r.appendContent(n),r.setInternalData("data",o),r}),this.addDOMEvent("resized",()=>this._on_resize()),this.addDOMEvent("created",()=>this._calc_sizes()),this._vwp=new u({content:this._els}),this.setContent(this._vwp)}_calc_sizes(){let e=0,t=0;this._els.forEach(l=>{let d=l.getInternalData("flex");if(d)e+=d;else{let m=l.getInternalData("width");if(m==0){let g=l.getBoundingRect();m=Math.ceil(g.width)+2,l.setInternalData("width",m)}t+=m}});let r=this.getBoundingRect().width-t,n=Math.ceil(r/e);console.log("filled",t),console.log("count",e),console.log("rest",r),console.log("unit",n);let a=0;this._els.forEach(l=>{let d=0,m=l.getInternalData("flex");m?(d=Math.min(n*m,r),r-=d):d=l.getInternalData("width"),l.setWidth(d),a+=d}),this._vwp.setWidth(a)}_on_resize(){this._calc_sizes()}};i(we,"Header"),we=h([p("x4")],we);var ye=class extends c{constructor(e){var t;super(e),this._img=new c({tag:"img",attrs:{loading:e.lazy,alt:e.alt,draggable:(t=e.draggable)!=null?t:!1},style:{width:"100%",height:"100%",objectFit:e.fit,objectPosition:e.position}}),this.setContent(this._img),this.setImage(e.src)}setImage(e){this._img.setAttribute("src",e)}};i(ye,"Image"),ye=h([p("x4")],ye);var Ee=class extends c{constructor(e){super({tag:"a",...e}),this.setAttribute("href",e.href),this.mapPropEvents(e,"click"),e.text&&this.setContent(e.text),this.addDOMEvent("click",t=>this._on_click(t))}setText(e){this.setContent(e)}_on_click(e){let t={context:this.props.href};this.fire("click",t),t.preventDefault&&(e.preventDefault(),e.stopPropagation())}};i(Ee,"Link"),Ee=h([p("x4")],Ee);var ko='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor"><!--!Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24l0 112c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-112c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"/></svg>';var ee=class extends Q{constructor(e){super(e)}setText(e){this.m_label.setText(e)}static show(e){let t=new ee({modal:!0,title:b.global.error,movable:!0,form:new W({content:[new u({content:[new f({iconId:ko}),new x({text:e})]})]}),buttons:["ok.outline","cancel.outline"]});return t.on("btnclick",o=>{_t(()=>t.close())}),t.display(),t}};i(ee,"MessageBox"),ee=h([p("x4")],ee);var Co='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor"><!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209L241 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L335 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"/></svg>';var Ao='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor"><!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24V264c0 13.3-10.7 24-24 24s-24-10.7-24-24V152c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"/></svg>';var Io='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor"><!--!Font Awesome Pro 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path d="M207.4 20.4c2.4 8.5-2.6 17.3-11.2 19.7C101.5 66.2 32 153 32 256c0 123.7 100.3 224 224 224s224-100.3 224-224c0-103-69.5-189.8-164.3-215.9c-8.5-2.4-13.5-11.2-11.2-19.7s11.2-13.5 19.7-11.2C432.5 39.1 512 138.2 512 256c0 141.4-114.6 256-256 256S0 397.4 0 256C0 138.2 79.5 39.1 187.7 9.2c8.5-2.4 17.3 2.6 19.7 11.2z"/></svg>';var Mo='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512" fill="currentColor"><!--!Font Awesome Pro 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path d="M192 233.4L59.5 100.9 36.9 123.5 169.4 256 36.9 388.5l22.6 22.6L192 278.6 324.5 411.1l22.6-22.6L214.6 256 347.1 123.5l-22.6-22.6L192 233.4z"/></svg>';var ke=class extends I{constructor(e){super({});let t=e.iconId;t||(e.loading?(t=Io,this.addClass("")):e.mode=="danger"?t=Ao:t=Co),this.addClass(e.mode);let o=new f({iconId:t});e.loading&&(o.addClass("rotate"),this.props.modal=!0),this.setContent(new u({content:[o,new _({cls:"body",content:[new x({cls:"title",text:e.title}),new x({cls:"text",text:e.text})]}),new v({cls:"outline",icon:Mo,click:i(()=>{this.close()},"click")})]}))}close(){this.clearTimeout("close"),super.close()}display(e=0){let t=new N(0,0,window.innerWidth,window.innerHeight);this.displayNear(t,"bottom right","bottom right",{x:-20,y:-10}),e&&this.setTimeout("close",e*1e3,()=>{this.close()})}};i(ke,"Notification"),ke=h([p("x4")],ke);var Ce=class extends _{constructor(e){var o;super({...e,content:void 0});let t=(o=e.bodyModel)!=null?o:_;super.setContent([this._title=new x({tag:"legend",text:e.title,icon:e.icon}),this._body=new t({cls:"body",content:e.content})])}setContent(e){this._body.setContent(e)}setTitle(e){this._title.setContent(e)}};i(Ce,"Panel"),Ce=h([p("x4")],Ce);var Ae=class extends c{constructor(e){super(e),this.setContent(this._bar=new c({cls:"bar"})),this.setValue(e.value)}setValue(e){let t=e/(this.props.max-this.props.min)*100;this._bar.setStyleValue("width",t+"%")}};i(Ae,"Progress"),Ae=h([p("x4")],Ae);var Po='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512" fill="currentColor"><!--!Font Awesome Pro 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path d="M288.1 0l86.5 164 182.7 31.6L428 328.5 454.4 512 288.1 430.2 121.7 512l26.4-183.5L18.9 195.6 201.5 164 288.1 0z"/></svg>';var Ie=class extends u{constructor(e){var t;super(e),e.steps=(t=e.steps)!=null?t:5,this._update()}_update(){var r,n;let e=this.props,t=(r=e.icon)!=null?r:Po,o=(n=e.value)!=null?n:0;this.m_input=new k({type:"text",hidden:!0,name:e.name,value:""+o}),this.addDOMEvent("click",a=>this._on_click(a)),this.m_els=[];for(let a=0;a<e.steps;a++){let l="item";a+1<=o&&(l+=" checked");let d=new f({cls:l,iconId:t});d.setInternalData("value",a),this.m_els.push(d)}this.m_els.push(this.m_input),this.setContent(this.m_els)}getValue(){var e;return(e=this.props.value)!=null?e:0}setValue(e){this.props.value=e;for(let t=0;t<this.props.steps;t++)this.m_els[t].setClass("checked",this.m_els[t].getInternalData("value")<=e);this.m_input.setValue(""+this.props.value)}setSteps(e){this.props.steps=e,this._update()}setShape(e){this.removeClass(this.props.icon),this.props.icon=e}_on_click(e){let t=y(e.target);t=t.parentElement(f),t&&this.setValue(t.getInternalData("value")),this.fire("change",{value:this.props.value})}};i(Ie,"Rating"),Ie=h([p("x4")],Ie);var Me=class extends c{constructor(t){super(t);this._mdown=!1;this._irect=null;this._thumb=null;this._bar=null;this._range=null;this.setContent([new u({cls:"track",content:[this._bar=new c({cls:"bar"}),this._thumb=new c({cls:"thumb"})]}),this._range=new k({type:"range",hidden:!0,value:t.value,min:t.min,max:t.max,step:t.step})]),this.setAttribute("tabindex",0),this.setDOMEvents({pointerdown:i(o=>this._on_mousedown(o),"pointerdown"),pointermove:i(o=>this._on_mousemove(o),"pointermove"),pointerup:i(o=>this._on_mouseup(o),"pointerup"),keydown:i(o=>this._on_key(o),"keydown")}),this._range.addDOMEvent("change",o=>{})}_on_mousedown(t){t.stopPropagation(),t.preventDefault(),this.focus(),this._mdown=!0,this._irect=this.getBoundingRect(),this.setCapture(t.pointerId)}_on_mousemove(t){if(this._mdown){let o=t.pageX-this._irect.left;o<0?o=0:o>this._irect.width&&(o=this._irect.width);let r=o/this._irect.width*100;this._range.setNumValue(r),this._update()}}_update(){let t=this._range.getNumValue(),o=t/(this.props.max-this.props.min)*100;this._thumb.setStyleValue("left",o+"%"),this._bar.setStyleValue("width",o+"%"),this.fire("change",{value:t})}_on_mouseup(t){this._mdown&&(this.releaseCapture(t.pointerId),this._mdown=!1)}_on_key(t){var n;console.log(t.key);let o=(n=this.props.step)!=null?n:1,r=0;switch(t.key){case"ArrowRight":case"ArrowUp":r=o;break;case"ArrowLeft":case"ArrowDown":r=-o;break}r&&(t.ctrlKey&&(r*=10),this._range.setNumValue(this._range.getNumValue()+r),this._update())}};i(Me,"Slider"),Me=h([p("x4")],Me);var Pe=class extends u{constructor(e){super(e);let t=R();this.setContent([new c({cls:"switch",content:[new k({type:"checkbox",id:t,checked:e.checked}),new c({cls:"track"}),new c({cls:"thumb"})]}),new x({tag:"label",text:e.label,labelFor:t})])}};i(Pe,"Switch"),Pe=h([p("x4")],Pe);var De=class extends v{constructor(e,t){super(e),this.addClass("outline"),this.setIcon(t.icon),this.setText(t.title),this.setData("tabname",t.name)}};i(De,"CTab"),De=h([p("x4")],De);var Te=class extends u{constructor(e,t){super(e);let o=t.map(r=>new De({click:i(n=>this._on_click(n),"click")},r));this.mapPropEvents(e,"click"),this.setContent(o)}_on_click(e){let t=e.source.getData("tabname");this.fire("click",{name:t})}select(e){let t=this.query(`[data-tabname="${e}"]`);this._selitem&&this._selitem.setClass("selected",!1),this._selitem=t,this._selection=e,this._selitem&&this._selitem.setClass("selected",!0)}};i(Te,"CTabList"),Te=h([p("x4")],Te);var Le=class extends _{constructor(e){var o;super(e);let t=(o=e.items)==null?void 0:o.map(r=>({name:r.name,content:r.tab}));this.setContent([this._list=new Te({click:i(r=>this._onclick(r),"click")},e.items),this._stack=new V({cls:"body x4flex",default:e.default,items:t})]),e.default&&this.selectTab(e.default)}selectTab(e){this._list.select(e),this._stack.select(e)}_onclick(e){this.selectTab(e.name)}};i(Le,"Tabs"),Le=h([p("x4")],Le);var Se=class extends _{constructor(e){super(e),this.setContent([new x({text:e.label}),this._input=new c({tag:"textarea"})]),this._input.setAttribute("name",e.name),this._input.setAttribute("value",e.value+""),e.resize||this._input.setAttribute("resize",!1)}};i(Se,"TextArea"),Se=h([p("x4")],Se);var Re=class extends u{constructor(e){var o,r;super(e),e.inputId||(e.inputId=R()),e.required&&this.setAttribute("required",!0);let t=(o=e.inputGadgets)!=null?o:[];this.setContent([new u({id:"label",width:e.labelWidth,content:[new x({tag:"label",text:e.label,labelFor:e.inputId})]}),new u({id:"edit",content:[new k({type:(r=e.type)!=null?r:"text",readonly:e.readonly,value:e.value,id:e.inputId,required:e.required,disabled:e.disabled,placeholder:e.placeholder}),...t]})])}};i(Re,"TextEdit"),Re=h([p("x4")],Re);var Do='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor"> <!--!Font Awesome Pro 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path d="M256 32a224 224 0 1 1 0 448 224 224 0 1 1 0-448zm0 480A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM192 352v32h16 96 16V352H304 272V240 224H256 216 200v32h16 24v96H208 192zm88-168V136H232v48h48z"/></svg>';var xt=null,tt=null,To=new ie;function Sr(){document.addEventListener("mouseenter",s=>{if(s.target===document)return;let e=Lt(s.target),t=e.getAttribute("tooltip");if(t){xt=s.target;let o=e.getBoundingRect();Rr(t,o,{x:s.pageX,y:s.pageY})}},!0),document.addEventListener("mouseleave",s=>{xt&&s.target==xt&&(xt=null,Or())},!0)}i(Sr,"initTooltips");function Rr(s,e,t){tt||(tt=new Oe({})),To.setTimeout(null,300,()=>{tt.setText(Qe(s)),tt.displayAt(t.x,t.y)})}i(Rr,"showTT");function Or(){tt.show(!1),To.clearTimeout(null)}i(Or,"closeTT");var Oe=class extends I{constructor(e){super(e),this.setContent(new u({content:[new f({iconId:Do}),new c({id:"text"})]}))}setText(e){this.query("#text").setContent(e)}};i(Oe,"Tooltip"),Oe=h([p("x4")],Oe);var Lo='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor"><!--!Font Awesome Pro 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path d="M267.3 395.3c-6.2 6.2-16.4 6.2-22.6 0l-192-192c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0L256 361.4 436.7 180.7c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6l-192 192z"/></svg>';var So=(m=>(m[m.first=0]="first",m[m.prev=1]="prev",m[m.next=2]="next",m[m.last=3]="last",m[m.parent=4]="parent",m[m.child=5]="child",m[m.expand=6]="expand",m[m.collapse=7]="collapse",m[m.toggle=8]="toggle",m))(So||{}),te=class extends E{constructor(e,t){super({...e}),this._item=t,t?(this._label=new u({cls:"label item",content:[this._icon=new f({iconId:t.children?Lo:t.iconId}),new x({tag:"span",cls:"",text:t.text})]}),this._label.setData("id",t.id+""),t.children&&(this._childs=new _({cls:"body"}),t.open===void 0&&(t.open=!1),this.addClass("folder"),this.setClass("open",t.open),this.setItems(t.children),this._icon.addDOMEvent("click",o=>this.toggle(o)))):this._childs=new _({cls:"body"}),this.setContent([this._label,this._childs])}toggle(e){let t=this.hasClass("open");this.open(!t),e&&e.stopPropagation()}open(e=!0){this.setClass("open",e),this._item.open=e}setItems(e){if(e){let t=e.map(o=>new te({},o));this._childs.setContent(t)}else this._childs.clearContent()}};i(te,"CTreeViewItem"),te=h([p("x4")],te);var Be=class extends c{constructor(e){super(e),e.items&&this.setItems(e.items),this.setAttribute("tabindex",0),this.setDOMEvents({click:i(t=>this._onclick(t),"click"),keydown:i(t=>this._onkey(t),"keydown")})}setItems(e){this._items=e;let t=new te({cls:"root"},null);t.setItems(e),this.setContent(t)}_onclick(e){let t=e.target;for(;t&&t!=this.dom;){let o=y(t);if(o&&o.hasClass("item")){let r=o.getData("id");this._selectItem(r,o);return}t=t.parentElement}this.clearSelection()}_onkey(e){switch(e.key){case"ArrowDown":{this.navigate(2);break}case"ArrowUp":{this.navigate(1);break}case"Home":{this.navigate(0);break}case"End":{this.navigate(3);break}case"ArrowRight":{this.navigate(5);break}case"+":{this.navigate(6);break}case"ArrowLeft":{this.navigate(4);break}case"-":{this.navigate(7);break}case" ":{this.navigate(8);break}default:console.log(e.key);return}e.preventDefault(),e.stopPropagation()}navigate(e){var r;if(!this._items||this._items.length==0)return;if(!this._selitem)if(e==2||e==4)e=0;else if(e==1)e=3;else return;let t=(r=this._selitem)==null?void 0:r.parentElement(),o=t==null?void 0:t.hasClass("folder");if(t&&e==4&&o&&t.hasClass("open")?e=7:e==5&&(o?t.hasClass("open")?e=2:e=6:e=2),e==6||e==7||e==8){if(o)return e==8?(t.toggle(),!0):(t.open(e==6),!0)}else{let n=this._flattenOpenItems(),a=n.findIndex(d=>this._selection==d.id),l;if(e==0)l=n[0].id;else if(e==3)l=n[n.length-1].id;else if(a>=0){if(e==1)a>0&&(l=n[a-1].id);else if(e==2)a<n.length-1&&(l=n[a+1].id);else if(e==4){let d=n[a].level;for(;a>0;)if(a--,n[a].level<d){l=n[a].id;break}}}if(l){let d=this.query(`[data-id="${l}"]`);return this._selectItem(l,d),!0}}return!1}_flattenOpenItems(){let e=[],t=i((o,r)=>{e.push({id:o.id+"",level:r}),o.children&&o.open&&o.children.forEach(n=>t(n,r+1))},"build");return this._items.forEach(o=>t(o,0)),e}_flattenItems(){let e=[],t=i(o=>{e.push(o),o.children&&o.children.forEach(r=>t(r))},"build");return this._items.forEach(o=>t(o)),e}_selectItem(e,t){this._selitem&&(this._selitem.removeClass("selected"),this._selitem=void 0),this._selitem=t,this._selection=e,t&&(t.addClass("selected"),t.scrollIntoView({behavior:"smooth",block:"nearest"}));let o=this._findItem(e);this.fire("change",{selection:o})}_findItem(e){return this._flattenItems().find(o=>o.id==e)}clearSelection(){this._selitem&&(this._selitem.removeClass("selected"),this._selitem=void 0),this._selection=void 0,this.fire("change",{selection:void 0})}};i(Be,"Treeview"),Be=h([p("x4")],Be);