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