diff --git a/app/srv/core/main.js b/app/srv/core/main.js index 3699739e..6482abc5 100644 --- a/app/srv/core/main.js +++ b/app/srv/core/main.js @@ -94,7 +94,7 @@ Error generating stack: `+o.message+` ${rg(e,t.mode)} ${xg(e,t.mode)} `,(t?.hover||t?.active)&&wg({item:e,hover:t?.hover,active:t?.active}),ng(e,t.mode)])}catch(n){console.log(n)}return cx([])};var Eg=P(G()),wo=(e,t,n,r,i)=>{let o=t.item,l;o.component?.style&&(l={style:o.component.style,className:vf(o.component.style,{mode:e.mode})});let s={className:vf(o,{mode:e.mode}),inherit:l},a={},u=t.item.childs,c;return t.item.type==="text"?(c=null,s.dangerouslySetInnerHTML={__html:t.item.html||""}):c=Array.isArray(u)&&u?.map(d=>{if(!d)return null;let{id:f}=d,p=n?e.layout?.meta[f]:e.meta[f];return p?(0,Eg.jsx)(qt,{meta:p,is_layout:n,passprop:{...r},depth:i+1},f):null}),s.children=c,t.item.adv?.html?(delete s.children,s.dangerouslySetInnerHTML={__html:t.item.adv?.html}):t.item.adv?.js&&!t.item.adv.js.includes("children")&&(delete s.children,delete s.dangerouslySetInnerHTML),{props:s,text_props:a}};var Iy=P(ge());var by=P(Cf());var Yr={NORMAL:0,WILDCARD:1,PLACEHOLDER:2};function Bs(e={}){let t={options:e,rootNode:vy(),staticRoutesMap:{}},n=r=>e.strictTrailingSlash?r:r.replace(/\/$/,"")||"/";if(e.routes)for(let r in e.routes)_y(t,n(r),e.routes[r]);return{ctx:t,lookup:r=>VS(t,n(r)),insert:(r,i)=>_y(t,n(r),i),remove:r=>WS(t,n(r))}}function VS(e,t){let n=e.staticRoutesMap[t];if(n)return n.data;let r=t.split("/"),i={},o=!1,l=null,s=e.rootNode,a=null;for(let u=0;u{},db:null,api:null,init_local_effect:{}},page:{history:{id:"",show:!1},root_id:"root",cur:KS,doc:null,list:{},building:!1,meta:{},entry:[],tree:[],render:()=>{}},comp:{doc:null,item:null,loaded:{},list:{},group:{}},code:{},global_prop:[],ui:{monaco:null,comp_editable:localStorage.getItem("prasi-comp-editable")==="yes",zoom:localStorage.zoom||"100%",side:{prop:!0},layout:{left:parseInt(localStorage.getItem("prasi-layout-left")||"250"),right:parseInt(localStorage.getItem("prasi-layout-right")||"250")},prevent_indent_hook:!1,syncing:!1,tree:{item_loading:[],search:"",search_ref:null,search_mode:{Name:!0,JS:!1,HTML:!1,CSS:!1},rename_id:"",open:{}},popup:{file:{enabled:!1,open:!1,picker:{value:"",on_pick:!1,multi:!1},path:"/",expanded:JSON.parse(localStorage.getItem("panel-file-expanded")||"{}"),entry:{},selected:new Set,action:null,file_renaming:"",file_ctx_menu_event:null,tree:[],tree_renaming:"",tree_ctx_path:"",tree_ctx_menu_event:null,preview:!0,upload:{started:!1,progress:{}}},code:{init:!1,open:!1,name:"site",log:"",loading:!1,startup_status:"init",error:!1,show_log:!1,list:{}},page:{open:null,form:null},script:{open:!1,mode:"js",lastMode:"js",type:"item",prop_kind:"",prop_name:"",on_close:()=>{},typings:{status:"ok",err_msg:""},wb_render:()=>{}},site:null,site_form:null,comp:{preview_id:"",open:null,import:!1},comp_group:null,api:{open:!1}}}};var $s=e=>({isMobile:e.mode==="mobile",isDesktop:e.mode==="desktop",isEditor:location.pathname.startsWith("/ed/")});var ar=P(ge());var ut=window;var QS=af("prasi-cache","prasi-cache-store"),Co={timeout:null,store:QS},Hs=(e,t)=>{let n=[...wy(t,"navigate(",")"),...wy(t,"href = ",";")],r=e.page.cur.id;e.page.navs[r]||(e.page.navs[r]=new Set);for(let i of n)e.page.navs[r].add(i);clearTimeout(Co.timeout),Co.timeout=setTimeout(()=>{e.on_nav_loaded&&e.on_nav_loaded({urls:Array.from(e.page.navs[r])})},100)},wy=(e,t,n)=>{let r=0,i=0,o=[];for(;;){let l=e.indexOf(t,r);if(i=r,l>=0){let s=e[l+t.length];if(s==='"'||s==="'"||s==="`"){let a=e.indexOf(`${s}${n}`,l+t.length+1),u=e.substring(l+t.length+1,a);r=a+2+n.length,o.push(u)}}if(i===r)break}return o};var sr=P(ge());var xy=P(_f()),lr=P(ge());var Tf=P(G()),ky=(e,t,n,r,i)=>o=>{let[l,s]=(0,lr.useState)({}),a=o.internal_key;n.item.script||(n.item.script={});let u=n.item.script;a&&(n.item.script_keyed||(n.item.script_keyed={}),n.item.script_keyed[a]||(n.item.script_keyed[a]={}),u=n.item.script_keyed[a]),u.passprop||(u.passprop={});let c={};if(u.passprop){let p=!1;for(let[g,_]of Object.entries(o))["children","key"].includes(g)||(p=!0,c[g]=_,u.passprop[g]={end:0,start:0,value:_})}let d={...r,...c};if(!Array.isArray(o.children)&&(0,lr.isValidElement)(o.children)&&typeof o.children=="object"){let p=(0,xy.default)(o.children,"props.meta.item.component.props.child.content.childs");if(Array.isArray(p)){let g=!0;for(let _ of p)!(0,lr.isValidElement)(_)&&typeof _=="object"||(g=!1);if(g)return p.map(_=>{let w=e.meta[_.id];if(w||(e.meta[_.id]={item:_},w=e.meta[_.id]),w){if(Object.keys(w.item).length<=3&&w.mitem){let h={...w.item},m=w.mitem.toJSON();w.item={...m,...h}}return(0,Tf.jsx)(qt,{is_layout:t,meta:w,passprop:d,parent_key:o.internal_key,depth:i},_.id)}return null})}}if(!Array.isArray(o.children)&&!(0,lr.isValidElement)(o.children)&&typeof o.children=="object"){let p=o.children.id;if(p){let g=e.meta[p];if(!g){e.meta[p]={item:o.children},g=e.meta[p];let _=g.item.component?.id;_&&e.comp.load(_).then(w=>{if(w){for(let[m,y]of Object.entries(w)){let v=g.item;v[m]||(v[m]=y)}let h=g.item.component?.props;for(let[m,y]of Object.entries(w.component?.props||{}))h[m]||(h[m]=y);s({})}})}return(0,Tf.jsx)(qt,{is_layout:t,meta:g,passprop:d,parent_key:o.internal_key,depth:i})}}return Nf(o,d,a?{parent_key:a}:void 0)},Nf=(e,t,n)=>{let r={};if(Array.isArray(e)?r.children=e:r=e,Array.isArray(r.children)){if(r.children.length===1)return If(r.children[0],r,t,n);let i=[];for(let o of r.children)i.push(If(o,r,t,n));return i}return If(r.children,r,t,n)},If=(e,t,n,r)=>{if((0,lr.isValidElement)(e)){let i={...t};return delete i.children,{...e,props:{...e.props,...r,passprop:{...n,...i}}}}return e};var ti={},Sy=(e,t,n)=>r=>{let i=["localhost","prasi.avolut.com"].includes(location.hostname)&&location.pathname.startsWith("/ed/"),o=n.item.id,{children:l,parent_key:s}=r,a=e.script?.init_local_effect,u=t?e.layout?.meta:e.meta,c=(0,sr.useRef)(ti[o]?ti[o]:r.value),[d,f]=(0,sr.useState)({}),p=c.current;return p.render=()=>{window.prasiContext.render?window.prasiContext.render():f({})},Vs(e,n,n.script?.scope,s),r.hook&&r.hook(p),(0,sr.useEffect)(()=>{if(n.parent?.instance_id&&u){let _=u[n.parent?.instance_id];if(_&&_.instances){for(let[w,h]of Object.entries(_.instances[n.parent.instance_id]))if(h===n.item.id){o=w;break}}}return!a[o]&&(typeof a=="object"&&(a[o]=!0),(async()=>r.effect&&(await r.effect(p),i&&(ti[o]=p)))()),()=>{}},[...r.deps||[],location.pathname]),(0,sr.useEffect)(()=>{i&&ti[o]===null&&(async()=>r.effect&&(await r.effect(p),i&&(ti[o]=p)))()},[ti[o]]),Nf(l,{...n.script?.scope,[r.name]:p})};var Io=window,ni=(e,t,n)=>{Io.prasiEdit||(Io.prasiEdit={});let r=Io.prasiEdit[n];r||(Io.prasiEdit[n]={},r=Io.prasiEdit[n]);let i=()=>{let l=t.get("id")||"",s=r[l];return s||(r[l]=[],s=r[l]),s},o=t.toJSON();return{...o,edit:{get props(){if(o.component?.props){let l={};for(let[s,a]of Object.entries(o.component.props))if(a.content){let u=t.get("component")?.get("props")?.get(s)?.get("content");u?l[s]={mode:"jsx",value:ni(e,u,n)}:l[s]={mode:"jsx",value:null}}else{let u=typeof a.valueBuilt=="string"?a.valueBuilt.trim():"";if(u.endsWith(`; -`)&&(u=u.substring(0,u.length-2)),u&&u===a.value.trim()){let c=new Function(`return ${a.value}`);l[s]={mode:"string",value:c()}}else l[s]={mode:"raw",value:a.value,valueBuilt:a.valueBuilt}}return l}},get pending(){return[]},async commit(){let l={},s={};if(t){for(let[a,u]of Object.entries(r)){let c=e[a];if(!c||!c.mitem)continue;let f=c.mitem.toJSON();if(f){let p=f?.component?.props,g={};for(let w of u)if(w.type==="prop"&&p)p[w.name]&&(w.mode==="string"?(p[w.name].value=JSON.stringify(w.value),p[w.name].valueBuilt=JSON.stringify(w.value)):w.mode==="raw"?(p[w.name].value=w.value,w.valueBuilt?p[w.name].valueBuilt=w.valueBuilt:g[w.name]=w.value):w.mode==="jsx"&&(p[w.name]||(p[w.name]={meta:{type:"content-element"}}),w.value&&(p[w.name].content=Ws([w.value],s)[0])));else if(w.type==="set"&&typeof w.value=="object")for(let[h,m]of Object.entries(w.value))f[h]=m;else if(w.type==="child"&&Array.isArray(w.childs)){let h=Ws(w.childs.filter(m=>m),s);f.childs=h}for(let[w,h]of Object.entries(s))g[w]=h.value;let _=await _api.code_build(g);for(let[w,h]of Object.entries(_))p[w]?p[w].valueBuilt=h:s[w]&&(s[w].valueBuilt=h);l[a]=f}}t.doc?.transact(()=>{for(let[a,u]of Object.entries(l)){let c=e[a];c.mitem&&syncronize(c.mitem,u)}})}},setValue(l,s){let a=i(),u=s;if(l==="childs")throw new Error("Please modify childs via .child");a.push({type:"set",name:l,value:u})},setProp(l,s){let a=i();typeof s=="string"?a.push({type:"prop",mode:"string",name:l,value:s}):s.mode==="string"?a.push({type:"prop",mode:"string",name:l,value:s.value}):s.mode==="raw"?a.push({type:"prop",mode:"raw",name:l,value:s.value,valueBuilt:s.valueBuilt}):s.mode==="jsx"&&a.push({type:"prop",mode:"jsx",name:l,value:s.value})},setChilds(l){i().push({type:"child",childs:l})},get childs(){let l=t?.toJSON();if(l.component?.id){if((l.component?.props.child).content){let a=t.get("component")?.get("props")?.get("child")?.get("content");if(a)return[ni(e,a,n)]}return[]}return l.childs?l.childs.map(s=>{if(s){let a=e[s.id];if(a&&a.mitem)return ni(e,a.mitem,n)}}).filter(s=>s):[]},get parent(){if(t){let l=t.parent.toJSON();if(Array.isArray(l)){let s=(t.parent?.parent).get("id"),a=e[s].mitem;if(a)return{item:ni(e,a,n),child_type:"child",child_idx:l.findIndex(u=>u.id===o.id)}}}return null}}}},XS=async(e,t)=>{let n={};for(let[r,i]of Object.entries(e))i.mode?i.mode==="string"?n[r]={value:JSON.stringify(i.value),valueBuilt:JSON.stringify(i.value),meta:{type:"text"}}:i.mode==="jsx"&&i.value?n[r]={value:"",valueBuilt:"",content:Ws([i.value],t)[0],meta:{type:"content-element"}}:i.mode==="raw"&&(n[r]={value:i.value,valueBuilt:i.valueBuilt,meta:{type:"text"}}):n[r]=i;return n},Ws=(e,t)=>{let n=t||{};return e.map(i=>{let o={...i};if(delete o.edit,o.component?.props){o.component.props=XS(o.component.props,n);for(let[l,s]of Object.entries(o.component.props))!s.valueBuilt&&s.value&&(n[o.id+"|||"+l]=s)}return o.childs&&(o.childs=Ws(o.childs,n)),o})};var ri=(e,t,n)=>({...t,edit:{setChilds(r){},get childs(){if(t.component?.id){let r=t.component?.props.child;return r.content?[ri(e,r.content,n)]:[]}return t.childs?t.childs.map(r=>{if(r){let i=e[r.id];if(i&&i.item)return ri(e,i.item,n)}}).filter(r=>r):[]},get props(){if(t.component?.props){let r={};for(let[i,o]of Object.entries(t.component.props))if(o.content){let l=t.component?.props?.[i]?.content;l?r[i]={mode:"jsx",value:ri(e,l,n)}:r[i]={mode:"jsx",value:null}}else{let l=typeof o.valueBuilt=="string"?o.valueBuilt.trim():"";if(l.endsWith(`; +`)&&(u=u.substring(0,u.length-2)),u&&u===a.value.trim()){let c=new Function(`return ${a.value}`);l[s]={mode:"string",value:c()}}else l[s]={mode:"raw",value:a.value,valueBuilt:a.valueBuilt}}return l}},get pending(){return[]},async commit(){let l={},s={};if(t){for(let[a,u]of Object.entries(r)){let c=e[a];if(!c||!c.mitem)continue;let f=c.mitem.toJSON();if(f){let p=f?.component?.props,g={};for(let w of u)if(w.type==="prop"&&p)p[w.name]&&(w.mode==="string"?(p[w.name].value=JSON.stringify(w.value),p[w.name].valueBuilt=JSON.stringify(w.value)):w.mode==="raw"?(p[w.name].value=w.value,w.valueBuilt?p[w.name].valueBuilt=w.valueBuilt:g[w.name]=w.value):w.mode==="jsx"&&(p[w.name]||(p[w.name]={meta:{type:"content-element"}}),w.value&&(p[w.name].content=Ws([w.value],s)[0])));else if(w.type==="set"&&typeof w.value=="object")for(let[h,m]of Object.entries(w.value))f[h]=m;else if(w.type==="child"&&Array.isArray(w.childs)){let h=Ws(w.childs.filter(m=>m),s);f.childs=h}for(let[w,h]of Object.entries(s))g[w]=h.value;let _=await _api.code_build(g);for(let[w,h]of Object.entries(_))p[w]?p[w].valueBuilt=h:s[w]&&(s[w].valueBuilt=h);l[a]=f}}t.doc?.transact(()=>{for(let[a,u]of Object.entries(l)){let c=e[a];c.mitem&&console.log(syncronize(c.mitem,u))}})}},setValue(l,s){let a=i(),u=s;if(l==="childs")throw new Error("Please modify childs via .child");a.push({type:"set",name:l,value:u})},setProp(l,s){let a=i();typeof s=="string"?a.push({type:"prop",mode:"string",name:l,value:s}):s.mode==="string"?a.push({type:"prop",mode:"string",name:l,value:s.value}):s.mode==="raw"?a.push({type:"prop",mode:"raw",name:l,value:s.value,valueBuilt:s.valueBuilt}):s.mode==="jsx"&&a.push({type:"prop",mode:"jsx",name:l,value:s.value})},setChilds(l){i().push({type:"child",childs:l})},get childs(){let l=t?.toJSON();if(l.component?.id){if((l.component?.props.child).content){let a=t.get("component")?.get("props")?.get("child")?.get("content");if(a)return[ni(e,a,n)]}return[]}return l.childs?l.childs.map(s=>{if(s){let a=e[s.id];if(a&&a.mitem)return ni(e,a.mitem,n)}}).filter(s=>s):[]},get parent(){if(t){let l=t.parent.toJSON();if(Array.isArray(l)){let s=(t.parent?.parent).get("id"),a=e[s].mitem;if(a)return{item:ni(e,a,n),child_type:"child",child_idx:l.findIndex(u=>u.id===o.id)}}}return null}}}},XS=(e,t)=>{let n={};for(let[r,i]of Object.entries(e))i.mode?i.mode==="string"?n[r]={value:JSON.stringify(i.value),valueBuilt:JSON.stringify(i.value),meta:{type:"text"}}:i.mode==="jsx"&&i.value?n[r]={value:"",valueBuilt:"",content:Ws([i.value],t)[0],meta:{type:"content-element"}}:i.mode==="raw"&&(n[r]={value:i.value,valueBuilt:i.valueBuilt,meta:{type:"text"}}):n[r]=i;return n},Ws=(e,t)=>{let n=t||{};return e.map(i=>{let o={...i};if(delete o.edit,o.component?.props){o.component.props=XS(o.component.props,n);for(let[l,s]of Object.entries(o.component.props))!s.valueBuilt&&s.value&&(n[o.id+"|||"+l]=s)}return o.childs&&(o.childs=Ws(o.childs,n)),o})};var ri=(e,t,n)=>({...t,edit:{setChilds(r){},get childs(){if(t.component?.id){let r=t.component?.props.child;return r.content?[ri(e,r.content,n)]:[]}return t.childs?t.childs.map(r=>{if(r){let i=e[r.id];if(i&&i.item)return ri(e,i.item,n)}}).filter(r=>r):[]},get props(){if(t.component?.props){let r={};for(let[i,o]of Object.entries(t.component.props))if(o.content){let l=t.component?.props?.[i]?.content;l?r[i]={mode:"jsx",value:ri(e,l,n)}:r[i]={mode:"jsx",value:null}}else{let l=typeof o.valueBuilt=="string"?o.valueBuilt.trim():"";if(l.endsWith(`; `)&&(l=l.substring(0,l.length-2)),l&&l===o.value.trim()){let s=new Function(`return ${o.value}`);r[i]={mode:"string",value:s()}}else r[i]={mode:"raw",value:o.value,valueBuilt:o.valueBuilt}}return r}},async commit(){},get parent(){let r=e[t.id];if(r&&r.parent?.id){let i=e[r.parent.id];return ri(e,i.item,n)}return null},pending:[],setProp(r,i){},setValue(r,i){}}});var Of=P(G()),Ey=(e,t,n,r,i,o)=>{let l=wo(e,t,n,r,i);e.visit&&e.visit(t,l),t.script?t.script.scope=r:t.script={scope:r,result:null,Local:Sy(e,n,t),PassProp:ky(e,n,t,r,i)};let s=t.script,a=window.exports,u={useEffect:ar.useEffect,children:l.props.children,props:l.props,Local:s?.Local,db:e.site.db,api:e.site.api,PassProp:s?.PassProp,ErrorBox:Nt,newElement:()=>{},_item:t.mitem?ni(e.meta,t.mitem,e.page.cur.id):ri(e.meta,t.item,e.page.cur.id),_meta:e.meta,render:f=>{let p=f;if((0,ar.isValidElement)(f)&&f.props.children){let g=w=>{let h=!1,m=[];if((0,ar.isValidElement)(w)){if(w.type===t.script?.PassProp)return{should_replace:!0,el:{...w,props:{...w.props,internal_key:w.key}}};if(Array.isArray(w.props?.children))for(let y of w.props?.children)if(Array.isArray(y)){let v=[],S=!1;for(let R of y){let k=g(R);k.should_replace?(v.push(k.el),S=!0):v.push(R)}S?(h=!0,m.push(v)):m.push(y)}else typeof y=="object"&&y?y.type===t.script?.PassProp&&(h=!0,m.push({...y,props:{...y.props,internal_key:y.props.key}})):m.push(y)}return{should_replace:h,el:{...w,props:{...w.props,children:m}}}},_=g(f);_.should_replace&&(p=_.el)}s&&(s.result=(0,Of.jsx)(ar.Suspense,{children:p}))},params,...$s(e),...a,...r};if(typeof r=="object"){for(let[f,p]of Object.entries(r))if(typeof p=="object"&&p&&p._jsx){let g=p;u[f]=(0,Of.jsx)(qS,{fn:g.fn,passprop:{...r},meta:t})}}!ut.isEditor&&t.item.adv?.js&&Hs(e,t.item.adv.js);let c=t.item.adv?.jsBuilt||"",d=Af(c,Pf)||"";try{new Function(...Object.keys(u),"___js",`// ${t.item.name}: ${t.item.id} try { ${d} @@ -113,7 +113,7 @@ ${d} `):" "+h_(o[0]):"as no adapter specified";throw new D("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return r},adapters:Jf};function Yf(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Mn(null,e)}function ua(e){return Yf(e),e.headers=Me.from(e.headers),e.data=Mo.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),aa.getAdapter(e.adapter||ui.adapter)(e).then(function(r){return Yf(e),r.data=Mo.call(e,e.transformResponse,r),r.headers=Me.from(r.headers),r},function(r){return zo(r)||(Yf(e),r&&r.response&&(r.response.data=Mo.call(e,e.transformResponse,r.response),r.response.headers=Me.from(r.response.headers))),Promise.reject(r)})}var g_=e=>e instanceof Me?{...e}:e;function Yt(e,t){t=t||{};let n={};function r(u,c,d){return x.isPlainObject(u)&&x.isPlainObject(c)?x.merge.call({caseless:d},u,c):x.isPlainObject(c)?x.merge({},c):x.isArray(c)?c.slice():c}function i(u,c,d){if(x.isUndefined(c)){if(!x.isUndefined(u))return r(void 0,u,d)}else return r(u,c,d)}function o(u,c){if(!x.isUndefined(c))return r(void 0,c)}function l(u,c){if(x.isUndefined(c)){if(!x.isUndefined(u))return r(void 0,u)}else return r(void 0,c)}function s(u,c,d){if(d in t)return r(u,c);if(d in e)return r(void 0,u)}let a={url:o,method:o,data:o,baseURL:l,transformRequest:l,transformResponse:l,paramsSerializer:l,timeout:l,timeoutMessage:l,withCredentials:l,withXSRFToken:l,adapter:l,responseType:l,xsrfCookieName:l,xsrfHeaderName:l,onUploadProgress:l,onDownloadProgress:l,decompress:l,maxContentLength:l,maxBodyLength:l,beforeRedirect:l,transport:l,httpAgent:l,httpsAgent:l,cancelToken:l,socketPath:l,responseEncoding:l,validateStatus:s,headers:(u,c)=>i(g_(u),g_(c),!0)};return x.forEach(Object.keys(Object.assign({},e,t)),function(c){let d=a[c]||i,f=d(e[c],t[c],c);x.isUndefined(f)&&d!==s||(n[c]=f)}),n}var ca="1.6.8";var ed={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ed[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});var y_={};ed.transitional=function(t,n,r){function i(o,l){return"[Axios v"+ca+"] Transitional option '"+o+"'"+l+(r?". "+r:"")}return(o,l,s)=>{if(t===!1)throw new D(i(l," has been removed"+(n?" in "+n:"")),D.ERR_DEPRECATED);return n&&!y_[l]&&(y_[l]=!0,console.warn(i(l," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,l,s):!0}};function e2(e,t,n){if(typeof e!="object")throw new D("options must be an object",D.ERR_BAD_OPTION_VALUE);let r=Object.keys(e),i=r.length;for(;i-- >0;){let o=r[i],l=t[o];if(l){let s=e[o],a=s===void 0||l(s,o,e);if(a!==!0)throw new D("option "+o+" must be "+a,D.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new D("Unknown option "+o,D.ERR_BAD_OPTION)}}var fa={assertOptions:e2,validators:ed};var zn=fa.validators,fi=class{constructor(t){this.defaults=t,this.interceptors={request:new Hf,response:new Hf}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let i;Error.captureStackTrace?Error.captureStackTrace(i={}):i=new Error;let o=i.stack?i.stack.replace(/^.+\n/,""):"";r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=` `+o):r.stack=o}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Yt(this.defaults,n);let{transitional:r,paramsSerializer:i,headers:o}=n;r!==void 0&&fa.assertOptions(r,{silentJSONParsing:zn.transitional(zn.boolean),forcedJSONParsing:zn.transitional(zn.boolean),clarifyTimeoutError:zn.transitional(zn.boolean)},!1),i!=null&&(x.isFunction(i)?n.paramsSerializer={serialize:i}:fa.assertOptions(i,{encode:zn.function,serialize:zn.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let l=o&&x.merge(o.common,o[n.method]);o&&x.forEach(["delete","get","head","post","put","patch","common"],g=>{delete o[g]}),n.headers=Me.concat(l,o);let s=[],a=!0;this.interceptors.request.forEach(function(_){typeof _.runWhen=="function"&&_.runWhen(n)===!1||(a=a&&_.synchronous,s.unshift(_.fulfilled,_.rejected))});let u=[];this.interceptors.response.forEach(function(_){u.push(_.fulfilled,_.rejected)});let c,d=0,f;if(!a){let g=[ua.bind(this),void 0];for(g.unshift.apply(g,s),g.push.apply(g,u),f=g.length,c=Promise.resolve(n);d{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](i);r._listeners=null}),this.promise.then=i=>{let o,l=new Promise(s=>{r.subscribe(s),o=s}).then(i);return l.cancel=function(){r.unsubscribe(o)},l},t(function(o,l,s){r.reason||(r.reason=new Mn(o,l,s),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;let n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new e(function(i){t=i}),cancel:t}}},__=td;function nd(e){return function(n){return e.apply(null,n)}}function rd(e){return x.isObject(e)&&e.isAxiosError===!0}var id={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(id).forEach(([e,t])=>{id[t]=e});var v_=id;function w_(e){let t=new jo(e),n=No(jo.prototype.request,t);return x.extend(n,jo.prototype,t,{allOwnKeys:!0}),x.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return w_(Yt(e,i))},n}var ue=w_(ui);ue.Axios=jo;ue.CanceledError=Mn;ue.CancelToken=__;ue.isCancel=zo;ue.VERSION=ca;ue.toFormData=Ln;ue.AxiosError=D;ue.Cancel=ue.CanceledError;ue.all=function(t){return Promise.all(t)};ue.spread=nd;ue.isAxiosError=rd;ue.mergeConfig=Yt;ue.AxiosHeaders=Me;ue.formToJSON=e=>la(x.isHTMLForm(e)?new FormData(e):e);ue.getAdapter=aa.getAdapter;ue.HttpStatusCode=v_;ue.default=ue;var da=ue;var{Axios:bP,AxiosError:RP,CanceledError:CP,isCancel:IP,CancelToken:TP,VERSION:NP,all:OP,Cancel:PP,isAxiosError:AP,spread:LP,toFormData:MP,AxiosHeaders:zP,HttpStatusCode:DP,formToJSON:jP,getAdapter:FP,mergeConfig:UP}=da;BigInt.prototype.toJSON=function(){return"BigInt::"+this.toString()};var t2=typeof window<"u"?window:null,x_=typeof global<"u"?global:void 0,di=async(e,t,n)=>{let r={...n},i=null,o=!1,l=null,s=[];if(Array.isArray(t))for(let d of t)d instanceof File&&(s.push(d),o=!0),typeof d=="function"&&(l=d);else t instanceof File&&(o=!0,s.push(t));if(!o)i=JSON.stringify(t),r["content-type"]="aplication/json";else{let d=new FormData;for(let f of s)d.append(f.name,f);i=d,delete r["content-type"],r.enctype="multipart/form-data;"}let a=new URL(e);if(t2!==null){let d=new URL(location.href),f="";if(a.host===d.host||x_&&typeof x_.server_hook=="function"?f=a.toString():f=`${d.protocol}//${d.host}/_proxy/${encodeURIComponent(a.toString())}`,f){if(l)return(await da({method:t?"post":void 0,url:f,data:i,onUploadProgress:l})).data;{let g=await(await fetch(f,t?{method:"POST",body:i,headers:r}:void 0)).text();try{return JSON.parse(g,k_)}catch{return g}}}}let c=await(await fetch(a,t?{method:"POST",body:i,headers:r}:void 0)).text();try{return JSON.parse(c,k_)}catch{return c}},k_=(e,t)=>typeof t=="string"&&t.startsWith("BigInt::")?BigInt(t.substring(8)):t;var U_=P(F_());var B_=async(e,t)=>{let n=(0,U_.default)(e,"/"),r=await di(O2(n,"/_prasi/_")),i="";r&&r.prasi&&(i=r.prasi);let o=N2(n);if(i==="v2")await new Promise(l=>{let s=document,a=s.createElement("script");a.onload=async()=>{l()},localStorage.getItem("api-ts-"+n)||localStorage.setItem("api-ts-"+n,Date.now().toString());let u=localStorage.getItem("api-ts-"+n);t?a.src=`${o}/_prasi/load.js?url=${n}&v3&dev=1&ts=${u}`:a.src=`${o}/_prasi/load.js?url=${n}&v3&ts=${u}`,document.querySelector(`script[src="${a.src}"]`)?l():s.body.appendChild(a)});else{let l=await fetch(o+"/_prasi/api-entry");if(ut.prasiApi[n]={apiEntry:(await l.json()).srv},t){let s=await fetch(o+"/_prasi/api-types");ut.prasiApi[n].apiTypes=await s.text(),ut.prasiApi[n].prismaTypes={"prisma.d.ts":await ad(`${o}/_prasi/prisma/index.d.ts`),"runtime/index.d.ts":await ad(`${o}/_prasi/prisma/runtime/index.d.ts`),"runtime/library.d.ts":await ad(`${o}/_prasi/prisma/runtime/library.d.ts`)}}}},N2=e=>{let t=new URL(e);return`${t.protocol}//${t.host}`},O2=(e,t)=>{let n=new URL(e);return n.pathname=t,n.toString()},ad=async(e,t)=>await(await fetch(e)).text();var Fo={},H_=e=>{ut.prasiApi||(ut.prasiApi={});try{let t=new URL(e),n=`${t.protocol}//${t.host}`;return ut.prasiApi[n]||Fo[n]||(Fo[n]=B_(n,location.hostname.includes("prasi"))),new Proxy({},{get:(r,i)=>{if(i==="_url")return(l,s)=>{let a=new URL(n);a.pathname=l.split("/").filter(d=>d).join("/");let u=new URL(location.href),c="";return a.host===u.host||s===!1?c=a.toString():c=`${u.protocol}//${u.host}/_proxy/${encodeURIComponent(a.toString())}`,c};let o=l=>function(...s){return new Promise(async(a,u)=>{try{let c=ut.prasiApi[n];if(!c&&Fo&&typeof Fo[n]=="object"&&(await Fo[n],c=ut.prasiApi[n]),c){if(l==="_raw"){let p=s[0],g=`${n}${p}`,_=await $_(g,s.slice(1));a(_);return}if(c.apiEntry||(c.apiEntry={}),c.apiEntry&&!c.apiEntry[l]){u(`API ${l.toString()} not found, existing API: - ${Object.keys(c.apiEntry||{}).join(` - - `)}`);return}let d=c.apiEntry[l].url,f=c.apiEntry[l].args;if(d&&f){if(s.length>0&&f.length>0)for(let[_,w]of Object.entries(s)){let h=f[parseInt(_)];f&&f.includes(h)&&w&&typeof w!="string"&&typeof w!="number"||(d=d.replace(`:${h}?`,w+""),d=d.replace(`:${h}`,w+""))}let p=`${n}${d}`,g=await $_(p,s);a(g)}else console.error(`API Not Found: ${l.toString()}`)}else u("Failed to load API [Proxy]: "+n)}catch(c){u(c)}})};return i==="then"?new Proxy({},{get:(l,s)=>o(s)}):o(i)}})}catch{return null}},$_=async(e,t)=>await di(e,t,{"content-type":"application/json"});var p1=P(G_());function _i(e){let t=e.length;for(;--t>=0;)e[t]=0}var z2=0,Ov=1,D2=2,j2=3,F2=258,Pd=29,el=256,Go=el+1+Pd,hi=30,Ad=19,Pv=2*Go+1,ur=15,ud=16,U2=7,Ld=256,Av=16,Lv=17,Mv=18,Sd=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),_a=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),B2=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),zv=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),$2=512,nn=new Array((Go+2)*2);_i(nn);var Ho=new Array(hi*2);_i(Ho);var Zo=new Array($2);_i(Zo);var Ko=new Array(F2-j2+1);_i(Ko);var Md=new Array(Pd);_i(Md);var va=new Array(hi);_i(va);function cd(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}var Dv,jv,Fv;function fd(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}var Uv=e=>e<256?Zo[e]:Zo[256+(e>>>7)],Qo=(e,t)=>{e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255},Ve=(e,t,n)=>{e.bi_valid>ud-n?(e.bi_buf|=t<>ud-e.bi_valid,e.bi_valid+=n-ud):(e.bi_buf|=t<{Ve(e,n[t*2],n[t*2+1])},Bv=(e,t)=>{let n=0;do n|=e&1,e>>>=1,n<<=1;while(--t>0);return n>>>1},H2=e=>{e.bi_valid===16?(Qo(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)},V2=(e,t)=>{let n=t.dyn_tree,r=t.max_code,i=t.stat_desc.static_tree,o=t.stat_desc.has_stree,l=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,a=t.stat_desc.max_length,u,c,d,f,p,g,_=0;for(f=0;f<=ur;f++)e.bl_count[f]=0;for(n[e.heap[e.heap_max]*2+1]=0,u=e.heap_max+1;ua&&(f=a,_++),n[c*2+1]=f,!(c>r)&&(e.bl_count[f]++,p=0,c>=s&&(p=l[c-s]),g=n[c*2],e.opt_len+=g*(f+p),o&&(e.static_len+=g*(i[c*2+1]+p)));if(_!==0){do{for(f=a-1;e.bl_count[f]===0;)f--;e.bl_count[f]--,e.bl_count[f+1]+=2,e.bl_count[a]--,_-=2}while(_>0);for(f=a;f!==0;f--)for(c=e.bl_count[f];c!==0;)d=e.heap[--u],!(d>r)&&(n[d*2+1]!==f&&(e.opt_len+=(f-n[d*2+1])*n[d*2],n[d*2+1]=f),c--)}},$v=(e,t,n)=>{let r=new Array(ur+1),i=0,o,l;for(o=1;o<=ur;o++)i=i+n[o-1]<<1,r[o]=i;for(l=0;l<=t;l++){let s=e[l*2+1];s!==0&&(e[l*2]=Bv(r[s]++,s))}},W2=()=>{let e,t,n,r,i,o=new Array(ur+1);for(n=0,r=0;r>=7;r{let t;for(t=0;t{e.bi_valid>8?Qo(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},Z_=(e,t,n,r)=>{let i=t*2,o=n*2;return e[i]{let r=e.heap[n],i=n<<1;for(;i<=e.heap_len&&(i{let r,i,o=0,l,s;if(e.sym_next!==0)do r=e.pending_buf[e.sym_buf+o++]&255,r+=(e.pending_buf[e.sym_buf+o++]&255)<<8,i=e.pending_buf[e.sym_buf+o++],r===0?Lt(e,i,t):(l=Ko[i],Lt(e,l+el+1,t),s=Sd[l],s!==0&&(i-=Md[l],Ve(e,i,s)),r--,l=Uv(r),Lt(e,l,n),s=_a[l],s!==0&&(r-=va[l],Ve(e,r,s)));while(o{let n=t.dyn_tree,r=t.stat_desc.static_tree,i=t.stat_desc.has_stree,o=t.stat_desc.elems,l,s,a=-1,u;for(e.heap_len=0,e.heap_max=Pv,l=0;l>1;l>=1;l--)dd(e,n,l);u=o;do l=e.heap[1],e.heap[1]=e.heap[e.heap_len--],dd(e,n,1),s=e.heap[1],e.heap[--e.heap_max]=l,e.heap[--e.heap_max]=s,n[u*2]=n[l*2]+n[s*2],e.depth[u]=(e.depth[l]>=e.depth[s]?e.depth[l]:e.depth[s])+1,n[l*2+1]=n[s*2+1]=u,e.heap[1]=u++,dd(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],V2(e,t),$v(n,a,e.bl_count)},Q_=(e,t,n)=>{let r,i=-1,o,l=t[0*2+1],s=0,a=7,u=4;for(l===0&&(a=138,u=3),t[(n+1)*2+1]=65535,r=0;r<=n;r++)o=l,l=t[(r+1)*2+1],!(++s{let r,i=-1,o,l=t[0*2+1],s=0,a=7,u=4;for(l===0&&(a=138,u=3),r=0;r<=n;r++)if(o=l,l=t[(r+1)*2+1],!(++s{let t;for(Q_(e,e.dyn_ltree,e.l_desc.max_code),Q_(e,e.dyn_dtree,e.d_desc.max_code),Ed(e,e.bl_desc),t=Ad-1;t>=3&&e.bl_tree[zv[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t},Z2=(e,t,n,r)=>{let i;for(Ve(e,t-257,5),Ve(e,n-1,5),Ve(e,r-4,4),i=0;i{let t=4093624447,n;for(n=0;n<=31;n++,t>>>=1)if(t&1&&e.dyn_ltree[n*2]!==0)return 0;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return 1;for(n=32;n{q_||(W2(),q_=!0),e.l_desc=new fd(e.dyn_ltree,Dv),e.d_desc=new fd(e.dyn_dtree,jv),e.bl_desc=new fd(e.bl_tree,Fv),e.bi_buf=0,e.bi_valid=0,Hv(e)},Wv=(e,t,n,r)=>{Ve(e,(z2<<1)+(r?1:0),3),Vv(e),Qo(e,n),Qo(e,~n),n&&e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n},X2=e=>{Ve(e,Ov<<1,3),Lt(e,Ld,nn),H2(e)},q2=(e,t,n,r)=>{let i,o,l=0;e.level>0?(e.strm.data_type===2&&(e.strm.data_type=K2(e)),Ed(e,e.l_desc),Ed(e,e.d_desc),l=G2(e),i=e.opt_len+3+7>>>3,o=e.static_len+3+7>>>3,o<=i&&(i=o)):i=o=n+5,n+4<=i&&t!==-1?Wv(e,t,n,r):e.strategy===4||o===i?(Ve(e,(Ov<<1)+(r?1:0),3),K_(e,nn,Ho)):(Ve(e,(D2<<1)+(r?1:0),3),Z2(e,e.l_desc.max_code+1,e.d_desc.max_code+1,l+1),K_(e,e.dyn_ltree,e.dyn_dtree)),Hv(e),r&&Vv(e)},J2=(e,t,n)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=n,t===0?e.dyn_ltree[n*2]++:(e.matches++,t--,e.dyn_ltree[(Ko[n]+el+1)*2]++,e.dyn_dtree[Uv(t)*2]++),e.sym_next===e.sym_end),Y2=Q2,eb=Wv,tb=q2,nb=J2,rb=X2,ib={_tr_init:Y2,_tr_stored_block:eb,_tr_flush_block:tb,_tr_tally:nb,_tr_align:rb},ob=(e,t,n,r)=>{let i=e&65535|0,o=e>>>16&65535|0,l=0;for(;n!==0;){l=n>2e3?2e3:n,n-=l;do i=i+t[r++]|0,o=o+i|0;while(--l);i%=65521,o%=65521}return i|o<<16|0},Xo=ob,lb=()=>{let e,t=[];for(var n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=e&1?3988292384^e>>>1:e>>>1;t[n]=e}return t},sb=new Uint32Array(lb()),ab=(e,t,n,r)=>{let i=sb,o=r+n;e^=-1;for(let l=r;l>>8^i[(e^t[l])&255];return e^-1},he=ab,dr={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},hr={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},{_tr_init:ub,_tr_stored_block:bd,_tr_flush_block:cb,_tr_tally:Fn,_tr_align:fb}=ib,{Z_NO_FLUSH:Un,Z_PARTIAL_FLUSH:db,Z_FULL_FLUSH:pb,Z_FINISH:dt,Z_BLOCK:J_,Z_OK:xe,Z_STREAM_END:Y_,Z_STREAM_ERROR:Mt,Z_DATA_ERROR:mb,Z_BUF_ERROR:pd,Z_DEFAULT_COMPRESSION:hb,Z_FILTERED:gb,Z_HUFFMAN_ONLY:pa,Z_RLE:yb,Z_FIXED:_b,Z_DEFAULT_STRATEGY:vb,Z_UNKNOWN:wb,Z_DEFLATED:ka}=hr,xb=9,kb=15,Sb=8,Eb=29,bb=256,Rd=bb+1+Eb,Rb=30,Cb=19,Ib=2*Rd+1,Tb=15,U=3,jn=258,zt=jn+U+1,Nb=32,gi=42,zd=57,Cd=69,Id=73,Td=91,Nd=103,cr=113,Bo=666,ze=1,vi=2,pr=3,wi=4,Ob=3,fr=(e,t)=>(e.msg=dr[t],t),ev=e=>e*2-(e>4?9:0),Dn=e=>{let t=e.length;for(;--t>=0;)e[t]=0},Pb=e=>{let t,n,r,i=e.w_size;t=e.hash_size,r=t;do n=e.head[--r],e.head[r]=n>=i?n-i:0;while(--t);t=i,r=t;do n=e.prev[--r],e.prev[r]=n>=i?n-i:0;while(--t)},Ab=(e,t,n)=>(t<{let t=e.state,n=t.pending;n>e.avail_out&&(n=e.avail_out),n!==0&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+n),e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,t.pending===0&&(t.pending_out=0))},et=(e,t)=>{cb(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Ye(e.strm)},$=(e,t)=>{e.pending_buf[e.pending++]=t},Uo=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255},Od=(e,t,n,r)=>{let i=e.avail_in;return i>r&&(i=r),i===0?0:(e.avail_in-=i,t.set(e.input.subarray(e.next_in,e.next_in+i),n),e.state.wrap===1?e.adler=Xo(e.adler,t,i,n):e.state.wrap===2&&(e.adler=he(e.adler,t,i,n)),e.next_in+=i,e.total_in+=i,i)},Gv=(e,t)=>{let n=e.max_chain_length,r=e.strstart,i,o,l=e.prev_length,s=e.nice_match,a=e.strstart>e.w_size-zt?e.strstart-(e.w_size-zt):0,u=e.window,c=e.w_mask,d=e.prev,f=e.strstart+jn,p=u[r+l-1],g=u[r+l];e.prev_length>=e.good_match&&(n>>=2),s>e.lookahead&&(s=e.lookahead);do if(i=t,!(u[i+l]!==g||u[i+l-1]!==p||u[i]!==u[r]||u[++i]!==u[r+1])){r+=2,i++;do;while(u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&rl){if(e.match_start=t,l=o,o>=s)break;p=u[r+l-1],g=u[r+l]}}while((t=d[t&c])>a&&--n!==0);return l<=e.lookahead?l:e.lookahead},yi=e=>{let t=e.w_size,n,r,i;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-zt)&&(e.window.set(e.window.subarray(t,t+t-r),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),Pb(e),r+=t),e.strm.avail_in===0)break;if(n=Od(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=n,e.lookahead+e.insert>=U)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=Bn(e,e.ins_h,e.window[i+1]);e.insert&&(e.ins_h=Bn(e,e.ins_h,e.window[i+U-1]),e.prev[i&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=i,i++,e.insert--,!(e.lookahead+e.insert{let n=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,r,i,o,l=0,s=e.strm.avail_in;do{if(r=65535,o=e.bi_valid+42>>3,e.strm.avail_outi+e.strm.avail_in&&(r=i+e.strm.avail_in),r>o&&(r=o),r>8,e.pending_buf[e.pending-2]=~r,e.pending_buf[e.pending-1]=~r>>8,Ye(e.strm),i&&(i>r&&(i=r),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+i),e.strm.next_out),e.strm.next_out+=i,e.strm.avail_out-=i,e.strm.total_out+=i,e.block_start+=i,r-=i),r&&(Od(e.strm,e.strm.output,e.strm.next_out,r),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r)}while(l===0);return s-=e.strm.avail_in,s&&(s>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=s&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-s,e.strm.next_in),e.strstart),e.strstart+=s,e.insert+=s>e.w_size-e.insert?e.w_size-e.insert:s),e.block_start=e.strstart),e.high_watero&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,o+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),o>e.strm.avail_in&&(o=e.strm.avail_in),o&&(Od(e.strm,e.window,e.strstart,o),e.strstart+=o,e.insert+=o>e.w_size-e.insert?e.w_size-e.insert:o),e.high_water>3,o=e.pending_buf_size-o>65535?65535:e.pending_buf_size-o,n=o>e.w_size?e.w_size:o,i=e.strstart-e.block_start,(i>=n||(i||t===dt)&&t!==Un&&e.strm.avail_in===0&&i<=o)&&(r=i>o?o:i,l=t===dt&&e.strm.avail_in===0&&r===i?1:0,bd(e,e.block_start,r,l),e.block_start+=r,Ye(e.strm)),l?pr:ze)},md=(e,t)=>{let n,r;for(;;){if(e.lookahead=U&&(e.ins_h=Bn(e,e.ins_h,e.window[e.strstart+U-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),n!==0&&e.strstart-n<=e.w_size-zt&&(e.match_length=Gv(e,n)),e.match_length>=U)if(r=Fn(e,e.strstart-e.match_start,e.match_length-U),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=U){e.match_length--;do e.strstart++,e.ins_h=Bn(e,e.ins_h,e.window[e.strstart+U-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=Bn(e,e.ins_h,e.window[e.strstart+1]);else r=Fn(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(et(e,!1),e.strm.avail_out===0))return ze}return e.insert=e.strstart{let n,r,i;for(;;){if(e.lookahead=U&&(e.ins_h=Bn(e,e.ins_h,e.window[e.strstart+U-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=U-1,n!==0&&e.prev_length4096)&&(e.match_length=U-1)),e.prev_length>=U&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-U,r=Fn(e,e.strstart-1-e.prev_match,e.prev_length-U),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=i&&(e.ins_h=Bn(e,e.ins_h,e.window[e.strstart+U-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=U-1,e.strstart++,r&&(et(e,!1),e.strm.avail_out===0))return ze}else if(e.match_available){if(r=Fn(e,0,e.window[e.strstart-1]),r&&et(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return ze}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=Fn(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart{let n,r,i,o,l=e.window;for(;;){if(e.lookahead<=jn){if(yi(e),e.lookahead<=jn&&t===Un)return ze;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=U&&e.strstart>0&&(i=e.strstart-1,r=l[i],r===l[++i]&&r===l[++i]&&r===l[++i])){o=e.strstart+jn;do;while(r===l[++i]&&r===l[++i]&&r===l[++i]&&r===l[++i]&&r===l[++i]&&r===l[++i]&&r===l[++i]&&r===l[++i]&&ie.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=U?(n=Fn(e,1,e.match_length-U),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=Fn(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(et(e,!1),e.strm.avail_out===0))return ze}return e.insert=0,t===dt?(et(e,!0),e.strm.avail_out===0?pr:wi):e.sym_next&&(et(e,!1),e.strm.avail_out===0)?ze:vi},Mb=(e,t)=>{let n;for(;;){if(e.lookahead===0&&(yi(e),e.lookahead===0)){if(t===Un)return ze;break}if(e.match_length=0,n=Fn(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(et(e,!1),e.strm.avail_out===0))return ze}return e.insert=0,t===dt?(et(e,!0),e.strm.avail_out===0?pr:wi):e.sym_next&&(et(e,!1),e.strm.avail_out===0)?ze:vi};function At(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}var $o=[new At(0,0,0,0,Zv),new At(4,4,8,4,md),new At(4,5,16,8,md),new At(4,6,32,32,md),new At(4,4,16,16,pi),new At(8,16,32,32,pi),new At(8,16,128,128,pi),new At(8,32,128,256,pi),new At(32,128,258,1024,pi),new At(32,258,258,4096,pi)],zb=e=>{e.window_size=2*e.w_size,Dn(e.head),e.max_lazy_match=$o[e.level].max_lazy,e.good_match=$o[e.level].good_length,e.nice_match=$o[e.level].nice_length,e.max_chain_length=$o[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=U-1,e.match_available=0,e.ins_h=0};function Db(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=ka,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(Ib*2),this.dyn_dtree=new Uint16Array((2*Rb+1)*2),this.bl_tree=new Uint16Array((2*Cb+1)*2),Dn(this.dyn_ltree),Dn(this.dyn_dtree),Dn(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(Tb+1),this.heap=new Uint16Array(2*Rd+1),Dn(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*Rd+1),Dn(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}var tl=e=>{if(!e)return 1;let t=e.state;return!t||t.strm!==e||t.status!==gi&&t.status!==zd&&t.status!==Cd&&t.status!==Id&&t.status!==Td&&t.status!==Nd&&t.status!==cr&&t.status!==Bo?1:0},Kv=e=>{if(tl(e))return fr(e,Mt);e.total_in=e.total_out=0,e.data_type=wb;let t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap===2?zd:t.wrap?gi:cr,e.adler=t.wrap===2?0:1,t.last_flush=-2,ub(t),xe},Qv=e=>{let t=Kv(e);return t===xe&&zb(e.state),t},jb=(e,t)=>tl(e)||e.state.wrap!==2?Mt:(e.state.gzhead=t,xe),Xv=(e,t,n,r,i,o)=>{if(!e)return Mt;let l=1;if(t===hb&&(t=6),r<0?(l=0,r=-r):r>15&&(l=2,r-=16),i<1||i>xb||n!==ka||r<8||r>15||t<0||t>9||o<0||o>_b||r===8&&l!==1)return fr(e,Mt);r===8&&(r=9);let s=new Db;return e.state=s,s.strm=e,s.status=gi,s.wrap=l,s.gzhead=null,s.w_bits=r,s.w_size=1<Xv(e,t,ka,kb,Sb,vb),Ub=(e,t)=>{if(tl(e)||t>J_||t<0)return e?fr(e,Mt):Mt;let n=e.state;if(!e.output||e.avail_in!==0&&!e.input||n.status===Bo&&t!==dt)return fr(e,e.avail_out===0?pd:Mt);let r=n.last_flush;if(n.last_flush=t,n.pending!==0){if(Ye(e),e.avail_out===0)return n.last_flush=-1,xe}else if(e.avail_in===0&&ev(t)<=ev(r)&&t!==dt)return fr(e,pd);if(n.status===Bo&&e.avail_in!==0)return fr(e,pd);if(n.status===gi&&n.wrap===0&&(n.status=cr),n.status===gi){let i=ka+(n.w_bits-8<<4)<<8,o=-1;if(n.strategy>=pa||n.level<2?o=0:n.level<6?o=1:n.level===6?o=2:o=3,i|=o<<6,n.strstart!==0&&(i|=Nb),i+=31-i%31,Uo(n,i),n.strstart!==0&&(Uo(n,e.adler>>>16),Uo(n,e.adler&65535)),e.adler=1,n.status=cr,Ye(e),n.pending!==0)return n.last_flush=-1,xe}if(n.status===zd){if(e.adler=0,$(n,31),$(n,139),$(n,8),n.gzhead)$(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),$(n,n.gzhead.time&255),$(n,n.gzhead.time>>8&255),$(n,n.gzhead.time>>16&255),$(n,n.gzhead.time>>24&255),$(n,n.level===9?2:n.strategy>=pa||n.level<2?4:0),$(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&($(n,n.gzhead.extra.length&255),$(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=he(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=Cd;else if($(n,0),$(n,0),$(n,0),$(n,0),$(n,0),$(n,n.level===9?2:n.strategy>=pa||n.level<2?4:0),$(n,Ob),n.status=cr,Ye(e),n.pending!==0)return n.last_flush=-1,xe}if(n.status===Cd){if(n.gzhead.extra){let i=n.pending,o=(n.gzhead.extra.length&65535)-n.gzindex;for(;n.pending+o>n.pending_buf_size;){let s=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+s),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>i&&(e.adler=he(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex+=s,Ye(e),n.pending!==0)return n.last_flush=-1,xe;i=0,o-=s}let l=new Uint8Array(n.gzhead.extra);n.pending_buf.set(l.subarray(n.gzindex,n.gzindex+o),n.pending),n.pending+=o,n.gzhead.hcrc&&n.pending>i&&(e.adler=he(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex=0}n.status=Id}if(n.status===Id){if(n.gzhead.name){let i=n.pending,o;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>i&&(e.adler=he(e.adler,n.pending_buf,n.pending-i,i)),Ye(e),n.pending!==0)return n.last_flush=-1,xe;i=0}n.gzindexi&&(e.adler=he(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex=0}n.status=Td}if(n.status===Td){if(n.gzhead.comment){let i=n.pending,o;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>i&&(e.adler=he(e.adler,n.pending_buf,n.pending-i,i)),Ye(e),n.pending!==0)return n.last_flush=-1,xe;i=0}n.gzindexi&&(e.adler=he(e.adler,n.pending_buf,n.pending-i,i))}n.status=Nd}if(n.status===Nd){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(Ye(e),n.pending!==0))return n.last_flush=-1,xe;$(n,e.adler&255),$(n,e.adler>>8&255),e.adler=0}if(n.status=cr,Ye(e),n.pending!==0)return n.last_flush=-1,xe}if(e.avail_in!==0||n.lookahead!==0||t!==Un&&n.status!==Bo){let i=n.level===0?Zv(n,t):n.strategy===pa?Mb(n,t):n.strategy===yb?Lb(n,t):$o[n.level].func(n,t);if((i===pr||i===wi)&&(n.status=Bo),i===ze||i===pr)return e.avail_out===0&&(n.last_flush=-1),xe;if(i===vi&&(t===db?fb(n):t!==J_&&(bd(n,0,0,!1),t===pb&&(Dn(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),Ye(e),e.avail_out===0))return n.last_flush=-1,xe}return t!==dt?xe:n.wrap<=0?Y_:(n.wrap===2?($(n,e.adler&255),$(n,e.adler>>8&255),$(n,e.adler>>16&255),$(n,e.adler>>24&255),$(n,e.total_in&255),$(n,e.total_in>>8&255),$(n,e.total_in>>16&255),$(n,e.total_in>>24&255)):(Uo(n,e.adler>>>16),Uo(n,e.adler&65535)),Ye(e),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?xe:Y_)},Bb=e=>{if(tl(e))return Mt;let t=e.state.status;return e.state=null,t===cr?fr(e,mb):xe},$b=(e,t)=>{let n=t.length;if(tl(e))return Mt;let r=e.state,i=r.wrap;if(i===2||i===1&&r.status!==gi||r.lookahead)return Mt;if(i===1&&(e.adler=Xo(e.adler,t,n,0)),r.wrap=0,n>=r.w_size){i===0&&(Dn(r.head),r.strstart=0,r.block_start=0,r.insert=0);let a=new Uint8Array(r.w_size);a.set(t.subarray(n-r.w_size,n),0),t=a,n=r.w_size}let o=e.avail_in,l=e.next_in,s=e.input;for(e.avail_in=n,e.next_in=0,e.input=t,yi(r);r.lookahead>=U;){let a=r.strstart,u=r.lookahead-(U-1);do r.ins_h=Bn(r,r.ins_h,r.window[a+U-1]),r.prev[a&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=a,a++;while(--u);r.strstart=a,r.lookahead=U-1,yi(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=U-1,r.match_available=0,e.next_in=l,e.input=s,e.avail_in=o,r.wrap=i,xe},Hb=Fb,Vb=Xv,Wb=Qv,Gb=Kv,Zb=jb,Kb=Ub,Qb=Bb,Xb=$b,qb="pako deflate (from Nodeca project)",Vo={deflateInit:Hb,deflateInit2:Vb,deflateReset:Wb,deflateResetKeep:Gb,deflateSetHeader:Zb,deflate:Kb,deflateEnd:Qb,deflateSetDictionary:Xb,deflateInfo:qb},Jb=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),Yb=function(e){let t=Array.prototype.slice.call(arguments,1);for(;t.length;){let n=t.shift();if(n){if(typeof n!="object")throw new TypeError(n+"must be non-object");for(let r in n)Jb(n,r)&&(e[r]=n[r])}}return e},eR=e=>{let t=0;for(let r=0,i=e.length;r=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;qo[254]=qo[254]=1;var tR=e=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let t,n,r,i,o,l=e.length,s=0;for(i=0;i>>6,t[o++]=128|n&63):n<65536?(t[o++]=224|n>>>12,t[o++]=128|n>>>6&63,t[o++]=128|n&63):(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63,t[o++]=128|n>>>6&63,t[o++]=128|n&63);return t},nR=(e,t)=>{if(t<65534&&e.subarray&&qv)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let n="";for(let r=0;r{let n=t||e.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(e.subarray(0,t));let r,i,o=new Array(n*2);for(i=0,r=0;r4){o[i++]=65533,r+=s-1;continue}for(l&=s===2?31:s===3?15:7;s>1&&r1){o[i++]=65533;continue}l<65536?o[i++]=l:(l-=65536,o[i++]=55296|l>>10&1023,o[i++]=56320|l&1023)}return nR(o,i)},iR=(e,t)=>{t=t||e.length,t>e.length&&(t=e.length);let n=t-1;for(;n>=0&&(e[n]&192)===128;)n--;return n<0||n===0?t:n+qo[e[n]]>t?n:t},Jo={string2buf:tR,buf2string:rR,utf8border:iR};function oR(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var Jv=oR,Yv=Object.prototype.toString,{Z_NO_FLUSH:lR,Z_SYNC_FLUSH:sR,Z_FULL_FLUSH:aR,Z_FINISH:uR,Z_OK:wa,Z_STREAM_END:cR,Z_DEFAULT_COMPRESSION:fR,Z_DEFAULT_STRATEGY:dR,Z_DEFLATED:pR}=hr;function nl(e){this.options=Sa.assign({level:fR,method:pR,chunkSize:16384,windowBits:15,memLevel:8,strategy:dR},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Jv,this.strm.avail_out=0;let n=Vo.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==wa)throw new Error(dr[n]);if(t.header&&Vo.deflateSetHeader(this.strm,t.header),t.dictionary){let r;if(typeof t.dictionary=="string"?r=Jo.string2buf(t.dictionary):Yv.call(t.dictionary)==="[object ArrayBuffer]"?r=new Uint8Array(t.dictionary):r=t.dictionary,n=Vo.deflateSetDictionary(this.strm,r),n!==wa)throw new Error(dr[n]);this._dict_set=!0}}nl.prototype.push=function(e,t){let n=this.strm,r=this.options.chunkSize,i,o;if(this.ended)return!1;for(t===~~t?o=t:o=t===!0?uR:lR,typeof e=="string"?n.input=Jo.string2buf(e):Yv.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){if(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),(o===sR||o===aR)&&n.avail_out<=6){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(i=Vo.deflate(n,o),i===cR)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),i=Vo.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===wa;if(n.avail_out===0){this.onData(n.output);continue}if(o>0&&n.next_out>0){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(n.avail_in===0)break}return!0};nl.prototype.onData=function(e){this.chunks.push(e)};nl.prototype.onEnd=function(e){e===wa&&(this.result=Sa.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Dd(e,t){let n=new nl(t);if(n.push(e,!0),n.err)throw n.msg||dr[n.err];return n.result}function mR(e,t){return t=t||{},t.raw=!0,Dd(e,t)}function hR(e,t){return t=t||{},t.gzip=!0,Dd(e,t)}var gR=nl,yR=Dd,_R=mR,vR=hR,wR=hr,xR={Deflate:gR,deflate:yR,deflateRaw:_R,gzip:vR,constants:wR},ma=16209,kR=16191,SR=function(t,n){let r,i,o,l,s,a,u,c,d,f,p,g,_,w,h,m,y,v,S,R,k,b,N,C,O=t.state;r=t.next_in,N=t.input,i=r+(t.avail_in-5),o=t.next_out,C=t.output,l=o-(n-t.avail_out),s=o+(t.avail_out-257),a=O.dmax,u=O.wsize,c=O.whave,d=O.wnext,f=O.window,p=O.hold,g=O.bits,_=O.lencode,w=O.distcode,h=(1<>>24,p>>>=v,g-=v,v=y>>>16&255,v===0)C[o++]=y&65535;else if(v&16){S=y&65535,v&=15,v&&(g>>=v,g-=v),g<15&&(p+=N[r++]<>>24,p>>>=v,g-=v,v=y>>>16&255,v&16){if(R=y&65535,v&=15,ga){t.msg="invalid distance too far back",O.mode=ma;break e}if(p>>>=v,g-=v,v=o-l,R>v){if(v=R-v,v>c&&O.sane){t.msg="invalid distance too far back",O.mode=ma;break e}if(k=0,b=f,d===0){if(k+=u-v,v2;)C[o++]=b[k++],C[o++]=b[k++],C[o++]=b[k++],S-=3;S&&(C[o++]=b[k++],S>1&&(C[o++]=b[k++]))}else{k=o-R;do C[o++]=C[k++],C[o++]=C[k++],C[o++]=C[k++],S-=3;while(S>2);S&&(C[o++]=C[k++],S>1&&(C[o++]=C[k++]))}}else if(v&64){t.msg="invalid distance code",O.mode=ma;break e}else{y=w[(y&65535)+(p&(1<>3,r-=S,g-=S<<3,p&=(1<{let a=s.bits,u=0,c=0,d=0,f=0,p=0,g=0,_=0,w=0,h=0,m=0,y,v,S,R,k,b=null,N,C=new Uint16Array(mi+1),O=new Uint16Array(mi+1),De=null,il,Dt,jt;for(u=0;u<=mi;u++)C[u]=0;for(c=0;c=1&&C[f]===0;f--);if(p>f&&(p=f),f===0)return i[o++]=1<<24|64<<16|0,i[o++]=1<<24|64<<16|0,s.bits=1,0;for(d=1;d0&&(e===rv||f!==1))return-1;for(O[1]=0,u=1;utv||e===iv&&h>nv)return 1;for(;;){il=u-_,l[c]+1=N?(Dt=De[l[c]-N],jt=b[l[c]-N]):(Dt=96,jt=0),y=1<>_)+v]=il<<24|Dt<<16|jt|0;while(v!==0);for(y=1<>=1;if(y!==0?(m&=y-1,m+=y):m=0,c++,--C[u]===0){if(u===f)break;u=t[n+l[c]]}if(u>p&&(m&R)!==S){for(_===0&&(_=p),k+=d,g=u-_,w=1<tv||e===iv&&h>nv)return 1;S=m&R,i[S]=p<<24|g<<16|k-o|0}}return m!==0&&(i[k+m]=u-_<<24|64<<16|0),s.bits=p,0},Wo=IR,TR=0,e1=1,t1=2,{Z_FINISH:ov,Z_BLOCK:NR,Z_TREES:ha,Z_OK:mr,Z_STREAM_END:OR,Z_NEED_DICT:PR,Z_STREAM_ERROR:pt,Z_DATA_ERROR:n1,Z_MEM_ERROR:r1,Z_BUF_ERROR:AR,Z_DEFLATED:lv}=hr,Ea=16180,sv=16181,av=16182,uv=16183,cv=16184,fv=16185,dv=16186,pv=16187,mv=16188,hv=16189,xa=16190,tn=16191,gd=16192,gv=16193,yd=16194,yv=16195,_v=16196,vv=16197,wv=16198,ga=16199,ya=16200,xv=16201,kv=16202,Sv=16203,Ev=16204,bv=16205,_d=16206,Rv=16207,Cv=16208,ee=16209,i1=16210,o1=16211,LR=852,MR=592,zR=15,DR=zR,Iv=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function jR(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var gr=e=>{if(!e)return 1;let t=e.state;return!t||t.strm!==e||t.modeo1?1:0},l1=e=>{if(gr(e))return pt;let t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=Ea,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(LR),t.distcode=t.distdyn=new Int32Array(MR),t.sane=1,t.back=-1,mr},s1=e=>{if(gr(e))return pt;let t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,l1(e)},a1=(e,t)=>{let n;if(gr(e))return pt;let r=e.state;return t<0?(n=0,t=-t):(n=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?pt:(r.window!==null&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,s1(e))},u1=(e,t)=>{if(!e)return pt;let n=new jR;e.state=n,n.strm=e,n.window=null,n.mode=Ea;let r=a1(e,t);return r!==mr&&(e.state=null),r},FR=e=>u1(e,DR),Tv=!0,vd,wd,UR=e=>{if(Tv){vd=new Int32Array(512),wd=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(Wo(e1,e.lens,0,288,vd,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;Wo(t1,e.lens,0,32,wd,0,e.work,{bits:5}),Tv=!1}e.lencode=vd,e.lenbits=9,e.distcode=wd,e.distbits=5},c1=(e,t,n,r)=>{let i,o=e.state;return o.window===null&&(o.wsize=1<=o.wsize?(o.window.set(t.subarray(n-o.wsize,n),0),o.wnext=0,o.whave=o.wsize):(i=o.wsize-o.wnext,i>r&&(i=r),o.window.set(t.subarray(n-r,n-r+i),o.wnext),r-=i,r?(o.window.set(t.subarray(n-r,n),0),o.wnext=r,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave{let n,r,i,o,l,s,a,u,c,d,f,p,g,_,w=0,h,m,y,v,S,R,k,b,N=new Uint8Array(4),C,O,De=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(gr(e)||!e.output||!e.input&&e.avail_in!==0)return pt;n=e.state,n.mode===tn&&(n.mode=gd),l=e.next_out,i=e.output,a=e.avail_out,o=e.next_in,r=e.input,s=e.avail_in,u=n.hold,c=n.bits,d=s,f=a,b=mr;e:for(;;)switch(n.mode){case Ea:if(n.wrap===0){n.mode=gd;break}for(;c<16;){if(s===0)break e;s--,u+=r[o++]<>>8&255,n.check=he(n.check,N,2,0),u=0,c=0,n.mode=sv;break}if(n.head&&(n.head.done=!1),!(n.wrap&1)||(((u&255)<<8)+(u>>8))%31){e.msg="incorrect header check",n.mode=ee;break}if((u&15)!==lv){e.msg="unknown compression method",n.mode=ee;break}if(u>>>=4,c-=4,k=(u&15)+8,n.wbits===0&&(n.wbits=k),k>15||k>n.wbits){e.msg="invalid window size",n.mode=ee;break}n.dmax=1<>8&1),n.flags&512&&n.wrap&4&&(N[0]=u&255,N[1]=u>>>8&255,n.check=he(n.check,N,2,0)),u=0,c=0,n.mode=av;case av:for(;c<32;){if(s===0)break e;s--,u+=r[o++]<>>8&255,N[2]=u>>>16&255,N[3]=u>>>24&255,n.check=he(n.check,N,4,0)),u=0,c=0,n.mode=uv;case uv:for(;c<16;){if(s===0)break e;s--,u+=r[o++]<>8),n.flags&512&&n.wrap&4&&(N[0]=u&255,N[1]=u>>>8&255,n.check=he(n.check,N,2,0)),u=0,c=0,n.mode=cv;case cv:if(n.flags&1024){for(;c<16;){if(s===0)break e;s--,u+=r[o++]<>>8&255,n.check=he(n.check,N,2,0)),u=0,c=0}else n.head&&(n.head.extra=null);n.mode=fv;case fv:if(n.flags&1024&&(p=n.length,p>s&&(p=s),p&&(n.head&&(k=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(r.subarray(o,o+p),k)),n.flags&512&&n.wrap&4&&(n.check=he(n.check,r,p,o)),s-=p,o+=p,n.length-=p),n.length))break e;n.length=0,n.mode=dv;case dv:if(n.flags&2048){if(s===0)break e;p=0;do k=r[o+p++],n.head&&k&&n.length<65536&&(n.head.name+=String.fromCharCode(k));while(k&&p>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=tn;break;case hv:for(;c<32;){if(s===0)break e;s--,u+=r[o++]<>>=c&7,c-=c&7,n.mode=_d;break}for(;c<3;){if(s===0)break e;s--,u+=r[o++]<>>=1,c-=1,u&3){case 0:n.mode=gv;break;case 1:if(UR(n),n.mode=ga,t===ha){u>>>=2,c-=2;break e}break;case 2:n.mode=_v;break;case 3:e.msg="invalid block type",n.mode=ee}u>>>=2,c-=2;break;case gv:for(u>>>=c&7,c-=c&7;c<32;){if(s===0)break e;s--,u+=r[o++]<>>16^65535)){e.msg="invalid stored block lengths",n.mode=ee;break}if(n.length=u&65535,u=0,c=0,n.mode=yd,t===ha)break e;case yd:n.mode=yv;case yv:if(p=n.length,p){if(p>s&&(p=s),p>a&&(p=a),p===0)break e;i.set(r.subarray(o,o+p),l),s-=p,o+=p,a-=p,l+=p,n.length-=p;break}n.mode=tn;break;case _v:for(;c<14;){if(s===0)break e;s--,u+=r[o++]<>>=5,c-=5,n.ndist=(u&31)+1,u>>>=5,c-=5,n.ncode=(u&15)+4,u>>>=4,c-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=ee;break}n.have=0,n.mode=vv;case vv:for(;n.have>>=3,c-=3}for(;n.have<19;)n.lens[De[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,C={bits:n.lenbits},b=Wo(TR,n.lens,0,19,n.lencode,0,n.work,C),n.lenbits=C.bits,b){e.msg="invalid code lengths set",n.mode=ee;break}n.have=0,n.mode=wv;case wv:for(;n.have>>24,m=w>>>16&255,y=w&65535,!(h<=c);){if(s===0)break e;s--,u+=r[o++]<>>=h,c-=h,n.lens[n.have++]=y;else{if(y===16){for(O=h+2;c>>=h,c-=h,n.have===0){e.msg="invalid bit length repeat",n.mode=ee;break}k=n.lens[n.have-1],p=3+(u&3),u>>>=2,c-=2}else if(y===17){for(O=h+3;c>>=h,c-=h,k=0,p=3+(u&7),u>>>=3,c-=3}else{for(O=h+7;c>>=h,c-=h,k=0,p=11+(u&127),u>>>=7,c-=7}if(n.have+p>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=ee;break}for(;p--;)n.lens[n.have++]=k}}if(n.mode===ee)break;if(n.lens[256]===0){e.msg="invalid code -- missing end-of-block",n.mode=ee;break}if(n.lenbits=9,C={bits:n.lenbits},b=Wo(e1,n.lens,0,n.nlen,n.lencode,0,n.work,C),n.lenbits=C.bits,b){e.msg="invalid literal/lengths set",n.mode=ee;break}if(n.distbits=6,n.distcode=n.distdyn,C={bits:n.distbits},b=Wo(t1,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,C),n.distbits=C.bits,b){e.msg="invalid distances set",n.mode=ee;break}if(n.mode=ga,t===ha)break e;case ga:n.mode=ya;case ya:if(s>=6&&a>=258){e.next_out=l,e.avail_out=a,e.next_in=o,e.avail_in=s,n.hold=u,n.bits=c,SR(e,f),l=e.next_out,i=e.output,a=e.avail_out,o=e.next_in,r=e.input,s=e.avail_in,u=n.hold,c=n.bits,n.mode===tn&&(n.back=-1);break}for(n.back=0;w=n.lencode[u&(1<>>24,m=w>>>16&255,y=w&65535,!(h<=c);){if(s===0)break e;s--,u+=r[o++]<>v)],h=w>>>24,m=w>>>16&255,y=w&65535,!(v+h<=c);){if(s===0)break e;s--,u+=r[o++]<>>=v,c-=v,n.back+=v}if(u>>>=h,c-=h,n.back+=h,n.length=y,m===0){n.mode=bv;break}if(m&32){n.back=-1,n.mode=tn;break}if(m&64){e.msg="invalid literal/length code",n.mode=ee;break}n.extra=m&15,n.mode=xv;case xv:if(n.extra){for(O=n.extra;c>>=n.extra,c-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=kv;case kv:for(;w=n.distcode[u&(1<>>24,m=w>>>16&255,y=w&65535,!(h<=c);){if(s===0)break e;s--,u+=r[o++]<>v)],h=w>>>24,m=w>>>16&255,y=w&65535,!(v+h<=c);){if(s===0)break e;s--,u+=r[o++]<>>=v,c-=v,n.back+=v}if(u>>>=h,c-=h,n.back+=h,m&64){e.msg="invalid distance code",n.mode=ee;break}n.offset=y,n.extra=m&15,n.mode=Sv;case Sv:if(n.extra){for(O=n.extra;c>>=n.extra,c-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=ee;break}n.mode=Ev;case Ev:if(a===0)break e;if(p=f-a,n.offset>p){if(p=n.offset-p,p>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=ee;break}p>n.wnext?(p-=n.wnext,g=n.wsize-p):g=n.wnext-p,p>n.length&&(p=n.length),_=n.window}else _=i,g=l-n.offset,p=n.length;p>a&&(p=a),a-=p,n.length-=p;do i[l++]=_[g++];while(--p);n.length===0&&(n.mode=ya);break;case bv:if(a===0)break e;i[l++]=n.length,a--,n.mode=ya;break;case _d:if(n.wrap){for(;c<32;){if(s===0)break e;s--,u|=r[o++]<{if(gr(e))return pt;let t=e.state;return t.window&&(t.window=null),e.state=null,mr},HR=(e,t)=>{if(gr(e))return pt;let n=e.state;return n.wrap&2?(n.head=t,t.done=!1,mr):pt},VR=(e,t)=>{let n=t.length,r,i,o;return gr(e)||(r=e.state,r.wrap!==0&&r.mode!==xa)?pt:r.mode===xa&&(i=1,i=Xo(i,t,n,0),i!==r.check)?n1:(o=c1(e,t,n,n),o?(r.mode=i1,r1):(r.havedict=1,mr))},WR=s1,GR=a1,ZR=l1,KR=FR,QR=u1,XR=BR,qR=$R,JR=HR,YR=VR,eC="pako inflate (from Nodeca project)",rn={inflateReset:WR,inflateReset2:GR,inflateResetKeep:ZR,inflateInit:KR,inflateInit2:QR,inflate:XR,inflateEnd:qR,inflateGetHeader:JR,inflateSetDictionary:YR,inflateInfo:eC};function tC(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var nC=tC,f1=Object.prototype.toString,{Z_NO_FLUSH:rC,Z_FINISH:iC,Z_OK:Yo,Z_STREAM_END:xd,Z_NEED_DICT:kd,Z_STREAM_ERROR:oC,Z_DATA_ERROR:Nv,Z_MEM_ERROR:lC}=hr;function rl(e){this.options=Sa.assign({chunkSize:1024*64,windowBits:15,to:""},e||{});let t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Jv,this.strm.avail_out=0;let n=rn.inflateInit2(this.strm,t.windowBits);if(n!==Yo)throw new Error(dr[n]);if(this.header=new nC,rn.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=Jo.string2buf(t.dictionary):f1.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=rn.inflateSetDictionary(this.strm,t.dictionary),n!==Yo)))throw new Error(dr[n])}rl.prototype.push=function(e,t){let n=this.strm,r=this.options.chunkSize,i=this.options.dictionary,o,l,s;if(this.ended)return!1;for(t===~~t?l=t:l=t===!0?iC:rC,f1.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){for(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),o=rn.inflate(n,l),o===kd&&i&&(o=rn.inflateSetDictionary(n,i),o===Yo?o=rn.inflate(n,l):o===Nv&&(o=kd));n.avail_in>0&&o===xd&&n.state.wrap>0&&e[n.next_in]!==0;)rn.inflateReset(n),o=rn.inflate(n,l);switch(o){case oC:case Nv:case kd:case lC:return this.onEnd(o),this.ended=!0,!1}if(s=n.avail_out,n.next_out&&(n.avail_out===0||o===xd))if(this.options.to==="string"){let a=Jo.utf8border(n.output,n.next_out),u=n.next_out-a,c=Jo.buf2string(n.output,a);n.next_out=u,n.avail_out=r-u,u&&n.output.set(n.output.subarray(a,a+u),0),this.onData(c)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(!(o===Yo&&s===0)){if(o===xd)return o=rn.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,!0;if(n.avail_in===0)break}}return!0};rl.prototype.onData=function(e){this.chunks.push(e)};rl.prototype.onEnd=function(e){e===Yo&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Sa.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function jd(e,t){let n=new rl(t);if(n.push(e),n.err)throw n.msg||dr[n.err];return n.result}function sC(e,t){return t=t||{},t.raw=!0,jd(e,t)}var aC=rl,uC=jd,cC=sC,fC=jd,dC=hr,pC={Inflate:aC,inflate:uC,inflateRaw:cC,ungzip:fC,constants:dC},{Deflate:mC,deflate:hC,deflateRaw:gC,gzip:yC}=xR,{Inflate:_C,inflate:vC,inflateRaw:wC,ungzip:xC}=pC,kC=mC,SC=hC,EC=gC,bC=yC,RC=_C,CC=vC,IC=wC,TC=xC,NC=hr,d1={Deflate:kC,deflate:SC,deflateRaw:EC,gzip:bC,Inflate:RC,inflate:CC,inflateRaw:IC,ungzip:TC,constants:NC};var m1=e=>{let t="";return new Proxy({},{get(n,r){return r==="_batch"?{update:async i=>yr({name:t,action:"batch_update",table:"",params:{batch:i}},e),upsert:async i=>yr({name:t,action:"batch_upsert",table:"",params:{arg:i}},e)}:r==="_schema"?{tables:async()=>yr({name:t,action:"schema_tables",table:"",params:[]},e),columns:async i=>yr({name:t,action:"schema_columns",table:i,params:[]},e),rels:async i=>yr({name:t,action:"schema_rels",table:i,params:[]},e)}:r.startsWith("$")?(...i)=>{let o=d1.gzip(JSON.stringify(i));return yr({name:t,action:"query",table:r,params:btoa(o.reduce((l,s)=>l+String.fromCharCode(s),""))},e)}:new Proxy({},{get(i,o){return async(...l)=>(r==="query"&&(r=o,o="query"),await yr({name:t,action:o,table:r,params:l},e))}})}})},ba={},yr=async(e,t)=>{try{let n=new URL(t);n.pathname="/_dbs",e.table&&(n.pathname+=`/${e.table}`);let r=n.toString();typeof localStorage<"u"&&localStorage.mlsid&&(e.mlsid=localStorage.mlsid);let i=(0,p1.default)(e),o=ba[i];if(!o||o&&Date.now()-o.timestamp>1e3){ba[i]={timestamp:Date.now(),promise:di(r,e,{"content-type":"application/json"}),result:null};let l=await ba[i].promise;return ba[i].result=l,l}return await o.promise}catch{}};var h1=P(Cf());var g1=e=>{let{item:t,item_comp:n,ids:r}=e,i=Tn(n);if(y1(i,r),t.id&&(i.id=t.id),i.hidden=t.hidden,i.component){if(i.component.props&&t.component)for(let o of Object.keys(i.component.props)){let l=t.component.props[o],s=i.component.props[o];l&&(s.value=l.value,s.valueBuilt=l.valueBuilt,s.jsxCalledBy=l.jsxCalledBy,s.content=l.content)}i.component.instances=t.component?.instances,i.component.style=t.component?.style}for(let o of Object.keys(t))delete t[o];for(let[o,l]of Object.entries(i))t[o]=l},y1=(e,t)=>{if(e.originalId=e.id,t[e.id]||(t[e.id]=(0,h1.createId)()),e.id=t[e.id],e.childs)for(let n of e.childs)y1(n,t)};var _1=e=>{let t=Object.entries(e.item_comp.component?.props||{}).sort((n,r)=>n[1].idx-r[1].idx);for(let[n,r]of t){let i=Tn(r),o=e.item.component?.props;o&&o[n]&&(i.value=o[n].value,i.valueBuilt=o[n].valueBuilt,o[n].content&&(i.content=o[n].content)),i&&e.each(n,i)}};var Ra=e=>{let t={};for(let[n,r]of Object.entries(e))if(n==="childs"){if(t.childs=[],r&&Array.isArray(r))for(let i of r)i.type==="item"&&i.component?t.childs.push(i):t.childs.push({name:i.name,id:i.id,originalId:i.originalId})}else t[n]=r;return t};var v1=(e,t)=>{let{item:n}=t;if(n.type==="item"&&n.component?.id&&t.parent?.item.id){let r=e.comps[n.component.id];if(e.on?.visit_component&&e.on.visit_component(n,t.root||t.item),!r)return;if(r){let i;if(e.mode==="page"?(n.component.instances||(n.component.instances={}),i=n.component.instances):i=t.parent?.root_instances,i){let l=i[n.id];i[n.id]||(i[n.id]={},l=i[n.id]),g1({item:n,item_comp:r,ids:l})}let o={item:Ra(n),jsx_prop:t.jsx_prop,parent:{id:t.parent.item.id,comp_id:t.parent?.comp?.component?.id,instance_id:t.parent?.instance_id},instances:i};e.on?.visit&&e.on.visit(o,n,t.root||t.item),n.id&&e.set_meta!==!1&&(e.meta[n.id]=o),_1({item:n,item_comp:r,instance:i?i[n.id]:{},each(l,s){let a=n.component?.id;s.meta?.type==="content-element"&&a&&s.content&&(s.content.name=l,xi({...e},{item:s.content,root:t.root||s.content,is_root:!1,jsx_prop:{is_root:!0,comp_id:a,name:l},parent:{item:o.item,instance_id:n.id,comp:r,root_instances:i}}))}});for(let l of Object.values(n.childs))l?.name?.startsWith("jsx:")||l&&Object.keys(l).length>3&&xi({...e,mode:"comp"},{item:l,is_root:!1,root:t.root||t.item,parent:{item:n,instance_id:n.id,root_instances:i,comp:r}})}}};var xi=(e,t)=>{let n=t.item;if(n.type==="item"&&n.component?.id&&t.ignore_first_component!==!0){v1(e,t);return}let r={item:Ra(n),parent:{id:t.parent?.item.id||"root",instance_id:t.parent?.instance_id,comp_id:t.parent?.comp?.component?.id}};if(t.jsx_prop&&(r.jsx_prop=t.jsx_prop),e.on?.visit&&e.on.visit(r,n,t.root||t.item),n.id&&e.set_meta!==!1&&(e.meta[r.item.id]=r),n.childs){for(let[i,o]of Object.entries(n.childs))if(o.id){let l={item:o,is_root:!1,root:t.root||t.item,parent:{item:r.item,instance_id:t.parent?.instance_id,comp:t.parent?.comp,root_instances:t.parent?.root_instances}};t.jsx_prop&&(l.jsx_prop={...t.jsx_prop,is_root:!1}),xi(e,l)}}};var OC=()=>new Promise(async e=>{let t=!1,n=await(await fetch(I.url`_prasi/route`)).json();t||e(n)}),w1=async()=>{let e=Bs(),t=[];try{let n=await OC();if(n&&n.site&&n.urls){n.layout&&(I.layout.id=n.layout.id,I.layout.root=n.layout.root,I.layout.meta={},I.layout.root&&(await li(I.layout.root.childs),Ca(I.layout.meta,I.layout.root))),I.site=n.site,I.site.code={mode:"vsc"},await PC(),I.site.api=H_(I.site.api_url),I.site.db=m1(I.site.api_url);let r=window;r.serverurl=I.site.api_url,r.db=I.site.db,r.api=I.site.api;for(let i of n.urls)e.insert(i.url,i),t.push(i)}}catch{}return{router:e,pages:t}},PC=()=>new Promise(e=>{let t=document,n=t.createElement("script");n.onload=async()=>{e()};let r=I.site.api_url;if(r==="*")r=`${location.protocol}//${location.host}`,I.site.api_url=r;else try{new URL(r)}catch{location.hostname==="localhost"?r="http://localhost:4550":r="https://prasi.avolut.com"}localStorage.getItem("api-ts-"+r)||localStorage.setItem("api-ts-"+r,Date.now().toString());let i=localStorage.getItem("api-ts-"+r);n.src=`${r}/_prasi/load.js?url=${r}&v3&ts=${i}`,document.querySelector(`script[src="${n.src}"]`)?e():t.body.appendChild(n)}),Ca=(e,t)=>{for(let n of t.childs)xi({set_meta:!0,comps:I.comp.list,meta:e,mode:"page"},{item:n})};var se=window;var on=P(G()),Ud=()=>location.hostname.split(".").length===4||location.hostname==="prasi.app"||location.hostname==="prasi.avolut.com"||location.hostname.includes("ngrok")||location.hostname==="localhost"||location.hostname==="127.0.0.1"||location.hostname==="10.0.2.2",k1=()=>{let e=In({page_id:""}),[t,n]=(0,x1.useState)({}),r=()=>n({});se.prasiContext.render=r;let i=nf.Provider,o=Ud()&&location.pathname.startsWith("/prod");if(I.route.status!=="ready")return I.route.status==="init"&&(I.route.status="loading",w1().then(async({router:c,pages:d})=>{Fy(),I.route.status="ready",I.route.router=c,I.route.pages=d;let f=se._prasi.basepath,p=`${f.endsWith("/")?f:`${f}/`}_prasi/code/index.js`,g=new URL(location.href);p.startsWith("/")&&(p=`${g.protocol}//${g.host}${p}`);let _=new Function("callback",`import("${p}").then(callback)`);await new Promise(w=>{_(h=>{for(let[m,y]of Object.entries(h))se[m]=y;w()})}),r()})),(0,on.jsx)(_o,{});let l=I.route.router;if(!l)return(0,on.jsx)(ff,{children:"Failed to create Router"});let s="";if(o){let c=location.pathname.split("/");cf(c[3])&&(s=c[3])}let a=null;if(se._prasi.page_id)l.insert(I.pathname,{id:se._prasi.page_id,url:I.pathname}),a={id:se._prasi.page_id,url:"",params:se._prasi.params},se._prasi.routed={page_id:se._prasi.page_id,params:se._prasi.params},delete se._prasi.page_id,delete se._prasi.params;else{if(a=l.lookup(I.pathname),s){let c=I.route.pages.find(d=>s===d.id);c&&(a=c)}a&&se._prasi.routed&&se._prasi.routed.page_id===a.id&&se._prasi.routed.params&&(a.params=se._prasi.routed.params)}if(!a)return(0,on.jsx)(ff,{children:"Page Not Found"});a.id!==e.page_id&&(I.init_local_effect={}),se.params=a.params||{},I.page.id=a.id,I.page.url=a.url;let u=I.page.cache[a.id];if(u)I.page.root=u.root,I.page.meta=u.meta;else return My(a.id).then(async({root:c})=>{if(a){let d={id:a.id,url:a.url,root:c,meta:{}};await li(c.childs),Ca(d.meta,c),I.page.cache[d.id]=d,r()}}).catch(()=>{r()}),(0,on.jsx)(_o,{note:"Loading page"});return(0,on.jsx)(i,{value:se.prasiContext,children:(0,on.jsx)("div",{className:cx("relative flex flex-1 items-center justify-center"),children:(0,on.jsx)("div",{className:cx("absolute flex flex-col items-stretch flex-1 bg-white main-content-preview",I.mode==="mobile"?css` + - `)}`);return}let d=c.apiEntry[l].url,f=c.apiEntry[l].args;if(d&&f){if(s.length>0&&f.length>0)for(let[_,w]of Object.entries(s)){let h=f[parseInt(_)];f&&f.includes(h)&&w&&typeof w!="string"&&typeof w!="number"||(d=d.replace(`:${h}?`,w+""),d=d.replace(`:${h}`,w+""))}let p=`${n}${d}`,g=await $_(p,s);a(g)}else console.error(`API Not Found: ${l.toString()}`)}else u("Failed to load API [Proxy]: "+n)}catch(c){u(c)}})};return i==="then"?new Proxy({},{get:(l,s)=>o(s)}):o(i)}})}catch{return null}},$_=async(e,t)=>await di(e,t,{"content-type":"application/json"});var p1=P(G_());function _i(e){let t=e.length;for(;--t>=0;)e[t]=0}var z2=0,Ov=1,D2=2,j2=3,F2=258,Pd=29,el=256,Go=el+1+Pd,hi=30,Ad=19,Pv=2*Go+1,ur=15,ud=16,U2=7,Ld=256,Av=16,Lv=17,Mv=18,Sd=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),_a=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),B2=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),zv=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),$2=512,nn=new Array((Go+2)*2);_i(nn);var Ho=new Array(hi*2);_i(Ho);var Zo=new Array($2);_i(Zo);var Ko=new Array(F2-j2+1);_i(Ko);var Md=new Array(Pd);_i(Md);var va=new Array(hi);_i(va);function cd(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}var Dv,jv,Fv;function fd(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}var Uv=e=>e<256?Zo[e]:Zo[256+(e>>>7)],Qo=(e,t)=>{e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255},Ve=(e,t,n)=>{e.bi_valid>ud-n?(e.bi_buf|=t<>ud-e.bi_valid,e.bi_valid+=n-ud):(e.bi_buf|=t<{Ve(e,n[t*2],n[t*2+1])},Bv=(e,t)=>{let n=0;do n|=e&1,e>>>=1,n<<=1;while(--t>0);return n>>>1},H2=e=>{e.bi_valid===16?(Qo(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)},V2=(e,t)=>{let n=t.dyn_tree,r=t.max_code,i=t.stat_desc.static_tree,o=t.stat_desc.has_stree,l=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,a=t.stat_desc.max_length,u,c,d,f,p,g,_=0;for(f=0;f<=ur;f++)e.bl_count[f]=0;for(n[e.heap[e.heap_max]*2+1]=0,u=e.heap_max+1;ua&&(f=a,_++),n[c*2+1]=f,!(c>r)&&(e.bl_count[f]++,p=0,c>=s&&(p=l[c-s]),g=n[c*2],e.opt_len+=g*(f+p),o&&(e.static_len+=g*(i[c*2+1]+p)));if(_!==0){do{for(f=a-1;e.bl_count[f]===0;)f--;e.bl_count[f]--,e.bl_count[f+1]+=2,e.bl_count[a]--,_-=2}while(_>0);for(f=a;f!==0;f--)for(c=e.bl_count[f];c!==0;)d=e.heap[--u],!(d>r)&&(n[d*2+1]!==f&&(e.opt_len+=(f-n[d*2+1])*n[d*2],n[d*2+1]=f),c--)}},$v=(e,t,n)=>{let r=new Array(ur+1),i=0,o,l;for(o=1;o<=ur;o++)i=i+n[o-1]<<1,r[o]=i;for(l=0;l<=t;l++){let s=e[l*2+1];s!==0&&(e[l*2]=Bv(r[s]++,s))}},W2=()=>{let e,t,n,r,i,o=new Array(ur+1);for(n=0,r=0;r>=7;r{let t;for(t=0;t{e.bi_valid>8?Qo(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},Z_=(e,t,n,r)=>{let i=t*2,o=n*2;return e[i]{let r=e.heap[n],i=n<<1;for(;i<=e.heap_len&&(i{let r,i,o=0,l,s;if(e.sym_next!==0)do r=e.pending_buf[e.sym_buf+o++]&255,r+=(e.pending_buf[e.sym_buf+o++]&255)<<8,i=e.pending_buf[e.sym_buf+o++],r===0?Lt(e,i,t):(l=Ko[i],Lt(e,l+el+1,t),s=Sd[l],s!==0&&(i-=Md[l],Ve(e,i,s)),r--,l=Uv(r),Lt(e,l,n),s=_a[l],s!==0&&(r-=va[l],Ve(e,r,s)));while(o{let n=t.dyn_tree,r=t.stat_desc.static_tree,i=t.stat_desc.has_stree,o=t.stat_desc.elems,l,s,a=-1,u;for(e.heap_len=0,e.heap_max=Pv,l=0;l>1;l>=1;l--)dd(e,n,l);u=o;do l=e.heap[1],e.heap[1]=e.heap[e.heap_len--],dd(e,n,1),s=e.heap[1],e.heap[--e.heap_max]=l,e.heap[--e.heap_max]=s,n[u*2]=n[l*2]+n[s*2],e.depth[u]=(e.depth[l]>=e.depth[s]?e.depth[l]:e.depth[s])+1,n[l*2+1]=n[s*2+1]=u,e.heap[1]=u++,dd(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],V2(e,t),$v(n,a,e.bl_count)},Q_=(e,t,n)=>{let r,i=-1,o,l=t[0*2+1],s=0,a=7,u=4;for(l===0&&(a=138,u=3),t[(n+1)*2+1]=65535,r=0;r<=n;r++)o=l,l=t[(r+1)*2+1],!(++s{let r,i=-1,o,l=t[0*2+1],s=0,a=7,u=4;for(l===0&&(a=138,u=3),r=0;r<=n;r++)if(o=l,l=t[(r+1)*2+1],!(++s{let t;for(Q_(e,e.dyn_ltree,e.l_desc.max_code),Q_(e,e.dyn_dtree,e.d_desc.max_code),Ed(e,e.bl_desc),t=Ad-1;t>=3&&e.bl_tree[zv[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t},Z2=(e,t,n,r)=>{let i;for(Ve(e,t-257,5),Ve(e,n-1,5),Ve(e,r-4,4),i=0;i{let t=4093624447,n;for(n=0;n<=31;n++,t>>>=1)if(t&1&&e.dyn_ltree[n*2]!==0)return 0;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return 1;for(n=32;n{q_||(W2(),q_=!0),e.l_desc=new fd(e.dyn_ltree,Dv),e.d_desc=new fd(e.dyn_dtree,jv),e.bl_desc=new fd(e.bl_tree,Fv),e.bi_buf=0,e.bi_valid=0,Hv(e)},Wv=(e,t,n,r)=>{Ve(e,(z2<<1)+(r?1:0),3),Vv(e),Qo(e,n),Qo(e,~n),n&&e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n},X2=e=>{Ve(e,Ov<<1,3),Lt(e,Ld,nn),H2(e)},q2=(e,t,n,r)=>{let i,o,l=0;e.level>0?(e.strm.data_type===2&&(e.strm.data_type=K2(e)),Ed(e,e.l_desc),Ed(e,e.d_desc),l=G2(e),i=e.opt_len+3+7>>>3,o=e.static_len+3+7>>>3,o<=i&&(i=o)):i=o=n+5,n+4<=i&&t!==-1?Wv(e,t,n,r):e.strategy===4||o===i?(Ve(e,(Ov<<1)+(r?1:0),3),K_(e,nn,Ho)):(Ve(e,(D2<<1)+(r?1:0),3),Z2(e,e.l_desc.max_code+1,e.d_desc.max_code+1,l+1),K_(e,e.dyn_ltree,e.dyn_dtree)),Hv(e),r&&Vv(e)},J2=(e,t,n)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=n,t===0?e.dyn_ltree[n*2]++:(e.matches++,t--,e.dyn_ltree[(Ko[n]+el+1)*2]++,e.dyn_dtree[Uv(t)*2]++),e.sym_next===e.sym_end),Y2=Q2,eb=Wv,tb=q2,nb=J2,rb=X2,ib={_tr_init:Y2,_tr_stored_block:eb,_tr_flush_block:tb,_tr_tally:nb,_tr_align:rb},ob=(e,t,n,r)=>{let i=e&65535|0,o=e>>>16&65535|0,l=0;for(;n!==0;){l=n>2e3?2e3:n,n-=l;do i=i+t[r++]|0,o=o+i|0;while(--l);i%=65521,o%=65521}return i|o<<16|0},Xo=ob,lb=()=>{let e,t=[];for(var n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=e&1?3988292384^e>>>1:e>>>1;t[n]=e}return t},sb=new Uint32Array(lb()),ab=(e,t,n,r)=>{let i=sb,o=r+n;e^=-1;for(let l=r;l>>8^i[(e^t[l])&255];return e^-1},he=ab,dr={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},hr={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},{_tr_init:ub,_tr_stored_block:bd,_tr_flush_block:cb,_tr_tally:Fn,_tr_align:fb}=ib,{Z_NO_FLUSH:Un,Z_PARTIAL_FLUSH:db,Z_FULL_FLUSH:pb,Z_FINISH:dt,Z_BLOCK:J_,Z_OK:xe,Z_STREAM_END:Y_,Z_STREAM_ERROR:Mt,Z_DATA_ERROR:mb,Z_BUF_ERROR:pd,Z_DEFAULT_COMPRESSION:hb,Z_FILTERED:gb,Z_HUFFMAN_ONLY:pa,Z_RLE:yb,Z_FIXED:_b,Z_DEFAULT_STRATEGY:vb,Z_UNKNOWN:wb,Z_DEFLATED:ka}=hr,xb=9,kb=15,Sb=8,Eb=29,bb=256,Rd=bb+1+Eb,Rb=30,Cb=19,Ib=2*Rd+1,Tb=15,U=3,jn=258,zt=jn+U+1,Nb=32,gi=42,zd=57,Cd=69,Id=73,Td=91,Nd=103,cr=113,Bo=666,ze=1,vi=2,pr=3,wi=4,Ob=3,fr=(e,t)=>(e.msg=dr[t],t),ev=e=>e*2-(e>4?9:0),Dn=e=>{let t=e.length;for(;--t>=0;)e[t]=0},Pb=e=>{let t,n,r,i=e.w_size;t=e.hash_size,r=t;do n=e.head[--r],e.head[r]=n>=i?n-i:0;while(--t);t=i,r=t;do n=e.prev[--r],e.prev[r]=n>=i?n-i:0;while(--t)},Ab=(e,t,n)=>(t<{let t=e.state,n=t.pending;n>e.avail_out&&(n=e.avail_out),n!==0&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+n),e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,t.pending===0&&(t.pending_out=0))},et=(e,t)=>{cb(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Ye(e.strm)},$=(e,t)=>{e.pending_buf[e.pending++]=t},Uo=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255},Od=(e,t,n,r)=>{let i=e.avail_in;return i>r&&(i=r),i===0?0:(e.avail_in-=i,t.set(e.input.subarray(e.next_in,e.next_in+i),n),e.state.wrap===1?e.adler=Xo(e.adler,t,i,n):e.state.wrap===2&&(e.adler=he(e.adler,t,i,n)),e.next_in+=i,e.total_in+=i,i)},Gv=(e,t)=>{let n=e.max_chain_length,r=e.strstart,i,o,l=e.prev_length,s=e.nice_match,a=e.strstart>e.w_size-zt?e.strstart-(e.w_size-zt):0,u=e.window,c=e.w_mask,d=e.prev,f=e.strstart+jn,p=u[r+l-1],g=u[r+l];e.prev_length>=e.good_match&&(n>>=2),s>e.lookahead&&(s=e.lookahead);do if(i=t,!(u[i+l]!==g||u[i+l-1]!==p||u[i]!==u[r]||u[++i]!==u[r+1])){r+=2,i++;do;while(u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&rl){if(e.match_start=t,l=o,o>=s)break;p=u[r+l-1],g=u[r+l]}}while((t=d[t&c])>a&&--n!==0);return l<=e.lookahead?l:e.lookahead},yi=e=>{let t=e.w_size,n,r,i;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-zt)&&(e.window.set(e.window.subarray(t,t+t-r),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),Pb(e),r+=t),e.strm.avail_in===0)break;if(n=Od(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=n,e.lookahead+e.insert>=U)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=Bn(e,e.ins_h,e.window[i+1]);e.insert&&(e.ins_h=Bn(e,e.ins_h,e.window[i+U-1]),e.prev[i&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=i,i++,e.insert--,!(e.lookahead+e.insert{let n=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,r,i,o,l=0,s=e.strm.avail_in;do{if(r=65535,o=e.bi_valid+42>>3,e.strm.avail_outi+e.strm.avail_in&&(r=i+e.strm.avail_in),r>o&&(r=o),r>8,e.pending_buf[e.pending-2]=~r,e.pending_buf[e.pending-1]=~r>>8,Ye(e.strm),i&&(i>r&&(i=r),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+i),e.strm.next_out),e.strm.next_out+=i,e.strm.avail_out-=i,e.strm.total_out+=i,e.block_start+=i,r-=i),r&&(Od(e.strm,e.strm.output,e.strm.next_out,r),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r)}while(l===0);return s-=e.strm.avail_in,s&&(s>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=s&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-s,e.strm.next_in),e.strstart),e.strstart+=s,e.insert+=s>e.w_size-e.insert?e.w_size-e.insert:s),e.block_start=e.strstart),e.high_watero&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,o+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),o>e.strm.avail_in&&(o=e.strm.avail_in),o&&(Od(e.strm,e.window,e.strstart,o),e.strstart+=o,e.insert+=o>e.w_size-e.insert?e.w_size-e.insert:o),e.high_water>3,o=e.pending_buf_size-o>65535?65535:e.pending_buf_size-o,n=o>e.w_size?e.w_size:o,i=e.strstart-e.block_start,(i>=n||(i||t===dt)&&t!==Un&&e.strm.avail_in===0&&i<=o)&&(r=i>o?o:i,l=t===dt&&e.strm.avail_in===0&&r===i?1:0,bd(e,e.block_start,r,l),e.block_start+=r,Ye(e.strm)),l?pr:ze)},md=(e,t)=>{let n,r;for(;;){if(e.lookahead=U&&(e.ins_h=Bn(e,e.ins_h,e.window[e.strstart+U-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),n!==0&&e.strstart-n<=e.w_size-zt&&(e.match_length=Gv(e,n)),e.match_length>=U)if(r=Fn(e,e.strstart-e.match_start,e.match_length-U),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=U){e.match_length--;do e.strstart++,e.ins_h=Bn(e,e.ins_h,e.window[e.strstart+U-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=Bn(e,e.ins_h,e.window[e.strstart+1]);else r=Fn(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(et(e,!1),e.strm.avail_out===0))return ze}return e.insert=e.strstart{let n,r,i;for(;;){if(e.lookahead=U&&(e.ins_h=Bn(e,e.ins_h,e.window[e.strstart+U-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=U-1,n!==0&&e.prev_length4096)&&(e.match_length=U-1)),e.prev_length>=U&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-U,r=Fn(e,e.strstart-1-e.prev_match,e.prev_length-U),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=i&&(e.ins_h=Bn(e,e.ins_h,e.window[e.strstart+U-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=U-1,e.strstart++,r&&(et(e,!1),e.strm.avail_out===0))return ze}else if(e.match_available){if(r=Fn(e,0,e.window[e.strstart-1]),r&&et(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return ze}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=Fn(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart{let n,r,i,o,l=e.window;for(;;){if(e.lookahead<=jn){if(yi(e),e.lookahead<=jn&&t===Un)return ze;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=U&&e.strstart>0&&(i=e.strstart-1,r=l[i],r===l[++i]&&r===l[++i]&&r===l[++i])){o=e.strstart+jn;do;while(r===l[++i]&&r===l[++i]&&r===l[++i]&&r===l[++i]&&r===l[++i]&&r===l[++i]&&r===l[++i]&&r===l[++i]&&ie.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=U?(n=Fn(e,1,e.match_length-U),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=Fn(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(et(e,!1),e.strm.avail_out===0))return ze}return e.insert=0,t===dt?(et(e,!0),e.strm.avail_out===0?pr:wi):e.sym_next&&(et(e,!1),e.strm.avail_out===0)?ze:vi},Mb=(e,t)=>{let n;for(;;){if(e.lookahead===0&&(yi(e),e.lookahead===0)){if(t===Un)return ze;break}if(e.match_length=0,n=Fn(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(et(e,!1),e.strm.avail_out===0))return ze}return e.insert=0,t===dt?(et(e,!0),e.strm.avail_out===0?pr:wi):e.sym_next&&(et(e,!1),e.strm.avail_out===0)?ze:vi};function At(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}var $o=[new At(0,0,0,0,Zv),new At(4,4,8,4,md),new At(4,5,16,8,md),new At(4,6,32,32,md),new At(4,4,16,16,pi),new At(8,16,32,32,pi),new At(8,16,128,128,pi),new At(8,32,128,256,pi),new At(32,128,258,1024,pi),new At(32,258,258,4096,pi)],zb=e=>{e.window_size=2*e.w_size,Dn(e.head),e.max_lazy_match=$o[e.level].max_lazy,e.good_match=$o[e.level].good_length,e.nice_match=$o[e.level].nice_length,e.max_chain_length=$o[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=U-1,e.match_available=0,e.ins_h=0};function Db(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=ka,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(Ib*2),this.dyn_dtree=new Uint16Array((2*Rb+1)*2),this.bl_tree=new Uint16Array((2*Cb+1)*2),Dn(this.dyn_ltree),Dn(this.dyn_dtree),Dn(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(Tb+1),this.heap=new Uint16Array(2*Rd+1),Dn(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*Rd+1),Dn(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}var tl=e=>{if(!e)return 1;let t=e.state;return!t||t.strm!==e||t.status!==gi&&t.status!==zd&&t.status!==Cd&&t.status!==Id&&t.status!==Td&&t.status!==Nd&&t.status!==cr&&t.status!==Bo?1:0},Kv=e=>{if(tl(e))return fr(e,Mt);e.total_in=e.total_out=0,e.data_type=wb;let t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap===2?zd:t.wrap?gi:cr,e.adler=t.wrap===2?0:1,t.last_flush=-2,ub(t),xe},Qv=e=>{let t=Kv(e);return t===xe&&zb(e.state),t},jb=(e,t)=>tl(e)||e.state.wrap!==2?Mt:(e.state.gzhead=t,xe),Xv=(e,t,n,r,i,o)=>{if(!e)return Mt;let l=1;if(t===hb&&(t=6),r<0?(l=0,r=-r):r>15&&(l=2,r-=16),i<1||i>xb||n!==ka||r<8||r>15||t<0||t>9||o<0||o>_b||r===8&&l!==1)return fr(e,Mt);r===8&&(r=9);let s=new Db;return e.state=s,s.strm=e,s.status=gi,s.wrap=l,s.gzhead=null,s.w_bits=r,s.w_size=1<Xv(e,t,ka,kb,Sb,vb),Ub=(e,t)=>{if(tl(e)||t>J_||t<0)return e?fr(e,Mt):Mt;let n=e.state;if(!e.output||e.avail_in!==0&&!e.input||n.status===Bo&&t!==dt)return fr(e,e.avail_out===0?pd:Mt);let r=n.last_flush;if(n.last_flush=t,n.pending!==0){if(Ye(e),e.avail_out===0)return n.last_flush=-1,xe}else if(e.avail_in===0&&ev(t)<=ev(r)&&t!==dt)return fr(e,pd);if(n.status===Bo&&e.avail_in!==0)return fr(e,pd);if(n.status===gi&&n.wrap===0&&(n.status=cr),n.status===gi){let i=ka+(n.w_bits-8<<4)<<8,o=-1;if(n.strategy>=pa||n.level<2?o=0:n.level<6?o=1:n.level===6?o=2:o=3,i|=o<<6,n.strstart!==0&&(i|=Nb),i+=31-i%31,Uo(n,i),n.strstart!==0&&(Uo(n,e.adler>>>16),Uo(n,e.adler&65535)),e.adler=1,n.status=cr,Ye(e),n.pending!==0)return n.last_flush=-1,xe}if(n.status===zd){if(e.adler=0,$(n,31),$(n,139),$(n,8),n.gzhead)$(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),$(n,n.gzhead.time&255),$(n,n.gzhead.time>>8&255),$(n,n.gzhead.time>>16&255),$(n,n.gzhead.time>>24&255),$(n,n.level===9?2:n.strategy>=pa||n.level<2?4:0),$(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&($(n,n.gzhead.extra.length&255),$(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=he(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=Cd;else if($(n,0),$(n,0),$(n,0),$(n,0),$(n,0),$(n,n.level===9?2:n.strategy>=pa||n.level<2?4:0),$(n,Ob),n.status=cr,Ye(e),n.pending!==0)return n.last_flush=-1,xe}if(n.status===Cd){if(n.gzhead.extra){let i=n.pending,o=(n.gzhead.extra.length&65535)-n.gzindex;for(;n.pending+o>n.pending_buf_size;){let s=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+s),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>i&&(e.adler=he(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex+=s,Ye(e),n.pending!==0)return n.last_flush=-1,xe;i=0,o-=s}let l=new Uint8Array(n.gzhead.extra);n.pending_buf.set(l.subarray(n.gzindex,n.gzindex+o),n.pending),n.pending+=o,n.gzhead.hcrc&&n.pending>i&&(e.adler=he(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex=0}n.status=Id}if(n.status===Id){if(n.gzhead.name){let i=n.pending,o;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>i&&(e.adler=he(e.adler,n.pending_buf,n.pending-i,i)),Ye(e),n.pending!==0)return n.last_flush=-1,xe;i=0}n.gzindexi&&(e.adler=he(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex=0}n.status=Td}if(n.status===Td){if(n.gzhead.comment){let i=n.pending,o;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>i&&(e.adler=he(e.adler,n.pending_buf,n.pending-i,i)),Ye(e),n.pending!==0)return n.last_flush=-1,xe;i=0}n.gzindexi&&(e.adler=he(e.adler,n.pending_buf,n.pending-i,i))}n.status=Nd}if(n.status===Nd){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(Ye(e),n.pending!==0))return n.last_flush=-1,xe;$(n,e.adler&255),$(n,e.adler>>8&255),e.adler=0}if(n.status=cr,Ye(e),n.pending!==0)return n.last_flush=-1,xe}if(e.avail_in!==0||n.lookahead!==0||t!==Un&&n.status!==Bo){let i=n.level===0?Zv(n,t):n.strategy===pa?Mb(n,t):n.strategy===yb?Lb(n,t):$o[n.level].func(n,t);if((i===pr||i===wi)&&(n.status=Bo),i===ze||i===pr)return e.avail_out===0&&(n.last_flush=-1),xe;if(i===vi&&(t===db?fb(n):t!==J_&&(bd(n,0,0,!1),t===pb&&(Dn(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),Ye(e),e.avail_out===0))return n.last_flush=-1,xe}return t!==dt?xe:n.wrap<=0?Y_:(n.wrap===2?($(n,e.adler&255),$(n,e.adler>>8&255),$(n,e.adler>>16&255),$(n,e.adler>>24&255),$(n,e.total_in&255),$(n,e.total_in>>8&255),$(n,e.total_in>>16&255),$(n,e.total_in>>24&255)):(Uo(n,e.adler>>>16),Uo(n,e.adler&65535)),Ye(e),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?xe:Y_)},Bb=e=>{if(tl(e))return Mt;let t=e.state.status;return e.state=null,t===cr?fr(e,mb):xe},$b=(e,t)=>{let n=t.length;if(tl(e))return Mt;let r=e.state,i=r.wrap;if(i===2||i===1&&r.status!==gi||r.lookahead)return Mt;if(i===1&&(e.adler=Xo(e.adler,t,n,0)),r.wrap=0,n>=r.w_size){i===0&&(Dn(r.head),r.strstart=0,r.block_start=0,r.insert=0);let a=new Uint8Array(r.w_size);a.set(t.subarray(n-r.w_size,n),0),t=a,n=r.w_size}let o=e.avail_in,l=e.next_in,s=e.input;for(e.avail_in=n,e.next_in=0,e.input=t,yi(r);r.lookahead>=U;){let a=r.strstart,u=r.lookahead-(U-1);do r.ins_h=Bn(r,r.ins_h,r.window[a+U-1]),r.prev[a&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=a,a++;while(--u);r.strstart=a,r.lookahead=U-1,yi(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=U-1,r.match_available=0,e.next_in=l,e.input=s,e.avail_in=o,r.wrap=i,xe},Hb=Fb,Vb=Xv,Wb=Qv,Gb=Kv,Zb=jb,Kb=Ub,Qb=Bb,Xb=$b,qb="pako deflate (from Nodeca project)",Vo={deflateInit:Hb,deflateInit2:Vb,deflateReset:Wb,deflateResetKeep:Gb,deflateSetHeader:Zb,deflate:Kb,deflateEnd:Qb,deflateSetDictionary:Xb,deflateInfo:qb},Jb=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),Yb=function(e){let t=Array.prototype.slice.call(arguments,1);for(;t.length;){let n=t.shift();if(n){if(typeof n!="object")throw new TypeError(n+"must be non-object");for(let r in n)Jb(n,r)&&(e[r]=n[r])}}return e},eR=e=>{let t=0;for(let r=0,i=e.length;r=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;qo[254]=qo[254]=1;var tR=e=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let t,n,r,i,o,l=e.length,s=0;for(i=0;i>>6,t[o++]=128|n&63):n<65536?(t[o++]=224|n>>>12,t[o++]=128|n>>>6&63,t[o++]=128|n&63):(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63,t[o++]=128|n>>>6&63,t[o++]=128|n&63);return t},nR=(e,t)=>{if(t<65534&&e.subarray&&qv)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let n="";for(let r=0;r{let n=t||e.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(e.subarray(0,t));let r,i,o=new Array(n*2);for(i=0,r=0;r4){o[i++]=65533,r+=s-1;continue}for(l&=s===2?31:s===3?15:7;s>1&&r1){o[i++]=65533;continue}l<65536?o[i++]=l:(l-=65536,o[i++]=55296|l>>10&1023,o[i++]=56320|l&1023)}return nR(o,i)},iR=(e,t)=>{t=t||e.length,t>e.length&&(t=e.length);let n=t-1;for(;n>=0&&(e[n]&192)===128;)n--;return n<0||n===0?t:n+qo[e[n]]>t?n:t},Jo={string2buf:tR,buf2string:rR,utf8border:iR};function oR(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var Jv=oR,Yv=Object.prototype.toString,{Z_NO_FLUSH:lR,Z_SYNC_FLUSH:sR,Z_FULL_FLUSH:aR,Z_FINISH:uR,Z_OK:wa,Z_STREAM_END:cR,Z_DEFAULT_COMPRESSION:fR,Z_DEFAULT_STRATEGY:dR,Z_DEFLATED:pR}=hr;function nl(e){this.options=Sa.assign({level:fR,method:pR,chunkSize:16384,windowBits:15,memLevel:8,strategy:dR},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Jv,this.strm.avail_out=0;let n=Vo.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==wa)throw new Error(dr[n]);if(t.header&&Vo.deflateSetHeader(this.strm,t.header),t.dictionary){let r;if(typeof t.dictionary=="string"?r=Jo.string2buf(t.dictionary):Yv.call(t.dictionary)==="[object ArrayBuffer]"?r=new Uint8Array(t.dictionary):r=t.dictionary,n=Vo.deflateSetDictionary(this.strm,r),n!==wa)throw new Error(dr[n]);this._dict_set=!0}}nl.prototype.push=function(e,t){let n=this.strm,r=this.options.chunkSize,i,o;if(this.ended)return!1;for(t===~~t?o=t:o=t===!0?uR:lR,typeof e=="string"?n.input=Jo.string2buf(e):Yv.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){if(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),(o===sR||o===aR)&&n.avail_out<=6){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(i=Vo.deflate(n,o),i===cR)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),i=Vo.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===wa;if(n.avail_out===0){this.onData(n.output);continue}if(o>0&&n.next_out>0){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(n.avail_in===0)break}return!0};nl.prototype.onData=function(e){this.chunks.push(e)};nl.prototype.onEnd=function(e){e===wa&&(this.result=Sa.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Dd(e,t){let n=new nl(t);if(n.push(e,!0),n.err)throw n.msg||dr[n.err];return n.result}function mR(e,t){return t=t||{},t.raw=!0,Dd(e,t)}function hR(e,t){return t=t||{},t.gzip=!0,Dd(e,t)}var gR=nl,yR=Dd,_R=mR,vR=hR,wR=hr,xR={Deflate:gR,deflate:yR,deflateRaw:_R,gzip:vR,constants:wR},ma=16209,kR=16191,SR=function(t,n){let r,i,o,l,s,a,u,c,d,f,p,g,_,w,h,m,y,v,S,R,k,b,N,C,O=t.state;r=t.next_in,N=t.input,i=r+(t.avail_in-5),o=t.next_out,C=t.output,l=o-(n-t.avail_out),s=o+(t.avail_out-257),a=O.dmax,u=O.wsize,c=O.whave,d=O.wnext,f=O.window,p=O.hold,g=O.bits,_=O.lencode,w=O.distcode,h=(1<>>24,p>>>=v,g-=v,v=y>>>16&255,v===0)C[o++]=y&65535;else if(v&16){S=y&65535,v&=15,v&&(g>>=v,g-=v),g<15&&(p+=N[r++]<>>24,p>>>=v,g-=v,v=y>>>16&255,v&16){if(R=y&65535,v&=15,ga){t.msg="invalid distance too far back",O.mode=ma;break e}if(p>>>=v,g-=v,v=o-l,R>v){if(v=R-v,v>c&&O.sane){t.msg="invalid distance too far back",O.mode=ma;break e}if(k=0,b=f,d===0){if(k+=u-v,v2;)C[o++]=b[k++],C[o++]=b[k++],C[o++]=b[k++],S-=3;S&&(C[o++]=b[k++],S>1&&(C[o++]=b[k++]))}else{k=o-R;do C[o++]=C[k++],C[o++]=C[k++],C[o++]=C[k++],S-=3;while(S>2);S&&(C[o++]=C[k++],S>1&&(C[o++]=C[k++]))}}else if(v&64){t.msg="invalid distance code",O.mode=ma;break e}else{y=w[(y&65535)+(p&(1<>3,r-=S,g-=S<<3,p&=(1<{let a=s.bits,u=0,c=0,d=0,f=0,p=0,g=0,_=0,w=0,h=0,m=0,y,v,S,R,k,b=null,N,C=new Uint16Array(mi+1),O=new Uint16Array(mi+1),De=null,il,Dt,jt;for(u=0;u<=mi;u++)C[u]=0;for(c=0;c=1&&C[f]===0;f--);if(p>f&&(p=f),f===0)return i[o++]=1<<24|64<<16|0,i[o++]=1<<24|64<<16|0,s.bits=1,0;for(d=1;d0&&(e===rv||f!==1))return-1;for(O[1]=0,u=1;utv||e===iv&&h>nv)return 1;for(;;){il=u-_,l[c]+1=N?(Dt=De[l[c]-N],jt=b[l[c]-N]):(Dt=96,jt=0),y=1<>_)+v]=il<<24|Dt<<16|jt|0;while(v!==0);for(y=1<>=1;if(y!==0?(m&=y-1,m+=y):m=0,c++,--C[u]===0){if(u===f)break;u=t[n+l[c]]}if(u>p&&(m&R)!==S){for(_===0&&(_=p),k+=d,g=u-_,w=1<tv||e===iv&&h>nv)return 1;S=m&R,i[S]=p<<24|g<<16|k-o|0}}return m!==0&&(i[k+m]=u-_<<24|64<<16|0),s.bits=p,0},Wo=IR,TR=0,e1=1,t1=2,{Z_FINISH:ov,Z_BLOCK:NR,Z_TREES:ha,Z_OK:mr,Z_STREAM_END:OR,Z_NEED_DICT:PR,Z_STREAM_ERROR:pt,Z_DATA_ERROR:n1,Z_MEM_ERROR:r1,Z_BUF_ERROR:AR,Z_DEFLATED:lv}=hr,Ea=16180,sv=16181,av=16182,uv=16183,cv=16184,fv=16185,dv=16186,pv=16187,mv=16188,hv=16189,xa=16190,tn=16191,gd=16192,gv=16193,yd=16194,yv=16195,_v=16196,vv=16197,wv=16198,ga=16199,ya=16200,xv=16201,kv=16202,Sv=16203,Ev=16204,bv=16205,_d=16206,Rv=16207,Cv=16208,ee=16209,i1=16210,o1=16211,LR=852,MR=592,zR=15,DR=zR,Iv=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function jR(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var gr=e=>{if(!e)return 1;let t=e.state;return!t||t.strm!==e||t.modeo1?1:0},l1=e=>{if(gr(e))return pt;let t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=Ea,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(LR),t.distcode=t.distdyn=new Int32Array(MR),t.sane=1,t.back=-1,mr},s1=e=>{if(gr(e))return pt;let t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,l1(e)},a1=(e,t)=>{let n;if(gr(e))return pt;let r=e.state;return t<0?(n=0,t=-t):(n=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?pt:(r.window!==null&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,s1(e))},u1=(e,t)=>{if(!e)return pt;let n=new jR;e.state=n,n.strm=e,n.window=null,n.mode=Ea;let r=a1(e,t);return r!==mr&&(e.state=null),r},FR=e=>u1(e,DR),Tv=!0,vd,wd,UR=e=>{if(Tv){vd=new Int32Array(512),wd=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(Wo(e1,e.lens,0,288,vd,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;Wo(t1,e.lens,0,32,wd,0,e.work,{bits:5}),Tv=!1}e.lencode=vd,e.lenbits=9,e.distcode=wd,e.distbits=5},c1=(e,t,n,r)=>{let i,o=e.state;return o.window===null&&(o.wsize=1<=o.wsize?(o.window.set(t.subarray(n-o.wsize,n),0),o.wnext=0,o.whave=o.wsize):(i=o.wsize-o.wnext,i>r&&(i=r),o.window.set(t.subarray(n-r,n-r+i),o.wnext),r-=i,r?(o.window.set(t.subarray(n-r,n),0),o.wnext=r,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave{let n,r,i,o,l,s,a,u,c,d,f,p,g,_,w=0,h,m,y,v,S,R,k,b,N=new Uint8Array(4),C,O,De=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(gr(e)||!e.output||!e.input&&e.avail_in!==0)return pt;n=e.state,n.mode===tn&&(n.mode=gd),l=e.next_out,i=e.output,a=e.avail_out,o=e.next_in,r=e.input,s=e.avail_in,u=n.hold,c=n.bits,d=s,f=a,b=mr;e:for(;;)switch(n.mode){case Ea:if(n.wrap===0){n.mode=gd;break}for(;c<16;){if(s===0)break e;s--,u+=r[o++]<>>8&255,n.check=he(n.check,N,2,0),u=0,c=0,n.mode=sv;break}if(n.head&&(n.head.done=!1),!(n.wrap&1)||(((u&255)<<8)+(u>>8))%31){e.msg="incorrect header check",n.mode=ee;break}if((u&15)!==lv){e.msg="unknown compression method",n.mode=ee;break}if(u>>>=4,c-=4,k=(u&15)+8,n.wbits===0&&(n.wbits=k),k>15||k>n.wbits){e.msg="invalid window size",n.mode=ee;break}n.dmax=1<>8&1),n.flags&512&&n.wrap&4&&(N[0]=u&255,N[1]=u>>>8&255,n.check=he(n.check,N,2,0)),u=0,c=0,n.mode=av;case av:for(;c<32;){if(s===0)break e;s--,u+=r[o++]<>>8&255,N[2]=u>>>16&255,N[3]=u>>>24&255,n.check=he(n.check,N,4,0)),u=0,c=0,n.mode=uv;case uv:for(;c<16;){if(s===0)break e;s--,u+=r[o++]<>8),n.flags&512&&n.wrap&4&&(N[0]=u&255,N[1]=u>>>8&255,n.check=he(n.check,N,2,0)),u=0,c=0,n.mode=cv;case cv:if(n.flags&1024){for(;c<16;){if(s===0)break e;s--,u+=r[o++]<>>8&255,n.check=he(n.check,N,2,0)),u=0,c=0}else n.head&&(n.head.extra=null);n.mode=fv;case fv:if(n.flags&1024&&(p=n.length,p>s&&(p=s),p&&(n.head&&(k=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(r.subarray(o,o+p),k)),n.flags&512&&n.wrap&4&&(n.check=he(n.check,r,p,o)),s-=p,o+=p,n.length-=p),n.length))break e;n.length=0,n.mode=dv;case dv:if(n.flags&2048){if(s===0)break e;p=0;do k=r[o+p++],n.head&&k&&n.length<65536&&(n.head.name+=String.fromCharCode(k));while(k&&p>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=tn;break;case hv:for(;c<32;){if(s===0)break e;s--,u+=r[o++]<>>=c&7,c-=c&7,n.mode=_d;break}for(;c<3;){if(s===0)break e;s--,u+=r[o++]<>>=1,c-=1,u&3){case 0:n.mode=gv;break;case 1:if(UR(n),n.mode=ga,t===ha){u>>>=2,c-=2;break e}break;case 2:n.mode=_v;break;case 3:e.msg="invalid block type",n.mode=ee}u>>>=2,c-=2;break;case gv:for(u>>>=c&7,c-=c&7;c<32;){if(s===0)break e;s--,u+=r[o++]<>>16^65535)){e.msg="invalid stored block lengths",n.mode=ee;break}if(n.length=u&65535,u=0,c=0,n.mode=yd,t===ha)break e;case yd:n.mode=yv;case yv:if(p=n.length,p){if(p>s&&(p=s),p>a&&(p=a),p===0)break e;i.set(r.subarray(o,o+p),l),s-=p,o+=p,a-=p,l+=p,n.length-=p;break}n.mode=tn;break;case _v:for(;c<14;){if(s===0)break e;s--,u+=r[o++]<>>=5,c-=5,n.ndist=(u&31)+1,u>>>=5,c-=5,n.ncode=(u&15)+4,u>>>=4,c-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=ee;break}n.have=0,n.mode=vv;case vv:for(;n.have>>=3,c-=3}for(;n.have<19;)n.lens[De[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,C={bits:n.lenbits},b=Wo(TR,n.lens,0,19,n.lencode,0,n.work,C),n.lenbits=C.bits,b){e.msg="invalid code lengths set",n.mode=ee;break}n.have=0,n.mode=wv;case wv:for(;n.have>>24,m=w>>>16&255,y=w&65535,!(h<=c);){if(s===0)break e;s--,u+=r[o++]<>>=h,c-=h,n.lens[n.have++]=y;else{if(y===16){for(O=h+2;c>>=h,c-=h,n.have===0){e.msg="invalid bit length repeat",n.mode=ee;break}k=n.lens[n.have-1],p=3+(u&3),u>>>=2,c-=2}else if(y===17){for(O=h+3;c>>=h,c-=h,k=0,p=3+(u&7),u>>>=3,c-=3}else{for(O=h+7;c>>=h,c-=h,k=0,p=11+(u&127),u>>>=7,c-=7}if(n.have+p>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=ee;break}for(;p--;)n.lens[n.have++]=k}}if(n.mode===ee)break;if(n.lens[256]===0){e.msg="invalid code -- missing end-of-block",n.mode=ee;break}if(n.lenbits=9,C={bits:n.lenbits},b=Wo(e1,n.lens,0,n.nlen,n.lencode,0,n.work,C),n.lenbits=C.bits,b){e.msg="invalid literal/lengths set",n.mode=ee;break}if(n.distbits=6,n.distcode=n.distdyn,C={bits:n.distbits},b=Wo(t1,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,C),n.distbits=C.bits,b){e.msg="invalid distances set",n.mode=ee;break}if(n.mode=ga,t===ha)break e;case ga:n.mode=ya;case ya:if(s>=6&&a>=258){e.next_out=l,e.avail_out=a,e.next_in=o,e.avail_in=s,n.hold=u,n.bits=c,SR(e,f),l=e.next_out,i=e.output,a=e.avail_out,o=e.next_in,r=e.input,s=e.avail_in,u=n.hold,c=n.bits,n.mode===tn&&(n.back=-1);break}for(n.back=0;w=n.lencode[u&(1<>>24,m=w>>>16&255,y=w&65535,!(h<=c);){if(s===0)break e;s--,u+=r[o++]<>v)],h=w>>>24,m=w>>>16&255,y=w&65535,!(v+h<=c);){if(s===0)break e;s--,u+=r[o++]<>>=v,c-=v,n.back+=v}if(u>>>=h,c-=h,n.back+=h,n.length=y,m===0){n.mode=bv;break}if(m&32){n.back=-1,n.mode=tn;break}if(m&64){e.msg="invalid literal/length code",n.mode=ee;break}n.extra=m&15,n.mode=xv;case xv:if(n.extra){for(O=n.extra;c>>=n.extra,c-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=kv;case kv:for(;w=n.distcode[u&(1<>>24,m=w>>>16&255,y=w&65535,!(h<=c);){if(s===0)break e;s--,u+=r[o++]<>v)],h=w>>>24,m=w>>>16&255,y=w&65535,!(v+h<=c);){if(s===0)break e;s--,u+=r[o++]<>>=v,c-=v,n.back+=v}if(u>>>=h,c-=h,n.back+=h,m&64){e.msg="invalid distance code",n.mode=ee;break}n.offset=y,n.extra=m&15,n.mode=Sv;case Sv:if(n.extra){for(O=n.extra;c>>=n.extra,c-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=ee;break}n.mode=Ev;case Ev:if(a===0)break e;if(p=f-a,n.offset>p){if(p=n.offset-p,p>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=ee;break}p>n.wnext?(p-=n.wnext,g=n.wsize-p):g=n.wnext-p,p>n.length&&(p=n.length),_=n.window}else _=i,g=l-n.offset,p=n.length;p>a&&(p=a),a-=p,n.length-=p;do i[l++]=_[g++];while(--p);n.length===0&&(n.mode=ya);break;case bv:if(a===0)break e;i[l++]=n.length,a--,n.mode=ya;break;case _d:if(n.wrap){for(;c<32;){if(s===0)break e;s--,u|=r[o++]<{if(gr(e))return pt;let t=e.state;return t.window&&(t.window=null),e.state=null,mr},HR=(e,t)=>{if(gr(e))return pt;let n=e.state;return n.wrap&2?(n.head=t,t.done=!1,mr):pt},VR=(e,t)=>{let n=t.length,r,i,o;return gr(e)||(r=e.state,r.wrap!==0&&r.mode!==xa)?pt:r.mode===xa&&(i=1,i=Xo(i,t,n,0),i!==r.check)?n1:(o=c1(e,t,n,n),o?(r.mode=i1,r1):(r.havedict=1,mr))},WR=s1,GR=a1,ZR=l1,KR=FR,QR=u1,XR=BR,qR=$R,JR=HR,YR=VR,eC="pako inflate (from Nodeca project)",rn={inflateReset:WR,inflateReset2:GR,inflateResetKeep:ZR,inflateInit:KR,inflateInit2:QR,inflate:XR,inflateEnd:qR,inflateGetHeader:JR,inflateSetDictionary:YR,inflateInfo:eC};function tC(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var nC=tC,f1=Object.prototype.toString,{Z_NO_FLUSH:rC,Z_FINISH:iC,Z_OK:Yo,Z_STREAM_END:xd,Z_NEED_DICT:kd,Z_STREAM_ERROR:oC,Z_DATA_ERROR:Nv,Z_MEM_ERROR:lC}=hr;function rl(e){this.options=Sa.assign({chunkSize:1024*64,windowBits:15,to:""},e||{});let t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Jv,this.strm.avail_out=0;let n=rn.inflateInit2(this.strm,t.windowBits);if(n!==Yo)throw new Error(dr[n]);if(this.header=new nC,rn.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=Jo.string2buf(t.dictionary):f1.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=rn.inflateSetDictionary(this.strm,t.dictionary),n!==Yo)))throw new Error(dr[n])}rl.prototype.push=function(e,t){let n=this.strm,r=this.options.chunkSize,i=this.options.dictionary,o,l,s;if(this.ended)return!1;for(t===~~t?l=t:l=t===!0?iC:rC,f1.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){for(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),o=rn.inflate(n,l),o===kd&&i&&(o=rn.inflateSetDictionary(n,i),o===Yo?o=rn.inflate(n,l):o===Nv&&(o=kd));n.avail_in>0&&o===xd&&n.state.wrap>0&&e[n.next_in]!==0;)rn.inflateReset(n),o=rn.inflate(n,l);switch(o){case oC:case Nv:case kd:case lC:return this.onEnd(o),this.ended=!0,!1}if(s=n.avail_out,n.next_out&&(n.avail_out===0||o===xd))if(this.options.to==="string"){let a=Jo.utf8border(n.output,n.next_out),u=n.next_out-a,c=Jo.buf2string(n.output,a);n.next_out=u,n.avail_out=r-u,u&&n.output.set(n.output.subarray(a,a+u),0),this.onData(c)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(!(o===Yo&&s===0)){if(o===xd)return o=rn.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,!0;if(n.avail_in===0)break}}return!0};rl.prototype.onData=function(e){this.chunks.push(e)};rl.prototype.onEnd=function(e){e===Yo&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Sa.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function jd(e,t){let n=new rl(t);if(n.push(e),n.err)throw n.msg||dr[n.err];return n.result}function sC(e,t){return t=t||{},t.raw=!0,jd(e,t)}var aC=rl,uC=jd,cC=sC,fC=jd,dC=hr,pC={Inflate:aC,inflate:uC,inflateRaw:cC,ungzip:fC,constants:dC},{Deflate:mC,deflate:hC,deflateRaw:gC,gzip:yC}=xR,{Inflate:_C,inflate:vC,inflateRaw:wC,ungzip:xC}=pC,kC=mC,SC=hC,EC=gC,bC=yC,RC=_C,CC=vC,IC=wC,TC=xC,NC=hr,d1={Deflate:kC,deflate:SC,deflateRaw:EC,gzip:bC,Inflate:RC,inflate:CC,inflateRaw:IC,ungzip:TC,constants:NC};var m1=e=>{let t="";return new Proxy({},{get(n,r){return r==="_batch"?{update:async i=>yr({name:t,action:"batch_update",table:"",params:{batch:i}},e),upsert:async i=>yr({name:t,action:"batch_upsert",table:"",params:{arg:i}},e)}:r==="_schema"?{tables:async()=>yr({name:t,action:"schema_tables",table:"",params:[]},e),columns:async i=>yr({name:t,action:"schema_columns",table:i,params:[]},e),rels:async i=>yr({name:t,action:"schema_rels",table:i,params:[]},e)}:r.startsWith("$")?(...i)=>{let o=d1.gzip(JSON.stringify(i));return yr({name:t,action:"query",table:r,params:btoa(o.reduce((l,s)=>l+String.fromCharCode(s),""))},e)}:new Proxy({},{get(i,o){return async(...l)=>(r==="query"&&(r=o,o="query"),await yr({name:t,action:o,table:r,params:l},e))}})}})},ba={},yr=async(e,t)=>{try{let n=new URL(t);n.pathname="/_dbs",e.table&&(n.pathname+=`/${e.table}`);let r=n.toString();typeof localStorage<"u"&&localStorage.mlsid&&(e.mlsid=localStorage.mlsid);let i=(0,p1.default)(e),o=ba[i];if(!o||o&&Date.now()-o.timestamp>1e3){ba[i]={timestamp:Date.now(),promise:di(r,e,{"content-type":"application/json"}),result:null};let l=await ba[i].promise;return ba[i].result=l,l}return await o.promise}catch{}};var h1=P(Cf());var g1=e=>{let{item:t,item_comp:n,ids:r}=e,i=Tn(n);if(y1(i,r),t.id&&(i.id=t.id),i.hidden=t.hidden,i.component){if(i.component.props&&t.component&&t.component.props)for(let o of Object.keys(i.component.props)){let l=t.component.props[o],s=i.component.props[o];l&&(s.value=l.value,s.valueBuilt=l.valueBuilt,s.jsxCalledBy=l.jsxCalledBy,s.content=l.content)}i.component.instances=t.component?.instances,i.component.style=t.component?.style}for(let o of Object.keys(t))delete t[o];for(let[o,l]of Object.entries(i))t[o]=l},y1=(e,t)=>{if(e.originalId=e.id,t[e.id]||(t[e.id]=(0,h1.createId)()),e.id=t[e.id],e.childs)for(let n of e.childs)y1(n,t)};var _1=e=>{let t=Object.entries(e.item_comp.component?.props||{}).sort((n,r)=>n[1].idx-r[1].idx);for(let[n,r]of t){let i=Tn(r),o=e.item.component?.props;o&&o[n]&&(i.value=o[n].value,i.valueBuilt=o[n].valueBuilt,o[n].content&&(i.content=o[n].content)),i&&e.each(n,i)}};var Ra=e=>{let t={};for(let[n,r]of Object.entries(e))if(n==="childs"){if(t.childs=[],r&&Array.isArray(r))for(let i of r)i.type==="item"&&i.component?t.childs.push(i):t.childs.push({name:i.name,id:i.id,originalId:i.originalId})}else t[n]=r;return t};var v1=(e,t)=>{let{item:n}=t;if(n.type==="item"&&n.component?.id&&t.parent?.item.id){let r=e.comps[n.component.id];if(e.on?.visit_component&&e.on.visit_component(n,t.root||t.item),!r)return;if(r){let i;if(e.mode==="page"?(n.component.instances||(n.component.instances={}),i=n.component.instances):i=t.parent?.root_instances,i){let l=i[n.id];i[n.id]||(i[n.id]={},l=i[n.id]),g1({item:n,item_comp:r,ids:l})}let o={item:Ra(n),jsx_prop:t.jsx_prop,parent:{id:t.parent.item.id,comp_id:t.parent?.comp?.component?.id,instance_id:t.parent?.instance_id},instances:i};e.on?.visit&&e.on.visit(o,n,t.root||t.item),n.id&&e.set_meta!==!1&&(e.meta[n.id]=o),_1({item:n,item_comp:r,instance:i?i[n.id]:{},each(l,s){let a=n.component?.id;s.meta?.type==="content-element"&&a&&s.content&&(s.content.name=l,xi({...e},{item:s.content,root:t.root||s.content,is_root:!1,jsx_prop:{is_root:!0,comp_id:a,name:l},parent:{item:o.item,instance_id:n.id,comp:r,root_instances:i}}))}});for(let l of Object.values(n.childs))l?.name?.startsWith("jsx:")||l&&Object.keys(l).length>3&&xi({...e,mode:"comp"},{item:l,is_root:!1,root:t.root||t.item,parent:{item:n,instance_id:n.id,root_instances:i,comp:r}})}}};var xi=(e,t)=>{let n=t.item;if(n.type==="item"&&n.component?.id&&t.ignore_first_component!==!0){v1(e,t);return}let r={item:Ra(n),parent:{id:t.parent?.item.id||"root",instance_id:t.parent?.instance_id,comp_id:t.parent?.comp?.component?.id}};if(t.jsx_prop&&(r.jsx_prop=t.jsx_prop),e.on?.visit&&e.on.visit(r,n,t.root||t.item),n.id&&e.set_meta!==!1&&(e.meta[r.item.id]=r),n.childs){for(let[i,o]of Object.entries(n.childs))if(o.id){let l={item:o,is_root:!1,root:t.root||t.item,parent:{item:r.item,instance_id:t.parent?.instance_id,comp:t.parent?.comp,root_instances:t.parent?.root_instances}};t.jsx_prop&&(l.jsx_prop={...t.jsx_prop,is_root:!1}),xi(e,l)}}};var OC=()=>new Promise(async e=>{let t=!1,n=await(await fetch(I.url`_prasi/route`)).json();t||e(n)}),w1=async()=>{let e=Bs(),t=[];try{let n=await OC();if(n&&n.site&&n.urls){n.layout&&(I.layout.id=n.layout.id,I.layout.root=n.layout.root,I.layout.meta={},I.layout.root&&(await li(I.layout.root.childs),Ca(I.layout.meta,I.layout.root))),I.site=n.site,I.site.code={mode:"vsc"},await PC(),I.site.api=H_(I.site.api_url),I.site.db=m1(I.site.api_url);let r=window;r.serverurl=I.site.api_url,r.db=I.site.db,r.api=I.site.api;for(let i of n.urls)e.insert(i.url,i),t.push(i)}}catch{}return{router:e,pages:t}},PC=()=>new Promise(e=>{let t=document,n=t.createElement("script");n.onload=async()=>{e()};let r=I.site.api_url;if(r==="*")r=`${location.protocol}//${location.host}`,I.site.api_url=r;else try{new URL(r)}catch{location.hostname==="localhost"?r="http://localhost:4550":r="https://prasi.avolut.com"}localStorage.getItem("api-ts-"+r)||localStorage.setItem("api-ts-"+r,Date.now().toString());let i=localStorage.getItem("api-ts-"+r);n.src=`${r}/_prasi/load.js?url=${r}&v3&ts=${i}`,document.querySelector(`script[src="${n.src}"]`)?e():t.body.appendChild(n)}),Ca=(e,t)=>{for(let n of t.childs)xi({set_meta:!0,comps:I.comp.list,meta:e,mode:"page"},{item:n})};var se=window;var on=P(G()),Ud=()=>location.hostname.split(".").length===4||location.hostname==="prasi.app"||location.hostname==="prasi.avolut.com"||location.hostname.includes("ngrok")||location.hostname==="localhost"||location.hostname==="127.0.0.1"||location.hostname==="10.0.2.2",k1=()=>{let e=In({page_id:""}),[t,n]=(0,x1.useState)({}),r=()=>n({});se.prasiContext.render=r;let i=nf.Provider,o=Ud()&&location.pathname.startsWith("/prod");if(I.route.status!=="ready")return I.route.status==="init"&&(I.route.status="loading",w1().then(async({router:c,pages:d})=>{Fy(),I.route.status="ready",I.route.router=c,I.route.pages=d;let f=se._prasi.basepath,p=`${f.endsWith("/")?f:`${f}/`}_prasi/code/index.js`,g=new URL(location.href);p.startsWith("/")&&(p=`${g.protocol}//${g.host}${p}`);let _=new Function("callback",`import("${p}").then(callback)`);await new Promise(w=>{_(h=>{for(let[m,y]of Object.entries(h))se[m]=y;w()})}),r()})),(0,on.jsx)(_o,{});let l=I.route.router;if(!l)return(0,on.jsx)(ff,{children:"Failed to create Router"});let s="";if(o){let c=location.pathname.split("/");cf(c[3])&&(s=c[3])}let a=null;if(se._prasi.page_id)l.insert(I.pathname,{id:se._prasi.page_id,url:I.pathname}),a={id:se._prasi.page_id,url:"",params:se._prasi.params},se._prasi.routed={page_id:se._prasi.page_id,params:se._prasi.params},delete se._prasi.page_id,delete se._prasi.params;else{if(a=l.lookup(I.pathname),s){let c=I.route.pages.find(d=>s===d.id);c&&(a=c)}a&&se._prasi.routed&&se._prasi.routed.page_id===a.id&&se._prasi.routed.params&&(a.params=se._prasi.routed.params)}if(!a)return(0,on.jsx)(ff,{children:"Page Not Found"});a.id!==e.page_id&&(I.init_local_effect={}),se.params=a.params||{},I.page.id=a.id,I.page.url=a.url;let u=I.page.cache[a.id];if(u)I.page.root=u.root,I.page.meta=u.meta;else return My(a.id).then(async({root:c})=>{if(a){let d={id:a.id,url:a.url,root:c,meta:{}};await li(c.childs),Ca(d.meta,c),I.page.cache[d.id]=d,r()}}).catch(()=>{r()}),(0,on.jsx)(_o,{note:"Loading page"});return(0,on.jsx)(i,{value:se.prasiContext,children:(0,on.jsx)("div",{className:cx("relative flex flex-1 items-center justify-center"),children:(0,on.jsx)("div",{className:cx("absolute flex flex-col items-stretch flex-1 bg-white main-content-preview",I.mode==="mobile"?css` @media (min-width: 768px) { border-left: 1px solid #ccc; border-right: 1px solid #ccc; diff --git a/app/srv/ws/sync/code/templates/typings/global_d_ts b/app/srv/ws/sync/code/templates/typings/global_d_ts index 862d2d3f..206f8b50 100644 --- a/app/srv/ws/sync/code/templates/typings/global_d_ts +++ b/app/srv/ws/sync/code/templates/typings/global_d_ts @@ -83,9 +83,10 @@ declare global { type SingleChange = | { type: "set"; name: string; value: any } - | ({ type: "prop"; name: string } & PropVal); + | ({ type: "prop"; name: string } & PropVal) + | { type: "child"; childs: SimpleItem[] }; - type PropVal = + export type PropVal = | { mode: "string"; value: string } | { mode: "raw"; value: string; valueBuilt?: string } | { mode: "jsx"; value: null | (IItem & PrasiEdit) }; @@ -96,12 +97,17 @@ declare global { child_idx: number; }; - type PrasiEdit = { + type SimpleItem = Partial> & { + component?: { id: string; props: Record }; + }; + + export type PrasiEdit = { edit: { setValue: (name: T, value: IItem[T]) => void; setProp: (name: string, value: PropVal | string) => void; pending: SingleChange[]; - readonly childs: (IItem & PrasiEdit)[]; + childs: (IItem & PrasiEdit)[]; + setChilds: (childs: ((IItem & PrasiEdit) | SimpleItem)[]) => void; readonly parent: null | ParentArg; commit: () => Promise; readonly props?: Record; diff --git a/app/web/src/nova/ed/panel/popup/api/api-db.tsx b/app/web/src/nova/ed/panel/popup/api/api-db.tsx index de8616b8..6a05862f 100644 --- a/app/web/src/nova/ed/panel/popup/api/api-db.tsx +++ b/app/web/src/nova/ed/panel/popup/api/api-db.tsx @@ -1,4 +1,4 @@ -import { useGlobal } from "web-utils"; +import { useGlobal, useLocal } from "web-utils"; import { AutoHeightTextarea } from "../../../../../utils/ui/auto-textarea"; import { EDGlobal } from "../../../logic/ed-global"; import { apiRef, apiUrl, server } from "./api-utils"; @@ -13,15 +13,18 @@ export const EdApiDB = ({ update: () => void; }) => { const p = useGlobal(EDGlobal, "EDITOR"); + const local = useLocal({ url: db.url }); const api = apiRef[apiUrl(p)]; + return ( -
+
{ - db.url = e.currentTarget.value; - p.render(); + local.url = e.currentTarget.value; + db.url = local.url; + local.render(); }} onBlur={async () => { update(); @@ -57,6 +60,7 @@ export const EdApiDB = ({ "api-ts-" + p.site.config.api_url, Date.now().toString() ); + location.reload(); }} > DB Pull @@ -74,6 +78,7 @@ export const EdApiDB = ({ server.status = "ready"; render(); alert("RESTART: OK"); + location.reload(); }} > Restart Server diff --git a/app/web/src/nova/vi/meta/comp/init-comp-load.tsx b/app/web/src/nova/vi/meta/comp/init-comp-load.tsx index c9850338..360c975a 100644 --- a/app/web/src/nova/vi/meta/comp/init-comp-load.tsx +++ b/app/web/src/nova/vi/meta/comp/init-comp-load.tsx @@ -62,9 +62,11 @@ export const initLoadComp = async ( } for (const component of comps) { - for (const prop of Object.values(component.props)) { - if (prop.meta?.type === "content-element" && prop.content) { - await initLoadComp(p, prop.content, opt, loaded); + if (component.props) { + for (const prop of Object.values(component.props)) { + if (prop.meta?.type === "content-element" && prop.content) { + await initLoadComp(p, prop.content, opt, loaded); + } } } } diff --git a/app/web/src/nova/vi/meta/comp/instantiate.tsx b/app/web/src/nova/vi/meta/comp/instantiate.tsx index aba1fe5e..1acf3cb8 100644 --- a/app/web/src/nova/vi/meta/comp/instantiate.tsx +++ b/app/web/src/nova/vi/meta/comp/instantiate.tsx @@ -18,7 +18,7 @@ export const instantiate = (arg: { newitem.hidden = item.hidden; if (newitem.component) { - if (newitem.component.props && item.component) { + if (newitem.component.props && item.component && item.component.props) { for (const k of Object.keys(newitem.component.props)) { const cprop = item.component.props[k]; const nprop = newitem.component.props[k]; diff --git a/app/web/src/nova/vi/render/script/item-dev.ts b/app/web/src/nova/vi/render/script/item-dev.ts index a98ee0cc..a2eb3ab3 100644 --- a/app/web/src/nova/vi/render/script/item-dev.ts +++ b/app/web/src/nova/vi/render/script/item-dev.ts @@ -9,7 +9,7 @@ const w = window as unknown as { type SingleChange = | { type: "set"; name: string; value: any } | ({ type: "prop"; name: string } & PropVal) - | { type: "child"; childs: SimpleItem[] }; + | { type: "child"; childs: ((IItem & PrasiEdit) | SimpleItem)[] }; export type PropVal = | { mode: "string"; value: string } @@ -32,7 +32,7 @@ export type PrasiEdit = { setProp: (name: string, value: PropVal | string) => void; pending: SingleChange[]; childs: (IItem & PrasiEdit)[]; - setChilds: (childs: SimpleItem[]) => void; + setChilds: (childs: ((IItem & PrasiEdit) | SimpleItem)[]) => void; readonly parent: null | ParentArg; commit: () => Promise; readonly props?: Record; @@ -197,8 +197,9 @@ export const devItem = ( mitem.doc?.transact(() => { for (const [k, v] of Object.entries(result)) { const m = metas[k]; + if (m.mitem) { - syncronize(m.mitem as any, v); + console.log(syncronize(m.mitem as any, v)); } } }); @@ -306,7 +307,7 @@ export const devItem = ( } as IItem & PrasiEdit; }; -const complexifyProps = async ( +const complexifyProps = ( props: Record, compileValueBuilt: Record ) => { diff --git a/app/web/src/utils/script/types/base.ts b/app/web/src/utils/script/types/base.ts index 36c8c5dd..f605e93d 100644 --- a/app/web/src/utils/script/types/base.ts +++ b/app/web/src/utils/script/types/base.ts @@ -68,41 +68,39 @@ export const baseTypings = ` }; childs: IItem[]; }; - + type SingleChange = - | { type: "set"; name: string; value: any } - | ({ type: "prop"; name: string } & PropVal) - | { type: "child"; childs: SimpleItem[] }; + | { type: "set"; name: string; value: any } + | ({ type: "prop"; name: string } & PropVal) + | { type: "child"; childs: SimpleItem[] }; export type PropVal = - | { mode: "string"; value: string } - | { mode: "raw"; value: string; valueBuilt?: string } - | { mode: "jsx"; value: null | (IItem & PrasiEdit) }; + | { mode: "string"; value: string } + | { mode: "raw"; value: string; valueBuilt?: string } + | { mode: "jsx"; value: null | (IItem & PrasiEdit) }; type ParentArg = { - item: IItem & PrasiEdit; - child_type: "jsx" | "child"; - child_idx: number; + item: IItem & PrasiEdit; + child_type: "jsx" | "child"; + child_idx: number; }; type SimpleItem = Partial> & { - component?: { id: string; props: Record }; + component?: { id: string; props: Record }; }; export type PrasiEdit = { - edit: { - setValue: (name: T, value: IItem[T]) => void; - setProp: (name: string, value: PropVal | string) => void; - pending: SingleChange[]; - childs: (IItem & PrasiEdit)[]; - setChilds: (childs: SimpleItem[]) => void; - readonly parent: null | ParentArg; - commit: () => Promise; - readonly props?: Record; + edit: { + setValue: (name: T, value: IItem[T]) => void; + setProp: (name: string, value: PropVal | string) => void; + pending: SingleChange[]; + childs: (IItem & PrasiEdit)[]; + setChilds: (childs: ((IItem & PrasiEdit) | SimpleItem)[]) => void; + readonly parent: null | ParentArg; + commit: () => Promise; + readonly props?: Record; + }; }; - }; - - type PrasiItem = IItem & PrasiEdit; const _item: undefined | PrasiItem; diff --git a/package.json b/package.json index a5e2887b..7afbf134 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "module": "src/index.ts", "type": "module", "scripts": { - "dev": "bun run --hot ./pkgs/core/index.ts dev", + "dev": "bun run --no-clear-screen --hot ./pkgs/core/index.ts dev", "clean": "rm -rf data/lmdb && rm -rf app/static && rm -rf app/web/.parcel-cache", "build": "bun run --silent ./pkgs/core/build.ts", "db-pull": "bun run ./pkgs/core/db-pull.ts", diff --git a/pkgs/core/server/api/api-scan.ts b/pkgs/core/server/api/api-scan.ts index 95256ce1..4279d88c 100644 --- a/pkgs/core/server/api/api-scan.ts +++ b/pkgs/core/server/api/api-scan.ts @@ -16,7 +16,7 @@ export const prepareApiRoutes = async () => { const api = await import(importPath); let args: string[] = await parseArgs(importPath); const route = { - url: api._.url, + url: api._.url, args, raw: !!api._.raw, fn: api._.api,