@rulecms/widget-svelte 0.3.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +13 -10
- package/dist/index.d.ts +157 -1
- package/dist/index.js +2505 -2245
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
"use strict";var Ss=Object.defineProperty;var Lr=e=>{throw TypeError(e)};var Es=(e,t,n)=>t in e?Ss(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ge=(e,t,n)=>Es(e,typeof t!="symbol"?t+"":t,n),On=(e,t,n)=>t.has(e)||Lr("Cannot "+n);var v=(e,t,n)=>(On(e,t,"read from private field"),n?n.call(e):t.get(e)),F=(e,t,n)=>t.has(e)?Lr("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),J=(e,t,n,r)=>(On(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),j=(e,t,n)=>(On(e,t,"access private method"),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const zn=require("svelte"),Ts="5";var to;typeof window<"u"&&((to=window.__svelte??(window.__svelte={})).v??(to.v=new Set)).add(Ts);const Is=1,Ds=2,oo=4,Ps=8,ks=16,Ls=1,Rs=2,B=Symbol("uninitialized"),io="http://www.w3.org/1999/xhtml",xs="http://www.w3.org/2000/svg",Ms="@attach",so=!1;var tr=Array.isArray,Ns=Array.prototype.indexOf,fn=Array.prototype.includes,nr=Array.from,Os=Object.defineProperty,Ot=Object.getOwnPropertyDescriptor,Ws=Object.getOwnPropertyDescriptors,Fs=Object.prototype,Vs=Array.prototype,lo=Object.getPrototypeOf;function It(e){return typeof e=="function"}const js=()=>{};function Bs(e){for(var t=0;t<e.length;t++)e[t]()}function ao(){var e,t,n=new Promise((r,o)=>{e=r,t=o});return{promise:n,resolve:e,reject:t}}const G=2,wt=4,rr=8,or=1<<24,be=16,pe=32,Be=64,Us=128,ue=512,H=1024,U=2048,we=4096,Z=8192,ce=16384,Et=32768,Rr=1<<25,Ue=65536,dn=1<<17,Ks=1<<18,Sn=1<<19,Hs=1<<20,Ee=1<<25,$e=65536,pn=1<<21,dt=1<<22,Ve=1<<23,pt=Symbol("$state"),Gs=Symbol("legacy props"),Ys=Symbol(""),Wn=Symbol("attributes"),xr=Symbol("class"),Mr=Symbol("style"),rn=Symbol("text"),Xt=new class extends Error{constructor(){super(...arguments);ge(this,"name","StaleReactionError");ge(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};var no;const ir=!!((no=globalThis.document)!=null&&no.contentType)&&globalThis.document.contentType.includes("xml");function zs(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function qs(e,t,n){throw new Error("https://svelte.dev/e/each_key_duplicate")}function Xs(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Zs(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Js(e){throw new Error("https://svelte.dev/e/effect_orphan")}function Qs(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function $s(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function el(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function tl(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function nl(){console.warn("https://svelte.dev/e/derived_inert")}function rl(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function uo(e){return e===this.v}function ol(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function co(e){return!ol(e,this.v)}let il=!1,fe=null;function hn(e){fe=e}function Me(e,t=!1,n){fe={p:fe,i:!1,c:null,e:null,s:e,x:null,r:R,l:null}}function Ne(e){var t=fe,n=t.e;if(n!==null){t.e=null;for(var r of n)Do(r)}return t.i=!0,fe=t.p,{}}function fo(){return!0}let ut=[];function sl(){var e=ut;ut=[],Bs(e)}function Vt(e){if(ut.length===0){var t=ut;queueMicrotask(()=>{t===ut&&sl()})}ut.push(e)}function ll(e){var t=R;if(t===null)return k.f|=Ve,e;if((t.f&Et)===0&&(t.f&wt)===0)throw e;gn(e,t)}function gn(e,t){if(!(t!==null&&(t.f&ce)!==0)){for(;t!==null;){if((t.f&Us)!==0){if((t.f&Et)===0)throw e;try{t.b.error(e);return}catch(n){e=n}}t=t.parent}throw e}}const al=-7169;function V(e,t){e.f=e.f&al|t}function sr(e){(e.f&ue)!==0||e.deps===null?V(e,H):V(e,we)}function po(e){if(e!==null)for(const t of e)(t.f&G)===0||(t.f&$e)===0||(t.f^=$e,po(t.deps))}function ul(e,t,n){(e.f&U)!==0?t.add(e):(e.f&we)!==0&&n.add(e),po(e.deps),V(e,H)}function cl(e,t){if(t){const n=document.body;e.autofocus=!0,Vt(()=>{document.activeElement===n&&e.focus()})}}function Zt(e){var t=k,n=R;Ie(null),He(null);try{return e()}finally{Ie(t),He(n)}}function ho(e,t,n,r){const o=lr;var i=e.filter(d=>!d.settled),s=t.map(o);if(n.length===0&&i.length===0){r(s);return}var l=R,u=fl(),c=i.length===1?i[0].promise:i.length>1?Promise.all(i.map(d=>d.promise)):null;function f(d){if((l.f&ce)===0){u();try{r([...s,...d])}catch(y){gn(y,l)}vn()}}var p=go();if(n.length===0){c.then(()=>f([])).finally(p);return}function a(){Promise.all(n.map(d=>dl(d))).then(f).catch(d=>gn(d,l)).finally(p)}c?c.then(()=>{u(),a(),vn()}):a()}function fl(){var e=R,t=k,n=fe,r=L;return function(i=!0){He(e),Ie(t),hn(n),i&&(e.f&ce)===0&&(r==null||r.activate(),r==null||r.apply())}}function vn(e=!0){He(null),Ie(null),hn(null),e&&(L==null||L.deactivate())}function go(){var e=R,t=e.b,n=L,r=!!(t!=null&&t.is_rendered());return t==null||t.update_pending_count(1,n),n.increment(r,e),()=>{t==null||t.update_pending_count(-1,n),n.decrement(r,e)}}function lr(e){var t=G|U;return R!==null&&(R.f|=Sn),{ctx:fe,deps:null,effects:null,equals:uo,f:t,fn:e,reactions:null,rv:0,v:B,wv:0,parent:R,ac:null}}const Lt=Symbol("obsolete");function dl(e,t,n){let r=R;r===null&&zs();var o=void 0,i=Bt(B),s=!k,l=new Set;return Dl(()=>{var d,y;var u=R,c=ao();o=c.promise;try{Promise.resolve(e()).then(c.resolve,m=>{m!==Xt&&c.reject(m)}).finally(vn)}catch(m){c.reject(m),vn()}var f=L;if(s){if((u.f&Et)!==0)var p=go();if((d=r.b)!=null&&d.is_rendered())(y=f.async_deriveds.get(u))==null||y.reject(Lt);else for(const m of l.values())m.reject(Lt);l.add(c),f.async_deriveds.set(u,c)}const a=(m,h=void 0)=>{p==null||p(),l.delete(c),h!==Lt&&(f.activate(),h?(i.f|=Ve,Ut(i,h)):((i.f&Ve)!==0&&(i.f^=Ve),Ut(i,m)),f.deactivate())};c.promise.then(a,m=>a(null,m||"unknown"))}),fr(()=>{for(const u of l)u.reject(Lt)}),new Promise(u=>{function c(f){function p(){f===o?u(i):c(o)}f.then(p,p)}c(o)})}function D(e){const t=lr(e);return Oo(t),t}function pl(e){const t=lr(e);return t.equals=co,t}function hl(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)de(t[n])}}function ar(e){var t,n=R,r=e.parent;if(!Ke&&r!==null&&e.v!==B&&(r.f&(ce|Z))!==0)return nl(),e.v;He(r);try{e.f&=~$e,hl(e),t=jo(e)}finally{He(n)}return t}function vo(e){var t=ar(e);if(!e.equals(t)&&(e.wv=Fo(),(!(L!=null&&L.is_fork)||e.deps===null)&&(L!==null?(L.capture(e,t,!0),Wt==null||Wt.capture(e,t,!0)):e.v=t,e.deps===null))){V(e,H);return}Ke||(z!==null?(Io()||L!=null&&L.is_fork)&&z.set(e,t):sr(e))}function gl(e){var t;if(e.effects!==null)for(const n of e.effects)(n.teardown||n.ac)&&((t=n.teardown)==null||t.call(n),n.ac!==null&&Zt(()=>{n.ac.abort(Xt),n.ac=null}),n.fn!==null&&(n.teardown=js),Kt(n,0),pr(n))}function yo(e){if(e.effects!==null)for(const t of e.effects)t.teardown&&t.fn!==null&&At(t)}let Fn=null,lt=null,L=null,Wt=null,z=null,qn=null,Vn=!1,ct=null,sn=null;var Nr=0;let vl=1;var gt,We,qe,vt,yt,mt,Re,_t,Q,Yt,xe,ye,Ae,bt,Xe,x,Xn,Rt,Zn,mo,_o,at,yl,xt;const Cn=class Cn{constructor(){F(this,x);ge(this,"id",vl++);F(this,gt,!1);ge(this,"linked",!0);F(this,We,null);F(this,qe,null);ge(this,"async_deriveds",new Map);ge(this,"current",new Map);ge(this,"previous",new Map);F(this,vt,new Set);F(this,yt,new Set);F(this,mt,0);F(this,Re,new Map);F(this,_t,null);F(this,Q,[]);F(this,Yt,[]);F(this,xe,new Set);F(this,ye,new Set);F(this,Ae,new Map);F(this,bt,new Set);ge(this,"is_fork",!1);F(this,Xe,!1);lt===null?Fn=lt=this:(J(lt,qe,this),J(this,We,lt)),lt=this}skip_effect(t){v(this,Ae).has(t)||v(this,Ae).set(t,{d:[],m:[]}),v(this,bt).delete(t)}unskip_effect(t,n=r=>this.schedule(r)){var r=v(this,Ae).get(t);if(r){v(this,Ae).delete(t);for(var o of r.d)V(o,U),n(o);for(o of r.m)V(o,we),n(o)}v(this,bt).add(t)}capture(t,n,r=!1){t.v!==B&&!this.previous.has(t)&&this.previous.set(t,t.v),(t.f&Ve)===0&&(this.current.set(t,[n,r]),z==null||z.set(t,n)),this.is_fork||(t.v=n)}activate(){L=this}deactivate(){L=null,z=null}flush(){try{Vn=!0,L=this,j(this,x,Rt).call(this)}finally{Nr=0,qn=null,ct=null,sn=null,Vn=!1,L=null,z=null,Je.clear()}}discard(){var t;for(const n of v(this,yt))n(this);v(this,yt).clear();for(const n of this.async_deriveds.values())n.reject(Lt);j(this,x,xt).call(this),(t=v(this,_t))==null||t.resolve()}register_created_effect(t){v(this,Yt).push(t)}increment(t,n){if(J(this,mt,v(this,mt)+1),t){let r=v(this,Re).get(n)??0;v(this,Re).set(n,r+1)}}decrement(t,n){if(J(this,mt,v(this,mt)-1),t){let r=v(this,Re).get(n)??0;r===1?v(this,Re).delete(n):v(this,Re).set(n,r-1)}v(this,Xe)||(J(this,Xe,!0),Vt(()=>{J(this,Xe,!1),this.linked&&this.flush()}))}transfer_effects(t,n){for(const r of t)v(this,xe).add(r);for(const r of n)v(this,ye).add(r);t.clear(),n.clear()}oncommit(t){v(this,vt).add(t)}ondiscard(t){v(this,yt).add(t)}settled(){return(v(this,_t)??J(this,_t,ao())).promise}static ensure(){if(L===null){const t=L=new Cn;Vn||Vt(()=>{v(t,gt)||t.flush()})}return L}apply(){{z=null;return}}schedule(t){var o;if(qn=t,(o=t.b)!=null&&o.is_pending&&(t.f&(wt|rr|or))!==0&&(t.f&Et)===0){t.b.defer_effect(t);return}for(var n=t;n.parent!==null;){n=n.parent;var r=n.f;if(ct!==null&&n===R&&(k===null||(k.f&G)===0))return;if((r&(Be|pe))!==0){if((r&H)===0)return;n.f^=H}}v(this,Q).push(n)}};gt=new WeakMap,We=new WeakMap,qe=new WeakMap,vt=new WeakMap,yt=new WeakMap,mt=new WeakMap,Re=new WeakMap,_t=new WeakMap,Q=new WeakMap,Yt=new WeakMap,xe=new WeakMap,ye=new WeakMap,Ae=new WeakMap,bt=new WeakMap,Xe=new WeakMap,x=new WeakSet,Xn=function(){if(this.is_fork)return!0;for(const r of v(this,Re).keys()){for(var t=r,n=!1;t.parent!==null;){if(v(this,Ae).has(t)){n=!0;break}t=t.parent}if(!n)return!0}return!1},Rt=function(){var u,c,f,p;J(this,gt,!0),Nr++>1e3&&(j(this,x,xt).call(this),ml());for(const a of v(this,xe))v(this,ye).delete(a),V(a,U),this.schedule(a);for(const a of v(this,ye))V(a,we),this.schedule(a);const t=v(this,Q);J(this,Q,[]),this.apply();var n=ct=[],r=[],o=sn=[];for(const a of t)try{j(this,x,Zn).call(this,a,n,r)}catch(d){throw Co(a),j(this,x,Xn).call(this)||this.discard(),d}if(L=null,o.length>0){var i=Cn.ensure();for(const a of o)i.schedule(a)}if(ct=null,sn=null,j(this,x,Xn).call(this)){j(this,x,at).call(this,r),j(this,x,at).call(this,n);for(const[a,d]of v(this,Ae))wo(a,d);o.length>0&&j(u=L,x,Rt).call(u);return}const s=j(this,x,mo).call(this);if(s){j(this,x,at).call(this,r),j(this,x,at).call(this,n),j(c=s,x,_o).call(c,this);return}v(this,xe).clear(),v(this,ye).clear();for(const a of v(this,vt))a(this);v(this,vt).clear(),Wt=this,Or(r),Or(n),Wt=null,(f=v(this,_t))==null||f.resolve();var l=L;if(v(this,mt)===0&&(v(this,Q).length===0||l!==null)&&j(this,x,xt).call(this),v(this,Q).length>0)if(l!==null){const a=l;v(a,Q).push(...v(this,Q).filter(d=>!v(a,Q).includes(d)))}else l=this;l!==null&&j(p=l,x,Rt).call(p)},Zn=function(t,n,r){t.f^=H;for(var o=t.first;o!==null;){var i=o.f,s=(i&(pe|Be))!==0,l=s&&(i&H)!==0,u=l||(i&Z)!==0||v(this,Ae).has(o);if(!u&&o.fn!==null){s?o.f^=H:(i&wt)!==0?n.push(o):$t(o)&&((i&be)!==0&&v(this,ye).add(o),At(o));var c=o.first;if(c!==null){o=c;continue}}for(;o!==null;){var f=o.next;if(f!==null){o=f;break}o=o.parent}}},mo=function(){for(var t=v(this,We);t!==null;){if(!t.is_fork){for(const[n,[,r]]of this.current)if(t.current.has(n)&&!r)return t}t=v(t,We)}return null},_o=function(t){var r;for(const[o,i]of t.current)!this.previous.has(o)&&t.previous.has(o)&&this.previous.set(o,t.previous.get(o)),this.current.set(o,i);for(const[o,i]of t.async_deriveds){const s=this.async_deriveds.get(o);s&&i.promise.then(s.resolve).catch(s.reject)}t.async_deriveds.clear(),this.transfer_effects(v(t,xe),v(t,ye));const n=o=>{var i=o.reactions;if(i!==null&&!((o.f&G)!==0&&(o.f&(U|we))===0))for(const u of i){var s=u.f;if((s&G)!==0)n(u);else{var l=u;s&(dt|be)&&!this.async_deriveds.has(l)&&(v(this,ye).delete(l),V(l,U),this.schedule(l))}}};for(const o of this.current.keys())n(o);this.oncommit(()=>t.discard()),j(r=t,x,xt).call(r),L=this,j(this,x,Rt).call(this)},at=function(t){for(var n=0;n<t.length;n+=1)ul(t[n],v(this,xe),v(this,ye))},yl=function(){var p;for(let a=Fn;a!==null;a=v(a,qe)){var t=a.id<this.id,n=[];for(const[d,[y,m]]of this.current){if(a.current.has(d)){var r=a.current.get(d)[0];if(t&&y!==r)a.current.set(d,[y,m]);else continue}n.push(d)}if(t)for(const[d,y]of this.async_deriveds){const m=a.async_deriveds.get(d);m&&y.promise.then(m.resolve).catch(m.reject)}var o=[...a.current.keys()].filter(d=>!a.current.get(d)[1]);if(!(!v(a,gt)||o.length===0)){var i=o.filter(d=>!this.current.has(d));if(i.length===0)t&&a.discard();else if(n.length>0){if(t)for(const d of v(this,bt))a.unskip_effect(d,y=>{var m;(y.f&(be|dt))!==0?a.schedule(y):j(m=a,x,at).call(m,[y])});a.activate();var s=new Set,l=new Map;for(var u of n)bo(u,i,s,l);l=new Map;var c=[...a.current].filter(([d,y])=>{const m=this.current.get(d);return m?m[0]!==y[0]||m[1]!==y[1]:!0}).map(([d])=>d);if(c.length>0)for(const d of v(this,Yt))(d.f&(ce|Z|dn))===0&&ur(d,c,l)&&((d.f&(dt|be))!==0?(V(d,U),a.schedule(d)):v(a,xe).add(d));if(v(a,Q).length>0&&!v(a,Xe)){a.apply();for(var f of v(a,Q))j(p=a,x,Zn).call(p,f,[],[]);J(a,Q,[])}a.deactivate()}}}},xt=function(){if(this.linked){var t=v(this,We),n=v(this,qe);t===null?Fn=n:J(t,qe,n),n===null?lt=t:J(n,We,t),this.linked=!1}};let jt=Cn;function ml(){try{Qs()}catch(e){gn(e,qn)}}let ve=null;function Or(e){var t=e.length;if(t!==0){for(var n=0;n<t;){var r=e[n++];if((r.f&(ce|Z))===0&&$t(r)&&(ve=new Set,At(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&Ro(r),(ve==null?void 0:ve.size)>0)){Je.clear();for(const o of ve){if((o.f&(ce|Z))!==0)continue;const i=[o];let s=o.parent;for(;s!==null;)ve.has(s)&&(ve.delete(s),i.push(s)),s=s.parent;for(let l=i.length-1;l>=0;l--){const u=i[l];(u.f&(ce|Z))===0&&At(u)}}ve.clear()}}ve=null}}function bo(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(const o of e.reactions){const i=o.f;(i&G)!==0?bo(o,t,n,r):(i&(dt|be))!==0&&(i&U)===0&&ur(o,t,r)&&(V(o,U),cr(o))}}function ur(e,t,n){const r=n.get(e);if(r!==void 0)return r;if(e.deps!==null)for(const o of e.deps){if(fn.call(t,o))return!0;if((o.f&G)!==0&&ur(o,t,n))return n.set(o,!0),!0}return n.set(e,!1),!1}function cr(e){L.schedule(e)}function wo(e,t){if(!((e.f&pe)!==0&&(e.f&H)!==0)){(e.f&U)!==0?t.d.push(e):(e.f&we)!==0&&t.m.push(e),V(e,H);for(var n=e.first;n!==null;)wo(n,t),n=n.next}}function Co(e){V(e,H);for(var t=e.first;t!==null;)Co(t),t=t.next}let yn=new Set;const Je=new Map;let Ao=!1;function Bt(e,t){var n={f:0,v:e,reactions:null,equals:uo,rv:0,wv:0};return n}function oe(e,t){const n=Bt(e);return Oo(n),n}function _l(e,t=!1,n=!0){const r=Bt(e);return t||(r.equals=co),r}function W(e,t,n=!1){k!==null&&(!Fe||(k.f&dn)!==0)&&fo()&&(k.f&(G|be|dt|dn))!==0&&(Te===null||!Te.has(e))&&tl();let r=n?ft(t):t;return Ut(e,r,sn)}function Ut(e,t,n=null){if(!e.equals(t)){Je.set(e,Ke?t:e.v);var r=jt.ensure();if(r.capture(e,t),(e.f&G)!==0){const o=e;(e.f&U)!==0&&ar(o),z===null&&sr(o)}e.wv=Fo(),So(e,U,n),R!==null&&(R.f&H)!==0&&(R.f&(pe|Be))===0&&(se===null?Ll([e]):se.push(e)),!r.is_fork&&yn.size>0&&!Ao&&bl()}return t}function bl(){Ao=!1;for(const e of yn){(e.f&H)!==0&&V(e,we);let t;try{t=$t(e)}catch{t=!0}t&&At(e)}yn.clear()}function jn(e){W(e,e.v+1)}function So(e,t,n){var r=e.reactions;if(r!==null)for(var o=r.length,i=0;i<o;i++){var s=r[i],l=s.f,u=(l&U)===0;if(u&&V(s,t),(l&dn)!==0)yn.add(s);else if((l&G)!==0){var c=s;z==null||z.delete(c),(l&$e)===0&&(l&ue&&(R===null||(R.f&pn)===0)&&(s.f|=$e),So(c,we,n))}else if(u){var f=s;(l&be)!==0&&ve!==null&&ve.add(f),n!==null?n.push(f):cr(f)}}}function ft(e){if(typeof e!="object"||e===null||pt in e)return e;const t=lo(e);if(t!==Fs&&t!==Vs)return e;var n=new Map,r=tr(e),o=oe(0),i=Qe,s=l=>{if(Qe===i)return l();var u=k,c=Qe;Ie(null),Vr(i);var f=l();return Ie(u),Vr(c),f};return r&&n.set("length",oe(e.length)),new Proxy(e,{defineProperty(l,u,c){(!("value"in c)||c.configurable===!1||c.enumerable===!1||c.writable===!1)&&$s();var f=n.get(u);return f===void 0?s(()=>{var p=oe(c.value);return n.set(u,p),p}):W(f,c.value,!0),!0},deleteProperty(l,u){var c=n.get(u);if(c===void 0){if(u in l){const f=s(()=>oe(B));n.set(u,f),jn(o)}}else W(c,B),jn(o);return!0},get(l,u,c){var d;if(u===pt)return e;var f=n.get(u),p=u in l;if(f===void 0&&(!p||(d=Ot(l,u))!=null&&d.writable)&&(f=s(()=>{var y=ft(p?l[u]:B),m=oe(y);return m}),n.set(u,f)),f!==void 0){var a=g(f);return a===B?void 0:a}return Reflect.get(l,u,c)},getOwnPropertyDescriptor(l,u){var c=Reflect.getOwnPropertyDescriptor(l,u);if(c&&"value"in c){var f=n.get(u);f&&(c.value=g(f))}else if(c===void 0){var p=n.get(u),a=p==null?void 0:p.v;if(p!==void 0&&a!==B)return{enumerable:!0,configurable:!0,value:a,writable:!0}}return c},has(l,u){var a;if(u===pt)return!0;var c=n.get(u),f=c!==void 0&&c.v!==B||Reflect.has(l,u);if(c!==void 0||R!==null&&(!f||(a=Ot(l,u))!=null&&a.writable)){c===void 0&&(c=s(()=>{var d=f?ft(l[u]):B,y=oe(d);return y}),n.set(u,c));var p=g(c);if(p===B)return!1}return f},set(l,u,c,f){var P;var p=n.get(u),a=u in l;if(r&&u==="length")for(var d=c;d<p.v;d+=1){var y=n.get(d+"");y!==void 0?W(y,B):d in l&&(y=s(()=>oe(B)),n.set(d+"",y))}if(p===void 0)(!a||(P=Ot(l,u))!=null&&P.writable)&&(p=s(()=>oe(void 0)),W(p,ft(c)),n.set(u,p));else{a=p.v!==B;var m=s(()=>ft(c));W(p,m)}var h=Reflect.getOwnPropertyDescriptor(l,u);if(h!=null&&h.set&&h.set.call(f,c),!a){if(r&&typeof u=="string"){var _=n.get("length"),A=Number(u);Number.isInteger(A)&&A>=_.v&&W(_,A+1)}jn(o)}return!0},ownKeys(l){g(o);var u=Reflect.ownKeys(l).filter(p=>{var a=n.get(p);return a===void 0||a.v!==B});for(var[c,f]of n)f.v!==B&&!(c in l)&&u.push(c);return u},setPrototypeOf(){el()}})}function Wr(e){try{if(e!==null&&typeof e=="object"&&pt in e)return e[pt]}catch{}return e}function wl(e,t){return Object.is(Wr(e),Wr(t))}var Cl,Al,Sl;function je(e=""){return document.createTextNode(e)}function mn(e){return Al.call(e)}function Jt(e){return Sl.call(e)}function _e(e,t){return mn(e)}function q(e,t=!1){{var n=mn(e);return n instanceof Comment&&n.data===""?Jt(n):n}}function Ct(e,t=1,n=!1){let r=e;for(;t--;)r=Jt(r);return r}function El(e){e.textContent=""}function Eo(){return!1}function To(e,t,n){return t==null||t===io?n?document.createElement(e,{is:n}):document.createElement(e):n?document.createElementNS(t,e,{is:n}):document.createElementNS(t,e)}function Tl(e){R===null&&(k===null&&Js(),Zs()),Ke&&Xs()}function Il(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function Ge(e,t){var n=R;n!==null&&(n.f&Z)!==0&&(e|=Z);var r={ctx:fe,deps:null,nodes:null,f:e|U|ue,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};L==null||L.register_created_effect(r);var o=r;if((e&wt)!==0)ct!==null?ct.push(r):jt.ensure().schedule(r);else if(t!==null){try{At(r)}catch(s){throw de(r),s}o.deps===null&&o.teardown===null&&o.nodes===null&&o.first===o.last&&(o.f&Sn)===0&&(o=o.first,(e&be)!==0&&(e&Ue)!==0&&o!==null&&(o.f|=Ue))}if(o!==null&&(o.parent=n,n!==null&&Il(o,n),k!==null&&(k.f&G)!==0&&(e&Be)===0)){var i=k;(i.effects??(i.effects=[])).push(o)}return r}function Io(){return k!==null&&!Fe}function fr(e){const t=Ge(rr,null);return V(t,H),t.teardown=e,t}function dr(e){Tl();var t=R.f,n=!k&&(t&pe)!==0&&fe!==null&&!fe.i;if(n){var r=fe;(r.e??(r.e=[])).push(e)}else return Do(e)}function Do(e){return Ge(wt|Hs,e)}function Po(e){return Ge(wt,e)}function Dl(e){return Ge(dt|Sn,e)}function le(e,t=[],n=[],r=[]){ho(r,t,n,o=>{Ge(rr,()=>{e(...o.map(g))})})}function Qt(e,t=0){var n=Ge(be|t,e);return n}function ko(e,t=0){var n=Ge(or|t,e);return n}function et(e){return Ge(pe|Sn,e)}function Lo(e){var t=e.teardown;if(t!==null){const n=Ke,r=k;Fr(!0),Ie(null);try{t.call(null)}finally{Fr(n),Ie(r)}}}function pr(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){const o=n.ac;o!==null&&Zt(()=>{o.abort(Xt)});var r=n.next;(n.f&Be)!==0?n.parent=null:de(n,t),n=r}}function Pl(e){for(var t=e.first;t!==null;){var n=t.next;(t.f&pe)===0&&de(t),t=n}}function de(e,t=!0){var n=!1;(t||(e.f&Ks)!==0)&&e.nodes!==null&&e.nodes.end!==null&&(kl(e.nodes.start,e.nodes.end),n=!0),e.f|=Rr,pr(e,t&&!n),Kt(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(const i of r)i.stop();Lo(e),e.f^=Rr,e.f|=ce;var o=e.parent;o!==null&&o.first!==null&&Ro(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function kl(e,t){for(;e!==null;){var n=e===t?null:Jt(e);e.remove(),e=n}}function Ro(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function hr(e,t,n=!0){var r=[];xo(e,r,!0);var o=()=>{n&&de(e),t&&t()},i=r.length;if(i>0){var s=()=>--i||o();for(var l of r)l.out(s)}else o()}function xo(e,t,n){if((e.f&Z)===0){e.f^=Z;var r=e.nodes&&e.nodes.t;if(r!==null)for(const l of r)(l.is_global||n)&&t.push(l);for(var o=e.first;o!==null;){var i=o.next;if((o.f&Be)===0){var s=(o.f&Ue)!==0||(o.f&pe)!==0&&(e.f&be)!==0;xo(o,t,s?n:!1)}o=i}}}function _n(e){Mo(e,!0)}function Mo(e,t){if((e.f&Z)!==0){e.f^=Z,(e.f&H)===0&&(V(e,U),jt.ensure().schedule(e));for(var n=e.first;n!==null;){var r=n.next,o=(n.f&Ue)!==0||(n.f&pe)!==0;Mo(n,o?t:!1),n=r}var i=e.nodes&&e.nodes.t;if(i!==null)for(const s of i)(s.is_global||t)&&s.in()}}function No(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var o=n===r?null:Jt(n);t.append(n),n=o}}let ln=!1,Ke=!1;function Fr(e){Ke=e}let k=null,Fe=!1;function Ie(e){k=e}let R=null;function He(e){R=e}let Te=null;function Oo(e){k!==null&&(Te??(Te=new Set)).add(e)}let $=null,ee=0,se=null;function Ll(e){se=e}let Wo=1,Ye=0,Qe=Ye;function Vr(e){Qe=e}function Fo(){return++Wo}function $t(e){var t=e.f;if((t&U)!==0)return!0;if(t&G&&(e.f&=~$e),(t&we)!==0){for(var n=e.deps,r=n.length,o=0;o<r;o++){var i=n[o];if($t(i)&&vo(i),i.wv>e.wv)return!0}(t&ue)!==0&&z===null&&V(e,H)}return!1}function Vo(e,t,n=!0){var r=e.reactions;if(r!==null&&!(Te!==null&&Te.has(e)))for(var o=0;o<r.length;o++){var i=r[o];(i.f&G)!==0?Vo(i,t,!1):t===i&&(n?V(i,U):(i.f&H)!==0&&V(i,we),cr(i))}}function jo(e){var m;var t=$,n=ee,r=se,o=k,i=Te,s=fe,l=Fe,u=Qe,c=e.f;$=null,ee=0,se=null,k=(c&(pe|Be))===0?e:null,Te=null,hn(e.ctx),Fe=!1,Qe=++Ye,e.ac!==null&&(Zt(()=>{e.ac.abort(Xt)}),e.ac=null);try{e.f|=pn;var f=e.fn,p=f();e.f|=Et;var a=e.deps,d=L==null?void 0:L.is_fork;if($!==null){var y;if(d||Kt(e,ee),a!==null&&ee>0)for(a.length=ee+$.length,y=0;y<$.length;y++)a[ee+y]=$[y];else e.deps=a=$;if(Io()&&(e.f&ue)!==0)for(y=ee;y<a.length;y++)((m=a[y]).reactions??(m.reactions=[])).push(e)}else!d&&a!==null&&ee<a.length&&(Kt(e,ee),a.length=ee);if(fo()&&se!==null&&!Fe&&a!==null&&(e.f&(G|we|U))===0)for(y=0;y<se.length;y++)Vo(se[y],e);if(o!==null&&o!==e){if(Ye++,o.deps!==null)for(let h=0;h<n;h+=1)o.deps[h].rv=Ye;if(t!==null)for(const h of t)h.rv=Ye;se!==null&&(r===null?r=se:r.push(...se))}return(e.f&Ve)!==0&&(e.f^=Ve),p}catch(h){return ll(h)}finally{e.f^=pn,$=t,ee=n,se=r,k=o,Te=i,hn(s),Fe=l,Qe=u}}function Rl(e,t){let n=t.reactions;if(n!==null){var r=Ns.call(n,e);if(r!==-1){var o=n.length-1;o===0?n=t.reactions=null:(n[r]=n[o],n.pop())}}if(n===null&&(t.f&G)!==0&&($===null||!fn.call($,t))){var i=t;(i.f&ue)!==0&&(i.f^=ue,i.f&=~$e),i.v!==B&&sr(i),i.ac!==null&&Zt(()=>{i.ac.abort(Xt),i.ac=null,V(i,U)}),gl(i),Kt(i,0)}}function Kt(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)Rl(e,n[r])}function At(e){var t=e.f;if((t&ce)===0){V(e,H);var n=R,r=ln;R=e,ln=(t&(pe|Be))===0;try{(t&(be|or))!==0?Pl(e):pr(e),Lo(e);var o=jo(e);e.teardown=typeof o=="function"?o:null,e.wv=Wo;var i;so&&il&&(e.f&U)!==0&&e.deps}finally{ln=r,R=n}}}function g(e){var t=e.f,n=(t&G)!==0;if(k!==null&&!Fe){var r=R!==null&&(R.f&ce)!==0;if(!r&&(Te===null||!Te.has(e))){var o=k.deps;if((k.f&pn)!==0)e.rv<Ye&&(e.rv=Ye,$===null&&o!==null&&o[ee]===e?ee++:$===null?$=[e]:$.push(e));else{k.deps??(k.deps=[]),fn.call(k.deps,e)||k.deps.push(e);var i=e.reactions;i===null?e.reactions=[k]:fn.call(i,k)||i.push(k)}}}if(Ke&&Je.has(e))return Je.get(e);if(n){var s=e;if(Ke){var l=s.v;return((s.f&H)===0&&s.reactions!==null||Uo(s))&&(l=ar(s)),Je.set(s,l),l}var u=(s.f&ue)===0&&!Fe&&k!==null&&(ln||(k.f&ue)!==0),c=(s.f&Et)===0;$t(s)&&(u&&(s.f|=ue),vo(s)),u&&!c&&(yo(s),Bo(s))}if(z!=null&&z.has(e))return z.get(e);if((e.f&Ve)!==0)throw e.v;return e.v}function Bo(e){if(e.f|=ue,e.deps!==null)for(const t of e.deps)(t.reactions??(t.reactions=[])).push(e),(t.f&G)!==0&&(t.f&ue)===0&&(yo(t),Bo(t))}function Uo(e){if(e.v===B)return!0;if(e.deps===null)return!1;for(const t of e.deps)if(Je.has(t)||(t.f&G)!==0&&Uo(t))return!0;return!1}const ze=Symbol("events"),xl=new Set,Ml=new Set;function Nl(e,t,n,r={}){function o(i){if(r.capture||Fl.call(t,i),!i.cancelBubble)return Zt(()=>n==null?void 0:n.call(this,i))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?Vt(()=>{t.addEventListener(e,o,r)}):t.addEventListener(e,o,r),o}function Ol(e,t,n){(t[ze]??(t[ze]={}))[e]=n}function Wl(e){for(var t=0;t<e.length;t++)xl.add(e[t]);for(var n of Ml)n(e)}let jr=null;function Fl(e){var m,h;var t=this,n=t.ownerDocument,r=e.type,o=((m=e.composedPath)==null?void 0:m.call(e))||[],i=o[0]||e.target;jr=e;var s=0,l=jr===e&&e[ze];if(l){var u=o.indexOf(l);if(u!==-1&&(t===document||t===window)){e[ze]=t;return}var c=o.indexOf(t);if(c===-1)return;u<=c&&(s=u)}if(i=o[s]||e.target,i!==t){Os(e,"currentTarget",{configurable:!0,get(){return i||n}});var f=k,p=R;Ie(null),He(null);try{for(var a,d=[];i!==null&&i!==t;){try{var y=(h=i[ze])==null?void 0:h[r];y!=null&&(!i.disabled||e.target===i)&&y.call(i,e)}catch(_){a?d.push(_):a=_}if(e.cancelBubble)break;s++,i=s<o.length?o[s]:null}if(a){for(let _ of d)queueMicrotask(()=>{throw _});throw a}}finally{e[ze]=t,delete e.currentTarget,Ie(f),He(p)}}}var ro;const Bn=((ro=globalThis==null?void 0:globalThis.window)==null?void 0:ro.trustedTypes)&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:e=>e});function Vl(e){return(Bn==null?void 0:Bn.createHTML(e))??e}function jl(e){var t=To("template");return t.innerHTML=Vl(e.replaceAll("<!>","<!---->")),t.content}function Ht(e,t){var n=R;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function Pe(e,t){var n=(t&Ls)!==0,r=(t&Rs)!==0,o,i=!e.startsWith("<!>");return()=>{o===void 0&&(o=jl(i?e:"<!>"+e),n||(o=mn(o)));var s=r||Cl?document.importNode(o,!0):o.cloneNode(!0);if(n){var l=mn(s),u=s.lastChild;Ht(l,u)}else Ht(s,s);return s}}function gr(e=""){{var t=je(e+"");return Ht(t,t),t}}function ie(){var e=document.createDocumentFragment(),t=document.createComment(""),n=je();return e.append(t,n),Ht(t,n),e}function M(e,t){e!==null&&e.before(t)}function Bl(e){return e.endsWith("capture")&&e!=="gotpointercapture"&&e!=="lostpointercapture"}const Ul=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function Kl(e){return Ul.includes(e)}const Hl={formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly",defaultvalue:"defaultValue",defaultchecked:"defaultChecked",srcobject:"srcObject",novalidate:"noValidate",allowfullscreen:"allowFullscreen",disablepictureinpicture:"disablePictureInPicture",disableremoteplayback:"disableRemotePlayback"};function Gl(e){return e=e.toLowerCase(),Hl[e]??e}function En(e,t){var n=t==null?"":typeof t=="object"?`${t}`:t;n!==(e[rn]??(e[rn]=e.nodeValue))&&(e[rn]=n,e.nodeValue=`${n}`)}var me,Se,te,Ze,zt,qt,An;class Tn{constructor(t,n=!0){ge(this,"anchor");F(this,me,new Map);F(this,Se,new Map);F(this,te,new Map);F(this,Ze,new Set);F(this,zt,!0);F(this,qt,t=>{if(v(this,me).has(t)){var n=v(this,me).get(t),r=v(this,Se).get(n);if(r)_n(r),v(this,Ze).delete(n);else{var o=v(this,te).get(n);o&&(_n(o.effect),v(this,Se).set(n,o.effect),v(this,te).delete(n),o.fragment.lastChild.remove(),this.anchor.before(o.fragment),r=o.effect)}for(const[i,s]of v(this,me)){if(v(this,me).delete(i),i===t)break;const l=v(this,te).get(s);l&&(de(l.effect),v(this,te).delete(s))}for(const[i,s]of v(this,Se)){if(i===n||v(this,Ze).has(i))continue;const l=()=>{if(Array.from(v(this,me).values()).includes(i)){var c=document.createDocumentFragment();No(s,c),c.append(je()),v(this,te).set(i,{effect:s,fragment:c})}else de(s);v(this,Ze).delete(i),v(this,Se).delete(i)};v(this,zt)||!r?(v(this,Ze).add(i),hr(s,l,!1)):l()}}});F(this,An,t=>{v(this,me).delete(t);const n=Array.from(v(this,me).values());for(const[r,o]of v(this,te))n.includes(r)||(de(o.effect),v(this,te).delete(r))});this.anchor=t,J(this,zt,n)}ensure(t,n){var r=L,o=Eo();if(n&&!v(this,Se).has(t)&&!v(this,te).has(t))if(o){var i=document.createDocumentFragment(),s=je();i.append(s),v(this,te).set(t,{effect:et(()=>n(s)),fragment:i})}else v(this,Se).set(t,et(()=>n(this.anchor)));if(v(this,me).set(r,t),o){for(const[l,u]of v(this,Se))l===t?r.unskip_effect(u):r.skip_effect(u);for(const[l,u]of v(this,te))l===t?r.unskip_effect(u.effect):r.skip_effect(u.effect);r.oncommit(v(this,qt)),r.ondiscard(v(this,An))}else v(this,qt).call(this,r)}}me=new WeakMap,Se=new WeakMap,te=new WeakMap,Ze=new WeakMap,zt=new WeakMap,qt=new WeakMap,An=new WeakMap;function vr(e,t,...n){var r=new Tn(e);Qt(()=>{const o=t()??null;r.ensure(o,o&&(i=>o(i,...n)))},Ue)}function De(e,t,n=!1){var r=new Tn(e),o=n?Ue:0;function i(s,l){r.ensure(s,l)}Qt(()=>{var s=!1;t((l,u=0)=>{s=!0,i(u,l)}),s||i(-1,null)},o)}function Yl(e,t,n){for(var r=[],o=t.length,i,s=t.length,l=0;l<o;l++){let p=t[l];hr(p,()=>{if(i){if(i.pending.delete(p),i.done.add(p),i.pending.size===0){var a=e.outrogroups;Jn(e,nr(i.done)),a.delete(i),a.size===0&&(e.outrogroups=null)}}else s-=1},!1)}if(s===0){var u=r.length===0&&n!==null&&e.pending.size===0;if(u){var c=n,f=c.parentNode;El(f),f.append(c),e.items.clear()}Jn(e,t,!u)}else i={pending:new Set(t),done:new Set},(e.outrogroups??(e.outrogroups=new Set)).add(i)}function Jn(e,t,n=!0){var r;if(e.pending.size>0){r=new Set;for(const s of e.pending.values())for(const l of s)r.add(e.items.get(l).e)}for(var o=0;o<t.length;o++){var i=t[o];if(r!=null&&r.has(i)){i.f|=Ee;const s=document.createDocumentFragment();No(i,s)}else de(t[o],n)}}var Br;function bn(e,t,n,r,o,i=null){var s=e,l=new Map,u=(t&oo)!==0;if(u){var c=e;s=c.appendChild(je())}var f=null,p=pl(()=>{var P=n();return tr(P)?P:P==null?[]:nr(P)}),a,d=new Map,y=!0;function m(P){(A.effect.f&ce)===0&&(A.pending.delete(P),A.fallback=f,zl(A,a,s,t,r),f!==null&&(a.length===0?(f.f&Ee)===0?_n(f):(f.f^=Ee,Mt(f,null,s)):hr(f,()=>{f=null})))}function h(P){A.pending.delete(P)}var _=Qt(()=>{a=g(p);for(var P=a.length,C=new Set,w=L,S=Eo(),E=0;E<P;E+=1){var b=a[E],I=r(b,E),T=y?null:l.get(I);T?(T.v&&Ut(T.v,b),T.i&&Ut(T.i,E),S&&w.unskip_effect(T.e)):(T=ql(l,y?s:Br??(Br=je()),b,I,E,o,t,n),y||(T.e.f|=Ee),l.set(I,T)),C.add(I)}if(P===0&&i&&!f&&(y?f=et(()=>i(s)):(f=et(()=>i(Br??(Br=je()))),f.f|=Ee)),P>C.size&&qs(),!y)if(d.set(w,C),S){for(const[N,Y]of l)C.has(N)||w.skip_effect(Y.e);w.oncommit(m),w.ondiscard(h)}else m(w);g(p)}),A={effect:_,items:l,pending:d,outrogroups:null,fallback:f};y=!1}function Dt(e){for(;e!==null&&(e.f&pe)===0;)e=e.next;return e}function zl(e,t,n,r,o){var T,N,Y,O,X,it,tn,Le,st;var i=(r&Ps)!==0,s=t.length,l=e.items,u=Dt(e.effect.first),c,f=null,p,a=[],d=[],y,m,h,_;if(i)for(_=0;_<s;_+=1)y=t[_],m=o(y,_),h=l.get(m).e,(h.f&Ee)===0&&((N=(T=h.nodes)==null?void 0:T.a)==null||N.measure(),(p??(p=new Set)).add(h));for(_=0;_<s;_+=1){if(y=t[_],m=o(y,_),h=l.get(m).e,e.outrogroups!==null)for(const he of e.outrogroups)he.pending.delete(h),he.done.delete(h);if((h.f&Z)!==0&&(_n(h),i&&((O=(Y=h.nodes)==null?void 0:Y.a)==null||O.unfix(),(p??(p=new Set)).delete(h))),(h.f&Ee)!==0)if(h.f^=Ee,h===u)Mt(h,null,n);else{var A=f?f.next:u;h===e.effect.last&&(e.effect.last=h.prev),h.prev&&(h.prev.next=h.next),h.next&&(h.next.prev=h.prev),Oe(e,f,h),Oe(e,h,A),Mt(h,A,n),f=h,a=[],d=[],u=Dt(f.next);continue}if(h!==u){if(c!==void 0&&c.has(h)){if(a.length<d.length){var P=d[0],C;f=P.prev;var w=a[0],S=a[a.length-1];for(C=0;C<a.length;C+=1)Mt(a[C],P,n);for(C=0;C<d.length;C+=1)c.delete(d[C]);Oe(e,w.prev,S.next),Oe(e,f,w),Oe(e,S,P),u=P,f=S,_-=1,a=[],d=[]}else c.delete(h),Mt(h,u,n),Oe(e,h.prev,h.next),Oe(e,h,f===null?e.effect.first:f.next),Oe(e,f,h),f=h;continue}for(a=[],d=[];u!==null&&u!==h;)(c??(c=new Set)).add(u),d.push(u),u=Dt(u.next);if(u===null)continue}(h.f&Ee)===0&&a.push(h),f=h,u=Dt(h.next)}if(e.outrogroups!==null){for(const he of e.outrogroups)he.pending.size===0&&(Jn(e,nr(he.done)),(X=e.outrogroups)==null||X.delete(he));e.outrogroups.size===0&&(e.outrogroups=null)}if(u!==null||c!==void 0){var E=[];if(c!==void 0)for(h of c)(h.f&Z)===0&&E.push(h);for(;u!==null;)(u.f&Z)===0&&u!==e.fallback&&E.push(u),u=Dt(u.next);var b=E.length;if(b>0){var I=(r&oo)!==0&&s===0?n:null;if(i){for(_=0;_<b;_+=1)(tn=(it=E[_].nodes)==null?void 0:it.a)==null||tn.measure();for(_=0;_<b;_+=1)(st=(Le=E[_].nodes)==null?void 0:Le.a)==null||st.fix()}Yl(e,E,I)}}i&&Vt(()=>{var he,nn;if(p!==void 0)for(h of p)(nn=(he=h.nodes)==null?void 0:he.a)==null||nn.apply()})}function ql(e,t,n,r,o,i,s,l){var u=(s&Is)!==0?(s&ks)===0?_l(n,!1,!1):Bt(n):null,c=(s&Ds)!==0?Bt(o):null;return{v:u,i:c,e:et(()=>(i(t,u??n,c??o,l),()=>{e.delete(r)}))}}function Mt(e,t,n){if(e.nodes)for(var r=e.nodes.start,o=e.nodes.end,i=t&&(t.f&Ee)===0?t.nodes.start:n;r!==null;){var s=Jt(r);if(i.before(r),r===o)return;r=s}}function Oe(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}function Un(e,t,n){var r=new Tn(e);Qt(()=>{var o=t()??null;r.ensure(o,o&&(i=>n(i,o)))},Ue)}function yr(e,t,n,r,o,i){var s=null,l=e,u=new Tn(l,!1);Qt(()=>{const c=t()||null;var f=c==="svg"?xs:void 0;if(c===null){u.ensure(null,null);return}return u.ensure(c,p=>{if(c){if(s=To(c,f),Ht(s,s),r){var a=null,d=s.appendChild(je());r(s,d),a==null||a.remove()}R.nodes.end=s,p.before(s)}}),()=>{}},Ue),fr(()=>{})}function Xl(e,t){var n=void 0,r;ko(()=>{n!==(n=t())&&(r&&(de(r),r=null),n&&(r=et(()=>{Po(()=>n(e))})))})}function Ko(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Ko(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Zl(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Ko(e))&&(r&&(r+=" "),r+=t);return r}function Gt(e){return typeof e=="object"?Zl(e):e??""}const Ur=[...`
|
|
2
|
-
\r\f \v\uFEFF`];function Jl(e,t,n){var r=e==null?"":""+e;if(n){for(var o of Object.keys(n))if(n[o])r=r?r+" "+o:o;else if(r.length)for(var i=o.length,s=0;(s=r.indexOf(o,s))>=0;){var l=s+i;(s===0||Ur.includes(r[s-1]))&&(l===r.length||Ur.includes(r[l]))?r=(s===0?"":r.substring(0,s))+r.substring(l+1):s=l}}return r===""?null:r}function Kr(e,t=!1){var n=t?" !important;":";",r="";for(var o of Object.keys(e)){var i=e[o];i!=null&&i!==""&&(r+=" "+o+": "+i+n)}return r}function Kn(e){return e[0]!=="-"||e[1]!=="-"?e.toLowerCase():e}function Ql(e,t){if(t){var n="",r,o;if(Array.isArray(t)?(r=t[0],o=t[1]):r=t,e){e=String(e).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var i=!1,s=0,l=!1,u=[];r&&u.push(...Object.keys(r).map(Kn)),o&&u.push(...Object.keys(o).map(Kn));var c=0,f=-1;const m=e.length;for(var p=0;p<m;p++){var a=e[p];if(l?a==="/"&&e[p-1]==="*"&&(l=!1):i?i===a&&(i=!1):a==="/"&&e[p+1]==="*"?l=!0:a==='"'||a==="'"?i=a:a==="("?s++:a===")"&&s--,!l&&i===!1&&s===0){if(a===":"&&f===-1)f=p;else if(a===";"||p===m-1){if(f!==-1){var d=Kn(e.substring(c,f).trim());if(!u.includes(d)){a!==";"&&p++;var y=e.substring(c,p).trim();n+=" "+y+";"}}c=p+1,f=-1}}}}return r&&(n+=Kr(r)),o&&(n+=Kr(o,!0)),n=n.trim(),n===""?null:n}return e==null?null:String(e)}function St(e,t,n,r,o,i){var s=e[xr];if(s!==n||s===void 0){var l=Jl(n,r,i);l==null?e.removeAttribute("class"):t?e.className=l:e.setAttribute("class",l),e[xr]=n}else if(i&&o!==i)for(var u in i){var c=!!i[u];(o==null||c!==!!o[u])&&e.classList.toggle(u,c)}return i}function Hn(e,t={},n,r){for(var o in n){var i=n[o];t[o]!==i&&(n[o]==null?e.style.removeProperty(o):e.style.setProperty(o,i,r))}}function ne(e,t,n,r){var o=e[Mr];if(o!==t){var i=Ql(t,r);i==null?e.removeAttribute("style"):e.style.cssText=i,e[Mr]=t}else r&&(Array.isArray(r)?(Hn(e,n==null?void 0:n[0],r[0]),Hn(e,n==null?void 0:n[1],r[1],"important")):Hn(e,n,r));return r}function Qn(e,t,n=!1){if(e.multiple){if(t==null)return;if(!tr(t))return rl();for(var r of e.options)r.selected=t.includes(Hr(r));return}for(r of e.options){var o=Hr(r);if(wl(o,t)){r.selected=!0;return}}(!n||t!==void 0)&&(e.selectedIndex=-1)}function $l(e){var t=new MutationObserver(()=>{"__value"in e&&Qn(e,e.__value)});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),fr(()=>{t.disconnect()})}function Hr(e){return"__value"in e?e.__value:e.value}const Pt=Symbol("class"),kt=Symbol("style"),Ho=Symbol("is custom element"),Go=Symbol("is html"),ea=ir?"input":"INPUT",ta=ir?"option":"OPTION",na=ir?"select":"SELECT";function ra(e,t){t?e.hasAttribute("selected")||e.setAttribute("selected",""):e.removeAttribute("selected")}function ht(e,t,n,r){var o=Yo(e);o[t]!==(o[t]=n)&&(t==="loading"&&(e[Ys]=n),n==null?e.removeAttribute(t):typeof n!="string"&&zo(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function oa(e,t,n,r,o=!1,i=!1){var s=Yo(e),l=s[Ho],u=!s[Go],c=t||{},f=e.nodeName===ta;for(var p in t)p in n||(n[p]=null);n.class?n.class=Gt(n.class):n[Pt]&&(n.class=null),n[kt]&&(n.style??(n.style=null));var a=zo(e);if(e.nodeName===ea&&"type"in n&&("value"in n||"__value"in n)){var d=n.type;(d!==c.type||d===void 0&&e.hasAttribute("type"))&&(c.type=d,ht(e,"type",d))}for(const C in n){let w=n[C];if(f&&C==="value"&&w==null){e.value=e.__value="",c[C]=w;continue}if(C==="class"){var y=e.namespaceURI==="http://www.w3.org/1999/xhtml";St(e,y,w,r,t==null?void 0:t[Pt],n[Pt]),c[C]=w,c[Pt]=n[Pt];continue}if(C==="style"){ne(e,w,t==null?void 0:t[kt],n[kt]),c[C]=w,c[kt]=n[kt];continue}var m=c[C];if(!(w===m&&!(w===void 0&&e.hasAttribute(C)))){c[C]=w;var h=C[0]+C[1];if(h!=="$$")if(h==="on"){const S={},E="$$"+C;let b=C.slice(2);var _=Kl(b);if(Bl(b)&&(b=b.slice(0,-7),S.capture=!0),!_&&m){if(w!=null)continue;e.removeEventListener(b,c[E],S),c[E]=null}if(_)Ol(b,e,w),Wl([b]);else if(w!=null){let I=function(T){c[C].call(this,T)};c[E]=Nl(b,e,I,S)}}else if(C==="style")ht(e,C,w);else if(C==="autofocus")cl(e,!!w);else if(!l&&(C==="__value"||C==="value"&&w!=null))e.value=e.__value=w;else if(C==="selected"&&f)ra(e,w);else{var A=C;u||(A=Gl(A));var P=A==="defaultValue"||A==="defaultChecked";if(w==null&&!l&&!P)if(s[C]=null,A==="value"||A==="checked"){let S=e;const E=t===void 0;if(A==="value"){let b=S.defaultValue;S.removeAttribute(A),S.defaultValue=b,S.value=S.__value=E?b:null}else{let b=S.defaultChecked;S.removeAttribute(A),S.defaultChecked=b,S.checked=E?b:!1}}else e.removeAttribute(C);else P||a.includes(A)&&(l||typeof w!="string")?(e[A]=w,A in s&&(s[A]=B)):typeof w!="function"&&ht(e,A,w)}}}return c}function ia(e,t,n=[],r=[],o=[],i,s=!1,l=!1){ho(o,n,r,u=>{var c=void 0,f={},p=e.nodeName===na,a=!1;if(ko(()=>{var y=t(...u.map(g)),m=oa(e,c,y,i,s,l);a&&p&&"value"in y&&Qn(e,y.value);for(let _ of Object.getOwnPropertySymbols(f))y[_]||de(f[_]);for(let _ of Object.getOwnPropertySymbols(y)){var h=y[_];_.description===Ms&&(!c||h!==c[_])&&(f[_]&&de(f[_]),f[_]=et(()=>Xl(e,()=>h))),m[_]=h}c=m}),p){var d=e;Po(()=>{Qn(d,c.value,!0),$l(d)})}a=!0})}function Yo(e){return e[Wn]??(e[Wn]={[Ho]:e.nodeName.includes("-"),[Go]:e.namespaceURI===io})}var Gr=new Map;function zo(e){var t=e.getAttribute("is")||e.nodeName,n=Gr.get(t);if(n)return n;Gr.set(t,n=[]);for(var r,o=e,i=Element.prototype;i!==o;){r=Ws(o);for(var s in r)r[s].set&&s!=="innerHTML"&&s!=="textContent"&&s!=="innerText"&&n.push(s);o=lo(o)}return n}const sa={get(e,t){let n=e.props.length;for(;n--;){let r=e.props[n];if(It(r)&&(r=r()),typeof r=="object"&&r!==null&&t in r)return r[t]}},set(e,t,n){let r=e.props.length;for(;r--;){let o=e.props[r];It(o)&&(o=o());const i=Ot(o,t);if(i&&i.set)return i.set(n),!0}return!1},getOwnPropertyDescriptor(e,t){let n=e.props.length;for(;n--;){let r=e.props[n];if(It(r)&&(r=r()),typeof r=="object"&&r!==null&&t in r){const o=Ot(r,t);return o&&!o.configurable&&(o.configurable=!0),o}}},has(e,t){if(t===pt||t===Gs)return!1;for(let n of e.props)if(It(n)&&(n=n()),n!=null&&t in n)return!0;return!1},ownKeys(e){const t=[];for(let n of e.props)if(It(n)&&(n=n()),!!n){for(const r in n)t.includes(r)||t.push(r);for(const r of Object.getOwnPropertySymbols(n))t.includes(r)||t.push(r)}return t}};function Gn(...e){return new Proxy({props:e},sa)}function ae(e,t,n,r){var o=r,i=!0,s=()=>(i&&(i=!1,o=r),o),l;l=e[t],l===void 0&&r!==void 0&&(l=s());var u;return u=()=>{var c=e[t];return c===void 0?s():(i=!0,c)},u}const Tt="default";function mr(e,t){return!(e!=null&&e.length)||e===Tt?t:`${e}/${t}`}const la=`RuleCMS widget: this widget config uses components from the default component library, but no "default" library is registered. The default library is registered by the consumer app: add the RuleCMS default source components package as a direct dependency and register it, e.g. libraries: { default: sourceComponentsModule } (statically imported for SSR) or libraries: { default: () => import('<default source components package>') }. See the @rulecms/widget-svelte README.`;function Yr(e){if(!e||typeof e!="object")return!1;const t=e;return!!t.manifest&&typeof t.manifest=="object"&&!!t.components&&typeof t.components=="object"&&!Array.isArray(t.components)}function aa(e){if(Yr(e))return e;const t=e;return Yr(t==null?void 0:t.default)?t.default:null}function Yn(e){return e.usesDefaultLibrary?[Tt,...e.libraryIds]:[...e.libraryIds]}function zr({registrations:e,referenced:t}){if(t.usesDefaultLibrary&&!(e!=null&&e[Tt]))throw new Error(la)}function ua(e){const t=[],n=new Set;for(const r of e.values()){if(typeof r.stylesheet!="string")continue;const o=r.stylesheet.trim();!o||n.has(o)||(n.add(o),t.push(o))}return t.length>0?t:void 0}function qo(e){const t={};for(const[r,o]of e){const i=r===Tt;for(const[s,l]of Object.entries(o.components))t[i?s:`${r}/${s}`]=l}const n=ua(e);return n?{components:t,stylesheets:n}:{components:t}}function en(){const e=new Map,t=new Map,n=new Map,r=new Map;let o=0;function i(c,f){var p;e.get(c)!==f&&((p=f.manifest)!=null&&p.id&&f.manifest.id!==c&&console.warn(`RuleCMS widget: component library registered as "${c}" declares manifest id "${f.manifest.id}". The registered id wins for resolution.`),e.set(c,f),o+=1)}function s(c){const f=Yn(c),p=[...f].sort().join("|"),a=r.get(p);if(a&&a.loadedVersion===o)return a.plugin;const d=new Map;for(const m of f){const h=e.get(m);h&&d.set(m,h)}const y=qo(d);return r.set(p,{loadedVersion:o,plugin:y}),y}function l(c){zr(c);const{registrations:f,referenced:p}=c;for(const a of Yn(p)){if(e.has(a)||n.has(a))continue;const d=f==null?void 0:f[a];if(!d){console.error(`RuleCMS widget: no component library registered for libraryId "${a}"; its components will not render.`),n.set(a,new Error(`No registration for libraryId "${a}"`));continue}if(typeof d=="function")return null;i(a,d)}return s(p)}async function u(c){zr(c);const{registrations:f,referenced:p}=c,a=Yn(p);return await Promise.all(a.map(async d=>{if(e.has(d)||n.has(d))return;const y=f==null?void 0:f[d];if(!y){console.error(`RuleCMS widget: no component library registered for libraryId "${d}"; its components will not render.`),n.set(d,new Error(`No registration for libraryId "${d}"`));return}if(typeof y!="function"){i(d,y);return}let m=t.get(d);m||(m=y().then(h=>{const _=aa(h);if(!_)throw new Error(`Registration for libraryId "${d}" did not resolve to a ComponentLibraryModule (expected { manifest, components }).`);i(d,_)}).catch(h=>{n.set(d,h),console.error(`RuleCMS widget: failed to load component library "${d}":`,h)}).finally(()=>{t.delete(d)}),t.set(d,m)),await m})),s(p)}return{resolveSync:l,resolve:u}}const ca={Preview:"Preview",Compose:"Compose",RenderedPage:"RenderedPage"},In={DroppableBox:"droppable-box"},$n={FlexStart:"flex-start",FlexEnd:"flex-end",Center:"center",SpaceBetween:"space-between",SpaceAround:"space-around",SpaceEvenly:"space-evenly"},fa={FlexStart:"flex-start",FlexEnd:"flex-end",Center:"center",SpaceBetween:"space-between",SpaceAround:"space-around",SpaceEvenly:"space-evenly",Stretch:"stretch"},an="cssAttrArray",da={Phone:"phone",Tablet:"tablet",Desktop:"desktop"},_r={ComposerComponent:"ComposerWidget",Collection:"Collection",MoveComponentHandle:"MoveWidgetHandle"},br=`${_r.Collection}_`,Xo="dev.",Zo="https://rulecms.com",Jo="https://widget-cache.rulecms.com",Qo="/api/v1/c/widget/get",$o="/api/v1/c/dev/widget/get";function tt(e){return typeof e=="string"&&e.startsWith(Xo)}function ei(e,t){return t?t.replace(/\/$/,""):tt(e)?Zo:Jo}function wr({publishedKey:e,token:t,endpoint:n}){const r=tt(t),o=r?$o:Qo,i=r?new URLSearchParams({widgetKey:e,token:t}):new URLSearchParams({publishedKey:e,token:t});return`${ei(t,n)}${o}?${i.toString()}`}const pa=({id:e,prefix:t})=>`${t}_${e}`,ti=e=>{if(!(e!=null&&e.length)||!e.includes("_")){console.error(`Invalid drag item id: ${e}. Type does not exist.`);return}return ni(e)},Cr=e=>e.includes("_"),ni=e=>{const t=e.indexOf("_"),n=e.substring(0,t),r=e.substring(t+1);return{prefix:n,id:r}},Ar=e=>{if(!Cr(e))return;const n=ti(e);return(n==null?void 0:n.prefix)===_r.Collection||console.error("getCollectionIdForCollectionType - Invalid component type: ${componentType}. Invalid prefix type."),n==null?void 0:n.id},ha=e=>{if(!(e!=null&&e.length)){console.error("getNameAndInstanceIdFromWidgetKey: Missing widget key");return}const t=e.split("$");if(t.length<2){console.error("getNameAndInstanceIdFromWidgetKey: Invalid widget key format");return}const n=t[0];if(!t[1].includes("@"))return{name:n,instanceId:t[1]};const o=t[1].split("@");return{name:n,instanceId:o[0],parentId:o[1]}},ga=e=>{if(!(e!=null&&e.length))return{errorMessage:"getNameFromWidgetKey: Missing widget key"};const t=e.split("$");return t.length<2?{errorMessage:"getNameFromWidgetKey: Invalid widget key format"}:{name:t[0]}},ri=e=>{var o,i,s,l;if(!e)return{error:"getWidgetKeyForCollection: Missing collection"};if(!((o=e.name)!=null&&o.length))return{error:"getWidgetKeyForCollection: Missing collection name"};const t=(i=e.name)==null?void 0:i.trim().toLowerCase();if(!((s=e.id)!=null&&s.length))return{error:"getWidgetKeyForCollection: Missing collection id"};const r=((l=e.parentId)==null?void 0:l.length)?`${e.id}@${e.parentId}`:`${e.id}`;return{data:`${t}$${r}`}},oi=e=>{var o,i,s,l;if(!e)return{error:"getWidgetKeyForPublishedCollection: Missing collection"};if(!((o=e.name)!=null&&o.length))return{error:"getWidgetKeyForPublishedCollection: Missing collection name"};const t=(i=e.name)==null?void 0:i.trim().toLowerCase();if(!((s=e.publishedKey)!=null&&s.length))return{error:"getWidgetKeyForPublishedCollection: Missing collection publishedKey"};const r=((l=e.parentId)==null?void 0:l.length)?`${e.publishedKey}@${e.parentId}`:`${e.publishedKey}`;return{data:`${t}$${r}`}},va=e=>{const t=ri(e);return`${br}${t.data}`},ya=e=>{const t=oi(e);return`${br}${t.data}`},ii="---",si="___";function li(e,t){return`${e}${ii}${t}`}function ma(e,t,n){return`${li(e,t)}${si}${n}`}function _a(e){const t=e.split(".");if(t.length!==3)throw new Error(`Invalid version format: ${e}. Expected format: x.y.z`);const n=t[0],r=t[1],o=parseInt(t[2],10);if(isNaN(o))throw new Error(`Invalid patch version: ${t[2]}. Expected a number.`);return`${n}.${r}.${o+1}`}function Dn({displayItemList:e,widgetCollections:t}){const n=new Set;let r=!1;const o=i=>{var s,l,u;if((s=i==null?void 0:i.rows)!=null&&s.length){for(const c of i.rows)if((l=c==null?void 0:c.columns)!=null&&l.length)for(const f of c.columns)f.collection&&o(f.collection.collectionRows),!(!f.type||f.type===In.DroppableBox)&&(Cr(f.type)||(!((u=f.libraryId)!=null&&u.length)||f.libraryId===Tt?r=!0:n.add(f.libraryId)))}};o(e);for(const i of Object.values(t??{}))o(i==null?void 0:i.collectionRows);return{libraryIds:Array.from(n),usesDefaultLibrary:r}}const Sr=Symbol("rulecms-widget-context");function ba(){return{token:"",endpoint:void 0,libraries:void 0,libraryRegistry:en()}}function wa(e,t){Me(t,!0);const n=ft(ba());dr(()=>{n.token=t.token,n.endpoint=t.endpoint,n.libraries=t.libraries}),zn.setContext(Sr,n);var r=ie(),o=q(r);vr(o,()=>t.children),M(e,r),Ne()}const ai="1200px",Er="500px",Tr="820px",Ca=ai,ui="rulecms",Aa=1920,Sa={f:"auto",q:"auto",c:"limit"},Ea=/^[A-Za-z0-9][A-Za-z0-9._\-/]*$/,Ta=300,Ia=/^[A-Za-z0-9][A-Za-z0-9_-]*$/,Da=100,Pa=/^https:\/\/[^\s"'()\\<>]+$/,ka=2e3,La=/^[A-Za-z0-9_,.:\-/]*$/,Ra=300,ci=e=>typeof e=="string"&&e.length<=Ta&&Ea.test(e),fi=e=>typeof e=="string"&&e.length<=Da&&Ia.test(e),di=e=>typeof e=="string"&&e.length<=ka&&Pa.test(e),pi=e=>typeof e=="string"&&e.length<=Ra&&La.test(e),xa=e=>Object.entries(e).map(([t,n])=>`${t}_${n}`).join(","),Ma=e=>{const t={};for(const n of e.split(",")){const r=n.trim(),o=r.indexOf("_");o<=0||(t[r.slice(0,o)]=r.slice(o+1))}return t},hi=({publicId:e,cloudName:t=ui,transformations:n,width:r=Aa})=>{const o=typeof n=="string"?Ma(n):n,i={...Sa,...o,w:r};return encodeURI(`https://res.cloudinary.com/${t}/image/upload/${xa(i)}/${e}`)},gi=/^--[A-Za-z0-9_-]+$/,vi=200,Ir=e=>{if(typeof e!="string")return!1;const t=e.trim();return t.length<=vi&&gi.test(t)},Ce=e=>`var(${e.trim()})`,K=e=>{if(typeof e!="object"||e===null||Array.isArray(e))return;const t=e.cssVariable;if(t!=null)return Ir(t)?t.trim():void 0},ke=e=>{if(typeof e!="object"||e===null||Array.isArray(e))return!1;const t=e.cssVariable;return t==null?!1:!Ir(t)},Na=(e,t)=>{const n=K(e);return n?{[t]:Ce(n)}:void 0},yi=e=>{if(typeof e!="object"||e===null||Array.isArray(e)||ke(e))return!1;if(K(e))return!0;const t=e;return t.source==="none"?!0:t.source==="url"?di(t.url):t.source==="cloudinary"?!ci(t.publicId)||t.cloudName!==void 0&&t.cloudName!==null&&!fi(t.cloudName)?!1:t.transformations===void 0||t.transformations===null||pi(t.transformations):!1},mi=["px","%","em","rem","vh","vw"],Pn=["inherit","unset"],_i=["allSides","top","right","bottom","left"],nt=(e,t={})=>{if(typeof e!="object"||e===null||Array.isArray(e))return!1;const n=e;return ke(e)?!1:K(e)?!0:n.unit==="auto"?t.allowAuto!==!1:n.unit==="keyword"?t.allowKeywords!==!1&&Pn.includes(n.keyword):mi.includes(n.unit)?typeof n.value!="number"||!Number.isFinite(n.value)?!1:t.allowNegative!==!1||n.value>=0:!1},bi=(e,t={})=>{if(typeof e!="object"||e===null||Array.isArray(e))return!1;const n=e;for(const r of _i){const o=n[r];if(o!=null&&!nt(o,t))return!1}return!0},Oa=[...Pn,"transparent","currentColor"],Wa=/^(#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})|rgba?\([^)]+\)|hsla?\([^)]+\))$/,kn=e=>{if(typeof e!="object"||e===null||Array.isArray(e))return!1;const t=e;return ke(e)?!1:K(e)?!0:t.unit==="keyword"?Oa.includes(t.keyword):t.unit==="color"?typeof t.value=="string"&&Wa.test(t.value.trim()):!1},Ln=e=>{const t=K(e);return t?Ce(t):"unit"in e?e.unit==="keyword"?e.keyword:e.value.trim():""},wi=(e,t)=>typeof e=="object"&&e!==null&&!Array.isArray(e)?!ke(e)&&!!K(e):typeof e!="string"||!e.length?!1:t.includes(e)?!0:Pn.includes(e),Ci=['system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif','Georgia, "Times New Roman", Times, serif',"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace","Arial, Helvetica, sans-serif",'"Helvetica Neue", Helvetica, Arial, sans-serif',"Verdana, Geneva, sans-serif"],Ai=["normal","bold","100","200","300","400","500","600","700","800","900"],Si=["normal","italic","oblique"],Ei=["left","center","right","justify","start","end"],Ti=["none","underline","line-through","overline"],Ii=["none","uppercase","lowercase","capitalize"],un=["visible","hidden","scroll","auto","clip"],Di=["flex-start","flex-end","center","space-between","space-around","space-evenly"],Pi=["flex-start","flex-end","center","baseline","stretch"],ki=["wrap","nowrap"],Li=["flex-start","flex-end","center","space-between","space-around","space-evenly","stretch"],Ri=["row","row-reverse","column","column-reverse"],xi=["cover","contain","auto"],Mi=["center center","center top","center bottom","left center","left top","left bottom","right center","right top","right bottom"],Ni=["no-repeat","repeat","repeat-x","repeat-y","space","round"],Oi=["justifyContent","alignItems","flexWrap","alignContent","flexDirection"],Wi=["none","solid","dashed","dotted","double","groove","ridge","inset","outset"],Fi=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?!ke(e)&&!!K(e):Wi.includes(e),Vi=e=>{if(typeof e!="object"||e===null||Array.isArray(e))return!1;const t=e;return ke(e)?!1:K(e)?!0:!(t.width!==void 0&&t.width!==null&&!nt(t.width,{allowAuto:!1,allowNegative:!1})||t.style!==void 0&&t.style!==null&&!Fi(t.style)||t.color!==void 0&&t.color!==null&&!kn(t.color))},Fa={allowAuto:!1,allowKeywords:!1,allowNegative:!0},Va={allowAuto:!1,allowKeywords:!1,allowNegative:!1},ji=e=>{if(typeof e!="object"||e===null||Array.isArray(e))return!1;const t=e;if(ke(e))return!1;if(K(e))return!0;for(const n of["offsetX","offsetY","spread"]){const r=t[n];if(r!=null&&!nt(r,Fa))return!1}return!(t.blur!==void 0&&t.blur!==null&&!nt(t.blur,Va)||t.color!==void 0&&t.color!==null&&!kn(t.color)||t.inset!==void 0&&t.inset!==null&&typeof t.inset!="boolean")},Bi=e=>e?e.cssVariable!==void 0&&e.cssVariable!==null||e.offsetX!==void 0||e.offsetY!==void 0||e.blur!==void 0||e.spread!==void 0||e.color!==void 0:!1,Ui=e=>{if(typeof e!="object"||e===null||Array.isArray(e))return!1;const t=e;return ke(e)?!1:K(e)?!0:t.unit==="number"?typeof t.value=="number"&&Number.isFinite(t.value)&&t.value>0:nt(e,{allowAuto:!1,allowNegative:!1})},Ki=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?!ke(e)&&!!K(e):typeof e=="number"&&Number.isFinite(e)&&e>=0&&e<=1,Hi=e=>{if(!yi(e))return{};const t=K(e);if(t)return{backgroundImage:Ce(t)};const n=e;return n.source==="none"?{backgroundImage:"none"}:n.source==="url"?{backgroundImage:`url("${n.url}")`}:{backgroundImage:`url("${hi({publicId:n.publicId,cloudName:n.cloudName,transformations:n.transformations})}")`}},rt=e=>{const t=K(e);return t?Ce(t):"unit"in e?e.unit==="auto"?"auto":e.unit==="keyword"?e.keyword:`${e.value}${e.unit}`:""},Gi=e=>{if(!Vi(e))return{};const t=K(e);if(t)return{border:Ce(t)};const n={};if(e.width&&(n.borderWidth=rt(e.width)),e.style){const r=K(e.style);n.borderStyle=r?Ce(r):e.style}return e.color&&(n.borderColor=Ln(e.color)),n},on=e=>e?rt(e):"0px",Yi=e=>{if(!ji(e)||!Bi(e))return{};const t=K(e);if(t)return{boxShadow:Ce(t)};const n=[on(e.offsetX),on(e.offsetY),on(e.blur),on(e.spread)];return e.color&&n.push(Ln(e.color)),e.inset&&n.unshift("inset"),{boxShadow:n.join(" ")}},ja=e=>`${e.charAt(0).toUpperCase()}${e.slice(1)}`,zi=(e,t)=>{if(!bi(e))return{};if(e.allSides)return{[t]:rt(e.allSides)};const n={};for(const r of["top","right","bottom","left"]){const o=e[r];o&&(n[`${t}${ja(r)}`]=rt(o))}return n},qi=(e,t)=>kn(e)?{[t]:Ln(e)}:{},Xi=(e,t,n)=>{if(!wi(e,n))return{};const r=K(e);return r?{[t]:Ce(r)}:{[t]:e}},Zi=(e,t,n={})=>nt(e,n)?{[t]:rt(e)}:{},Ji=e=>{if(!Ui(e))return{};const t=K(e);return t?{lineHeight:Ce(t)}:"unit"in e&&e.unit==="number"?{lineHeight:e.value}:{lineHeight:rt(e)}},Qi=e=>{if(!Ki(e))return{};const t=K(e);return t?{opacity:Ce(t)}:{opacity:e}},Rn={"margin-3-resolutions":{kind:"boxSpacing",cssProperty:"margin"},"padding-3-resolutions":{kind:"boxSpacing",cssProperty:"padding"},"border-3-resolutions":{kind:"border"},"box-shadow-3-resolutions":{kind:"boxShadow"},"border-radius-3-resolutions":{kind:"length",cssProperty:"borderRadius",capabilities:{allowAuto:!1,allowNegative:!1}},"width-3-resolutions":{kind:"length",cssProperty:"width",capabilities:{allowAuto:!0,allowNegative:!1}},"height-3-resolutions":{kind:"length",cssProperty:"height",capabilities:{allowAuto:!0,allowNegative:!1}},"min-width-3-resolutions":{kind:"length",cssProperty:"minWidth",capabilities:{allowAuto:!1,allowNegative:!1}},"max-width-3-resolutions":{kind:"length",cssProperty:"maxWidth",capabilities:{allowAuto:!1,allowNegative:!1}},"min-height-3-resolutions":{kind:"length",cssProperty:"minHeight",capabilities:{allowAuto:!1,allowNegative:!1}},"max-height-3-resolutions":{kind:"length",cssProperty:"maxHeight",capabilities:{allowAuto:!1,allowNegative:!1}},"gap-3-resolutions":{kind:"length",cssProperty:"gap",capabilities:{allowAuto:!1,allowNegative:!1}},"justify-content-3-resolutions":{kind:"enum",cssProperty:"justifyContent",allowedValues:Di},"align-items-3-resolutions":{kind:"enum",cssProperty:"alignItems",allowedValues:Pi},"flex-wrap-3-resolutions":{kind:"enum",cssProperty:"flexWrap",allowedValues:ki},"align-content-3-resolutions":{kind:"enum",cssProperty:"alignContent",allowedValues:Li},"flex-direction-3-resolutions":{kind:"enum",cssProperty:"flexDirection",allowedValues:Ri},"overflow-3-resolutions":{kind:"enum",cssProperty:"overflow",allowedValues:un},"overflow-x-3-resolutions":{kind:"enum",cssProperty:"overflowX",allowedValues:un},"overflow-y-3-resolutions":{kind:"enum",cssProperty:"overflowY",allowedValues:un},"background-color-3-resolutions":{kind:"color",cssProperty:"backgroundColor"},"color-3-resolutions":{kind:"color",cssProperty:"color"},"background-image-3-resolutions":{kind:"backgroundImage"},"background-size-3-resolutions":{kind:"enum",cssProperty:"backgroundSize",allowedValues:xi},"background-position-3-resolutions":{kind:"enum",cssProperty:"backgroundPosition",allowedValues:Mi},"background-repeat-3-resolutions":{kind:"enum",cssProperty:"backgroundRepeat",allowedValues:Ni},"opacity-3-resolutions":{kind:"opacity"},"font-family-3-resolutions":{kind:"enum",cssProperty:"fontFamily",allowedValues:Ci},"font-size-3-resolutions":{kind:"length",cssProperty:"fontSize",capabilities:{allowAuto:!1,allowNegative:!1}},"font-weight-3-resolutions":{kind:"enum",cssProperty:"fontWeight",allowedValues:Ai},"font-style-3-resolutions":{kind:"enum",cssProperty:"fontStyle",allowedValues:Si},"line-height-3-resolutions":{kind:"lineHeight"},"letter-spacing-3-resolutions":{kind:"length",cssProperty:"letterSpacing",capabilities:{allowAuto:!1,allowNegative:!0}},"text-align-3-resolutions":{kind:"enum",cssProperty:"textAlign",allowedValues:Ei},"text-decoration-3-resolutions":{kind:"enum",cssProperty:"textDecoration",allowedValues:Ti},"text-transform-3-resolutions":{kind:"enum",cssProperty:"textTransform",allowedValues:Ii}},$i=(e,t)=>{const n=Rn[e];if(!n)return{};switch(n.kind){case"boxSpacing":return zi(t,n.cssProperty);case"length":return Zi(t,n.cssProperty,n.capabilities);case"border":return Gi(t);case"boxShadow":return Yi(t);case"color":return qi(t,n.cssProperty);case"opacity":return Qi(t);case"enum":return Xi(t,n.cssProperty,n.allowedValues);case"lineHeight":return Ji(t);case"backgroundImage":return Hi(t);default:return{}}},Ba=Object.fromEntries(Object.entries(Rn).filter(([,e])=>e.kind==="boxSpacing").map(([e,t])=>[e,t.cssProperty])),Ua=e=>e!=null&&e!=="",es=e=>e?!Oi.some(n=>Ua(e[n]))||e.display==="flex"?e:{...e,display:"flex"}:{},ts=({dbEntryType:e,libraryId:t,sourceComponentsPlugin:n})=>{if(!(e!=null&&e.length))return;const r=n.components[mr(t,e)];if(!r||!("defaultAttributeValues"in r))return;const i=r.defaultAttributeValues;if(i!=null&&i.length)return i.reduce((s,l)=>({...s,[l.name]:l.defaultValues}),{})},ot=({deviceDisplayType:e,componentAttributes:t})=>{if(!t)return;const n={},r={};for(const[o,i]of Object.entries(t)){if(!o.includes("3-resolutions")||!i)continue;const s=i.all,l=s??i[e.toLowerCase()];r[o]=l,Rn[o]&&Object.assign(n,$i(o,l))}return Object.keys(n).length||Object.keys(r).length?{styles:Object.keys(n).length?n:void 0,componentAttributesSpecificToDeviceType:Object.keys(r).length?r:void 0}:void 0},ns=({defaultAttributes:e,userModifiedAttributes:t})=>e?t?{...e,...t}:e:t;function Ft(e){return e.componentAttributes??e.widgetAttributes}function er({col:e,deviceDisplayType:t,isComposeMode:n,sourceComponentsPlugin:r}){const o=Ft(e),i=ts({dbEntryType:e.type,libraryId:e.libraryId,sourceComponentsPlugin:r})||[],s=ns({defaultAttributes:i,userModifiedAttributes:o}),{styles:l,componentAttributesSpecificToDeviceType:u}=ot({deviceDisplayType:t,componentAttributes:s})||{styles:void 0,componentAttributesSpecificToDeviceType:void 0};let c={};const f={};if(l)for(const[a,d]of Object.entries(l))n&&f[a]||(c={...c,[a]:d});let p=Ft(e);for(const a in u)if(a.includes("3-resolutions")){p={...Ft(e)||{},...u||{}};break}return{componentAttributesBasedOnDevice:p,componentStyles:es(c)}}const rs=e=>{const t=(e==null?void 0:e.rows)||[];for(const n of t)if(((n==null?void 0:n.columns)||[]).length>0)return!0;return(e==null?void 0:e.containerAttributes)&&Object.keys(e.containerAttributes).length>0},os="var(--sl-spacing-x-small)";function is(e){return e!=null&&e.horizontalAlignment||e!=null&&e.verticalAlignment||e!=null&&e.flexWrap||e!=null&&e.gap||e!=null&&e.alignContent?!0:!!(e!=null&&e.rowAttributes&&Object.keys(e.rowAttributes).length>0)}function ss({row:e,deviceDisplayType:t}){var r;const n=ot({deviceDisplayType:t,componentAttributes:e.rowAttributes});return((r=n==null?void 0:n.componentAttributesSpecificToDeviceType)==null?void 0:r["hide-component-3-resolutions"])==="true"}function ls({row:e,deviceDisplayType:t,isComposeMode:n}){var d;const r=((d=ot({deviceDisplayType:t,componentAttributes:e.rowAttributes}))==null?void 0:d.styles)||{},o=r.justifyContent??e.horizontalAlignment??$n.Center,i=r.alignItems??e.verticalAlignment??$n.Center,s=r.flexDirection??"row",l=r.gap??e.gap??os,u=n?"nowrap":r.flexWrap??e.flexWrap??"nowrap",c=r.alignContent??e.alignContent??void 0,f=new Set(["justifyContent","alignItems","flexDirection","gap","flexWrap","alignContent","display"]),p={};for(const[y,m]of Object.entries(r))f.has(y)||(p[y]=m);const a={display:"flex",flexDirection:s,gap:l,flexWrap:u,justifyContent:o,alignItems:i,...p};return c!==void 0&&(a.alignContent=c),a}const xn="css-classes-3-resolutions",Ka=500,Ha=/[\x00-\x1f\x7f]/g,Mn=e=>{if(typeof e!="string")return;const t=new Set,n=[];for(const o of e.split(/\s+/)){const i=o.replace(Ha,"");i&&(t.has(i)||(t.add(i),n.push(i)))}if(!n.length)return;let r="";for(const o of n){const i=r?`${r} ${o}`:o;if(i.length>Ka)break;r=i}return r.length?r:void 0},Dr="hide-component-3-resolutions",as=["width-3-resolutions","min-width-3-resolutions","max-width-3-resolutions","height-3-resolutions","min-height-3-resolutions","max-height-3-resolutions","margin-3-resolutions","padding-3-resolutions","border-3-resolutions","border-radius-3-resolutions","box-shadow-3-resolutions","overflow-3-resolutions","overflow-x-3-resolutions","overflow-y-3-resolutions",Dr],Ga=new Set(as);function us({containerAttributes:e,deviceDisplayType:t}){var r;const n=ot({deviceDisplayType:t,componentAttributes:e});return((r=n==null?void 0:n.componentAttributesSpecificToDeviceType)==null?void 0:r[Dr])==="true"}function cs({containerAttributes:e,deviceDisplayType:t,isComposeMode:n}){var i;if(!e)return{styles:{}};const r=n?Object.fromEntries(Object.entries(e).filter(([s])=>!Ga.has(s))):e,o=ot({deviceDisplayType:t,componentAttributes:r});return{styles:(o==null?void 0:o.styles)??{},cssClasses:Mn((i=o==null?void 0:o.componentAttributesSpecificToDeviceType)==null?void 0:i[xn])}}function fs(e){return Object.keys(e.styles).length>0||!!e.cssClasses}function re(e){if(!e)return;const t=[];for(const[n,r]of Object.entries(e)){if(r==null||r==="")continue;const o=n.replace(/[A-Z]/g,i=>`-${i.toLowerCase()}`);t.push(`${o}: ${r}`)}return t.length>0?t.join("; "):void 0}const Nn="/";function ds({componentProps:e,ancestorColumnIds:t,columnId:n}){if(!e||!n)return;const r=[...t??[],n];for(let o=0;o<r.length;o+=1){const i=r.slice(o).join(Nn),s=e[i];if(s)return s}}function ps({displayItemList:e,widgetCollections:t}){const n=[],r=(o,i)=>{var s;if((s=o==null?void 0:o.rows)!=null&&s.length)for(const l of o.rows)for(const u of l.columns){if(!u.id||u.type===In.DroppableBox)continue;const c=Ar(u.type);if(c!=null&&c.length){const f=u.collection??(t==null?void 0:t[c]);f&&!i.includes(u.id)&&r(f.collectionRows,[...i,u.id]);continue}n.push([...i,u.id].join(Nn))}};return r(e,[]),n}function Ya(e,t){const n=`${Nn}${e}`;return t.some(r=>r===e||r.endsWith(n))}function hs({componentProps:e,displayItemList:t,widgetCollections:n}){const r=e?Object.keys(e):[];if(!r.length)return[];const o=ps({displayItemList:t,widgetCollections:n});return r.filter(i=>!Ya(i,o))}function gs({componentProps:e,displayItemList:t,widgetCollections:n,publishedKey:r}){if(process.env.NODE_ENV==="production")return;const o=hs({componentProps:e,displayItemList:t,widgetCollections:n});o.length&&console.warn(`RuleCMSWidget "${r}": componentProps ${o.map(i=>`"${i}"`).join(", ")} ${o.length===1?"matches":"match"} no component in this widget, so those props were not passed to anything. Keys are column ids from the widget config — the composer's Modify drawer shows the id of the selected component.`)}function za(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function qa(e){if(e.all!==void 0&&e.all!==null)return!1;const t=e.phone,n=e.tablet,r=e.desktop;return t!==n||t!==r||n!==r}function qr(e){var t;if(!((t=e==null?void 0:e.rows)!=null&&t.length))return!1;for(const n of e.rows){if(Xr(n.rowAttributes))return!0;for(const r of n.columns)if(Xr(Ft(r)))return!0}return!1}function Xr(e){if(!e)return!1;for(const[t,n]of Object.entries(e))if(!(!t.includes("3-resolutions")||!za(n))){if(t==="hide-component-3-resolutions"){const r=n,o=i=>i==="true"||i===!0;if(o(r.phone)!==o(r.tablet)||o(r.phone)!==o(r.desktop))return!0;continue}if(qa(n))return!0}return!1}function vs(e,t){if(qr(e))return!0;for(const n of Object.values(t))if(qr(n.collectionRows))return!0;return!1}const ys=parseInt(Er,10),ms=parseInt(Tr,10),Xa=ys+1,Za=ms+1;function Ja(e){const t=`.${e}-phone`,n=`.${e}-tablet`,r=`.${e}-desktop`;return`
|
|
1
|
+
"use strict";var Ys=Object.defineProperty;var Ur=e=>{throw TypeError(e)};var zs=(e,t,n)=>t in e?Ys(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var _e=(e,t,n)=>zs(e,typeof t!="symbol"?t+"":t,n),Kn=(e,t,n)=>t.has(e)||Ur("Cannot "+n);var v=(e,t,n)=>(Kn(e,t,"read from private field"),n?n.call(e):t.get(e)),W=(e,t,n)=>t.has(e)?Ur("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ne=(e,t,n,r)=>(Kn(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),U=(e,t,n)=>(Kn(e,t,"access private method"),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const tr=require("svelte"),qs="5";var ci;typeof window<"u"&&((ci=window.__svelte??(window.__svelte={})).v??(ci.v=new Set)).add(qs);const Xs=1,Zs=2,pi=4,Js=8,Qs=16,$s=1,el=2,K=Symbol("uninitialized"),hi="http://www.w3.org/1999/xhtml",tl="http://www.w3.org/2000/svg",nl="@attach",gi=!1;var fr=Array.isArray,rl=Array.prototype.indexOf,pn=Array.prototype.includes,dr=Array.from,il=Object.defineProperty,Ft=Object.getOwnPropertyDescriptor,ol=Object.getOwnPropertyDescriptors,sl=Object.prototype,ll=Array.prototype,vi=Object.getPrototypeOf;function Dt(e){return typeof e=="function"}const al=()=>{};function ul(e){for(var t=0;t<e.length;t++)e[t]()}function yi(){var e,t,n=new Promise((r,i)=>{e=r,t=i});return{promise:n,resolve:e,reject:t}}const q=2,At=4,pr=8,hr=1<<24,Ae=16,ve=32,Ke=64,cl=128,fe=512,Y=1024,H=2048,Ee=4096,ee=8192,de=16384,Tt=32768,Kr=1<<25,He=65536,hn=1<<17,fl=1<<18,In=1<<19,dl=1<<20,De=1<<25,rt=65536,gn=1<<21,gt=1<<22,je=1<<23,vt=Symbol("$state"),pl=Symbol("legacy props"),hl=Symbol(""),Hn=Symbol("attributes"),Hr=Symbol("class"),Gr=Symbol("style"),ln=Symbol("text"),Jt=new class extends Error{constructor(){super(...arguments);_e(this,"name","StaleReactionError");_e(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};var fi;const gr=!!((fi=globalThis.document)!=null&&fi.contentType)&&globalThis.document.contentType.includes("xml");function gl(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function vl(e,t,n){throw new Error("https://svelte.dev/e/each_key_duplicate")}function yl(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function ml(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function _l(e){throw new Error("https://svelte.dev/e/effect_orphan")}function bl(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function wl(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Cl(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Al(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function El(){console.warn("https://svelte.dev/e/derived_inert")}function Sl(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function mi(e){return e===this.v}function Tl(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function _i(e){return!Tl(e,this.v)}let Il=!1,pe=null;function vn(e){pe=e}function Le(e,t=!1,n){pe={p:pe,i:!1,c:null,e:null,s:e,x:null,r:R,l:null}}function xe(e){var t=pe,n=t.e;if(n!==null){t.e=null;for(var r of n)Oi(r)}return t.i=!0,pe=t.p,{}}function bi(){return!0}let dt=[];function Dl(){var e=dt;dt=[],ul(e)}function Bt(e){if(dt.length===0){var t=dt;queueMicrotask(()=>{t===dt&&Dl()})}dt.push(e)}function Pl(e){var t=R;if(t===null)return k.f|=je,e;if((t.f&Tt)===0&&(t.f&At)===0)throw e;yn(e,t)}function yn(e,t){if(!(t!==null&&(t.f&de)!==0)){for(;t!==null;){if((t.f&cl)!==0){if((t.f&Tt)===0)throw e;try{t.b.error(e);return}catch(n){e=n}}t=t.parent}throw e}}const kl=-7169;function j(e,t){e.f=e.f&kl|t}function vr(e){(e.f&fe)!==0||e.deps===null?j(e,Y):j(e,Ee)}function wi(e){if(e!==null)for(const t of e)(t.f&q)===0||(t.f&rt)===0||(t.f^=rt,wi(t.deps))}function Ll(e,t,n){(e.f&H)!==0?t.add(e):(e.f&Ee)!==0&&n.add(e),wi(e.deps),j(e,Y)}function xl(e,t){if(t){const n=document.body;e.autofocus=!0,Bt(()=>{document.activeElement===n&&e.focus()})}}function Qt(e){var t=k,n=R;ke(null),Ye(null);try{return e()}finally{ke(t),Ye(n)}}function Ci(e,t,n,r){const i=yr;var o=e.filter(d=>!d.settled),s=t.map(i);if(n.length===0&&o.length===0){r(s);return}var l=R,a=Rl(),u=o.length===1?o[0].promise:o.length>1?Promise.all(o.map(d=>d.promise)):null;function f(d){if((l.f&de)===0){a();try{r([...s,...d])}catch(y){yn(y,l)}mn()}}var h=Ai();if(n.length===0){u.then(()=>f([])).finally(h);return}function c(){Promise.all(n.map(d=>Nl(d))).then(f).catch(d=>yn(d,l)).finally(h)}u?u.then(()=>{a(),c(),mn()}):c()}function Rl(){var e=R,t=k,n=pe,r=L;return function(o=!0){Ye(e),ke(t),vn(n),o&&(e.f&de)===0&&(r==null||r.activate(),r==null||r.apply())}}function mn(e=!0){Ye(null),ke(null),vn(null),e&&(L==null||L.deactivate())}function Ai(){var e=R,t=e.b,n=L,r=!!(t!=null&&t.is_rendered());return t==null||t.update_pending_count(1,n),n.increment(r,e),()=>{t==null||t.update_pending_count(-1,n),n.decrement(r,e)}}function yr(e){var t=q|H;return R!==null&&(R.f|=In),{ctx:pe,deps:null,effects:null,equals:mi,f:t,fn:e,reactions:null,rv:0,v:K,wv:0,parent:R,ac:null}}const xt=Symbol("obsolete");function Nl(e,t,n){let r=R;r===null&&gl();var i=void 0,o=Kt(K),s=!k,l=new Set;return Zl(()=>{var d,y;var a=R,u=yi();i=u.promise;try{Promise.resolve(e()).then(u.resolve,m=>{m!==Jt&&u.reject(m)}).finally(mn)}catch(m){u.reject(m),mn()}var f=L;if(s){if((a.f&Tt)!==0)var h=Ai();if((d=r.b)!=null&&d.is_rendered())(y=f.async_deriveds.get(a))==null||y.reject(xt);else for(const m of l.values())m.reject(xt);l.add(u),f.async_deriveds.set(a,u)}const c=(m,g=void 0)=>{h==null||h(),l.delete(u),g!==xt&&(f.activate(),g?(o.f|=je,Ht(o,g)):((o.f&je)!==0&&(o.f^=je),Ht(o,m)),f.deactivate())};u.promise.then(c,m=>c(null,m||"unknown"))}),wr(()=>{for(const a of l)a.reject(xt)}),new Promise(a=>{function u(f){function h(){f===i?a(o):u(i)}f.then(h,h)}u(i)})}function D(e){const t=yr(e);return Hi(t),t}function Ml(e){const t=yr(e);return t.equals=_i,t}function Ol(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)he(t[n])}}function mr(e){var t,n=R,r=e.parent;if(!Ge&&r!==null&&e.v!==K&&(r.f&(de|ee))!==0)return El(),e.v;Ye(r);try{e.f&=~rt,Ol(e),t=qi(e)}finally{Ye(n)}return t}function Ei(e){var t=mr(e);if(!e.equals(t)&&(e.wv=Yi(),(!(L!=null&&L.is_fork)||e.deps===null)&&(L!==null?(L.capture(e,t,!0),Wt==null||Wt.capture(e,t,!0)):e.v=t,e.deps===null))){j(e,Y);return}Ge||(X!==null?(Mi()||L!=null&&L.is_fork)&&X.set(e,t):vr(e))}function Fl(e){var t;if(e.effects!==null)for(const n of e.effects)(n.teardown||n.ac)&&((t=n.teardown)==null||t.call(n),n.ac!==null&&Qt(()=>{n.ac.abort(Jt),n.ac=null}),n.fn!==null&&(n.teardown=al),Gt(n,0),Ar(n))}function Si(e){if(e.effects!==null)for(const t of e.effects)t.teardown&&t.fn!==null&&Et(t)}let Gn=null,ct=null,L=null,Wt=null,X=null,nr=null,Yn=!1,pt=null,un=null;var Yr=0;let Wl=1;var yt,We,Je,mt,_t,bt,Ne,wt,re,qt,Me,we,Te,Ct,Qe,M,rr,Rt,ir,Ti,Ii,ft,Vl,Nt;const Sn=class Sn{constructor(){W(this,M);_e(this,"id",Wl++);W(this,yt,!1);_e(this,"linked",!0);W(this,We,null);W(this,Je,null);_e(this,"async_deriveds",new Map);_e(this,"current",new Map);_e(this,"previous",new Map);W(this,mt,new Set);W(this,_t,new Set);W(this,bt,0);W(this,Ne,new Map);W(this,wt,null);W(this,re,[]);W(this,qt,[]);W(this,Me,new Set);W(this,we,new Set);W(this,Te,new Map);W(this,Ct,new Set);_e(this,"is_fork",!1);W(this,Qe,!1);ct===null?Gn=ct=this:(ne(ct,Je,this),ne(this,We,ct)),ct=this}skip_effect(t){v(this,Te).has(t)||v(this,Te).set(t,{d:[],m:[]}),v(this,Ct).delete(t)}unskip_effect(t,n=r=>this.schedule(r)){var r=v(this,Te).get(t);if(r){v(this,Te).delete(t);for(var i of r.d)j(i,H),n(i);for(i of r.m)j(i,Ee),n(i)}v(this,Ct).add(t)}capture(t,n,r=!1){t.v!==K&&!this.previous.has(t)&&this.previous.set(t,t.v),(t.f&je)===0&&(this.current.set(t,[n,r]),X==null||X.set(t,n)),this.is_fork||(t.v=n)}activate(){L=this}deactivate(){L=null,X=null}flush(){try{Yn=!0,L=this,U(this,M,Rt).call(this)}finally{Yr=0,nr=null,pt=null,un=null,Yn=!1,L=null,X=null,et.clear()}}discard(){var t;for(const n of v(this,_t))n(this);v(this,_t).clear();for(const n of this.async_deriveds.values())n.reject(xt);U(this,M,Nt).call(this),(t=v(this,wt))==null||t.resolve()}register_created_effect(t){v(this,qt).push(t)}increment(t,n){if(ne(this,bt,v(this,bt)+1),t){let r=v(this,Ne).get(n)??0;v(this,Ne).set(n,r+1)}}decrement(t,n){if(ne(this,bt,v(this,bt)-1),t){let r=v(this,Ne).get(n)??0;r===1?v(this,Ne).delete(n):v(this,Ne).set(n,r-1)}v(this,Qe)||(ne(this,Qe,!0),Bt(()=>{ne(this,Qe,!1),this.linked&&this.flush()}))}transfer_effects(t,n){for(const r of t)v(this,Me).add(r);for(const r of n)v(this,we).add(r);t.clear(),n.clear()}oncommit(t){v(this,mt).add(t)}ondiscard(t){v(this,_t).add(t)}settled(){return(v(this,wt)??ne(this,wt,yi())).promise}static ensure(){if(L===null){const t=L=new Sn;Yn||Bt(()=>{v(t,yt)||t.flush()})}return L}apply(){{X=null;return}}schedule(t){var i;if(nr=t,(i=t.b)!=null&&i.is_pending&&(t.f&(At|pr|hr))!==0&&(t.f&Tt)===0){t.b.defer_effect(t);return}for(var n=t;n.parent!==null;){n=n.parent;var r=n.f;if(pt!==null&&n===R&&(k===null||(k.f&q)===0))return;if((r&(Ke|ve))!==0){if((r&Y)===0)return;n.f^=Y}}v(this,re).push(n)}};yt=new WeakMap,We=new WeakMap,Je=new WeakMap,mt=new WeakMap,_t=new WeakMap,bt=new WeakMap,Ne=new WeakMap,wt=new WeakMap,re=new WeakMap,qt=new WeakMap,Me=new WeakMap,we=new WeakMap,Te=new WeakMap,Ct=new WeakMap,Qe=new WeakMap,M=new WeakSet,rr=function(){if(this.is_fork)return!0;for(const r of v(this,Ne).keys()){for(var t=r,n=!1;t.parent!==null;){if(v(this,Te).has(t)){n=!0;break}t=t.parent}if(!n)return!0}return!1},Rt=function(){var a,u,f,h;ne(this,yt,!0),Yr++>1e3&&(U(this,M,Nt).call(this),jl());for(const c of v(this,Me))v(this,we).delete(c),j(c,H),this.schedule(c);for(const c of v(this,we))j(c,Ee),this.schedule(c);const t=v(this,re);ne(this,re,[]),this.apply();var n=pt=[],r=[],i=un=[];for(const c of t)try{U(this,M,ir).call(this,c,n,r)}catch(d){throw ki(c),U(this,M,rr).call(this)||this.discard(),d}if(L=null,i.length>0){var o=Sn.ensure();for(const c of i)o.schedule(c)}if(pt=null,un=null,U(this,M,rr).call(this)){U(this,M,ft).call(this,r),U(this,M,ft).call(this,n);for(const[c,d]of v(this,Te))Pi(c,d);i.length>0&&U(a=L,M,Rt).call(a);return}const s=U(this,M,Ti).call(this);if(s){U(this,M,ft).call(this,r),U(this,M,ft).call(this,n),U(u=s,M,Ii).call(u,this);return}v(this,Me).clear(),v(this,we).clear();for(const c of v(this,mt))c(this);v(this,mt).clear(),Wt=this,zr(r),zr(n),Wt=null,(f=v(this,wt))==null||f.resolve();var l=L;if(v(this,bt)===0&&(v(this,re).length===0||l!==null)&&U(this,M,Nt).call(this),v(this,re).length>0)if(l!==null){const c=l;v(c,re).push(...v(this,re).filter(d=>!v(c,re).includes(d)))}else l=this;l!==null&&U(h=l,M,Rt).call(h)},ir=function(t,n,r){t.f^=Y;for(var i=t.first;i!==null;){var o=i.f,s=(o&(ve|Ke))!==0,l=s&&(o&Y)!==0,a=l||(o&ee)!==0||v(this,Te).has(i);if(!a&&i.fn!==null){s?i.f^=Y:(o&At)!==0?n.push(i):tn(i)&&((o&Ae)!==0&&v(this,we).add(i),Et(i));var u=i.first;if(u!==null){i=u;continue}}for(;i!==null;){var f=i.next;if(f!==null){i=f;break}i=i.parent}}},Ti=function(){for(var t=v(this,We);t!==null;){if(!t.is_fork){for(const[n,[,r]]of this.current)if(t.current.has(n)&&!r)return t}t=v(t,We)}return null},Ii=function(t){var r;for(const[i,o]of t.current)!this.previous.has(i)&&t.previous.has(i)&&this.previous.set(i,t.previous.get(i)),this.current.set(i,o);for(const[i,o]of t.async_deriveds){const s=this.async_deriveds.get(i);s&&o.promise.then(s.resolve).catch(s.reject)}t.async_deriveds.clear(),this.transfer_effects(v(t,Me),v(t,we));const n=i=>{var o=i.reactions;if(o!==null&&!((i.f&q)!==0&&(i.f&(H|Ee))===0))for(const a of o){var s=a.f;if((s&q)!==0)n(a);else{var l=a;s&(gt|Ae)&&!this.async_deriveds.has(l)&&(v(this,we).delete(l),j(l,H),this.schedule(l))}}};for(const i of this.current.keys())n(i);this.oncommit(()=>t.discard()),U(r=t,M,Nt).call(r),L=this,U(this,M,Rt).call(this)},ft=function(t){for(var n=0;n<t.length;n+=1)Ll(t[n],v(this,Me),v(this,we))},Vl=function(){var h;for(let c=Gn;c!==null;c=v(c,Je)){var t=c.id<this.id,n=[];for(const[d,[y,m]]of this.current){if(c.current.has(d)){var r=c.current.get(d)[0];if(t&&y!==r)c.current.set(d,[y,m]);else continue}n.push(d)}if(t)for(const[d,y]of this.async_deriveds){const m=c.async_deriveds.get(d);m&&y.promise.then(m.resolve).catch(m.reject)}var i=[...c.current.keys()].filter(d=>!c.current.get(d)[1]);if(!(!v(c,yt)||i.length===0)){var o=i.filter(d=>!this.current.has(d));if(o.length===0)t&&c.discard();else if(n.length>0){if(t)for(const d of v(this,Ct))c.unskip_effect(d,y=>{var m;(y.f&(Ae|gt))!==0?c.schedule(y):U(m=c,M,ft).call(m,[y])});c.activate();var s=new Set,l=new Map;for(var a of n)Di(a,o,s,l);l=new Map;var u=[...c.current].filter(([d,y])=>{const m=this.current.get(d);return m?m[0]!==y[0]||m[1]!==y[1]:!0}).map(([d])=>d);if(u.length>0)for(const d of v(this,qt))(d.f&(de|ee|hn))===0&&_r(d,u,l)&&((d.f&(gt|Ae))!==0?(j(d,H),c.schedule(d)):v(c,Me).add(d));if(v(c,re).length>0&&!v(c,Qe)){c.apply();for(var f of v(c,re))U(h=c,M,ir).call(h,f,[],[]);ne(c,re,[])}c.deactivate()}}}},Nt=function(){if(this.linked){var t=v(this,We),n=v(this,Je);t===null?Gn=n:ne(t,Je,n),n===null?ct=t:ne(n,We,t),this.linked=!1}};let Ut=Sn;function jl(){try{bl()}catch(e){yn(e,nr)}}let be=null;function zr(e){var t=e.length;if(t!==0){for(var n=0;n<t;){var r=e[n++];if((r.f&(de|ee))===0&&tn(r)&&(be=new Set,Et(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&ji(r),(be==null?void 0:be.size)>0)){et.clear();for(const i of be){if((i.f&(de|ee))!==0)continue;const o=[i];let s=i.parent;for(;s!==null;)be.has(s)&&(be.delete(s),o.push(s)),s=s.parent;for(let l=o.length-1;l>=0;l--){const a=o[l];(a.f&(de|ee))===0&&Et(a)}}be.clear()}}be=null}}function Di(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(const i of e.reactions){const o=i.f;(o&q)!==0?Di(i,t,n,r):(o&(gt|Ae))!==0&&(o&H)===0&&_r(i,t,r)&&(j(i,H),br(i))}}function _r(e,t,n){const r=n.get(e);if(r!==void 0)return r;if(e.deps!==null)for(const i of e.deps){if(pn.call(t,i))return!0;if((i.f&q)!==0&&_r(i,t,n))return n.set(i,!0),!0}return n.set(e,!1),!1}function br(e){L.schedule(e)}function Pi(e,t){if(!((e.f&ve)!==0&&(e.f&Y)!==0)){(e.f&H)!==0?t.d.push(e):(e.f&Ee)!==0&&t.m.push(e),j(e,Y);for(var n=e.first;n!==null;)Pi(n,t),n=n.next}}function ki(e){j(e,Y);for(var t=e.first;t!==null;)ki(t),t=t.next}let _n=new Set;const et=new Map;let Li=!1;function Kt(e,t){var n={f:0,v:e,reactions:null,equals:mi,rv:0,wv:0};return n}function le(e,t){const n=Kt(e);return Hi(n),n}function Bl(e,t=!1,n=!0){const r=Kt(e);return t||(r.equals=_i),r}function F(e,t,n=!1){k!==null&&(!Ve||(k.f&hn)!==0)&&bi()&&(k.f&(q|Ae|gt|hn))!==0&&(Pe===null||!Pe.has(e))&&Al();let r=n?ht(t):t;return Ht(e,r,un)}function Ht(e,t,n=null){if(!e.equals(t)){et.set(e,Ge?t:e.v);var r=Ut.ensure();if(r.capture(e,t),(e.f&q)!==0){const i=e;(e.f&H)!==0&&mr(i),X===null&&vr(i)}e.wv=Yi(),xi(e,H,n),R!==null&&(R.f&Y)!==0&&(R.f&(ve|Ke))===0&&(ue===null?$l([e]):ue.push(e)),!r.is_fork&&_n.size>0&&!Li&&Ul()}return t}function Ul(){Li=!1;for(const e of _n){(e.f&Y)!==0&&j(e,Ee);let t;try{t=tn(e)}catch{t=!0}t&&Et(e)}_n.clear()}function zn(e){F(e,e.v+1)}function xi(e,t,n){var r=e.reactions;if(r!==null)for(var i=r.length,o=0;o<i;o++){var s=r[o],l=s.f,a=(l&H)===0;if(a&&j(s,t),(l&hn)!==0)_n.add(s);else if((l&q)!==0){var u=s;X==null||X.delete(u),(l&rt)===0&&(l&fe&&(R===null||(R.f&gn)===0)&&(s.f|=rt),xi(u,Ee,n))}else if(a){var f=s;(l&Ae)!==0&&be!==null&&be.add(f),n!==null?n.push(f):br(f)}}}function ht(e){if(typeof e!="object"||e===null||vt in e)return e;const t=vi(e);if(t!==sl&&t!==ll)return e;var n=new Map,r=fr(e),i=le(0),o=tt,s=l=>{if(tt===o)return l();var a=k,u=tt;ke(null),Zr(o);var f=l();return ke(a),Zr(u),f};return r&&n.set("length",le(e.length)),new Proxy(e,{defineProperty(l,a,u){(!("value"in u)||u.configurable===!1||u.enumerable===!1||u.writable===!1)&&wl();var f=n.get(a);return f===void 0?s(()=>{var h=le(u.value);return n.set(a,h),h}):F(f,u.value,!0),!0},deleteProperty(l,a){var u=n.get(a);if(u===void 0){if(a in l){const f=s(()=>le(K));n.set(a,f),zn(i)}}else F(u,K),zn(i);return!0},get(l,a,u){var d;if(a===vt)return e;var f=n.get(a),h=a in l;if(f===void 0&&(!h||(d=Ft(l,a))!=null&&d.writable)&&(f=s(()=>{var y=ht(h?l[a]:K),m=le(y);return m}),n.set(a,f)),f!==void 0){var c=p(f);return c===K?void 0:c}return Reflect.get(l,a,u)},getOwnPropertyDescriptor(l,a){var u=Reflect.getOwnPropertyDescriptor(l,a);if(u&&"value"in u){var f=n.get(a);f&&(u.value=p(f))}else if(u===void 0){var h=n.get(a),c=h==null?void 0:h.v;if(h!==void 0&&c!==K)return{enumerable:!0,configurable:!0,value:c,writable:!0}}return u},has(l,a){var c;if(a===vt)return!0;var u=n.get(a),f=u!==void 0&&u.v!==K||Reflect.has(l,a);if(u!==void 0||R!==null&&(!f||(c=Ft(l,a))!=null&&c.writable)){u===void 0&&(u=s(()=>{var d=f?ht(l[a]):K,y=le(d);return y}),n.set(a,u));var h=p(u);if(h===K)return!1}return f},set(l,a,u,f){var C;var h=n.get(a),c=a in l;if(r&&a==="length")for(var d=u;d<h.v;d+=1){var y=n.get(d+"");y!==void 0?F(y,K):d in l&&(y=s(()=>le(K)),n.set(d+"",y))}if(h===void 0)(!c||(C=Ft(l,a))!=null&&C.writable)&&(h=s(()=>le(void 0)),F(h,ht(u)),n.set(a,h));else{c=h.v!==K;var m=s(()=>ht(u));F(h,m)}var g=Reflect.getOwnPropertyDescriptor(l,a);if(g!=null&&g.set&&g.set.call(f,u),!c){if(r&&typeof a=="string"){var _=n.get("length"),T=Number(a);Number.isInteger(T)&&T>=_.v&&F(_,T+1)}zn(i)}return!0},ownKeys(l){p(i);var a=Reflect.ownKeys(l).filter(h=>{var c=n.get(h);return c===void 0||c.v!==K});for(var[u,f]of n)f.v!==K&&!(u in l)&&a.push(u);return a},setPrototypeOf(){Cl()}})}function qr(e){try{if(e!==null&&typeof e=="object"&&vt in e)return e[vt]}catch{}return e}function Kl(e,t){return Object.is(qr(e),qr(t))}var Hl,Gl,Yl;function Be(e=""){return document.createTextNode(e)}function bn(e){return Gl.call(e)}function $t(e){return Yl.call(e)}function ae(e,t){return bn(e)}function z(e,t=!1){{var n=bn(e);return n instanceof Comment&&n.data===""?$t(n):n}}function Ue(e,t=1,n=!1){let r=e;for(;t--;)r=$t(r);return r}function zl(e){e.textContent=""}function Ri(){return!1}function Ni(e,t,n){return t==null||t===hi?n?document.createElement(e,{is:n}):document.createElement(e):n?document.createElementNS(t,e,{is:n}):document.createElementNS(t,e)}function ql(e){R===null&&(k===null&&_l(),ml()),Ge&&yl()}function Xl(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function ze(e,t){var n=R;n!==null&&(n.f&ee)!==0&&(e|=ee);var r={ctx:pe,deps:null,nodes:null,f:e|H|fe,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};L==null||L.register_created_effect(r);var i=r;if((e&At)!==0)pt!==null?pt.push(r):Ut.ensure().schedule(r);else if(t!==null){try{Et(r)}catch(s){throw he(r),s}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&(i.f&In)===0&&(i=i.first,(e&Ae)!==0&&(e&He)!==0&&i!==null&&(i.f|=He))}if(i!==null&&(i.parent=n,n!==null&&Xl(i,n),k!==null&&(k.f&q)!==0&&(e&Ke)===0)){var o=k;(o.effects??(o.effects=[])).push(i)}return r}function Mi(){return k!==null&&!Ve}function wr(e){const t=ze(pr,null);return j(t,Y),t.teardown=e,t}function Cr(e){ql();var t=R.f,n=!k&&(t&ve)!==0&&pe!==null&&!pe.i;if(n){var r=pe;(r.e??(r.e=[])).push(e)}else return Oi(e)}function Oi(e){return ze(At|dl,e)}function Fi(e){return ze(At,e)}function Zl(e){return ze(gt|In,e)}function $(e,t=[],n=[],r=[]){Ci(r,t,n,i=>{ze(pr,()=>{e(...i.map(p))})})}function en(e,t=0){var n=ze(Ae|t,e);return n}function Wi(e,t=0){var n=ze(hr|t,e);return n}function it(e){return ze(ve|In,e)}function Vi(e){var t=e.teardown;if(t!==null){const n=Ge,r=k;Xr(!0),ke(null);try{t.call(null)}finally{Xr(n),ke(r)}}}function Ar(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){const i=n.ac;i!==null&&Qt(()=>{i.abort(Jt)});var r=n.next;(n.f&Ke)!==0?n.parent=null:he(n,t),n=r}}function Jl(e){for(var t=e.first;t!==null;){var n=t.next;(t.f&ve)===0&&he(t),t=n}}function he(e,t=!0){var n=!1;(t||(e.f&fl)!==0)&&e.nodes!==null&&e.nodes.end!==null&&(Ql(e.nodes.start,e.nodes.end),n=!0),e.f|=Kr,Ar(e,t&&!n),Gt(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(const o of r)o.stop();Vi(e),e.f^=Kr,e.f|=de;var i=e.parent;i!==null&&i.first!==null&&ji(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function Ql(e,t){for(;e!==null;){var n=e===t?null:$t(e);e.remove(),e=n}}function ji(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function Er(e,t,n=!0){var r=[];Bi(e,r,!0);var i=()=>{n&&he(e),t&&t()},o=r.length;if(o>0){var s=()=>--o||i();for(var l of r)l.out(s)}else i()}function Bi(e,t,n){if((e.f&ee)===0){e.f^=ee;var r=e.nodes&&e.nodes.t;if(r!==null)for(const l of r)(l.is_global||n)&&t.push(l);for(var i=e.first;i!==null;){var o=i.next;if((i.f&Ke)===0){var s=(i.f&He)!==0||(i.f&ve)!==0&&(e.f&Ae)!==0;Bi(i,t,s?n:!1)}i=o}}}function wn(e){Ui(e,!0)}function Ui(e,t){if((e.f&ee)!==0){e.f^=ee,(e.f&Y)===0&&(j(e,H),Ut.ensure().schedule(e));for(var n=e.first;n!==null;){var r=n.next,i=(n.f&He)!==0||(n.f&ve)!==0;Ui(n,i?t:!1),n=r}var o=e.nodes&&e.nodes.t;if(o!==null)for(const s of o)(s.is_global||t)&&s.in()}}function Ki(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var i=n===r?null:$t(n);t.append(n),n=i}}let cn=!1,Ge=!1;function Xr(e){Ge=e}let k=null,Ve=!1;function ke(e){k=e}let R=null;function Ye(e){R=e}let Pe=null;function Hi(e){k!==null&&(Pe??(Pe=new Set)).add(e)}let ie=null,oe=0,ue=null;function $l(e){ue=e}let Gi=1,Xe=0,tt=Xe;function Zr(e){tt=e}function Yi(){return++Gi}function tn(e){var t=e.f;if((t&H)!==0)return!0;if(t&q&&(e.f&=~rt),(t&Ee)!==0){for(var n=e.deps,r=n.length,i=0;i<r;i++){var o=n[i];if(tn(o)&&Ei(o),o.wv>e.wv)return!0}(t&fe)!==0&&X===null&&j(e,Y)}return!1}function zi(e,t,n=!0){var r=e.reactions;if(r!==null&&!(Pe!==null&&Pe.has(e)))for(var i=0;i<r.length;i++){var o=r[i];(o.f&q)!==0?zi(o,t,!1):t===o&&(n?j(o,H):(o.f&Y)!==0&&j(o,Ee),br(o))}}function qi(e){var m;var t=ie,n=oe,r=ue,i=k,o=Pe,s=pe,l=Ve,a=tt,u=e.f;ie=null,oe=0,ue=null,k=(u&(ve|Ke))===0?e:null,Pe=null,vn(e.ctx),Ve=!1,tt=++Xe,e.ac!==null&&(Qt(()=>{e.ac.abort(Jt)}),e.ac=null);try{e.f|=gn;var f=e.fn,h=f();e.f|=Tt;var c=e.deps,d=L==null?void 0:L.is_fork;if(ie!==null){var y;if(d||Gt(e,oe),c!==null&&oe>0)for(c.length=oe+ie.length,y=0;y<ie.length;y++)c[oe+y]=ie[y];else e.deps=c=ie;if(Mi()&&(e.f&fe)!==0)for(y=oe;y<c.length;y++)((m=c[y]).reactions??(m.reactions=[])).push(e)}else!d&&c!==null&&oe<c.length&&(Gt(e,oe),c.length=oe);if(bi()&&ue!==null&&!Ve&&c!==null&&(e.f&(q|Ee|H))===0)for(y=0;y<ue.length;y++)zi(ue[y],e);if(i!==null&&i!==e){if(Xe++,i.deps!==null)for(let g=0;g<n;g+=1)i.deps[g].rv=Xe;if(t!==null)for(const g of t)g.rv=Xe;ue!==null&&(r===null?r=ue:r.push(...ue))}return(e.f&je)!==0&&(e.f^=je),h}catch(g){return Pl(g)}finally{e.f^=gn,ie=t,oe=n,ue=r,k=i,Pe=o,vn(s),Ve=l,tt=a}}function ea(e,t){let n=t.reactions;if(n!==null){var r=rl.call(n,e);if(r!==-1){var i=n.length-1;i===0?n=t.reactions=null:(n[r]=n[i],n.pop())}}if(n===null&&(t.f&q)!==0&&(ie===null||!pn.call(ie,t))){var o=t;(o.f&fe)!==0&&(o.f^=fe,o.f&=~rt),o.v!==K&&vr(o),o.ac!==null&&Qt(()=>{o.ac.abort(Jt),o.ac=null,j(o,H)}),Fl(o),Gt(o,0)}}function Gt(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)ea(e,n[r])}function Et(e){var t=e.f;if((t&de)===0){j(e,Y);var n=R,r=cn;R=e,cn=(t&(ve|Ke))===0;try{(t&(Ae|hr))!==0?Jl(e):Ar(e),Vi(e);var i=qi(e);e.teardown=typeof i=="function"?i:null,e.wv=Gi;var o;gi&&Il&&(e.f&H)!==0&&e.deps}finally{cn=r,R=n}}}function p(e){var t=e.f,n=(t&q)!==0;if(k!==null&&!Ve){var r=R!==null&&(R.f&de)!==0;if(!r&&(Pe===null||!Pe.has(e))){var i=k.deps;if((k.f&gn)!==0)e.rv<Xe&&(e.rv=Xe,ie===null&&i!==null&&i[oe]===e?oe++:ie===null?ie=[e]:ie.push(e));else{k.deps??(k.deps=[]),pn.call(k.deps,e)||k.deps.push(e);var o=e.reactions;o===null?e.reactions=[k]:pn.call(o,k)||o.push(k)}}}if(Ge&&et.has(e))return et.get(e);if(n){var s=e;if(Ge){var l=s.v;return((s.f&Y)===0&&s.reactions!==null||Zi(s))&&(l=mr(s)),et.set(s,l),l}var a=(s.f&fe)===0&&!Ve&&k!==null&&(cn||(k.f&fe)!==0),u=(s.f&Tt)===0;tn(s)&&(a&&(s.f|=fe),Ei(s)),a&&!u&&(Si(s),Xi(s))}if(X!=null&&X.has(e))return X.get(e);if((e.f&je)!==0)throw e.v;return e.v}function Xi(e){if(e.f|=fe,e.deps!==null)for(const t of e.deps)(t.reactions??(t.reactions=[])).push(e),(t.f&q)!==0&&(t.f&fe)===0&&(Si(t),Xi(t))}function Zi(e){if(e.v===K)return!0;if(e.deps===null)return!1;for(const t of e.deps)if(et.has(t)||(t.f&q)!==0&&Zi(t))return!0;return!1}const Ze=Symbol("events"),ta=new Set,na=new Set;function ra(e,t,n,r={}){function i(o){if(r.capture||sa.call(t,o),!o.cancelBubble)return Qt(()=>n==null?void 0:n.call(this,o))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?Bt(()=>{t.addEventListener(e,i,r)}):t.addEventListener(e,i,r),i}function ia(e,t,n){(t[Ze]??(t[Ze]={}))[e]=n}function oa(e){for(var t=0;t<e.length;t++)ta.add(e[t]);for(var n of na)n(e)}let Jr=null;function sa(e){var m,g;var t=this,n=t.ownerDocument,r=e.type,i=((m=e.composedPath)==null?void 0:m.call(e))||[],o=i[0]||e.target;Jr=e;var s=0,l=Jr===e&&e[Ze];if(l){var a=i.indexOf(l);if(a!==-1&&(t===document||t===window)){e[Ze]=t;return}var u=i.indexOf(t);if(u===-1)return;a<=u&&(s=a)}if(o=i[s]||e.target,o!==t){il(e,"currentTarget",{configurable:!0,get(){return o||n}});var f=k,h=R;ke(null),Ye(null);try{for(var c,d=[];o!==null&&o!==t;){try{var y=(g=o[Ze])==null?void 0:g[r];y!=null&&(!o.disabled||e.target===o)&&y.call(o,e)}catch(_){c?d.push(_):c=_}if(e.cancelBubble)break;s++,o=s<i.length?i[s]:null}if(c){for(let _ of d)queueMicrotask(()=>{throw _});throw c}}finally{e[Ze]=t,delete e.currentTarget,ke(f),Ye(h)}}}var di;const qn=((di=globalThis==null?void 0:globalThis.window)==null?void 0:di.trustedTypes)&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:e=>e});function la(e){return(qn==null?void 0:qn.createHTML(e))??e}function aa(e){var t=Ni("template");return t.innerHTML=la(e.replaceAll("<!>","<!---->")),t.content}function Yt(e,t){var n=R;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function ye(e,t){var n=(t&$s)!==0,r=(t&el)!==0,i,o=!e.startsWith("<!>");return()=>{i===void 0&&(i=aa(o?e:"<!>"+e),n||(i=bn(i)));var s=r||Hl?document.importNode(i,!0):i.cloneNode(!0);if(n){var l=bn(s),a=s.lastChild;Yt(l,a)}else Yt(s,s);return s}}function Dn(e=""){{var t=Be(e+"");return Yt(t,t),t}}function Z(){var e=document.createDocumentFragment(),t=document.createComment(""),n=Be();return e.append(t,n),Yt(t,n),e}function x(e,t){e!==null&&e.before(t)}function ua(e){return e.endsWith("capture")&&e!=="gotpointercapture"&&e!=="lostpointercapture"}const ca=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function fa(e){return ca.includes(e)}const da={formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly",defaultvalue:"defaultValue",defaultchecked:"defaultChecked",srcobject:"srcObject",novalidate:"noValidate",allowfullscreen:"allowFullscreen",disablepictureinpicture:"disablePictureInPicture",disableremoteplayback:"disableRemotePlayback"};function pa(e){return e=e.toLowerCase(),da[e]??e}function nn(e,t){var n=t==null?"":typeof t=="object"?`${t}`:t;n!==(e[ln]??(e[ln]=e.nodeValue))&&(e[ln]=n,e.nodeValue=`${n}`)}var Ce,Ie,se,$e,Xt,Zt,Tn;class Pn{constructor(t,n=!0){_e(this,"anchor");W(this,Ce,new Map);W(this,Ie,new Map);W(this,se,new Map);W(this,$e,new Set);W(this,Xt,!0);W(this,Zt,t=>{if(v(this,Ce).has(t)){var n=v(this,Ce).get(t),r=v(this,Ie).get(n);if(r)wn(r),v(this,$e).delete(n);else{var i=v(this,se).get(n);i&&(wn(i.effect),v(this,Ie).set(n,i.effect),v(this,se).delete(n),i.fragment.lastChild.remove(),this.anchor.before(i.fragment),r=i.effect)}for(const[o,s]of v(this,Ce)){if(v(this,Ce).delete(o),o===t)break;const l=v(this,se).get(s);l&&(he(l.effect),v(this,se).delete(s))}for(const[o,s]of v(this,Ie)){if(o===n||v(this,$e).has(o))continue;const l=()=>{if(Array.from(v(this,Ce).values()).includes(o)){var u=document.createDocumentFragment();Ki(s,u),u.append(Be()),v(this,se).set(o,{effect:s,fragment:u})}else he(s);v(this,$e).delete(o),v(this,Ie).delete(o)};v(this,Xt)||!r?(v(this,$e).add(o),Er(s,l,!1)):l()}}});W(this,Tn,t=>{v(this,Ce).delete(t);const n=Array.from(v(this,Ce).values());for(const[r,i]of v(this,se))n.includes(r)||(he(i.effect),v(this,se).delete(r))});this.anchor=t,ne(this,Xt,n)}ensure(t,n){var r=L,i=Ri();if(n&&!v(this,Ie).has(t)&&!v(this,se).has(t))if(i){var o=document.createDocumentFragment(),s=Be();o.append(s),v(this,se).set(t,{effect:it(()=>n(s)),fragment:o})}else v(this,Ie).set(t,it(()=>n(this.anchor)));if(v(this,Ce).set(r,t),i){for(const[l,a]of v(this,Ie))l===t?r.unskip_effect(a):r.skip_effect(a);for(const[l,a]of v(this,se))l===t?r.unskip_effect(a.effect):r.skip_effect(a.effect);r.oncommit(v(this,Zt)),r.ondiscard(v(this,Tn))}else v(this,Zt).call(this,r)}}Ce=new WeakMap,Ie=new WeakMap,se=new WeakMap,$e=new WeakMap,Xt=new WeakMap,Zt=new WeakMap,Tn=new WeakMap;function Sr(e,t,...n){var r=new Pn(e);en(()=>{const i=t()??null;r.ensure(i,i&&(o=>i(o,...n)))},He)}function ge(e,t,n=!1){var r=new Pn(e),i=n?He:0;function o(s,l){r.ensure(s,l)}en(()=>{var s=!1;t((l,a=0)=>{s=!0,o(a,l)}),s||o(-1,null)},i)}function ha(e,t,n){for(var r=[],i=t.length,o,s=t.length,l=0;l<i;l++){let h=t[l];Er(h,()=>{if(o){if(o.pending.delete(h),o.done.add(h),o.pending.size===0){var c=e.outrogroups;or(e,dr(o.done)),c.delete(o),c.size===0&&(e.outrogroups=null)}}else s-=1},!1)}if(s===0){var a=r.length===0&&n!==null&&e.pending.size===0;if(a){var u=n,f=u.parentNode;zl(f),f.append(u),e.items.clear()}or(e,t,!a)}else o={pending:new Set(t),done:new Set},(e.outrogroups??(e.outrogroups=new Set)).add(o)}function or(e,t,n=!0){var r;if(e.pending.size>0){r=new Set;for(const s of e.pending.values())for(const l of s)r.add(e.items.get(l).e)}for(var i=0;i<t.length;i++){var o=t[i];if(r!=null&&r.has(o)){o.f|=De;const s=document.createDocumentFragment();Ki(o,s)}else he(t[i],n)}}var Qr;function Vt(e,t,n,r,i,o=null){var s=e,l=new Map,a=(t&pi)!==0;if(a){var u=e;s=u.appendChild(Be())}var f=null,h=Ml(()=>{var C=n();return fr(C)?C:C==null?[]:dr(C)}),c,d=new Map,y=!0;function m(C){(T.effect.f&de)===0&&(T.pending.delete(C),T.fallback=f,ga(T,c,s,t,r),f!==null&&(c.length===0?(f.f&De)===0?wn(f):(f.f^=De,Mt(f,null,s)):Er(f,()=>{f=null})))}function g(C){T.pending.delete(C)}var _=en(()=>{c=p(h);for(var C=c.length,b=new Set,w=L,P=Ri(),S=0;S<C;S+=1){var I=c[S],E=r(I,S),A=y?null:l.get(E);A?(A.v&&Ht(A.v,I),A.i&&Ht(A.i,S),P&&w.unskip_effect(A.e)):(A=va(l,y?s:Qr??(Qr=Be()),I,E,S,i,t,n),y||(A.e.f|=De),l.set(E,A)),b.add(E)}if(C===0&&o&&!f&&(y?f=it(()=>o(s)):(f=it(()=>o(Qr??(Qr=Be()))),f.f|=De)),C>b.size&&vl(),!y)if(d.set(w,b),P){for(const[N,B]of l)b.has(N)||w.skip_effect(B.e);w.oncommit(m),w.ondiscard(g)}else m(w);p(h)}),T={effect:_,items:l,pending:d,outrogroups:null,fallback:f};y=!1}function Pt(e){for(;e!==null&&(e.f&ve)===0;)e=e.next;return e}function ga(e,t,n,r,i){var A,N,B,te,O,V,qe,on,sn;var o=(r&Js)!==0,s=t.length,l=e.items,a=Pt(e.effect.first),u,f=null,h,c=[],d=[],y,m,g,_;if(o)for(_=0;_<s;_+=1)y=t[_],m=i(y,_),g=l.get(m).e,(g.f&De)===0&&((N=(A=g.nodes)==null?void 0:A.a)==null||N.measure(),(h??(h=new Set)).add(g));for(_=0;_<s;_+=1){if(y=t[_],m=i(y,_),g=l.get(m).e,e.outrogroups!==null)for(const me of e.outrogroups)me.pending.delete(g),me.done.delete(g);if((g.f&ee)!==0&&(wn(g),o&&((te=(B=g.nodes)==null?void 0:B.a)==null||te.unfix(),(h??(h=new Set)).delete(g))),(g.f&De)!==0)if(g.f^=De,g===a)Mt(g,null,n);else{var T=f?f.next:a;g===e.effect.last&&(e.effect.last=g.prev),g.prev&&(g.prev.next=g.next),g.next&&(g.next.prev=g.prev),Fe(e,f,g),Fe(e,g,T),Mt(g,T,n),f=g,c=[],d=[],a=Pt(f.next);continue}if(g!==a){if(u!==void 0&&u.has(g)){if(c.length<d.length){var C=d[0],b;f=C.prev;var w=c[0],P=c[c.length-1];for(b=0;b<c.length;b+=1)Mt(c[b],C,n);for(b=0;b<d.length;b+=1)u.delete(d[b]);Fe(e,w.prev,P.next),Fe(e,f,w),Fe(e,P,C),a=C,f=P,_-=1,c=[],d=[]}else u.delete(g),Mt(g,a,n),Fe(e,g.prev,g.next),Fe(e,g,f===null?e.effect.first:f.next),Fe(e,f,g),f=g;continue}for(c=[],d=[];a!==null&&a!==g;)(u??(u=new Set)).add(a),d.push(a),a=Pt(a.next);if(a===null)continue}(g.f&De)===0&&c.push(g),f=g,a=Pt(g.next)}if(e.outrogroups!==null){for(const me of e.outrogroups)me.pending.size===0&&(or(e,dr(me.done)),(O=e.outrogroups)==null||O.delete(me));e.outrogroups.size===0&&(e.outrogroups=null)}if(a!==null||u!==void 0){var S=[];if(u!==void 0)for(g of u)(g.f&ee)===0&&S.push(g);for(;a!==null;)(a.f&ee)===0&&a!==e.fallback&&S.push(a),a=Pt(a.next);var I=S.length;if(I>0){var E=(r&pi)!==0&&s===0?n:null;if(o){for(_=0;_<I;_+=1)(qe=(V=S[_].nodes)==null?void 0:V.a)==null||qe.measure();for(_=0;_<I;_+=1)(sn=(on=S[_].nodes)==null?void 0:on.a)==null||sn.fix()}ha(e,S,E)}}o&&Bt(()=>{var me,at;if(h!==void 0)for(g of h)(at=(me=g.nodes)==null?void 0:me.a)==null||at.apply()})}function va(e,t,n,r,i,o,s,l){var a=(s&Xs)!==0?(s&Qs)===0?Bl(n,!1,!1):Kt(n):null,u=(s&Zs)!==0?Kt(i):null;return{v:a,i:u,e:it(()=>(o(t,a??n,u??i,l),()=>{e.delete(r)}))}}function Mt(e,t,n){if(e.nodes)for(var r=e.nodes.start,i=e.nodes.end,o=t&&(t.f&De)===0?t.nodes.start:n;r!==null;){var s=$t(r);if(o.before(r),r===i)return;r=s}}function Fe(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}function Xn(e,t,n){var r=new Pn(e);en(()=>{var i=t()??null;r.ensure(i,i&&(o=>n(o,i)))},He)}function kn(e,t,n,r,i,o){var s=null,l=e,a=new Pn(l,!1);en(()=>{const u=t()||null;var f=u==="svg"?tl:void 0;if(u===null){a.ensure(null,null);return}return a.ensure(u,h=>{if(u){if(s=Ni(u,f),Yt(s,s),r){var c=null,d=s.appendChild(Be());r(s,d),c==null||c.remove()}R.nodes.end=s,h.before(s)}}),()=>{}},He),wr(()=>{})}function ya(e,t){var n=void 0,r;Wi(()=>{n!==(n=t())&&(r&&(he(r),r=null),n&&(r=it(()=>{Fi(()=>n(e))})))})}function Ji(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Ji(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function ma(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Ji(e))&&(r&&(r+=" "),r+=t);return r}function zt(e){return typeof e=="object"?ma(e):e??""}const $r=[...`
|
|
2
|
+
\r\f \v\uFEFF`];function _a(e,t,n){var r=e==null?"":""+e;if(n){for(var i of Object.keys(n))if(n[i])r=r?r+" "+i:i;else if(r.length)for(var o=i.length,s=0;(s=r.indexOf(i,s))>=0;){var l=s+o;(s===0||$r.includes(r[s-1]))&&(l===r.length||$r.includes(r[l]))?r=(s===0?"":r.substring(0,s))+r.substring(l+1):s=l}}return r===""?null:r}function ei(e,t=!1){var n=t?" !important;":";",r="";for(var i of Object.keys(e)){var o=e[i];o!=null&&o!==""&&(r+=" "+i+": "+o+n)}return r}function Zn(e){return e[0]!=="-"||e[1]!=="-"?e.toLowerCase():e}function ba(e,t){if(t){var n="",r,i;if(Array.isArray(t)?(r=t[0],i=t[1]):r=t,e){e=String(e).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var o=!1,s=0,l=!1,a=[];r&&a.push(...Object.keys(r).map(Zn)),i&&a.push(...Object.keys(i).map(Zn));var u=0,f=-1;const m=e.length;for(var h=0;h<m;h++){var c=e[h];if(l?c==="/"&&e[h-1]==="*"&&(l=!1):o?o===c&&(o=!1):c==="/"&&e[h+1]==="*"?l=!0:c==='"'||c==="'"?o=c:c==="("?s++:c===")"&&s--,!l&&o===!1&&s===0){if(c===":"&&f===-1)f=h;else if(c===";"||h===m-1){if(f!==-1){var d=Zn(e.substring(u,f).trim());if(!a.includes(d)){c!==";"&&h++;var y=e.substring(u,h).trim();n+=" "+y+";"}}u=h+1,f=-1}}}}return r&&(n+=ei(r)),i&&(n+=ei(i,!0)),n=n.trim(),n===""?null:n}return e==null?null:String(e)}function St(e,t,n,r,i,o){var s=e[Hr];if(s!==n||s===void 0){var l=_a(n,r,o);l==null?e.removeAttribute("class"):t?e.className=l:e.setAttribute("class",l),e[Hr]=n}else if(o&&i!==o)for(var a in o){var u=!!o[a];(i==null||u!==!!i[a])&&e.classList.toggle(a,u)}return o}function Jn(e,t={},n,r){for(var i in n){var o=n[i];t[i]!==o&&(n[i]==null?e.style.removeProperty(i):e.style.setProperty(i,o,r))}}function J(e,t,n,r){var i=e[Gr];if(i!==t){var o=ba(t,r);o==null?e.removeAttribute("style"):e.style.cssText=o,e[Gr]=t}else r&&(Array.isArray(r)?(Jn(e,n==null?void 0:n[0],r[0]),Jn(e,n==null?void 0:n[1],r[1],"important")):Jn(e,n,r));return r}function sr(e,t,n=!1){if(e.multiple){if(t==null)return;if(!fr(t))return Sl();for(var r of e.options)r.selected=t.includes(ti(r));return}for(r of e.options){var i=ti(r);if(Kl(i,t)){r.selected=!0;return}}(!n||t!==void 0)&&(e.selectedIndex=-1)}function wa(e){var t=new MutationObserver(()=>{"__value"in e&&sr(e,e.__value)});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),wr(()=>{t.disconnect()})}function ti(e){return"__value"in e?e.__value:e.value}const kt=Symbol("class"),Lt=Symbol("style"),Qi=Symbol("is custom element"),$i=Symbol("is html"),Ca=gr?"input":"INPUT",Aa=gr?"option":"OPTION",Ea=gr?"select":"SELECT";function Sa(e,t){t?e.hasAttribute("selected")||e.setAttribute("selected",""):e.removeAttribute("selected")}function nt(e,t,n,r){var i=to(e);i[t]!==(i[t]=n)&&(t==="loading"&&(e[hl]=n),n==null?e.removeAttribute(t):typeof n!="string"&&no(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function Ta(e,t,n,r,i=!1,o=!1){var s=to(e),l=s[Qi],a=!s[$i],u=t||{},f=e.nodeName===Aa;for(var h in t)h in n||(n[h]=null);n.class?n.class=zt(n.class):n[kt]&&(n.class=null),n[Lt]&&(n.style??(n.style=null));var c=no(e);if(e.nodeName===Ca&&"type"in n&&("value"in n||"__value"in n)){var d=n.type;(d!==u.type||d===void 0&&e.hasAttribute("type"))&&(u.type=d,nt(e,"type",d))}for(const b in n){let w=n[b];if(f&&b==="value"&&w==null){e.value=e.__value="",u[b]=w;continue}if(b==="class"){var y=e.namespaceURI==="http://www.w3.org/1999/xhtml";St(e,y,w,r,t==null?void 0:t[kt],n[kt]),u[b]=w,u[kt]=n[kt];continue}if(b==="style"){J(e,w,t==null?void 0:t[Lt],n[Lt]),u[b]=w,u[Lt]=n[Lt];continue}var m=u[b];if(!(w===m&&!(w===void 0&&e.hasAttribute(b)))){u[b]=w;var g=b[0]+b[1];if(g!=="$$")if(g==="on"){const P={},S="$$"+b;let I=b.slice(2);var _=fa(I);if(ua(I)&&(I=I.slice(0,-7),P.capture=!0),!_&&m){if(w!=null)continue;e.removeEventListener(I,u[S],P),u[S]=null}if(_)ia(I,e,w),oa([I]);else if(w!=null){let E=function(A){u[b].call(this,A)};u[S]=ra(I,e,E,P)}}else if(b==="style")nt(e,b,w);else if(b==="autofocus")xl(e,!!w);else if(!l&&(b==="__value"||b==="value"&&w!=null))e.value=e.__value=w;else if(b==="selected"&&f)Sa(e,w);else{var T=b;a||(T=pa(T));var C=T==="defaultValue"||T==="defaultChecked";if(w==null&&!l&&!C)if(s[b]=null,T==="value"||T==="checked"){let P=e;const S=t===void 0;if(T==="value"){let I=P.defaultValue;P.removeAttribute(T),P.defaultValue=I,P.value=P.__value=S?I:null}else{let I=P.defaultChecked;P.removeAttribute(T),P.defaultChecked=I,P.checked=S?I:!1}}else e.removeAttribute(b);else C||c.includes(T)&&(l||typeof w!="string")?(e[T]=w,T in s&&(s[T]=K)):typeof w!="function"&&nt(e,T,w)}}}return u}function eo(e,t,n=[],r=[],i=[],o,s=!1,l=!1){Ci(i,n,r,a=>{var u=void 0,f={},h=e.nodeName===Ea,c=!1;if(Wi(()=>{var y=t(...a.map(p)),m=Ta(e,u,y,o,s,l);c&&h&&"value"in y&&sr(e,y.value);for(let _ of Object.getOwnPropertySymbols(f))y[_]||he(f[_]);for(let _ of Object.getOwnPropertySymbols(y)){var g=y[_];_.description===nl&&(!u||g!==u[_])&&(f[_]&&he(f[_]),f[_]=it(()=>ya(e,()=>g))),m[_]=g}u=m}),h){var d=e;Fi(()=>{sr(d,u.value,!0),wa(d)})}c=!0})}function to(e){return e[Hn]??(e[Hn]={[Qi]:e.nodeName.includes("-"),[$i]:e.namespaceURI===hi})}var ni=new Map;function no(e){var t=e.getAttribute("is")||e.nodeName,n=ni.get(t);if(n)return n;ni.set(t,n=[]);for(var r,i=e,o=Element.prototype;o!==i;){r=ol(i);for(var s in r)r[s].set&&s!=="innerHTML"&&s!=="textContent"&&s!=="innerText"&&n.push(s);i=vi(i)}return n}const Ia={get(e,t){let n=e.props.length;for(;n--;){let r=e.props[n];if(Dt(r)&&(r=r()),typeof r=="object"&&r!==null&&t in r)return r[t]}},set(e,t,n){let r=e.props.length;for(;r--;){let i=e.props[r];Dt(i)&&(i=i());const o=Ft(i,t);if(o&&o.set)return o.set(n),!0}return!1},getOwnPropertyDescriptor(e,t){let n=e.props.length;for(;n--;){let r=e.props[n];if(Dt(r)&&(r=r()),typeof r=="object"&&r!==null&&t in r){const i=Ft(r,t);return i&&!i.configurable&&(i.configurable=!0),i}}},has(e,t){if(t===vt||t===pl)return!1;for(let n of e.props)if(Dt(n)&&(n=n()),n!=null&&t in n)return!0;return!1},ownKeys(e){const t=[];for(let n of e.props)if(Dt(n)&&(n=n()),!!n){for(const r in n)t.includes(r)||t.push(r);for(const r of Object.getOwnPropertySymbols(n))t.includes(r)||t.push(r)}return t}};function Qn(...e){return new Proxy({props:e},Ia)}function ce(e,t,n,r){var i=r,o=!0,s=()=>(o&&(o=!1,i=r),i),l;l=e[t],l===void 0&&r!==void 0&&(l=s());var a;return a=()=>{var u=e[t];return u===void 0?s():(o=!0,u)},a}const It="default";function Tr(e,t){return!(e!=null&&e.length)||e===It?t:`${e}/${t}`}const Da=`RuleCMS widget: this widget config uses components from the default component library, but no "default" library is registered. The default library is registered by the consumer app: add the RuleCMS default source components package as a direct dependency and register it, e.g. libraries: { default: sourceComponentsModule } (statically imported for SSR) or libraries: { default: () => import('<default source components package>') }. See the @rulecms/widget-svelte README.`;function ri(e){if(!e||typeof e!="object")return!1;const t=e;return!!t.manifest&&typeof t.manifest=="object"&&!!t.components&&typeof t.components=="object"&&!Array.isArray(t.components)}function Pa(e){if(ri(e))return e;const t=e;return ri(t==null?void 0:t.default)?t.default:null}function $n(e){return e.usesDefaultLibrary?[It,...e.libraryIds]:[...e.libraryIds]}function ii({registrations:e,referenced:t}){if(t.usesDefaultLibrary&&!(e!=null&&e[It]))throw new Error(Da)}function ka(e){const t=[],n=new Set;for(const r of e.values()){if(typeof r.stylesheet!="string")continue;const i=r.stylesheet.trim();!i||n.has(i)||(n.add(i),t.push(i))}return t.length>0?t:void 0}function ro(e){const t={};for(const[r,i]of e){const o=r===It;for(const[s,l]of Object.entries(i.components))t[o?s:`${r}/${s}`]=l}const n=ka(e);return n?{components:t,stylesheets:n}:{components:t}}function rn(){const e=new Map,t=new Map,n=new Map,r=new Map;let i=0;function o(u,f){var h;e.get(u)!==f&&((h=f.manifest)!=null&&h.id&&f.manifest.id!==u&&console.warn(`RuleCMS widget: component library registered as "${u}" declares manifest id "${f.manifest.id}". The registered id wins for resolution.`),e.set(u,f),i+=1)}function s(u){const f=$n(u),h=[...f].sort().join("|"),c=r.get(h);if(c&&c.loadedVersion===i)return c.plugin;const d=new Map;for(const m of f){const g=e.get(m);g&&d.set(m,g)}const y=ro(d);return r.set(h,{loadedVersion:i,plugin:y}),y}function l(u){ii(u);const{registrations:f,referenced:h}=u;for(const c of $n(h)){if(e.has(c)||n.has(c))continue;const d=f==null?void 0:f[c];if(!d){console.error(`RuleCMS widget: no component library registered for libraryId "${c}"; its components will not render.`),n.set(c,new Error(`No registration for libraryId "${c}"`));continue}if(typeof d=="function")return null;o(c,d)}return s(h)}async function a(u){ii(u);const{registrations:f,referenced:h}=u,c=$n(h);return await Promise.all(c.map(async d=>{if(e.has(d)||n.has(d))return;const y=f==null?void 0:f[d];if(!y){console.error(`RuleCMS widget: no component library registered for libraryId "${d}"; its components will not render.`),n.set(d,new Error(`No registration for libraryId "${d}"`));return}if(typeof y!="function"){o(d,y);return}let m=t.get(d);m||(m=y().then(g=>{const _=Pa(g);if(!_)throw new Error(`Registration for libraryId "${d}" did not resolve to a ComponentLibraryModule (expected { manifest, components }).`);o(d,_)}).catch(g=>{n.set(d,g),console.error(`RuleCMS widget: failed to load component library "${d}":`,g)}).finally(()=>{t.delete(d)}),t.set(d,m)),await m})),s(h)}return{resolveSync:l,resolve:a}}const La={Preview:"Preview",Compose:"Compose",RenderedPage:"RenderedPage"},Ln={DroppableBox:"droppable-box"},lr={FlexStart:"flex-start",FlexEnd:"flex-end",Center:"center",SpaceBetween:"space-between",SpaceAround:"space-around",SpaceEvenly:"space-evenly"},xa={FlexStart:"flex-start",FlexEnd:"flex-end",Center:"center",SpaceBetween:"space-between",SpaceAround:"space-around",SpaceEvenly:"space-evenly",Stretch:"stretch"},Cn="cssAttrArray",Ra={Phone:"phone",Tablet:"tablet",Desktop:"desktop"},Ir={ComposerComponent:"ComposerWidget",Collection:"Collection",MoveComponentHandle:"MoveWidgetHandle"},Dr=`${Ir.Collection}_`,io="dev.",oo="https://rulecms.com",so="https://widget-cache.rulecms.com",lo="/api/v1/c/widget/get",ao="/api/v1/c/dev/widget/get";function ot(e){return typeof e=="string"&&e.startsWith(io)}function uo(e,t){return t?t.replace(/\/$/,""):ot(e)?oo:so}function Pr({publishedKey:e,token:t,endpoint:n}){const r=ot(t),i=r?ao:lo,o=r?new URLSearchParams({widgetKey:e,token:t}):new URLSearchParams({publishedKey:e,token:t});return`${uo(t,n)}${i}?${o.toString()}`}const Na=({id:e,prefix:t})=>`${t}_${e}`,co=e=>{if(!(e!=null&&e.length)||!e.includes("_")){console.error(`Invalid drag item id: ${e}. Type does not exist.`);return}return fo(e)},kr=e=>e.includes("_"),fo=e=>{const t=e.indexOf("_"),n=e.substring(0,t),r=e.substring(t+1);return{prefix:n,id:r}},Lr=e=>{if(!kr(e))return;const n=co(e);return(n==null?void 0:n.prefix)===Ir.Collection||console.error("getCollectionIdForCollectionType - Invalid component type: ${componentType}. Invalid prefix type."),n==null?void 0:n.id},Ma=e=>{if(!(e!=null&&e.length)){console.error("getNameAndInstanceIdFromWidgetKey: Missing widget key");return}const t=e.split("$");if(t.length<2){console.error("getNameAndInstanceIdFromWidgetKey: Invalid widget key format");return}const n=t[0];if(!t[1].includes("@"))return{name:n,instanceId:t[1]};const i=t[1].split("@");return{name:n,instanceId:i[0],parentId:i[1]}},Oa=e=>{if(!(e!=null&&e.length))return{errorMessage:"getNameFromWidgetKey: Missing widget key"};const t=e.split("$");return t.length<2?{errorMessage:"getNameFromWidgetKey: Invalid widget key format"}:{name:t[0]}},po=e=>{var i,o,s,l;if(!e)return{error:"getWidgetKeyForCollection: Missing collection"};if(!((i=e.name)!=null&&i.length))return{error:"getWidgetKeyForCollection: Missing collection name"};const t=(o=e.name)==null?void 0:o.trim().toLowerCase();if(!((s=e.id)!=null&&s.length))return{error:"getWidgetKeyForCollection: Missing collection id"};const r=((l=e.parentId)==null?void 0:l.length)?`${e.id}@${e.parentId}`:`${e.id}`;return{data:`${t}$${r}`}},ho=e=>{var i,o,s,l;if(!e)return{error:"getWidgetKeyForPublishedCollection: Missing collection"};if(!((i=e.name)!=null&&i.length))return{error:"getWidgetKeyForPublishedCollection: Missing collection name"};const t=(o=e.name)==null?void 0:o.trim().toLowerCase();if(!((s=e.publishedKey)!=null&&s.length))return{error:"getWidgetKeyForPublishedCollection: Missing collection publishedKey"};const r=((l=e.parentId)==null?void 0:l.length)?`${e.publishedKey}@${e.parentId}`:`${e.publishedKey}`;return{data:`${t}$${r}`}},Fa=e=>{const t=po(e);return`${Dr}${t.data}`},Wa=e=>{const t=ho(e);return`${Dr}${t.data}`},go="---",vo="___";function yo(e,t){return`${e}${go}${t}`}function Va(e,t,n){return`${yo(e,t)}${vo}${n}`}function ja(e){const t=e.split(".");if(t.length!==3)throw new Error(`Invalid version format: ${e}. Expected format: x.y.z`);const n=t[0],r=t[1],i=parseInt(t[2],10);if(isNaN(i))throw new Error(`Invalid patch version: ${t[2]}. Expected a number.`);return`${n}.${r}.${i+1}`}function xn({displayItemList:e,widgetCollections:t}){const n=new Set;let r=!1;const i=o=>{var s,l,a;if((s=o==null?void 0:o.rows)!=null&&s.length){for(const u of o.rows)if((l=u==null?void 0:u.columns)!=null&&l.length)for(const f of u.columns)f.collection&&i(f.collection.collectionRows),!(!f.type||f.type===Ln.DroppableBox)&&(kr(f.type)||(!((a=f.libraryId)!=null&&a.length)||f.libraryId===It?r=!0:n.add(f.libraryId)))}};i(e);for(const o of Object.values(t??{}))i(o==null?void 0:o.collectionRows);return{libraryIds:Array.from(n),usesDefaultLibrary:r}}const xr=Symbol("rulecms-widget-context");function Ba(){return{token:"",endpoint:void 0,libraries:void 0,libraryRegistry:rn()}}function Ua(e,t){Le(t,!0);const n=ht(Ba());Cr(()=>{n.token=t.token,n.endpoint=t.endpoint,n.libraries=t.libraries}),tr.setContext(xr,n);var r=Z(),i=z(r);Sr(i,()=>t.children),x(e,r),xe()}const mo="1200px",Rr="500px",Nr="820px",Ka=mo,_o="rulecms",Ha=1920,Ga={f:"auto",q:"auto",c:"limit"},Ya=/^[A-Za-z0-9][A-Za-z0-9._\-/]*$/,za=300,qa=/^[A-Za-z0-9][A-Za-z0-9_-]*$/,Xa=100,Za=/^https:\/\/[^\s"'()\\<>]+$/,Ja=2e3,Qa=/^[A-Za-z0-9_,.:\-/]*$/,$a=300,bo=e=>typeof e=="string"&&e.length<=za&&Ya.test(e),wo=e=>typeof e=="string"&&e.length<=Xa&&qa.test(e),Co=e=>typeof e=="string"&&e.length<=Ja&&Za.test(e),Ao=e=>typeof e=="string"&&e.length<=$a&&Qa.test(e),eu=e=>Object.entries(e).map(([t,n])=>`${t}_${n}`).join(","),tu=e=>{const t={};for(const n of e.split(",")){const r=n.trim(),i=r.indexOf("_");i<=0||(t[r.slice(0,i)]=r.slice(i+1))}return t},Eo=({publicId:e,cloudName:t=_o,transformations:n,width:r=Ha})=>{const i=typeof n=="string"?tu(n):n,o={...Ga,...i,w:r};return encodeURI(`https://res.cloudinary.com/${t}/image/upload/${eu(o)}/${e}`)},So=/^--[A-Za-z0-9_-]+$/,To=200,Rn=e=>{if(typeof e!="string")return!1;const t=e.trim();return t.length<=To&&So.test(t)},Se=e=>`var(${e.trim()})`,G=e=>{if(typeof e!="object"||e===null||Array.isArray(e))return;const t=e.cssVariable;if(t!=null)return Rn(t)?t.trim():void 0},Re=e=>{if(typeof e!="object"||e===null||Array.isArray(e))return!1;const t=e.cssVariable;return t==null?!1:!Rn(t)},nu=(e,t)=>{const n=G(e);return n?{[t]:Se(n)}:void 0},Io=e=>{if(typeof e!="object"||e===null||Array.isArray(e)||Re(e))return!1;if(G(e))return!0;const t=e;return t.source==="none"?!0:t.source==="url"?Co(t.url):t.source==="cloudinary"?!bo(t.publicId)||t.cloudName!==void 0&&t.cloudName!==null&&!wo(t.cloudName)?!1:t.transformations===void 0||t.transformations===null||Ao(t.transformations):!1},Do=["px","%","em","rem","vh","vw"],Nn=["inherit","unset"],Po=["allSides","top","right","bottom","left"],st=(e,t={})=>{if(typeof e!="object"||e===null||Array.isArray(e))return!1;const n=e;return Re(e)?!1:G(e)?!0:n.unit==="auto"?t.allowAuto!==!1:n.unit==="keyword"?t.allowKeywords!==!1&&Nn.includes(n.keyword):Do.includes(n.unit)?typeof n.value!="number"||!Number.isFinite(n.value)?!1:t.allowNegative!==!1||n.value>=0:!1},ko=(e,t={})=>{if(typeof e!="object"||e===null||Array.isArray(e))return!1;const n=e;for(const r of Po){const i=n[r];if(i!=null&&!st(i,t))return!1}return!0},ru=[...Nn,"transparent","currentColor"],iu=/^(#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})|rgba?\([^)]+\)|hsla?\([^)]+\))$/,Mn=e=>{if(typeof e!="object"||e===null||Array.isArray(e))return!1;const t=e;return Re(e)?!1:G(e)?!0:t.unit==="keyword"?ru.includes(t.keyword):t.unit==="color"?typeof t.value=="string"&&iu.test(t.value.trim()):!1},On=e=>{const t=G(e);return t?Se(t):"unit"in e?e.unit==="keyword"?e.keyword:e.value.trim():""},Lo=(e,t)=>typeof e=="object"&&e!==null&&!Array.isArray(e)?!Re(e)&&!!G(e):typeof e!="string"||!e.length?!1:t.includes(e)?!0:Nn.includes(e),xo=['system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif','Georgia, "Times New Roman", Times, serif',"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace","Arial, Helvetica, sans-serif",'"Helvetica Neue", Helvetica, Arial, sans-serif',"Verdana, Geneva, sans-serif"],Ro=["normal","bold","100","200","300","400","500","600","700","800","900"],No=["normal","italic","oblique"],Mo=["left","center","right","justify","start","end"],Oo=["none","underline","line-through","overline"],Fo=["none","uppercase","lowercase","capitalize"],fn=["visible","hidden","scroll","auto","clip"],Wo=["auto","none"],Vo=["flex-start","flex-end","center","space-between","space-around","space-evenly"],jo=["flex-start","flex-end","center","baseline","stretch"],Bo=["wrap","nowrap"],Uo=["flex-start","flex-end","center","space-between","space-around","space-evenly","stretch"],Ko=["row","row-reverse","column","column-reverse"],Ho=["cover","contain","auto"],Go=["center center","center top","center bottom","left center","left top","left bottom","right center","right top","right bottom"],Yo=["no-repeat","repeat","repeat-x","repeat-y","space","round"],zo=["justifyContent","alignItems","flexWrap","alignContent","flexDirection"],qo=["none","solid","dashed","dotted","double","groove","ridge","inset","outset"],Xo=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?!Re(e)&&!!G(e):qo.includes(e),Zo=e=>{if(typeof e!="object"||e===null||Array.isArray(e))return!1;const t=e;return Re(e)?!1:G(e)?!0:!(t.width!==void 0&&t.width!==null&&!st(t.width,{allowAuto:!1,allowNegative:!1})||t.style!==void 0&&t.style!==null&&!Xo(t.style)||t.color!==void 0&&t.color!==null&&!Mn(t.color))},ou={allowAuto:!1,allowKeywords:!1,allowNegative:!0},su={allowAuto:!1,allowKeywords:!1,allowNegative:!1},Jo=e=>{if(typeof e!="object"||e===null||Array.isArray(e))return!1;const t=e;if(Re(e))return!1;if(G(e))return!0;for(const n of["offsetX","offsetY","spread"]){const r=t[n];if(r!=null&&!st(r,ou))return!1}return!(t.blur!==void 0&&t.blur!==null&&!st(t.blur,su)||t.color!==void 0&&t.color!==null&&!Mn(t.color)||t.inset!==void 0&&t.inset!==null&&typeof t.inset!="boolean")},Qo=e=>e?e.cssVariable!==void 0&&e.cssVariable!==null||e.offsetX!==void 0||e.offsetY!==void 0||e.blur!==void 0||e.spread!==void 0||e.color!==void 0:!1,$o=e=>{if(typeof e!="object"||e===null||Array.isArray(e))return!1;const t=e;return Re(e)?!1:G(e)?!0:t.unit==="number"?typeof t.value=="number"&&Number.isFinite(t.value)&&t.value>0:st(e,{allowAuto:!1,allowNegative:!1})},es=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?!Re(e)&&!!G(e):typeof e=="number"&&Number.isFinite(e)&&e>=0&&e<=1,ts=e=>{if(!Io(e))return{};const t=G(e);if(t)return{backgroundImage:Se(t)};const n=e;return n.source==="none"?{backgroundImage:"none"}:n.source==="url"?{backgroundImage:`url("${n.url}")`}:{backgroundImage:`url("${Eo({publicId:n.publicId,cloudName:n.cloudName,transformations:n.transformations})}")`}},lt=e=>{const t=G(e);return t?Se(t):"unit"in e?e.unit==="auto"?"auto":e.unit==="keyword"?e.keyword:`${e.value}${e.unit}`:""},ns=e=>{if(!Zo(e))return{};const t=G(e);if(t)return{border:Se(t)};const n={};if(e.width&&(n.borderWidth=lt(e.width)),e.style){const r=G(e.style);n.borderStyle=r?Se(r):e.style}return e.color&&(n.borderColor=On(e.color)),n},an=e=>e?lt(e):"0px",rs=e=>{if(!Jo(e)||!Qo(e))return{};const t=G(e);if(t)return{boxShadow:Se(t)};const n=[an(e.offsetX),an(e.offsetY),an(e.blur),an(e.spread)];return e.color&&n.push(On(e.color)),e.inset&&n.unshift("inset"),{boxShadow:n.join(" ")}},lu=e=>`${e.charAt(0).toUpperCase()}${e.slice(1)}`,is=(e,t)=>{if(!ko(e))return{};if(e.allSides)return{[t]:lt(e.allSides)};const n={};for(const r of["top","right","bottom","left"]){const i=e[r];i&&(n[`${t}${lu(r)}`]=lt(i))}return n},os=(e,t)=>Mn(e)?{[t]:On(e)}:{},ss=(e,t,n)=>{if(!Lo(e,n))return{};const r=G(e);return r?{[t]:Se(r)}:{[t]:e}},ls=(e,t,n={})=>st(e,n)?{[t]:lt(e)}:{},as=e=>{if(!$o(e))return{};const t=G(e);return t?{lineHeight:Se(t)}:"unit"in e&&e.unit==="number"?{lineHeight:e.value}:{lineHeight:lt(e)}},us=e=>{if(!es(e))return{};const t=G(e);return t?{opacity:Se(t)}:{opacity:e}},Fn={"margin-3-resolutions":{kind:"boxSpacing",cssProperty:"margin"},"padding-3-resolutions":{kind:"boxSpacing",cssProperty:"padding"},"border-3-resolutions":{kind:"border"},"box-shadow-3-resolutions":{kind:"boxShadow"},"border-radius-3-resolutions":{kind:"length",cssProperty:"borderRadius",capabilities:{allowAuto:!1,allowNegative:!1}},"width-3-resolutions":{kind:"length",cssProperty:"width",capabilities:{allowAuto:!0,allowNegative:!1}},"height-3-resolutions":{kind:"length",cssProperty:"height",capabilities:{allowAuto:!0,allowNegative:!1}},"min-width-3-resolutions":{kind:"length",cssProperty:"minWidth",capabilities:{allowAuto:!1,allowNegative:!1}},"max-width-3-resolutions":{kind:"length",cssProperty:"maxWidth",capabilities:{allowAuto:!1,allowNegative:!1}},"min-height-3-resolutions":{kind:"length",cssProperty:"minHeight",capabilities:{allowAuto:!1,allowNegative:!1}},"max-height-3-resolutions":{kind:"length",cssProperty:"maxHeight",capabilities:{allowAuto:!1,allowNegative:!1}},"gap-3-resolutions":{kind:"length",cssProperty:"gap",capabilities:{allowAuto:!1,allowNegative:!1}},"justify-content-3-resolutions":{kind:"enum",cssProperty:"justifyContent",allowedValues:Vo},"align-items-3-resolutions":{kind:"enum",cssProperty:"alignItems",allowedValues:jo},"flex-wrap-3-resolutions":{kind:"enum",cssProperty:"flexWrap",allowedValues:Bo},"align-content-3-resolutions":{kind:"enum",cssProperty:"alignContent",allowedValues:Uo},"flex-direction-3-resolutions":{kind:"enum",cssProperty:"flexDirection",allowedValues:Ko},"overflow-3-resolutions":{kind:"enum",cssProperty:"overflow",allowedValues:fn},"overflow-x-3-resolutions":{kind:"enum",cssProperty:"overflowX",allowedValues:fn},"overflow-y-3-resolutions":{kind:"enum",cssProperty:"overflowY",allowedValues:fn},"pointer-events-3-resolutions":{kind:"enum",cssProperty:"pointerEvents",allowedValues:Wo},"background-color-3-resolutions":{kind:"color",cssProperty:"backgroundColor"},"color-3-resolutions":{kind:"color",cssProperty:"color"},"background-image-3-resolutions":{kind:"backgroundImage"},"background-size-3-resolutions":{kind:"enum",cssProperty:"backgroundSize",allowedValues:Ho},"background-position-3-resolutions":{kind:"enum",cssProperty:"backgroundPosition",allowedValues:Go},"background-repeat-3-resolutions":{kind:"enum",cssProperty:"backgroundRepeat",allowedValues:Yo},"opacity-3-resolutions":{kind:"opacity"},"font-family-3-resolutions":{kind:"enum",cssProperty:"fontFamily",allowedValues:xo},"font-size-3-resolutions":{kind:"length",cssProperty:"fontSize",capabilities:{allowAuto:!1,allowNegative:!1}},"font-weight-3-resolutions":{kind:"enum",cssProperty:"fontWeight",allowedValues:Ro},"font-style-3-resolutions":{kind:"enum",cssProperty:"fontStyle",allowedValues:No},"line-height-3-resolutions":{kind:"lineHeight"},"letter-spacing-3-resolutions":{kind:"length",cssProperty:"letterSpacing",capabilities:{allowAuto:!1,allowNegative:!0}},"text-align-3-resolutions":{kind:"enum",cssProperty:"textAlign",allowedValues:Mo},"text-decoration-3-resolutions":{kind:"enum",cssProperty:"textDecoration",allowedValues:Oo},"text-transform-3-resolutions":{kind:"enum",cssProperty:"textTransform",allowedValues:Fo}},cs=(e,t)=>{const n=Fn[e];if(!n)return{};switch(n.kind){case"boxSpacing":return is(t,n.cssProperty);case"length":return ls(t,n.cssProperty,n.capabilities);case"border":return ns(t);case"boxShadow":return rs(t);case"color":return os(t,n.cssProperty);case"opacity":return us(t);case"enum":return ss(t,n.cssProperty,n.allowedValues);case"lineHeight":return as(t);case"backgroundImage":return ts(t);default:return{}}},au=Object.fromEntries(Object.entries(Fn).filter(([,e])=>e.kind==="boxSpacing").map(([e,t])=>[e,t.cssProperty])),uu=e=>e!=null&&e!=="",fs=e=>e?!zo.some(n=>uu(e[n]))||e.display==="flex"?e:{...e,display:"flex"}:{},ds=({dbEntryType:e,libraryId:t,sourceComponentsPlugin:n})=>{if(!(e!=null&&e.length))return;const r=n.components[Tr(t,e)];if(!r||!("defaultAttributeValues"in r))return;const o=r.defaultAttributeValues;if(o!=null&&o.length)return o.reduce((s,l)=>({...s,[l.name]:l.defaultValues}),{})},Oe=({deviceDisplayType:e,componentAttributes:t})=>{if(!t)return;const n={},r={};for(const[i,o]of Object.entries(t)){if(!i.includes("3-resolutions")||!o)continue;const s=o.all,l=s??o[e.toLowerCase()];r[i]=l,Fn[i]&&Object.assign(n,cs(i,l))}return Object.keys(n).length||Object.keys(r).length?{styles:Object.keys(n).length?n:void 0,componentAttributesSpecificToDeviceType:Object.keys(r).length?r:void 0}:void 0},ps=({defaultAttributes:e,userModifiedAttributes:t})=>e?t?{...e,...t}:e:t;function jt(e){return e.componentAttributes??e.widgetAttributes}function ar({col:e,deviceDisplayType:t,isComposeMode:n,sourceComponentsPlugin:r}){const i=jt(e),o=ds({dbEntryType:e.type,libraryId:e.libraryId,sourceComponentsPlugin:r})||[],s=ps({defaultAttributes:o,userModifiedAttributes:i}),{styles:l,componentAttributesSpecificToDeviceType:a}=Oe({deviceDisplayType:t,componentAttributes:s})||{styles:void 0,componentAttributesSpecificToDeviceType:void 0};let u={};const f={};if(l)for(const[c,d]of Object.entries(l))n&&f[c]||(u={...u,[c]:d});let h=jt(e);for(const c in a)if(c.includes("3-resolutions")){h={...jt(e)||{},...a||{}};break}return{componentAttributesBasedOnDevice:h,componentStyles:fs(u)}}const hs=e=>{const t=(e==null?void 0:e.rows)||[];for(const n of t)if(((n==null?void 0:n.columns)||[]).length>0)return!0;return(e==null?void 0:e.containerAttributes)&&Object.keys(e.containerAttributes).length>0},gs="var(--sl-spacing-x-small)";function vs(e){return e!=null&&e.horizontalAlignment||e!=null&&e.verticalAlignment||e!=null&&e.flexWrap||e!=null&&e.gap||e!=null&&e.alignContent?!0:!!(e!=null&&e.rowAttributes&&Object.keys(e.rowAttributes).length>0)}function ys({row:e,deviceDisplayType:t}){var r;const n=Oe({deviceDisplayType:t,componentAttributes:e.rowAttributes});return((r=n==null?void 0:n.componentAttributesSpecificToDeviceType)==null?void 0:r["hide-component-3-resolutions"])==="true"}function ms({row:e,deviceDisplayType:t,isComposeMode:n}){var d;const r=((d=Oe({deviceDisplayType:t,componentAttributes:e.rowAttributes}))==null?void 0:d.styles)||{},i=r.justifyContent??e.horizontalAlignment??lr.Center,o=r.alignItems??e.verticalAlignment??lr.Center,s=r.flexDirection??"row",l=r.gap??e.gap??gs,a=n?"nowrap":r.flexWrap??e.flexWrap??"nowrap",u=r.alignContent??e.alignContent??void 0,f=new Set(["justifyContent","alignItems","flexDirection","gap","flexWrap","alignContent","display"]),h={};for(const[y,m]of Object.entries(r))f.has(y)||(h[y]=m);const c={display:"flex",flexDirection:s,gap:l,flexWrap:a,justifyContent:i,alignItems:o,...h};return u!==void 0&&(c.alignContent=u),c}const Wn="css-classes-3-resolutions",cu=500,fu=/[\x00-\x1f\x7f]/g,Vn=e=>{if(typeof e!="string")return;const t=new Set,n=[];for(const i of e.split(/\s+/)){const o=i.replace(fu,"");o&&(t.has(o)||(t.add(o),n.push(o)))}if(!n.length)return;let r="";for(const i of n){const o=r?`${r} ${i}`:i;if(o.length>cu)break;r=o}return r.length?r:void 0},Mr="hide-component-3-resolutions",_s="pointer-events-3-resolutions",bs=["width-3-resolutions","min-width-3-resolutions","max-width-3-resolutions","height-3-resolutions","min-height-3-resolutions","max-height-3-resolutions","margin-3-resolutions","padding-3-resolutions","border-3-resolutions","border-radius-3-resolutions","box-shadow-3-resolutions","overflow-3-resolutions","overflow-x-3-resolutions","overflow-y-3-resolutions",Mr,_s],du=new Set(bs);function jn({containerAttributes:e,deviceDisplayType:t}){var r;const n=Oe({deviceDisplayType:t,componentAttributes:e});return((r=n==null?void 0:n.componentAttributesSpecificToDeviceType)==null?void 0:r[Mr])==="true"}function Or({containerAttributes:e,deviceDisplayType:t,isComposeMode:n}){var o;if(!e)return{styles:{}};const r=n?Object.fromEntries(Object.entries(e).filter(([s])=>!du.has(s))):e,i=Oe({deviceDisplayType:t,componentAttributes:r});return{styles:(i==null?void 0:i.styles)??{},cssClasses:Vn((o=i==null?void 0:i.componentAttributesSpecificToDeviceType)==null?void 0:o[Wn])}}function ws(e){return Object.keys(e.styles).length>0||!!e.cssClasses}function Fr({containerAttributes:e,widgetContainerStyles:t}){return((e==null?void 0:e[Cn])||[]).some(r=>r.toLowerCase().startsWith("height:"))||t.styles.height!==void 0}const Cs="z-index-3-resolutions",Wr=0;function As(e){var t,n;return!!((n=(t=e==null?void 0:e.overlayLayers)==null?void 0:t.layers)!=null&&n.length)}function ur({containerAttributes:e,deviceDisplayType:t}){var i;const n=Oe({deviceDisplayType:t,componentAttributes:e}),r=(i=n==null?void 0:n.componentAttributesSpecificToDeviceType)==null?void 0:i[Cs];if(typeof r=="number"&&Number.isFinite(r))return r;if(typeof r=="string"&&r.trim().length){const o=Number(r);if(Number.isFinite(o))return o}return Wr}function Es(e,t){return e+t+1}function Ss({containerAttributes:e,deviceDisplayType:t}){var i;const n=Oe({deviceDisplayType:t,componentAttributes:e}),r=(i=n==null?void 0:n.styles)==null?void 0:i.pointerEvents;return typeof r=="string"?r:void 0}function Ts({layer:e,deviceDisplayType:t}){var n;return(n=e==null?void 0:e.rows)!=null&&n.length?jn({containerAttributes:e.containerAttributes,deviceDisplayType:t}):!0}function Is({isWithinCollection:e,baseDeclaresOwnHeight:t,baseZIndex:n}){return{position:"relative",isolation:"isolate",display:"flex",flexDirection:"column",...t?{}:{height:e?"auto":"100%"},...n===Wr?{}:{zIndex:n}}}function Ds({zIndex:e,pointerEvents:t}){return{position:"absolute",top:0,left:0,width:"100%",height:"100%",boxSizing:"border-box",zIndex:e,...t?{pointerEvents:t}:{}}}function Q(e){if(!e)return;const t=[];for(const[n,r]of Object.entries(e)){if(r==null||r==="")continue;const i=n.replace(/[A-Z]/g,o=>`-${o.toLowerCase()}`);t.push(`${i}: ${r}`)}return t.length>0?t.join("; "):void 0}const Bn="/";function Ps({componentProps:e,ancestorColumnIds:t,columnId:n}){if(!e||!n)return;const r=[...t??[],n];for(let i=0;i<r.length;i+=1){const o=r.slice(i).join(Bn),s=e[o];if(s)return s}}function ks({displayItemList:e,widgetCollections:t}){const n=[],r=(i,o)=>{var s;if((s=i==null?void 0:i.rows)!=null&&s.length)for(const l of i.rows)for(const a of l.columns){if(!a.id||a.type===Ln.DroppableBox)continue;const u=Lr(a.type);if(u!=null&&u.length){const f=a.collection??(t==null?void 0:t[u]);f&&!o.includes(a.id)&&r(f.collectionRows,[...o,a.id]);continue}n.push([...o,a.id].join(Bn))}};return r(e,[]),n}function pu(e,t){const n=`${Bn}${e}`;return t.some(r=>r===e||r.endsWith(n))}function Ls({componentProps:e,displayItemList:t,widgetCollections:n}){const r=e?Object.keys(e):[];if(!r.length)return[];const i=ks({displayItemList:t,widgetCollections:n});return r.filter(o=>!pu(o,i))}function xs({componentProps:e,displayItemList:t,widgetCollections:n,publishedKey:r}){if(process.env.NODE_ENV==="production")return;const i=Ls({componentProps:e,displayItemList:t,widgetCollections:n});i.length&&console.warn(`RuleCMSWidget "${r}": componentProps ${i.map(o=>`"${o}"`).join(", ")} ${i.length===1?"matches":"match"} no component in this widget, so those props were not passed to anything. Keys are column ids from the widget config — the composer's Modify drawer shows the id of the selected component.`)}function hu(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function gu(e){if(e.all!==void 0&&e.all!==null)return!1;const t=e.phone,n=e.tablet,r=e.desktop;return t!==n||t!==r||n!==r}function cr(e){var t,n;if(!((t=e==null?void 0:e.rows)!=null&&t.length))return!1;if(er(e.containerAttributes))return!0;for(const r of e.rows){if(er(r.rowAttributes))return!0;for(const i of r.columns)if(er(jt(i)))return!0}for(const r of((n=e.overlayLayers)==null?void 0:n.layers)??[])if(cr(r))return!0;return!1}function er(e){if(!e)return!1;for(const[t,n]of Object.entries(e))if(!(!t.includes("3-resolutions")||!hu(n))){if(t==="hide-component-3-resolutions"){const r=n,i=o=>o==="true"||o===!0;if(i(r.phone)!==i(r.tablet)||i(r.phone)!==i(r.desktop))return!0;continue}if(gu(n))return!0}return!1}function Rs(e,t){if(cr(e))return!0;for(const n of Object.values(t))if(cr(n.collectionRows))return!0;return!1}const Ns=parseInt(Rr,10),Ms=parseInt(Nr,10),vu=Ns+1,yu=Ms+1;function mu(e){const t=`.${e}-phone`,n=`.${e}-tablet`,r=`.${e}-desktop`;return`
|
|
3
3
|
${t}, ${n}, ${r} { display: none; }
|
|
4
|
-
@media (max-width: ${
|
|
5
|
-
@media (min-width: ${
|
|
6
|
-
@media (min-width: ${
|
|
7
|
-
`.trim()}function
|
|
8
|
-
`)}),
|
|
9
|
-
${
|
|
10
|
-
}`:""),f=D(()=>!n()&&us({containerAttributes:t.displayItemList.containerAttributes,deviceDisplayType:i()})),p=D(()=>cs({containerAttributes:t.displayItemList.containerAttributes,deviceDisplayType:i(),isComposeMode:n()})),a=D(()=>{var E;const w=((E=t.displayItemList.containerAttributes)==null?void 0:E[an])||[],S=fs(g(p));return n()&&!o()||r()||w.length>0||S||l(n(),t.displayItemList.rows,o())}),d=D(()=>[g(u)?s:void 0,g(p).cssClasses].filter(Boolean).join(" ")),y=D(()=>{var S;return{...(((S=t.displayItemList.containerAttributes)==null?void 0:S[an])||[]).some(E=>E.toLowerCase().startsWith("height:"))?{}:{height:o()?"auto":"100%"},display:"flex",flexDirection:"column",...g(p).styles}}),m=D(()=>g(a)?g(d):""),h=D(()=>g(f)?{display:"none"}:g(a)?g(y):{display:"contents"});var _=$a(),A=_e(_);{var P=w=>{var S=ie(),E=q(S);yr(E,()=>"style",!1,(b,I)=>{var T=gr();le(()=>En(T,g(c))),M(I,T)}),M(w,S)};De(A,w=>{g(u)&&w(P)})}var C=Ct(A,2);vr(C,()=>t.children),le(w=>{ht(_,"hidden",g(f)||void 0),St(_,1,Gt(g(m)||void 0)),ne(_,w)},[()=>re(g(h))]),M(e,_),Ne()}var tu=Pe("<div><!></div>");function nu(e,t){Me(t,!0);let n=ae(t,"isComposeMode",3,!1),r=ae(t,"showDropContainers",3,!1),o=ae(t,"isWithinCollection",3,!1),i=ae(t,"deviceDisplayType",3,"Desktop");function s(m,h,_){var P;const A=m&&!_?3:1;return!!((P=h==null?void 0:h.columns)!=null&&P.length)&&h.columns.length>A}const l=D(()=>!n()&&ss({row:t.row,deviceDisplayType:i()})),u=D(()=>r()||is(t.row)||s(n(),t.row,o())),c=D(()=>ls({row:t.row,deviceDisplayType:i(),isComposeMode:n()})),f=D(()=>{var h;const m=ot({deviceDisplayType:i(),componentAttributes:t.row.rowAttributes});return Mn((h=m==null?void 0:m.componentAttributesSpecificToDeviceType)==null?void 0:h[xn])??""}),p=D(()=>g(u)?g(f):""),a=D(()=>g(l)?{display:"none"}:g(u)?g(c):{display:"contents"});var d=tu(),y=_e(d);vr(y,()=>t.children),le(m=>{ht(d,"hidden",g(l)||void 0),St(d,1,Gt(g(p)||void 0)),ne(d,m)},[()=>re(g(a))]),M(e,d),Ne()}const _s=["minWidth","maxWidth","minHeight","maxHeight","margin","marginTop","marginRight","marginBottom","marginLeft","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","borderWidth","borderStyle","borderColor","border","borderRadius","boxShadow","width","height","gap","display","justifyContent","alignItems","flexWrap","alignContent","flexDirection","overflow","overflowX","overflowY","backgroundColor","backgroundImage","backgroundSize","backgroundPosition","backgroundRepeat","opacity","fontFamily","fontSize","fontWeight","fontStyle","color","lineHeight","letterSpacing","textAlign","textDecoration","textTransform"],ru=e=>e!=null&&e!=="",ou=e=>e?_s.reduce((t,n)=>{const r=e[n];return ru(r)&&(t[n]=r),t},{}):{},iu=e=>{if(!e)return;const t={...e};for(const n of _s)delete t[n];return Object.keys(t).length?t:void 0},su=e=>Object.keys(e).length>0,lu=(e,t)=>{const n=(e==null?void 0:e.noContainer)??!1,r=e==null?void 0:e.resolveNoContainer;if(typeof r!="function")return n;try{const o=r(t);if(typeof o=="boolean")return o;console.error(`resolveNoContainer: component "${e==null?void 0:e.id}" returned ${typeof o} instead of a boolean; falling back to noContainer=${n}`)}catch(o){console.error(`resolveNoContainer: component "${e==null?void 0:e.id}" threw; falling back to noContainer=${n}`,o)}return n},au=(e,t)=>{const n=e==null?void 0:e.resolveRendersOwnElement;if(typeof n!="function")return!1;try{const r=n(t);if(typeof r=="boolean")return r;console.error(`resolveRendersOwnElement: component "${e==null?void 0:e.id}" returned ${typeof r} instead of a boolean; falling back to false`)}catch(r){console.error(`resolveRendersOwnElement: component "${e==null?void 0:e.id}" threw; falling back to false`,r)}return!1};var Zr=Pe("<div><!></div>");function bs(e,t){Me(t,!0);const n=D(()=>t.components[mr(t.libraryId,t.componentType)]),r=D(()=>{var _;const h=(_=g(n))==null?void 0:_.card;return h||(console.error(`DisplayComponent: Component with type ${t.componentType}${t.libraryId?` (library "${t.libraryId}")`:""} not found in components`),null)}),o=D(()=>({componentAttributes:t.componentAttributes,styleProps:t.styleProps})),i=D(()=>g(n)?lu(g(n),g(o)):!1),s=D(()=>ou(t.styleProps)),l=D(()=>g(i)?iu(t.styleProps):t.styleProps),u=D(()=>{var h;return Mn((h=t.componentAttributes)==null?void 0:h[xn])}),c=D(()=>g(i)&&su(g(s))),f=D(()=>!g(i)||(g(n)?au(g(n),g(o)):!1)),p=D(()=>!g(c)&&g(f)?g(u):void 0),a=D(()=>({componentAttributes:t.componentAttributes,styleProps:g(l),className:g(p),widgetInstanceProps:t.widgetInstanceProps,mounts:t.mounts}));var d=ie(),y=q(d);{var m=h=>{const _=D(()=>g(r));var A=ie(),P=q(A);{var C=E=>{var b=Zr(),I=_e(b);Un(I,()=>g(_),(T,N)=>{N(T,Gn(()=>g(a)))}),le(T=>{St(b,1,Gt(g(u)||void 0)),ne(b,T)},[()=>re(g(s))]),M(E,b)},w=E=>{var b=Zr(),I=_e(b);Un(I,()=>g(_),(T,N)=>{N(T,Gn(()=>g(a)))}),le(()=>St(b,1,Gt(g(u)))),M(E,b)},S=E=>{var b=ie(),I=q(b);Un(I,()=>g(_),(T,N)=>{N(T,Gn(()=>g(a)))}),M(E,b)};De(P,E=>{g(c)?E(C):!g(f)&&g(u)?E(w,1):E(S,-1)})}M(h,A)};De(y,h=>{g(r)&&h(m)})}M(e,d),Ne()}function Pr(e,t){Me(t,!0);let n=ae(t,"isComposeMode",3,!1),r=ae(t,"isWithinCollection",3,!1),o=ae(t,"showDropContainers",3,!1);const i=D(()=>cn(t.plugins).components);function s(p){if(n()&&p.type===In.DroppableBox)return!1;const{componentAttributesBasedOnDevice:a}=er({col:p,deviceDisplayType:t.deviceDisplayType,isComposeMode:n(),sourceComponentsPlugin:cn(t.plugins)}),d=!!a&&a["hide-component-3-resolutions"]==="true";return!(!n()&&d)}function l(p){const{componentAttributesBasedOnDevice:a,componentStyles:d}=er({col:p,deviceDisplayType:t.deviceDisplayType,isComposeMode:n(),sourceComponentsPlugin:cn(t.plugins)});return{componentAttributes:a,styleProps:d}}function u(p){const a=Ar(p.type);if(!(a!=null&&a.length))return null;const d=p.collection??t.widgetCollections[a];if(!d)throw new Error(`DisplayCollection - Collection with ID ${a} not found in widgetCollections. Available collections: ${Object.keys(t.widgetCollections).join(", ")}`);return!d.collectionRows||!rs(d.collectionRows)?null:d.collectionRows}function c(p){return[...t.ancestorColumnIds??[],p]}function f(p){return ds({componentProps:t.componentProps,ancestorColumnIds:t.ancestorColumnIds,columnId:p})}eu(e,{get displayItemList(){return t.displayItemList},get isComposeMode(){return n()},get showDropContainers(){return o()},get isWithinCollection(){return r()},get deviceDisplayType(){return t.deviceDisplayType},children:(p,a)=>{var d=ie(),y=q(d);bn(y,17,()=>t.displayItemList.rows,m=>m.id,(m,h)=>{nu(m,{get row(){return g(h)},get isComposeMode(){return n()},get showDropContainers(){return o()},get isWithinCollection(){return r()},get deviceDisplayType(){return t.deviceDisplayType},children:(_,A)=>{var P=ie(),C=q(P);bn(C,17,()=>g(h).columns,w=>w.id,(w,S)=>{var E=ie(),b=q(E);{var I=N=>{const Y=D(()=>u(g(S)));var O=ie(),X=q(O);{var it=Le=>{{let st=D(()=>c(g(S).id));Pr(Le,{get displayItemList(){return g(Y)},get isComposeMode(){return n()},isWithinCollection:!0,get widgetCollections(){return t.widgetCollections},get showDropContainers(){return o()},get reduxDeviceDisplayType(){return t.reduxDeviceDisplayType},get plugins(){return t.plugins},get deviceDisplayType(){return t.deviceDisplayType},get componentProps(){return t.componentProps},get mounts(){return t.mounts},get ancestorColumnIds(){return g(st)}})}},tn=Le=>{{let st=D(()=>l(g(S)).componentAttributes),he=D(()=>l(g(S)).styleProps),nn=D(()=>f(g(S).id));bs(Le,{get componentType(){return g(S).type},get libraryId(){return g(S).libraryId},get componentAttributes(){return g(st)},get components(){return g(i)},get styleProps(){return g(he)},get widgetInstanceProps(){return g(nn)},get mounts(){return t.mounts}})}};De(X,Le=>{g(Y)?Le(it):Le(tn,-1)})}M(N,O)},T=D(()=>s(g(S)));De(b,N=>{g(T)&&N(I)})}M(w,E)}),M(_,P)},$$slots:{default:!0}})}),M(p,d)},$$slots:{default:!0}}),Ne()}function wn(e,t){Me(t,!0);var n=ie(),r=q(n);{var o=i=>{Pr(i,{get displayItemList(){return t.displayItemList},get isComposeMode(){return t.isComposeMode},get isWithinCollection(){return t.isWithinCollection},get widgetCollections(){return t.widgetCollections},get showDropContainers(){return t.showDropContainers},get reduxDeviceDisplayType(){return t.reduxDeviceDisplayType},get plugins(){return t.plugins},get deviceDisplayType(){return t.deviceDisplayType},get componentProps(){return t.componentProps},get mounts(){return t.mounts},get ancestorColumnIds(){return t.ancestorColumnIds}})};De(r,i=>{var s,l;(l=(s=t.displayItemList)==null?void 0:s.rows)!=null&&l.length&&i(o)})}M(e,n),Ne()}function ws(e,t){var n=ie(),r=q(n);bn(r,16,()=>t.stylesheets??[],o=>o,(o,i)=>{var s=ie(),l=q(s);yr(l,()=>"style",!1,(u,c)=>{ia(u,()=>({"data-rulecms-library-stylesheet":""}));var f=gr();le(()=>En(f,i)),M(c,f)}),M(o,s)}),M(e,n)}let uu=0;var cu=Pe("<div><!></div>"),Jr=Pe("<!> <!>",1);function Cs(e,t){Me(t,!0);const n=["Phone","Tablet","Desktop"],r=`rulecms-bp-${++uu}`,o=D(()=>t.scopeIdInput??r),i=D(()=>vs(t.displayItemList,t.widgetCollections)),s=D(()=>Ja(g(o)));var l=Jr(),u=q(l);{let a=D(()=>{var d;return(d=t.plugins.sourceComponents)==null?void 0:d.stylesheets});ws(u,{get stylesheets(){return g(a)}})}var c=Ct(u,2);{var f=a=>{wn(a,{get displayItemList(){return t.displayItemList},isComposeMode:!1,isWithinCollection:!1,get widgetCollections(){return t.widgetCollections},showDropContainers:!1,reduxDeviceDisplayType:"desktop",deviceDisplayType:"Desktop",get plugins(){return t.plugins},get componentProps(){return t.componentProps},get mounts(){return t.mounts}})},p=a=>{var d=Jr(),y=q(d);yr(y,()=>"style",!1,(h,_)=>{var A=gr();le(()=>En(A,g(s))),M(_,A)});var m=Ct(y,2);bn(m,16,()=>n,h=>h,(h,_)=>{var A=cu(),P=_e(A);wn(P,{get displayItemList(){return t.displayItemList},isComposeMode:!1,isWithinCollection:!1,get widgetCollections(){return t.widgetCollections},showDropContainers:!1,reduxDeviceDisplayType:"desktop",get deviceDisplayType(){return _},get plugins(){return t.plugins},get componentProps(){return t.componentProps},get mounts(){return t.mounts}}),le(C=>St(A,1,C),[()=>`${g(o)}-${_.toLowerCase()}`]),M(h,A)}),M(a,d)};De(c,a=>{g(i)?a(p,-1):a(f)})}M(e,l),Ne()}function fu(e,t,n){if(e)return"Phone";if(t)return"Tablet";const r=(n==null?void 0:n.toLowerCase())||"desktop";return r==="phone"?"Phone":r==="tablet"?"Tablet":"Desktop"}const du=`(max-width: ${Er})`,pu=`(max-width: ${Tr})`;var hu=Pe("<!> <!>",1);function As(e,t){Me(t,!0);let n=oe("Desktop"),r,o;function i(){W(n,fu((r==null?void 0:r.matches)??!1,(o==null?void 0:o.matches)??!1,t.reduxDeviceDisplayType),!0)}dr(()=>(typeof matchMedia=="function"&&(r=matchMedia(du),o=matchMedia(pu),r.addEventListener("change",i),o.addEventListener("change",i)),i(),()=>{r==null||r.removeEventListener("change",i),o==null||o.removeEventListener("change",i)}));var s=hu(),l=q(s);{var u=f=>{{let p=D(()=>{var a;return(a=t.plugins.sourceComponents)==null?void 0:a.stylesheets});ws(f,{get stylesheets(){return g(p)}})}};De(l,f=>{t.isWithinCollection||f(u)})}var c=Ct(l,2);wn(c,{get displayItemList(){return t.displayItemList},get isComposeMode(){return t.isComposeMode},get isWithinCollection(){return t.isWithinCollection},get widgetCollections(){return t.widgetCollections},get showDropContainers(){return t.showDropContainers},get reduxDeviceDisplayType(){return t.reduxDeviceDisplayType},get deviceDisplayType(){return g(n)},get plugins(){return t.plugins},get componentProps(){return t.componentProps},get mounts(){return t.mounts}}),M(e,s),Ne()}function gu(e){const t={};return Object.entries(e).forEach(([n,r])=>{const o={...r};if(o.itemList)try{o.collectionRows=typeof o.itemList=="string"?JSON.parse(o.itemList):o.itemList}catch(s){console.error(`Failed to parse itemList for collection ${n}:`,s),o.collectionRows={rows:[]}}let i=`${o.name}$${n}`;o.parentId&&(i=`${i}@${o.parentId}`),t[i]=o}),t}function vu(e){return typeof e.itemList=="string"?JSON.parse(e.itemList):e.itemList}function kr(e){return{displayItemList:vu(e.widget),widgetCollections:gu(e.childCollections),...e.libraries?{libraries:e.libraries}:{}}}function yu(e){const t=e.registry??en(),n=Dn({displayItemList:e.displayItemList,widgetCollections:e.widgetCollections});return t.resolveSync({registrations:e.libraries,referenced:n})}function mu(e){const t=e.registry??en(),n=Dn({displayItemList:e.displayItemList,widgetCollections:e.widgetCollections});return t.resolve({registrations:e.libraries,referenced:n})}const _u={display:"flex",justifyContent:"center",alignItems:"center",padding:"3rem",color:"#e2e8f0"},bu={display:"flex",alignItems:"center",gap:"1rem"},wu={width:"40px",height:"40px",border:"4px solid #4a5568",borderTopColor:"#63b3ed",borderRadius:"50%",animation:"spin 1s linear infinite"},Qr={padding:"1.5rem",backgroundColor:"#742a2a",border:"1px solid #9b2c2c",borderRadius:"8px",color:"#fed7d7"},$r={fontSize:"16px",fontWeight:"600",marginBottom:"0.5rem",color:"#feb2b2"},eo={fontSize:"14px",color:"#fed7d7"},Cu=`
|
|
4
|
+
@media (max-width: ${Ns}px) { ${t} { display: block; } }
|
|
5
|
+
@media (min-width: ${vu}px) and (max-width: ${Ms}px) { ${n} { display: block; } }
|
|
6
|
+
@media (min-width: ${yu}px) { ${r} { display: block; } }
|
|
7
|
+
`.trim()}function dn(e){if(!e)throw new Error("Source components plugin is required, but no plugins were provided");const t=e.sourceComponents;if(!t)throw new Error("Source components plugin is required, but was not found in plugins object");if(!t.components)throw new Error("Source components plugin is missing required property: components");if(typeof t.components!="object"||t.components===null||Array.isArray(t.components))throw new Error("Source components plugin components must be an object (Record<string, LibraryComponentEntry>)");return t}let _u=0;var bu=ye("<div><!> <!></div>");function wu(e,t){Le(t,!0);let n=ce(t,"isComposeMode",3,!1),r=ce(t,"showDropContainers",3,!1),i=ce(t,"isWithinCollection",3,!1),o=ce(t,"deviceDisplayType",3,"Desktop");const s=`rulecms-vc-${++_u}`;function l(w,P,S){const I=w&&!S?3:1;return!!(P!=null&&P.length)&&P.length>I}const a=D(()=>{var w;return(((w=t.displayItemList.containerAttributes)==null?void 0:w[Cn])||[]).join(`;
|
|
8
|
+
`)}),u=D(()=>p(a)?`.${s} {
|
|
9
|
+
${p(a)}
|
|
10
|
+
}`:""),f=D(()=>!n()&&jn({containerAttributes:t.displayItemList.containerAttributes,deviceDisplayType:o()})),h=D(()=>Or({containerAttributes:t.displayItemList.containerAttributes,deviceDisplayType:o(),isComposeMode:n()})),c=D(()=>{var S;const w=((S=t.displayItemList.containerAttributes)==null?void 0:S[Cn])||[],P=ws(p(h));return n()&&!i()||r()||w.length>0||P||l(n(),t.displayItemList.rows,i())}),d=D(()=>[p(a)?s:void 0,p(h).cssClasses].filter(Boolean).join(" ")),y=D(()=>({...Fr({containerAttributes:t.displayItemList.containerAttributes,widgetContainerStyles:p(h)})?{}:{height:i()?"auto":"100%"},display:"flex",flexDirection:"column",...p(h).styles})),m=D(()=>p(c)?p(d):""),g=D(()=>p(f)?{display:"none"}:p(c)?p(y):{display:"contents"});var _=bu(),T=ae(_);{var C=w=>{var P=Z(),S=z(P);kn(S,()=>"style",!1,(I,E)=>{var A=Dn();$(()=>nn(A,p(u))),x(E,A)}),x(w,P)};ge(T,w=>{p(a)&&w(C)})}var b=Ue(T,2);Sr(b,()=>t.children),$(w=>{nt(_,"hidden",p(f)||void 0),St(_,1,zt(p(m)||void 0)),J(_,w)},[()=>Q(p(g))]),x(e,_),xe()}var Cu=ye("<div><!></div>");function Au(e,t){Le(t,!0);let n=ce(t,"isComposeMode",3,!1),r=ce(t,"showDropContainers",3,!1),i=ce(t,"isWithinCollection",3,!1),o=ce(t,"deviceDisplayType",3,"Desktop");function s(m,g,_){var C;const T=m&&!_?3:1;return!!((C=g==null?void 0:g.columns)!=null&&C.length)&&g.columns.length>T}const l=D(()=>!n()&&ys({row:t.row,deviceDisplayType:o()})),a=D(()=>r()||vs(t.row)||s(n(),t.row,i())),u=D(()=>ms({row:t.row,deviceDisplayType:o(),isComposeMode:n()})),f=D(()=>{var g;const m=Oe({deviceDisplayType:o(),componentAttributes:t.row.rowAttributes});return Vn((g=m==null?void 0:m.componentAttributesSpecificToDeviceType)==null?void 0:g[Wn])??""}),h=D(()=>p(a)?p(f):""),c=D(()=>p(l)?{display:"none"}:p(a)?p(u):{display:"contents"});var d=Cu(),y=ae(d);Sr(y,()=>t.children),$(m=>{nt(d,"hidden",p(l)||void 0),St(d,1,zt(p(h)||void 0)),J(d,m)},[()=>Q(p(c))]),x(e,d),xe()}const Os=["minWidth","maxWidth","minHeight","maxHeight","margin","marginTop","marginRight","marginBottom","marginLeft","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","borderWidth","borderStyle","borderColor","border","borderRadius","boxShadow","width","height","gap","display","justifyContent","alignItems","flexWrap","alignContent","flexDirection","overflow","overflowX","overflowY","backgroundColor","backgroundImage","backgroundSize","backgroundPosition","backgroundRepeat","opacity","fontFamily","fontSize","fontWeight","fontStyle","color","lineHeight","letterSpacing","textAlign","textDecoration","textTransform"],Eu=e=>e!=null&&e!=="",Su=e=>e?Os.reduce((t,n)=>{const r=e[n];return Eu(r)&&(t[n]=r),t},{}):{},Tu=e=>{if(!e)return;const t={...e};for(const n of Os)delete t[n];return Object.keys(t).length?t:void 0},Iu=e=>Object.keys(e).length>0,Du=(e,t)=>{const n=(e==null?void 0:e.noContainer)??!1,r=e==null?void 0:e.resolveNoContainer;if(typeof r!="function")return n;try{const i=r(t);if(typeof i=="boolean")return i;console.error(`resolveNoContainer: component "${e==null?void 0:e.id}" returned ${typeof i} instead of a boolean; falling back to noContainer=${n}`)}catch(i){console.error(`resolveNoContainer: component "${e==null?void 0:e.id}" threw; falling back to noContainer=${n}`,i)}return n},Pu=(e,t)=>{const n=e==null?void 0:e.resolveRendersOwnElement;if(typeof n!="function")return!1;try{const r=n(t);if(typeof r=="boolean")return r;console.error(`resolveRendersOwnElement: component "${e==null?void 0:e.id}" returned ${typeof r} instead of a boolean; falling back to false`)}catch(r){console.error(`resolveRendersOwnElement: component "${e==null?void 0:e.id}" threw; falling back to false`,r)}return!1};var oi=ye("<div><!></div>");function Fs(e,t){Le(t,!0);const n=D(()=>t.components[Tr(t.libraryId,t.componentType)]),r=D(()=>{var _;const g=(_=p(n))==null?void 0:_.card;return g||(console.error(`DisplayComponent: Component with type ${t.componentType}${t.libraryId?` (library "${t.libraryId}")`:""} not found in components`),null)}),i=D(()=>({componentAttributes:t.componentAttributes,styleProps:t.styleProps})),o=D(()=>p(n)?Du(p(n),p(i)):!1),s=D(()=>Su(t.styleProps)),l=D(()=>p(o)?Tu(t.styleProps):t.styleProps),a=D(()=>{var g;return Vn((g=t.componentAttributes)==null?void 0:g[Wn])}),u=D(()=>p(o)&&Iu(p(s))),f=D(()=>!p(o)||(p(n)?Pu(p(n),p(i)):!1)),h=D(()=>!p(u)&&p(f)?p(a):void 0),c=D(()=>({componentAttributes:t.componentAttributes,styleProps:p(l),className:p(h),widgetInstanceProps:t.widgetInstanceProps,mounts:t.mounts}));var d=Z(),y=z(d);{var m=g=>{const _=D(()=>p(r));var T=Z(),C=z(T);{var b=S=>{var I=oi(),E=ae(I);Xn(E,()=>p(_),(A,N)=>{N(A,Qn(()=>p(c)))}),$(A=>{St(I,1,zt(p(a)||void 0)),J(I,A)},[()=>Q(p(s))]),x(S,I)},w=S=>{var I=oi(),E=ae(I);Xn(E,()=>p(_),(A,N)=>{N(A,Qn(()=>p(c)))}),$(()=>St(I,1,zt(p(a)))),x(S,I)},P=S=>{var I=Z(),E=z(I);Xn(E,()=>p(_),(A,N)=>{N(A,Qn(()=>p(c)))}),x(S,I)};ge(C,S=>{p(u)?S(b):!p(f)&&p(a)?S(w,1):S(P,-1)})}x(g,T)};ge(y,g=>{p(r)&&g(m)})}x(e,d),xe()}var ku=ye("<div><!></div>"),Lu=ye("<div><!> <!></div>");function An(e,t){Le(t,!0);const n=C=>{wu(C,{get displayItemList(){return t.displayItemList},get isComposeMode(){return r()},get showDropContainers(){return o()},get isWithinCollection(){return i()},get deviceDisplayType(){return t.deviceDisplayType},children:(b,w)=>{var P=Z(),S=z(P);Vt(S,17,()=>t.displayItemList.rows,I=>I.id,(I,E)=>{Au(I,{get row(){return p(E)},get isComposeMode(){return r()},get showDropContainers(){return o()},get isWithinCollection(){return i()},get deviceDisplayType(){return t.deviceDisplayType},children:(A,N)=>{var B=Z(),te=z(B);Vt(te,17,()=>p(E).columns,O=>O.id,(O,V)=>{var qe=Z(),on=z(qe);{var sn=at=>{const jr=D(()=>c(p(V)));var Br=Z(),Bs=z(Br);{var Us=ut=>{{let Un=D(()=>d(p(V).id));An(ut,{get displayItemList(){return p(jr)},get isComposeMode(){return r()},isWithinCollection:!0,get widgetCollections(){return t.widgetCollections},get showDropContainers(){return o()},get reduxDeviceDisplayType(){return t.reduxDeviceDisplayType},get plugins(){return t.plugins},get deviceDisplayType(){return t.deviceDisplayType},get componentProps(){return t.componentProps},get mounts(){return t.mounts},get ancestorColumnIds(){return p(Un)}})}},Ks=ut=>{{let Un=D(()=>h(p(V)).componentAttributes),Hs=D(()=>h(p(V)).styleProps),Gs=D(()=>y(p(V).id));Fs(ut,{get componentType(){return p(V).type},get libraryId(){return p(V).libraryId},get componentAttributes(){return p(Un)},get components(){return p(s)},get styleProps(){return p(Hs)},get widgetInstanceProps(){return p(Gs)},get mounts(){return t.mounts}})}};ge(Bs,ut=>{p(jr)?ut(Us):ut(Ks,-1)})}x(at,Br)},me=D(()=>f(p(V)));ge(on,at=>{p(me)&&at(sn)})}x(O,qe)}),x(A,B)},$$slots:{default:!0}})}),x(b,P)},$$slots:{default:!0}})};let r=ce(t,"isComposeMode",3,!1),i=ce(t,"isWithinCollection",3,!1),o=ce(t,"showDropContainers",3,!1);const s=D(()=>dn(t.plugins).components),l=D(()=>!r()&&As(t.displayItemList)&&!jn({containerAttributes:t.displayItemList.containerAttributes,deviceDisplayType:t.deviceDisplayType})),a=D(()=>{const C=ur({containerAttributes:t.displayItemList.containerAttributes,deviceDisplayType:t.deviceDisplayType});return Is({isWithinCollection:i(),baseDeclaresOwnHeight:Fr({containerAttributes:t.displayItemList.containerAttributes,widgetContainerStyles:Or({containerAttributes:t.displayItemList.containerAttributes,deviceDisplayType:t.deviceDisplayType,isComposeMode:r()})}),baseZIndex:C})}),u=D(()=>{var w;const C=((w=t.displayItemList.overlayLayers)==null?void 0:w.layers)??[],b=ur({containerAttributes:t.displayItemList.containerAttributes,deviceDisplayType:t.deviceDisplayType});return C.flatMap((P,S)=>Ts({layer:P,deviceDisplayType:t.deviceDisplayType})?[]:[{index:S,layer:P,boxStyles:Ds({zIndex:Es(b,S),pointerEvents:Ss({containerAttributes:P.containerAttributes,deviceDisplayType:t.deviceDisplayType})})}])});function f(C){if(r()&&C.type===Ln.DroppableBox)return!1;const{componentAttributesBasedOnDevice:b}=ar({col:C,deviceDisplayType:t.deviceDisplayType,isComposeMode:r(),sourceComponentsPlugin:dn(t.plugins)}),w=!!b&&b["hide-component-3-resolutions"]==="true";return!(!r()&&w)}function h(C){const{componentAttributesBasedOnDevice:b,componentStyles:w}=ar({col:C,deviceDisplayType:t.deviceDisplayType,isComposeMode:r(),sourceComponentsPlugin:dn(t.plugins)});return{componentAttributes:b,styleProps:w}}function c(C){const b=Lr(C.type);if(!(b!=null&&b.length))return null;const w=C.collection??t.widgetCollections[b];if(!w)throw new Error(`DisplayCollection - Collection with ID ${b} not found in widgetCollections. Available collections: ${Object.keys(t.widgetCollections).join(", ")}`);return!w.collectionRows||!hs(w.collectionRows)?null:w.collectionRows}function d(C){return[...t.ancestorColumnIds??[],C]}function y(C){return Ps({componentProps:t.componentProps,ancestorColumnIds:t.ancestorColumnIds,columnId:C})}var m=Z(),g=z(m);{var _=C=>{var b=Lu(),w=ae(b);n(w);var P=Ue(w,2);Vt(P,17,()=>p(u),S=>S.index,(S,I)=>{var E=ku(),A=ae(E);An(A,{get displayItemList(){return p(I).layer},get isComposeMode(){return r()},isWithinCollection:!1,get widgetCollections(){return t.widgetCollections},showDropContainers:!1,get reduxDeviceDisplayType(){return t.reduxDeviceDisplayType},get plugins(){return t.plugins},get deviceDisplayType(){return t.deviceDisplayType},get componentProps(){return t.componentProps},get mounts(){return t.mounts},get ancestorColumnIds(){return t.ancestorColumnIds}}),$(N=>{nt(E,"data-rulecms-overlay-layer",p(I).index),J(E,N)},[()=>Q(p(I).boxStyles)]),x(S,E)}),$(S=>J(b,S),[()=>Q(p(a))]),x(C,b)},T=C=>{n(C)};ge(g,C=>{p(l)?C(_):C(T,-1)})}x(e,m),xe()}function En(e,t){Le(t,!0);var n=Z(),r=z(n);{var i=o=>{An(o,{get displayItemList(){return t.displayItemList},get isComposeMode(){return t.isComposeMode},get isWithinCollection(){return t.isWithinCollection},get widgetCollections(){return t.widgetCollections},get showDropContainers(){return t.showDropContainers},get reduxDeviceDisplayType(){return t.reduxDeviceDisplayType},get plugins(){return t.plugins},get deviceDisplayType(){return t.deviceDisplayType},get componentProps(){return t.componentProps},get mounts(){return t.mounts},get ancestorColumnIds(){return t.ancestorColumnIds}})};ge(r,o=>{var s,l;(l=(s=t.displayItemList)==null?void 0:s.rows)!=null&&l.length&&o(i)})}x(e,n),xe()}function Ws(e,t){var n=Z(),r=z(n);Vt(r,16,()=>t.stylesheets??[],i=>i,(i,o)=>{var s=Z(),l=z(s);kn(l,()=>"style",!1,(a,u)=>{eo(a,()=>({"data-rulecms-library-stylesheet":""}));var f=Dn();$(()=>nn(f,o)),x(u,f)}),x(i,s)}),x(e,n)}let xu=0;var Ru=ye("<div><!></div>"),si=ye("<!> <!>",1);function Vs(e,t){Le(t,!0);const n=["Phone","Tablet","Desktop"],r=`rulecms-bp-${++xu}`,i=D(()=>t.scopeIdInput??r),o=D(()=>Rs(t.displayItemList,t.widgetCollections)),s=D(()=>mu(p(i)));var l=si(),a=z(l);{let c=D(()=>{var d;return(d=t.plugins.sourceComponents)==null?void 0:d.stylesheets});Ws(a,{get stylesheets(){return p(c)}})}var u=Ue(a,2);{var f=c=>{En(c,{get displayItemList(){return t.displayItemList},isComposeMode:!1,isWithinCollection:!1,get widgetCollections(){return t.widgetCollections},showDropContainers:!1,reduxDeviceDisplayType:"desktop",deviceDisplayType:"Desktop",get plugins(){return t.plugins},get componentProps(){return t.componentProps},get mounts(){return t.mounts}})},h=c=>{var d=si(),y=z(d);kn(y,()=>"style",!1,(g,_)=>{var T=Dn();$(()=>nn(T,p(s))),x(_,T)});var m=Ue(y,2);Vt(m,16,()=>n,g=>g,(g,_)=>{var T=Ru(),C=ae(T);En(C,{get displayItemList(){return t.displayItemList},isComposeMode:!1,isWithinCollection:!1,get widgetCollections(){return t.widgetCollections},showDropContainers:!1,reduxDeviceDisplayType:"desktop",get deviceDisplayType(){return _},get plugins(){return t.plugins},get componentProps(){return t.componentProps},get mounts(){return t.mounts}}),$(b=>St(T,1,b),[()=>`${p(i)}-${_.toLowerCase()}`]),x(g,T)}),x(c,d)};ge(u,c=>{p(o)?c(h,-1):c(f)})}x(e,l),xe()}function Nu(e,t,n){if(e)return"Phone";if(t)return"Tablet";const r=(n==null?void 0:n.toLowerCase())||"desktop";return r==="phone"?"Phone":r==="tablet"?"Tablet":"Desktop"}const Mu=`(max-width: ${Rr})`,Ou=`(max-width: ${Nr})`;var Fu=ye("<!> <!>",1);function js(e,t){Le(t,!0);let n=le("Desktop"),r,i;function o(){F(n,Nu((r==null?void 0:r.matches)??!1,(i==null?void 0:i.matches)??!1,t.reduxDeviceDisplayType),!0)}Cr(()=>(typeof matchMedia=="function"&&(r=matchMedia(Mu),i=matchMedia(Ou),r.addEventListener("change",o),i.addEventListener("change",o)),o(),()=>{r==null||r.removeEventListener("change",o),i==null||i.removeEventListener("change",o)}));var s=Fu(),l=z(s);{var a=f=>{{let h=D(()=>{var c;return(c=t.plugins.sourceComponents)==null?void 0:c.stylesheets});Ws(f,{get stylesheets(){return p(h)}})}};ge(l,f=>{t.isWithinCollection||f(a)})}var u=Ue(l,2);En(u,{get displayItemList(){return t.displayItemList},get isComposeMode(){return t.isComposeMode},get isWithinCollection(){return t.isWithinCollection},get widgetCollections(){return t.widgetCollections},get showDropContainers(){return t.showDropContainers},get reduxDeviceDisplayType(){return t.reduxDeviceDisplayType},get deviceDisplayType(){return p(n)},get plugins(){return t.plugins},get componentProps(){return t.componentProps},get mounts(){return t.mounts}}),x(e,s),xe()}const Wu=e=>e.replace(/\\/g,"\\\\").replace(/"/g,'\\"'),Vu=/[{};]/,ju=e=>{if(!e)return{};const t={};for(const[n,r]of Object.entries(e)){if(!Rn(n)||typeof r!="string")continue;const i=r.trim();i===""||Vu.test(i)||(t[n.trim()]=i)}return t},Bu=(e,t)=>{const n=ju(t),r=Object.keys(n);if(r.length===0||!e)return null;const i=`[data-rulecms-published-key="${Wu(e)}"] > *`,o=r.sort((s,l)=>s.localeCompare(l)).map(s=>` ${s}: ${n[s]};`).join(`
|
|
11
|
+
`);return`${i} {
|
|
12
|
+
${o}
|
|
13
|
+
}`};function Uu(e,t){Le(t,!0);const n=D(()=>Bu(t.publishedKey,t.variables));var r=Z(),i=z(r);{var o=s=>{var l=Z(),a=z(l);kn(a,()=>"style",!1,(u,f)=>{eo(u,()=>({"data-rulecms-project-css-variables":""}));var h=Dn();$(()=>nn(h,p(n))),x(f,h)}),x(s,l)};ge(i,s=>{p(n)&&s(o)})}x(e,r),xe()}function Ku(e){const t={};return Object.entries(e).forEach(([n,r])=>{const i={...r};if(i.itemList)try{i.collectionRows=typeof i.itemList=="string"?JSON.parse(i.itemList):i.itemList}catch(s){console.error(`Failed to parse itemList for collection ${n}:`,s),i.collectionRows={rows:[]}}let o=`${i.name}$${n}`;i.parentId&&(o=`${o}@${i.parentId}`),t[o]=i}),t}function Hu(e){return typeof e.itemList=="string"?JSON.parse(e.itemList):e.itemList}function Vr(e){return{displayItemList:Hu(e.widget),widgetCollections:Ku(e.childCollections),...e.libraries?{libraries:e.libraries}:{},...e.cssVariables&&Object.keys(e.cssVariables).length>0?{cssVariables:e.cssVariables}:{}}}function Gu(e){const t=e.registry??rn(),n=xn({displayItemList:e.displayItemList,widgetCollections:e.widgetCollections});return t.resolveSync({registrations:e.libraries,referenced:n})}function Yu(e){const t=e.registry??rn(),n=xn({displayItemList:e.displayItemList,widgetCollections:e.widgetCollections});return t.resolve({registrations:e.libraries,referenced:n})}const zu={display:"flex",justifyContent:"center",alignItems:"center",padding:"3rem",color:"#e2e8f0"},qu={display:"flex",alignItems:"center",gap:"1rem"},Xu={width:"40px",height:"40px",border:"4px solid #4a5568",borderTopColor:"#63b3ed",borderRadius:"50%",animation:"spin 1s linear infinite"},li={padding:"1.5rem",backgroundColor:"#742a2a",border:"1px solid #9b2c2c",borderRadius:"8px",color:"#fed7d7"},ai={fontSize:"16px",fontWeight:"600",marginBottom:"0.5rem",color:"#feb2b2"},ui={fontSize:"14px",color:"#fed7d7"},Zu=`
|
|
11
14
|
@keyframes spin {
|
|
12
15
|
from {
|
|
13
16
|
transform: rotate(0deg);
|
|
@@ -16,4 +19,4 @@ ${g(u)}
|
|
|
16
19
|
transform: rotate(360deg);
|
|
17
20
|
}
|
|
18
21
|
}
|
|
19
|
-
`,
|
|
22
|
+
`,Ju="data-rulecms-published-key";var Qu=ye("<div><div><div></div></div></div>"),$u=ye("<div><div>Error Loading Widget</div> <div> </div></div>"),ec=ye("<div><div>No Widget Data</div> <div>No widget data available</div></div>"),tc=ye('<span style="display: contents"><!> <!></span>');function nc(e,t){Le(t,!0);let n=ce(t,"mode",3,"client-fetch");const r=tr.getContext(xr);let i=le(!1),o=le(null),s=le(null),l=le(null);const a=D(()=>n()==="pre-fetched"),u=D(()=>({sourceComponents:p(l)??void 0}));let f=null,h=null,c=!1;function d(){if(!p(s)){F(l,null);return}const E=t.libraries??(r==null?void 0:r.libraries),A=r==null?void 0:r.libraryRegistry,N=Gu({displayItemList:p(s).displayItemList,widgetCollections:p(s).widgetCollections,libraries:E,registry:A});if(N){F(l,N,!0);return}Yu({displayItemList:p(s).displayItemList,widgetCollections:p(s).widgetCollections,libraries:E,registry:A}).then(B=>{F(l,B,!0)})}function y(){p(s)&&xs({componentProps:t.componentProps,displayItemList:p(s).displayItemList,widgetCollections:p(s).widgetCollections,publishedKey:t.publishedKey})}function m(){if(c||typeof document>"u")return;const E="rulecms-widget-spinner-styles";if(!document.getElementById(E)){const A=document.createElement("style");A.id=E,A.textContent=Zu,document.head.appendChild(A)}c=!0}function g(){const E=t.token??(r==null?void 0:r.token),A=t.endpoint??(r==null?void 0:r.endpoint);if(!t.publishedKey||!E){F(o,t.publishedKey?"Token is required. Provide it either directly as a prop (`token`) or via RuleCMSWidgetProvider.":ot(E)?"Widget key is required":"Published key is required",!0),F(s,null);return}const N=`${t.publishedKey}|${E}`;if(h===N&&p(s)){d();return}f==null||f.abort(),f=new AbortController;const B=f.signal;h=N,F(i,!0),F(o,null);const te=Pr({publishedKey:t.publishedKey,token:E,endpoint:A});fetch(te,{method:"GET",headers:{"Content-Type":"application/json"},...ot(E)?{cache:"no-store"}:{},signal:B}).then(async O=>{if(O.ok){const V=await O.json();V.success?(F(s,Vr(V.data),!0),F(o,null),d(),y()):(F(o,"Failed to fetch widget data"),F(s,null))}else{const V=await O.json().catch(()=>({error:"Unknown error"}));F(o,V.error||`Request failed with status ${O.status}`,!0),F(s,null)}}).catch(O=>{O instanceof DOMException&&O.name==="AbortError"||(console.error("Error fetching widget:",O),F(o,"Failed to fetch widget"),F(s,null))}).finally(()=>{F(i,!1)})}function _(){if(n()==="pre-fetched"){F(s,t.initialData??null,!0),F(i,!1),F(o,null),d(),y();return}m(),g()}Cr(()=>(t.publishedKey,t.token,t.endpoint,n(),t.initialData,t.libraries,t.componentProps,tr.untrack(()=>_()),()=>{f==null||f.abort()}));var T=tc(),C=ae(T);{let E=D(()=>{var A;return(A=p(s))==null?void 0:A.cssVariables});Uu(C,{get publishedKey(){return t.publishedKey},get variables(){return p(E)}})}var b=Ue(C,2);{var w=E=>{var A=Qu(),N=ae(A),B=ae(N);$((te,O,V)=>{J(A,te),J(N,O),J(B,V)},[()=>Q(zu),()=>Q(qu),()=>Q(Xu)]),x(E,A)},P=E=>{var A=$u(),N=ae(A),B=Ue(N,2),te=ae(B);$((O,V,qe)=>{J(A,O),J(N,V),J(B,qe),nn(te,p(o))},[()=>Q(li),()=>Q(ai),()=>Q(ui)]),x(E,A)},S=E=>{var A=ec(),N=ae(A),B=Ue(N,2);$((te,O,V)=>{J(A,te),J(N,O),J(B,V)},[()=>Q(li),()=>Q(ai),()=>Q(ui)]),x(E,A)},I=E=>{var A=Z(),N=z(A);{var B=O=>{Vs(O,{get displayItemList(){return p(s).displayItemList},get widgetCollections(){return p(s).widgetCollections},get plugins(){return p(u)},get componentProps(){return t.componentProps},get mounts(){return t.mounts}})},te=O=>{js(O,{get displayItemList(){return p(s).displayItemList},isComposeMode:!1,isWithinCollection:!1,get widgetCollections(){return p(s).widgetCollections},showDropContainers:!1,reduxDeviceDisplayType:"desktop",get plugins(){return p(u)},get componentProps(){return t.componentProps},get mounts(){return t.mounts}})};ge(N,O=>{p(a)?O(B):O(te,-1)})}x(E,A)};ge(b,E=>{n()!=="pre-fetched"&&p(i)?E(w):n()!=="pre-fetched"&&p(o)?E(P,1):n()!=="pre-fetched"&&!p(s)?E(S,2):p(l)&&p(s)&&E(I,3)})}$(()=>nt(T,"data-rulecms-published-key",t.publishedKey)),x(e,T),xe()}class Ot extends Error{constructor(n,r){super(n);_e(this,"status");this.name="FetchRuleCMSWidgetError",this.status=r}}async function rc(e){const{publishedKey:t,token:n,endpoint:r,fetchOptions:i}=e;if(!t)throw new Ot(ot(n)?"Widget key is required":"Published key is required");if(!n)throw new Ot("Token is required");const o=Pr({publishedKey:t,token:n,endpoint:r}),s=await fetch(o,{method:"GET",headers:{"Content-Type":"application/json"},...ot(n)?{cache:"no-store"}:{},...i});if(!s.ok){const a=await s.json().catch(()=>({error:"Unknown error"}));throw new Ot(a.error||`Request failed with status ${s.status}`,s.status)}const l=await s.json();if(!l.success)throw new Ot("Failed to fetch widget data");return Vr(l.data)}async function ic(e){const{data:t,libraries:n}=e,r=xn({displayItemList:t.displayItemList,widgetCollections:t.widgetCollections});return rn().resolve({registrations:n,referenced:r})}exports.AlignContentTypes=xa;exports.BreakpointVariantRender=Vs;exports.COLLECTION_TYPE_PREFIX=Dr;exports.COMPONENT_PROPS_PATH_SEPARATOR=Bn;exports.CSS_CLASSES_ATTRIBUTE_NAME=Wn;exports.CSS_VARIABLE_NAME_MAX_LENGTH=To;exports.CSS_VARIABLE_NAME_PATTERN=So;exports.DEFAULT_BASE_Z_INDEX=Wr;exports.DEFAULT_CLOUDINARY_CLOUD_NAME=_o;exports.DEFAULT_LIBRARY_ID=It;exports.DEFAULT_ROW_GAP=gs;exports.DEV_CLIENT_TOKEN_PREFIX=io;exports.DEV_WIDGET_API_PATH=ao;exports.DeviceDisplayTypes=Ra;exports.DisplayComponent=Fs;exports.DisplayItemTypes=Ln;exports.DragItemIdPrefixTypes=Ir;exports.EMBEDDED_KEY_SEPARATOR=vo;exports.FLEX_LAYOUT_STYLE_KEYS_THAT_DERIVE_DISPLAY=zo;exports.FetchRuleCMSWidgetError=Ot;exports.HIDE_WIDGET_ATTRIBUTE_NAME=Mr;exports.JustifyContentTypes=lr;exports.POINTER_EVENTS_ATTRIBUTE_NAME=_s;exports.PUBLISHED_KEY_SEPARATOR=go;exports.PUBLISHED_WIDGET_API_PATH=lo;exports.PageViewTypes=La;exports.RULECMS_API_ORIGIN=oo;exports.RULECMS_PUBLISHED_KEY_ATTRIBUTE=Ju;exports.RULECMS_WIDGET_CONTEXT_KEY=xr;exports.RenderComponents=js;exports.RenderComponentsForDevice=En;exports.RenderComponentsInner=An;exports.RuleCMSWidget=nc;exports.RuleCMSWidgetProvider=Ua;exports.WIDGET_ATTRIBUTES_IGNORED_IN_COMPOSE_MODE=bs;exports.WIDGET_CACHE_API_ORIGIN=so;exports.Z_INDEX_WIDGET_ATTRIBUTE_NAME=Cs;exports.alignContentAllowlist=Uo;exports.alignItemsAllowlist=jo;exports.backgroundPositionAllowlist=Go;exports.backgroundRepeatAllowlist=Yo;exports.backgroundSizeAllowlist=Ho;exports.borderStyleKeywords=qo;exports.boxSpacingSideKeys=Po;exports.boxSpacingStyleAttributeEntries=au;exports.buildCloudinaryBackgroundUrl=Eo;exports.buildOverlayLayerBoxStyles=Ds;exports.buildOverlayStackStyles=Is;exports.buildWidgetFetchUrl=Pr;exports.collectComponentInstancePaths=ks;exports.collectReferencedLibraryIds=xn;exports.composeSourceComponentsPlugin=ro;exports.createComponentLibraryRegistry=rn;exports.cssAttrArrayKey=Cn;exports.defaultPageWidth=mo;exports.deriveDisplayFlexIfNeeded=fs;exports.desktopModeWidth=Ka;exports.fetchRuleCMSWidget=rc;exports.findUnmatchedComponentPropsKeys=Ls;exports.flexDirectionAllowlist=Ko;exports.flexWrapAllowlist=Bo;exports.fontFamilyAllowlist=xo;exports.fontStyleAllowlist=No;exports.fontWeightAllowlist=Ro;exports.formatBackgroundImageStyles=ts;exports.formatBorderStyles=ns;exports.formatBoxShadowStyles=rs;exports.formatBoxSpacingStyles=is;exports.formatCssColorStyles=os;exports.formatCssColorValue=On;exports.formatCssEnumStyles=ss;exports.formatCssLengthStyles=ls;exports.formatCssVariable=Se;exports.formatCssVariableStyles=nu;exports.formatLineHeightStyles=as;exports.formatObjectStyleAttribute=cs;exports.formatOpacityStyles=us;exports.formatSpacingSideValue=lt;exports.generatePublishedKey=yo;exports.generatePublishedKeyForEmbedded=Va;exports.getCollectionIdForCollectionType=Lr;exports.getColumnAttributes=jt;exports.getComponentAttributesAndStyles=ar;exports.getComponentsPluginFromPlugins=dn;exports.getCssVariableFromLeaf=G;exports.getDefaultDimensionAttributes=ds;exports.getDeviceTypeBasedAttributes=Oe;exports.getDragItemId=Na;exports.getDragItemPrefixAndId=co;exports.getIdAndPrefix=fo;exports.getMergedAttributes=ps;exports.getNameAndInstanceIdFromWidgetKey=Ma;exports.getNameFromWidgetKey=Oa;exports.getOverlayLayerZIndex=Es;exports.getWidgetKeyForCollection=po;exports.getWidgetKeyForCollectionWithPrefix=Fa;exports.getWidgetKeyForPublishedCollection=ho;exports.getWidgetKeyForPublishedCollectionWithPrefix=Wa;exports.hasBoxShadowLeaf=Qo;exports.hasDeviceDivergentValues=Rs;exports.hasInvalidCssVariable=Re;exports.hasItems=hs;exports.hasOverlayLayers=As;exports.incrementVersion=ja;exports.isBackgroundImageValue=Io;exports.isBorderStyleValue=Xo;exports.isBorderValue=Zo;exports.isBoxShadowValue=Jo;exports.isBoxSpacingValue=ko;exports.isCloudinaryCloudName=wo;exports.isCloudinaryPublicId=bo;exports.isCloudinaryTransformationString=Ao;exports.isCssColorValue=Mn;exports.isCssEnumValue=Lo;exports.isCssVariableName=Rn;exports.isDevClientToken=ot;exports.isLineHeightValue=$o;exports.isOpacityValue=es;exports.isOverlayLayerEmptyForDevice=Ts;exports.isRowHiddenForDevice=ys;exports.isSafeImageUrl=Co;exports.isSpacingSideValue=st;exports.isWidgetHiddenForDevice=jn;exports.justifyContentAllowlist=Vo;exports.normalizeCssClasses=Vn;exports.objectStyleAttributeRegistry=Fn;exports.overflowAllowlist=fn;exports.phoneModeWidth=Rr;exports.pointerEventsAllowlist=Wo;exports.prepareRuleCMSWidgetData=Vr;exports.resolveBaseZIndex=ur;exports.resolveKey=Tr;exports.resolveOverlayLayerPointerEvents=Ss;exports.resolveRowStyles=ms;exports.resolveWidgetApiOrigin=uo;exports.resolveWidgetContainerStyles=Or;exports.resolveWidgetInstanceProps=Ps;exports.resolveWidgetLibraries=ic;exports.rowBasedPropertiesAreAssigned=vs;exports.spacingKeywords=Nn;exports.spacingLengthUnits=Do;exports.tabletModeWidth=Nr;exports.textAlignAllowlist=Mo;exports.textDecorationAllowlist=Oo;exports.textTransformAllowlist=Fo;exports.toStyleAttr=Q;exports.typeHasPrefix=kr;exports.warnUnmatchedComponentProps=xs;exports.widgetBasedPropertiesAreAssigned=ws;exports.widgetDeclaresOwnHeight=Fr;
|