uhuu-components 0.2.55 → 0.2.56
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/uhuu-components.umd.js
CHANGED
|
@@ -831,7 +831,7 @@
|
|
|
831
831
|
`;async function Sp(t,e={}){return new Promise(function(r,n){let a=new XMLHttpRequest;a.open(e.method||"get",t,!0);for(let i in e.headers)a.setRequestHeader(i,e.headers[i]);a.withCredentials=e.credentials==="include",a.onload=()=>{const i=a.status===0&&t.startsWith("file://")?200:a.status;r(new Response(a.responseText,{status:i}))},a.onerror=n,a.send(e.body||null)})}class KS{constructor(e){this.sheets=[],this.inserted=[],this.hooks={},this.hooks.onUrl=new ne(this),this.hooks.onAtPage=new ne(this),this.hooks.onAtMedia=new ne(this),this.hooks.onRule=new ne(this),this.hooks.onDeclaration=new ne(this),this.hooks.onContent=new ne(this),this.hooks.onSelector=new ne(this),this.hooks.onPseudoSelector=new ne(this),this.hooks.onImport=new ne(this),this.hooks.beforeTreeParse=new ne(this),this.hooks.beforeTreeWalk=new ne(this),this.hooks.afterTreeWalk=new ne(this),e!==!1&&this.setup()}setup(){return this.base=this.insert(US),this.styleEl=document.createElement("style"),document.head.appendChild(this.styleEl),this.styleSheet=this.styleEl.sheet,this.styleSheet}async add(){let e=[],r=[];for(var n=0;n<arguments.length;n++){let a;if(typeof arguments[n]=="object")for(let i in arguments[n]){let o=arguments[n];a=new Promise(function(s,l){r.push(i),s(o[i])})}else r.push(arguments[n]),a=Sp(arguments[n]).then(i=>i.text());e.push(a)}return await Promise.all(e).then(async a=>{let i="";for(let o=0;o<a.length;o++)i=await this.convertViaSheet(a[o],r[o]),this.insert(i);return i})}async convertViaSheet(e,r){let n=new HS(r,this.hooks);await n.parse(e);for(let a of n.imported){let i=await Sp(a).then(s=>s.text()),o=await this.convertViaSheet(i,a);this.insert(o)}return this.sheets.push(n),typeof n.width<"u"&&(this.width=n.width),typeof n.height<"u"&&(this.height=n.height),typeof n.orientation<"u"&&(this.orientation=n.orientation),n.toString()}insert(e){let r=document.querySelector("head"),n=document.createElement("style");return n.setAttribute("data-pagedjs-inserted-styles","true"),n.appendChild(document.createTextNode(e)),r.appendChild(n),this.inserted.push(n),n}destroy(){this.styleEl.remove(),this.inserted.forEach(e=>{e.remove()}),this.sheets=[]}}class ve{constructor(e,r,n){let a=Object.assign({},e&&e.hooks,r&&r.hooks,n&&n.hooks);this.chunker=e,this.polisher=r,this.caller=n;for(let i in a)i in this&&a[i].register(this[i].bind(this))}}Vt(ve.prototype);const xp={A0:{width:{value:841,unit:"mm"},height:{value:1189,unit:"mm"}},A1:{width:{value:594,unit:"mm"},height:{value:841,unit:"mm"}},A2:{width:{value:420,unit:"mm"},height:{value:594,unit:"mm"}},A3:{width:{value:297,unit:"mm"},height:{value:420,unit:"mm"}},A4:{width:{value:210,unit:"mm"},height:{value:297,unit:"mm"}},A5:{width:{value:148,unit:"mm"},height:{value:210,unit:"mm"}},A6:{width:{value:105,unit:"mm"},height:{value:148,unit:"mm"}},A7:{width:{value:74,unit:"mm"},height:{value:105,unit:"mm"}},A8:{width:{value:52,unit:"mm"},height:{value:74,unit:"mm"}},A9:{width:{value:37,unit:"mm"},height:{value:52,unit:"mm"}},A10:{width:{value:26,unit:"mm"},height:{value:37,unit:"mm"}},B4:{width:{value:250,unit:"mm"},height:{value:353,unit:"mm"}},B5:{width:{value:176,unit:"mm"},height:{value:250,unit:"mm"}},letter:{width:{value:8.5,unit:"in"},height:{value:11,unit:"in"}},legal:{width:{value:8.5,unit:"in"},height:{value:14,unit:"in"}},ledger:{width:{value:11,unit:"in"},height:{value:17,unit:"in"}}};class YS extends ve{constructor(e,r,n){super(e,r,n),this.pages={},this.width=void 0,this.height=void 0,this.orientation=void 0,this.marginalia={}}pageModel(e){return{selector:e,name:void 0,psuedo:void 0,nth:void 0,marginalia:{},width:void 0,height:void 0,orientation:void 0,margin:{top:{},right:{},left:{},bottom:{}},padding:{top:{},right:{},left:{},bottom:{}},border:{top:{},right:{},left:{},bottom:{}},backgroundOrigin:void 0,block:{},marks:void 0,notes:void 0,added:!1}}onAtPage(e,r,n){let a,i,o="",s,l,c,d=!1;e.prelude?(s=this.getTypeSelector(e),l=this.getPsuedoSelector(e),c=this.getNthSelector(e),o=G.generate(e.prelude)):o="*",o in this.pages?(a=this.pages[o],i=this.replaceMarginalia(e),d=!0,a.added=!1):(a=this.pageModel(o),i=this.replaceMarginalia(e),this.pages[o]=a),a.name=s,a.psuedo=l,a.nth=c,d?a.marginalia=Object.assign(a.marginalia,i):a.marginalia=i;let u=this.replaceNotes(e);a.notes=u;let p=this.replaceDeclarations(e);if(p.size&&(a.size=p.size,a.width=p.size.width,a.height=p.size.height,a.orientation=p.size.orientation,a.format=p.size.format),p.bleed&&p.bleed[0]!="auto")switch(p.bleed.length){case 4:a.bleed={top:p.bleed[0],right:p.bleed[1],bottom:p.bleed[2],left:p.bleed[3]};break;case 3:a.bleed={top:p.bleed[0],right:p.bleed[1],bottom:p.bleed[2],left:p.bleed[1]};break;case 2:a.bleed={top:p.bleed[0],right:p.bleed[1],bottom:p.bleed[0],left:p.bleed[1]};break;default:a.bleed={top:p.bleed[0],right:p.bleed[0],bottom:p.bleed[0],left:p.bleed[0]}}p.marks&&((!p.bleed||p.bleed&&p.bleed[0]==="auto")&&(a.bleed={top:{value:6,unit:"mm"},right:{value:6,unit:"mm"},bottom:{value:6,unit:"mm"},left:{value:6,unit:"mm"}}),a.marks=p.marks),p.margin&&(a.margin=p.margin),p.padding&&(a.padding=p.padding),p.border&&(a.border=p.border),p.marks&&(a.marks=p.marks),d?a.block.children.appendList(e.block.children):a.block=e.block,n.remove(r)}afterTreeWalk(e,r){let n="*"in this.pages&&this.pages["*"].added===!1;if(this.addPageClasses(this.pages,e,r),n){let a=this.pages["*"].width,i=this.pages["*"].height,o=this.pages["*"].format,s=this.pages["*"].orientation,l=this.pages["*"].bleed,c=this.pages["*"].marks,d,u;":left"in this.pages&&(d=this.pages[":left"].bleed),":right"in this.pages&&(u=this.pages[":right"].bleed),a&&i&&(this.width!==a||this.height!==i)&&(this.width=a,this.height=i,this.format=o,this.orientation=s,this.addRootVars(e,a,i,s,l,u,d,c),this.addRootPage(e,this.pages["*"].size,l,u,d),this.emit("size",{width:a,height:i,orientation:s,format:o,bleed:l}),this.emit("atpages",this.pages))}}getTypeSelector(e){let r;return G.walk(e,{visit:"TypeSelector",enter:(n,a,i)=>{r=n.name}}),r}getPsuedoSelector(e){let r;return G.walk(e,{visit:"PseudoClassSelector",enter:(n,a,i)=>{n.name!=="nth"&&(r=n.name)}}),r}getNthSelector(e){let r;return G.walk(e,{visit:"PseudoClassSelector",enter:(n,a,i)=>{n.name==="nth"&&n.children&&(r=n.children.first().value)}}),r}replaceMarginalia(e){let r={};const n=["top-left-corner","top-left","top","top-center","top-right","top-right-corner","bottom-left-corner","bottom-left","bottom","bottom-center","bottom-right","bottom-right-corner","left-top","left-middle","left","left-bottom","top-right-corner","right-top","right-middle","right","right-bottom","right-right-corner"];return G.walk(e.block,{visit:"Atrule",enter:(a,i,o)=>{let s=a.name;n.includes(s)&&(s==="top"&&(s="top-center"),s==="right"&&(s="right-middle"),s==="left"&&(s="left-middle"),s==="bottom"&&(s="bottom-center"),r[s]=a.block,o.remove(i))}}),r}replaceNotes(e){let r={};return G.walk(e.block,{visit:"Atrule",enter:(n,a,i)=>{let o=n.name;o==="footnote"&&(r[o]=n.block,i.remove(a))}}),r}replaceDeclarations(e){let r={};return G.walk(e.block,{visit:"Declaration",enter:(n,a,i)=>{let o=G.property(n.property).name;if(o==="marks")r.marks=[],G.walk(n,{visit:"Identifier",enter:s=>{r.marks.push(s.name)}}),i.remove(a);else if(o==="margin")r.margin=this.getMargins(n),i.remove(a);else if(o.indexOf("margin-")===0){let s=o.substring(7);r.margin||(r.margin={top:{},right:{},left:{},bottom:{}}),r.margin[s]=n.value.children.first(),i.remove(a)}else if(o==="padding")r.padding=this.getPaddings(n.value),i.remove(a);else if(o.indexOf("padding-")===0){let s=o.substring(8);r.padding||(r.padding={top:{},right:{},left:{},bottom:{}}),r.padding[s]=n.value.children.first(),i.remove(a)}else if(o==="border")r.border||(r.border={top:{},right:{},left:{},bottom:{}}),r.border.top=G.generate(n.value),r.border.right=G.generate(n.value),r.border.left=G.generate(n.value),r.border.bottom=G.generate(n.value),i.remove(a);else if(o.indexOf("border-")===0){r.border||(r.border={top:{},right:{},left:{},bottom:{}});let s=o.substring(7);r.border[s]=G.generate(n.value),i.remove(a)}else o==="size"?(r.size=this.getSize(n),i.remove(a)):o==="bleed"&&(r.bleed=[],G.walk(n,{enter:s=>{switch(s.type){case"String":s.value.indexOf("auto")>-1&&r.bleed.push("auto");break;case"Dimension":r.bleed.push({value:s.value,unit:s.unit});break;case"Number":r.bleed.push({value:s.value,unit:"px"});break}}}),i.remove(a))}}),r}getSize(e){let r,n,a,i;return G.walk(e,{visit:"Dimension",enter:(o,s,l)=>{let{value:c,unit:d}=o;typeof r>"u"?r={value:c,unit:d}:typeof n>"u"&&(n={value:c,unit:d})}}),G.walk(e,{visit:"String",enter:(o,s,l)=>{let c=o.value.replace(/["|']/g,""),d=xp[c];d&&(r=d.width,n=d.height)}}),G.walk(e,{visit:"Identifier",enter:(o,s,l)=>{let c=o.name;if(c==="landscape"||c==="portrait")a=o.name;else if(c!=="auto"){let d=xp[c];d&&(r=d.width,n=d.height),i=c}}}),{width:r,height:n,orientation:a,format:i}}getMargins(e){let r=[],n={top:{},right:{},left:{},bottom:{}};if(G.walk(e,{enter:a=>{switch(a.type){case"Dimension":r.push(a);break;case"Number":r.push({value:a.value,unit:"px"});break}}}),r.length===1)for(let a in n)n[a]=r[0];else r.length===2?(n.top=r[0],n.right=r[1],n.bottom=r[0],n.left=r[1]):r.length===3?(n.top=r[0],n.right=r[1],n.bottom=r[2],n.left=r[1]):r.length===4&&(n.top=r[0],n.right=r[1],n.bottom=r[2],n.left=r[3]);return n}getPaddings(e){let r=[],n={top:{},right:{},left:{},bottom:{}};if(G.walk(e,{enter:a=>{switch(a.type){case"Dimension":r.push(a);break;case"Number":r.push({value:a.value,unit:"px"});break}}}),r.length===1)for(let a in n)n[a]=r[0];else r.length===2?(n.top=r[0],n.right=r[1],n.bottom=r[0],n.left=r[1]):r.length===3?(n.top=r[0],n.right=r[1],n.bottom=r[2],n.left=r[1]):r.length===4&&(n.top=r[0],n.right=r[1],n.bottom=r[2],n.left=r[3]);return n}getBorders(e){let r={top:{},right:{},left:{},bottom:{}};return e.prop=="border"?(r.top=G.generate(e.value),r.right=G.generate(e.value),r.bottom=G.generate(e.value),r.left=G.generate(e.value)):e.prop=="border-top"?r.top=G.generate(e.value):e.prop=="border-right"?r.right=G.generate(e.value):e.prop=="border-bottom"?r.bottom=G.generate(e.value):e.prop=="border-left"&&(r.left=G.generate(e.value)),r}addPageClasses(e,r,n){if("*"in e&&e["*"].added===!1){let a=this.createPage(e["*"],r.children,n);n.insertRule(a),e["*"].added=!0}if(":left"in e&&e[":left"].added===!1){let a=this.createPage(e[":left"],r.children,n);n.insertRule(a),e[":left"].added=!0}if(":right"in e&&e[":right"].added===!1){let a=this.createPage(e[":right"],r.children,n);n.insertRule(a),e[":right"].added=!0}if(":first"in e&&e[":first"].added===!1){let a=this.createPage(e[":first"],r.children,n);n.insertRule(a),e[":first"].added=!0}if(":blank"in e&&e[":blank"].added===!1){let a=this.createPage(e[":blank"],r.children,n);n.insertRule(a),e[":blank"].added=!0}for(let a in e)if(e[a].nth&&e[a].added===!1){let i=this.createPage(e[a],r.children,n);n.insertRule(i),e[a].added=!0}for(let a in e)if(e[a].name&&e[a].added===!1){let i=this.createPage(e[a],r.children,n);n.insertRule(i),e[a].added=!0}}createPage(e,r,n){let a=this.selectorsForPage(e),i=e.block.children.copy(),o={type:"Block",loc:0,children:i},s=this.createRule(a,o);return this.addMarginVars(e.margin,i,i.first()),this.addPaddingVars(e.padding,i,i.first()),this.addBorderVars(e.border,i,i.first()),e.width&&this.addDimensions(e.width,e.height,e.orientation,i,i.first()),e.marginalia&&(this.addMarginaliaStyles(e,r,s,n),this.addMarginaliaContent(e,r,s,n)),e.notes&&this.addNotesStyles(e.notes,e,r,s,n),s}addMarginVars(e,r,n){for(let a in e)if(typeof e[a].value<"u"){let i=e[a].value+(e[a].unit||""),o=r.createItem({type:"Declaration",property:"--pagedjs-margin-"+a,value:{type:"Raw",value:i}});r.append(o,n)}}addPaddingVars(e,r,n){for(let a in e)if(typeof e[a].value<"u"){let i=e[a].value+(e[a].unit||""),o=r.createItem({type:"Declaration",property:"--pagedjs-padding-"+a,value:{type:"Raw",value:i}});r.append(o,n)}}addBorderVars(e,r,n){for(const a of Object.keys(e)){const i=e[a];if(typeof i=="string"){const o=r.createItem({type:"Declaration",property:"--pagedjs-border-"+a,value:{type:"Raw",value:i}});r.append(o,n)}}}addDimensions(e,r,n,a,i){let o,s;o=te(e),s=te(r),n&&n!=="portrait"&&([o,s]=[s,o]);let l=this.createVariable("--pagedjs-pagebox-width",o);a.appendData(l);let c=this.createVariable("--pagedjs-pagebox-height",s);a.appendData(c)}addMarginaliaStyles(e,r,n,a){for(let i in e.marginalia){let o=G.clone(e.marginalia[i]),s=!1;if(o.children.isEmpty())continue;G.walk(o,{visit:"Declaration",enter:(u,p,f)=>{if(u.property==="content"&&(u.value.children&&u.value.children.first().name==="none"?s=!1:s=!0,f.remove(p)),u.property==="vertical-align"&&(G.walk(u,{visit:"Identifier",enter:(v,m,g)=>{let C=v.name;C==="top"?v.name="flex-start":C==="middle"?v.name="center":C==="bottom"&&(v.name="flex-end")}}),u.property="align-items"),u.property==="width"&&(i==="top-left"||i==="top-center"||i==="top-right"||i==="bottom-left"||i==="bottom-center"||i==="bottom-right")){let v=G.clone(u);v.property="max-width",f.appendData(v)}if(u.property==="height"&&(i==="left-top"||i==="left-middle"||i==="left-bottom"||i==="right-top"||i==="right-middle"||i==="right-bottom")){let v=G.clone(u);v.property="max-height",f.appendData(v)}}});let l=this.selectorsForPageMargin(e,i),c=this.createRule(l,o);r.appendData(c);let d=G.generate({type:"Selector",children:l});this.marginalia[d]={page:e,selector:d,block:e.marginalia[i],hasContent:s}}}addMarginaliaContent(e,r,n,a){let i;for(let o in e.marginalia){let s=G.clone(e.marginalia[o]);if(G.walk(s,{visit:"Declaration",enter:(f,v,m)=>{f.property!=="content"&&m.remove(v),f.value.children&&f.value.children.first().name==="none"&&(i=!0)}}),s.children.isEmpty())continue;let l=this.selectorsForPageMargin(e,o),c;l.insertData({type:"Combinator",name:">"}),l.insertData({type:"ClassSelector",name:"pagedjs_margin-content"}),l.insertData({type:"Combinator",name:">"}),l.insertData({type:"TypeSelector",name:"*"}),i?c=this.createDeclaration("display","none"):c=this.createDeclaration("display","block");let d=this.createRule(l,[c]);a.insertRule(d);let u=this.selectorsForPageMargin(e,o);u.insertData({type:"Combinator",name:">"}),u.insertData({type:"ClassSelector",name:"pagedjs_margin-content"}),u.insertData({type:"PseudoElementSelector",name:"after",children:null});let p=this.createRule(u,s);a.insertRule(p)}}addRootVars(e,r,n,a,i,o,s,l){let c=[],d=new G.List;d.insertData({type:"PseudoClassSelector",name:"root",children:null});let u,p,f,v,m,g;if(!i)u=te(r),p=te(n),f=te(r),v=te(n),m=te(r),g=te(n);else{u=`calc( ${te(r)} + ${te(i.left)} + ${te(i.right)} )`,p=`calc( ${te(n)} + ${te(i.top)} + ${te(i.bottom)} )`,f=`calc( ${te(r)} + ${te(i.left)} + ${te(i.right)} )`,v=`calc( ${te(n)} + ${te(i.top)} + ${te(i.bottom)} )`,m=`calc( ${te(r)} + ${te(i.left)} + ${te(i.right)} )`,g=`calc( ${te(n)} + ${te(i.top)} + ${te(i.bottom)} )`;let w=this.createVariable("--pagedjs-bleed-top",te(i.top)),A=this.createVariable("--pagedjs-bleed-right",te(i.right)),_=this.createVariable("--pagedjs-bleed-bottom",te(i.bottom)),I=this.createVariable("--pagedjs-bleed-left",te(i.left)),M=this.createVariable("--pagedjs-bleed-right-top",te(i.top)),z=this.createVariable("--pagedjs-bleed-right-right",te(i.right)),R=this.createVariable("--pagedjs-bleed-right-bottom",te(i.bottom)),H=this.createVariable("--pagedjs-bleed-right-left",te(i.left)),D=this.createVariable("--pagedjs-bleed-left-top",te(i.top)),F=this.createVariable("--pagedjs-bleed-left-right",te(i.right)),q=this.createVariable("--pagedjs-bleed-left-bottom",te(i.bottom)),P=this.createVariable("--pagedjs-bleed-left-left",te(i.left));o&&(M=this.createVariable("--pagedjs-bleed-right-top",te(o.top)),z=this.createVariable("--pagedjs-bleed-right-right",te(o.right)),R=this.createVariable("--pagedjs-bleed-right-bottom",te(o.bottom)),H=this.createVariable("--pagedjs-bleed-right-left",te(o.left)),f=`calc( ${te(r)} + ${te(o.left)} + ${te(o.right)} )`,v=`calc( ${te(n)} + ${te(o.top)} + ${te(o.bottom)} )`),s&&(D=this.createVariable("--pagedjs-bleed-left-top",te(s.top)),F=this.createVariable("--pagedjs-bleed-left-right",te(s.right)),q=this.createVariable("--pagedjs-bleed-left-bottom",te(s.bottom)),P=this.createVariable("--pagedjs-bleed-left-left",te(s.left)),m=`calc( ${te(r)} + ${te(s.left)} + ${te(s.right)} )`,g=`calc( ${te(n)} + ${te(s.top)} + ${te(s.bottom)} )`);let j=this.createVariable("--pagedjs-width",te(r)),Y=this.createVariable("--pagedjs-height",te(n));c.push(w,A,_,I,M,z,R,H,D,F,q,P,j,Y)}if(l&&l.forEach(w=>{let A=this.createVariable("--pagedjs-mark-"+w+"-display","block");c.push(A)}),a){let w=this.createVariable("--pagedjs-orientation",a);c.push(w),a!=="portrait"&&([u,p]=[p,u],[f,v]=[v,f],[m,g]=[g,m])}let C=this.createVariable("--pagedjs-width",u),x=this.createVariable("--pagedjs-height",p),h=this.createVariable("--pagedjs-width-right",f),b=this.createVariable("--pagedjs-height-right",v),S=this.createVariable("--pagedjs-width-left",m),E=this.createVariable("--pagedjs-height-left",g);c.push(C,x,h,b,S,E);let k=this.createRule(d,c);e.children.appendData(k)}addNotesStyles(e,r,n,a,i){for(const o in e){let s=this.selectorsForPage(r);s.insertData({type:"Combinator",name:" "}),s.insertData({type:"ClassSelector",name:"pagedjs_"+o+"_content"});let l=this.createRule(s,e[o]);n.appendData(l)}}addRootPage(e,r,n,a,i){let{width:o,height:s,orientation:l,format:c}=r,d=new G.List,u=new G.List,p=new G.List,f=new G.List,v=new G.List,m=new G.List;if(n){let C=new G.List,x=new G.List;C.appendData({type:"Dimension",unit:o.unit,value:o.value}),C.appendData({type:"WhiteSpace",value:" "}),C.appendData({type:"Operator",value:"+"}),C.appendData({type:"WhiteSpace",value:" "}),C.appendData({type:"Dimension",unit:n.left.unit,value:n.left.value}),C.appendData({type:"WhiteSpace",value:" "}),C.appendData({type:"Operator",value:"+"}),C.appendData({type:"WhiteSpace",value:" "}),C.appendData({type:"Dimension",unit:n.right.unit,value:n.right.value}),x.appendData({type:"Dimension",unit:s.unit,value:s.value}),x.appendData({type:"WhiteSpace",value:" "}),x.appendData({type:"Operator",value:"+"}),x.appendData({type:"WhiteSpace",value:" "}),x.appendData({type:"Dimension",unit:n.top.unit,value:n.top.value}),x.appendData({type:"WhiteSpace",value:" "}),x.appendData({type:"Operator",value:"+"}),x.appendData({type:"WhiteSpace",value:" "}),x.appendData({type:"Dimension",unit:n.bottom.unit,value:n.bottom.value}),f.appendData({type:"Function",name:"calc",children:C}),f.appendData({type:"WhiteSpace",value:" "}),f.appendData({type:"Function",name:"calc",children:x})}else c?(f.appendData({type:"Identifier",name:c}),l&&(f.appendData({type:"WhiteSpace",value:" "}),f.appendData({type:"Identifier",name:l}))):(f.appendData({type:"Dimension",unit:o.unit,value:o.value}),f.appendData({type:"WhiteSpace",value:" "}),f.appendData({type:"Dimension",unit:s.unit,value:s.value}));d.appendData({type:"Declaration",property:"size",loc:null,value:{type:"Value",children:f}}),d.appendData({type:"Declaration",property:"margin",loc:null,value:{type:"Value",children:[{type:"Dimension",unit:"px",value:0}]}}),d.appendData({type:"Declaration",property:"padding",loc:null,value:{type:"Value",children:[{type:"Dimension",unit:"px",value:0}]}}),d.appendData({type:"Declaration",property:"padding",loc:null,value:{type:"Value",children:[{type:"Dimension",unit:"px",value:0}]}});let g=e.children.createItem({type:"Atrule",prelude:null,name:"page",block:{type:"Block",loc:null,children:d}});if(e.children.append(g),i){let C=new G.List,x=new G.List;C.appendData({type:"Dimension",unit:o.unit,value:o.value}),C.appendData({type:"WhiteSpace",value:" "}),C.appendData({type:"Operator",value:"+"}),C.appendData({type:"WhiteSpace",value:" "}),C.appendData({type:"Dimension",unit:i.left.unit,value:i.left.value}),C.appendData({type:"WhiteSpace",value:" "}),C.appendData({type:"Operator",value:"+"}),C.appendData({type:"WhiteSpace",value:" "}),C.appendData({type:"Dimension",unit:i.right.unit,value:i.right.value}),x.appendData({type:"Dimension",unit:s.unit,value:s.value}),x.appendData({type:"WhiteSpace",value:" "}),x.appendData({type:"Operator",value:"+"}),x.appendData({type:"WhiteSpace",value:" "}),x.appendData({type:"Dimension",unit:i.top.unit,value:i.top.value}),x.appendData({type:"WhiteSpace",value:" "}),x.appendData({type:"Operator",value:"+"}),x.appendData({type:"WhiteSpace",value:" "}),x.appendData({type:"Dimension",unit:i.bottom.unit,value:i.bottom.value}),v.appendData({type:"Function",name:"calc",children:C}),v.appendData({type:"WhiteSpace",value:" "}),v.appendData({type:"Function",name:"calc",children:x}),u.appendData({type:"Declaration",property:"size",loc:null,value:{type:"Value",children:v}});let h=e.children.createItem({type:"Atrule",prelude:null,name:"page :left",block:{type:"Block",loc:null,children:u}});e.children.append(h)}if(a){let C=new G.List,x=new G.List;C.appendData({type:"Dimension",unit:o.unit,value:o.value}),C.appendData({type:"WhiteSpace",value:" "}),C.appendData({type:"Operator",value:"+"}),C.appendData({type:"WhiteSpace",value:" "}),C.appendData({type:"Dimension",unit:a.left.unit,value:a.left.value}),C.appendData({type:"WhiteSpace",value:" "}),C.appendData({type:"Operator",value:"+"}),C.appendData({type:"WhiteSpace",value:" "}),C.appendData({type:"Dimension",unit:a.right.unit,value:a.right.value}),x.appendData({type:"Dimension",unit:s.unit,value:s.value}),x.appendData({type:"WhiteSpace",value:" "}),x.appendData({type:"Operator",value:"+"}),x.appendData({type:"WhiteSpace",value:" "}),x.appendData({type:"Dimension",unit:a.top.unit,value:a.top.value}),x.appendData({type:"WhiteSpace",value:" "}),x.appendData({type:"Operator",value:"+"}),x.appendData({type:"WhiteSpace",value:" "}),x.appendData({type:"Dimension",unit:a.bottom.unit,value:a.bottom.value}),m.appendData({type:"Function",name:"calc",children:C}),m.appendData({type:"WhiteSpace",value:" "}),m.appendData({type:"Function",name:"calc",children:x}),p.appendData({type:"Declaration",property:"size",loc:null,value:{type:"Value",children:m}});let h=e.children.createItem({type:"Atrule",prelude:null,name:"page :right",block:{type:"Block",loc:null,children:p}});e.children.append(h)}}getNth(e){let r=e.indexOf("n"),n=e.indexOf("+"),a=e.split("n"),i=e.split("+"),o=null,s=null;return r>-1?(o=a[0],n>-1&&(s=i[1])):s=e,{type:"Nth",loc:null,selector:null,nth:{type:"AnPlusB",loc:null,a:o,b:s}}}addPageAttributes(e,r,n){let a=[r.dataset.page];if(a&&a.length)for(const i of a)i&&(e.name=i,e.element.classList.add("pagedjs_named_page"),e.element.classList.add("pagedjs_"+i+"_page"),r.dataset.splitFrom||e.element.classList.add("pagedjs_"+i+"_first_page"))}getStartElement(e,r){let n=r&&r.node;if(!e&&!r)return;if(!n)return e.children[0];if(n.nodeType===1&&n.parentNode.nodeType===11||n.nodeType===1&&n.dataset.page)return n;let a=Cc(n),i=a.querySelectorAll("[data-page]");return i.length?i[i.length-1]:a.children[0]}beforePageLayout(e,r,n,a){let i=this.getStartElement(r,n);i&&this.addPageAttributes(e,i,a.pages)}finalizePage(e,r,n,a){for(let i in this.marginalia){let o=this.marginalia[i],s=i.split(" "),l;r.element.matches(s[0])&&o.hasContent&&(l=r.element.querySelector(s[1]),l.classList.add("hasContent"))}["top","bottom"].forEach(i=>{let o=r.element.querySelector(".pagedjs_margin-"+i),s=r.element.querySelector(".pagedjs_margin-"+i+"-center"),l=r.element.querySelector(".pagedjs_margin-"+i+"-left"),c=r.element.querySelector(".pagedjs_margin-"+i+"-right"),d=s.classList.contains("hasContent"),u=l.classList.contains("hasContent"),p=c.classList.contains("hasContent"),f,v,m;if(u&&(v=window.getComputedStyle(l)["max-width"]),p&&(m=window.getComputedStyle(c)["max-width"]),d)if(f=window.getComputedStyle(s)["max-width"],f==="none"||f==="auto")if(!u&&!p)o.style["grid-template-columns"]="0 1fr 0";else if(u)if(p)if(v!=="none"&&v!=="auto")m!=="none"&&m!=="auto"?o.style["grid-template-columns"]=v+" 1fr "+m:o.style["grid-template-columns"]=v+" 1fr "+v;else if(m!=="none"&&m!=="auto")o.style["grid-template-columns"]=m+" 1fr "+m;else{o.style["grid-template-columns"]="auto auto 1fr",l.style["white-space"]="nowrap",s.style["white-space"]="nowrap",c.style["white-space"]="nowrap";let g=l.offsetWidth,C=s.offsetWidth,x=c.offsetWidth,h=g+C+x,b=C*100/h;b>40?o.style["grid-template-columns"]="minmax(16.66%, 1fr) minmax(33%, "+b+"%) minmax(16.66%, 1fr)":o.style["grid-template-columns"]="repeat(3, 1fr)",l.style["white-space"]="normal",s.style["white-space"]="normal",c.style["white-space"]="normal"}else if(v!=="none"&&v!=="auto")o.style["grid-template-columns"]=v+" 1fr "+v;else{o.style["grid-template-columns"]="auto auto 1fr",l.style["white-space"]="nowrap",s.style["white-space"]="nowrap";let g=l.offsetWidth,C=s.offsetWidth,x=g+C,h=C*100/x;o.style["grid-template-columns"]="minmax(16.66%, 1fr) minmax(33%, "+h+"%) minmax(16.66%, 1fr)",l.style["white-space"]="normal",s.style["white-space"]="normal"}else if(m!=="none"&&m!=="auto")o.style["grid-template-columns"]=m+" 1fr "+m;else{o.style["grid-template-columns"]="auto auto 1fr",c.style["white-space"]="nowrap",s.style["white-space"]="nowrap";let g=c.offsetWidth,C=s.offsetWidth,x=g+C,h=C*100/x;o.style["grid-template-columns"]="minmax(16.66%, 1fr) minmax(33%, "+h+"%) minmax(16.66%, 1fr)",c.style["white-space"]="normal",s.style["white-space"]="normal"}else f!=="none"&&f!=="auto"&&(u&&v!=="none"&&v!=="auto"?o.style["grid-template-columns"]=v+" "+f+" 1fr":p&&m!=="none"&&m!=="auto"?o.style["grid-template-columns"]="1fr "+f+" "+m:o.style["grid-template-columns"]="1fr "+f+" 1fr");else if(u)if(!p)o.style["grid-template-columns"]="1fr 0 0";else if(v!=="none"&&v!=="auto")m!=="none"&&m!=="auto"?o.style["grid-template-columns"]=v+" 1fr "+m:o.style["grid-template-columns"]=v+" 0 1fr";else if(m!=="none"&&m!=="auto")o.style["grid-template-columns"]="1fr 0 "+m;else{o.style["grid-template-columns"]="auto 1fr auto",l.style["white-space"]="nowrap",c.style["white-space"]="nowrap";let g=l.offsetWidth,C=c.offsetWidth,x=g+C,h=g*100/x;o.style["grid-template-columns"]="minmax(16.66%, "+h+"%) 0 1fr",l.style["white-space"]="normal",c.style["white-space"]="normal"}else m!=="none"&&m!=="auto"?o.style["grid-template-columns"]="1fr 0 "+m:o.style["grid-template-columns"]="0 0 1fr"}),["left","right"].forEach(i=>{let o=r.element.querySelector(".pagedjs_margin-"+i+"-middle.hasContent"),s=r.element.querySelector(".pagedjs_margin-"+i),l=r.element.querySelector(".pagedjs_margin-"+i+"-top"),c=r.element.querySelector(".pagedjs_margin-"+i+"-bottom"),d=l.classList.contains("hasContent"),u=c.classList.contains("hasContent"),p,f,v;d&&(f=window.getComputedStyle(l)["max-height"]),u&&(v=window.getComputedStyle(c)["max-height"]),o?(p=window.getComputedStyle(o)["max-height"],p==="none"||p==="auto"?!d&&!u?s.style["grid-template-rows"]="0 1fr 0":d?u?f!=="none"&&f!=="auto"?v!=="none"&&v!=="auto"?s.style["grid-template-rows"]=f+" calc(100% - "+f+" - "+v+") "+v:s.style["grid-template-rows"]=f+" calc(100% - "+f+"*2) "+f:v!=="none"&&v!=="auto"&&(s.style["grid-template-rows"]=v+" calc(100% - "+v+"*2) "+v):f!=="none"&&f!=="auto"&&(s.style["grid-template-rows"]=f+" calc(100% - "+f+"*2) "+f):v!=="none"&&v!=="auto"&&(s.style["grid-template-rows"]=v+" calc(100% - "+v+"*2) "+v):d&&f!=="none"&&f!=="auto"?s.style["grid-template-rows"]=f+" "+p+" calc(100% - ("+f+" + "+p+"))":u&&v!=="none"&&v!=="auto"?s.style["grid-template-rows"]="1fr "+p+" "+v:s.style["grid-template-rows"]="calc((100% - "+p+")/2) "+p+" calc((100% - "+p+")/2)"):d?u?f!=="none"&&f!=="auto"?v!=="none"&&v!=="auto"?s.style["grid-template-rows"]=f+" 1fr "+v:s.style["grid-template-rows"]=f+" 0 1fr":v!=="none"&&v!=="auto"?s.style["grid-template-rows"]="1fr 0 "+v:s.style["grid-template-rows"]="1fr 0 1fr":s.style["grid-template-rows"]="1fr 0 0":v!=="none"&&v!=="auto"?s.style["grid-template-rows"]="1fr 0 "+v:s.style["grid-template-rows"]="0 0 1fr"})}selectorsForPage(e){let r,n,a=new G.List;return a.insertData({type:"ClassSelector",name:"pagedjs_page"}),e.name&&(a.insertData({type:"ClassSelector",name:"pagedjs_named_page"}),a.insertData({type:"ClassSelector",name:"pagedjs_"+e.name+"_page"})),e.psuedo&&!(e.name&&e.psuedo==="first")&&a.insertData({type:"ClassSelector",name:"pagedjs_"+e.psuedo+"_page"}),e.name&&e.psuedo==="first"&&a.insertData({type:"ClassSelector",name:"pagedjs_"+e.name+"_"+e.psuedo+"_page"}),e.nth&&(r=new G.List,n=this.getNth(e.nth),r.insertData(n),a.insertData({type:"PseudoClassSelector",name:"nth-of-type",children:r})),a}selectorsForPageMargin(e,r){let n=this.selectorsForPage(e);return n.insertData({type:"Combinator",name:" "}),n.insertData({type:"ClassSelector",name:"pagedjs_margin-"+r}),n}createDeclaration(e,r,n){let a=new G.List;return a.insertData({type:"Identifier",loc:null,name:r}),{type:"Declaration",loc:null,important:n,property:e,value:{type:"Value",loc:null,children:a}}}createVariable(e,r){return{type:"Declaration",loc:null,property:e,value:{type:"Raw",value:r}}}createCalculatedDimension(e,r,n,a="+"){let i=new G.List,o=new G.List;return r.forEach((s,l)=>{o.appendData({type:"Dimension",unit:s.unit,value:s.value}),o.appendData({type:"WhiteSpace",value:" "}),l+1<r.length&&(o.appendData({type:"Operator",value:a}),o.appendData({type:"WhiteSpace",value:" "}))}),i.insertData({type:"Function",loc:null,name:"calc",children:o}),{type:"Declaration",loc:null,important:n,property:e,value:{type:"Value",loc:null,children:i}}}createDimension(e,r,n){let a=new G.List;return a.insertData({type:"Dimension",loc:null,value:r.value,unit:r.unit}),{type:"Declaration",loc:null,important:n,property:e,value:{type:"Value",loc:null,children:a}}}createBlock(e){let r=new G.List;return e.forEach(n=>{r.insertData(n)}),{type:"Block",loc:null,children:r}}createRule(e,r){let n=new G.List;return n.insertData({type:"Selector",children:e}),Array.isArray(r)&&(r=this.createBlock(r)),{type:"Rule",prelude:{type:"SelectorList",children:n},block:r}}}class XS extends ve{constructor(e,r,n){super(e,r,n),this.breaks={}}onDeclaration(e,r,n,a){let i=e.property;if(i==="page"){let s=e.value.children.first().name,l=G.generate(a.ruleNode.prelude),d={property:i,value:s,selector:l,name:s};l.split(",").forEach(u=>{this.breaks[u]?this.breaks[u].push(d):this.breaks[u]=[d]}),n.remove(r)}if(i==="break-before"||i==="break-after"||i==="page-break-before"||i==="page-break-after"){let s=e.value.children.first().name,l=G.generate(a.ruleNode.prelude);i==="page-break-before"?i="break-before":i==="page-break-after"&&(i="break-after");let c={property:i,value:s,selector:l};l.split(",").forEach(d=>{this.breaks[d]?this.breaks[d].push(c):this.breaks[d]=[c]}),n.remove(r)}}afterParsed(e){this.processBreaks(e,this.breaks)}processBreaks(e,r){for(let a in r){let i=e.querySelectorAll(a);for(var n=0;n<i.length;n++)for(let o of r[a])if(o.property==="break-after"){let s=wc(i[n],e);i[n].setAttribute("data-break-after",o.value),s&&s.setAttribute("data-previous-break-after",o.value)}else if(o.property==="break-before"){let s=ky(i[n],e);if(s){if(o.value==="page"&&kc(i[n],s))continue;i[n].setAttribute("data-break-before",o.value),s.setAttribute("data-next-break-before",o.value)}}else if(o.property==="page"){i[n].setAttribute("data-page",o.value);let s=wc(i[n],e);s&&s.setAttribute("data-after-page",o.value)}else i[n].setAttribute("data-"+o.property,o.value)}}mergeBreaks(e,r){for(let n in r)n in e?e[n]=e[n].concat(r[n]):e[n]=r[n];return e}addBreakAttributes(e,r){let n=e.querySelector("[data-break-before]"),a=e.querySelector("[data-break-after]"),i=e.querySelector("[data-previous-break-after]");n&&(n.dataset.splitFrom?(r.splitFrom=n.dataset.splitFrom,e.setAttribute("data-split-from",n.dataset.splitFrom)):n.dataset.breakBefore&&n.dataset.breakBefore!=="avoid"&&(r.breakBefore=n.dataset.breakBefore,e.setAttribute("data-break-before",n.dataset.breakBefore))),a&&a.dataset&&(a.dataset.splitTo?(r.splitTo=a.dataset.splitTo,e.setAttribute("data-split-to",a.dataset.splitTo)):a.dataset.breakAfter&&a.dataset.breakAfter!=="avoid"&&(r.breakAfter=a.dataset.breakAfter,e.setAttribute("data-break-after",a.dataset.breakAfter))),i&&i.dataset&&i.dataset.previousBreakAfter&&i.dataset.previousBreakAfter!=="avoid"&&(r.previousBreakAfter=i.dataset.previousBreakAfter)}afterPageLayout(e,r){this.addBreakAttributes(e,r)}}class ZS extends ve{constructor(e,r,n){super(e,r,n)}onAtMedia(e,r,n){let a=this.getMediaName(e),i;a.includes("print")?(i=e.block.children,n.appendList(i),n.remove(r)):!a.includes("all")&&!a.includes("pagedjs-ignore")&&n.remove(r)}getMediaName(e){let r=[];if(!(typeof e.prelude>"u"||e.prelude.type!=="AtrulePrelude"))return G.walk(e.prelude,{visit:"Identifier",enter:(n,a,i)=>{r.push(n.name)}}),r}}class QS extends ve{constructor(e,r,n){super(e,r,n)}afterPageLayout(e,r,n,a){let i=Array.from(e.querySelectorAll("[data-split-from]")),o=e.parentNode,s=Array.prototype.indexOf.call(o.children,e),l;if(s===0)return;l=o.children[s-1];let c;i.forEach(d=>{let u=d.dataset.ref;c=l.querySelector("[data-ref='"+u+"']:not([data-split-to])"),c&&(c.dataset.splitTo=u,c.dataset.splitFrom||(c.dataset.splitOriginal=!0))}),c&&this.handleAlignment(c)}handleAlignment(e){let r=window.getComputedStyle(e),n=r["text-align"],a=r["text-align-last"];e.dataset.lastSplitElement="true",n==="justify"&&a==="auto"?e.dataset.alignLastSplitElement="justify":e.dataset.alignLastSplitElement=a}}class JS extends ve{constructor(e,r,n){super(e,r,n),this.styleSheet=r.styleSheet,this.counters={},this.resetCountersMap=new Map}onDeclaration(e,r,n,a){let i=e.property;if(i==="counter-increment"){this.handleIncrement(e,a);let o=!1;e.value.children.forEach(s=>{s.type&&s.type!=="WhiteSpace"&&(o=!0)}),o||n.remove(r)}else if(i==="counter-reset"){this.handleReset(e,a);let o=!1;e.value.children.forEach(s=>{s.type&&s.type!=="WhiteSpace"&&(o=!0)}),o||n.remove(r)}}afterParsed(e){this.processCounters(e,this.counters),this.scopeCounters(this.counters)}addCounter(e){return e in this.counters?this.counters[e]:(this.counters[e]={name:e,increments:{},resets:{}},this.counters[e])}handleIncrement(e,r){let n=[],a=e.value.children;return a.forEach((i,o)=>{if(i.type&&i.type==="Identifier"){let s=i.name;if(s==="page"||s.indexOf("target-counter-")===0)return;let l,c,d;o.next&&o.next.data.type==="WhiteSpace"&&(l=o.next),l&&l.next&&l.next.data.type==="Number"&&(c=l.next,d=parseInt(c.data.value));let u=G.generate(r.ruleNode.prelude),p;s in this.counters?p=this.counters[s]:p=this.addCounter(s);let f={selector:u,number:d||1};p.increments[u]=f,n.push(f),a.remove(o),l&&a.remove(l),c&&a.remove(c)}}),n}handleReset(e,r){let n=e.value.children;n.forEach((a,i)=>{if(a.type&&a.type==="Identifier"){let o=a.name,s,l,c;i.next&&i.next.data.type==="WhiteSpace"&&(s=i.next),s&&s.next&&(s.next.data.type==="Number"?(l=s.next,c=parseInt(l.data.value)):s.next.data.type==="Function"&&s.next.data.name==="var"&&(l=s.next,c=s.next.data.children.head.data.name));let d,u,p=r.ruleNode.prelude;r.ruleNode.type==="Atrule"&&r.ruleNode.name==="page"?u=".pagedjs_page":u=G.generate(p||r.ruleNode),o==="footnote"&&this.addFootnoteMarkerCounter(e.value.children),o in this.counters?d=this.counters[o]:d=this.addCounter(o);let f={selector:u,number:c||0};d.resets[u]=f,u!==".pagedjs_page"&&(n.remove(i),s&&n.remove(s),l&&n.remove(l))}})}processCounters(e,r){let n;for(let a in r)n=this.counters[a],this.processCounterIncrements(e,n),this.processCounterResets(e,n),a!=="page"&&this.addCounterValues(e,n)}scopeCounters(e){let r=[];for(let n in e)n!=="page"&&r.push(`${e[n].name} 0`);this.insertRule(`.pagedjs_pages { counter-reset: ${r.join(" ")} page 0 pages var(--pagedjs-page-count) footnote var(--pagedjs-footnotes-count) footnote-marker var(--pagedjs-footnotes-count)}`)}insertRule(e){this.styleSheet.insertRule(e,this.styleSheet.cssRules.length)}processCounterIncrements(e,r){let n;for(let a in r.increments){n=r.increments[a];let i=e.querySelectorAll(n.selector);for(let o=0;o<i.length;o++)i[o].setAttribute("data-counter-"+r.name+"-increment",n.number),i[o].getAttribute("data-counter-increment")?i[o].setAttribute("data-counter-increment",i[o].getAttribute("data-counter-increment")+" "+r.name):i[o].setAttribute("data-counter-increment",r.name)}}processCounterResets(e,r){let n;for(let i in r.resets){n=r.resets[i];let o=e.querySelectorAll(n.selector);for(var a=0;a<o.length;a++){let s=n.number;typeof s=="string"&&s.startsWith("--")&&(s=o[a].style.getPropertyValue(s)||0),o[a].setAttribute("data-counter-"+r.name+"-reset",s),o[a].getAttribute("data-counter-reset")?o[a].setAttribute("data-counter-reset",o[a].getAttribute("data-counter-reset")+" "+r.name):o[a].setAttribute("data-counter-reset",r.name)}}}addCounterValues(e,r){let n=r.name;if(n==="page"||n==="footnote")return;let a=e.querySelectorAll("[data-counter-"+n+"-reset], [data-counter-"+n+"-increment]"),i=0,o,s,l,c,d,u,p;for(let f=0;f<a.length;f++)o=a[f],u=0,p=[],o.hasAttribute("data-counter-"+n+"-reset")&&(l=o.getAttribute("data-counter-"+n+"-reset"),c=parseInt(l),u=c-i,p.push(`${n} ${u}`),i=c),o.hasAttribute("data-counter-"+n+"-increment")&&(s=o.getAttribute("data-counter-"+n+"-increment"),d=parseInt(s),i+=d,o.setAttribute("data-counter-"+n+"-value",i),p.push(`${n} ${d}`)),p.length>0&&this.incrementCounterForElement(o,p)}addFootnoteMarkerCounter(e){let r=[];G.walk(e,{visit:"Identifier",enter:(n,a,i)=>{r.push(n.name)}}),!r.includes("footnote-maker")&&(e.insertData({type:"WhiteSpace",value:" "}),e.insertData({type:"Identifier",name:"footnote-marker"}),e.insertData({type:"WhiteSpace",value:" "}),e.insertData({type:"Number",value:0}))}incrementCounterForElement(e,r){if(!e||!r||r.length===0)return;const n=e.dataset.ref,a=Array.from(this.styleSheet.cssRules).filter(o=>o.selectorText===`[data-ref="${e.dataset.ref}"]:not([data-split-from])`&&o.style[0]==="counter-increment").map(o=>o.style.counterIncrement);a.push(this.mergeIncrements(r,(o,s)=>(parseInt(o)||0)+(parseInt(s)||0)));const i=this.mergeIncrements(a,(o,s)=>s);this.insertRule(`[data-ref="${n}"]:not([data-split-from]) { counter-increment: ${i} }`)}mergeIncrements(e,r){const n={};return e.forEach(a=>{let i=a.split(" ");for(let o=0;o<i.length;o+=2)n[i[o]]=r(n[i[o]],i[o+1])}),Object.entries(n).map(([a,i])=>`${a} ${i}`).join(" ")}afterPageLayout(e,r){let n=[];e.querySelectorAll("[data-counter-page-reset]:not([data-split-from])").forEach(o=>{const s=o.dataset&&o.dataset.ref;if(!(s&&this.resetCountersMap.has(s))){s&&this.resetCountersMap.set(s,"");let l=o.dataset.counterPageReset;n.push(`page ${l}`)}}),e.querySelectorAll("[data-counter-footnote-reset]:not([data-split-from])").forEach(o=>{let s=o.dataset.counterFootnoteReset;n.push(`footnote ${s}`),n.push(`footnote-marker ${s}`)}),n.length&&this.styleSheet.insertRule(`[data-page-number="${e.dataset.pageNumber}"] { counter-increment: none; counter-reset: ${n.join(" ")} }`,this.styleSheet.cssRules.length)}}class ex extends ve{constructor(e,r,n){super(e,r,n)}afterParsed(e){const r=e.querySelectorAll("ol");for(var n of r)this.addDataNumbers(n)}afterPageLayout(e,r,n,a){var i=e.getElementsByTagName("ol");for(var o of i)o.firstElementChild&&(o.start=o.firstElementChild.dataset.itemNum)}addDataNumbers(e){let r=1;e.hasAttribute("start")&&(r=parseInt(e.getAttribute("start"),10),isNaN(r)&&(r=1));let n=e.children;for(var a=0;a<n.length;a++)n[a].setAttribute("data-item-num",a+r)}}class tx extends ve{constructor(e,r,n){super(e,r,n),this.styleSheet=r.styleSheet,this.fixedElementsSelector=[],this.fixedElements=[]}onDeclaration(e,r,n,a){if(e.property==="position"&&e.value.children.first().name==="fixed"){let i=G.generate(a.ruleNode.prelude);this.fixedElementsSelector.push(i),n.remove(r)}}afterParsed(e){this.fixedElementsSelector.forEach(r=>{e.querySelectorAll(`${r}`).forEach(n=>{n.style.setProperty("position","absolute"),this.fixedElements.push(n),n.remove()})})}afterPageLayout(e,r,n){this.fixedElements.forEach(a=>{const i=a.cloneNode(!0);e.querySelector(".pagedjs_pagebox").insertAdjacentElement("afterbegin",i)})}}class rx extends ve{constructor(e,r,n){super(e,r,n),this.styleSheet=r.styleSheet,this.pageCounter={name:"page",increments:{},resets:{}}}onDeclaration(e,r,n,a){e.property==="counter-increment"&&this.handleIncrement(e,a)&&n.remove(r)}afterParsed(e){for(const r in this.pageCounter.increments){const n=this.pageCounter.increments[r];this.insertRule(`${n.selector} { --pagedjs-page-counter-increment: ${n.number} }`)}}handleIncrement(e,r){const n=e.value.children.first(),a=e.value.children.getSize()>1?e.value.children.last().value:1,i=n&&n.name;if(i&&i.indexOf("target-counter-")===0||i!=="page"||r.ruleNode.name==="page"&&r.ruleNode.type==="Atrule")return;const o=G.generate(r.ruleNode.prelude);return this.pageCounter.increments[o]={selector:o,number:a}}insertRule(e){this.styleSheet.insertRule(e,this.styleSheet.cssRules.length)}}class nx extends ve{constructor(e,r,n){super(e,r,n),this.styleSheet=r.styleSheet,this.selectors={}}onRule(e,r,n){let a=G.generate(e.prelude);if(a.match(/:(first|last|nth)-of-type/)){let i=G.generate(e.block);i=i.replace(/[{}]/g,"");let o="nth-of-type-"+at();a.split(",").forEach(s=>{this.selectors[s]?this.selectors[s][1]=`${this.selectors[s][1]};${i}`:this.selectors[s]=[o,i]}),n.remove(r)}}afterParsed(e){this.processSelectors(e,this.selectors)}processSelectors(e,r){for(let a in r){let i=e.querySelectorAll(a);for(var n=0;n<i.length;n++){let s=i[n].getAttribute("data-nth-of-type");s&&s!=""?(s=`${s},${r[a][0]}`,i[n].setAttribute("data-nth-of-type",s)):i[n].setAttribute("data-nth-of-type",r[a][0])}let o=`*[data-nth-of-type*='${r[a][0]}'] { ${r[a][1]}; }`;this.styleSheet.insertRule(o,this.styleSheet.cssRules.length)}}}class ax extends ve{constructor(e,r,n){super(e,r,n),this.styleSheet=r.styleSheet,this.selectors={}}onRule(e,r,n){let a=G.generate(e.prelude);if(a.match(/\+/)){let i=G.generate(e.block);i=i.replace(/[{}]/g,"");let o="following-"+at();a.split(",").forEach(s=>{this.selectors[s]?this.selectors[s][1]=`${this.selectors[s][1]};${i}`:this.selectors[s]=[o,i]}),n.remove(r)}}afterParsed(e){this.processSelectors(e,this.selectors)}processSelectors(e,r){for(let a in r){let i=e.querySelectorAll(a);for(var n=0;n<i.length;n++){let s=i[n].getAttribute("data-following");s&&s!=""?(s=`${s},${r[a][0]}`,i[n].setAttribute("data-following",s)):i[n].setAttribute("data-following",r[a][0])}let o=`*[data-following*='${r[a][0]}'] { ${r[a][1]}; }`;this.styleSheet.insertRule(o,this.styleSheet.cssRules.length)}}}class ix extends ve{constructor(e,r,n){super(e,r,n),this.footnotes={},this.needsLayout=[]}onDeclaration(e,r,n,a){let i=e.property;if(i==="float"){let o=e.value.children&&e.value.children.first();if((o&&o.name)==="footnote"){let l=G.generate(a.ruleNode.prelude);this.footnotes[l]={selector:l,policy:"auto",display:"block"},n.remove(r)}}if(i==="footnote-policy"){let o=e.value.children&&e.value.children.first(),s=o&&o.name;if(s){let l=G.generate(a.ruleNode.prelude),c=this.footnotes[l];c&&(c.policy=s)}}if(i==="footnote-display"){let o=e.value.children&&e.value.children.first(),s=o&&o.name,l=G.generate(a.ruleNode.prelude);if(s&&this.footnotes[l]){let c=this.footnotes[l];c&&(c.display=s)}}}onPseudoSelector(e,r,n,a,i){let o=e.name;if(o==="footnote-marker"){let s=i.ruleNode.prelude,l=new G.List;s.children.first().children.each(c=>{c.type!=="PseudoElementSelector"&&l.appendData(c)}),l.appendData({type:"AttributeSelector",name:{type:"Identifier",name:"data-footnote-marker"},flags:null,loc:null,matcher:null,value:null}),l.appendData({type:"PseudoElementSelector",name:"marker",loc:null,children:null}),s.children.first().children=l}if(o==="footnote-call"){let s=i.ruleNode.prelude,l=new G.List;s.children.first().children.each(c=>{c.type!=="PseudoElementSelector"&&l.appendData(c)}),l.appendData({type:"AttributeSelector",name:{type:"Identifier",name:"data-footnote-call"},flags:null,loc:null,matcher:null,value:null}),l.appendData({type:"PseudoElementSelector",name:"after",loc:null,children:null}),s.children.first().children=l}}afterParsed(e){this.processFootnotes(e,this.footnotes)}processFootnotes(e,r){for(let a in r){let i=e.querySelectorAll(a),o,s=r[a];for(var n=0;n<i.length;n++)o=i[n],o.setAttribute("data-note","footnote"),o.setAttribute("data-break-before","avoid"),o.setAttribute("data-note-policy",s.policy||"auto"),o.setAttribute("data-note-display",s.display||"block"),this.processFootnoteContainer(o)}}processFootnoteContainer(e){let r=e.parentElement,n=r;for(;r;){if(Ec(r)){n.setAttribute("data-has-notes","true");break}n=r,r=r.parentElement,r||n.setAttribute("data-has-notes","true")}}renderNode(e){if(e.nodeType==1){let r;if(!e.dataset)return;e.dataset.note==="footnote"?r=[e]:(e.dataset.hasNotes||e.querySelectorAll("[data-note='footnote']"))&&(r=e.querySelectorAll("[data-note='footnote']")),r&&r.length&&this.findVisibleFootnotes(r,e)}}findVisibleFootnotes(e,r){let n,a,i;n=r.closest(".pagedjs_page_content"),a=n.getBoundingClientRect(),i=a.left+a.width;for(let o=0;o<e.length;++o){let s=e[o];s.getBoundingClientRect().left<i&&this.moveFootnote(s,r.closest(".pagedjs_area"),!0)}}moveFootnote(e,r,n){let a=r.querySelector(".pagedjs_footnote_area"),i=a.querySelector(".pagedjs_footnote_content"),o=i.querySelector(".pagedjs_footnote_inner_content");if(!Me(e))return;let s;if(n&&(s=this.createFootnoteCall(e)),e.removeAttribute("data-break-before"),o.querySelector(`[data-ref="${e.dataset.ref}"]`)){e.remove();return}o.appendChild(e),i.classList.contains("pagedjs_footnote_empty")&&i.classList.remove("pagedjs_footnote_empty"),e.dataset.footnoteMarker=e.dataset.ref,e.id=`note-${e.dataset.ref}`;let c=i.scrollHeight,u=r.querySelector(".pagedjs_page_content").getBoundingClientRect(),p=u.left+u.width,f=s&&s.getBoundingClientRect(),v=a.getBoundingClientRect(),m=this.marginsHeight(i),g=this.paddingHeight(i),C=this.borderHeight(i),x=m+g+C,h=Math.floor(v.top);v.height===0&&(h-=this.marginsHeight(i,!1),h-=this.paddingHeight(i,!1),h-=this.borderHeight(i,!1));let b=e.dataset.notePolicy,S=0,E=0;if(s){let I=s.previousSibling,M=new Range;I?M.setStartBefore(I):M.setStartBefore(s),M.setEndAfter(s);let z=M.getBoundingClientRect();if(S=z.bottom,!b||b==="auto")E=Math.ceil(z.bottom);else if(b==="line")E=Math.ceil(z.top);else if(b==="block"){let R=s.closest("p").previousElementSibling;R?E=Math.ceil(R.getBoundingClientRect().bottom):E=Math.ceil(z.bottom)}}let k=c+x-v.height,w=S?h-S:0,A=S?Math.floor(v.top)-E:0,_=a.querySelector("[data-note='footnote']");if(n&&f.left>p)e.remove();else if(!_&&n&&x>w){r.style.setProperty("--pagedjs-footnotes-height","0px");let I=document.createElement("div");I.appendChild(e),this.needsLayout.push(I)}else n?S<v.top-k?r.style.setProperty("--pagedjs-footnotes-height",`${c+m+C}px`):(r.style.setProperty("--pagedjs-footnotes-height",`${v.height+A}px`),o.style.height=v.height+A-x+"px"):r.style.setProperty("--pagedjs-footnotes-height",`${c+x}px`)}createFootnoteCall(e){let r=e.parentElement,n=document.createElement("a");for(const a of e.classList)n.classList.add(`${a}`);return n.dataset.footnoteCall=e.dataset.ref,n.dataset.ref=e.dataset.ref,n.dataset.dataCounterFootnoteIncrement=1,n.href=`#note-${e.dataset.ref}`,r.insertBefore(n,e),n}afterPageLayout(e,r,n,a){let i=e.querySelector(".pagedjs_area"),o=r.footnotesArea,s=o.querySelector(".pagedjs_footnote_content"),l=o.querySelector(".pagedjs_footnote_inner_content"),c=s.getBoundingClientRect(),{width:d}=c;l.style.columnWidth=Math.round(d)+"px",l.style.columnGap="calc(var(--pagedjs-margin-right) + var(--pagedjs-margin-left))";let p=new Ba(o,void 0,a.settings).findOverflow(l,c);if(p){let{startContainer:f,startOffset:v}=p,m;if(Me(f)){let E=f.childNodes[v];m=Me(E)&&E.hasAttribute("data-footnote-marker")}let g=p.extractContents();if(!m){let E=g.firstElementChild;E.dataset.splitFrom=E.dataset.ref,this.handleAlignment(l.lastElementChild)}this.needsLayout.push(g),s.style.removeProperty("height"),l.style.removeProperty("height");let C=l.getBoundingClientRect(),{height:x}=C,h=this.marginsHeight(s),b=this.paddingHeight(s),S=this.borderHeight(s);if(i.style.setProperty("--pagedjs-footnotes-height",`${x+h+S+b}px`),l.childNodes.length===0&&s.classList.add("pagedjs_footnote_empty"),!n)a.clonePage(r);else{let E,k;n.node&&typeof n.node.dataset<"u"&&typeof n.node.dataset.previousBreakAfter<"u"&&(k=n.node.dataset.previousBreakAfter),n.node&&typeof n.node.dataset<"u"&&typeof n.node.dataset.breakBefore<"u"&&(E=n.node.dataset.breakBefore),(E||k)&&a.clonePage(r)}}l.style.height="auto"}handleAlignment(e){let n=window.getComputedStyle(e)["text-align-last"];e.dataset.lastSplitElement="true",n==="auto"?e.dataset.alignLastSplitElement="justify":e.dataset.alignLastSplitElement=n}beforePageLayout(e){for(;this.needsLayout.length;){let r=this.needsLayout.shift();Array.from(r.childNodes).forEach(n=>{this.moveFootnote(n,e.element.querySelector(".pagedjs_area"),!1)})}}afterOverflowRemoved(e,r){let n=r.closest(".pagedjs_area"),a=n.querySelectorAll(".pagedjs_footnote_area [data-note='footnote']");for(let o=0;o<a.length;o++){const s=a[o];e.querySelector(`[data-footnote-call="${s.dataset.ref}"]`)&&s.remove()}let i=n.querySelector(".pagedjs_footnote_inner_content");i&&i.childNodes.length===0&&i.parentElement.classList.add("pagedjs_footnote_empty")}marginsHeight(e,r=!0){let n=window.getComputedStyle(e),a=parseInt(n.marginTop),i=parseInt(n.marginBottom),o=0;return a&&(o+=a),i&&r&&(o+=i),o}paddingHeight(e,r=!0){let n=window.getComputedStyle(e),a=parseInt(n.paddingTop),i=parseInt(n.paddingBottom),o=0;return a&&(o+=a),i&&r&&(o+=i),o}borderHeight(e,r=!0){let n=window.getComputedStyle(e),a=parseInt(n.borderTop),i=parseInt(n.borderBottom),o=0;return a&&(o+=a),i&&r&&(o+=i),o}}const ox=[ZS,YS,XS,QS,JS,ex,tx,rx,nx,ax,ix];class sx extends ve{constructor(e,r,n){super(e,r,n),this.runningSelectors={},this.elements={}}onDeclaration(e,r,n,a){if(e.property==="position"){let i=G.generate(a.ruleNode.prelude),o=e.value.children.first().name;if(o==="running"){let s;G.walk(e,{visit:"Function",enter:(l,c,d)=>{s=l.children.first().name}}),this.runningSelectors[s]={identifier:o,value:s,selector:i}}}e.property==="content"&&G.walk(e,{visit:"Function",enter:(i,o,s)=>{if(i.name.indexOf("element")>-1){let l=G.generate(a.ruleNode.prelude),c=i.name,d=i.children.first().name,u=[d],p="first";l.split(",").forEach(f=>{f=f.replace(/::after|::before/,""),this.elements[f]={func:c,args:u,value:d,style:p,selector:f,fullSelector:l}})}}})}afterParsed(e){for(let r of Object.keys(this.runningSelectors)){let n=this.runningSelectors[r],a=Array.from(e.querySelectorAll(n.selector));if(n.identifier==="running")for(let i of a)i.style.display="none"}}afterPageLayout(e){for(let r of Object.keys(this.runningSelectors)){let n=this.runningSelectors[r],a=e.querySelector(n.selector);a&&(n.identifier==="running"?n.first=a:console.warn(n.value+"needs css replacement"))}this.orderedSelectors||(this.orderedSelectors=this.orderSelectors(this.elements));for(let r of this.orderedSelectors)if(r){let n=this.elements[r],a=e.querySelector(r);if(a){let i=this.runningSelectors[n.args[0]];if(i&&i.first){a.innerHTML="";let o=i.first.cloneNode(!0);o.style.display=null,a.appendChild(o)}}}}pageWeight(e){let r=1,n=e.split(" "),a=n.length&&n[0].split(".");switch(a.shift(),a.length){case 4:/^pagedjs_[\w-]+_first_page$/.test(a[3])?r=7:(a[3]==="pagedjs_left_page"||a[3]==="pagedjs_right_page")&&(r=6);break;case 3:a[1]==="pagedjs_named_page"&&(a[2].indexOf(":nth-of-type")>-1?r=7:r=5);break;case 2:a[1]==="pagedjs_first_page"?r=4:a[1]==="pagedjs_blank_page"?r=3:(a[1]==="pagedjs_left_page"||a[1]==="pagedjs_right_page")&&(r=2);break;default:a[0].indexOf(":nth-of-type")>-1?r=4:r=1}return r}orderSelectors(e){let r=Object.keys(e),n={1:[],2:[],3:[],4:[],5:[],6:[],7:[]},a=[];for(let o of r){let s=this.pageWeight(o);n[s].unshift(o)}for(var i=1;i<=7;i++)a=a.concat(n[i]);return a}beforeTreeParse(e,r){r.text=e.replace(/element[\s]*\(([^|^#)]*)\)/g,"element-ident($1)")}}function Ut(t,e=`"' `){if(t!=null)return t.replace(new RegExp(`^[${e}]+`),"").replace(new RegExp(`[${e}]+$`),"").replace(/["']/g,r=>"\\"+r).replace(/[\n]/g,r=>"\\00000A")}function lx(t){if(t!=null)return t.replace(new RegExp("::footnote-call","g"),"").replace(new RegExp("::footnote-marker","g"),"")}class cx extends ve{constructor(e,r,n){super(e,r,n),this.stringSetSelectors={},this.type,this.pageLastString}onDeclaration(e,r,n,a){if(e.property==="string-set"){let i=G.generate(a.ruleNode.prelude),o=[],s=[],l=[];e.value.children.forEach(c=>{c.type==="Identifier"&&o.push(c.name),c.type==="Function"&&(s.push(c.name),c.children.forEach(d=>{d.type==="Identifier"&&l.push(d.name)}))}),o.forEach((c,d)=>{let u=s[d],p=l[d];this.stringSetSelectors[c]={identifier:c,func:u,value:p,selector:i}})}}onContent(e,r,n,a,i){if(e.name==="string"){let o=e.children&&e.children.first().name;this.type=e.children.last().name,e.name="var",e.children=new G.List,this.type==="first"||this.type==="last"||this.type==="start"||this.type==="first-except"?e.children.append(e.children.createItem({type:"Identifier",loc:null,name:"--pagedjs-string-"+this.type+"-"+o})):e.children.append(e.children.createItem({type:"Identifier",loc:null,name:"--pagedjs-string-first-"+o}))}}afterPageLayout(e){this.pageLastString===void 0&&(this.pageLastString={});for(let r of Object.keys(this.stringSetSelectors)){let n=this.stringSetSelectors[r],a=n.value,i=n.func,o=e.querySelectorAll(n.selector),s=r in this.pageLastString?this.pageLastString[r]:"",l,c,d,u;if(o.length==0)l=s,c=s,d=s,u=s;else{o.forEach(m=>{i==="content"&&(this.pageLastString[r]=o[o.length-1].textContent),i==="attr"&&(this.pageLastString[r]=o[o.length-1].getAttribute(a)||"")}),i==="content"&&(l=o[0].textContent),i==="attr"&&(l=o[0].getAttribute(a)||""),i==="content"&&(c=o[o.length-1].textContent),i==="attr"&&(c=o[o.length-1].getAttribute(a)||"");let p=o[0].getBoundingClientRect().top,v=o[0].closest(".pagedjs_page_content").getBoundingClientRect().top;p==v?d=l:d=s,u=""}e.style.setProperty(`--pagedjs-string-first-${r}`,`"${Ut(l)}`),e.style.setProperty(`--pagedjs-string-last-${r}`,`"${Ut(c)}`),e.style.setProperty(`--pagedjs-string-start-${r}`,`"${Ut(d)}`),e.style.setProperty(`--pagedjs-string-first-except-${r}`,`"${Ut(u)}`)}}}class dx extends ve{constructor(e,r,n){super(e,r,n),this.styleSheet=r.styleSheet,this.counterTargets={}}onContent(e,r,n,a,i){if(e.name==="target-counter"){let o=G.generate(i.ruleNode.prelude),s=e.children.first(),l=s.name,c=G.generate(e),d=[];s.children.forEach(m=>{m.type==="Identifier"&&d.push(m.name)});let u,p,f;e.children.forEach(m=>{m.type==="Identifier"&&(u?p||(f=G.clone(m),p=m.name):u=m.name)});let v="target-counter-"+at();o.split(",").forEach(m=>{this.counterTargets[m]={func:l,args:d,value:c,counter:u,style:p,selector:m,fullSelector:o,variable:v}}),e.name="counter",e.children=new G.List,e.children.appendData({type:"Identifier",loc:0,name:v}),f&&(e.children.appendData({type:"Operator",loc:null,value:","}),e.children.appendData(f))}}afterPageLayout(e,r,n,a){Object.keys(this.counterTargets).forEach(i=>{let o=this.counterTargets[i],s=o.selector.split(/::?/g),l=s[0];a.pagesArea.querySelectorAll(l+":not([data-"+o.variable+"])").forEach((d,u)=>{if(o.func!=="attr")return;let p=yc(d,o.args),f=a.pagesArea.querySelector(bc(p));if(f){let v=at();d.setAttribute("data-"+o.variable,v);let m="";if(s.length>1&&(m+="::"+s[1]),o.counter==="page"){let C=a.pagesArea.querySelectorAll(".pagedjs_page"),x=0;for(let h=0;h<C.length;h++){let b=C[h],S=window.getComputedStyle(b),E=S["counter-reset"].replace("page","").trim(),k=S["counter-increment"].replace("page","").trim();if(E!=="none"&&(x=parseInt(E)),k!=="none"&&(x+=parseInt(k)),b.contains(f))break}this.styleSheet.insertRule(`[data-${o.variable}="${v}"]${m} { counter-reset: ${o.variable} ${x}; }`,this.styleSheet.cssRules.length)}else{let C=f.getAttribute(`data-counter-${o.counter}-value`);C&&this.styleSheet.insertRule(`[data-${o.variable}="${v}"]${m} { counter-reset: ${o.variable} ${o.variable} ${parseInt(C)}; }`,this.styleSheet.cssRules.length)}let g=document.querySelector(`[data-${o.variable}="${v}"]`);g&&(g.style.display="none",g.clientHeight,g.style.removeProperty("display"))}})})}}class ux extends ve{constructor(e,r,n){super(e,r,n),this.styleSheet=r.styleSheet,this.textTargets={},this.beforeContent="",this.afterContent="",this.selector={}}onContent(e,r,n,a,i){if(e.name==="target-text"){this.selector=G.generate(i.ruleNode.prelude);let o=e.children.first(),s=e.children.last(),l=o.name,c=G.generate(e),d=[];o.children.forEach(f=>{f.type==="Identifier"&&d.push(f.name)});let u;s!==o&&(u=s.name);let p="--pagedjs-"+at();this.selector.split(",").forEach(f=>{this.textTargets[f]={func:l,args:d,value:c,style:u||"content",selector:f,fullSelector:this.selector,variable:p}}),e.name="var",e.children=new G.List,e.children.appendData({type:"Identifier",loc:0,name:p})}}onPseudoSelector(e,r,n,a,i){i.ruleNode.block.children.forEach(o=>{e.name==="before"&&o.property==="content"?o.value.children.forEach(l=>{l.type==="String"&&(this.beforeContent=l.value)}):e.name==="after"&&o.property==="content"&&o.value.children.forEach(s=>{s.type==="String"&&(this.afterContent=s.value)})})}afterParsed(e){Object.keys(this.textTargets).forEach(r=>{let n=this.textTargets[r],a=n.selector.split("::"),i=a[0],o=e.querySelectorAll(i),s;o.forEach((l,c)=>{let d=yc(l,n.args),u=e.querySelector(bc(d));if(u)if(n.style){this.selector=at(),l.setAttribute("data-target-text",this.selector);let p="";if(a.length>1&&(p+="::"+a[1]),n.style==="before"||n.style==="after"){const f=`${n.style}Content`;s=Ut(this[f])}else s=Ut(u.textContent," ");s=n.style==="first-letter"?s.charAt(0):s,this.styleSheet.insertRule(`[data-target-text="${this.selector}"]${p} { ${n.variable}: "${s}" }`)}else console.warn("missed target",d)})})}}const px=[sx,cx,dx,ux];class fx extends ve{constructor(e,r,n){super(e,r,n)}filter(e){_c(e,r=>this.filterEmpty(r),NodeFilter.SHOW_TEXT)}filterEmpty(e){if(e.textContent.length>1&&Zr(e)){let r=e.parentNode;if(Me(r)&&r.closest("pre"))return NodeFilter.FILTER_REJECT;const a=ma(e),i=ga(e);return i===null&&a===null?(e.textContent=" ",NodeFilter.FILTER_REJECT):i===null||a===null?NodeFilter.FILTER_ACCEPT:(e.textContent=" ",NodeFilter.FILTER_REJECT)}else return NodeFilter.FILTER_REJECT}}class mx extends ve{constructor(e,r,n){super(e,r,n)}filter(e){_c(e,null,NodeFilter.SHOW_COMMENT)}}class hx extends ve{constructor(e,r,n){super(e,r,n)}filter(e){e.querySelectorAll("script").forEach(r=>{r.remove()})}}var es={},wp;function gx(){return wp||(wp=1,(function(t){var e=/(\[[^\]]+\])/g,r=/(#[^\s\+>~\.\[:]+)/g,n=/(\.[^\s\+>~\.\[:]+)/g,a=/(::[^\s\+>~\.\[:]+|:first-line|:first-letter|:before|:after)/g,i=/(:[^\s\+>~\.\[:]+)/g,o=/([^\s\+>~\.\[:]+)/g,s=/:not\(([^\)]*)\)/g,l=/\{[^]*/gm,c=/[\*\s\+>~]/g,d=/[#\.]/g,u=function(g,C,x,h){var b=h.match(g);if(b)for(var S=0;S<b.length;S++)x[C]++,h=h.replace(b[S]," ");return h},p=function(g){var C=g.indexOf(",");C!==-1&&(g=g.substring(0,C));var x={a:0,b:0,c:0};return g=g.replace(s," $1 "),g=g.replace(l," "),g=u(e,"b",x,g),g=u(r,"a",x,g),g=u(n,"b",x,g),g=u(a,"c",x,g),g=u(i,"b",x,g),g=g.replace(c," "),g=g.replace(d," "),u(o,"c",x,g),x.a*100+x.b*10+x.c*1},f={};t.calculateSpecificity=function(g){var C=f[g];return C===void 0&&(C=p(g),f[g]=C),C};var v={},m=null;t.isSelectorValid=function(g){var C=v[g];if(C===void 0){m==null&&(m=document.createElement("div"));try{m.querySelector(g),C=!0}catch{C=!1}v[g]=C}return C},t.validateSelector=function(g){if(!t.isSelectorValid(g)){var C=new SyntaxError(g+" is not a valid selector");throw C.code="EBADSELECTOR",C}}})(es)),es}var vx=gx();class yx extends ve{constructor(e,r,n){super(e,r,n),this.displayRules={}}onDeclaration(e,r,n,a){if(e.property==="display"){let i=G.generate(a.ruleNode.prelude),o=e.value.children.first().name;i.split(",").forEach(s=>{this.displayRules[s]={value:o,selector:s,specificity:vx.calculateSpecificity(s),important:e.important}})}}filter(e){let{matches:r,selectors:n}=this.sortDisplayedSelectors(e,this.displayRules);for(let i=0;i<r.length;i++){let o=r[i],s=n[i],l=s[s.length-1].value;this.removable(o)&&l==="none"&&(o.dataset.undisplayed="undisplayed")}let a=e.querySelectorAll("[style]");for(let i=0;i<a.length;i++){let o=a[i];this.removable(o)&&(o.dataset.undisplayed="undisplayed")}}sorter(e,r){return e.important&&!r.important?1:r.important&&!e.important?-1:e.specificity-r.specificity}sortDisplayedSelectors(e,r=[]){let n=[],a=[];for(let i in r){let o=r[i],s=o.selector,l=[];try{try{l=e.querySelectorAll(s)}catch{l=e.querySelectorAll(lx(s))}}catch{l=[]}let c=Array.from(l);for(let d of c)if(n.includes(d)){let u=n.indexOf(d);a[u].push(o),a[u]=a[u].sort(this.sorter)}else n.push(d),a.push([o])}return{matches:n,selectors:a}}removable(e){return!(e.style&&e.style.display!==""&&e.style.display!=="none")}}const bx=[fx,mx,hx,yx];var ts,Cp;function Sx(){return Cp||(Cp=1,ts=function(){var t=Array.from,e,r;return typeof t!="function"?!1:(e=["raz","dwa"],r=t(e),!!(r&&r!==e&&r[1]==="dwa"))}),ts}var rs,kp;function xx(){return kp||(kp=1,rs=function(){return typeof globalThis!="object"||!globalThis?!1:globalThis.Array===Array}),rs}var ns,Ep;function wx(){if(Ep)return ns;Ep=1;var t=function(){if(typeof self=="object"&&self)return self;if(typeof window=="object"&&window)return window;throw new Error("Unable to resolve global `this`")};return ns=(function(){if(this)return this;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch{return t()}try{return __global__||t()}finally{delete Object.prototype.__global__}})(),ns}var as,Tp;function on(){return Tp||(Tp=1,as=xx()()?globalThis:wx()),as}var is,Ap;function Cx(){if(Ap)return is;Ap=1;var t=on(),e={object:!0,symbol:!0};return is=function(){var r=t.Symbol,n;if(typeof r!="function")return!1;n=r("test symbol");try{String(n)}catch{return!1}return!(!e[typeof r.iterator]||!e[typeof r.toPrimitive]||!e[typeof r.toStringTag])},is}var os,_p;function kx(){return _p||(_p=1,os=function(t){return t?typeof t=="symbol"?!0:!t.constructor||t.constructor.name!=="Symbol"?!1:t[t.constructor.toStringTag]==="Symbol":!1}),os}var ss,Op;function Pp(){if(Op)return ss;Op=1;var t=kx();return ss=function(e){if(!t(e))throw new TypeError(e+" is not a symbol");return e},ss}var ls,Ip;function Ex(){if(Ip)return ls;Ip=1;var t=Gt(),e=Object.create,r=Object.defineProperty,n=Object.prototype,a=e(null);return ls=function(i){for(var o=0,s,l;a[i+(o||"")];)++o;return i+=o||"",a[i]=!0,s="@@"+i,r(n,s,t.gs(null,function(c){l||(l=!0,r(this,s,t(c)),l=!1)})),s},ls}var cs,Np;function Tx(){if(Np)return cs;Np=1;var t=Gt(),e=on().Symbol;return cs=function(r){return Object.defineProperties(r,{hasInstance:t("",e&&e.hasInstance||r("hasInstance")),isConcatSpreadable:t("",e&&e.isConcatSpreadable||r("isConcatSpreadable")),iterator:t("",e&&e.iterator||r("iterator")),match:t("",e&&e.match||r("match")),replace:t("",e&&e.replace||r("replace")),search:t("",e&&e.search||r("search")),species:t("",e&&e.species||r("species")),split:t("",e&&e.split||r("split")),toPrimitive:t("",e&&e.toPrimitive||r("toPrimitive")),toStringTag:t("",e&&e.toStringTag||r("toStringTag")),unscopables:t("",e&&e.unscopables||r("unscopables"))})},cs}var ds,Mp;function Ax(){if(Mp)return ds;Mp=1;var t=Gt(),e=Pp(),r=Object.create(null);return ds=function(n){return Object.defineProperties(n,{for:t(function(a){return r[a]?r[a]:r[a]=n(String(a))}),keyFor:t(function(a){var i;e(a);for(i in r)if(r[i]===a)return i})})},ds}var us,Dp;function _x(){if(Dp)return us;Dp=1;var t=Gt(),e=Pp(),r=on().Symbol,n=Ex(),a=Tx(),i=Ax(),o=Object.create,s=Object.defineProperties,l=Object.defineProperty,c,d,u;if(typeof r=="function")try{String(r()),u=!0}catch{}else r=null;return d=function(f){if(this instanceof d)throw new TypeError("Symbol is not a constructor");return c(f)},us=c=function p(f){var v;if(this instanceof p)throw new TypeError("Symbol is not a constructor");return u?r(f):(v=o(d.prototype),f=f===void 0?"":String(f),s(v,{__description__:t("",f),__name__:t("",n(f))}))},a(c),i(c),s(d.prototype,{constructor:t(c),toString:t("",function(){return this.__name__})}),s(c.prototype,{toString:t(function(){return"Symbol ("+e(this).__description__+")"}),valueOf:t(function(){return e(this)})}),l(c.prototype,c.toPrimitive,t("",function(){var p=e(this);return typeof p=="symbol"?p:p.toString()})),l(c.prototype,c.toStringTag,t("c","Symbol")),l(d.prototype,c.toStringTag,t("c",c.prototype[c.toStringTag])),l(d.prototype,c.toPrimitive,t("c",c.prototype[c.toPrimitive])),us}var ps,zp;function Ox(){return zp||(zp=1,ps=Cx()()?on().Symbol:_x()),ps}var fs,Lp;function Px(){if(Lp)return fs;Lp=1;var t=Object.prototype.toString,e=t.call((function(){return arguments})());return fs=function(r){return t.call(r)===e},fs}var ms,jp;function Ix(){if(jp)return ms;jp=1;var t=Object.prototype.toString,e=RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);return ms=function(r){return typeof r=="function"&&e(t.call(r))},ms}var hs,Wp;function Nx(){return Wp||(Wp=1,hs=function(){var t=Math.sign;return typeof t!="function"?!1:t(10)===1&&t(-20)===-1}),hs}var gs,Bp;function Mx(){return Bp||(Bp=1,gs=function(t){return t=Number(t),isNaN(t)||t===0?t:t>0?1:-1}),gs}var vs,qp;function Dx(){return qp||(qp=1,vs=Nx()()?Math.sign:Mx()),vs}var ys,Rp;function zx(){if(Rp)return ys;Rp=1;var t=Dx(),e=Math.abs,r=Math.floor;return ys=function(n){return isNaN(n)?0:(n=Number(n),n===0||!isFinite(n)?n:t(n)*r(e(n)))},ys}var bs,Fp;function $p(){if(Fp)return bs;Fp=1;var t=zx(),e=Math.max;return bs=function(r){return e(0,t(r))},bs}var Ss,Gp;function Lx(){if(Gp)return Ss;Gp=1;var t=Object.prototype.toString,e=t.call("");return Ss=function(r){return typeof r=="string"||r&&typeof r=="object"&&(r instanceof String||t.call(r)===e)||!1},Ss}var xs,Vp;function jx(){if(Vp)return xs;Vp=1;var t=Ox().iterator,e=Px(),r=Ix(),n=$p(),a=Xc(),i=Ia(),o=vr(),s=Lx(),l=Array.isArray,c=Function.prototype.call,d={configurable:!0,enumerable:!0,writable:!0,value:null},u=Object.defineProperty;return xs=function(p){var f=arguments[1],v=arguments[2],m,g,C,x,h,b,S,E,k,w;if(p=Object(i(p)),o(f)&&a(f),!this||this===Array||!r(this)){if(!f){if(e(p))return h=p.length,h!==1?Array.apply(null,p):(x=new Array(1),x[0]=p[0],x);if(l(p)){for(x=new Array(h=p.length),g=0;g<h;++g)x[g]=p[g];return x}}x=[]}else m=this;if(!l(p)){if((k=p[t])!==void 0){for(S=a(k).call(p),m&&(x=new m),E=S.next(),g=0;!E.done;)w=f?c.call(f,v,E.value,g):E.value,m?(d.value=w,u(x,g,d)):x[g]=w,E=S.next(),++g;h=g}else if(s(p)){for(h=p.length,m&&(x=new m),g=0,C=0;g<h;++g)w=p[g],g+1<h&&(b=w.charCodeAt(0),b>=55296&&b<=56319&&(w+=p[++g])),w=f?c.call(f,v,w,C):w,m?(d.value=w,u(x,C,d)):x[C]=w,++C;h=C}}if(h===void 0)for(h=n(p.length),m&&(x=new m(h)),g=0;g<h;++g)w=f?c.call(f,v,p[g],g):p[g],m?(d.value=w,u(x,g,d)):x[g]=w;return m&&(d.value=null,x.length=h),x},xs}var ws,Hp;function Wx(){return Hp||(Hp=1,ws=Sx()()?Array.from:jx()),ws}var Cs,Up;function Bx(){return Up||(Up=1,Cs=function(){var t=Number.isNaN;return typeof t!="function"?!1:!t({})&&t(NaN)&&!t(34)}),Cs}var ks,Kp;function qx(){return Kp||(Kp=1,ks=function(t){return t!==t}),ks}var Es,Yp;function Rx(){return Yp||(Yp=1,Es=Bx()()?Number.isNaN:qx()),Es}var Ts,Xp;function Fx(){if(Xp)return Ts;Xp=1;var t=Rx(),e=$p(),r=Ia(),n=Array.prototype.indexOf,a=Object.prototype.hasOwnProperty,i=Math.abs,o=Math.floor;return Ts=function(s){var l,c,d,u;if(!t(s))return n.apply(this,arguments);for(c=e(r(this).length),d=arguments[1],isNaN(d)?d=0:d>=0?d=o(d):d=e(this.length)-o(i(d)),l=d;l<c;++l)if(a.call(this,l)&&(u=this[l],t(u)))return l;return-1},Ts}var As,Zp;function $x(){if(Zp)return As;Zp=1;var t=Fx(),e=Array.prototype.forEach,r=Array.prototype.splice;return As=function(n){e.call(arguments,function(a){var i=t.call(this,a);i!==-1&&r.call(this,i,1)},this)},As}var _s,Qp;function Gx(){if(Qp)return _s;Qp=1;var t=vr(),e={function:!0,object:!0};return _s=function(r){return t(r)&&e[typeof r]||!1},_s}var Os,Jp;function Vx(){if(Jp)return Os;Jp=1;var t=Gx();return Os=function(e){if(!t(e))throw new TypeError(e+" is not an Object");return e},Os}var Ps,ef;function Hx(){if(ef)return Ps;ef=1;var t=Wx(),e=$x(),r=Vx(),n=Gt(),a=Qc().methods.emit,i=Object.defineProperty,o=Object.prototype.hasOwnProperty,s=Object.getOwnPropertyDescriptor;return Ps=function(l,c){var d,u,p,f;return r(l)&&r(c),f=arguments[2],f===void 0&&(f="emit"),u={close:function(){e.call(d,c)}},o.call(l,"__eePipes__")?((d=l.__eePipes__).push(c),u):(i(l,"__eePipes__",n("c",d=[c])),p=s(l,f),p?(delete p.get,delete p.set):p=n("c",void 0),p.value=function(){var v,m,g=t(d);for(a.apply(this,arguments),v=0;m=g[v];++v)a.apply(m,arguments)},i(l,f,p),u)},Ps}var Ux=Hx();const Kx=va(Ux);let tf=[...ox,...px,...bx];class rf{constructor(e,r,n){tf.forEach(a=>{let i=new a(e,r,n);Kx(i,this)})}}Vt(rf.prototype);function nf(){for(var t=0;t<arguments.length;t++)tf.push(arguments[t])}function Yx(t,e,r){return new rf(t,e,r)}class Is{constructor(e){this.settings=e||{},this.polisher=new KS(!1),this.chunker=new Jc(void 0,void 0,this.settings),this.hooks={},this.hooks.beforePreview=new ne(this),this.hooks.afterPreview=new ne(this),this.size={width:{value:8.5,unit:"in"},height:{value:11,unit:"in"},format:void 0,orientation:void 0},this.chunker.on("page",r=>{this.emit("page",r)}),this.chunker.on("rendering",()=>{this.emit("rendering",this.chunker)})}initializeHandlers(){let e=Yx(this.chunker,this.polisher,this);return e.on("size",r=>{this.size=r,this.emit("size",r)}),e.on("atpages",r=>{this.atpages=r,this.emit("atpages",r)}),e}registerHandlers(){return nf.apply(nf,arguments)}getParams(e){let r,n=new URL(window.location),a=new URLSearchParams(n.search);for(var i of a.entries())i[0]===e&&(r=i[1]);return r}wrapContent(){let e=document.querySelector("body"),r;return r=e.querySelector(":scope > template[data-ref='pagedjs-content']"),r||(r=document.createElement("template"),r.dataset.ref="pagedjs-content",r.innerHTML=e.innerHTML,e.innerHTML="",e.appendChild(r)),r.content}removeStyles(e=document){const r=Array.from(e.querySelectorAll("link[rel='stylesheet']:not([data-pagedjs-ignore], [media~='screen'])")),n=Array.from(e.querySelectorAll("style:not([data-pagedjs-inserted-styles], [data-pagedjs-ignore], [media~='screen'])"));return[...r,...n].sort(function(i,o){const s=i.compareDocumentPosition(o);return s===Node.DOCUMENT_POSITION_PRECEDING?1:s===Node.DOCUMENT_POSITION_FOLLOWING?-1:0}).map(i=>{if(i.nodeName==="STYLE"){const o={};return o[window.location.href]=i.textContent,i.remove(),o}if(i.nodeName==="LINK")return i.remove(),i.href;console.warn(`Unable to process: ${i}, ignoring.`)})}async preview(e,r,n){await this.hooks.beforePreview.trigger(e,n),e||(e=this.wrapContent()),r||(r=this.removeStyles()),this.polisher.setup(),this.handlers=this.initializeHandlers(),await this.polisher.add(...r);let a=performance.now(),i=await this.chunker.flow(e,n),o=performance.now();return i.performance=o-a,i.size=this.size,this.emit("rendered",i),await this.hooks.afterPreview.trigger(i.pages),i}}Vt(Is.prototype);function af(t,e){let r;return function(...a){clearTimeout(r),r=setTimeout(()=>t.apply(this,a),e)}}let Xx=class{prepareRendering(e){const{clientHeight:r,clientWidth:n}=e;e.innerHTML="",r&&(e.style.minHeight=`${r}px`),n&&window!==window.parent&&(e.style.minWidth=`${n}px`),document?.querySelectorAll("style[data-pagedjs-inserted-styles]").forEach(a=>a.remove()),this.resetZoom()}finalizeRendering(e){e&&(e.style.minWidth="auto",e.style.minHeight="auto"),this.attachEventListeners(),this.applyPagedCSS(),this.restoreZoom()}attachEventListeners(){document?.querySelectorAll("[data-uhuu]").forEach(e=>{const r=function(){const n=JSON.parse(this.getAttribute("data-uhuu"));$uhuu.editDialog(n)};e.removeEventListener("click",r),e.addEventListener("click",r)})}applyPagedCSS(){document?.querySelectorAll(".page-break-after[data-paged-css]").forEach(e=>{const r=e.closest("div.pagedjs_sheet"),n=e.getAttribute("data-paged-css");r&&n&&n.split(" ").filter(Boolean).forEach(a=>r.classList.add(a))})}getStyleUrls(e,r){if(e){const n=new Blob([e],{type:"text/css"});return[URL.createObjectURL(n)]}return r?[r]:[]}originalStyles;resetZoom(){if(typeof document>"u")return;const e=document?.body;e.style.transform&&(this.originalStyles={width:e.style.width,height:e.style.height,transform:e.style.transform,transformOrigin:e.style.transformOrigin||"center center"},e.style.opacity="0",e.style.width="100%",e.style.height="100%",e.style.transform="")}restoreZoom(){if(typeof document>"u")return;const e=document?.body;e.style.opacity="1",this.originalStyles?.transform&&(e.style.width=this.originalStyles.width,e.style.height=this.originalStyles.height,e.style.transform=this.originalStyles.transform)}};class of{static PAGE_SIZES={A0:{width:841,height:1189},A1:{width:594,height:841},A2:{width:420,height:594},A3:{width:297,height:420},A4:{width:210,height:297},A5:{width:148,height:210},A6:{width:105,height:148},B0:{width:1e3,height:1414},B1:{width:707,height:1e3},B2:{width:500,height:707},B3:{width:353,height:500},B4:{width:250,height:353},B5:{width:176,height:250},B6:{width:125,height:176},C0:{width:917,height:1297},C1:{width:648,height:917},C2:{width:458,height:648},C3:{width:324,height:458},C4:{width:229,height:324},C5:{width:162,height:229},C6:{width:114,height:162},LETTER:{width:216,height:279},LEGAL:{width:216,height:356},TABLOID:{width:279,height:432},LEDGER:{width:432,height:279}};static getStandardFormats(){return["Custom","A3","A4","A5","LETTER","LEGAL"]}static getDimensions({format:e,orientation:r="portrait"}){const n=this.PAGE_SIZES[e.toUpperCase()];return n?r==="landscape"?{width:n.height,height:n.width}:{width:n.width,height:n.height}:null}static mmToPx(e,r=72){return e*r/25.4}static getDimensionsInPx({format:e,orientation:r="portrait",dpi:n=72}){const a=this.getDimensions({format:e,orientation:r});return a?{width:this.mmToPx(a.width,n),height:this.mmToPx(a.height,n)}:null}static hasFormat(e){return e.toUpperCase()in this.PAGE_SIZES}static getAvailableFormats(){return Object.keys(this.PAGE_SIZES)}static pageParams(e,r){if(typeof document>"u")return;const{format:n,orientation:a,width:i,height:o,bleed:s,showBleed:l,compatibility:c,printCssRaw:d,printCssUrl:u,preview:p}=r,f=(!n||n.toLowerCase()==="custom")&&i&&o&&i>10&&o>10&&i<4e3&&o<4e3?{width:i,height:o}:this.getDimensions({format:n??"A4",orientation:a});return f&&(document.documentElement.style.setProperty("--uhuu-page-width",`${f.width}mm`),document.documentElement.style.setProperty("--uhuu-page-height",`${f.height}mm`)),document.documentElement.style.setProperty("--uhuu-page-bleed",`${Math.min(Math.max(s??0,0),400)}mm`),{page:{paginationType:e,format:n,orientation:a,bleed:s,width:f?.width,height:f?.height,preview:p,showBleed:l,compatibility:c,printCssRaw:d,printCssUrl:u}}}}const Mt=O.createContext(null),sf=({config:t,children:e})=>y.jsx(Mt.Provider,{value:t,children:e}),Zx=({children:t,className:e,setup:r})=>{const[n,a]=O.useState(!1),i=O.useRef(null),o=O.useRef(null),s=O.useRef(new Xx),l=O.useRef(!1),c=of.pageParams("dynamic",r);let d=c?.page?.printCssRaw??"";if(!c?.page?.printCssRaw&&l.current,c?.page?.width&&c?.page?.height){const p=/@page\s*{([^}]*)}/,f=d.match(p),v=`
|
|
832
832
|
size: ${c.page.width}mm ${c.page.height}mm;
|
|
833
833
|
bleed: ${c.page.bleed??0}mm;`;if(f){const m=f[1].replace(/\s*(size|bleed)\s*:[^;]*;/g,""),g=`@page {${v}${m}}`;d=d.replace(p,g)}else d=`@page {${v}}
|
|
834
|
-
${d}`}const u=af(()=>{if(!i.current||!o.current){console.warn("Container or page content reference is missing.");return}if(n)return;a(!0),s.current.prepareRendering(i.current);const p=new Is,f=s.current.getStyleUrls(d,c?.page?.printCssUrl??"");try{p.preview(o.current?.innerHTML??"",f,i.current).then(()=>{a(!1),s.current.finalizeRendering(i.current)})}catch(v){console.error("Error during Paged.js preview rendering:",v),a(!1)}},500);return O.useEffect(()=>{u()},[t,r]),y.jsxs(sf,{config:c,children:[y.jsx("div",{className:[e??"",n?"rendering":"rendered",c?.page?.showBleed?"uhuu-bleed-visible":"",c?.page?.preview??""].filter(Boolean).join(" "),ref:i}),y.jsx("div",{className:"uhuu-reactive-content",style:{display:"none"},ref:o,children:t})]})},Qx=({children:t})=>y.jsx(y.Fragment,{children:t});class sn{static handlePageBreakStyles(){document?.querySelectorAll(".page-break-after[data-paged-css]").forEach(e=>{const r=e.closest("div.uhuu-page-sheet"),n=e.getAttribute("data-paged-css");r&&n&&n.split(" ").filter(Boolean).forEach(i=>r.classList.add(i))})}static handleUhuuDialogs(){const e=function(){const r=JSON.parse(this.getAttribute("data-uhuu")||"{}");$uhuu.editDialog(r)};document?.querySelectorAll("[data-uhuu]").forEach(r=>{r.removeEventListener("click",e),r.addEventListener("click",e)})}static handle(){sn.handlePageBreakStyles(),sn.handleUhuuDialogs()}}class lf{static setupPageStyles(e){if(!e||typeof document>"u")return;const r=document.createElement("link");return r.rel="stylesheet",r.href=e,document.head.appendChild(r),r}static removePageStyles(e){e&&typeof document<"u"&&document?.head.removeChild(e)}}const cf=({children:t,className:e,setup:r})=>{const n=of.pageParams("static",r);O.useEffect(()=>{n?.page?.compatibility&&sn.handle();const i=lf.setupPageStyles(n?.page?.printCssUrl);return()=>{i&&lf.removePageStyles(i)}},[r,n?.page?.compatibility,n?.page?.printCssUrl]);const a=[e,n?.page?.preview].filter(Boolean).join(" ");return y.jsx(sf,{config:n,children:y.jsx("div",{className:a,children:t})})},df=O.forwardRef(({children:t,className:e="",style:r,pageNo:n,overlay:a,showBleed:i,"data-page-key":o},s)=>{const l=O.useContext(Mt),c=i??l?.page?.showBleed??!1;return y.jsxs("div",{className:`uhuu-page-sheet ${e}`,style:r,ref:s,"data-page-key":o,children:[t,a&&a({pageNo:n}),c&&y.jsx("div",{className:"uhuu-bleed-area"})]})}),Kt=(t,e)=>{const r=t.dialog;return r?e?.page?.paginationType==="dynamic"?{"data-uhuu":JSON.stringify(r)}:{onClick:n=>{n.stopPropagation(),window.$uhuu?.editDialog(r)},"data-uhuu":""}:{}},Ns=t=>{const e=O.useContext(Mt),r=t.bleed??e?.page?.bleed??0,n=t.pageWidth??e?.page?.width??210,a=t.pageHeight??e?.page?.height??297,{src:i,backgroundColor:o,width:s,height:l,left:c=0,right:d=0,top:u=0,bottom:p=0}=t,[f,v]=O.useState("h-full w-full object-cover object-center"),m=A=>`${A}mm`,g=()=>{let A=l;return l||(A=a,u||(A+=r),p||(A+=r),(u||p)&&(A-=(u??0)+(p??0))),A},x=(()=>{let A=s;return s||(A=n,c||(A+=r),d||(A+=r),(c||d)&&(A-=(c??0)+(d??0))),A})(),h=g(),b=A=>A!==void 0?m(A):void 0,E=(A=>Object.fromEntries(Object.entries(A).filter(([_,I])=>I!==void 0)))({backgroundColor:o,width:b(x),height:b(h),left:b(c>0?c+r:c),right:b(d>0?d+r:d),top:b(u>0?u+r:u),bottom:b(p>0?p+r:p)}),k=h>0?x/h:x/(a-(u??0)-(p??0)),w=A=>{let I=A.target.naturalWidth/A.target.naturalHeight>k?"cover-vertical":"cover-horizontal";v(I)};return y.jsx("div",{className:"uhuu-image-container",style:E,...t.dataUhuu!==void 0?{"data-uhuu":t.dataUhuu}:{},children:y.jsxs("div",{className:"uhuu-image-inner",...Kt(t,e),children:[y.jsx("img",{className:f,src:i,onLoad:A=>w(A)},`${i}-${x}-${h}`),t.children]})})};const Jx=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ew=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,r,n)=>n?n.toUpperCase():r.toLowerCase()),uf=t=>{const e=ew(t);return e.charAt(0).toUpperCase()+e.slice(1)},pf=(...t)=>t.filter((e,r,n)=>!!e&&e.trim()!==""&&n.indexOf(e)===r).join(" ").trim(),tw=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};var rw={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const nw=O.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:a="",children:i,iconNode:o,...s},l)=>O.createElement("svg",{ref:l,...rw,width:e,height:e,stroke:t,strokeWidth:n?Number(r)*24/Number(e):r,className:pf("lucide",a),...!i&&!tw(s)&&{"aria-hidden":"true"},...s},[...o.map(([c,d])=>O.createElement(c,d)),...Array.isArray(i)?i:[i]]));const Se=(t,e)=>{const r=O.forwardRef(({className:n,...a},i)=>O.createElement(nw,{ref:i,iconNode:e,className:pf(`lucide-${Jx(uf(t))}`,`lucide-${t}`,n),...a}));return r.displayName=uf(t),r};const ff=Se("arrow-up-down",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]);const aw=Se("book-dashed",[["path",{d:"M12 17h1.5",key:"1gkc67"}],["path",{d:"M12 22h1.5",key:"1my7sn"}],["path",{d:"M12 2h1.5",key:"19tvb7"}],["path",{d:"M17.5 22H19a1 1 0 0 0 1-1",key:"10akbh"}],["path",{d:"M17.5 2H19a1 1 0 0 1 1 1v1.5",key:"1vrfjs"}],["path",{d:"M20 14v3h-2.5",key:"1naeju"}],["path",{d:"M20 8.5V10",key:"1ctpfu"}],["path",{d:"M4 10V8.5",key:"1o3zg5"}],["path",{d:"M4 19.5V14",key:"ob81pf"}],["path",{d:"M4 4.5A2.5 2.5 0 0 1 6.5 2H8",key:"s8vcyb"}],["path",{d:"M8 22H6.5a1 1 0 0 1 0-5H8",key:"1cu73q"}]]);const Ms=Se("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const iw=Se("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const ow=Se("clipboard-list",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]);const mf=Se("ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);const hf=Se("grip-vertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);const Ds=Se("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);const sw=Se("maximize",[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]]);const lw=Se("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);const it=Se("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const cw=Se("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);const dw=Se("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);const uw=Se("unfold-horizontal",[["path",{d:"M16 12h6",key:"15xry1"}],["path",{d:"M8 12H2",key:"1jqql6"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 8v2",key:"1woqiv"}],["path",{d:"M12 14v2",key:"8jcxud"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m19 15 3-3-3-3",key:"wjy7rq"}],["path",{d:"m5 9-3 3 3 3",key:"j64kie"}]]);const pw=Se("unfold-vertical",[["path",{d:"M12 22v-6",key:"6o8u61"}],["path",{d:"M12 8V2",key:"1wkif3"}],["path",{d:"M4 12H2",key:"rhcxmi"}],["path",{d:"M10 12H8",key:"s88cx1"}],["path",{d:"M16 12h-2",key:"10asgb"}],["path",{d:"M22 12h-2",key:"14jgyd"}],["path",{d:"m15 19-3 3-3-3",key:"11eu04"}],["path",{d:"m15 5-3-3-3 3",key:"itvq4r"}]]);const gf=Se("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);const fw=Se("zoom-in",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]);const mw=Se("zoom-out",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]),vf=T.createContext({portalContainer:null});function zs(){return T.useContext(vf)}function hw({children:t}){const[e,r]=T.useState(null);return T.useEffect(()=>{if(typeof document>"u")return;const n=document.createElement("div");return n.setAttribute("data-uhuu-portal",""),n.style.cssText="position: fixed; top: 0; left: 0; z-index: 9999;",document.body.appendChild(n),r(n),()=>{document.body.removeChild(n)}},[]),y.jsx(vf.Provider,{value:{portalContainer:e},children:t})}const yf=O.createContext({interactive:!0,setInteractive:()=>{},enableDevTools:!1});function Ls(){return O.useContext(yf)}function js(){const{interactive:t}=Ls();return!t}function gw({children:t,defaultInteractive:e=!0,enableDevTools:r=!1}){const a=!!(typeof window<"u"&&window?.$uhuu_renderer)?!1:e,[i,o]=O.useState(a);return y.jsx(yf.Provider,{value:{interactive:i,setInteractive:o,enableDevTools:r},children:y.jsx(hw,{children:y.jsx("div",{"data-uhuu-interactive":i?"":void 0,style:{display:"contents"},children:t})})})}function bf(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var a=t.length;for(e=0;e<a;e++)t[e]&&(r=bf(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function Sf(){for(var t,e,r=0,n="",a=arguments.length;r<a;r++)(t=arguments[r])&&(e=bf(t))&&(n&&(n+=" "),n+=e);return n}const xf=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,wf=Sf,Cf=(t,e)=>r=>{var n;if(e?.variants==null)return wf(t,r?.class,r?.className);const{variants:a,defaultVariants:i}=e,o=Object.keys(a).map(c=>{const d=r?.[c],u=i?.[c];if(d===null)return null;const p=xf(d)||xf(u);return a[c][p]}),s=r&&Object.entries(r).reduce((c,d)=>{let[u,p]=d;return p===void 0||(c[u]=p),c},{}),l=e==null||(n=e.compoundVariants)===null||n===void 0?void 0:n.reduce((c,d)=>{let{class:u,className:p,...f}=d;return Object.entries(f).every(v=>{let[m,g]=v;return Array.isArray(g)?g.includes({...i,...s}[m]):{...i,...s}[m]===g})?[...c,u,p]:c},[]);return wf(t,o,l,r?.class,r?.className)},vw=(t,e)=>{const r=new Array(t.length+e.length);for(let n=0;n<t.length;n++)r[n]=t[n];for(let n=0;n<e.length;n++)r[t.length+n]=e[n];return r},yw=(t,e)=>({classGroupId:t,validator:e}),kf=(t=new Map,e=null,r)=>({nextPart:t,validators:e,classGroupId:r}),ln="-",Ef=[],bw="arbitrary..",Sw=t=>{const e=ww(t),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=t;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return xw(o);const s=o.split(ln),l=s[0]===""&&s.length>1?1:0;return Tf(s,l,e)},getConflictingClassGroupIds:(o,s)=>{if(s){const l=n[o],c=r[o];return l?c?vw(c,l):l:c||Ef}return r[o]||Ef}}},Tf=(t,e,r)=>{if(t.length-e===0)return r.classGroupId;const a=t[e],i=r.nextPart.get(a);if(i){const c=Tf(t,e+1,i);if(c)return c}const o=r.validators;if(o===null)return;const s=e===0?t.join(ln):t.slice(e).join(ln),l=o.length;for(let c=0;c<l;c++){const d=o[c];if(d.validator(s))return d.classGroupId}},xw=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),r=e.indexOf(":"),n=e.slice(0,r);return n?bw+n:void 0})(),ww=t=>{const{theme:e,classGroups:r}=t;return Cw(r,e)},Cw=(t,e)=>{const r=kf();for(const n in t){const a=t[n];Ws(a,r,n,e)}return r},Ws=(t,e,r,n)=>{const a=t.length;for(let i=0;i<a;i++){const o=t[i];kw(o,e,r,n)}},kw=(t,e,r,n)=>{if(typeof t=="string"){Ew(t,e,r);return}if(typeof t=="function"){Tw(t,e,r,n);return}Aw(t,e,r,n)},Ew=(t,e,r)=>{const n=t===""?e:Af(e,t);n.classGroupId=r},Tw=(t,e,r,n)=>{if(_w(t)){Ws(t(n),e,r,n);return}e.validators===null&&(e.validators=[]),e.validators.push(yw(r,t))},Aw=(t,e,r,n)=>{const a=Object.entries(t),i=a.length;for(let o=0;o<i;o++){const[s,l]=a[o];Ws(l,Af(e,s),r,n)}},Af=(t,e)=>{let r=t;const n=e.split(ln),a=n.length;for(let i=0;i<a;i++){const o=n[i];let s=r.nextPart.get(o);s||(s=kf(),r.nextPart.set(o,s)),r=s}return r},_w=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,Ow=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,r=Object.create(null),n=Object.create(null);const a=(i,o)=>{r[i]=o,e++,e>t&&(e=0,n=r,r=Object.create(null))};return{get(i){let o=r[i];if(o!==void 0)return o;if((o=n[i])!==void 0)return a(i,o),o},set(i,o){i in r?r[i]=o:a(i,o)}}},Bs="!",_f=":",Pw=[],Of=(t,e,r,n,a)=>({modifiers:t,hasImportantModifier:e,baseClassName:r,maybePostfixModifierPosition:n,isExternal:a}),Iw=t=>{const{prefix:e,experimentalParseClassName:r}=t;let n=a=>{const i=[];let o=0,s=0,l=0,c;const d=a.length;for(let m=0;m<d;m++){const g=a[m];if(o===0&&s===0){if(g===_f){i.push(a.slice(l,m)),l=m+1;continue}if(g==="/"){c=m;continue}}g==="["?o++:g==="]"?o--:g==="("?s++:g===")"&&s--}const u=i.length===0?a:a.slice(l);let p=u,f=!1;u.endsWith(Bs)?(p=u.slice(0,-1),f=!0):u.startsWith(Bs)&&(p=u.slice(1),f=!0);const v=c&&c>l?c-l:void 0;return Of(i,f,p,v)};if(e){const a=e+_f,i=n;n=o=>o.startsWith(a)?i(o.slice(a.length)):Of(Pw,!1,o,void 0,!0)}if(r){const a=n;n=i=>r({className:i,parseClassName:a})}return n},Nw=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((r,n)=>{e.set(r,1e6+n)}),r=>{const n=[];let a=[];for(let i=0;i<r.length;i++){const o=r[i],s=o[0]==="[",l=e.has(o);s||l?(a.length>0&&(a.sort(),n.push(...a),a=[]),n.push(o)):a.push(o)}return a.length>0&&(a.sort(),n.push(...a)),n}},Mw=t=>({cache:Ow(t.cacheSize),parseClassName:Iw(t),sortModifiers:Nw(t),...Sw(t)}),Dw=/\s+/,zw=(t,e)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:a,sortModifiers:i}=e,o=[],s=t.trim().split(Dw);let l="";for(let c=s.length-1;c>=0;c-=1){const d=s[c],{isExternal:u,modifiers:p,hasImportantModifier:f,baseClassName:v,maybePostfixModifierPosition:m}=r(d);if(u){l=d+(l.length>0?" "+l:l);continue}let g=!!m,C=n(g?v.substring(0,m):v);if(!C){if(!g){l=d+(l.length>0?" "+l:l);continue}if(C=n(v),!C){l=d+(l.length>0?" "+l:l);continue}g=!1}const x=p.length===0?"":p.length===1?p[0]:i(p).join(":"),h=f?x+Bs:x,b=h+C;if(o.indexOf(b)>-1)continue;o.push(b);const S=a(C,g);for(let E=0;E<S.length;++E){const k=S[E];o.push(h+k)}l=d+(l.length>0?" "+l:l)}return l},Lw=(...t)=>{let e=0,r,n,a="";for(;e<t.length;)(r=t[e++])&&(n=Pf(r))&&(a&&(a+=" "),a+=n);return a},Pf=t=>{if(typeof t=="string")return t;let e,r="";for(let n=0;n<t.length;n++)t[n]&&(e=Pf(t[n]))&&(r&&(r+=" "),r+=e);return r},jw=(t,...e)=>{let r,n,a,i;const o=l=>{const c=e.reduce((d,u)=>u(d),t());return r=Mw(c),n=r.cache.get,a=r.cache.set,i=s,s(l)},s=l=>{const c=n(l);if(c)return c;const d=zw(l,r);return a(l,d),d};return i=o,(...l)=>i(Lw(...l))},Ww=[],ye=t=>{const e=r=>r[t]||Ww;return e.isThemeGetter=!0,e},If=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Nf=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Bw=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,qw=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Rw=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Fw=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,$w=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Gw=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ht=t=>Bw.test(t),ce=t=>!!t&&!Number.isNaN(Number(t)),gt=t=>!!t&&Number.isInteger(Number(t)),qs=t=>t.endsWith("%")&&ce(t.slice(0,-1)),ot=t=>qw.test(t),Mf=()=>!0,Vw=t=>Rw.test(t)&&!Fw.test(t),Rs=()=>!1,Hw=t=>$w.test(t),Uw=t=>Gw.test(t),Kw=t=>!Q(t)&&!ee(t),Yw=t=>vt(t,Bf,Rs),Q=t=>If.test(t),Dt=t=>vt(t,qf,Vw),Df=t=>vt(t,nC,ce),Xw=t=>vt(t,Ff,Mf),Zw=t=>vt(t,Rf,Rs),zf=t=>vt(t,jf,Rs),Qw=t=>vt(t,Wf,Uw),cn=t=>vt(t,$f,Hw),ee=t=>Nf.test(t),br=t=>zt(t,qf),Jw=t=>zt(t,Rf),Lf=t=>zt(t,jf),eC=t=>zt(t,Bf),tC=t=>zt(t,Wf),dn=t=>zt(t,$f,!0),rC=t=>zt(t,Ff,!0),vt=(t,e,r)=>{const n=If.exec(t);return n?n[1]?e(n[1]):r(n[2]):!1},zt=(t,e,r=!1)=>{const n=Nf.exec(t);return n?n[1]?e(n[1]):r:!1},jf=t=>t==="position"||t==="percentage",Wf=t=>t==="image"||t==="url",Bf=t=>t==="length"||t==="size"||t==="bg-size",qf=t=>t==="length",nC=t=>t==="number",Rf=t=>t==="family-name",Ff=t=>t==="number"||t==="weight",$f=t=>t==="shadow",aC=jw(()=>{const t=ye("color"),e=ye("font"),r=ye("text"),n=ye("font-weight"),a=ye("tracking"),i=ye("leading"),o=ye("breakpoint"),s=ye("container"),l=ye("spacing"),c=ye("radius"),d=ye("shadow"),u=ye("inset-shadow"),p=ye("text-shadow"),f=ye("drop-shadow"),v=ye("blur"),m=ye("perspective"),g=ye("aspect"),C=ye("ease"),x=ye("animate"),h=()=>["auto","avoid","all","avoid-page","page","left","right","column"],b=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],S=()=>[...b(),ee,Q],E=()=>["auto","hidden","clip","visible","scroll"],k=()=>["auto","contain","none"],w=()=>[ee,Q,l],A=()=>[ht,"full","auto",...w()],_=()=>[gt,"none","subgrid",ee,Q],I=()=>["auto",{span:["full",gt,ee,Q]},gt,ee,Q],M=()=>[gt,"auto",ee,Q],z=()=>["auto","min","max","fr",ee,Q],R=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],H=()=>["start","end","center","stretch","center-safe","end-safe"],D=()=>["auto",...w()],F=()=>[ht,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...w()],q=()=>[ht,"screen","full","dvw","lvw","svw","min","max","fit",...w()],P=()=>[ht,"screen","full","lh","dvh","lvh","svh","min","max","fit",...w()],j=()=>[t,ee,Q],Y=()=>[...b(),Lf,zf,{position:[ee,Q]}],X=()=>["no-repeat",{repeat:["","x","y","space","round"]}],W=()=>["auto","cover","contain",eC,Yw,{size:[ee,Q]}],L=()=>[qs,br,Dt],B=()=>["","none","full",c,ee,Q],V=()=>["",ce,br,Dt],U=()=>["solid","dashed","dotted","double"],se=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ae=()=>[ce,qs,Lf,zf],N=()=>["","none",v,ee,Q],$=()=>["none",ce,ee,Q],Z=()=>["none",ce,ee,Q],le=()=>[ce,ee,Q],oe=()=>[ht,"full",...w()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ot],breakpoint:[ot],color:[Mf],container:[ot],"drop-shadow":[ot],ease:["in","out","in-out"],font:[Kw],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ot],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ot],shadow:[ot],spacing:["px",ce],text:[ot],"text-shadow":[ot],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ht,Q,ee,g]}],container:["container"],columns:[{columns:[ce,Q,ee,s]}],"break-after":[{"break-after":h()}],"break-before":[{"break-before":h()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:S()}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:A()}],"inset-x":[{"inset-x":A()}],"inset-y":[{"inset-y":A()}],start:[{"inset-s":A(),start:A()}],end:[{"inset-e":A(),end:A()}],"inset-bs":[{"inset-bs":A()}],"inset-be":[{"inset-be":A()}],top:[{top:A()}],right:[{right:A()}],bottom:[{bottom:A()}],left:[{left:A()}],visibility:["visible","invisible","collapse"],z:[{z:[gt,"auto",ee,Q]}],basis:[{basis:[ht,"full","auto",s,...w()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ce,ht,"auto","initial","none",Q]}],grow:[{grow:["",ce,ee,Q]}],shrink:[{shrink:["",ce,ee,Q]}],order:[{order:[gt,"first","last","none",ee,Q]}],"grid-cols":[{"grid-cols":_()}],"col-start-end":[{col:I()}],"col-start":[{"col-start":M()}],"col-end":[{"col-end":M()}],"grid-rows":[{"grid-rows":_()}],"row-start-end":[{row:I()}],"row-start":[{"row-start":M()}],"row-end":[{"row-end":M()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":z()}],"auto-rows":[{"auto-rows":z()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...R(),"normal"]}],"justify-items":[{"justify-items":[...H(),"normal"]}],"justify-self":[{"justify-self":["auto",...H()]}],"align-content":[{content:["normal",...R()]}],"align-items":[{items:[...H(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...H(),{baseline:["","last"]}]}],"place-content":[{"place-content":R()}],"place-items":[{"place-items":[...H(),"baseline"]}],"place-self":[{"place-self":["auto",...H()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:D()}],mx:[{mx:D()}],my:[{my:D()}],ms:[{ms:D()}],me:[{me:D()}],mbs:[{mbs:D()}],mbe:[{mbe:D()}],mt:[{mt:D()}],mr:[{mr:D()}],mb:[{mb:D()}],ml:[{ml:D()}],"space-x":[{"space-x":w()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":w()}],"space-y-reverse":["space-y-reverse"],size:[{size:F()}],"inline-size":[{inline:["auto",...q()]}],"min-inline-size":[{"min-inline":["auto",...q()]}],"max-inline-size":[{"max-inline":["none",...q()]}],"block-size":[{block:["auto",...P()]}],"min-block-size":[{"min-block":["auto",...P()]}],"max-block-size":[{"max-block":["none",...P()]}],w:[{w:[s,"screen",...F()]}],"min-w":[{"min-w":[s,"screen","none",...F()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[o]},...F()]}],h:[{h:["screen","lh",...F()]}],"min-h":[{"min-h":["screen","lh","none",...F()]}],"max-h":[{"max-h":["screen","lh",...F()]}],"font-size":[{text:["base",r,br,Dt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,rC,Xw]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",qs,Q]}],"font-family":[{font:[Jw,Zw,e]}],"font-features":[{"font-features":[Q]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,ee,Q]}],"line-clamp":[{"line-clamp":[ce,"none",ee,Df]}],leading:[{leading:[i,...w()]}],"list-image":[{"list-image":["none",ee,Q]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ee,Q]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:j()}],"text-color":[{text:j()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...U(),"wavy"]}],"text-decoration-thickness":[{decoration:[ce,"from-font","auto",ee,Dt]}],"text-decoration-color":[{decoration:j()}],"underline-offset":[{"underline-offset":[ce,"auto",ee,Q]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:w()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ee,Q]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ee,Q]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Y()}],"bg-repeat":[{bg:X()}],"bg-size":[{bg:W()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},gt,ee,Q],radial:["",ee,Q],conic:[gt,ee,Q]},tC,Qw]}],"bg-color":[{bg:j()}],"gradient-from-pos":[{from:L()}],"gradient-via-pos":[{via:L()}],"gradient-to-pos":[{to:L()}],"gradient-from":[{from:j()}],"gradient-via":[{via:j()}],"gradient-to":[{to:j()}],rounded:[{rounded:B()}],"rounded-s":[{"rounded-s":B()}],"rounded-e":[{"rounded-e":B()}],"rounded-t":[{"rounded-t":B()}],"rounded-r":[{"rounded-r":B()}],"rounded-b":[{"rounded-b":B()}],"rounded-l":[{"rounded-l":B()}],"rounded-ss":[{"rounded-ss":B()}],"rounded-se":[{"rounded-se":B()}],"rounded-ee":[{"rounded-ee":B()}],"rounded-es":[{"rounded-es":B()}],"rounded-tl":[{"rounded-tl":B()}],"rounded-tr":[{"rounded-tr":B()}],"rounded-br":[{"rounded-br":B()}],"rounded-bl":[{"rounded-bl":B()}],"border-w":[{border:V()}],"border-w-x":[{"border-x":V()}],"border-w-y":[{"border-y":V()}],"border-w-s":[{"border-s":V()}],"border-w-e":[{"border-e":V()}],"border-w-bs":[{"border-bs":V()}],"border-w-be":[{"border-be":V()}],"border-w-t":[{"border-t":V()}],"border-w-r":[{"border-r":V()}],"border-w-b":[{"border-b":V()}],"border-w-l":[{"border-l":V()}],"divide-x":[{"divide-x":V()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":V()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...U(),"hidden","none"]}],"divide-style":[{divide:[...U(),"hidden","none"]}],"border-color":[{border:j()}],"border-color-x":[{"border-x":j()}],"border-color-y":[{"border-y":j()}],"border-color-s":[{"border-s":j()}],"border-color-e":[{"border-e":j()}],"border-color-bs":[{"border-bs":j()}],"border-color-be":[{"border-be":j()}],"border-color-t":[{"border-t":j()}],"border-color-r":[{"border-r":j()}],"border-color-b":[{"border-b":j()}],"border-color-l":[{"border-l":j()}],"divide-color":[{divide:j()}],"outline-style":[{outline:[...U(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ce,ee,Q]}],"outline-w":[{outline:["",ce,br,Dt]}],"outline-color":[{outline:j()}],shadow:[{shadow:["","none",d,dn,cn]}],"shadow-color":[{shadow:j()}],"inset-shadow":[{"inset-shadow":["none",u,dn,cn]}],"inset-shadow-color":[{"inset-shadow":j()}],"ring-w":[{ring:V()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:j()}],"ring-offset-w":[{"ring-offset":[ce,Dt]}],"ring-offset-color":[{"ring-offset":j()}],"inset-ring-w":[{"inset-ring":V()}],"inset-ring-color":[{"inset-ring":j()}],"text-shadow":[{"text-shadow":["none",p,dn,cn]}],"text-shadow-color":[{"text-shadow":j()}],opacity:[{opacity:[ce,ee,Q]}],"mix-blend":[{"mix-blend":[...se(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":se()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[ce]}],"mask-image-linear-from-pos":[{"mask-linear-from":ae()}],"mask-image-linear-to-pos":[{"mask-linear-to":ae()}],"mask-image-linear-from-color":[{"mask-linear-from":j()}],"mask-image-linear-to-color":[{"mask-linear-to":j()}],"mask-image-t-from-pos":[{"mask-t-from":ae()}],"mask-image-t-to-pos":[{"mask-t-to":ae()}],"mask-image-t-from-color":[{"mask-t-from":j()}],"mask-image-t-to-color":[{"mask-t-to":j()}],"mask-image-r-from-pos":[{"mask-r-from":ae()}],"mask-image-r-to-pos":[{"mask-r-to":ae()}],"mask-image-r-from-color":[{"mask-r-from":j()}],"mask-image-r-to-color":[{"mask-r-to":j()}],"mask-image-b-from-pos":[{"mask-b-from":ae()}],"mask-image-b-to-pos":[{"mask-b-to":ae()}],"mask-image-b-from-color":[{"mask-b-from":j()}],"mask-image-b-to-color":[{"mask-b-to":j()}],"mask-image-l-from-pos":[{"mask-l-from":ae()}],"mask-image-l-to-pos":[{"mask-l-to":ae()}],"mask-image-l-from-color":[{"mask-l-from":j()}],"mask-image-l-to-color":[{"mask-l-to":j()}],"mask-image-x-from-pos":[{"mask-x-from":ae()}],"mask-image-x-to-pos":[{"mask-x-to":ae()}],"mask-image-x-from-color":[{"mask-x-from":j()}],"mask-image-x-to-color":[{"mask-x-to":j()}],"mask-image-y-from-pos":[{"mask-y-from":ae()}],"mask-image-y-to-pos":[{"mask-y-to":ae()}],"mask-image-y-from-color":[{"mask-y-from":j()}],"mask-image-y-to-color":[{"mask-y-to":j()}],"mask-image-radial":[{"mask-radial":[ee,Q]}],"mask-image-radial-from-pos":[{"mask-radial-from":ae()}],"mask-image-radial-to-pos":[{"mask-radial-to":ae()}],"mask-image-radial-from-color":[{"mask-radial-from":j()}],"mask-image-radial-to-color":[{"mask-radial-to":j()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[ce]}],"mask-image-conic-from-pos":[{"mask-conic-from":ae()}],"mask-image-conic-to-pos":[{"mask-conic-to":ae()}],"mask-image-conic-from-color":[{"mask-conic-from":j()}],"mask-image-conic-to-color":[{"mask-conic-to":j()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Y()}],"mask-repeat":[{mask:X()}],"mask-size":[{mask:W()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ee,Q]}],filter:[{filter:["","none",ee,Q]}],blur:[{blur:N()}],brightness:[{brightness:[ce,ee,Q]}],contrast:[{contrast:[ce,ee,Q]}],"drop-shadow":[{"drop-shadow":["","none",f,dn,cn]}],"drop-shadow-color":[{"drop-shadow":j()}],grayscale:[{grayscale:["",ce,ee,Q]}],"hue-rotate":[{"hue-rotate":[ce,ee,Q]}],invert:[{invert:["",ce,ee,Q]}],saturate:[{saturate:[ce,ee,Q]}],sepia:[{sepia:["",ce,ee,Q]}],"backdrop-filter":[{"backdrop-filter":["","none",ee,Q]}],"backdrop-blur":[{"backdrop-blur":N()}],"backdrop-brightness":[{"backdrop-brightness":[ce,ee,Q]}],"backdrop-contrast":[{"backdrop-contrast":[ce,ee,Q]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ce,ee,Q]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ce,ee,Q]}],"backdrop-invert":[{"backdrop-invert":["",ce,ee,Q]}],"backdrop-opacity":[{"backdrop-opacity":[ce,ee,Q]}],"backdrop-saturate":[{"backdrop-saturate":[ce,ee,Q]}],"backdrop-sepia":[{"backdrop-sepia":["",ce,ee,Q]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ee,Q]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ce,"initial",ee,Q]}],ease:[{ease:["linear","initial",C,ee,Q]}],delay:[{delay:[ce,ee,Q]}],animate:[{animate:["none",x,ee,Q]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,ee,Q]}],"perspective-origin":[{"perspective-origin":S()}],rotate:[{rotate:$()}],"rotate-x":[{"rotate-x":$()}],"rotate-y":[{"rotate-y":$()}],"rotate-z":[{"rotate-z":$()}],scale:[{scale:Z()}],"scale-x":[{"scale-x":Z()}],"scale-y":[{"scale-y":Z()}],"scale-z":[{"scale-z":Z()}],"scale-3d":["scale-3d"],skew:[{skew:le()}],"skew-x":[{"skew-x":le()}],"skew-y":[{"skew-y":le()}],transform:[{transform:[ee,Q,"","none","gpu","cpu"]}],"transform-origin":[{origin:S()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:oe()}],"translate-x":[{"translate-x":oe()}],"translate-y":[{"translate-y":oe()}],"translate-z":[{"translate-z":oe()}],"translate-none":["translate-none"],accent:[{accent:j()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:j()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ee,Q]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ee,Q]}],fill:[{fill:["none",...j()]}],"stroke-w":[{stroke:[ce,br,Dt,Df]}],stroke:[{stroke:["none",...j()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function pe(...t){return aC(Sf(t))}const iC=Cf("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-gray-900 text-white hover:bg-gray-800",outline:"border border-gray-300 bg-white hover:bg-gray-50 text-gray-900",ghost:"hover:bg-gray-100 text-gray-900",secondary:"bg-gray-100 text-gray-900 hover:bg-gray-200"},size:{default:"h-10 px-4 py-2",sm:"h-9 px-3 text-sm",lg:"h-11 px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),Ae=T.forwardRef(({className:t,variant:e,size:r,...n},a)=>y.jsx("button",{className:pe(iC({variant:e,size:r,className:t})),ref:a,...n}));Ae.displayName="Button";function ie(t,e,{checkForDefaultPrevented:r=!0}={}){return function(a){if(t?.(a),r===!1||!a.defaultPrevented)return e?.(a)}}function Gf(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function Sr(...t){return e=>{let r=!1;const n=t.map(a=>{const i=Gf(a,e);return!r&&typeof i=="function"&&(r=!0),i});if(r)return()=>{for(let a=0;a<n.length;a++){const i=n[a];typeof i=="function"?i():Gf(t[a],null)}}}}function me(...t){return T.useCallback(Sr(...t),t)}function oC(t,e){const r=T.createContext(e),n=i=>{const{children:o,...s}=i,l=T.useMemo(()=>s,Object.values(s));return y.jsx(r.Provider,{value:l,children:o})};n.displayName=t+"Provider";function a(i){const o=T.useContext(r);if(o)return o;if(e!==void 0)return e;throw new Error(`\`${i}\` must be used within \`${t}\``)}return[n,a]}function st(t,e=[]){let r=[];function n(i,o){const s=T.createContext(o),l=r.length;r=[...r,o];const c=u=>{const{scope:p,children:f,...v}=u,m=p?.[t]?.[l]||s,g=T.useMemo(()=>v,Object.values(v));return y.jsx(m.Provider,{value:g,children:f})};c.displayName=i+"Provider";function d(u,p){const f=p?.[t]?.[l]||s,v=T.useContext(f);if(v)return v;if(o!==void 0)return o;throw new Error(`\`${u}\` must be used within \`${i}\``)}return[c,d]}const a=()=>{const i=r.map(o=>T.createContext(o));return function(s){const l=s?.[t]||i;return T.useMemo(()=>({[`__scope${t}`]:{...s,[t]:l}}),[s,l])}};return a.scopeName=t,[n,sC(a,...e)]}function sC(...t){const e=t[0];if(t.length===1)return e;const r=()=>{const n=t.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const o=n.reduce((s,{useScope:l,scopeName:c})=>{const u=l(i)[`__scope${c}`];return{...s,...u}},{});return T.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return r.scopeName=e.scopeName,r}var yt=globalThis?.document?T.useLayoutEffect:()=>{},lC=T[" useInsertionEffect ".trim().toString()]||yt;function xr({prop:t,defaultProp:e,onChange:r=()=>{},caller:n}){const[a,i,o]=cC({defaultProp:e,onChange:r}),s=t!==void 0,l=s?t:a;{const d=T.useRef(t!==void 0);T.useEffect(()=>{const u=d.current;u!==s&&console.warn(`${n} is changing from ${u?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=s},[s,n])}const c=T.useCallback(d=>{if(s){const u=dC(d)?d(t):d;u!==t&&o.current?.(u)}else i(d)},[s,t,i,o]);return[l,c]}function cC({defaultProp:t,onChange:e}){const[r,n]=T.useState(t),a=T.useRef(r),i=T.useRef(e);return lC(()=>{i.current=e},[e]),T.useEffect(()=>{a.current!==r&&(i.current?.(r),a.current=r)},[r,a]),[r,n,i]}function dC(t){return typeof t=="function"}function wr(t){const e=uC(t),r=T.forwardRef((n,a)=>{const{children:i,...o}=n,s=T.Children.toArray(i),l=s.find(fC);if(l){const c=l.props.children,d=s.map(u=>u===l?T.Children.count(c)>1?T.Children.only(null):T.isValidElement(c)?c.props.children:null:u);return y.jsx(e,{...o,ref:a,children:T.isValidElement(c)?T.cloneElement(c,void 0,d):null})}return y.jsx(e,{...o,ref:a,children:i})});return r.displayName=`${t}.Slot`,r}function uC(t){const e=T.forwardRef((r,n)=>{const{children:a,...i}=r;if(T.isValidElement(a)){const o=hC(a),s=mC(i,a.props);return a.type!==T.Fragment&&(s.ref=n?Sr(n,o):o),T.cloneElement(a,s)}return T.Children.count(a)>1?T.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var Vf=Symbol("radix.slottable");function pC(t){const e=({children:r})=>y.jsx(y.Fragment,{children:r});return e.displayName=`${t}.Slottable`,e.__radixId=Vf,e}function fC(t){return T.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===Vf}function mC(t,e){const r={...e};for(const n in e){const a=t[n],i=e[n];/^on[A-Z]/.test(n)?a&&i?r[n]=(...s)=>{const l=i(...s);return a(...s),l}:a&&(r[n]=a):n==="style"?r[n]={...a,...i}:n==="className"&&(r[n]=[a,i].filter(Boolean).join(" "))}return{...t,...r}}function hC(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}var gC=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],he=gC.reduce((t,e)=>{const r=wr(`Primitive.${e}`),n=T.forwardRef((a,i)=>{const{asChild:o,...s}=a,l=o?r:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),y.jsx(l,{...s,ref:i})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function Hf(t,e){t&&vc.flushSync(()=>t.dispatchEvent(e))}function Fs(t){const e=t+"CollectionProvider",[r,n]=st(e),[a,i]=r(e,{collectionRef:{current:null},itemMap:new Map}),o=m=>{const{scope:g,children:C}=m,x=O.useRef(null),h=O.useRef(new Map).current;return y.jsx(a,{scope:g,itemMap:h,collectionRef:x,children:C})};o.displayName=e;const s=t+"CollectionSlot",l=wr(s),c=O.forwardRef((m,g)=>{const{scope:C,children:x}=m,h=i(s,C),b=me(g,h.collectionRef);return y.jsx(l,{ref:b,children:x})});c.displayName=s;const d=t+"CollectionItemSlot",u="data-radix-collection-item",p=wr(d),f=O.forwardRef((m,g)=>{const{scope:C,children:x,...h}=m,b=O.useRef(null),S=me(g,b),E=i(d,C);return O.useEffect(()=>(E.itemMap.set(b,{ref:b,...h}),()=>{E.itemMap.delete(b)})),y.jsx(p,{[u]:"",ref:S,children:x})});f.displayName=d;function v(m){const g=i(t+"CollectionConsumer",m);return O.useCallback(()=>{const x=g.collectionRef.current;if(!x)return[];const h=Array.from(x.querySelectorAll(`[${u}]`));return Array.from(g.itemMap.values()).sort((E,k)=>h.indexOf(E.ref.current)-h.indexOf(k.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:o,Slot:c,ItemSlot:f},v,n]}var vC=T.createContext(void 0);function $s(t){const e=T.useContext(vC);return t||e||"ltr"}function lt(t){const e=T.useRef(t);return T.useEffect(()=>{e.current=t}),T.useMemo(()=>(...r)=>e.current?.(...r),[])}function yC(t,e=globalThis?.document){const r=lt(t);T.useEffect(()=>{const n=a=>{a.key==="Escape"&&r(a)};return e.addEventListener("keydown",n,{capture:!0}),()=>e.removeEventListener("keydown",n,{capture:!0})},[r,e])}var bC="DismissableLayer",Gs="dismissableLayer.update",SC="dismissableLayer.pointerDownOutside",xC="dismissableLayer.focusOutside",Uf,Kf=T.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Vs=T.forwardRef((t,e)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:o,onDismiss:s,...l}=t,c=T.useContext(Kf),[d,u]=T.useState(null),p=d?.ownerDocument??globalThis?.document,[,f]=T.useState({}),v=me(e,k=>u(k)),m=Array.from(c.layers),[g]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),C=m.indexOf(g),x=d?m.indexOf(d):-1,h=c.layersWithOutsidePointerEventsDisabled.size>0,b=x>=C,S=kC(k=>{const w=k.target,A=[...c.branches].some(_=>_.contains(w));!b||A||(a?.(k),o?.(k),k.defaultPrevented||s?.())},p),E=EC(k=>{const w=k.target;[...c.branches].some(_=>_.contains(w))||(i?.(k),o?.(k),k.defaultPrevented||s?.())},p);return yC(k=>{x===c.layers.size-1&&(n?.(k),!k.defaultPrevented&&s&&(k.preventDefault(),s()))},p),T.useEffect(()=>{if(d)return r&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Uf=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(d)),c.layers.add(d),Yf(),()=>{r&&c.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=Uf)}},[d,p,r,c]),T.useEffect(()=>()=>{d&&(c.layers.delete(d),c.layersWithOutsidePointerEventsDisabled.delete(d),Yf())},[d,c]),T.useEffect(()=>{const k=()=>f({});return document.addEventListener(Gs,k),()=>document.removeEventListener(Gs,k)},[]),y.jsx(he.div,{...l,ref:v,style:{pointerEvents:h?b?"auto":"none":void 0,...t.style},onFocusCapture:ie(t.onFocusCapture,E.onFocusCapture),onBlurCapture:ie(t.onBlurCapture,E.onBlurCapture),onPointerDownCapture:ie(t.onPointerDownCapture,S.onPointerDownCapture)})});Vs.displayName=bC;var wC="DismissableLayerBranch",CC=T.forwardRef((t,e)=>{const r=T.useContext(Kf),n=T.useRef(null),a=me(e,n);return T.useEffect(()=>{const i=n.current;if(i)return r.branches.add(i),()=>{r.branches.delete(i)}},[r.branches]),y.jsx(he.div,{...t,ref:a})});CC.displayName=wC;function kC(t,e=globalThis?.document){const r=lt(t),n=T.useRef(!1),a=T.useRef(()=>{});return T.useEffect(()=>{const i=s=>{if(s.target&&!n.current){let l=function(){Xf(SC,r,c,{discrete:!0})};const c={originalEvent:s};s.pointerType==="touch"?(e.removeEventListener("click",a.current),a.current=l,e.addEventListener("click",a.current,{once:!0})):l()}else e.removeEventListener("click",a.current);n.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",i),e.removeEventListener("click",a.current)}},[e,r]),{onPointerDownCapture:()=>n.current=!0}}function EC(t,e=globalThis?.document){const r=lt(t),n=T.useRef(!1);return T.useEffect(()=>{const a=i=>{i.target&&!n.current&&Xf(xC,r,{originalEvent:i},{discrete:!1})};return e.addEventListener("focusin",a),()=>e.removeEventListener("focusin",a)},[e,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function Yf(){const t=new CustomEvent(Gs);document.dispatchEvent(t)}function Xf(t,e,r,{discrete:n}){const a=r.originalEvent.target,i=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:r});e&&a.addEventListener(t,e,{once:!0}),n?Hf(a,i):a.dispatchEvent(i)}var Hs=0;function Zf(){T.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??Qf()),document.body.insertAdjacentElement("beforeend",t[1]??Qf()),Hs++,()=>{Hs===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Hs--}},[])}function Qf(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var Us="focusScope.autoFocusOnMount",Ks="focusScope.autoFocusOnUnmount",Jf={bubbles:!1,cancelable:!0},TC="FocusScope",Ys=T.forwardRef((t,e)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...o}=t,[s,l]=T.useState(null),c=lt(a),d=lt(i),u=T.useRef(null),p=me(e,m=>l(m)),f=T.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;T.useEffect(()=>{if(n){let m=function(h){if(f.paused||!s)return;const b=h.target;s.contains(b)?u.current=b:bt(u.current,{select:!0})},g=function(h){if(f.paused||!s)return;const b=h.relatedTarget;b!==null&&(s.contains(b)||bt(u.current,{select:!0}))},C=function(h){if(document.activeElement===document.body)for(const S of h)S.removedNodes.length>0&&bt(s)};document.addEventListener("focusin",m),document.addEventListener("focusout",g);const x=new MutationObserver(C);return s&&x.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",g),x.disconnect()}}},[n,s,f.paused]),T.useEffect(()=>{if(s){rm.add(f);const m=document.activeElement;if(!s.contains(m)){const C=new CustomEvent(Us,Jf);s.addEventListener(Us,c),s.dispatchEvent(C),C.defaultPrevented||(AC(NC(em(s)),{select:!0}),document.activeElement===m&&bt(s))}return()=>{s.removeEventListener(Us,c),setTimeout(()=>{const C=new CustomEvent(Ks,Jf);s.addEventListener(Ks,d),s.dispatchEvent(C),C.defaultPrevented||bt(m??document.body,{select:!0}),s.removeEventListener(Ks,d),rm.remove(f)},0)}}},[s,c,d,f]);const v=T.useCallback(m=>{if(!r&&!n||f.paused)return;const g=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,C=document.activeElement;if(g&&C){const x=m.currentTarget,[h,b]=_C(x);h&&b?!m.shiftKey&&C===b?(m.preventDefault(),r&&bt(h,{select:!0})):m.shiftKey&&C===h&&(m.preventDefault(),r&&bt(b,{select:!0})):C===x&&m.preventDefault()}},[r,n,f.paused]);return y.jsx(he.div,{tabIndex:-1,...o,ref:p,onKeyDown:v})});Ys.displayName=TC;function AC(t,{select:e=!1}={}){const r=document.activeElement;for(const n of t)if(bt(n,{select:e}),document.activeElement!==r)return}function _C(t){const e=em(t),r=tm(e,t),n=tm(e.reverse(),t);return[r,n]}function em(t){const e=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const a=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||a?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)e.push(r.currentNode);return e}function tm(t,e){for(const r of t)if(!OC(r,{upTo:e}))return r}function OC(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function PC(t){return t instanceof HTMLInputElement&&"select"in t}function bt(t,{select:e=!1}={}){if(t&&t.focus){const r=document.activeElement;t.focus({preventScroll:!0}),t!==r&&PC(t)&&e&&t.select()}}var rm=IC();function IC(){let t=[];return{add(e){const r=t[0];e!==r&&r?.pause(),t=nm(t,e),t.unshift(e)},remove(e){t=nm(t,e),t[0]?.resume()}}}function nm(t,e){const r=[...t],n=r.indexOf(e);return n!==-1&&r.splice(n,1),r}function NC(t){return t.filter(e=>e.tagName!=="A")}var MC=T[" useId ".trim().toString()]||(()=>{}),DC=0;function Yt(t){const[e,r]=T.useState(MC());return yt(()=>{r(n=>n??String(DC++))},[t]),e?`radix-${e}`:""}const zC=["top","right","bottom","left"],St=Math.min,ze=Math.max,un=Math.round,pn=Math.floor,Ye=t=>({x:t,y:t}),LC={left:"right",right:"left",bottom:"top",top:"bottom"},jC={start:"end",end:"start"};function Xs(t,e,r){return ze(t,St(e,r))}function ct(t,e){return typeof t=="function"?t(e):t}function dt(t){return t.split("-")[0]}function Xt(t){return t.split("-")[1]}function Zs(t){return t==="x"?"y":"x"}function Qs(t){return t==="y"?"height":"width"}const WC=new Set(["top","bottom"]);function Xe(t){return WC.has(dt(t))?"y":"x"}function Js(t){return Zs(Xe(t))}function BC(t,e,r){r===void 0&&(r=!1);const n=Xt(t),a=Js(t),i=Qs(a);let o=a==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(o=fn(o)),[o,fn(o)]}function qC(t){const e=fn(t);return[el(t),e,el(e)]}function el(t){return t.replace(/start|end/g,e=>jC[e])}const am=["left","right"],im=["right","left"],RC=["top","bottom"],FC=["bottom","top"];function $C(t,e,r){switch(t){case"top":case"bottom":return r?e?im:am:e?am:im;case"left":case"right":return e?RC:FC;default:return[]}}function GC(t,e,r,n){const a=Xt(t);let i=$C(dt(t),r==="start",n);return a&&(i=i.map(o=>o+"-"+a),e&&(i=i.concat(i.map(el)))),i}function fn(t){return t.replace(/left|right|bottom|top/g,e=>LC[e])}function VC(t){return{top:0,right:0,bottom:0,left:0,...t}}function om(t){return typeof t!="number"?VC(t):{top:t,right:t,bottom:t,left:t}}function mn(t){const{x:e,y:r,width:n,height:a}=t;return{width:n,height:a,top:r,left:e,right:e+n,bottom:r+a,x:e,y:r}}function sm(t,e,r){let{reference:n,floating:a}=t;const i=Xe(e),o=Js(e),s=Qs(o),l=dt(e),c=i==="y",d=n.x+n.width/2-a.width/2,u=n.y+n.height/2-a.height/2,p=n[s]/2-a[s]/2;let f;switch(l){case"top":f={x:d,y:n.y-a.height};break;case"bottom":f={x:d,y:n.y+n.height};break;case"right":f={x:n.x+n.width,y:u};break;case"left":f={x:n.x-a.width,y:u};break;default:f={x:n.x,y:n.y}}switch(Xt(e)){case"start":f[o]-=p*(r&&c?-1:1);break;case"end":f[o]+=p*(r&&c?-1:1);break}return f}async function HC(t,e){var r;e===void 0&&(e={});const{x:n,y:a,platform:i,rects:o,elements:s,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:p=!1,padding:f=0}=ct(e,t),v=om(f),g=s[p?u==="floating"?"reference":"floating":u],C=mn(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(g)))==null||r?g:g.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(s.floating)),boundary:c,rootBoundary:d,strategy:l})),x=u==="floating"?{x:n,y:a,width:o.floating.width,height:o.floating.height}:o.reference,h=await(i.getOffsetParent==null?void 0:i.getOffsetParent(s.floating)),b=await(i.isElement==null?void 0:i.isElement(h))?await(i.getScale==null?void 0:i.getScale(h))||{x:1,y:1}:{x:1,y:1},S=mn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:x,offsetParent:h,strategy:l}):x);return{top:(C.top-S.top+v.top)/b.y,bottom:(S.bottom-C.bottom+v.bottom)/b.y,left:(C.left-S.left+v.left)/b.x,right:(S.right-C.right+v.right)/b.x}}const UC=async(t,e,r)=>{const{placement:n="bottom",strategy:a="absolute",middleware:i=[],platform:o}=r,s=i.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(e));let c=await o.getElementRects({reference:t,floating:e,strategy:a}),{x:d,y:u}=sm(c,n,l),p=n,f={},v=0;for(let g=0;g<s.length;g++){var m;const{name:C,fn:x}=s[g],{x:h,y:b,data:S,reset:E}=await x({x:d,y:u,initialPlacement:n,placement:p,strategy:a,middlewareData:f,rects:c,platform:{...o,detectOverflow:(m=o.detectOverflow)!=null?m:HC},elements:{reference:t,floating:e}});d=h??d,u=b??u,f={...f,[C]:{...f[C],...S}},E&&v<=50&&(v++,typeof E=="object"&&(E.placement&&(p=E.placement),E.rects&&(c=E.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:a}):E.rects),{x:d,y:u}=sm(c,p,l)),g=-1)}return{x:d,y:u,placement:p,strategy:a,middlewareData:f}},KC=t=>({name:"arrow",options:t,async fn(e){const{x:r,y:n,placement:a,rects:i,platform:o,elements:s,middlewareData:l}=e,{element:c,padding:d=0}=ct(t,e)||{};if(c==null)return{};const u=om(d),p={x:r,y:n},f=Js(a),v=Qs(f),m=await o.getDimensions(c),g=f==="y",C=g?"top":"left",x=g?"bottom":"right",h=g?"clientHeight":"clientWidth",b=i.reference[v]+i.reference[f]-p[f]-i.floating[v],S=p[f]-i.reference[f],E=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c));let k=E?E[h]:0;(!k||!await(o.isElement==null?void 0:o.isElement(E)))&&(k=s.floating[h]||i.floating[v]);const w=b/2-S/2,A=k/2-m[v]/2-1,_=St(u[C],A),I=St(u[x],A),M=_,z=k-m[v]-I,R=k/2-m[v]/2+w,H=Xs(M,R,z),D=!l.arrow&&Xt(a)!=null&&R!==H&&i.reference[v]/2-(R<M?_:I)-m[v]/2<0,F=D?R<M?R-M:R-z:0;return{[f]:p[f]+F,data:{[f]:H,centerOffset:R-H-F,...D&&{alignmentOffset:F}},reset:D}}}),YC=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var r,n;const{placement:a,middlewareData:i,rects:o,initialPlacement:s,platform:l,elements:c}=e,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:m=!0,...g}=ct(t,e);if((r=i.arrow)!=null&&r.alignmentOffset)return{};const C=dt(a),x=Xe(s),h=dt(s)===s,b=await(l.isRTL==null?void 0:l.isRTL(c.floating)),S=p||(h||!m?[fn(s)]:qC(s)),E=v!=="none";!p&&E&&S.push(...GC(s,m,v,b));const k=[s,...S],w=await l.detectOverflow(e,g),A=[];let _=((n=i.flip)==null?void 0:n.overflows)||[];if(d&&A.push(w[C]),u){const R=BC(a,o,b);A.push(w[R[0]],w[R[1]])}if(_=[..._,{placement:a,overflows:A}],!A.every(R=>R<=0)){var I,M;const R=(((I=i.flip)==null?void 0:I.index)||0)+1,H=k[R];if(H&&(!(u==="alignment"?x!==Xe(H):!1)||_.every(q=>Xe(q.placement)===x?q.overflows[0]>0:!0)))return{data:{index:R,overflows:_},reset:{placement:H}};let D=(M=_.filter(F=>F.overflows[0]<=0).sort((F,q)=>F.overflows[1]-q.overflows[1])[0])==null?void 0:M.placement;if(!D)switch(f){case"bestFit":{var z;const F=(z=_.filter(q=>{if(E){const P=Xe(q.placement);return P===x||P==="y"}return!0}).map(q=>[q.placement,q.overflows.filter(P=>P>0).reduce((P,j)=>P+j,0)]).sort((q,P)=>q[1]-P[1])[0])==null?void 0:z[0];F&&(D=F);break}case"initialPlacement":D=s;break}if(a!==D)return{reset:{placement:D}}}return{}}}};function lm(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function cm(t){return zC.some(e=>t[e]>=0)}const XC=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:r,platform:n}=e,{strategy:a="referenceHidden",...i}=ct(t,e);switch(a){case"referenceHidden":{const o=await n.detectOverflow(e,{...i,elementContext:"reference"}),s=lm(o,r.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:cm(s)}}}case"escaped":{const o=await n.detectOverflow(e,{...i,altBoundary:!0}),s=lm(o,r.floating);return{data:{escapedOffsets:s,escaped:cm(s)}}}default:return{}}}}},dm=new Set(["left","top"]);async function ZC(t,e){const{placement:r,platform:n,elements:a}=t,i=await(n.isRTL==null?void 0:n.isRTL(a.floating)),o=dt(r),s=Xt(r),l=Xe(r)==="y",c=dm.has(o)?-1:1,d=i&&l?-1:1,u=ct(e,t);let{mainAxis:p,crossAxis:f,alignmentAxis:v}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return s&&typeof v=="number"&&(f=s==="end"?v*-1:v),l?{x:f*d,y:p*c}:{x:p*c,y:f*d}}const QC=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var r,n;const{x:a,y:i,placement:o,middlewareData:s}=e,l=await ZC(e,t);return o===((r=s.offset)==null?void 0:r.placement)&&(n=s.arrow)!=null&&n.alignmentOffset?{}:{x:a+l.x,y:i+l.y,data:{...l,placement:o}}}}},JC=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:r,y:n,placement:a,platform:i}=e,{mainAxis:o=!0,crossAxis:s=!1,limiter:l={fn:C=>{let{x,y:h}=C;return{x,y:h}}},...c}=ct(t,e),d={x:r,y:n},u=await i.detectOverflow(e,c),p=Xe(dt(a)),f=Zs(p);let v=d[f],m=d[p];if(o){const C=f==="y"?"top":"left",x=f==="y"?"bottom":"right",h=v+u[C],b=v-u[x];v=Xs(h,v,b)}if(s){const C=p==="y"?"top":"left",x=p==="y"?"bottom":"right",h=m+u[C],b=m-u[x];m=Xs(h,m,b)}const g=l.fn({...e,[f]:v,[p]:m});return{...g,data:{x:g.x-r,y:g.y-n,enabled:{[f]:o,[p]:s}}}}}},e0=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:r,y:n,placement:a,rects:i,middlewareData:o}=e,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=ct(t,e),d={x:r,y:n},u=Xe(a),p=Zs(u);let f=d[p],v=d[u];const m=ct(s,e),g=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const h=p==="y"?"height":"width",b=i.reference[p]-i.floating[h]+g.mainAxis,S=i.reference[p]+i.reference[h]-g.mainAxis;f<b?f=b:f>S&&(f=S)}if(c){var C,x;const h=p==="y"?"width":"height",b=dm.has(dt(a)),S=i.reference[u]-i.floating[h]+(b&&((C=o.offset)==null?void 0:C[u])||0)+(b?0:g.crossAxis),E=i.reference[u]+i.reference[h]+(b?0:((x=o.offset)==null?void 0:x[u])||0)-(b?g.crossAxis:0);v<S?v=S:v>E&&(v=E)}return{[p]:f,[u]:v}}}},t0=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var r,n;const{placement:a,rects:i,platform:o,elements:s}=e,{apply:l=()=>{},...c}=ct(t,e),d=await o.detectOverflow(e,c),u=dt(a),p=Xt(a),f=Xe(a)==="y",{width:v,height:m}=i.floating;let g,C;u==="top"||u==="bottom"?(g=u,C=p===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?"start":"end")?"left":"right"):(C=u,g=p==="end"?"top":"bottom");const x=m-d.top-d.bottom,h=v-d.left-d.right,b=St(m-d[g],x),S=St(v-d[C],h),E=!e.middlewareData.shift;let k=b,w=S;if((r=e.middlewareData.shift)!=null&&r.enabled.x&&(w=h),(n=e.middlewareData.shift)!=null&&n.enabled.y&&(k=x),E&&!p){const _=ze(d.left,0),I=ze(d.right,0),M=ze(d.top,0),z=ze(d.bottom,0);f?w=v-2*(_!==0||I!==0?_+I:ze(d.left,d.right)):k=m-2*(M!==0||z!==0?M+z:ze(d.top,d.bottom))}await l({...e,availableWidth:w,availableHeight:k});const A=await o.getDimensions(s.floating);return v!==A.width||m!==A.height?{reset:{rects:!0}}:{}}}};function hn(){return typeof window<"u"}function Zt(t){return um(t)?(t.nodeName||"").toLowerCase():"#document"}function Le(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Ze(t){var e;return(e=(um(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function um(t){return hn()?t instanceof Node||t instanceof Le(t).Node:!1}function Ge(t){return hn()?t instanceof Element||t instanceof Le(t).Element:!1}function Qe(t){return hn()?t instanceof HTMLElement||t instanceof Le(t).HTMLElement:!1}function pm(t){return!hn()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Le(t).ShadowRoot}const r0=new Set(["inline","contents"]);function Cr(t){const{overflow:e,overflowX:r,overflowY:n,display:a}=Ve(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+r)&&!r0.has(a)}const n0=new Set(["table","td","th"]);function a0(t){return n0.has(Zt(t))}const i0=[":popover-open",":modal"];function gn(t){return i0.some(e=>{try{return t.matches(e)}catch{return!1}})}const o0=["transform","translate","scale","rotate","perspective"],s0=["transform","translate","scale","rotate","perspective","filter"],l0=["paint","layout","strict","content"];function tl(t){const e=rl(),r=Ge(t)?Ve(t):t;return o0.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!e&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!e&&(r.filter?r.filter!=="none":!1)||s0.some(n=>(r.willChange||"").includes(n))||l0.some(n=>(r.contain||"").includes(n))}function c0(t){let e=xt(t);for(;Qe(e)&&!Qt(e);){if(tl(e))return e;if(gn(e))return null;e=xt(e)}return null}function rl(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const d0=new Set(["html","body","#document"]);function Qt(t){return d0.has(Zt(t))}function Ve(t){return Le(t).getComputedStyle(t)}function vn(t){return Ge(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function xt(t){if(Zt(t)==="html")return t;const e=t.assignedSlot||t.parentNode||pm(t)&&t.host||Ze(t);return pm(e)?e.host:e}function fm(t){const e=xt(t);return Qt(e)?t.ownerDocument?t.ownerDocument.body:t.body:Qe(e)&&Cr(e)?e:fm(e)}function kr(t,e,r){var n;e===void 0&&(e=[]),r===void 0&&(r=!0);const a=fm(t),i=a===((n=t.ownerDocument)==null?void 0:n.body),o=Le(a);if(i){const s=nl(o);return e.concat(o,o.visualViewport||[],Cr(a)?a:[],s&&r?kr(s):[])}return e.concat(a,kr(a,[],r))}function nl(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function mm(t){const e=Ve(t);let r=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const a=Qe(t),i=a?t.offsetWidth:r,o=a?t.offsetHeight:n,s=un(r)!==i||un(n)!==o;return s&&(r=i,n=o),{width:r,height:n,$:s}}function al(t){return Ge(t)?t:t.contextElement}function Jt(t){const e=al(t);if(!Qe(e))return Ye(1);const r=e.getBoundingClientRect(),{width:n,height:a,$:i}=mm(e);let o=(i?un(r.width):r.width)/n,s=(i?un(r.height):r.height)/a;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}const u0=Ye(0);function hm(t){const e=Le(t);return!rl()||!e.visualViewport?u0:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function p0(t,e,r){return e===void 0&&(e=!1),!r||e&&r!==Le(t)?!1:e}function Lt(t,e,r,n){e===void 0&&(e=!1),r===void 0&&(r=!1);const a=t.getBoundingClientRect(),i=al(t);let o=Ye(1);e&&(n?Ge(n)&&(o=Jt(n)):o=Jt(t));const s=p0(i,r,n)?hm(i):Ye(0);let l=(a.left+s.x)/o.x,c=(a.top+s.y)/o.y,d=a.width/o.x,u=a.height/o.y;if(i){const p=Le(i),f=n&&Ge(n)?Le(n):n;let v=p,m=nl(v);for(;m&&n&&f!==v;){const g=Jt(m),C=m.getBoundingClientRect(),x=Ve(m),h=C.left+(m.clientLeft+parseFloat(x.paddingLeft))*g.x,b=C.top+(m.clientTop+parseFloat(x.paddingTop))*g.y;l*=g.x,c*=g.y,d*=g.x,u*=g.y,l+=h,c+=b,v=Le(m),m=nl(v)}}return mn({width:d,height:u,x:l,y:c})}function yn(t,e){const r=vn(t).scrollLeft;return e?e.left+r:Lt(Ze(t)).left+r}function gm(t,e){const r=t.getBoundingClientRect(),n=r.left+e.scrollLeft-yn(t,r),a=r.top+e.scrollTop;return{x:n,y:a}}function f0(t){let{elements:e,rect:r,offsetParent:n,strategy:a}=t;const i=a==="fixed",o=Ze(n),s=e?gn(e.floating):!1;if(n===o||s&&i)return r;let l={scrollLeft:0,scrollTop:0},c=Ye(1);const d=Ye(0),u=Qe(n);if((u||!u&&!i)&&((Zt(n)!=="body"||Cr(o))&&(l=vn(n)),Qe(n))){const f=Lt(n);c=Jt(n),d.x=f.x+n.clientLeft,d.y=f.y+n.clientTop}const p=o&&!u&&!i?gm(o,l):Ye(0);return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-l.scrollLeft*c.x+d.x+p.x,y:r.y*c.y-l.scrollTop*c.y+d.y+p.y}}function m0(t){return Array.from(t.getClientRects())}function h0(t){const e=Ze(t),r=vn(t),n=t.ownerDocument.body,a=ze(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=ze(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let o=-r.scrollLeft+yn(t);const s=-r.scrollTop;return Ve(n).direction==="rtl"&&(o+=ze(e.clientWidth,n.clientWidth)-a),{width:a,height:i,x:o,y:s}}const vm=25;function g0(t,e){const r=Le(t),n=Ze(t),a=r.visualViewport;let i=n.clientWidth,o=n.clientHeight,s=0,l=0;if(a){i=a.width,o=a.height;const d=rl();(!d||d&&e==="fixed")&&(s=a.offsetLeft,l=a.offsetTop)}const c=yn(n);if(c<=0){const d=n.ownerDocument,u=d.body,p=getComputedStyle(u),f=d.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,v=Math.abs(n.clientWidth-u.clientWidth-f);v<=vm&&(i-=v)}else c<=vm&&(i+=c);return{width:i,height:o,x:s,y:l}}const v0=new Set(["absolute","fixed"]);function y0(t,e){const r=Lt(t,!0,e==="fixed"),n=r.top+t.clientTop,a=r.left+t.clientLeft,i=Qe(t)?Jt(t):Ye(1),o=t.clientWidth*i.x,s=t.clientHeight*i.y,l=a*i.x,c=n*i.y;return{width:o,height:s,x:l,y:c}}function ym(t,e,r){let n;if(e==="viewport")n=g0(t,r);else if(e==="document")n=h0(Ze(t));else if(Ge(e))n=y0(e,r);else{const a=hm(t);n={x:e.x-a.x,y:e.y-a.y,width:e.width,height:e.height}}return mn(n)}function bm(t,e){const r=xt(t);return r===e||!Ge(r)||Qt(r)?!1:Ve(r).position==="fixed"||bm(r,e)}function b0(t,e){const r=e.get(t);if(r)return r;let n=kr(t,[],!1).filter(s=>Ge(s)&&Zt(s)!=="body"),a=null;const i=Ve(t).position==="fixed";let o=i?xt(t):t;for(;Ge(o)&&!Qt(o);){const s=Ve(o),l=tl(o);!l&&s.position==="fixed"&&(a=null),(i?!l&&!a:!l&&s.position==="static"&&!!a&&v0.has(a.position)||Cr(o)&&!l&&bm(t,o))?n=n.filter(d=>d!==o):a=s,o=xt(o)}return e.set(t,n),n}function S0(t){let{element:e,boundary:r,rootBoundary:n,strategy:a}=t;const o=[...r==="clippingAncestors"?gn(e)?[]:b0(e,this._c):[].concat(r),n],s=o[0],l=o.reduce((c,d)=>{const u=ym(e,d,a);return c.top=ze(u.top,c.top),c.right=St(u.right,c.right),c.bottom=St(u.bottom,c.bottom),c.left=ze(u.left,c.left),c},ym(e,s,a));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function x0(t){const{width:e,height:r}=mm(t);return{width:e,height:r}}function w0(t,e,r){const n=Qe(e),a=Ze(e),i=r==="fixed",o=Lt(t,!0,i,e);let s={scrollLeft:0,scrollTop:0};const l=Ye(0);function c(){l.x=yn(a)}if(n||!n&&!i)if((Zt(e)!=="body"||Cr(a))&&(s=vn(e)),n){const f=Lt(e,!0,i,e);l.x=f.x+e.clientLeft,l.y=f.y+e.clientTop}else a&&c();i&&!n&&a&&c();const d=a&&!n&&!i?gm(a,s):Ye(0),u=o.left+s.scrollLeft-l.x-d.x,p=o.top+s.scrollTop-l.y-d.y;return{x:u,y:p,width:o.width,height:o.height}}function il(t){return Ve(t).position==="static"}function Sm(t,e){if(!Qe(t)||Ve(t).position==="fixed")return null;if(e)return e(t);let r=t.offsetParent;return Ze(t)===r&&(r=r.ownerDocument.body),r}function xm(t,e){const r=Le(t);if(gn(t))return r;if(!Qe(t)){let a=xt(t);for(;a&&!Qt(a);){if(Ge(a)&&!il(a))return a;a=xt(a)}return r}let n=Sm(t,e);for(;n&&a0(n)&&il(n);)n=Sm(n,e);return n&&Qt(n)&&il(n)&&!tl(n)?r:n||c0(t)||r}const C0=async function(t){const e=this.getOffsetParent||xm,r=this.getDimensions,n=await r(t.floating);return{reference:w0(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function k0(t){return Ve(t).direction==="rtl"}const E0={convertOffsetParentRelativeRectToViewportRelativeRect:f0,getDocumentElement:Ze,getClippingRect:S0,getOffsetParent:xm,getElementRects:C0,getClientRects:m0,getDimensions:x0,getScale:Jt,isElement:Ge,isRTL:k0};function wm(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function T0(t,e){let r=null,n;const a=Ze(t);function i(){var s;clearTimeout(n),(s=r)==null||s.disconnect(),r=null}function o(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),i();const c=t.getBoundingClientRect(),{left:d,top:u,width:p,height:f}=c;if(s||e(),!p||!f)return;const v=pn(u),m=pn(a.clientWidth-(d+p)),g=pn(a.clientHeight-(u+f)),C=pn(d),h={rootMargin:-v+"px "+-m+"px "+-g+"px "+-C+"px",threshold:ze(0,St(1,l))||1};let b=!0;function S(E){const k=E[0].intersectionRatio;if(k!==l){if(!b)return o();k?o(!1,k):n=setTimeout(()=>{o(!1,1e-7)},1e3)}k===1&&!wm(c,t.getBoundingClientRect())&&o(),b=!1}try{r=new IntersectionObserver(S,{...h,root:a.ownerDocument})}catch{r=new IntersectionObserver(S,h)}r.observe(t)}return o(!0),i}function A0(t,e,r,n){n===void 0&&(n={});const{ancestorScroll:a=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,c=al(t),d=a||i?[...c?kr(c):[],...kr(e)]:[];d.forEach(C=>{a&&C.addEventListener("scroll",r,{passive:!0}),i&&C.addEventListener("resize",r)});const u=c&&s?T0(c,r):null;let p=-1,f=null;o&&(f=new ResizeObserver(C=>{let[x]=C;x&&x.target===c&&f&&(f.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var h;(h=f)==null||h.observe(e)})),r()}),c&&!l&&f.observe(c),f.observe(e));let v,m=l?Lt(t):null;l&&g();function g(){const C=Lt(t);m&&!wm(m,C)&&r(),m=C,v=requestAnimationFrame(g)}return r(),()=>{var C;d.forEach(x=>{a&&x.removeEventListener("scroll",r),i&&x.removeEventListener("resize",r)}),u?.(),(C=f)==null||C.disconnect(),f=null,l&&cancelAnimationFrame(v)}}const _0=QC,O0=JC,P0=YC,I0=t0,N0=XC,Cm=KC,M0=e0,D0=(t,e,r)=>{const n=new Map,a={platform:E0,...r},i={...a.platform,_c:n};return UC(t,e,{...a,platform:i})};var z0=typeof document<"u",L0=function(){},bn=z0?O.useLayoutEffect:L0;function Sn(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let r,n,a;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(r=t.length,r!==e.length)return!1;for(n=r;n--!==0;)if(!Sn(t[n],e[n]))return!1;return!0}if(a=Object.keys(t),r=a.length,r!==Object.keys(e).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(e,a[n]))return!1;for(n=r;n--!==0;){const i=a[n];if(!(i==="_owner"&&t.$$typeof)&&!Sn(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function km(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Em(t,e){const r=km(t);return Math.round(e*r)/r}function ol(t){const e=T.useRef(t);return bn(()=>{e.current=t}),e}function j0(t){t===void 0&&(t={});const{placement:e="bottom",strategy:r="absolute",middleware:n=[],platform:a,elements:{reference:i,floating:o}={},transform:s=!0,whileElementsMounted:l,open:c}=t,[d,u]=T.useState({x:0,y:0,strategy:r,placement:e,middlewareData:{},isPositioned:!1}),[p,f]=T.useState(n);Sn(p,n)||f(n);const[v,m]=T.useState(null),[g,C]=T.useState(null),x=T.useCallback(q=>{q!==E.current&&(E.current=q,m(q))},[]),h=T.useCallback(q=>{q!==k.current&&(k.current=q,C(q))},[]),b=i||v,S=o||g,E=T.useRef(null),k=T.useRef(null),w=T.useRef(d),A=l!=null,_=ol(l),I=ol(a),M=ol(c),z=T.useCallback(()=>{if(!E.current||!k.current)return;const q={placement:e,strategy:r,middleware:p};I.current&&(q.platform=I.current),D0(E.current,k.current,q).then(P=>{const j={...P,isPositioned:M.current!==!1};R.current&&!Sn(w.current,j)&&(w.current=j,vc.flushSync(()=>{u(j)}))})},[p,e,r,I,M]);bn(()=>{c===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,u(q=>({...q,isPositioned:!1})))},[c]);const R=T.useRef(!1);bn(()=>(R.current=!0,()=>{R.current=!1}),[]),bn(()=>{if(b&&(E.current=b),S&&(k.current=S),b&&S){if(_.current)return _.current(b,S,z);z()}},[b,S,z,_,A]);const H=T.useMemo(()=>({reference:E,floating:k,setReference:x,setFloating:h}),[x,h]),D=T.useMemo(()=>({reference:b,floating:S}),[b,S]),F=T.useMemo(()=>{const q={position:r,left:0,top:0};if(!D.floating)return q;const P=Em(D.floating,d.x),j=Em(D.floating,d.y);return s?{...q,transform:"translate("+P+"px, "+j+"px)",...km(D.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:P,top:j}},[r,s,D.floating,d.x,d.y]);return T.useMemo(()=>({...d,update:z,refs:H,elements:D,floatingStyles:F}),[d,z,H,D,F])}const W0=t=>{function e(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:t,fn(r){const{element:n,padding:a}=typeof t=="function"?t(r):t;return n&&e(n)?n.current!=null?Cm({element:n.current,padding:a}).fn(r):{}:n?Cm({element:n,padding:a}).fn(r):{}}}},B0=(t,e)=>({..._0(t),options:[t,e]}),q0=(t,e)=>({...O0(t),options:[t,e]}),R0=(t,e)=>({...M0(t),options:[t,e]}),F0=(t,e)=>({...P0(t),options:[t,e]}),$0=(t,e)=>({...I0(t),options:[t,e]}),G0=(t,e)=>({...N0(t),options:[t,e]}),V0=(t,e)=>({...W0(t),options:[t,e]});var H0="Arrow",Tm=T.forwardRef((t,e)=>{const{children:r,width:n=10,height:a=5,...i}=t;return y.jsx(he.svg,{...i,ref:e,width:n,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?r:y.jsx("polygon",{points:"0,0 30,0 15,10"})})});Tm.displayName=H0;var U0=Tm;function sl(t){const[e,r]=T.useState(void 0);return yt(()=>{if(t){r({width:t.offsetWidth,height:t.offsetHeight});const n=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const i=a[0];let o,s;if("borderBoxSize"in i){const l=i.borderBoxSize,c=Array.isArray(l)?l[0]:l;o=c.inlineSize,s=c.blockSize}else o=t.offsetWidth,s=t.offsetHeight;r({width:o,height:s})});return n.observe(t,{box:"border-box"}),()=>n.unobserve(t)}else r(void 0)},[t]),e}var ll="Popper",[Am,_m]=st(ll),[K0,Om]=Am(ll),Pm=t=>{const{__scopePopper:e,children:r}=t,[n,a]=T.useState(null);return y.jsx(K0,{scope:e,anchor:n,onAnchorChange:a,children:r})};Pm.displayName=ll;var Im="PopperAnchor",Nm=T.forwardRef((t,e)=>{const{__scopePopper:r,virtualRef:n,...a}=t,i=Om(Im,r),o=T.useRef(null),s=me(e,o),l=T.useRef(null);return T.useEffect(()=>{const c=l.current;l.current=n?.current||o.current,c!==l.current&&i.onAnchorChange(l.current)}),n?null:y.jsx(he.div,{...a,ref:s})});Nm.displayName=Im;var cl="PopperContent",[Y0,X0]=Am(cl),Mm=T.forwardRef((t,e)=>{const{__scopePopper:r,side:n="bottom",sideOffset:a=0,align:i="center",alignOffset:o=0,arrowPadding:s=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:d=0,sticky:u="partial",hideWhenDetached:p=!1,updatePositionStrategy:f="optimized",onPlaced:v,...m}=t,g=Om(cl,r),[C,x]=T.useState(null),h=me(e,U=>x(U)),[b,S]=T.useState(null),E=sl(b),k=E?.width??0,w=E?.height??0,A=n+(i!=="center"?"-"+i:""),_=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},I=Array.isArray(c)?c:[c],M=I.length>0,z={padding:_,boundary:I.filter(Q0),altBoundary:M},{refs:R,floatingStyles:H,placement:D,isPositioned:F,middlewareData:q}=j0({strategy:"fixed",placement:A,whileElementsMounted:(...U)=>A0(...U,{animationFrame:f==="always"}),elements:{reference:g.anchor},middleware:[B0({mainAxis:a+w,alignmentAxis:o}),l&&q0({mainAxis:!0,crossAxis:!1,limiter:u==="partial"?R0():void 0,...z}),l&&F0({...z}),$0({...z,apply:({elements:U,rects:se,availableWidth:ae,availableHeight:N})=>{const{width:$,height:Z}=se.reference,le=U.floating.style;le.setProperty("--radix-popper-available-width",`${ae}px`),le.setProperty("--radix-popper-available-height",`${N}px`),le.setProperty("--radix-popper-anchor-width",`${$}px`),le.setProperty("--radix-popper-anchor-height",`${Z}px`)}}),b&&V0({element:b,padding:s}),J0({arrowWidth:k,arrowHeight:w}),p&&G0({strategy:"referenceHidden",...z})]}),[P,j]=Lm(D),Y=lt(v);yt(()=>{F&&Y?.()},[F,Y]);const X=q.arrow?.x,W=q.arrow?.y,L=q.arrow?.centerOffset!==0,[B,V]=T.useState();return yt(()=>{C&&V(window.getComputedStyle(C).zIndex)},[C]),y.jsx("div",{ref:R.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:F?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:B,"--radix-popper-transform-origin":[q.transformOrigin?.x,q.transformOrigin?.y].join(" "),...q.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:y.jsx(Y0,{scope:r,placedSide:P,onArrowChange:S,arrowX:X,arrowY:W,shouldHideArrow:L,children:y.jsx(he.div,{"data-side":P,"data-align":j,...m,ref:h,style:{...m.style,animation:F?void 0:"none"}})})})});Mm.displayName=cl;var Dm="PopperArrow",Z0={top:"bottom",right:"left",bottom:"top",left:"right"},zm=T.forwardRef(function(e,r){const{__scopePopper:n,...a}=e,i=X0(Dm,n),o=Z0[i.placedSide];return y.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:y.jsx(U0,{...a,ref:r,style:{...a.style,display:"block"}})})});zm.displayName=Dm;function Q0(t){return t!==null}var J0=t=>({name:"transformOrigin",options:t,fn(e){const{placement:r,rects:n,middlewareData:a}=e,o=a.arrow?.centerOffset!==0,s=o?0:t.arrowWidth,l=o?0:t.arrowHeight,[c,d]=Lm(r),u={start:"0%",center:"50%",end:"100%"}[d],p=(a.arrow?.x??0)+s/2,f=(a.arrow?.y??0)+l/2;let v="",m="";return c==="bottom"?(v=o?u:`${p}px`,m=`${-l}px`):c==="top"?(v=o?u:`${p}px`,m=`${n.floating.height+l}px`):c==="right"?(v=`${-l}px`,m=o?u:`${f}px`):c==="left"&&(v=`${n.floating.width+l}px`,m=o?u:`${f}px`),{data:{x:v,y:m}}}});function Lm(t){const[e,r="center"]=t.split("-");return[e,r]}var ek=Pm,tk=Nm,rk=Mm,nk=zm,ak="Portal",dl=T.forwardRef((t,e)=>{const{container:r,...n}=t,[a,i]=T.useState(!1);yt(()=>i(!0),[]);const o=r||a&&globalThis?.document?.body;return o?Pt.createPortal(y.jsx(he.div,{...n,ref:e}),o):null});dl.displayName=ak;function ik(t,e){return T.useReducer((r,n)=>e[r][n]??r,t)}var wt=t=>{const{present:e,children:r}=t,n=ok(e),a=typeof r=="function"?r({present:n.isPresent}):T.Children.only(r),i=me(n.ref,sk(a));return typeof r=="function"||n.isPresent?T.cloneElement(a,{ref:i}):null};wt.displayName="Presence";function ok(t){const[e,r]=T.useState(),n=T.useRef(null),a=T.useRef(t),i=T.useRef("none"),o=t?"mounted":"unmounted",[s,l]=ik(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return T.useEffect(()=>{const c=xn(n.current);i.current=s==="mounted"?c:"none"},[s]),yt(()=>{const c=n.current,d=a.current;if(d!==t){const p=i.current,f=xn(c);t?l("MOUNT"):f==="none"||c?.display==="none"?l("UNMOUNT"):l(d&&p!==f?"ANIMATION_OUT":"UNMOUNT"),a.current=t}},[t,l]),yt(()=>{if(e){let c;const d=e.ownerDocument.defaultView??window,u=f=>{const m=xn(n.current).includes(CSS.escape(f.animationName));if(f.target===e&&m&&(l("ANIMATION_END"),!a.current)){const g=e.style.animationFillMode;e.style.animationFillMode="forwards",c=d.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=g)})}},p=f=>{f.target===e&&(i.current=xn(n.current))};return e.addEventListener("animationstart",p),e.addEventListener("animationcancel",u),e.addEventListener("animationend",u),()=>{d.clearTimeout(c),e.removeEventListener("animationstart",p),e.removeEventListener("animationcancel",u),e.removeEventListener("animationend",u)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:T.useCallback(c=>{n.current=c?getComputedStyle(c):null,r(c)},[])}}function xn(t){return t?.animationName||"none"}function sk(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}var ul="rovingFocusGroup.onEntryFocus",lk={bubbles:!1,cancelable:!0},Er="RovingFocusGroup",[pl,jm,ck]=Fs(Er),[dk,Wm]=st(Er,[ck]),[uk,pk]=dk(Er),Bm=T.forwardRef((t,e)=>y.jsx(pl.Provider,{scope:t.__scopeRovingFocusGroup,children:y.jsx(pl.Slot,{scope:t.__scopeRovingFocusGroup,children:y.jsx(fk,{...t,ref:e})})}));Bm.displayName=Er;var fk=T.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:a=!1,dir:i,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:d=!1,...u}=t,p=T.useRef(null),f=me(e,p),v=$s(i),[m,g]=xr({prop:o,defaultProp:s??null,onChange:l,caller:Er}),[C,x]=T.useState(!1),h=lt(c),b=jm(r),S=T.useRef(!1),[E,k]=T.useState(0);return T.useEffect(()=>{const w=p.current;if(w)return w.addEventListener(ul,h),()=>w.removeEventListener(ul,h)},[h]),y.jsx(uk,{scope:r,orientation:n,dir:v,loop:a,currentTabStopId:m,onItemFocus:T.useCallback(w=>g(w),[g]),onItemShiftTab:T.useCallback(()=>x(!0),[]),onFocusableItemAdd:T.useCallback(()=>k(w=>w+1),[]),onFocusableItemRemove:T.useCallback(()=>k(w=>w-1),[]),children:y.jsx(he.div,{tabIndex:C||E===0?-1:0,"data-orientation":n,...u,ref:f,style:{outline:"none",...t.style},onMouseDown:ie(t.onMouseDown,()=>{S.current=!0}),onFocus:ie(t.onFocus,w=>{const A=!S.current;if(w.target===w.currentTarget&&A&&!C){const _=new CustomEvent(ul,lk);if(w.currentTarget.dispatchEvent(_),!_.defaultPrevented){const I=b().filter(D=>D.focusable),M=I.find(D=>D.active),z=I.find(D=>D.id===m),H=[M,z,...I].filter(Boolean).map(D=>D.ref.current);Fm(H,d)}}S.current=!1}),onBlur:ie(t.onBlur,()=>x(!1))})})}),qm="RovingFocusGroupItem",Rm=T.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:a=!1,tabStopId:i,children:o,...s}=t,l=Yt(),c=i||l,d=pk(qm,r),u=d.currentTabStopId===c,p=jm(r),{onFocusableItemAdd:f,onFocusableItemRemove:v,currentTabStopId:m}=d;return T.useEffect(()=>{if(n)return f(),()=>v()},[n,f,v]),y.jsx(pl.ItemSlot,{scope:r,id:c,focusable:n,active:a,children:y.jsx(he.span,{tabIndex:u?0:-1,"data-orientation":d.orientation,...s,ref:e,onMouseDown:ie(t.onMouseDown,g=>{n?d.onItemFocus(c):g.preventDefault()}),onFocus:ie(t.onFocus,()=>d.onItemFocus(c)),onKeyDown:ie(t.onKeyDown,g=>{if(g.key==="Tab"&&g.shiftKey){d.onItemShiftTab();return}if(g.target!==g.currentTarget)return;const C=gk(g,d.orientation,d.dir);if(C!==void 0){if(g.metaKey||g.ctrlKey||g.altKey||g.shiftKey)return;g.preventDefault();let h=p().filter(b=>b.focusable).map(b=>b.ref.current);if(C==="last")h.reverse();else if(C==="prev"||C==="next"){C==="prev"&&h.reverse();const b=h.indexOf(g.currentTarget);h=d.loop?vk(h,b+1):h.slice(b+1)}setTimeout(()=>Fm(h))}}),children:typeof o=="function"?o({isCurrentTabStop:u,hasTabStop:m!=null}):o})})});Rm.displayName=qm;var mk={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function hk(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function gk(t,e,r){const n=hk(t.key,r);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return mk[n]}function Fm(t,e=!1){const r=document.activeElement;for(const n of t)if(n===r||(n.focus({preventScroll:e}),document.activeElement!==r))return}function vk(t,e){return t.map((r,n)=>t[(e+n)%t.length])}var yk=Bm,bk=Rm,Sk=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},er=new WeakMap,wn=new WeakMap,Cn={},fl=0,$m=function(t){return t&&(t.host||$m(t.parentNode))},xk=function(t,e){return e.map(function(r){if(t.contains(r))return r;var n=$m(r);return n&&t.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",t,". Doing nothing"),null)}).filter(function(r){return!!r})},wk=function(t,e,r,n){var a=xk(e,Array.isArray(t)?t:[t]);Cn[r]||(Cn[r]=new WeakMap);var i=Cn[r],o=[],s=new Set,l=new Set(a),c=function(u){!u||s.has(u)||(s.add(u),c(u.parentNode))};a.forEach(c);var d=function(u){!u||l.has(u)||Array.prototype.forEach.call(u.children,function(p){if(s.has(p))d(p);else try{var f=p.getAttribute(n),v=f!==null&&f!=="false",m=(er.get(p)||0)+1,g=(i.get(p)||0)+1;er.set(p,m),i.set(p,g),o.push(p),m===1&&v&&wn.set(p,!0),g===1&&p.setAttribute(r,"true"),v||p.setAttribute(n,"true")}catch(C){console.error("aria-hidden: cannot operate on ",p,C)}})};return d(e),s.clear(),fl++,function(){o.forEach(function(u){var p=er.get(u)-1,f=i.get(u)-1;er.set(u,p),i.set(u,f),p||(wn.has(u)||u.removeAttribute(n),wn.delete(u)),f||u.removeAttribute(r)}),fl--,fl||(er=new WeakMap,er=new WeakMap,wn=new WeakMap,Cn={})}},Gm=function(t,e,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(t)?t:[t]),a=Sk(t);return a?(n.push.apply(n,Array.from(a.querySelectorAll("[aria-live], script"))),wk(n,a,r,"aria-hidden")):function(){return null}},Je=function(){return Je=Object.assign||function(e){for(var r,n=1,a=arguments.length;n<a;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},Je.apply(this,arguments)};function Vm(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(t);a<n.length;a++)e.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(t,n[a])&&(r[n[a]]=t[n[a]]);return r}function Ck(t,e,r){if(r||arguments.length===2)for(var n=0,a=e.length,i;n<a;n++)(i||!(n in e))&&(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||Array.prototype.slice.call(e))}typeof SuppressedError=="function"&&SuppressedError;var kn="right-scroll-bar-position",En="width-before-scroll-bar",kk="with-scroll-bars-hidden",Ek="--removed-body-scroll-bar-size";function ml(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function Tk(t,e){var r=O.useState(function(){return{value:t,callback:e,facade:{get current(){return r.value},set current(n){var a=r.value;a!==n&&(r.value=n,r.callback(n,a))}}}})[0];return r.callback=e,r.facade}var Ak=typeof window<"u"?T.useLayoutEffect:T.useEffect,Hm=new WeakMap;function _k(t,e){var r=Tk(null,function(n){return t.forEach(function(a){return ml(a,n)})});return Ak(function(){var n=Hm.get(r);if(n){var a=new Set(n),i=new Set(t),o=r.current;a.forEach(function(s){i.has(s)||ml(s,null)}),i.forEach(function(s){a.has(s)||ml(s,o)})}Hm.set(r,t)},[t]),r}function Ok(t){return t}function Pk(t,e){e===void 0&&(e=Ok);var r=[],n=!1,a={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:t},useMedium:function(i){var o=e(i,n);return r.push(o),function(){r=r.filter(function(s){return s!==o})}},assignSyncMedium:function(i){for(n=!0;r.length;){var o=r;r=[],o.forEach(i)}r={push:function(s){return i(s)},filter:function(){return r}}},assignMedium:function(i){n=!0;var o=[];if(r.length){var s=r;r=[],s.forEach(i),o=r}var l=function(){var d=o;o=[],d.forEach(i)},c=function(){return Promise.resolve().then(l)};c(),r={push:function(d){o.push(d),c()},filter:function(d){return o=o.filter(d),r}}}};return a}function Ik(t){t===void 0&&(t={});var e=Pk(null);return e.options=Je({async:!0,ssr:!1},t),e}var Um=function(t){var e=t.sideCar,r=Vm(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=e.read();if(!n)throw new Error("Sidecar medium not found");return T.createElement(n,Je({},r))};Um.isSideCarExport=!0;function Nk(t,e){return t.useMedium(e),Um}var Km=Ik(),hl=function(){},Tn=T.forwardRef(function(t,e){var r=T.useRef(null),n=T.useState({onScrollCapture:hl,onWheelCapture:hl,onTouchMoveCapture:hl}),a=n[0],i=n[1],o=t.forwardProps,s=t.children,l=t.className,c=t.removeScrollBar,d=t.enabled,u=t.shards,p=t.sideCar,f=t.noRelative,v=t.noIsolation,m=t.inert,g=t.allowPinchZoom,C=t.as,x=C===void 0?"div":C,h=t.gapMode,b=Vm(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=p,E=_k([r,e]),k=Je(Je({},b),a);return T.createElement(T.Fragment,null,d&&T.createElement(S,{sideCar:Km,removeScrollBar:c,shards:u,noRelative:f,noIsolation:v,inert:m,setCallbacks:i,allowPinchZoom:!!g,lockRef:r,gapMode:h}),o?T.cloneElement(T.Children.only(s),Je(Je({},k),{ref:E})):T.createElement(x,Je({},k,{className:l,ref:E}),s))});Tn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Tn.classNames={fullWidth:En,zeroRight:kn};var Mk=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Dk(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=Mk();return e&&t.setAttribute("nonce",e),t}function zk(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function Lk(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var jk=function(){var t=0,e=null;return{add:function(r){t==0&&(e=Dk())&&(zk(e,r),Lk(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},Wk=function(){var t=jk();return function(e,r){T.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&r])}},Ym=function(){var t=Wk(),e=function(r){var n=r.styles,a=r.dynamic;return t(n,a),null};return e},Bk={left:0,top:0,right:0,gap:0},gl=function(t){return parseInt(t||"",10)||0},qk=function(t){var e=window.getComputedStyle(document.body),r=e[t==="padding"?"paddingLeft":"marginLeft"],n=e[t==="padding"?"paddingTop":"marginTop"],a=e[t==="padding"?"paddingRight":"marginRight"];return[gl(r),gl(n),gl(a)]},Rk=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return Bk;var e=qk(t),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,n-r+e[2]-e[0])}},Fk=Ym(),tr="data-scroll-locked",$k=function(t,e,r,n){var a=t.left,i=t.top,o=t.right,s=t.gap;return r===void 0&&(r="margin"),`
|
|
834
|
+
${d}`}const u=af(()=>{if(!i.current||!o.current){console.warn("Container or page content reference is missing.");return}if(n)return;a(!0),s.current.prepareRendering(i.current);const p=new Is,f=s.current.getStyleUrls(d,c?.page?.printCssUrl??"");try{p.preview(o.current?.innerHTML??"",f,i.current).then(()=>{a(!1),s.current.finalizeRendering(i.current)})}catch(v){console.error("Error during Paged.js preview rendering:",v),a(!1)}},500);return O.useEffect(()=>{u()},[t,r]),y.jsxs(sf,{config:c,children:[y.jsx("div",{className:[e??"",n?"rendering":"rendered",c?.page?.showBleed?"uhuu-bleed-visible":"",c?.page?.preview??""].filter(Boolean).join(" "),ref:i}),y.jsx("div",{className:"uhuu-reactive-content",style:{display:"none"},ref:o,children:t})]})},Qx=({children:t})=>y.jsx(y.Fragment,{children:t});class sn{static handlePageBreakStyles(){document?.querySelectorAll(".page-break-after[data-paged-css]").forEach(e=>{const r=e.closest("div.uhuu-page-sheet"),n=e.getAttribute("data-paged-css");r&&n&&n.split(" ").filter(Boolean).forEach(i=>r.classList.add(i))})}static handleUhuuDialogs(){const e=function(){const r=JSON.parse(this.getAttribute("data-uhuu")||"{}");$uhuu.editDialog(r)};document?.querySelectorAll("[data-uhuu]").forEach(r=>{r.removeEventListener("click",e),r.addEventListener("click",e)})}static handle(){sn.handlePageBreakStyles(),sn.handleUhuuDialogs()}}class lf{static setupPageStyles(e){if(!e||typeof document>"u")return;const r=document.createElement("link");return r.rel="stylesheet",r.href=e,document.head.appendChild(r),r}static removePageStyles(e){e&&typeof document<"u"&&document?.head.removeChild(e)}}const cf=({children:t,className:e,setup:r})=>{const n=of.pageParams("static",r);O.useEffect(()=>{n?.page?.compatibility&&sn.handle();const i=lf.setupPageStyles(n?.page?.printCssUrl);return()=>{i&&lf.removePageStyles(i)}},[r,n?.page?.compatibility,n?.page?.printCssUrl]);const a=[e,n?.page?.preview].filter(Boolean).join(" ");return y.jsx(sf,{config:n,children:y.jsx("div",{className:a,children:t})})},df=O.forwardRef(({children:t,className:e="",style:r,pageNo:n,overlay:a,showBleed:i,"data-page-key":o},s)=>{const l=O.useContext(Mt),c=i??l?.page?.showBleed??!1;return y.jsxs("div",{className:`uhuu-page-sheet ${e}`,style:r,ref:s,"data-page-key":o,children:[t,a&&a({pageNo:n}),c&&y.jsx("div",{className:"uhuu-bleed-area"})]})}),Kt=(t,e)=>{const r=t.dialog;return r?e?.page?.paginationType==="dynamic"?{"data-uhuu":JSON.stringify(r)}:{onClick:n=>{n.stopPropagation(),window.$uhuu?.editDialog(r)},"data-uhuu":""}:{}},Ns=t=>{const e=O.useContext(Mt),r=t.bleed??e?.page?.bleed??0,n=t.pageWidth??e?.page?.width??210,a=t.pageHeight??e?.page?.height??297,{src:i,backgroundColor:o,width:s,height:l,left:c=0,right:d=0,top:u=0,bottom:p=0}=t,[f,v]=O.useState("h-full w-full object-cover object-center"),m=A=>`${A}mm`,g=()=>{let A=l;return l||(A=a,u||(A+=r),p||(A+=r),(u||p)&&(A-=(u??0)+(p??0))),A},x=(()=>{let A=s;return s||(A=n,c||(A+=r),d||(A+=r),(c||d)&&(A-=(c??0)+(d??0))),A})(),h=g(),b=A=>A!==void 0?m(A):void 0,E=(A=>Object.fromEntries(Object.entries(A).filter(([_,I])=>I!==void 0)))({backgroundColor:o,width:b(x),height:b(h),left:b(c>0?c+r:c),right:b(d>0?d+r:d),top:b(u>0?u+r:u),bottom:b(p>0?p+r:p)}),k=h>0?x/h:x/(a-(u??0)-(p??0)),w=A=>{let I=A.target.naturalWidth/A.target.naturalHeight>k?"cover-vertical":"cover-horizontal";v(I)};return y.jsx("div",{className:"uhuu-image-container",style:E,...t.dataUhuu!==void 0?{"data-uhuu":t.dataUhuu}:{},children:y.jsxs("div",{className:"uhuu-image-inner",...Kt(t,e),children:[y.jsx("img",{className:f,src:i||null,onLoad:A=>w(A)},`${i}-${x}-${h}`),t.children]})})};const Jx=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ew=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,r,n)=>n?n.toUpperCase():r.toLowerCase()),uf=t=>{const e=ew(t);return e.charAt(0).toUpperCase()+e.slice(1)},pf=(...t)=>t.filter((e,r,n)=>!!e&&e.trim()!==""&&n.indexOf(e)===r).join(" ").trim(),tw=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};var rw={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const nw=O.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:a="",children:i,iconNode:o,...s},l)=>O.createElement("svg",{ref:l,...rw,width:e,height:e,stroke:t,strokeWidth:n?Number(r)*24/Number(e):r,className:pf("lucide",a),...!i&&!tw(s)&&{"aria-hidden":"true"},...s},[...o.map(([c,d])=>O.createElement(c,d)),...Array.isArray(i)?i:[i]]));const Se=(t,e)=>{const r=O.forwardRef(({className:n,...a},i)=>O.createElement(nw,{ref:i,iconNode:e,className:pf(`lucide-${Jx(uf(t))}`,`lucide-${t}`,n),...a}));return r.displayName=uf(t),r};const ff=Se("arrow-up-down",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]);const aw=Se("book-dashed",[["path",{d:"M12 17h1.5",key:"1gkc67"}],["path",{d:"M12 22h1.5",key:"1my7sn"}],["path",{d:"M12 2h1.5",key:"19tvb7"}],["path",{d:"M17.5 22H19a1 1 0 0 0 1-1",key:"10akbh"}],["path",{d:"M17.5 2H19a1 1 0 0 1 1 1v1.5",key:"1vrfjs"}],["path",{d:"M20 14v3h-2.5",key:"1naeju"}],["path",{d:"M20 8.5V10",key:"1ctpfu"}],["path",{d:"M4 10V8.5",key:"1o3zg5"}],["path",{d:"M4 19.5V14",key:"ob81pf"}],["path",{d:"M4 4.5A2.5 2.5 0 0 1 6.5 2H8",key:"s8vcyb"}],["path",{d:"M8 22H6.5a1 1 0 0 1 0-5H8",key:"1cu73q"}]]);const Ms=Se("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const iw=Se("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const ow=Se("clipboard-list",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]);const mf=Se("ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);const hf=Se("grip-vertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);const Ds=Se("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);const sw=Se("maximize",[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]]);const lw=Se("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);const it=Se("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const cw=Se("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);const dw=Se("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);const uw=Se("unfold-horizontal",[["path",{d:"M16 12h6",key:"15xry1"}],["path",{d:"M8 12H2",key:"1jqql6"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 8v2",key:"1woqiv"}],["path",{d:"M12 14v2",key:"8jcxud"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m19 15 3-3-3-3",key:"wjy7rq"}],["path",{d:"m5 9-3 3 3 3",key:"j64kie"}]]);const pw=Se("unfold-vertical",[["path",{d:"M12 22v-6",key:"6o8u61"}],["path",{d:"M12 8V2",key:"1wkif3"}],["path",{d:"M4 12H2",key:"rhcxmi"}],["path",{d:"M10 12H8",key:"s88cx1"}],["path",{d:"M16 12h-2",key:"10asgb"}],["path",{d:"M22 12h-2",key:"14jgyd"}],["path",{d:"m15 19-3 3-3-3",key:"11eu04"}],["path",{d:"m15 5-3-3-3 3",key:"itvq4r"}]]);const gf=Se("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);const fw=Se("zoom-in",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]);const mw=Se("zoom-out",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]),vf=T.createContext({portalContainer:null});function zs(){return T.useContext(vf)}function hw({children:t}){const[e,r]=T.useState(null);return T.useEffect(()=>{if(typeof document>"u")return;const n=document.createElement("div");return n.setAttribute("data-uhuu-portal",""),n.style.cssText="position: fixed; top: 0; left: 0; z-index: 9999;",document.body.appendChild(n),r(n),()=>{document.body.removeChild(n)}},[]),y.jsx(vf.Provider,{value:{portalContainer:e},children:t})}const yf=O.createContext({interactive:!0,setInteractive:()=>{},enableDevTools:!1});function Ls(){return O.useContext(yf)}function js(){const{interactive:t}=Ls();return!t}function gw({children:t,defaultInteractive:e=!0,enableDevTools:r=!1}){const a=!!(typeof window<"u"&&window?.$uhuu_renderer)?!1:e,[i,o]=O.useState(a);return y.jsx(yf.Provider,{value:{interactive:i,setInteractive:o,enableDevTools:r},children:y.jsx(hw,{children:y.jsx("div",{"data-uhuu-interactive":i?"":void 0,style:{display:"contents"},children:t})})})}function bf(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var a=t.length;for(e=0;e<a;e++)t[e]&&(r=bf(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function Sf(){for(var t,e,r=0,n="",a=arguments.length;r<a;r++)(t=arguments[r])&&(e=bf(t))&&(n&&(n+=" "),n+=e);return n}const xf=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,wf=Sf,Cf=(t,e)=>r=>{var n;if(e?.variants==null)return wf(t,r?.class,r?.className);const{variants:a,defaultVariants:i}=e,o=Object.keys(a).map(c=>{const d=r?.[c],u=i?.[c];if(d===null)return null;const p=xf(d)||xf(u);return a[c][p]}),s=r&&Object.entries(r).reduce((c,d)=>{let[u,p]=d;return p===void 0||(c[u]=p),c},{}),l=e==null||(n=e.compoundVariants)===null||n===void 0?void 0:n.reduce((c,d)=>{let{class:u,className:p,...f}=d;return Object.entries(f).every(v=>{let[m,g]=v;return Array.isArray(g)?g.includes({...i,...s}[m]):{...i,...s}[m]===g})?[...c,u,p]:c},[]);return wf(t,o,l,r?.class,r?.className)},vw=(t,e)=>{const r=new Array(t.length+e.length);for(let n=0;n<t.length;n++)r[n]=t[n];for(let n=0;n<e.length;n++)r[t.length+n]=e[n];return r},yw=(t,e)=>({classGroupId:t,validator:e}),kf=(t=new Map,e=null,r)=>({nextPart:t,validators:e,classGroupId:r}),ln="-",Ef=[],bw="arbitrary..",Sw=t=>{const e=ww(t),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=t;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return xw(o);const s=o.split(ln),l=s[0]===""&&s.length>1?1:0;return Tf(s,l,e)},getConflictingClassGroupIds:(o,s)=>{if(s){const l=n[o],c=r[o];return l?c?vw(c,l):l:c||Ef}return r[o]||Ef}}},Tf=(t,e,r)=>{if(t.length-e===0)return r.classGroupId;const a=t[e],i=r.nextPart.get(a);if(i){const c=Tf(t,e+1,i);if(c)return c}const o=r.validators;if(o===null)return;const s=e===0?t.join(ln):t.slice(e).join(ln),l=o.length;for(let c=0;c<l;c++){const d=o[c];if(d.validator(s))return d.classGroupId}},xw=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),r=e.indexOf(":"),n=e.slice(0,r);return n?bw+n:void 0})(),ww=t=>{const{theme:e,classGroups:r}=t;return Cw(r,e)},Cw=(t,e)=>{const r=kf();for(const n in t){const a=t[n];Ws(a,r,n,e)}return r},Ws=(t,e,r,n)=>{const a=t.length;for(let i=0;i<a;i++){const o=t[i];kw(o,e,r,n)}},kw=(t,e,r,n)=>{if(typeof t=="string"){Ew(t,e,r);return}if(typeof t=="function"){Tw(t,e,r,n);return}Aw(t,e,r,n)},Ew=(t,e,r)=>{const n=t===""?e:Af(e,t);n.classGroupId=r},Tw=(t,e,r,n)=>{if(_w(t)){Ws(t(n),e,r,n);return}e.validators===null&&(e.validators=[]),e.validators.push(yw(r,t))},Aw=(t,e,r,n)=>{const a=Object.entries(t),i=a.length;for(let o=0;o<i;o++){const[s,l]=a[o];Ws(l,Af(e,s),r,n)}},Af=(t,e)=>{let r=t;const n=e.split(ln),a=n.length;for(let i=0;i<a;i++){const o=n[i];let s=r.nextPart.get(o);s||(s=kf(),r.nextPart.set(o,s)),r=s}return r},_w=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,Ow=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,r=Object.create(null),n=Object.create(null);const a=(i,o)=>{r[i]=o,e++,e>t&&(e=0,n=r,r=Object.create(null))};return{get(i){let o=r[i];if(o!==void 0)return o;if((o=n[i])!==void 0)return a(i,o),o},set(i,o){i in r?r[i]=o:a(i,o)}}},Bs="!",_f=":",Pw=[],Of=(t,e,r,n,a)=>({modifiers:t,hasImportantModifier:e,baseClassName:r,maybePostfixModifierPosition:n,isExternal:a}),Iw=t=>{const{prefix:e,experimentalParseClassName:r}=t;let n=a=>{const i=[];let o=0,s=0,l=0,c;const d=a.length;for(let m=0;m<d;m++){const g=a[m];if(o===0&&s===0){if(g===_f){i.push(a.slice(l,m)),l=m+1;continue}if(g==="/"){c=m;continue}}g==="["?o++:g==="]"?o--:g==="("?s++:g===")"&&s--}const u=i.length===0?a:a.slice(l);let p=u,f=!1;u.endsWith(Bs)?(p=u.slice(0,-1),f=!0):u.startsWith(Bs)&&(p=u.slice(1),f=!0);const v=c&&c>l?c-l:void 0;return Of(i,f,p,v)};if(e){const a=e+_f,i=n;n=o=>o.startsWith(a)?i(o.slice(a.length)):Of(Pw,!1,o,void 0,!0)}if(r){const a=n;n=i=>r({className:i,parseClassName:a})}return n},Nw=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((r,n)=>{e.set(r,1e6+n)}),r=>{const n=[];let a=[];for(let i=0;i<r.length;i++){const o=r[i],s=o[0]==="[",l=e.has(o);s||l?(a.length>0&&(a.sort(),n.push(...a),a=[]),n.push(o)):a.push(o)}return a.length>0&&(a.sort(),n.push(...a)),n}},Mw=t=>({cache:Ow(t.cacheSize),parseClassName:Iw(t),sortModifiers:Nw(t),...Sw(t)}),Dw=/\s+/,zw=(t,e)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:a,sortModifiers:i}=e,o=[],s=t.trim().split(Dw);let l="";for(let c=s.length-1;c>=0;c-=1){const d=s[c],{isExternal:u,modifiers:p,hasImportantModifier:f,baseClassName:v,maybePostfixModifierPosition:m}=r(d);if(u){l=d+(l.length>0?" "+l:l);continue}let g=!!m,C=n(g?v.substring(0,m):v);if(!C){if(!g){l=d+(l.length>0?" "+l:l);continue}if(C=n(v),!C){l=d+(l.length>0?" "+l:l);continue}g=!1}const x=p.length===0?"":p.length===1?p[0]:i(p).join(":"),h=f?x+Bs:x,b=h+C;if(o.indexOf(b)>-1)continue;o.push(b);const S=a(C,g);for(let E=0;E<S.length;++E){const k=S[E];o.push(h+k)}l=d+(l.length>0?" "+l:l)}return l},Lw=(...t)=>{let e=0,r,n,a="";for(;e<t.length;)(r=t[e++])&&(n=Pf(r))&&(a&&(a+=" "),a+=n);return a},Pf=t=>{if(typeof t=="string")return t;let e,r="";for(let n=0;n<t.length;n++)t[n]&&(e=Pf(t[n]))&&(r&&(r+=" "),r+=e);return r},jw=(t,...e)=>{let r,n,a,i;const o=l=>{const c=e.reduce((d,u)=>u(d),t());return r=Mw(c),n=r.cache.get,a=r.cache.set,i=s,s(l)},s=l=>{const c=n(l);if(c)return c;const d=zw(l,r);return a(l,d),d};return i=o,(...l)=>i(Lw(...l))},Ww=[],ye=t=>{const e=r=>r[t]||Ww;return e.isThemeGetter=!0,e},If=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Nf=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Bw=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,qw=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Rw=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Fw=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,$w=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Gw=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ht=t=>Bw.test(t),ce=t=>!!t&&!Number.isNaN(Number(t)),gt=t=>!!t&&Number.isInteger(Number(t)),qs=t=>t.endsWith("%")&&ce(t.slice(0,-1)),ot=t=>qw.test(t),Mf=()=>!0,Vw=t=>Rw.test(t)&&!Fw.test(t),Rs=()=>!1,Hw=t=>$w.test(t),Uw=t=>Gw.test(t),Kw=t=>!Q(t)&&!ee(t),Yw=t=>vt(t,Bf,Rs),Q=t=>If.test(t),Dt=t=>vt(t,qf,Vw),Df=t=>vt(t,nC,ce),Xw=t=>vt(t,Ff,Mf),Zw=t=>vt(t,Rf,Rs),zf=t=>vt(t,jf,Rs),Qw=t=>vt(t,Wf,Uw),cn=t=>vt(t,$f,Hw),ee=t=>Nf.test(t),br=t=>zt(t,qf),Jw=t=>zt(t,Rf),Lf=t=>zt(t,jf),eC=t=>zt(t,Bf),tC=t=>zt(t,Wf),dn=t=>zt(t,$f,!0),rC=t=>zt(t,Ff,!0),vt=(t,e,r)=>{const n=If.exec(t);return n?n[1]?e(n[1]):r(n[2]):!1},zt=(t,e,r=!1)=>{const n=Nf.exec(t);return n?n[1]?e(n[1]):r:!1},jf=t=>t==="position"||t==="percentage",Wf=t=>t==="image"||t==="url",Bf=t=>t==="length"||t==="size"||t==="bg-size",qf=t=>t==="length",nC=t=>t==="number",Rf=t=>t==="family-name",Ff=t=>t==="number"||t==="weight",$f=t=>t==="shadow",aC=jw(()=>{const t=ye("color"),e=ye("font"),r=ye("text"),n=ye("font-weight"),a=ye("tracking"),i=ye("leading"),o=ye("breakpoint"),s=ye("container"),l=ye("spacing"),c=ye("radius"),d=ye("shadow"),u=ye("inset-shadow"),p=ye("text-shadow"),f=ye("drop-shadow"),v=ye("blur"),m=ye("perspective"),g=ye("aspect"),C=ye("ease"),x=ye("animate"),h=()=>["auto","avoid","all","avoid-page","page","left","right","column"],b=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],S=()=>[...b(),ee,Q],E=()=>["auto","hidden","clip","visible","scroll"],k=()=>["auto","contain","none"],w=()=>[ee,Q,l],A=()=>[ht,"full","auto",...w()],_=()=>[gt,"none","subgrid",ee,Q],I=()=>["auto",{span:["full",gt,ee,Q]},gt,ee,Q],M=()=>[gt,"auto",ee,Q],z=()=>["auto","min","max","fr",ee,Q],R=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],H=()=>["start","end","center","stretch","center-safe","end-safe"],D=()=>["auto",...w()],F=()=>[ht,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...w()],q=()=>[ht,"screen","full","dvw","lvw","svw","min","max","fit",...w()],P=()=>[ht,"screen","full","lh","dvh","lvh","svh","min","max","fit",...w()],j=()=>[t,ee,Q],Y=()=>[...b(),Lf,zf,{position:[ee,Q]}],X=()=>["no-repeat",{repeat:["","x","y","space","round"]}],W=()=>["auto","cover","contain",eC,Yw,{size:[ee,Q]}],L=()=>[qs,br,Dt],B=()=>["","none","full",c,ee,Q],V=()=>["",ce,br,Dt],U=()=>["solid","dashed","dotted","double"],se=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ae=()=>[ce,qs,Lf,zf],N=()=>["","none",v,ee,Q],$=()=>["none",ce,ee,Q],Z=()=>["none",ce,ee,Q],le=()=>[ce,ee,Q],oe=()=>[ht,"full",...w()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ot],breakpoint:[ot],color:[Mf],container:[ot],"drop-shadow":[ot],ease:["in","out","in-out"],font:[Kw],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ot],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ot],shadow:[ot],spacing:["px",ce],text:[ot],"text-shadow":[ot],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ht,Q,ee,g]}],container:["container"],columns:[{columns:[ce,Q,ee,s]}],"break-after":[{"break-after":h()}],"break-before":[{"break-before":h()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:S()}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:A()}],"inset-x":[{"inset-x":A()}],"inset-y":[{"inset-y":A()}],start:[{"inset-s":A(),start:A()}],end:[{"inset-e":A(),end:A()}],"inset-bs":[{"inset-bs":A()}],"inset-be":[{"inset-be":A()}],top:[{top:A()}],right:[{right:A()}],bottom:[{bottom:A()}],left:[{left:A()}],visibility:["visible","invisible","collapse"],z:[{z:[gt,"auto",ee,Q]}],basis:[{basis:[ht,"full","auto",s,...w()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ce,ht,"auto","initial","none",Q]}],grow:[{grow:["",ce,ee,Q]}],shrink:[{shrink:["",ce,ee,Q]}],order:[{order:[gt,"first","last","none",ee,Q]}],"grid-cols":[{"grid-cols":_()}],"col-start-end":[{col:I()}],"col-start":[{"col-start":M()}],"col-end":[{"col-end":M()}],"grid-rows":[{"grid-rows":_()}],"row-start-end":[{row:I()}],"row-start":[{"row-start":M()}],"row-end":[{"row-end":M()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":z()}],"auto-rows":[{"auto-rows":z()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...R(),"normal"]}],"justify-items":[{"justify-items":[...H(),"normal"]}],"justify-self":[{"justify-self":["auto",...H()]}],"align-content":[{content:["normal",...R()]}],"align-items":[{items:[...H(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...H(),{baseline:["","last"]}]}],"place-content":[{"place-content":R()}],"place-items":[{"place-items":[...H(),"baseline"]}],"place-self":[{"place-self":["auto",...H()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:D()}],mx:[{mx:D()}],my:[{my:D()}],ms:[{ms:D()}],me:[{me:D()}],mbs:[{mbs:D()}],mbe:[{mbe:D()}],mt:[{mt:D()}],mr:[{mr:D()}],mb:[{mb:D()}],ml:[{ml:D()}],"space-x":[{"space-x":w()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":w()}],"space-y-reverse":["space-y-reverse"],size:[{size:F()}],"inline-size":[{inline:["auto",...q()]}],"min-inline-size":[{"min-inline":["auto",...q()]}],"max-inline-size":[{"max-inline":["none",...q()]}],"block-size":[{block:["auto",...P()]}],"min-block-size":[{"min-block":["auto",...P()]}],"max-block-size":[{"max-block":["none",...P()]}],w:[{w:[s,"screen",...F()]}],"min-w":[{"min-w":[s,"screen","none",...F()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[o]},...F()]}],h:[{h:["screen","lh",...F()]}],"min-h":[{"min-h":["screen","lh","none",...F()]}],"max-h":[{"max-h":["screen","lh",...F()]}],"font-size":[{text:["base",r,br,Dt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,rC,Xw]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",qs,Q]}],"font-family":[{font:[Jw,Zw,e]}],"font-features":[{"font-features":[Q]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,ee,Q]}],"line-clamp":[{"line-clamp":[ce,"none",ee,Df]}],leading:[{leading:[i,...w()]}],"list-image":[{"list-image":["none",ee,Q]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ee,Q]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:j()}],"text-color":[{text:j()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...U(),"wavy"]}],"text-decoration-thickness":[{decoration:[ce,"from-font","auto",ee,Dt]}],"text-decoration-color":[{decoration:j()}],"underline-offset":[{"underline-offset":[ce,"auto",ee,Q]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:w()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ee,Q]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ee,Q]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Y()}],"bg-repeat":[{bg:X()}],"bg-size":[{bg:W()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},gt,ee,Q],radial:["",ee,Q],conic:[gt,ee,Q]},tC,Qw]}],"bg-color":[{bg:j()}],"gradient-from-pos":[{from:L()}],"gradient-via-pos":[{via:L()}],"gradient-to-pos":[{to:L()}],"gradient-from":[{from:j()}],"gradient-via":[{via:j()}],"gradient-to":[{to:j()}],rounded:[{rounded:B()}],"rounded-s":[{"rounded-s":B()}],"rounded-e":[{"rounded-e":B()}],"rounded-t":[{"rounded-t":B()}],"rounded-r":[{"rounded-r":B()}],"rounded-b":[{"rounded-b":B()}],"rounded-l":[{"rounded-l":B()}],"rounded-ss":[{"rounded-ss":B()}],"rounded-se":[{"rounded-se":B()}],"rounded-ee":[{"rounded-ee":B()}],"rounded-es":[{"rounded-es":B()}],"rounded-tl":[{"rounded-tl":B()}],"rounded-tr":[{"rounded-tr":B()}],"rounded-br":[{"rounded-br":B()}],"rounded-bl":[{"rounded-bl":B()}],"border-w":[{border:V()}],"border-w-x":[{"border-x":V()}],"border-w-y":[{"border-y":V()}],"border-w-s":[{"border-s":V()}],"border-w-e":[{"border-e":V()}],"border-w-bs":[{"border-bs":V()}],"border-w-be":[{"border-be":V()}],"border-w-t":[{"border-t":V()}],"border-w-r":[{"border-r":V()}],"border-w-b":[{"border-b":V()}],"border-w-l":[{"border-l":V()}],"divide-x":[{"divide-x":V()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":V()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...U(),"hidden","none"]}],"divide-style":[{divide:[...U(),"hidden","none"]}],"border-color":[{border:j()}],"border-color-x":[{"border-x":j()}],"border-color-y":[{"border-y":j()}],"border-color-s":[{"border-s":j()}],"border-color-e":[{"border-e":j()}],"border-color-bs":[{"border-bs":j()}],"border-color-be":[{"border-be":j()}],"border-color-t":[{"border-t":j()}],"border-color-r":[{"border-r":j()}],"border-color-b":[{"border-b":j()}],"border-color-l":[{"border-l":j()}],"divide-color":[{divide:j()}],"outline-style":[{outline:[...U(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ce,ee,Q]}],"outline-w":[{outline:["",ce,br,Dt]}],"outline-color":[{outline:j()}],shadow:[{shadow:["","none",d,dn,cn]}],"shadow-color":[{shadow:j()}],"inset-shadow":[{"inset-shadow":["none",u,dn,cn]}],"inset-shadow-color":[{"inset-shadow":j()}],"ring-w":[{ring:V()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:j()}],"ring-offset-w":[{"ring-offset":[ce,Dt]}],"ring-offset-color":[{"ring-offset":j()}],"inset-ring-w":[{"inset-ring":V()}],"inset-ring-color":[{"inset-ring":j()}],"text-shadow":[{"text-shadow":["none",p,dn,cn]}],"text-shadow-color":[{"text-shadow":j()}],opacity:[{opacity:[ce,ee,Q]}],"mix-blend":[{"mix-blend":[...se(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":se()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[ce]}],"mask-image-linear-from-pos":[{"mask-linear-from":ae()}],"mask-image-linear-to-pos":[{"mask-linear-to":ae()}],"mask-image-linear-from-color":[{"mask-linear-from":j()}],"mask-image-linear-to-color":[{"mask-linear-to":j()}],"mask-image-t-from-pos":[{"mask-t-from":ae()}],"mask-image-t-to-pos":[{"mask-t-to":ae()}],"mask-image-t-from-color":[{"mask-t-from":j()}],"mask-image-t-to-color":[{"mask-t-to":j()}],"mask-image-r-from-pos":[{"mask-r-from":ae()}],"mask-image-r-to-pos":[{"mask-r-to":ae()}],"mask-image-r-from-color":[{"mask-r-from":j()}],"mask-image-r-to-color":[{"mask-r-to":j()}],"mask-image-b-from-pos":[{"mask-b-from":ae()}],"mask-image-b-to-pos":[{"mask-b-to":ae()}],"mask-image-b-from-color":[{"mask-b-from":j()}],"mask-image-b-to-color":[{"mask-b-to":j()}],"mask-image-l-from-pos":[{"mask-l-from":ae()}],"mask-image-l-to-pos":[{"mask-l-to":ae()}],"mask-image-l-from-color":[{"mask-l-from":j()}],"mask-image-l-to-color":[{"mask-l-to":j()}],"mask-image-x-from-pos":[{"mask-x-from":ae()}],"mask-image-x-to-pos":[{"mask-x-to":ae()}],"mask-image-x-from-color":[{"mask-x-from":j()}],"mask-image-x-to-color":[{"mask-x-to":j()}],"mask-image-y-from-pos":[{"mask-y-from":ae()}],"mask-image-y-to-pos":[{"mask-y-to":ae()}],"mask-image-y-from-color":[{"mask-y-from":j()}],"mask-image-y-to-color":[{"mask-y-to":j()}],"mask-image-radial":[{"mask-radial":[ee,Q]}],"mask-image-radial-from-pos":[{"mask-radial-from":ae()}],"mask-image-radial-to-pos":[{"mask-radial-to":ae()}],"mask-image-radial-from-color":[{"mask-radial-from":j()}],"mask-image-radial-to-color":[{"mask-radial-to":j()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[ce]}],"mask-image-conic-from-pos":[{"mask-conic-from":ae()}],"mask-image-conic-to-pos":[{"mask-conic-to":ae()}],"mask-image-conic-from-color":[{"mask-conic-from":j()}],"mask-image-conic-to-color":[{"mask-conic-to":j()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Y()}],"mask-repeat":[{mask:X()}],"mask-size":[{mask:W()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ee,Q]}],filter:[{filter:["","none",ee,Q]}],blur:[{blur:N()}],brightness:[{brightness:[ce,ee,Q]}],contrast:[{contrast:[ce,ee,Q]}],"drop-shadow":[{"drop-shadow":["","none",f,dn,cn]}],"drop-shadow-color":[{"drop-shadow":j()}],grayscale:[{grayscale:["",ce,ee,Q]}],"hue-rotate":[{"hue-rotate":[ce,ee,Q]}],invert:[{invert:["",ce,ee,Q]}],saturate:[{saturate:[ce,ee,Q]}],sepia:[{sepia:["",ce,ee,Q]}],"backdrop-filter":[{"backdrop-filter":["","none",ee,Q]}],"backdrop-blur":[{"backdrop-blur":N()}],"backdrop-brightness":[{"backdrop-brightness":[ce,ee,Q]}],"backdrop-contrast":[{"backdrop-contrast":[ce,ee,Q]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ce,ee,Q]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ce,ee,Q]}],"backdrop-invert":[{"backdrop-invert":["",ce,ee,Q]}],"backdrop-opacity":[{"backdrop-opacity":[ce,ee,Q]}],"backdrop-saturate":[{"backdrop-saturate":[ce,ee,Q]}],"backdrop-sepia":[{"backdrop-sepia":["",ce,ee,Q]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ee,Q]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ce,"initial",ee,Q]}],ease:[{ease:["linear","initial",C,ee,Q]}],delay:[{delay:[ce,ee,Q]}],animate:[{animate:["none",x,ee,Q]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,ee,Q]}],"perspective-origin":[{"perspective-origin":S()}],rotate:[{rotate:$()}],"rotate-x":[{"rotate-x":$()}],"rotate-y":[{"rotate-y":$()}],"rotate-z":[{"rotate-z":$()}],scale:[{scale:Z()}],"scale-x":[{"scale-x":Z()}],"scale-y":[{"scale-y":Z()}],"scale-z":[{"scale-z":Z()}],"scale-3d":["scale-3d"],skew:[{skew:le()}],"skew-x":[{"skew-x":le()}],"skew-y":[{"skew-y":le()}],transform:[{transform:[ee,Q,"","none","gpu","cpu"]}],"transform-origin":[{origin:S()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:oe()}],"translate-x":[{"translate-x":oe()}],"translate-y":[{"translate-y":oe()}],"translate-z":[{"translate-z":oe()}],"translate-none":["translate-none"],accent:[{accent:j()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:j()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ee,Q]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ee,Q]}],fill:[{fill:["none",...j()]}],"stroke-w":[{stroke:[ce,br,Dt,Df]}],stroke:[{stroke:["none",...j()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function pe(...t){return aC(Sf(t))}const iC=Cf("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-gray-900 text-white hover:bg-gray-800",outline:"border border-gray-300 bg-white hover:bg-gray-50 text-gray-900",ghost:"hover:bg-gray-100 text-gray-900",secondary:"bg-gray-100 text-gray-900 hover:bg-gray-200"},size:{default:"h-10 px-4 py-2",sm:"h-9 px-3 text-sm",lg:"h-11 px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),Ae=T.forwardRef(({className:t,variant:e,size:r,...n},a)=>y.jsx("button",{className:pe(iC({variant:e,size:r,className:t})),ref:a,...n}));Ae.displayName="Button";function ie(t,e,{checkForDefaultPrevented:r=!0}={}){return function(a){if(t?.(a),r===!1||!a.defaultPrevented)return e?.(a)}}function Gf(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function Sr(...t){return e=>{let r=!1;const n=t.map(a=>{const i=Gf(a,e);return!r&&typeof i=="function"&&(r=!0),i});if(r)return()=>{for(let a=0;a<n.length;a++){const i=n[a];typeof i=="function"?i():Gf(t[a],null)}}}}function me(...t){return T.useCallback(Sr(...t),t)}function oC(t,e){const r=T.createContext(e),n=i=>{const{children:o,...s}=i,l=T.useMemo(()=>s,Object.values(s));return y.jsx(r.Provider,{value:l,children:o})};n.displayName=t+"Provider";function a(i){const o=T.useContext(r);if(o)return o;if(e!==void 0)return e;throw new Error(`\`${i}\` must be used within \`${t}\``)}return[n,a]}function st(t,e=[]){let r=[];function n(i,o){const s=T.createContext(o),l=r.length;r=[...r,o];const c=u=>{const{scope:p,children:f,...v}=u,m=p?.[t]?.[l]||s,g=T.useMemo(()=>v,Object.values(v));return y.jsx(m.Provider,{value:g,children:f})};c.displayName=i+"Provider";function d(u,p){const f=p?.[t]?.[l]||s,v=T.useContext(f);if(v)return v;if(o!==void 0)return o;throw new Error(`\`${u}\` must be used within \`${i}\``)}return[c,d]}const a=()=>{const i=r.map(o=>T.createContext(o));return function(s){const l=s?.[t]||i;return T.useMemo(()=>({[`__scope${t}`]:{...s,[t]:l}}),[s,l])}};return a.scopeName=t,[n,sC(a,...e)]}function sC(...t){const e=t[0];if(t.length===1)return e;const r=()=>{const n=t.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const o=n.reduce((s,{useScope:l,scopeName:c})=>{const u=l(i)[`__scope${c}`];return{...s,...u}},{});return T.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return r.scopeName=e.scopeName,r}var yt=globalThis?.document?T.useLayoutEffect:()=>{},lC=T[" useInsertionEffect ".trim().toString()]||yt;function xr({prop:t,defaultProp:e,onChange:r=()=>{},caller:n}){const[a,i,o]=cC({defaultProp:e,onChange:r}),s=t!==void 0,l=s?t:a;{const d=T.useRef(t!==void 0);T.useEffect(()=>{const u=d.current;u!==s&&console.warn(`${n} is changing from ${u?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=s},[s,n])}const c=T.useCallback(d=>{if(s){const u=dC(d)?d(t):d;u!==t&&o.current?.(u)}else i(d)},[s,t,i,o]);return[l,c]}function cC({defaultProp:t,onChange:e}){const[r,n]=T.useState(t),a=T.useRef(r),i=T.useRef(e);return lC(()=>{i.current=e},[e]),T.useEffect(()=>{a.current!==r&&(i.current?.(r),a.current=r)},[r,a]),[r,n,i]}function dC(t){return typeof t=="function"}function wr(t){const e=uC(t),r=T.forwardRef((n,a)=>{const{children:i,...o}=n,s=T.Children.toArray(i),l=s.find(fC);if(l){const c=l.props.children,d=s.map(u=>u===l?T.Children.count(c)>1?T.Children.only(null):T.isValidElement(c)?c.props.children:null:u);return y.jsx(e,{...o,ref:a,children:T.isValidElement(c)?T.cloneElement(c,void 0,d):null})}return y.jsx(e,{...o,ref:a,children:i})});return r.displayName=`${t}.Slot`,r}function uC(t){const e=T.forwardRef((r,n)=>{const{children:a,...i}=r;if(T.isValidElement(a)){const o=hC(a),s=mC(i,a.props);return a.type!==T.Fragment&&(s.ref=n?Sr(n,o):o),T.cloneElement(a,s)}return T.Children.count(a)>1?T.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var Vf=Symbol("radix.slottable");function pC(t){const e=({children:r})=>y.jsx(y.Fragment,{children:r});return e.displayName=`${t}.Slottable`,e.__radixId=Vf,e}function fC(t){return T.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===Vf}function mC(t,e){const r={...e};for(const n in e){const a=t[n],i=e[n];/^on[A-Z]/.test(n)?a&&i?r[n]=(...s)=>{const l=i(...s);return a(...s),l}:a&&(r[n]=a):n==="style"?r[n]={...a,...i}:n==="className"&&(r[n]=[a,i].filter(Boolean).join(" "))}return{...t,...r}}function hC(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}var gC=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],he=gC.reduce((t,e)=>{const r=wr(`Primitive.${e}`),n=T.forwardRef((a,i)=>{const{asChild:o,...s}=a,l=o?r:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),y.jsx(l,{...s,ref:i})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function Hf(t,e){t&&vc.flushSync(()=>t.dispatchEvent(e))}function Fs(t){const e=t+"CollectionProvider",[r,n]=st(e),[a,i]=r(e,{collectionRef:{current:null},itemMap:new Map}),o=m=>{const{scope:g,children:C}=m,x=O.useRef(null),h=O.useRef(new Map).current;return y.jsx(a,{scope:g,itemMap:h,collectionRef:x,children:C})};o.displayName=e;const s=t+"CollectionSlot",l=wr(s),c=O.forwardRef((m,g)=>{const{scope:C,children:x}=m,h=i(s,C),b=me(g,h.collectionRef);return y.jsx(l,{ref:b,children:x})});c.displayName=s;const d=t+"CollectionItemSlot",u="data-radix-collection-item",p=wr(d),f=O.forwardRef((m,g)=>{const{scope:C,children:x,...h}=m,b=O.useRef(null),S=me(g,b),E=i(d,C);return O.useEffect(()=>(E.itemMap.set(b,{ref:b,...h}),()=>{E.itemMap.delete(b)})),y.jsx(p,{[u]:"",ref:S,children:x})});f.displayName=d;function v(m){const g=i(t+"CollectionConsumer",m);return O.useCallback(()=>{const x=g.collectionRef.current;if(!x)return[];const h=Array.from(x.querySelectorAll(`[${u}]`));return Array.from(g.itemMap.values()).sort((E,k)=>h.indexOf(E.ref.current)-h.indexOf(k.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:o,Slot:c,ItemSlot:f},v,n]}var vC=T.createContext(void 0);function $s(t){const e=T.useContext(vC);return t||e||"ltr"}function lt(t){const e=T.useRef(t);return T.useEffect(()=>{e.current=t}),T.useMemo(()=>(...r)=>e.current?.(...r),[])}function yC(t,e=globalThis?.document){const r=lt(t);T.useEffect(()=>{const n=a=>{a.key==="Escape"&&r(a)};return e.addEventListener("keydown",n,{capture:!0}),()=>e.removeEventListener("keydown",n,{capture:!0})},[r,e])}var bC="DismissableLayer",Gs="dismissableLayer.update",SC="dismissableLayer.pointerDownOutside",xC="dismissableLayer.focusOutside",Uf,Kf=T.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Vs=T.forwardRef((t,e)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:o,onDismiss:s,...l}=t,c=T.useContext(Kf),[d,u]=T.useState(null),p=d?.ownerDocument??globalThis?.document,[,f]=T.useState({}),v=me(e,k=>u(k)),m=Array.from(c.layers),[g]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),C=m.indexOf(g),x=d?m.indexOf(d):-1,h=c.layersWithOutsidePointerEventsDisabled.size>0,b=x>=C,S=kC(k=>{const w=k.target,A=[...c.branches].some(_=>_.contains(w));!b||A||(a?.(k),o?.(k),k.defaultPrevented||s?.())},p),E=EC(k=>{const w=k.target;[...c.branches].some(_=>_.contains(w))||(i?.(k),o?.(k),k.defaultPrevented||s?.())},p);return yC(k=>{x===c.layers.size-1&&(n?.(k),!k.defaultPrevented&&s&&(k.preventDefault(),s()))},p),T.useEffect(()=>{if(d)return r&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Uf=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(d)),c.layers.add(d),Yf(),()=>{r&&c.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=Uf)}},[d,p,r,c]),T.useEffect(()=>()=>{d&&(c.layers.delete(d),c.layersWithOutsidePointerEventsDisabled.delete(d),Yf())},[d,c]),T.useEffect(()=>{const k=()=>f({});return document.addEventListener(Gs,k),()=>document.removeEventListener(Gs,k)},[]),y.jsx(he.div,{...l,ref:v,style:{pointerEvents:h?b?"auto":"none":void 0,...t.style},onFocusCapture:ie(t.onFocusCapture,E.onFocusCapture),onBlurCapture:ie(t.onBlurCapture,E.onBlurCapture),onPointerDownCapture:ie(t.onPointerDownCapture,S.onPointerDownCapture)})});Vs.displayName=bC;var wC="DismissableLayerBranch",CC=T.forwardRef((t,e)=>{const r=T.useContext(Kf),n=T.useRef(null),a=me(e,n);return T.useEffect(()=>{const i=n.current;if(i)return r.branches.add(i),()=>{r.branches.delete(i)}},[r.branches]),y.jsx(he.div,{...t,ref:a})});CC.displayName=wC;function kC(t,e=globalThis?.document){const r=lt(t),n=T.useRef(!1),a=T.useRef(()=>{});return T.useEffect(()=>{const i=s=>{if(s.target&&!n.current){let l=function(){Xf(SC,r,c,{discrete:!0})};const c={originalEvent:s};s.pointerType==="touch"?(e.removeEventListener("click",a.current),a.current=l,e.addEventListener("click",a.current,{once:!0})):l()}else e.removeEventListener("click",a.current);n.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",i),e.removeEventListener("click",a.current)}},[e,r]),{onPointerDownCapture:()=>n.current=!0}}function EC(t,e=globalThis?.document){const r=lt(t),n=T.useRef(!1);return T.useEffect(()=>{const a=i=>{i.target&&!n.current&&Xf(xC,r,{originalEvent:i},{discrete:!1})};return e.addEventListener("focusin",a),()=>e.removeEventListener("focusin",a)},[e,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function Yf(){const t=new CustomEvent(Gs);document.dispatchEvent(t)}function Xf(t,e,r,{discrete:n}){const a=r.originalEvent.target,i=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:r});e&&a.addEventListener(t,e,{once:!0}),n?Hf(a,i):a.dispatchEvent(i)}var Hs=0;function Zf(){T.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??Qf()),document.body.insertAdjacentElement("beforeend",t[1]??Qf()),Hs++,()=>{Hs===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Hs--}},[])}function Qf(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var Us="focusScope.autoFocusOnMount",Ks="focusScope.autoFocusOnUnmount",Jf={bubbles:!1,cancelable:!0},TC="FocusScope",Ys=T.forwardRef((t,e)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...o}=t,[s,l]=T.useState(null),c=lt(a),d=lt(i),u=T.useRef(null),p=me(e,m=>l(m)),f=T.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;T.useEffect(()=>{if(n){let m=function(h){if(f.paused||!s)return;const b=h.target;s.contains(b)?u.current=b:bt(u.current,{select:!0})},g=function(h){if(f.paused||!s)return;const b=h.relatedTarget;b!==null&&(s.contains(b)||bt(u.current,{select:!0}))},C=function(h){if(document.activeElement===document.body)for(const S of h)S.removedNodes.length>0&&bt(s)};document.addEventListener("focusin",m),document.addEventListener("focusout",g);const x=new MutationObserver(C);return s&&x.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",g),x.disconnect()}}},[n,s,f.paused]),T.useEffect(()=>{if(s){rm.add(f);const m=document.activeElement;if(!s.contains(m)){const C=new CustomEvent(Us,Jf);s.addEventListener(Us,c),s.dispatchEvent(C),C.defaultPrevented||(AC(NC(em(s)),{select:!0}),document.activeElement===m&&bt(s))}return()=>{s.removeEventListener(Us,c),setTimeout(()=>{const C=new CustomEvent(Ks,Jf);s.addEventListener(Ks,d),s.dispatchEvent(C),C.defaultPrevented||bt(m??document.body,{select:!0}),s.removeEventListener(Ks,d),rm.remove(f)},0)}}},[s,c,d,f]);const v=T.useCallback(m=>{if(!r&&!n||f.paused)return;const g=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,C=document.activeElement;if(g&&C){const x=m.currentTarget,[h,b]=_C(x);h&&b?!m.shiftKey&&C===b?(m.preventDefault(),r&&bt(h,{select:!0})):m.shiftKey&&C===h&&(m.preventDefault(),r&&bt(b,{select:!0})):C===x&&m.preventDefault()}},[r,n,f.paused]);return y.jsx(he.div,{tabIndex:-1,...o,ref:p,onKeyDown:v})});Ys.displayName=TC;function AC(t,{select:e=!1}={}){const r=document.activeElement;for(const n of t)if(bt(n,{select:e}),document.activeElement!==r)return}function _C(t){const e=em(t),r=tm(e,t),n=tm(e.reverse(),t);return[r,n]}function em(t){const e=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const a=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||a?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)e.push(r.currentNode);return e}function tm(t,e){for(const r of t)if(!OC(r,{upTo:e}))return r}function OC(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function PC(t){return t instanceof HTMLInputElement&&"select"in t}function bt(t,{select:e=!1}={}){if(t&&t.focus){const r=document.activeElement;t.focus({preventScroll:!0}),t!==r&&PC(t)&&e&&t.select()}}var rm=IC();function IC(){let t=[];return{add(e){const r=t[0];e!==r&&r?.pause(),t=nm(t,e),t.unshift(e)},remove(e){t=nm(t,e),t[0]?.resume()}}}function nm(t,e){const r=[...t],n=r.indexOf(e);return n!==-1&&r.splice(n,1),r}function NC(t){return t.filter(e=>e.tagName!=="A")}var MC=T[" useId ".trim().toString()]||(()=>{}),DC=0;function Yt(t){const[e,r]=T.useState(MC());return yt(()=>{r(n=>n??String(DC++))},[t]),e?`radix-${e}`:""}const zC=["top","right","bottom","left"],St=Math.min,ze=Math.max,un=Math.round,pn=Math.floor,Ye=t=>({x:t,y:t}),LC={left:"right",right:"left",bottom:"top",top:"bottom"},jC={start:"end",end:"start"};function Xs(t,e,r){return ze(t,St(e,r))}function ct(t,e){return typeof t=="function"?t(e):t}function dt(t){return t.split("-")[0]}function Xt(t){return t.split("-")[1]}function Zs(t){return t==="x"?"y":"x"}function Qs(t){return t==="y"?"height":"width"}const WC=new Set(["top","bottom"]);function Xe(t){return WC.has(dt(t))?"y":"x"}function Js(t){return Zs(Xe(t))}function BC(t,e,r){r===void 0&&(r=!1);const n=Xt(t),a=Js(t),i=Qs(a);let o=a==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(o=fn(o)),[o,fn(o)]}function qC(t){const e=fn(t);return[el(t),e,el(e)]}function el(t){return t.replace(/start|end/g,e=>jC[e])}const am=["left","right"],im=["right","left"],RC=["top","bottom"],FC=["bottom","top"];function $C(t,e,r){switch(t){case"top":case"bottom":return r?e?im:am:e?am:im;case"left":case"right":return e?RC:FC;default:return[]}}function GC(t,e,r,n){const a=Xt(t);let i=$C(dt(t),r==="start",n);return a&&(i=i.map(o=>o+"-"+a),e&&(i=i.concat(i.map(el)))),i}function fn(t){return t.replace(/left|right|bottom|top/g,e=>LC[e])}function VC(t){return{top:0,right:0,bottom:0,left:0,...t}}function om(t){return typeof t!="number"?VC(t):{top:t,right:t,bottom:t,left:t}}function mn(t){const{x:e,y:r,width:n,height:a}=t;return{width:n,height:a,top:r,left:e,right:e+n,bottom:r+a,x:e,y:r}}function sm(t,e,r){let{reference:n,floating:a}=t;const i=Xe(e),o=Js(e),s=Qs(o),l=dt(e),c=i==="y",d=n.x+n.width/2-a.width/2,u=n.y+n.height/2-a.height/2,p=n[s]/2-a[s]/2;let f;switch(l){case"top":f={x:d,y:n.y-a.height};break;case"bottom":f={x:d,y:n.y+n.height};break;case"right":f={x:n.x+n.width,y:u};break;case"left":f={x:n.x-a.width,y:u};break;default:f={x:n.x,y:n.y}}switch(Xt(e)){case"start":f[o]-=p*(r&&c?-1:1);break;case"end":f[o]+=p*(r&&c?-1:1);break}return f}async function HC(t,e){var r;e===void 0&&(e={});const{x:n,y:a,platform:i,rects:o,elements:s,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:p=!1,padding:f=0}=ct(e,t),v=om(f),g=s[p?u==="floating"?"reference":"floating":u],C=mn(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(g)))==null||r?g:g.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(s.floating)),boundary:c,rootBoundary:d,strategy:l})),x=u==="floating"?{x:n,y:a,width:o.floating.width,height:o.floating.height}:o.reference,h=await(i.getOffsetParent==null?void 0:i.getOffsetParent(s.floating)),b=await(i.isElement==null?void 0:i.isElement(h))?await(i.getScale==null?void 0:i.getScale(h))||{x:1,y:1}:{x:1,y:1},S=mn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:x,offsetParent:h,strategy:l}):x);return{top:(C.top-S.top+v.top)/b.y,bottom:(S.bottom-C.bottom+v.bottom)/b.y,left:(C.left-S.left+v.left)/b.x,right:(S.right-C.right+v.right)/b.x}}const UC=async(t,e,r)=>{const{placement:n="bottom",strategy:a="absolute",middleware:i=[],platform:o}=r,s=i.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(e));let c=await o.getElementRects({reference:t,floating:e,strategy:a}),{x:d,y:u}=sm(c,n,l),p=n,f={},v=0;for(let g=0;g<s.length;g++){var m;const{name:C,fn:x}=s[g],{x:h,y:b,data:S,reset:E}=await x({x:d,y:u,initialPlacement:n,placement:p,strategy:a,middlewareData:f,rects:c,platform:{...o,detectOverflow:(m=o.detectOverflow)!=null?m:HC},elements:{reference:t,floating:e}});d=h??d,u=b??u,f={...f,[C]:{...f[C],...S}},E&&v<=50&&(v++,typeof E=="object"&&(E.placement&&(p=E.placement),E.rects&&(c=E.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:a}):E.rects),{x:d,y:u}=sm(c,p,l)),g=-1)}return{x:d,y:u,placement:p,strategy:a,middlewareData:f}},KC=t=>({name:"arrow",options:t,async fn(e){const{x:r,y:n,placement:a,rects:i,platform:o,elements:s,middlewareData:l}=e,{element:c,padding:d=0}=ct(t,e)||{};if(c==null)return{};const u=om(d),p={x:r,y:n},f=Js(a),v=Qs(f),m=await o.getDimensions(c),g=f==="y",C=g?"top":"left",x=g?"bottom":"right",h=g?"clientHeight":"clientWidth",b=i.reference[v]+i.reference[f]-p[f]-i.floating[v],S=p[f]-i.reference[f],E=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c));let k=E?E[h]:0;(!k||!await(o.isElement==null?void 0:o.isElement(E)))&&(k=s.floating[h]||i.floating[v]);const w=b/2-S/2,A=k/2-m[v]/2-1,_=St(u[C],A),I=St(u[x],A),M=_,z=k-m[v]-I,R=k/2-m[v]/2+w,H=Xs(M,R,z),D=!l.arrow&&Xt(a)!=null&&R!==H&&i.reference[v]/2-(R<M?_:I)-m[v]/2<0,F=D?R<M?R-M:R-z:0;return{[f]:p[f]+F,data:{[f]:H,centerOffset:R-H-F,...D&&{alignmentOffset:F}},reset:D}}}),YC=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var r,n;const{placement:a,middlewareData:i,rects:o,initialPlacement:s,platform:l,elements:c}=e,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:m=!0,...g}=ct(t,e);if((r=i.arrow)!=null&&r.alignmentOffset)return{};const C=dt(a),x=Xe(s),h=dt(s)===s,b=await(l.isRTL==null?void 0:l.isRTL(c.floating)),S=p||(h||!m?[fn(s)]:qC(s)),E=v!=="none";!p&&E&&S.push(...GC(s,m,v,b));const k=[s,...S],w=await l.detectOverflow(e,g),A=[];let _=((n=i.flip)==null?void 0:n.overflows)||[];if(d&&A.push(w[C]),u){const R=BC(a,o,b);A.push(w[R[0]],w[R[1]])}if(_=[..._,{placement:a,overflows:A}],!A.every(R=>R<=0)){var I,M;const R=(((I=i.flip)==null?void 0:I.index)||0)+1,H=k[R];if(H&&(!(u==="alignment"?x!==Xe(H):!1)||_.every(q=>Xe(q.placement)===x?q.overflows[0]>0:!0)))return{data:{index:R,overflows:_},reset:{placement:H}};let D=(M=_.filter(F=>F.overflows[0]<=0).sort((F,q)=>F.overflows[1]-q.overflows[1])[0])==null?void 0:M.placement;if(!D)switch(f){case"bestFit":{var z;const F=(z=_.filter(q=>{if(E){const P=Xe(q.placement);return P===x||P==="y"}return!0}).map(q=>[q.placement,q.overflows.filter(P=>P>0).reduce((P,j)=>P+j,0)]).sort((q,P)=>q[1]-P[1])[0])==null?void 0:z[0];F&&(D=F);break}case"initialPlacement":D=s;break}if(a!==D)return{reset:{placement:D}}}return{}}}};function lm(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function cm(t){return zC.some(e=>t[e]>=0)}const XC=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:r,platform:n}=e,{strategy:a="referenceHidden",...i}=ct(t,e);switch(a){case"referenceHidden":{const o=await n.detectOverflow(e,{...i,elementContext:"reference"}),s=lm(o,r.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:cm(s)}}}case"escaped":{const o=await n.detectOverflow(e,{...i,altBoundary:!0}),s=lm(o,r.floating);return{data:{escapedOffsets:s,escaped:cm(s)}}}default:return{}}}}},dm=new Set(["left","top"]);async function ZC(t,e){const{placement:r,platform:n,elements:a}=t,i=await(n.isRTL==null?void 0:n.isRTL(a.floating)),o=dt(r),s=Xt(r),l=Xe(r)==="y",c=dm.has(o)?-1:1,d=i&&l?-1:1,u=ct(e,t);let{mainAxis:p,crossAxis:f,alignmentAxis:v}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return s&&typeof v=="number"&&(f=s==="end"?v*-1:v),l?{x:f*d,y:p*c}:{x:p*c,y:f*d}}const QC=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var r,n;const{x:a,y:i,placement:o,middlewareData:s}=e,l=await ZC(e,t);return o===((r=s.offset)==null?void 0:r.placement)&&(n=s.arrow)!=null&&n.alignmentOffset?{}:{x:a+l.x,y:i+l.y,data:{...l,placement:o}}}}},JC=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:r,y:n,placement:a,platform:i}=e,{mainAxis:o=!0,crossAxis:s=!1,limiter:l={fn:C=>{let{x,y:h}=C;return{x,y:h}}},...c}=ct(t,e),d={x:r,y:n},u=await i.detectOverflow(e,c),p=Xe(dt(a)),f=Zs(p);let v=d[f],m=d[p];if(o){const C=f==="y"?"top":"left",x=f==="y"?"bottom":"right",h=v+u[C],b=v-u[x];v=Xs(h,v,b)}if(s){const C=p==="y"?"top":"left",x=p==="y"?"bottom":"right",h=m+u[C],b=m-u[x];m=Xs(h,m,b)}const g=l.fn({...e,[f]:v,[p]:m});return{...g,data:{x:g.x-r,y:g.y-n,enabled:{[f]:o,[p]:s}}}}}},e0=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:r,y:n,placement:a,rects:i,middlewareData:o}=e,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=ct(t,e),d={x:r,y:n},u=Xe(a),p=Zs(u);let f=d[p],v=d[u];const m=ct(s,e),g=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const h=p==="y"?"height":"width",b=i.reference[p]-i.floating[h]+g.mainAxis,S=i.reference[p]+i.reference[h]-g.mainAxis;f<b?f=b:f>S&&(f=S)}if(c){var C,x;const h=p==="y"?"width":"height",b=dm.has(dt(a)),S=i.reference[u]-i.floating[h]+(b&&((C=o.offset)==null?void 0:C[u])||0)+(b?0:g.crossAxis),E=i.reference[u]+i.reference[h]+(b?0:((x=o.offset)==null?void 0:x[u])||0)-(b?g.crossAxis:0);v<S?v=S:v>E&&(v=E)}return{[p]:f,[u]:v}}}},t0=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var r,n;const{placement:a,rects:i,platform:o,elements:s}=e,{apply:l=()=>{},...c}=ct(t,e),d=await o.detectOverflow(e,c),u=dt(a),p=Xt(a),f=Xe(a)==="y",{width:v,height:m}=i.floating;let g,C;u==="top"||u==="bottom"?(g=u,C=p===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?"start":"end")?"left":"right"):(C=u,g=p==="end"?"top":"bottom");const x=m-d.top-d.bottom,h=v-d.left-d.right,b=St(m-d[g],x),S=St(v-d[C],h),E=!e.middlewareData.shift;let k=b,w=S;if((r=e.middlewareData.shift)!=null&&r.enabled.x&&(w=h),(n=e.middlewareData.shift)!=null&&n.enabled.y&&(k=x),E&&!p){const _=ze(d.left,0),I=ze(d.right,0),M=ze(d.top,0),z=ze(d.bottom,0);f?w=v-2*(_!==0||I!==0?_+I:ze(d.left,d.right)):k=m-2*(M!==0||z!==0?M+z:ze(d.top,d.bottom))}await l({...e,availableWidth:w,availableHeight:k});const A=await o.getDimensions(s.floating);return v!==A.width||m!==A.height?{reset:{rects:!0}}:{}}}};function hn(){return typeof window<"u"}function Zt(t){return um(t)?(t.nodeName||"").toLowerCase():"#document"}function Le(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Ze(t){var e;return(e=(um(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function um(t){return hn()?t instanceof Node||t instanceof Le(t).Node:!1}function Ge(t){return hn()?t instanceof Element||t instanceof Le(t).Element:!1}function Qe(t){return hn()?t instanceof HTMLElement||t instanceof Le(t).HTMLElement:!1}function pm(t){return!hn()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Le(t).ShadowRoot}const r0=new Set(["inline","contents"]);function Cr(t){const{overflow:e,overflowX:r,overflowY:n,display:a}=Ve(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+r)&&!r0.has(a)}const n0=new Set(["table","td","th"]);function a0(t){return n0.has(Zt(t))}const i0=[":popover-open",":modal"];function gn(t){return i0.some(e=>{try{return t.matches(e)}catch{return!1}})}const o0=["transform","translate","scale","rotate","perspective"],s0=["transform","translate","scale","rotate","perspective","filter"],l0=["paint","layout","strict","content"];function tl(t){const e=rl(),r=Ge(t)?Ve(t):t;return o0.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!e&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!e&&(r.filter?r.filter!=="none":!1)||s0.some(n=>(r.willChange||"").includes(n))||l0.some(n=>(r.contain||"").includes(n))}function c0(t){let e=xt(t);for(;Qe(e)&&!Qt(e);){if(tl(e))return e;if(gn(e))return null;e=xt(e)}return null}function rl(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const d0=new Set(["html","body","#document"]);function Qt(t){return d0.has(Zt(t))}function Ve(t){return Le(t).getComputedStyle(t)}function vn(t){return Ge(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function xt(t){if(Zt(t)==="html")return t;const e=t.assignedSlot||t.parentNode||pm(t)&&t.host||Ze(t);return pm(e)?e.host:e}function fm(t){const e=xt(t);return Qt(e)?t.ownerDocument?t.ownerDocument.body:t.body:Qe(e)&&Cr(e)?e:fm(e)}function kr(t,e,r){var n;e===void 0&&(e=[]),r===void 0&&(r=!0);const a=fm(t),i=a===((n=t.ownerDocument)==null?void 0:n.body),o=Le(a);if(i){const s=nl(o);return e.concat(o,o.visualViewport||[],Cr(a)?a:[],s&&r?kr(s):[])}return e.concat(a,kr(a,[],r))}function nl(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function mm(t){const e=Ve(t);let r=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const a=Qe(t),i=a?t.offsetWidth:r,o=a?t.offsetHeight:n,s=un(r)!==i||un(n)!==o;return s&&(r=i,n=o),{width:r,height:n,$:s}}function al(t){return Ge(t)?t:t.contextElement}function Jt(t){const e=al(t);if(!Qe(e))return Ye(1);const r=e.getBoundingClientRect(),{width:n,height:a,$:i}=mm(e);let o=(i?un(r.width):r.width)/n,s=(i?un(r.height):r.height)/a;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}const u0=Ye(0);function hm(t){const e=Le(t);return!rl()||!e.visualViewport?u0:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function p0(t,e,r){return e===void 0&&(e=!1),!r||e&&r!==Le(t)?!1:e}function Lt(t,e,r,n){e===void 0&&(e=!1),r===void 0&&(r=!1);const a=t.getBoundingClientRect(),i=al(t);let o=Ye(1);e&&(n?Ge(n)&&(o=Jt(n)):o=Jt(t));const s=p0(i,r,n)?hm(i):Ye(0);let l=(a.left+s.x)/o.x,c=(a.top+s.y)/o.y,d=a.width/o.x,u=a.height/o.y;if(i){const p=Le(i),f=n&&Ge(n)?Le(n):n;let v=p,m=nl(v);for(;m&&n&&f!==v;){const g=Jt(m),C=m.getBoundingClientRect(),x=Ve(m),h=C.left+(m.clientLeft+parseFloat(x.paddingLeft))*g.x,b=C.top+(m.clientTop+parseFloat(x.paddingTop))*g.y;l*=g.x,c*=g.y,d*=g.x,u*=g.y,l+=h,c+=b,v=Le(m),m=nl(v)}}return mn({width:d,height:u,x:l,y:c})}function yn(t,e){const r=vn(t).scrollLeft;return e?e.left+r:Lt(Ze(t)).left+r}function gm(t,e){const r=t.getBoundingClientRect(),n=r.left+e.scrollLeft-yn(t,r),a=r.top+e.scrollTop;return{x:n,y:a}}function f0(t){let{elements:e,rect:r,offsetParent:n,strategy:a}=t;const i=a==="fixed",o=Ze(n),s=e?gn(e.floating):!1;if(n===o||s&&i)return r;let l={scrollLeft:0,scrollTop:0},c=Ye(1);const d=Ye(0),u=Qe(n);if((u||!u&&!i)&&((Zt(n)!=="body"||Cr(o))&&(l=vn(n)),Qe(n))){const f=Lt(n);c=Jt(n),d.x=f.x+n.clientLeft,d.y=f.y+n.clientTop}const p=o&&!u&&!i?gm(o,l):Ye(0);return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-l.scrollLeft*c.x+d.x+p.x,y:r.y*c.y-l.scrollTop*c.y+d.y+p.y}}function m0(t){return Array.from(t.getClientRects())}function h0(t){const e=Ze(t),r=vn(t),n=t.ownerDocument.body,a=ze(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=ze(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let o=-r.scrollLeft+yn(t);const s=-r.scrollTop;return Ve(n).direction==="rtl"&&(o+=ze(e.clientWidth,n.clientWidth)-a),{width:a,height:i,x:o,y:s}}const vm=25;function g0(t,e){const r=Le(t),n=Ze(t),a=r.visualViewport;let i=n.clientWidth,o=n.clientHeight,s=0,l=0;if(a){i=a.width,o=a.height;const d=rl();(!d||d&&e==="fixed")&&(s=a.offsetLeft,l=a.offsetTop)}const c=yn(n);if(c<=0){const d=n.ownerDocument,u=d.body,p=getComputedStyle(u),f=d.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,v=Math.abs(n.clientWidth-u.clientWidth-f);v<=vm&&(i-=v)}else c<=vm&&(i+=c);return{width:i,height:o,x:s,y:l}}const v0=new Set(["absolute","fixed"]);function y0(t,e){const r=Lt(t,!0,e==="fixed"),n=r.top+t.clientTop,a=r.left+t.clientLeft,i=Qe(t)?Jt(t):Ye(1),o=t.clientWidth*i.x,s=t.clientHeight*i.y,l=a*i.x,c=n*i.y;return{width:o,height:s,x:l,y:c}}function ym(t,e,r){let n;if(e==="viewport")n=g0(t,r);else if(e==="document")n=h0(Ze(t));else if(Ge(e))n=y0(e,r);else{const a=hm(t);n={x:e.x-a.x,y:e.y-a.y,width:e.width,height:e.height}}return mn(n)}function bm(t,e){const r=xt(t);return r===e||!Ge(r)||Qt(r)?!1:Ve(r).position==="fixed"||bm(r,e)}function b0(t,e){const r=e.get(t);if(r)return r;let n=kr(t,[],!1).filter(s=>Ge(s)&&Zt(s)!=="body"),a=null;const i=Ve(t).position==="fixed";let o=i?xt(t):t;for(;Ge(o)&&!Qt(o);){const s=Ve(o),l=tl(o);!l&&s.position==="fixed"&&(a=null),(i?!l&&!a:!l&&s.position==="static"&&!!a&&v0.has(a.position)||Cr(o)&&!l&&bm(t,o))?n=n.filter(d=>d!==o):a=s,o=xt(o)}return e.set(t,n),n}function S0(t){let{element:e,boundary:r,rootBoundary:n,strategy:a}=t;const o=[...r==="clippingAncestors"?gn(e)?[]:b0(e,this._c):[].concat(r),n],s=o[0],l=o.reduce((c,d)=>{const u=ym(e,d,a);return c.top=ze(u.top,c.top),c.right=St(u.right,c.right),c.bottom=St(u.bottom,c.bottom),c.left=ze(u.left,c.left),c},ym(e,s,a));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function x0(t){const{width:e,height:r}=mm(t);return{width:e,height:r}}function w0(t,e,r){const n=Qe(e),a=Ze(e),i=r==="fixed",o=Lt(t,!0,i,e);let s={scrollLeft:0,scrollTop:0};const l=Ye(0);function c(){l.x=yn(a)}if(n||!n&&!i)if((Zt(e)!=="body"||Cr(a))&&(s=vn(e)),n){const f=Lt(e,!0,i,e);l.x=f.x+e.clientLeft,l.y=f.y+e.clientTop}else a&&c();i&&!n&&a&&c();const d=a&&!n&&!i?gm(a,s):Ye(0),u=o.left+s.scrollLeft-l.x-d.x,p=o.top+s.scrollTop-l.y-d.y;return{x:u,y:p,width:o.width,height:o.height}}function il(t){return Ve(t).position==="static"}function Sm(t,e){if(!Qe(t)||Ve(t).position==="fixed")return null;if(e)return e(t);let r=t.offsetParent;return Ze(t)===r&&(r=r.ownerDocument.body),r}function xm(t,e){const r=Le(t);if(gn(t))return r;if(!Qe(t)){let a=xt(t);for(;a&&!Qt(a);){if(Ge(a)&&!il(a))return a;a=xt(a)}return r}let n=Sm(t,e);for(;n&&a0(n)&&il(n);)n=Sm(n,e);return n&&Qt(n)&&il(n)&&!tl(n)?r:n||c0(t)||r}const C0=async function(t){const e=this.getOffsetParent||xm,r=this.getDimensions,n=await r(t.floating);return{reference:w0(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function k0(t){return Ve(t).direction==="rtl"}const E0={convertOffsetParentRelativeRectToViewportRelativeRect:f0,getDocumentElement:Ze,getClippingRect:S0,getOffsetParent:xm,getElementRects:C0,getClientRects:m0,getDimensions:x0,getScale:Jt,isElement:Ge,isRTL:k0};function wm(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function T0(t,e){let r=null,n;const a=Ze(t);function i(){var s;clearTimeout(n),(s=r)==null||s.disconnect(),r=null}function o(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),i();const c=t.getBoundingClientRect(),{left:d,top:u,width:p,height:f}=c;if(s||e(),!p||!f)return;const v=pn(u),m=pn(a.clientWidth-(d+p)),g=pn(a.clientHeight-(u+f)),C=pn(d),h={rootMargin:-v+"px "+-m+"px "+-g+"px "+-C+"px",threshold:ze(0,St(1,l))||1};let b=!0;function S(E){const k=E[0].intersectionRatio;if(k!==l){if(!b)return o();k?o(!1,k):n=setTimeout(()=>{o(!1,1e-7)},1e3)}k===1&&!wm(c,t.getBoundingClientRect())&&o(),b=!1}try{r=new IntersectionObserver(S,{...h,root:a.ownerDocument})}catch{r=new IntersectionObserver(S,h)}r.observe(t)}return o(!0),i}function A0(t,e,r,n){n===void 0&&(n={});const{ancestorScroll:a=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,c=al(t),d=a||i?[...c?kr(c):[],...kr(e)]:[];d.forEach(C=>{a&&C.addEventListener("scroll",r,{passive:!0}),i&&C.addEventListener("resize",r)});const u=c&&s?T0(c,r):null;let p=-1,f=null;o&&(f=new ResizeObserver(C=>{let[x]=C;x&&x.target===c&&f&&(f.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var h;(h=f)==null||h.observe(e)})),r()}),c&&!l&&f.observe(c),f.observe(e));let v,m=l?Lt(t):null;l&&g();function g(){const C=Lt(t);m&&!wm(m,C)&&r(),m=C,v=requestAnimationFrame(g)}return r(),()=>{var C;d.forEach(x=>{a&&x.removeEventListener("scroll",r),i&&x.removeEventListener("resize",r)}),u?.(),(C=f)==null||C.disconnect(),f=null,l&&cancelAnimationFrame(v)}}const _0=QC,O0=JC,P0=YC,I0=t0,N0=XC,Cm=KC,M0=e0,D0=(t,e,r)=>{const n=new Map,a={platform:E0,...r},i={...a.platform,_c:n};return UC(t,e,{...a,platform:i})};var z0=typeof document<"u",L0=function(){},bn=z0?O.useLayoutEffect:L0;function Sn(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let r,n,a;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(r=t.length,r!==e.length)return!1;for(n=r;n--!==0;)if(!Sn(t[n],e[n]))return!1;return!0}if(a=Object.keys(t),r=a.length,r!==Object.keys(e).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(e,a[n]))return!1;for(n=r;n--!==0;){const i=a[n];if(!(i==="_owner"&&t.$$typeof)&&!Sn(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function km(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Em(t,e){const r=km(t);return Math.round(e*r)/r}function ol(t){const e=T.useRef(t);return bn(()=>{e.current=t}),e}function j0(t){t===void 0&&(t={});const{placement:e="bottom",strategy:r="absolute",middleware:n=[],platform:a,elements:{reference:i,floating:o}={},transform:s=!0,whileElementsMounted:l,open:c}=t,[d,u]=T.useState({x:0,y:0,strategy:r,placement:e,middlewareData:{},isPositioned:!1}),[p,f]=T.useState(n);Sn(p,n)||f(n);const[v,m]=T.useState(null),[g,C]=T.useState(null),x=T.useCallback(q=>{q!==E.current&&(E.current=q,m(q))},[]),h=T.useCallback(q=>{q!==k.current&&(k.current=q,C(q))},[]),b=i||v,S=o||g,E=T.useRef(null),k=T.useRef(null),w=T.useRef(d),A=l!=null,_=ol(l),I=ol(a),M=ol(c),z=T.useCallback(()=>{if(!E.current||!k.current)return;const q={placement:e,strategy:r,middleware:p};I.current&&(q.platform=I.current),D0(E.current,k.current,q).then(P=>{const j={...P,isPositioned:M.current!==!1};R.current&&!Sn(w.current,j)&&(w.current=j,vc.flushSync(()=>{u(j)}))})},[p,e,r,I,M]);bn(()=>{c===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,u(q=>({...q,isPositioned:!1})))},[c]);const R=T.useRef(!1);bn(()=>(R.current=!0,()=>{R.current=!1}),[]),bn(()=>{if(b&&(E.current=b),S&&(k.current=S),b&&S){if(_.current)return _.current(b,S,z);z()}},[b,S,z,_,A]);const H=T.useMemo(()=>({reference:E,floating:k,setReference:x,setFloating:h}),[x,h]),D=T.useMemo(()=>({reference:b,floating:S}),[b,S]),F=T.useMemo(()=>{const q={position:r,left:0,top:0};if(!D.floating)return q;const P=Em(D.floating,d.x),j=Em(D.floating,d.y);return s?{...q,transform:"translate("+P+"px, "+j+"px)",...km(D.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:P,top:j}},[r,s,D.floating,d.x,d.y]);return T.useMemo(()=>({...d,update:z,refs:H,elements:D,floatingStyles:F}),[d,z,H,D,F])}const W0=t=>{function e(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:t,fn(r){const{element:n,padding:a}=typeof t=="function"?t(r):t;return n&&e(n)?n.current!=null?Cm({element:n.current,padding:a}).fn(r):{}:n?Cm({element:n,padding:a}).fn(r):{}}}},B0=(t,e)=>({..._0(t),options:[t,e]}),q0=(t,e)=>({...O0(t),options:[t,e]}),R0=(t,e)=>({...M0(t),options:[t,e]}),F0=(t,e)=>({...P0(t),options:[t,e]}),$0=(t,e)=>({...I0(t),options:[t,e]}),G0=(t,e)=>({...N0(t),options:[t,e]}),V0=(t,e)=>({...W0(t),options:[t,e]});var H0="Arrow",Tm=T.forwardRef((t,e)=>{const{children:r,width:n=10,height:a=5,...i}=t;return y.jsx(he.svg,{...i,ref:e,width:n,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?r:y.jsx("polygon",{points:"0,0 30,0 15,10"})})});Tm.displayName=H0;var U0=Tm;function sl(t){const[e,r]=T.useState(void 0);return yt(()=>{if(t){r({width:t.offsetWidth,height:t.offsetHeight});const n=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const i=a[0];let o,s;if("borderBoxSize"in i){const l=i.borderBoxSize,c=Array.isArray(l)?l[0]:l;o=c.inlineSize,s=c.blockSize}else o=t.offsetWidth,s=t.offsetHeight;r({width:o,height:s})});return n.observe(t,{box:"border-box"}),()=>n.unobserve(t)}else r(void 0)},[t]),e}var ll="Popper",[Am,_m]=st(ll),[K0,Om]=Am(ll),Pm=t=>{const{__scopePopper:e,children:r}=t,[n,a]=T.useState(null);return y.jsx(K0,{scope:e,anchor:n,onAnchorChange:a,children:r})};Pm.displayName=ll;var Im="PopperAnchor",Nm=T.forwardRef((t,e)=>{const{__scopePopper:r,virtualRef:n,...a}=t,i=Om(Im,r),o=T.useRef(null),s=me(e,o),l=T.useRef(null);return T.useEffect(()=>{const c=l.current;l.current=n?.current||o.current,c!==l.current&&i.onAnchorChange(l.current)}),n?null:y.jsx(he.div,{...a,ref:s})});Nm.displayName=Im;var cl="PopperContent",[Y0,X0]=Am(cl),Mm=T.forwardRef((t,e)=>{const{__scopePopper:r,side:n="bottom",sideOffset:a=0,align:i="center",alignOffset:o=0,arrowPadding:s=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:d=0,sticky:u="partial",hideWhenDetached:p=!1,updatePositionStrategy:f="optimized",onPlaced:v,...m}=t,g=Om(cl,r),[C,x]=T.useState(null),h=me(e,U=>x(U)),[b,S]=T.useState(null),E=sl(b),k=E?.width??0,w=E?.height??0,A=n+(i!=="center"?"-"+i:""),_=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},I=Array.isArray(c)?c:[c],M=I.length>0,z={padding:_,boundary:I.filter(Q0),altBoundary:M},{refs:R,floatingStyles:H,placement:D,isPositioned:F,middlewareData:q}=j0({strategy:"fixed",placement:A,whileElementsMounted:(...U)=>A0(...U,{animationFrame:f==="always"}),elements:{reference:g.anchor},middleware:[B0({mainAxis:a+w,alignmentAxis:o}),l&&q0({mainAxis:!0,crossAxis:!1,limiter:u==="partial"?R0():void 0,...z}),l&&F0({...z}),$0({...z,apply:({elements:U,rects:se,availableWidth:ae,availableHeight:N})=>{const{width:$,height:Z}=se.reference,le=U.floating.style;le.setProperty("--radix-popper-available-width",`${ae}px`),le.setProperty("--radix-popper-available-height",`${N}px`),le.setProperty("--radix-popper-anchor-width",`${$}px`),le.setProperty("--radix-popper-anchor-height",`${Z}px`)}}),b&&V0({element:b,padding:s}),J0({arrowWidth:k,arrowHeight:w}),p&&G0({strategy:"referenceHidden",...z})]}),[P,j]=Lm(D),Y=lt(v);yt(()=>{F&&Y?.()},[F,Y]);const X=q.arrow?.x,W=q.arrow?.y,L=q.arrow?.centerOffset!==0,[B,V]=T.useState();return yt(()=>{C&&V(window.getComputedStyle(C).zIndex)},[C]),y.jsx("div",{ref:R.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:F?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:B,"--radix-popper-transform-origin":[q.transformOrigin?.x,q.transformOrigin?.y].join(" "),...q.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:y.jsx(Y0,{scope:r,placedSide:P,onArrowChange:S,arrowX:X,arrowY:W,shouldHideArrow:L,children:y.jsx(he.div,{"data-side":P,"data-align":j,...m,ref:h,style:{...m.style,animation:F?void 0:"none"}})})})});Mm.displayName=cl;var Dm="PopperArrow",Z0={top:"bottom",right:"left",bottom:"top",left:"right"},zm=T.forwardRef(function(e,r){const{__scopePopper:n,...a}=e,i=X0(Dm,n),o=Z0[i.placedSide];return y.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:y.jsx(U0,{...a,ref:r,style:{...a.style,display:"block"}})})});zm.displayName=Dm;function Q0(t){return t!==null}var J0=t=>({name:"transformOrigin",options:t,fn(e){const{placement:r,rects:n,middlewareData:a}=e,o=a.arrow?.centerOffset!==0,s=o?0:t.arrowWidth,l=o?0:t.arrowHeight,[c,d]=Lm(r),u={start:"0%",center:"50%",end:"100%"}[d],p=(a.arrow?.x??0)+s/2,f=(a.arrow?.y??0)+l/2;let v="",m="";return c==="bottom"?(v=o?u:`${p}px`,m=`${-l}px`):c==="top"?(v=o?u:`${p}px`,m=`${n.floating.height+l}px`):c==="right"?(v=`${-l}px`,m=o?u:`${f}px`):c==="left"&&(v=`${n.floating.width+l}px`,m=o?u:`${f}px`),{data:{x:v,y:m}}}});function Lm(t){const[e,r="center"]=t.split("-");return[e,r]}var ek=Pm,tk=Nm,rk=Mm,nk=zm,ak="Portal",dl=T.forwardRef((t,e)=>{const{container:r,...n}=t,[a,i]=T.useState(!1);yt(()=>i(!0),[]);const o=r||a&&globalThis?.document?.body;return o?Pt.createPortal(y.jsx(he.div,{...n,ref:e}),o):null});dl.displayName=ak;function ik(t,e){return T.useReducer((r,n)=>e[r][n]??r,t)}var wt=t=>{const{present:e,children:r}=t,n=ok(e),a=typeof r=="function"?r({present:n.isPresent}):T.Children.only(r),i=me(n.ref,sk(a));return typeof r=="function"||n.isPresent?T.cloneElement(a,{ref:i}):null};wt.displayName="Presence";function ok(t){const[e,r]=T.useState(),n=T.useRef(null),a=T.useRef(t),i=T.useRef("none"),o=t?"mounted":"unmounted",[s,l]=ik(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return T.useEffect(()=>{const c=xn(n.current);i.current=s==="mounted"?c:"none"},[s]),yt(()=>{const c=n.current,d=a.current;if(d!==t){const p=i.current,f=xn(c);t?l("MOUNT"):f==="none"||c?.display==="none"?l("UNMOUNT"):l(d&&p!==f?"ANIMATION_OUT":"UNMOUNT"),a.current=t}},[t,l]),yt(()=>{if(e){let c;const d=e.ownerDocument.defaultView??window,u=f=>{const m=xn(n.current).includes(CSS.escape(f.animationName));if(f.target===e&&m&&(l("ANIMATION_END"),!a.current)){const g=e.style.animationFillMode;e.style.animationFillMode="forwards",c=d.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=g)})}},p=f=>{f.target===e&&(i.current=xn(n.current))};return e.addEventListener("animationstart",p),e.addEventListener("animationcancel",u),e.addEventListener("animationend",u),()=>{d.clearTimeout(c),e.removeEventListener("animationstart",p),e.removeEventListener("animationcancel",u),e.removeEventListener("animationend",u)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:T.useCallback(c=>{n.current=c?getComputedStyle(c):null,r(c)},[])}}function xn(t){return t?.animationName||"none"}function sk(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}var ul="rovingFocusGroup.onEntryFocus",lk={bubbles:!1,cancelable:!0},Er="RovingFocusGroup",[pl,jm,ck]=Fs(Er),[dk,Wm]=st(Er,[ck]),[uk,pk]=dk(Er),Bm=T.forwardRef((t,e)=>y.jsx(pl.Provider,{scope:t.__scopeRovingFocusGroup,children:y.jsx(pl.Slot,{scope:t.__scopeRovingFocusGroup,children:y.jsx(fk,{...t,ref:e})})}));Bm.displayName=Er;var fk=T.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:a=!1,dir:i,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:d=!1,...u}=t,p=T.useRef(null),f=me(e,p),v=$s(i),[m,g]=xr({prop:o,defaultProp:s??null,onChange:l,caller:Er}),[C,x]=T.useState(!1),h=lt(c),b=jm(r),S=T.useRef(!1),[E,k]=T.useState(0);return T.useEffect(()=>{const w=p.current;if(w)return w.addEventListener(ul,h),()=>w.removeEventListener(ul,h)},[h]),y.jsx(uk,{scope:r,orientation:n,dir:v,loop:a,currentTabStopId:m,onItemFocus:T.useCallback(w=>g(w),[g]),onItemShiftTab:T.useCallback(()=>x(!0),[]),onFocusableItemAdd:T.useCallback(()=>k(w=>w+1),[]),onFocusableItemRemove:T.useCallback(()=>k(w=>w-1),[]),children:y.jsx(he.div,{tabIndex:C||E===0?-1:0,"data-orientation":n,...u,ref:f,style:{outline:"none",...t.style},onMouseDown:ie(t.onMouseDown,()=>{S.current=!0}),onFocus:ie(t.onFocus,w=>{const A=!S.current;if(w.target===w.currentTarget&&A&&!C){const _=new CustomEvent(ul,lk);if(w.currentTarget.dispatchEvent(_),!_.defaultPrevented){const I=b().filter(D=>D.focusable),M=I.find(D=>D.active),z=I.find(D=>D.id===m),H=[M,z,...I].filter(Boolean).map(D=>D.ref.current);Fm(H,d)}}S.current=!1}),onBlur:ie(t.onBlur,()=>x(!1))})})}),qm="RovingFocusGroupItem",Rm=T.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:a=!1,tabStopId:i,children:o,...s}=t,l=Yt(),c=i||l,d=pk(qm,r),u=d.currentTabStopId===c,p=jm(r),{onFocusableItemAdd:f,onFocusableItemRemove:v,currentTabStopId:m}=d;return T.useEffect(()=>{if(n)return f(),()=>v()},[n,f,v]),y.jsx(pl.ItemSlot,{scope:r,id:c,focusable:n,active:a,children:y.jsx(he.span,{tabIndex:u?0:-1,"data-orientation":d.orientation,...s,ref:e,onMouseDown:ie(t.onMouseDown,g=>{n?d.onItemFocus(c):g.preventDefault()}),onFocus:ie(t.onFocus,()=>d.onItemFocus(c)),onKeyDown:ie(t.onKeyDown,g=>{if(g.key==="Tab"&&g.shiftKey){d.onItemShiftTab();return}if(g.target!==g.currentTarget)return;const C=gk(g,d.orientation,d.dir);if(C!==void 0){if(g.metaKey||g.ctrlKey||g.altKey||g.shiftKey)return;g.preventDefault();let h=p().filter(b=>b.focusable).map(b=>b.ref.current);if(C==="last")h.reverse();else if(C==="prev"||C==="next"){C==="prev"&&h.reverse();const b=h.indexOf(g.currentTarget);h=d.loop?vk(h,b+1):h.slice(b+1)}setTimeout(()=>Fm(h))}}),children:typeof o=="function"?o({isCurrentTabStop:u,hasTabStop:m!=null}):o})})});Rm.displayName=qm;var mk={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function hk(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function gk(t,e,r){const n=hk(t.key,r);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return mk[n]}function Fm(t,e=!1){const r=document.activeElement;for(const n of t)if(n===r||(n.focus({preventScroll:e}),document.activeElement!==r))return}function vk(t,e){return t.map((r,n)=>t[(e+n)%t.length])}var yk=Bm,bk=Rm,Sk=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},er=new WeakMap,wn=new WeakMap,Cn={},fl=0,$m=function(t){return t&&(t.host||$m(t.parentNode))},xk=function(t,e){return e.map(function(r){if(t.contains(r))return r;var n=$m(r);return n&&t.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",t,". Doing nothing"),null)}).filter(function(r){return!!r})},wk=function(t,e,r,n){var a=xk(e,Array.isArray(t)?t:[t]);Cn[r]||(Cn[r]=new WeakMap);var i=Cn[r],o=[],s=new Set,l=new Set(a),c=function(u){!u||s.has(u)||(s.add(u),c(u.parentNode))};a.forEach(c);var d=function(u){!u||l.has(u)||Array.prototype.forEach.call(u.children,function(p){if(s.has(p))d(p);else try{var f=p.getAttribute(n),v=f!==null&&f!=="false",m=(er.get(p)||0)+1,g=(i.get(p)||0)+1;er.set(p,m),i.set(p,g),o.push(p),m===1&&v&&wn.set(p,!0),g===1&&p.setAttribute(r,"true"),v||p.setAttribute(n,"true")}catch(C){console.error("aria-hidden: cannot operate on ",p,C)}})};return d(e),s.clear(),fl++,function(){o.forEach(function(u){var p=er.get(u)-1,f=i.get(u)-1;er.set(u,p),i.set(u,f),p||(wn.has(u)||u.removeAttribute(n),wn.delete(u)),f||u.removeAttribute(r)}),fl--,fl||(er=new WeakMap,er=new WeakMap,wn=new WeakMap,Cn={})}},Gm=function(t,e,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(t)?t:[t]),a=Sk(t);return a?(n.push.apply(n,Array.from(a.querySelectorAll("[aria-live], script"))),wk(n,a,r,"aria-hidden")):function(){return null}},Je=function(){return Je=Object.assign||function(e){for(var r,n=1,a=arguments.length;n<a;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},Je.apply(this,arguments)};function Vm(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(t);a<n.length;a++)e.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(t,n[a])&&(r[n[a]]=t[n[a]]);return r}function Ck(t,e,r){if(r||arguments.length===2)for(var n=0,a=e.length,i;n<a;n++)(i||!(n in e))&&(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||Array.prototype.slice.call(e))}typeof SuppressedError=="function"&&SuppressedError;var kn="right-scroll-bar-position",En="width-before-scroll-bar",kk="with-scroll-bars-hidden",Ek="--removed-body-scroll-bar-size";function ml(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function Tk(t,e){var r=O.useState(function(){return{value:t,callback:e,facade:{get current(){return r.value},set current(n){var a=r.value;a!==n&&(r.value=n,r.callback(n,a))}}}})[0];return r.callback=e,r.facade}var Ak=typeof window<"u"?T.useLayoutEffect:T.useEffect,Hm=new WeakMap;function _k(t,e){var r=Tk(null,function(n){return t.forEach(function(a){return ml(a,n)})});return Ak(function(){var n=Hm.get(r);if(n){var a=new Set(n),i=new Set(t),o=r.current;a.forEach(function(s){i.has(s)||ml(s,null)}),i.forEach(function(s){a.has(s)||ml(s,o)})}Hm.set(r,t)},[t]),r}function Ok(t){return t}function Pk(t,e){e===void 0&&(e=Ok);var r=[],n=!1,a={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:t},useMedium:function(i){var o=e(i,n);return r.push(o),function(){r=r.filter(function(s){return s!==o})}},assignSyncMedium:function(i){for(n=!0;r.length;){var o=r;r=[],o.forEach(i)}r={push:function(s){return i(s)},filter:function(){return r}}},assignMedium:function(i){n=!0;var o=[];if(r.length){var s=r;r=[],s.forEach(i),o=r}var l=function(){var d=o;o=[],d.forEach(i)},c=function(){return Promise.resolve().then(l)};c(),r={push:function(d){o.push(d),c()},filter:function(d){return o=o.filter(d),r}}}};return a}function Ik(t){t===void 0&&(t={});var e=Pk(null);return e.options=Je({async:!0,ssr:!1},t),e}var Um=function(t){var e=t.sideCar,r=Vm(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=e.read();if(!n)throw new Error("Sidecar medium not found");return T.createElement(n,Je({},r))};Um.isSideCarExport=!0;function Nk(t,e){return t.useMedium(e),Um}var Km=Ik(),hl=function(){},Tn=T.forwardRef(function(t,e){var r=T.useRef(null),n=T.useState({onScrollCapture:hl,onWheelCapture:hl,onTouchMoveCapture:hl}),a=n[0],i=n[1],o=t.forwardProps,s=t.children,l=t.className,c=t.removeScrollBar,d=t.enabled,u=t.shards,p=t.sideCar,f=t.noRelative,v=t.noIsolation,m=t.inert,g=t.allowPinchZoom,C=t.as,x=C===void 0?"div":C,h=t.gapMode,b=Vm(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=p,E=_k([r,e]),k=Je(Je({},b),a);return T.createElement(T.Fragment,null,d&&T.createElement(S,{sideCar:Km,removeScrollBar:c,shards:u,noRelative:f,noIsolation:v,inert:m,setCallbacks:i,allowPinchZoom:!!g,lockRef:r,gapMode:h}),o?T.cloneElement(T.Children.only(s),Je(Je({},k),{ref:E})):T.createElement(x,Je({},k,{className:l,ref:E}),s))});Tn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Tn.classNames={fullWidth:En,zeroRight:kn};var Mk=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Dk(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=Mk();return e&&t.setAttribute("nonce",e),t}function zk(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function Lk(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var jk=function(){var t=0,e=null;return{add:function(r){t==0&&(e=Dk())&&(zk(e,r),Lk(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},Wk=function(){var t=jk();return function(e,r){T.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&r])}},Ym=function(){var t=Wk(),e=function(r){var n=r.styles,a=r.dynamic;return t(n,a),null};return e},Bk={left:0,top:0,right:0,gap:0},gl=function(t){return parseInt(t||"",10)||0},qk=function(t){var e=window.getComputedStyle(document.body),r=e[t==="padding"?"paddingLeft":"marginLeft"],n=e[t==="padding"?"paddingTop":"marginTop"],a=e[t==="padding"?"paddingRight":"marginRight"];return[gl(r),gl(n),gl(a)]},Rk=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return Bk;var e=qk(t),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,n-r+e[2]-e[0])}},Fk=Ym(),tr="data-scroll-locked",$k=function(t,e,r,n){var a=t.left,i=t.top,o=t.right,s=t.gap;return r===void 0&&(r="margin"),`
|
|
835
835
|
.`.concat(kk,` {
|
|
836
836
|
overflow: hidden `).concat(n,`;
|
|
837
837
|
padding-right: `).concat(s,"px ").concat(n,`;
|
|
@@ -871,7 +871,7 @@ ${d}`}const u=af(()=>{if(!i.current||!o.current){console.warn("Container or page
|
|
|
871
871
|
`)},Xm=function(){var t=parseInt(document.body.getAttribute(tr)||"0",10);return isFinite(t)?t:0},Gk=function(){T.useEffect(function(){return document.body.setAttribute(tr,(Xm()+1).toString()),function(){var t=Xm()-1;t<=0?document.body.removeAttribute(tr):document.body.setAttribute(tr,t.toString())}},[])},Vk=function(t){var e=t.noRelative,r=t.noImportant,n=t.gapMode,a=n===void 0?"margin":n;Gk();var i=T.useMemo(function(){return Rk(a)},[a]);return T.createElement(Fk,{styles:$k(i,!e,a,r?"":"!important")})},vl=!1;if(typeof window<"u")try{var An=Object.defineProperty({},"passive",{get:function(){return vl=!0,!0}});window.addEventListener("test",An,An),window.removeEventListener("test",An,An)}catch{vl=!1}var rr=vl?{passive:!1}:!1,Hk=function(t){return t.tagName==="TEXTAREA"},Zm=function(t,e){if(!(t instanceof Element))return!1;var r=window.getComputedStyle(t);return r[e]!=="hidden"&&!(r.overflowY===r.overflowX&&!Hk(t)&&r[e]==="visible")},Uk=function(t){return Zm(t,"overflowY")},Kk=function(t){return Zm(t,"overflowX")},Qm=function(t,e){var r=e.ownerDocument,n=e;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var a=Jm(t,n);if(a){var i=eh(t,n),o=i[1],s=i[2];if(o>s)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},Yk=function(t){var e=t.scrollTop,r=t.scrollHeight,n=t.clientHeight;return[e,r,n]},Xk=function(t){var e=t.scrollLeft,r=t.scrollWidth,n=t.clientWidth;return[e,r,n]},Jm=function(t,e){return t==="v"?Uk(e):Kk(e)},eh=function(t,e){return t==="v"?Yk(e):Xk(e)},Zk=function(t,e){return t==="h"&&e==="rtl"?-1:1},Qk=function(t,e,r,n,a){var i=Zk(t,window.getComputedStyle(e).direction),o=i*n,s=r.target,l=e.contains(s),c=!1,d=o>0,u=0,p=0;do{if(!s)break;var f=eh(t,s),v=f[0],m=f[1],g=f[2],C=m-g-i*v;(v||C)&&Jm(t,s)&&(u+=C,p+=v);var x=s.parentNode;s=x&&x.nodeType===Node.DOCUMENT_FRAGMENT_NODE?x.host:x}while(!l&&s!==document.body||l&&(e.contains(s)||e===s));return(d&&Math.abs(u)<1||!d&&Math.abs(p)<1)&&(c=!0),c},_n=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},th=function(t){return[t.deltaX,t.deltaY]},rh=function(t){return t&&"current"in t?t.current:t},Jk=function(t,e){return t[0]===e[0]&&t[1]===e[1]},eE=function(t){return`
|
|
872
872
|
.block-interactivity-`.concat(t,` {pointer-events: none;}
|
|
873
873
|
.allow-interactivity-`).concat(t,` {pointer-events: all;}
|
|
874
|
-
`)},tE=0,nr=[];function rE(t){var e=T.useRef([]),r=T.useRef([0,0]),n=T.useRef(),a=T.useState(tE++)[0],i=T.useState(Ym)[0],o=T.useRef(t);T.useEffect(function(){o.current=t},[t]),T.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(a));var m=Ck([t.lockRef.current],(t.shards||[]).map(rh),!0).filter(Boolean);return m.forEach(function(g){return g.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),m.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(a))})}}},[t.inert,t.lockRef.current,t.shards]);var s=T.useCallback(function(m,g){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!o.current.allowPinchZoom;var C=_n(m),x=r.current,h="deltaX"in m?m.deltaX:x[0]-C[0],b="deltaY"in m?m.deltaY:x[1]-C[1],S,E=m.target,k=Math.abs(h)>Math.abs(b)?"h":"v";if("touches"in m&&k==="h"&&E.type==="range")return!1;var w=window.getSelection(),A=w&&w.anchorNode,_=A?A===E||A.contains(E):!1;if(_)return!1;var I=Qm(k,E);if(!I)return!0;if(I?S=k:(S=k==="v"?"h":"v",I=Qm(k,E)),!I)return!1;if(!n.current&&"changedTouches"in m&&(h||b)&&(n.current=S),!S)return!0;var M=n.current||S;return Qk(M,g,m,M==="h"?h:b)},[]),l=T.useCallback(function(m){var g=m;if(!(!nr.length||nr[nr.length-1]!==i)){var C="deltaY"in g?th(g):_n(g),x=e.current.filter(function(S){return S.name===g.type&&(S.target===g.target||g.target===S.shadowParent)&&Jk(S.delta,C)})[0];if(x&&x.should){g.cancelable&&g.preventDefault();return}if(!x){var h=(o.current.shards||[]).map(rh).filter(Boolean).filter(function(S){return S.contains(g.target)}),b=h.length>0?s(g,h[0]):!o.current.noIsolation;b&&g.cancelable&&g.preventDefault()}}},[]),c=T.useCallback(function(m,g,C,x){var h={name:m,delta:g,target:C,should:x,shadowParent:nE(C)};e.current.push(h),setTimeout(function(){e.current=e.current.filter(function(b){return b!==h})},1)},[]),d=T.useCallback(function(m){r.current=_n(m),n.current=void 0},[]),u=T.useCallback(function(m){c(m.type,th(m),m.target,s(m,t.lockRef.current))},[]),p=T.useCallback(function(m){c(m.type,_n(m),m.target,s(m,t.lockRef.current))},[]);T.useEffect(function(){return nr.push(i),t.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:p}),document.addEventListener("wheel",l,rr),document.addEventListener("touchmove",l,rr),document.addEventListener("touchstart",d,rr),function(){nr=nr.filter(function(m){return m!==i}),document.removeEventListener("wheel",l,rr),document.removeEventListener("touchmove",l,rr),document.removeEventListener("touchstart",d,rr)}},[]);var f=t.removeScrollBar,v=t.inert;return T.createElement(T.Fragment,null,v?T.createElement(i,{styles:eE(a)}):null,f?T.createElement(Vk,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function nE(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const aE=Nk(Km,rE);var yl=T.forwardRef(function(t,e){return T.createElement(Tn,Je({},t,{ref:e,sideCar:aE}))});yl.classNames=Tn.classNames;var bl=["Enter"," "],iE=["ArrowDown","PageUp","Home"],nh=["ArrowUp","PageDown","End"],oE=[...iE,...nh],sE={ltr:[...bl,"ArrowRight"],rtl:[...bl,"ArrowLeft"]},lE={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Tr="Menu",[Ar,cE,dE]=Fs(Tr),[jt,ah]=st(Tr,[dE,_m,Wm]),On=_m(),ih=Wm(),[uE,Wt]=jt(Tr),[pE,_r]=jt(Tr),oh=t=>{const{__scopeMenu:e,open:r=!1,children:n,dir:a,onOpenChange:i,modal:o=!0}=t,s=On(e),[l,c]=T.useState(null),d=T.useRef(!1),u=lt(i),p=$s(a);return T.useEffect(()=>{const f=()=>{d.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},v=()=>d.current=!1;return document.addEventListener("keydown",f,{capture:!0}),()=>{document.removeEventListener("keydown",f,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),y.jsx(ek,{...s,children:y.jsx(uE,{scope:e,open:r,onOpenChange:u,content:l,onContentChange:c,children:y.jsx(pE,{scope:e,onClose:T.useCallback(()=>u(!1),[u]),isUsingKeyboardRef:d,dir:p,modal:o,children:n})})})};oh.displayName=Tr;var fE="MenuAnchor",Sl=T.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t,a=On(r);return y.jsx(tk,{...a,...n,ref:e})});Sl.displayName=fE;var xl="MenuPortal",[mE,sh]=jt(xl,{forceMount:void 0}),lh=t=>{const{__scopeMenu:e,forceMount:r,children:n,container:a}=t,i=Wt(xl,e);return y.jsx(mE,{scope:e,forceMount:r,children:y.jsx(wt,{present:r||i.open,children:y.jsx(dl,{asChild:!0,container:a,children:n})})})};lh.displayName=xl;var qe="MenuContent",[hE,wl]=jt(qe),ch=T.forwardRef((t,e)=>{const r=sh(qe,t.__scopeMenu),{forceMount:n=r.forceMount,...a}=t,i=Wt(qe,t.__scopeMenu),o=_r(qe,t.__scopeMenu);return y.jsx(Ar.Provider,{scope:t.__scopeMenu,children:y.jsx(wt,{present:n||i.open,children:y.jsx(Ar.Slot,{scope:t.__scopeMenu,children:o.modal?y.jsx(gE,{...a,ref:e}):y.jsx(vE,{...a,ref:e})})})})}),gE=T.forwardRef((t,e)=>{const r=Wt(qe,t.__scopeMenu),n=T.useRef(null),a=me(e,n);return T.useEffect(()=>{const i=n.current;if(i)return Gm(i)},[]),y.jsx(Cl,{...t,ref:a,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:ie(t.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),vE=T.forwardRef((t,e)=>{const r=Wt(qe,t.__scopeMenu);return y.jsx(Cl,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),yE=wr("MenuContent.ScrollLock"),Cl=T.forwardRef((t,e)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:u,onInteractOutside:p,onDismiss:f,disableOutsideScroll:v,...m}=t,g=Wt(qe,r),C=_r(qe,r),x=On(r),h=ih(r),b=cE(r),[S,E]=T.useState(null),k=T.useRef(null),w=me(e,k,g.onContentChange),A=T.useRef(0),_=T.useRef(""),I=T.useRef(0),M=T.useRef(null),z=T.useRef("right"),R=T.useRef(0),H=v?yl:T.Fragment,D=v?{as:yE,allowPinchZoom:!0}:void 0,F=P=>{const j=_.current+P,Y=b().filter(U=>!U.disabled),X=document.activeElement,W=Y.find(U=>U.ref.current===X)?.textValue,L=Y.map(U=>U.textValue),B=PE(L,j,W),V=Y.find(U=>U.textValue===B)?.ref.current;(function U(se){_.current=se,window.clearTimeout(A.current),se!==""&&(A.current=window.setTimeout(()=>U(""),1e3))})(j),V&&setTimeout(()=>V.focus())};T.useEffect(()=>()=>window.clearTimeout(A.current),[]),Zf();const q=T.useCallback(P=>z.current===M.current?.side&&NE(P,M.current?.area),[]);return y.jsx(hE,{scope:r,searchRef:_,onItemEnter:T.useCallback(P=>{q(P)&&P.preventDefault()},[q]),onItemLeave:T.useCallback(P=>{q(P)||(k.current?.focus(),E(null))},[q]),onTriggerLeave:T.useCallback(P=>{q(P)&&P.preventDefault()},[q]),pointerGraceTimerRef:I,onPointerGraceIntentChange:T.useCallback(P=>{M.current=P},[]),children:y.jsx(H,{...D,children:y.jsx(Ys,{asChild:!0,trapped:a,onMountAutoFocus:ie(i,P=>{P.preventDefault(),k.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:y.jsx(Vs,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:u,onInteractOutside:p,onDismiss:f,children:y.jsx(yk,{asChild:!0,...h,dir:C.dir,orientation:"vertical",loop:n,currentTabStopId:S,onCurrentTabStopIdChange:E,onEntryFocus:ie(l,P=>{C.isUsingKeyboardRef.current||P.preventDefault()}),preventScrollOnEntryFocus:!0,children:y.jsx(rk,{role:"menu","aria-orientation":"vertical","data-state":Th(g.open),"data-radix-menu-content":"",dir:C.dir,...x,...m,ref:w,style:{outline:"none",...m.style},onKeyDown:ie(m.onKeyDown,P=>{const Y=P.target.closest("[data-radix-menu-content]")===P.currentTarget,X=P.ctrlKey||P.altKey||P.metaKey,W=P.key.length===1;Y&&(P.key==="Tab"&&P.preventDefault(),!X&&W&&F(P.key));const L=k.current;if(P.target!==L||!oE.includes(P.key))return;P.preventDefault();const V=b().filter(U=>!U.disabled).map(U=>U.ref.current);nh.includes(P.key)&&V.reverse(),_E(V)}),onBlur:ie(t.onBlur,P=>{P.currentTarget.contains(P.target)||(window.clearTimeout(A.current),_.current="")}),onPointerMove:ie(t.onPointerMove,Pr(P=>{const j=P.target,Y=R.current!==P.clientX;if(P.currentTarget.contains(j)&&Y){const X=P.clientX>R.current?"right":"left";z.current=X,R.current=P.clientX}}))})})})})})})});ch.displayName=qe;var bE="MenuGroup",kl=T.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t;return y.jsx(he.div,{role:"group",...n,ref:e})});kl.displayName=bE;var SE="MenuLabel",dh=T.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t;return y.jsx(he.div,{...n,ref:e})});dh.displayName=SE;var Pn="MenuItem",uh="menu.itemSelect",In=T.forwardRef((t,e)=>{const{disabled:r=!1,onSelect:n,...a}=t,i=T.useRef(null),o=_r(Pn,t.__scopeMenu),s=wl(Pn,t.__scopeMenu),l=me(e,i),c=T.useRef(!1),d=()=>{const u=i.current;if(!r&&u){const p=new CustomEvent(uh,{bubbles:!0,cancelable:!0});u.addEventListener(uh,f=>n?.(f),{once:!0}),Hf(u,p),p.defaultPrevented?c.current=!1:o.onClose()}};return y.jsx(ph,{...a,ref:l,disabled:r,onClick:ie(t.onClick,d),onPointerDown:u=>{t.onPointerDown?.(u),c.current=!0},onPointerUp:ie(t.onPointerUp,u=>{c.current||u.currentTarget?.click()}),onKeyDown:ie(t.onKeyDown,u=>{const p=s.searchRef.current!=="";r||p&&u.key===" "||bl.includes(u.key)&&(u.currentTarget.click(),u.preventDefault())})})});In.displayName=Pn;var ph=T.forwardRef((t,e)=>{const{__scopeMenu:r,disabled:n=!1,textValue:a,...i}=t,o=wl(Pn,r),s=ih(r),l=T.useRef(null),c=me(e,l),[d,u]=T.useState(!1),[p,f]=T.useState("");return T.useEffect(()=>{const v=l.current;v&&f((v.textContent??"").trim())},[i.children]),y.jsx(Ar.ItemSlot,{scope:r,disabled:n,textValue:a??p,children:y.jsx(bk,{asChild:!0,...s,focusable:!n,children:y.jsx(he.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...i,ref:c,onPointerMove:ie(t.onPointerMove,Pr(v=>{n?o.onItemLeave(v):(o.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ie(t.onPointerLeave,Pr(v=>o.onItemLeave(v))),onFocus:ie(t.onFocus,()=>u(!0)),onBlur:ie(t.onBlur,()=>u(!1))})})})}),xE="MenuCheckboxItem",fh=T.forwardRef((t,e)=>{const{checked:r=!1,onCheckedChange:n,...a}=t;return y.jsx(yh,{scope:t.__scopeMenu,checked:r,children:y.jsx(In,{role:"menuitemcheckbox","aria-checked":Nn(r)?"mixed":r,...a,ref:e,"data-state":Tl(r),onSelect:ie(a.onSelect,()=>n?.(Nn(r)?!0:!r),{checkForDefaultPrevented:!1})})})});fh.displayName=xE;var mh="MenuRadioGroup",[wE,CE]=jt(mh,{value:void 0,onValueChange:()=>{}}),hh=T.forwardRef((t,e)=>{const{value:r,onValueChange:n,...a}=t,i=lt(n);return y.jsx(wE,{scope:t.__scopeMenu,value:r,onValueChange:i,children:y.jsx(kl,{...a,ref:e})})});hh.displayName=mh;var gh="MenuRadioItem",vh=T.forwardRef((t,e)=>{const{value:r,...n}=t,a=CE(gh,t.__scopeMenu),i=r===a.value;return y.jsx(yh,{scope:t.__scopeMenu,checked:i,children:y.jsx(In,{role:"menuitemradio","aria-checked":i,...n,ref:e,"data-state":Tl(i),onSelect:ie(n.onSelect,()=>a.onValueChange?.(r),{checkForDefaultPrevented:!1})})})});vh.displayName=gh;var El="MenuItemIndicator",[yh,kE]=jt(El,{checked:!1}),bh=T.forwardRef((t,e)=>{const{__scopeMenu:r,forceMount:n,...a}=t,i=kE(El,r);return y.jsx(wt,{present:n||Nn(i.checked)||i.checked===!0,children:y.jsx(he.span,{...a,ref:e,"data-state":Tl(i.checked)})})});bh.displayName=El;var EE="MenuSeparator",Sh=T.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t;return y.jsx(he.div,{role:"separator","aria-orientation":"horizontal",...n,ref:e})});Sh.displayName=EE;var TE="MenuArrow",xh=T.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t,a=On(r);return y.jsx(nk,{...a,...n,ref:e})});xh.displayName=TE;var AE="MenuSub",[tI,wh]=jt(AE),Or="MenuSubTrigger",Ch=T.forwardRef((t,e)=>{const r=Wt(Or,t.__scopeMenu),n=_r(Or,t.__scopeMenu),a=wh(Or,t.__scopeMenu),i=wl(Or,t.__scopeMenu),o=T.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:l}=i,c={__scopeMenu:t.__scopeMenu},d=T.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return T.useEffect(()=>d,[d]),T.useEffect(()=>{const u=s.current;return()=>{window.clearTimeout(u),l(null)}},[s,l]),y.jsx(Sl,{asChild:!0,...c,children:y.jsx(ph,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":a.contentId,"data-state":Th(r.open),...t,ref:Sr(e,a.onTriggerChange),onClick:u=>{t.onClick?.(u),!(t.disabled||u.defaultPrevented)&&(u.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:ie(t.onPointerMove,Pr(u=>{i.onItemEnter(u),!u.defaultPrevented&&!t.disabled&&!r.open&&!o.current&&(i.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{r.onOpenChange(!0),d()},100))})),onPointerLeave:ie(t.onPointerLeave,Pr(u=>{d();const p=r.content?.getBoundingClientRect();if(p){const f=r.content?.dataset.side,v=f==="right",m=v?-5:5,g=p[v?"left":"right"],C=p[v?"right":"left"];i.onPointerGraceIntentChange({area:[{x:u.clientX+m,y:u.clientY},{x:g,y:p.top},{x:C,y:p.top},{x:C,y:p.bottom},{x:g,y:p.bottom}],side:f}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(u),u.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:ie(t.onKeyDown,u=>{const p=i.searchRef.current!=="";t.disabled||p&&u.key===" "||sE[n.dir].includes(u.key)&&(r.onOpenChange(!0),r.content?.focus(),u.preventDefault())})})})});Ch.displayName=Or;var kh="MenuSubContent",Eh=T.forwardRef((t,e)=>{const r=sh(qe,t.__scopeMenu),{forceMount:n=r.forceMount,...a}=t,i=Wt(qe,t.__scopeMenu),o=_r(qe,t.__scopeMenu),s=wh(kh,t.__scopeMenu),l=T.useRef(null),c=me(e,l);return y.jsx(Ar.Provider,{scope:t.__scopeMenu,children:y.jsx(wt,{present:n||i.open,children:y.jsx(Ar.Slot,{scope:t.__scopeMenu,children:y.jsx(Cl,{id:s.contentId,"aria-labelledby":s.triggerId,...a,ref:c,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{o.isUsingKeyboardRef.current&&l.current?.focus(),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:ie(t.onFocusOutside,d=>{d.target!==s.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:ie(t.onEscapeKeyDown,d=>{o.onClose(),d.preventDefault()}),onKeyDown:ie(t.onKeyDown,d=>{const u=d.currentTarget.contains(d.target),p=lE[o.dir].includes(d.key);u&&p&&(i.onOpenChange(!1),s.trigger?.focus(),d.preventDefault())})})})})})});Eh.displayName=kh;function Th(t){return t?"open":"closed"}function Nn(t){return t==="indeterminate"}function Tl(t){return Nn(t)?"indeterminate":t?"checked":"unchecked"}function _E(t){const e=document.activeElement;for(const r of t)if(r===e||(r.focus(),document.activeElement!==e))return}function OE(t,e){return t.map((r,n)=>t[(e+n)%t.length])}function PE(t,e,r){const a=e.length>1&&Array.from(e).every(c=>c===e[0])?e[0]:e,i=r?t.indexOf(r):-1;let o=OE(t,Math.max(i,0));a.length===1&&(o=o.filter(c=>c!==r));const l=o.find(c=>c.toLowerCase().startsWith(a.toLowerCase()));return l!==r?l:void 0}function IE(t,e){const{x:r,y:n}=t;let a=!1;for(let i=0,o=e.length-1;i<e.length;o=i++){const s=e[i],l=e[o],c=s.x,d=s.y,u=l.x,p=l.y;d>n!=p>n&&r<(u-c)*(n-d)/(p-d)+c&&(a=!a)}return a}function NE(t,e){if(!e)return!1;const r={x:t.clientX,y:t.clientY};return IE(r,e)}function Pr(t){return e=>e.pointerType==="mouse"?t(e):void 0}var ME=oh,DE=Sl,zE=lh,LE=ch,jE=kl,WE=dh,BE=In,qE=fh,RE=hh,FE=vh,$E=bh,GE=Sh,VE=xh,HE=Ch,UE=Eh,Mn="DropdownMenu",[KE]=st(Mn,[ah]),_e=ah(),[YE,Ah]=KE(Mn),_h=t=>{const{__scopeDropdownMenu:e,children:r,dir:n,open:a,defaultOpen:i,onOpenChange:o,modal:s=!0}=t,l=_e(e),c=T.useRef(null),[d,u]=xr({prop:a,defaultProp:i??!1,onChange:o,caller:Mn});return y.jsx(YE,{scope:e,triggerId:Yt(),triggerRef:c,contentId:Yt(),open:d,onOpenChange:u,onOpenToggle:T.useCallback(()=>u(p=>!p),[u]),modal:s,children:y.jsx(ME,{...l,open:d,onOpenChange:u,dir:n,modal:s,children:r})})};_h.displayName=Mn;var Oh="DropdownMenuTrigger",Ph=T.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...a}=t,i=Ah(Oh,r),o=_e(r);return y.jsx(DE,{asChild:!0,...o,children:y.jsx(he.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...a,ref:Sr(e,i.triggerRef),onPointerDown:ie(t.onPointerDown,s=>{!n&&s.button===0&&s.ctrlKey===!1&&(i.onOpenToggle(),i.open||s.preventDefault())}),onKeyDown:ie(t.onKeyDown,s=>{n||(["Enter"," "].includes(s.key)&&i.onOpenToggle(),s.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(s.key)&&s.preventDefault())})})})});Ph.displayName=Oh;var XE="DropdownMenuPortal",Ih=t=>{const{__scopeDropdownMenu:e,...r}=t,n=_e(e);return y.jsx(zE,{...n,...r})};Ih.displayName=XE;var Nh="DropdownMenuContent",Mh=T.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,a=Ah(Nh,r),i=_e(r),o=T.useRef(!1);return y.jsx(LE,{id:a.contentId,"aria-labelledby":a.triggerId,...i,...n,ref:e,onCloseAutoFocus:ie(t.onCloseAutoFocus,s=>{o.current||a.triggerRef.current?.focus(),o.current=!1,s.preventDefault()}),onInteractOutside:ie(t.onInteractOutside,s=>{const l=s.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,d=l.button===2||c;(!a.modal||d)&&(o.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Mh.displayName=Nh;var ZE="DropdownMenuGroup",QE=T.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,a=_e(r);return y.jsx(jE,{...a,...n,ref:e})});QE.displayName=ZE;var JE="DropdownMenuLabel",Dh=T.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,a=_e(r);return y.jsx(WE,{...a,...n,ref:e})});Dh.displayName=JE;var eT="DropdownMenuItem",zh=T.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,a=_e(r);return y.jsx(BE,{...a,...n,ref:e})});zh.displayName=eT;var tT="DropdownMenuCheckboxItem",Lh=T.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,a=_e(r);return y.jsx(qE,{...a,...n,ref:e})});Lh.displayName=tT;var rT="DropdownMenuRadioGroup",jh=T.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,a=_e(r);return y.jsx(RE,{...a,...n,ref:e})});jh.displayName=rT;var nT="DropdownMenuRadioItem",Wh=T.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,a=_e(r);return y.jsx(FE,{...a,...n,ref:e})});Wh.displayName=nT;var aT="DropdownMenuItemIndicator",iT=T.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,a=_e(r);return y.jsx($E,{...a,...n,ref:e})});iT.displayName=aT;var oT="DropdownMenuSeparator",Bh=T.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,a=_e(r);return y.jsx(GE,{...a,...n,ref:e})});Bh.displayName=oT;var sT="DropdownMenuArrow",lT=T.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,a=_e(r);return y.jsx(VE,{...a,...n,ref:e})});lT.displayName=sT;var cT="DropdownMenuSubTrigger",qh=T.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,a=_e(r);return y.jsx(HE,{...a,...n,ref:e})});qh.displayName=cT;var dT="DropdownMenuSubContent",Rh=T.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,a=_e(r);return y.jsx(UE,{...a,...n,ref:e,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Rh.displayName=dT;var uT=_h,pT=Ph,fT=Ih,Fh=Mh,$h=Dh,Gh=zh,Vh=Lh,mT=jh,Hh=Wh,Uh=Bh,Kh=qh,Yh=Rh;const Dn=uT,zn=pT,hT=mT,gT=T.forwardRef(({className:t,inset:e,children:r,...n},a)=>y.jsx(Kh,{ref:a,className:pe("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-gray-100 data-[state=open]:bg-gray-100",e&&"pl-8",t),...n,children:r}));gT.displayName=Kh.displayName;const vT=T.forwardRef(({className:t,...e},r)=>y.jsx(Yh,{ref:r,className:pe("z-50 min-w-[8rem] overflow-hidden rounded-md border border-gray-200 bg-white p-1 text-gray-900 shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...e}));vT.displayName=Yh.displayName;const Ir=T.forwardRef(({className:t,sideOffset:e=4,...r},n)=>{const{portalContainer:a}=zs();return y.jsx(fT,{container:a||void 0,children:y.jsx(Fh,{ref:n,sideOffset:e,"data-uhuu-editor":!0,className:pe("z-50 min-w-[8rem] overflow-hidden rounded-md border border-gray-200 bg-white p-1 text-gray-900 shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...r})})});Ir.displayName=Fh.displayName;const Bt=T.forwardRef(({className:t,inset:e,...r},n)=>y.jsx(Gh,{ref:n,className:pe("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-gray-100 focus:text-gray-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e&&"pl-8",t),...r}));Bt.displayName=Gh.displayName;const yT=T.forwardRef(({className:t,children:e,checked:r,...n},a)=>y.jsx(Vh,{ref:a,className:pe("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-gray-100 focus:text-gray-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),checked:r,...n,children:e}));yT.displayName=Vh.displayName;const Xh=T.forwardRef(({className:t,children:e,...r},n)=>y.jsx(Hh,{ref:n,className:pe("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-gray-100 focus:text-gray-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...r,children:e}));Xh.displayName=Hh.displayName;const Al=T.forwardRef(({className:t,inset:e,...r},n)=>y.jsx($h,{ref:n,className:pe("px-2 py-1.5 text-sm font-medium",e&&"pl-8",t),...r}));Al.displayName=$h.displayName;const Ln=T.forwardRef(({className:t,...e},r)=>y.jsx(Uh,{ref:r,className:pe("-mx-1 my-1 h-px bg-gray-200",t),...e}));Ln.displayName=Uh.displayName;const bT=(t,e)=>{if(t.stopPropagation(),e.onSelect){e.onSelect(t);return}e.dialog&&typeof window<"u"&&window.$uhuu?.editDialog?.(e.dialog)},_l=(t,e)=>{if(!t)return null;const r=t.trim();if(r.startsWith("<")){const a=r.replace(/<svg\b([^>]*)>/i,(i,o)=>{let s=o;return/\bwidth=/.test(s)?s=s.replace(/\bwidth=(\"[^\"]*\"|'[^']*'|[^\s>]+)/i,'width="100%"'):s+=' width="100%"',/\bheight=/.test(s)?s=s.replace(/\bheight=(\"[^\"]*\"|'[^']*'|[^\s>]+)/i,'height="100%"'):s+=' height="100%"',/\bpreserveAspectRatio=/.test(s)?s=s.replace(/\bpreserveAspectRatio=(\"[^\"]*\"|'[^']*'|[^\s>]+)/i,'preserveAspectRatio="xMidYMid slice"'):s+=' preserveAspectRatio="xMidYMid slice"',`<svg${s}>`});return y.jsx("div",{className:pe("pointer-events-none absolute inset-0 z-10",e),"aria-hidden":"true",dangerouslySetInnerHTML:{__html:a}})}return y.jsx("img",{src:t,alt:"","aria-hidden":"true",className:pe("pointer-events-none absolute inset-0 z-10 h-full w-full object-cover",e)})},Ol=(t,e)=>e?y.jsx("div",{className:"absolute right-2 top-2 z-20",children:y.jsxs(Dn,{modal:!1,children:[y.jsx(zn,{asChild:!0,children:y.jsx(Ae,{variant:"secondary",size:"icon",title:"Image options",className:"h-7 w-7 shadow-sm",onPointerDown:r=>r.stopPropagation(),onClick:r=>r.stopPropagation(),children:y.jsx(mf,{className:"h-4 w-4"})})}),y.jsx(Ir,{className:"w-40 p-1.5",align:"end",children:t.map(r=>y.jsxs(Bt,{onSelect:n=>bT(n,r),disabled:r.disabled,children:[r.icon&&y.jsx("span",{className:"mr-2 inline-flex",children:r.icon}),y.jsx("span",{children:r.label})]},r.id))})]})}):null,Pl=(t=[])=>{const e=js();return t.length>0&&!e},ST=({className:t,style:e,overlaySvg:r,overlayClassName:n,options:a=[],dialog:i,dialogProps:o,bleedProps:s,children:l})=>{const c=O.useContext(Mt),d=Pl(a),u=i?Kt({dialog:i},c):{};return T.useMemo(()=>{if(!o)return u;const p={...u,...o};return(u.className||o.className)&&(p.className=`${u.className||""} ${o.className||""}`.trim()),Object.keys(u).forEach(f=>{const v=u[f],m=o[f];f.startsWith("on")&&typeof v=="function"&&typeof m=="function"&&(p[f]=g=>{v(g),m(g)})}),p},[u,o]),y.jsxs(y.Fragment,{children:[y.jsxs(Ns,{...s,dialog:i,children:[_l(r,n),l]}),Ol(a,d)]})};function Il(t){const e=O.useContext(Mt),r=t.bleed??e?.page?.bleed??0,n=t.pageWidth??e?.page?.width??210,a=t.pageHeight??e?.page?.height??297,{src:i,side:o,backgroundColor:s,width:l,height:c,left:d=0,right:u=0,top:p=0,bottom:f=0}=t,[v,m]=O.useState("h-full w-full object-cover object-center"),g=D=>`${D}mm`,C=()=>{let D=l;return l||(D=2*n,d||(D+=2*r),u||(D+=2*r),(d||u)&&(D-=(d??0)+(u??0))),D},x=()=>{let D=c;return c||(D=a,p||(D+=r),f||(D+=r),(p||f)&&(D-=(p??0)+(f??0))),D},h=C(),b=x(),S=D=>D!==void 0?g(D):void 0,E=D=>Object.fromEntries(Object.entries(D).filter(([F,q])=>q!==void 0)),k=d>0?d+r:-1*r,w=p>0?p+r:-1*r,A=f>0?f+r:-1*r,_=-1*n+k,I=p>0&&f>0,M=E({backgroundColor:s,width:S(h),...I?{height:S(b)}:{},left:S(k),top:S(w),bottom:S(A)}),z=E({width:S(h),...I?{height:S(b)}:{},left:S(_),top:S(w),bottom:S(A)}),R=b!=0?h/b:h/(a-(p??0)-(f??0)),H=D=>{let q=D.target.naturalWidth/D.target.naturalHeight>R?"cover-vertical":"cover-horizontal";m(q)};return y.jsx("div",{className:"uhuu-image-container",style:o=="end"?z:M,...t.dataUhuu!==void 0?{"data-uhuu":t.dataUhuu}:{},children:y.jsxs("div",{className:"uhuu-image-inner",...Kt(t,e),children:[y.jsx("img",{className:v,src:i,onLoad:D=>H(D)},`${i}-${h}-${b}`),t.children]})})}const xT=({overlaySvg:t,overlayClassName:e,options:r=[],dialog:n,spreadProps:a,children:i})=>{const o=Pl(r);return y.jsxs(y.Fragment,{children:[y.jsxs(Il,{...a,dialog:n,children:[_l(t,e),i]}),Ol(r,o)]})},wT=({src:t,alt:e="",className:r,imageClassName:n,style:a,imageStyle:i,overlaySvg:o,overlayClassName:s,options:l=[],dialog:c,dialogProps:d,placeholder:u,children:p,imageProps:f,renderImage:v})=>{const m=O.useContext(Mt),g=c?Kt({dialog:c},m):{},C=Pl(l),x=T.useMemo(()=>{if(!d)return g;const w={...g,...d};return(g.className||d.className)&&(w.className=pe(g.className,d.className)),Object.keys(g).forEach(A=>{const _=g[A],I=d[A];A.startsWith("on")&&typeof _=="function"&&typeof I=="function"&&(w[A]=M=>{_(M),I(M)})}),w},[g,d]),h=()=>{const w=f?.className,A=f?.style,_=f?.src??t,I=f?.alt??e,M={...f,src:_,alt:I,className:pe("h-full w-full object-cover",n,w),style:{...i,...A}};return v?v(M):_?y.jsx("img",{...M}):u??null},b=x["data-uhuu"],S=T.Children.toArray(p).some(w=>T.isValidElement(w)?w.type===Il||w.type===Ns:!1);S&&delete x["data-uhuu"];const E=T.Children.map(p,w=>T.isValidElement(w)?T.cloneElement(w,{dataUhuu:b}):w),k=S?"relative h-full w-full":"relative";return y.jsxs("div",{className:pe(k,r),style:a,children:[y.jsxs("div",{className:"relative h-full w-full",...x,children:[h(),E,_l(o,s)]}),Ol(l,C)]})},CT=t=>{const{computedOverlaySvg:e,computedOptions:r,computedDirectDialog:n}=O.useMemo(()=>{const{annotation:H,dialog:D,overlaySvg:F,options:q,src:P}=t;if(!H&&!D)return{computedOverlaySvg:F,computedOptions:q,computedDirectDialog:void 0};const j=H?.value||{},Y=F??j.annotationSvg??"",X=[];if(H){if(D){const $={...D};if(D.type==="satellite"){const{path:Z,type:le,...oe}=D;$.config={...oe,path:"image"},$.path=Z,$.type=le}X.push({id:"edit",label:"Edit image",dialog:$})}const B=Array.isArray(j.annotations)?j.annotations:[],{path:V,value:U,annotations:se,...ae}=H,N={path:H.path,type:"annotation",image:P,annotations:B,...ae};X.push({id:"annotate",label:"Annotate",dialog:N})}const W=q?[...X,...q]:X;let L;if(D){const B={...D};if(D.type==="satellite"){const{path:V,type:U,...se}=D;B.config={...se,path:"image"},B.path=V,B.type=U}L=B}return{computedOverlaySvg:Y,computedOptions:W.length>0?W:void 0,computedDirectDialog:L}},[t.annotation,t.dialog,t.overlaySvg,t.options,t.src]),a=O.useMemo(()=>t.mode?t.mode:t.side!==void 0?"spread":t.width!==void 0||t.height!==void 0||t.left!==void 0||t.right!==void 0||t.top!==void 0||t.bottom!==void 0?"bleed":"auto",[t.mode,t.side,t.width,t.height,t.left,t.right,t.top,t.bottom]),i=a==="auto"||r&&r.length>0||e||n||t.renderImage!==void 0||t.placeholder!==void 0||t.children!==void 0,{mode:o,side:s,src:l,alt:c,className:d,imageClassName:u,style:p,imageStyle:f,backgroundColor:v,width:m,height:g,left:C,right:x,top:h,bottom:b,pageWidth:S,pageHeight:E,bleed:k,overlayClassName:w,dialogProps:A,placeholder:_,children:I,imageProps:M,renderImage:z}=t,R={src:l,backgroundColor:v,width:m,height:g,left:C,right:x,top:h,bottom:b,pageWidth:S,pageHeight:E,bleed:k};if(a==="auto")return y.jsx(wT,{src:l,alt:c,className:d,style:p,imageClassName:u,imageStyle:f,overlaySvg:e,overlayClassName:w,options:r,dialog:n,dialogProps:A,placeholder:_,children:I,imageProps:M,renderImage:z});if(a==="spread"){const H={...R,side:s};return i&&(e||r?.length||n)?y.jsx(xT,{className:d,style:p,overlaySvg:e,overlayClassName:w,options:r,dialog:n,dialogProps:A,spreadProps:H,children:I}):y.jsx(Il,{...H})}return i&&(e||r?.length||n)?y.jsx(ST,{className:d,style:p,overlaySvg:e,overlayClassName:w,options:r,dialog:n,dialogProps:A,bleedProps:R,children:I}):y.jsx(Ns,{...R})},kT=t=>{const e=O.useContext(Mt);return y.jsx("div",{className:t.className,...Kt(t,e),children:t.children})},qt="uhuu_page_editor";function Oe(t){return t.kind==="group"}function ET(t){const e=[];let r=1;for(const n of t)if(Oe(n))for(const a of n.pages)e.push({...a,kind:"page",pageNum:r++});else e.push({...n,pageNum:r++});return e}function TT(t){const e=[];let r=1;for(const n of t)if(Oe(n)){const a=n.pages.map(i=>({...i,kind:"page",pageNum:r++}));e.push({...n,pages:a})}else e.push({...n,pageNum:r++});return e}function Ct(t){return ET(t).length}function AT(t){return t.map(e=>{const r=e.strictPosition;if(Oe(e)){const n=e.pages[0],a=n?.componentKey??n?.id;return{kind:"group",id:e.id,groupId:e.id,firstPageId:n?.id,firstPageComponentKey:a,firstPageComponent:n?.component,pageCount:e.pages.length,label:e.label||`${e.id} (${e.pages.length} pages)`,strictPosition:r}}else{const n=e.componentKey??e.id;return{kind:"page",id:e.id,label:e.label,pageId:e.id,pageComponentKey:n,pageLabel:e.label,pageNum:e.pageNum,pageComponent:e.component,strictPosition:r}}})}function _T(t,e){const r=new Map;e.forEach(a=>{r.set(a.id,a)});const n=[];for(const a of t){const i=r.get(a.id);i&&n.push(i)}return n}function Nl(t){return t.map(e=>{if("kind"in e&&e.kind)return e;if(e.pages&&Array.isArray(e.pages))return{kind:"group",...e,pages:(e.pages??[]).map(i=>{const{kind:o,...s}=i||{};return{kind:"page",...s}})};const{kind:n,...a}=e;return{kind:"page",...a}})}function Zh(t,e=qt){const r=Nl(t);return{key:e,items:r,totalPages:Ct(r),updatedAt:new Date().toISOString()}}function OT(t,e=qt){const r=t?.[e];if(!r?.items)return null;const n=Nl(r.items);return{key:e,items:n,totalPages:Ct(n),updatedAt:r.updatedAt||new Date().toISOString()}}function PT(t,e,r=qt){const n=Zh(e,r);return{...t??{},[r]:n}}function Qh(){return Math.random().toString(36).slice(2,11)}function Jh(t,e,r){return{kind:"page",id:r?.repeatable?Qh():t,componentKey:e,templateId:t,label:r?.label,repeatable:r?.repeatable,maxInstances:r?.maxInstances,...r}}function eg(t,e,r){const n=r?.repeatable?Qh():t;return{kind:"group",id:n,templateId:t,label:r?.label,repeatable:r?.repeatable??!1,maxInstances:r?.maxInstances??null,pages:e.map((a,i)=>{const o=typeof a=="string"?a:a.key,s=typeof a=="string"?void 0:a.dataKey;return{id:`${n}__${s??o}__${i}`,componentKey:o,templateId:o,...s?{dataKey:s}:{}}}),...r}}function tg(t,e){return t<0?e+t+1:t}function rg(t,e,r){for(const n of e){const a=tg(n.start,r),i=tg(n.end,r);if(t>=a&&t<=i)return!0}return!1}function IT(t,e,r=2){switch(t){case"all":return[{start:1,end:e}];case"cover":return[{start:1,end:r},{start:-r,end:-1}];case"text":return e<=r*2?[]:[{start:r+1,end:-(r+1)}];default:return[]}}function NT(t,e){if(!e||e.mode==="all")return t;const r=Ct(t),n=e.mode??"all",a=e.coverPageCount??2,i=n==="custom"&&e.ranges?e.ranges:IT(n,r,a);if(i.length===0)return[];const o=[];for(const s of t)if(Oe(s)){const l=s.pages.filter(c=>c.pageNum&&rg(c.pageNum,i,r));l.length>0&&o.push({...s,pages:l})}else s.pageNum&&rg(s.pageNum,i,r)&&o.push(s);return o}function ng(t,e){if(t?.integrations)return t.integrations[e]}function MT(t,e){return e&&Oe(e)?e.id:t?.id??null}function ag(t,e,r){const n=MT(e,r);return n?{instanceId:n,integration:ng(t,n)}:{instanceId:null,integration:void 0}}function ig(t,e,r){return ag(t,e,r).integration}function og(t,e){if(!t)return null;const r=`integrations.${t}`;return e?`${r}.${e}`:r}function DT(t){if(!t)return{instanceId:null,fieldPath:t,isIntegrationPath:!1};const e="integrations.";if(t.startsWith(e)){const r=t.slice(e.length),n=r.indexOf(".");if(n>0){const a=r.slice(0,n),i=r.slice(n+1);return{instanceId:a,fieldPath:i,isIntegrationPath:!0}}else return{instanceId:r,fieldPath:"",isIntegrationPath:!0}}return{instanceId:null,fieldPath:t,isIntegrationPath:!1}}function zT(t,e,r){if(!e)return r;const n=e.split("."),a={...t};let i=a;for(let s=0;s<n.length-1;s++){const l=n[s];!(l in i)||typeof i[l]!="object"||i[l]===null?i[l]={}:i[l]={...i[l]},i=i[l]}const o=n[n.length-1];return i[o]=r,a}function LT(t,e,r){const n=DT(e);if(!n.isIntegrationPath||!n.instanceId)return t;const{instanceId:a,fieldPath:i}=n,o=ng(t,a)||{},s=zT(o,i,r);return{...t,integrations:{...t?.integrations||{},[a]:s}}}function jn(t,e){if(!t||!e)return;const r=typeof e=="string"?e:e?.id,n=typeof e=="string"?void 0:e?.templateId??e?.componentKey,a=typeof e=="string"?void 0:e?.componentKey,i=Array.from(new Set([r,n,a].filter(Boolean)));for(const o of i)if(t?.pages?.[o]!==void 0)return t.pages[o];for(const o of i)if(t?.groups?.[o]!==void 0)return t.groups[o];for(const o of i)if(t[o]!==void 0)return t[o]}const Nr=T.createContext(null);function jT(t=qt){return[t]}function WT(t,e,r){if(!e)return t;if(!t)return e;const n={...e};return r.forEach(a=>{t[a]!==void 0&&(n[a]=t[a])}),n}function sg({payload:t,onPayloadChange:e,children:r,stateKey:n=qt}){const[a,i]=T.useState(t??{}),o=T.useRef(null),s=T.useRef(!1),l=T.useRef(null),c=T.useRef(0),d=T.useRef(!0),u=T.useCallback(w=>{try{return JSON.stringify(w)}catch{return String(w)}},[]),p=T.useMemo(()=>jT(n),[n]),f=T.useCallback((w,A)=>{if(!w)return null;const _={...w};return A.forEach(I=>{delete _[I]}),_},[]);T.useEffect(()=>{if(d.current){d.current=!1,t&&(o.current=t,i(t));return}if(s.current){s.current=!1,l.current=t,c.current=Date.now(),o.current=t;return}if(t===o.current)return;if(Date.now()-c.current<500&&l.current!==null){const _=f(t,p),I=f(l.current,p),M=_?u(_):null,z=I?u(I):null;if(M&&M===z){l.current=null,o.current=t;return}}o.current=t,i(_=>t?WT(_,t,p):_)},[t,p,u,f]);const v=T.useCallback(w=>{e?.(w),typeof window<"u"&&window.$uhuu?.initPayload&&window.$uhuu.initPayload(w)},[e]),m=T.useCallback(w=>{s.current=!0,i(A=>{const _=typeof w=="function"?w(A):w;let I=_;return _&&typeof _=="object"&&Object.keys(_).filter(z=>z.startsWith("integrations.")||z==="integrations").length>0&&_.integrations&&(I=_),l.current=I,c.current=Date.now(),v(I),I})},[v]),g=T.useCallback((w,A,_)=>{m(I=>({...I??{},pages:{...I?.pages??{},[w]:{...I?.pages?.[w]??{},[A]:_}}}))},[m]),C=T.useCallback((w,A)=>{m(_=>{const I=_?.integrations??{},M=I[w],z=typeof A=="function"?A(M):A;return{..._??{},integrations:{...I,[w]:z}}})},[m]),x=T.useCallback((w,A,_)=>{C(w,I=>({...I??{},[A]:_}))},[C]),h=T.useCallback(w=>{m(A=>{if(!A?.integrations||!A.integrations[w])return A;const{[w]:_,...I}=A.integrations;return{...A,integrations:Object.keys(I).length>0?I:void 0}})},[m]),b=T.useCallback((w,A)=>{m(_=>LT(_,w,A))},[m]),S=T.useCallback((w,A)=>{const _=A??n;m(I=>PT(I,w,_))},[m,n]),E=T.useCallback(w=>jn(a,w),[a]),k=T.useMemo(()=>({payload:a,setPayload:m,setPageOptionValue:g,setIntegrationPayload:C,setIntegrationPayloadValue:x,removeIntegrationPayload:h,updateIntegrationByDialogPath:b,mergePageEditorState:S,getPagePayload:E}),[a,m,g,C,x,h,b,S,E]);return y.jsx(Nr.Provider,{value:k,children:r})}function BT(t){return t.defaultValue!==void 0?t.defaultValue:t.type==="toggle"?!1:t.type==="slider"||t.type==="counter"?0:""}function qT(t,e){return t.type==="toggle"?e===!0||e==="true":t.type==="slider"||t.type==="counter"?Number(e):e}function RT(t,e,r){const n=t.field??t.id;return{...t,getValue:i=>{const o=e?.pages?.[i.id]?.[n];return o===void 0?BT(t):t.type==="toggle"?!!o:o},onChange:(i,o)=>{r(i,n,qT(t,o))}}}const Wn=O.createContext({zoom:100,scaleValue:1,hideUI:!1});function FT({children:t,layout:e="spread"}){const{scaleValue:r}=O.useContext(Wn),n=O.useRef(null);return O.useEffect(()=>{if(!n.current)return;const a=()=>{const s=n.current?.querySelectorAll("[data-section-content]");if(!s?.length)return;const l=Array.from(s).reduce((c,d)=>{const u=Number.parseInt(d.getAttribute("data-natural-width")||"0");return c+u},0);if(l>0){const c=l*r;n.current?.style.setProperty("--uhuu-group-pair-width",`${c}px`)}};a();const i=new ResizeObserver(a);return n.current.querySelectorAll("[data-section-content]").forEach(s=>i.observe(s)),()=>i.disconnect()},[t,r]),y.jsx("div",{ref:n,className:`two-pages-pair two-pages-pair--${e}`,children:t})}function Bn({children:t,title:e,className:r="",controls:n,origin:a="center"}){const{scaleValue:i,hideUI:o}=O.useContext(Wn),s=O.useRef(null),[l,c]=O.useState(0),[d,u]=O.useState(0);O.useEffect(()=>{if(s.current){const C=()=>{const h=s.current;if(h){const b=h.style.transform;h.style.transform="scale(1)";const S=h.scrollHeight,E=h.scrollWidth;h.style.transform=b,c(S),u(E)}};C();const x=new ResizeObserver(C);return x.observe(s.current),()=>{x.disconnect()}}},[t]);const p=l*i,f=Math.max(d*i,150),v={left:{justify:"justify-start",origin:"top left"},right:{justify:"justify-end",origin:"top right"},center:{justify:"justify-center",origin:"top center"}},{justify:m,origin:g}=v[a];return o?y.jsx("div",{className:r,children:t}):y.jsxs("div",{className:`group/section ${r}`,style:{width:`${f}px`,minWidth:"150px"},children:[y.jsx("div",{children:n??y.jsx("div",{className:"px-4 py-2 border-b border-gray-200",children:y.jsxs("div",{className:"text-sm font-medium text-gray-700",children:[e," Controls"]})})}),y.jsx("div",{className:"pt-1",style:{height:p>0?`${p+32}px`:"auto",minHeight:"100px"},children:y.jsx("div",{className:`flex items-start ${m}`,children:y.jsx("div",{ref:s,"data-section-content":!0,"data-natural-width":d,"data-natural-height":l,style:{transform:`scale(${i})`,transformOrigin:g},children:t})})})]})}function $T({children:t,className:e="",defaultZoom:r=100,minZoom:n=25,maxZoom:a=200,onAddPage:i,menuItems:o,hideUI:s,preview:l="single_page"}){const c=js(),d=s??c,[u,p]=O.useState(r),[f,v]=O.useState("none"),m=O.useRef(null),g=O.useRef(null),[C,x]=O.useState(!1),[h,b]=O.useState(0),[S,E]=O.useState(!0),k=M=>{if(!m.current||!g.current)return u;const z=m.current.getBoundingClientRect(),R=g.current.querySelector("[data-section-content]");if(!R)return u;let H=Number.parseInt(R.getAttribute("data-natural-width")||"0");const D=Number.parseInt(R.getAttribute("data-natural-height")||"0");if(H===0||D===0)return u;l==="two_pages"&&(H=H*2);const F=z.width-32,q=screen.height-120,P=F/H*100,j=q/D*100;switch(M){case"width":return Math.min(Math.max(P,n),a);case"height":return Math.min(Math.max(j,n),a);case"both":return Math.min(Math.max(Math.min(P,j),n),a);default:return u}},w=M=>{if(v(M),M!=="none"){const z=k(M);p(z)}},A=()=>{const M=Math.min(u+25,a);p(M),v("none")},_=()=>{const M=Math.max(u-25,n);p(M),v("none")};O.useEffect(()=>{const M=()=>{if(!m.current||!g.current)return;const H=m.current.getBoundingClientRect().width;if(!C){const D=g.current.querySelector("[data-section-content]");if(D){const F=Number.parseInt(D.getAttribute("data-natural-width")||"0");if(F>0){if(F>H-48){const q=k("both");v("both"),p(q)}x(!0),b(H),E(!1);return}}if(S){setTimeout(M,50);return}}E(!1)},z=()=>{if(!m.current||S)return;const H=m.current.getBoundingClientRect().width;if(Math.abs(H-h)>10){if(f!=="none"){const D=k(f);p(D)}b(H)}};return M(),window.addEventListener("resize",z),()=>{window.removeEventListener("resize",z)}},[f,n,a,C,h,S]);const I=u/100;return d?y.jsx(Wn.Provider,{value:{zoom:100,scaleValue:1,hideUI:!0},children:y.jsx("div",{className:e,children:t})}):y.jsx(Wn.Provider,{value:{zoom:u,scaleValue:I,hideUI:!1},children:y.jsxs("div",{ref:m,className:`flex flex-col min-h-0 ${e}`,children:[y.jsxs("div",{"data-uhuu-editor":!0,className:"fixed right-4 bottom-4 z-50 flex items-center gap-1.5 px-2.5 py-1.5 bg-white/90 backdrop-blur-md border border-gray-200/60 rounded-lg shadow-sm",children:[o,y.jsx("div",{className:"h-4 w-px bg-gray-200 mx-0.5"}),y.jsxs(Dn,{modal:!1,children:[y.jsx(zn,{asChild:!0,children:y.jsxs(Ae,{variant:"ghost",size:"sm",title:"Zoom",className:"text-xs font-medium text-gray-700 hover:bg-gray-100/80 h-7 px-2.5",children:[Math.round(u),"%",y.jsx(iw,{className:"w-3 h-3 ml-1 opacity-60"})]})}),y.jsxs(Ir,{className:"w-52 p-1.5",align:"end",children:[y.jsxs(Bt,{onClick:()=>w("width"),className:`cursor-pointer flex items-center ${f==="width"?"bg-gray-100":""}`,children:[y.jsx(uw,{className:"w-4 h-4 mr-2"}),y.jsx("span",{children:"Fit to Width"})]}),y.jsxs(Bt,{onClick:()=>w("height"),className:`cursor-pointer flex items-center ${f==="height"?"bg-gray-100":""}`,children:[y.jsx(pw,{className:"w-4 h-4 mr-2"}),y.jsx("span",{children:"Fit to Height"})]}),y.jsxs(Bt,{onClick:()=>w("both"),className:`cursor-pointer flex items-center ${f==="both"?"bg-gray-100":""}`,children:[y.jsx(sw,{className:"w-4 h-4 mr-2"}),y.jsx("span",{children:"Fit to Page"})]}),y.jsx(Ln,{className:"my-1.5"}),y.jsxs("div",{className:"flex items-center justify-center gap-2 px-3 py-2.5",onClick:M=>M.stopPropagation(),children:[y.jsx(Ae,{variant:"ghost",size:"sm",onClick:M=>{M.stopPropagation(),_()},disabled:u<=n,className:"h-8 w-8 p-0 hover:bg-gray-100 disabled:opacity-40",title:"Zoom out (25%)",children:y.jsx(mw,{className:"w-4 h-4"})}),y.jsxs("div",{className:"relative",children:[y.jsx("input",{type:"number",value:Math.round(u),onChange:M=>{const z=Number.parseInt(M.target.value);if(!isNaN(z)){const R=Math.min(Math.max(z,n),a);p(R),v("none")}},onFocus:M=>M.target.select(),className:"w-20 pr-6 text-center text-sm text-gray-700 bg-white border border-gray-300 rounded px-2 py-1.5 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all",min:n,max:a}),y.jsx("span",{className:"absolute right-2 top-1/2 -translate-y-1/2 text-xs text-gray-400 pointer-events-none",children:"%"})]}),y.jsx(Ae,{variant:"ghost",size:"sm",onClick:M=>{M.stopPropagation(),A()},disabled:u>=a,className:"h-8 w-8 p-0 hover:bg-gray-100 disabled:opacity-40",title:"Zoom in (25%)",children:y.jsx(fw,{className:"w-4 h-4"})})]})]})]})]}),y.jsx("div",{ref:g,children:y.jsx("div",{className:l==="two_pages"?"group_two_pages":"flex flex-col items-center",children:t})}),y.jsx("div",{className:"flex justify-center pb-16",children:y.jsx(Ae,{size:"sm",variant:"outline",onClick:()=>i?i():null,children:y.jsx(it,{})})})]})})}var qn="Dialog",[lg,cg]=st(qn),[GT,He]=lg(qn),dg=t=>{const{__scopeDialog:e,children:r,open:n,defaultOpen:a,onOpenChange:i,modal:o=!0}=t,s=T.useRef(null),l=T.useRef(null),[c,d]=xr({prop:n,defaultProp:a??!1,onChange:i,caller:qn});return y.jsx(GT,{scope:e,triggerRef:s,contentRef:l,contentId:Yt(),titleId:Yt(),descriptionId:Yt(),open:c,onOpenChange:d,onOpenToggle:T.useCallback(()=>d(u=>!u),[d]),modal:o,children:r})};dg.displayName=qn;var ug="DialogTrigger",pg=T.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,a=He(ug,r),i=me(e,a.triggerRef);return y.jsx(he.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":zl(a.open),...n,ref:i,onClick:ie(t.onClick,a.onOpenToggle)})});pg.displayName=ug;var Ml="DialogPortal",[VT,fg]=lg(Ml,{forceMount:void 0}),mg=t=>{const{__scopeDialog:e,forceMount:r,children:n,container:a}=t,i=He(Ml,e);return y.jsx(VT,{scope:e,forceMount:r,children:T.Children.map(n,o=>y.jsx(wt,{present:r||i.open,children:y.jsx(dl,{asChild:!0,container:a,children:o})}))})};mg.displayName=Ml;var Rn="DialogOverlay",hg=T.forwardRef((t,e)=>{const r=fg(Rn,t.__scopeDialog),{forceMount:n=r.forceMount,...a}=t,i=He(Rn,t.__scopeDialog);return i.modal?y.jsx(wt,{present:n||i.open,children:y.jsx(UT,{...a,ref:e})}):null});hg.displayName=Rn;var HT=wr("DialogOverlay.RemoveScroll"),UT=T.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,a=He(Rn,r);return y.jsx(yl,{as:HT,allowPinchZoom:!0,shards:[a.contentRef],children:y.jsx(he.div,{"data-state":zl(a.open),...n,ref:e,style:{pointerEvents:"auto",...n.style}})})}),Rt="DialogContent",gg=T.forwardRef((t,e)=>{const r=fg(Rt,t.__scopeDialog),{forceMount:n=r.forceMount,...a}=t,i=He(Rt,t.__scopeDialog);return y.jsx(wt,{present:n||i.open,children:i.modal?y.jsx(KT,{...a,ref:e}):y.jsx(YT,{...a,ref:e})})});gg.displayName=Rt;var KT=T.forwardRef((t,e)=>{const r=He(Rt,t.__scopeDialog),n=T.useRef(null),a=me(e,r.contentRef,n);return T.useEffect(()=>{const i=n.current;if(i)return Gm(i)},[]),y.jsx(vg,{...t,ref:a,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ie(t.onCloseAutoFocus,i=>{i.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:ie(t.onPointerDownOutside,i=>{const o=i.detail.originalEvent,s=o.button===0&&o.ctrlKey===!0;(o.button===2||s)&&i.preventDefault()}),onFocusOutside:ie(t.onFocusOutside,i=>i.preventDefault())})}),YT=T.forwardRef((t,e)=>{const r=He(Rt,t.__scopeDialog),n=T.useRef(!1),a=T.useRef(!1);return y.jsx(vg,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{t.onCloseAutoFocus?.(i),i.defaultPrevented||(n.current||r.triggerRef.current?.focus(),i.preventDefault()),n.current=!1,a.current=!1},onInteractOutside:i=>{t.onInteractOutside?.(i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const o=i.target;r.triggerRef.current?.contains(o)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),vg=T.forwardRef((t,e)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:a,onCloseAutoFocus:i,...o}=t,s=He(Rt,r),l=T.useRef(null),c=me(e,l);return Zf(),y.jsxs(y.Fragment,{children:[y.jsx(Ys,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:a,onUnmountAutoFocus:i,children:y.jsx(Vs,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":zl(s.open),...o,ref:c,onDismiss:()=>s.onOpenChange(!1)})}),y.jsxs(y.Fragment,{children:[y.jsx(ZT,{titleId:s.titleId}),y.jsx(JT,{contentRef:l,descriptionId:s.descriptionId})]})]})}),Dl="DialogTitle",yg=T.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,a=He(Dl,r);return y.jsx(he.h2,{id:a.titleId,...n,ref:e})});yg.displayName=Dl;var bg="DialogDescription",Sg=T.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,a=He(bg,r);return y.jsx(he.p,{id:a.descriptionId,...n,ref:e})});Sg.displayName=bg;var xg="DialogClose",wg=T.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,a=He(xg,r);return y.jsx(he.button,{type:"button",...n,ref:e,onClick:ie(t.onClick,()=>a.onOpenChange(!1))})});wg.displayName=xg;function zl(t){return t?"open":"closed"}var Cg="DialogTitleWarning",[XT,kg]=oC(Cg,{contentName:Rt,titleName:Dl,docsSlug:"dialog"}),ZT=({titleId:t})=>{const e=kg(Cg),r=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users.
|
|
874
|
+
`)},tE=0,nr=[];function rE(t){var e=T.useRef([]),r=T.useRef([0,0]),n=T.useRef(),a=T.useState(tE++)[0],i=T.useState(Ym)[0],o=T.useRef(t);T.useEffect(function(){o.current=t},[t]),T.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(a));var m=Ck([t.lockRef.current],(t.shards||[]).map(rh),!0).filter(Boolean);return m.forEach(function(g){return g.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),m.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(a))})}}},[t.inert,t.lockRef.current,t.shards]);var s=T.useCallback(function(m,g){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!o.current.allowPinchZoom;var C=_n(m),x=r.current,h="deltaX"in m?m.deltaX:x[0]-C[0],b="deltaY"in m?m.deltaY:x[1]-C[1],S,E=m.target,k=Math.abs(h)>Math.abs(b)?"h":"v";if("touches"in m&&k==="h"&&E.type==="range")return!1;var w=window.getSelection(),A=w&&w.anchorNode,_=A?A===E||A.contains(E):!1;if(_)return!1;var I=Qm(k,E);if(!I)return!0;if(I?S=k:(S=k==="v"?"h":"v",I=Qm(k,E)),!I)return!1;if(!n.current&&"changedTouches"in m&&(h||b)&&(n.current=S),!S)return!0;var M=n.current||S;return Qk(M,g,m,M==="h"?h:b)},[]),l=T.useCallback(function(m){var g=m;if(!(!nr.length||nr[nr.length-1]!==i)){var C="deltaY"in g?th(g):_n(g),x=e.current.filter(function(S){return S.name===g.type&&(S.target===g.target||g.target===S.shadowParent)&&Jk(S.delta,C)})[0];if(x&&x.should){g.cancelable&&g.preventDefault();return}if(!x){var h=(o.current.shards||[]).map(rh).filter(Boolean).filter(function(S){return S.contains(g.target)}),b=h.length>0?s(g,h[0]):!o.current.noIsolation;b&&g.cancelable&&g.preventDefault()}}},[]),c=T.useCallback(function(m,g,C,x){var h={name:m,delta:g,target:C,should:x,shadowParent:nE(C)};e.current.push(h),setTimeout(function(){e.current=e.current.filter(function(b){return b!==h})},1)},[]),d=T.useCallback(function(m){r.current=_n(m),n.current=void 0},[]),u=T.useCallback(function(m){c(m.type,th(m),m.target,s(m,t.lockRef.current))},[]),p=T.useCallback(function(m){c(m.type,_n(m),m.target,s(m,t.lockRef.current))},[]);T.useEffect(function(){return nr.push(i),t.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:p}),document.addEventListener("wheel",l,rr),document.addEventListener("touchmove",l,rr),document.addEventListener("touchstart",d,rr),function(){nr=nr.filter(function(m){return m!==i}),document.removeEventListener("wheel",l,rr),document.removeEventListener("touchmove",l,rr),document.removeEventListener("touchstart",d,rr)}},[]);var f=t.removeScrollBar,v=t.inert;return T.createElement(T.Fragment,null,v?T.createElement(i,{styles:eE(a)}):null,f?T.createElement(Vk,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function nE(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const aE=Nk(Km,rE);var yl=T.forwardRef(function(t,e){return T.createElement(Tn,Je({},t,{ref:e,sideCar:aE}))});yl.classNames=Tn.classNames;var bl=["Enter"," "],iE=["ArrowDown","PageUp","Home"],nh=["ArrowUp","PageDown","End"],oE=[...iE,...nh],sE={ltr:[...bl,"ArrowRight"],rtl:[...bl,"ArrowLeft"]},lE={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Tr="Menu",[Ar,cE,dE]=Fs(Tr),[jt,ah]=st(Tr,[dE,_m,Wm]),On=_m(),ih=Wm(),[uE,Wt]=jt(Tr),[pE,_r]=jt(Tr),oh=t=>{const{__scopeMenu:e,open:r=!1,children:n,dir:a,onOpenChange:i,modal:o=!0}=t,s=On(e),[l,c]=T.useState(null),d=T.useRef(!1),u=lt(i),p=$s(a);return T.useEffect(()=>{const f=()=>{d.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},v=()=>d.current=!1;return document.addEventListener("keydown",f,{capture:!0}),()=>{document.removeEventListener("keydown",f,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),y.jsx(ek,{...s,children:y.jsx(uE,{scope:e,open:r,onOpenChange:u,content:l,onContentChange:c,children:y.jsx(pE,{scope:e,onClose:T.useCallback(()=>u(!1),[u]),isUsingKeyboardRef:d,dir:p,modal:o,children:n})})})};oh.displayName=Tr;var fE="MenuAnchor",Sl=T.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t,a=On(r);return y.jsx(tk,{...a,...n,ref:e})});Sl.displayName=fE;var xl="MenuPortal",[mE,sh]=jt(xl,{forceMount:void 0}),lh=t=>{const{__scopeMenu:e,forceMount:r,children:n,container:a}=t,i=Wt(xl,e);return y.jsx(mE,{scope:e,forceMount:r,children:y.jsx(wt,{present:r||i.open,children:y.jsx(dl,{asChild:!0,container:a,children:n})})})};lh.displayName=xl;var qe="MenuContent",[hE,wl]=jt(qe),ch=T.forwardRef((t,e)=>{const r=sh(qe,t.__scopeMenu),{forceMount:n=r.forceMount,...a}=t,i=Wt(qe,t.__scopeMenu),o=_r(qe,t.__scopeMenu);return y.jsx(Ar.Provider,{scope:t.__scopeMenu,children:y.jsx(wt,{present:n||i.open,children:y.jsx(Ar.Slot,{scope:t.__scopeMenu,children:o.modal?y.jsx(gE,{...a,ref:e}):y.jsx(vE,{...a,ref:e})})})})}),gE=T.forwardRef((t,e)=>{const r=Wt(qe,t.__scopeMenu),n=T.useRef(null),a=me(e,n);return T.useEffect(()=>{const i=n.current;if(i)return Gm(i)},[]),y.jsx(Cl,{...t,ref:a,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:ie(t.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),vE=T.forwardRef((t,e)=>{const r=Wt(qe,t.__scopeMenu);return y.jsx(Cl,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),yE=wr("MenuContent.ScrollLock"),Cl=T.forwardRef((t,e)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:u,onInteractOutside:p,onDismiss:f,disableOutsideScroll:v,...m}=t,g=Wt(qe,r),C=_r(qe,r),x=On(r),h=ih(r),b=cE(r),[S,E]=T.useState(null),k=T.useRef(null),w=me(e,k,g.onContentChange),A=T.useRef(0),_=T.useRef(""),I=T.useRef(0),M=T.useRef(null),z=T.useRef("right"),R=T.useRef(0),H=v?yl:T.Fragment,D=v?{as:yE,allowPinchZoom:!0}:void 0,F=P=>{const j=_.current+P,Y=b().filter(U=>!U.disabled),X=document.activeElement,W=Y.find(U=>U.ref.current===X)?.textValue,L=Y.map(U=>U.textValue),B=PE(L,j,W),V=Y.find(U=>U.textValue===B)?.ref.current;(function U(se){_.current=se,window.clearTimeout(A.current),se!==""&&(A.current=window.setTimeout(()=>U(""),1e3))})(j),V&&setTimeout(()=>V.focus())};T.useEffect(()=>()=>window.clearTimeout(A.current),[]),Zf();const q=T.useCallback(P=>z.current===M.current?.side&&NE(P,M.current?.area),[]);return y.jsx(hE,{scope:r,searchRef:_,onItemEnter:T.useCallback(P=>{q(P)&&P.preventDefault()},[q]),onItemLeave:T.useCallback(P=>{q(P)||(k.current?.focus(),E(null))},[q]),onTriggerLeave:T.useCallback(P=>{q(P)&&P.preventDefault()},[q]),pointerGraceTimerRef:I,onPointerGraceIntentChange:T.useCallback(P=>{M.current=P},[]),children:y.jsx(H,{...D,children:y.jsx(Ys,{asChild:!0,trapped:a,onMountAutoFocus:ie(i,P=>{P.preventDefault(),k.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:y.jsx(Vs,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:u,onInteractOutside:p,onDismiss:f,children:y.jsx(yk,{asChild:!0,...h,dir:C.dir,orientation:"vertical",loop:n,currentTabStopId:S,onCurrentTabStopIdChange:E,onEntryFocus:ie(l,P=>{C.isUsingKeyboardRef.current||P.preventDefault()}),preventScrollOnEntryFocus:!0,children:y.jsx(rk,{role:"menu","aria-orientation":"vertical","data-state":Th(g.open),"data-radix-menu-content":"",dir:C.dir,...x,...m,ref:w,style:{outline:"none",...m.style},onKeyDown:ie(m.onKeyDown,P=>{const Y=P.target.closest("[data-radix-menu-content]")===P.currentTarget,X=P.ctrlKey||P.altKey||P.metaKey,W=P.key.length===1;Y&&(P.key==="Tab"&&P.preventDefault(),!X&&W&&F(P.key));const L=k.current;if(P.target!==L||!oE.includes(P.key))return;P.preventDefault();const V=b().filter(U=>!U.disabled).map(U=>U.ref.current);nh.includes(P.key)&&V.reverse(),_E(V)}),onBlur:ie(t.onBlur,P=>{P.currentTarget.contains(P.target)||(window.clearTimeout(A.current),_.current="")}),onPointerMove:ie(t.onPointerMove,Pr(P=>{const j=P.target,Y=R.current!==P.clientX;if(P.currentTarget.contains(j)&&Y){const X=P.clientX>R.current?"right":"left";z.current=X,R.current=P.clientX}}))})})})})})})});ch.displayName=qe;var bE="MenuGroup",kl=T.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t;return y.jsx(he.div,{role:"group",...n,ref:e})});kl.displayName=bE;var SE="MenuLabel",dh=T.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t;return y.jsx(he.div,{...n,ref:e})});dh.displayName=SE;var Pn="MenuItem",uh="menu.itemSelect",In=T.forwardRef((t,e)=>{const{disabled:r=!1,onSelect:n,...a}=t,i=T.useRef(null),o=_r(Pn,t.__scopeMenu),s=wl(Pn,t.__scopeMenu),l=me(e,i),c=T.useRef(!1),d=()=>{const u=i.current;if(!r&&u){const p=new CustomEvent(uh,{bubbles:!0,cancelable:!0});u.addEventListener(uh,f=>n?.(f),{once:!0}),Hf(u,p),p.defaultPrevented?c.current=!1:o.onClose()}};return y.jsx(ph,{...a,ref:l,disabled:r,onClick:ie(t.onClick,d),onPointerDown:u=>{t.onPointerDown?.(u),c.current=!0},onPointerUp:ie(t.onPointerUp,u=>{c.current||u.currentTarget?.click()}),onKeyDown:ie(t.onKeyDown,u=>{const p=s.searchRef.current!=="";r||p&&u.key===" "||bl.includes(u.key)&&(u.currentTarget.click(),u.preventDefault())})})});In.displayName=Pn;var ph=T.forwardRef((t,e)=>{const{__scopeMenu:r,disabled:n=!1,textValue:a,...i}=t,o=wl(Pn,r),s=ih(r),l=T.useRef(null),c=me(e,l),[d,u]=T.useState(!1),[p,f]=T.useState("");return T.useEffect(()=>{const v=l.current;v&&f((v.textContent??"").trim())},[i.children]),y.jsx(Ar.ItemSlot,{scope:r,disabled:n,textValue:a??p,children:y.jsx(bk,{asChild:!0,...s,focusable:!n,children:y.jsx(he.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...i,ref:c,onPointerMove:ie(t.onPointerMove,Pr(v=>{n?o.onItemLeave(v):(o.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ie(t.onPointerLeave,Pr(v=>o.onItemLeave(v))),onFocus:ie(t.onFocus,()=>u(!0)),onBlur:ie(t.onBlur,()=>u(!1))})})})}),xE="MenuCheckboxItem",fh=T.forwardRef((t,e)=>{const{checked:r=!1,onCheckedChange:n,...a}=t;return y.jsx(yh,{scope:t.__scopeMenu,checked:r,children:y.jsx(In,{role:"menuitemcheckbox","aria-checked":Nn(r)?"mixed":r,...a,ref:e,"data-state":Tl(r),onSelect:ie(a.onSelect,()=>n?.(Nn(r)?!0:!r),{checkForDefaultPrevented:!1})})})});fh.displayName=xE;var mh="MenuRadioGroup",[wE,CE]=jt(mh,{value:void 0,onValueChange:()=>{}}),hh=T.forwardRef((t,e)=>{const{value:r,onValueChange:n,...a}=t,i=lt(n);return y.jsx(wE,{scope:t.__scopeMenu,value:r,onValueChange:i,children:y.jsx(kl,{...a,ref:e})})});hh.displayName=mh;var gh="MenuRadioItem",vh=T.forwardRef((t,e)=>{const{value:r,...n}=t,a=CE(gh,t.__scopeMenu),i=r===a.value;return y.jsx(yh,{scope:t.__scopeMenu,checked:i,children:y.jsx(In,{role:"menuitemradio","aria-checked":i,...n,ref:e,"data-state":Tl(i),onSelect:ie(n.onSelect,()=>a.onValueChange?.(r),{checkForDefaultPrevented:!1})})})});vh.displayName=gh;var El="MenuItemIndicator",[yh,kE]=jt(El,{checked:!1}),bh=T.forwardRef((t,e)=>{const{__scopeMenu:r,forceMount:n,...a}=t,i=kE(El,r);return y.jsx(wt,{present:n||Nn(i.checked)||i.checked===!0,children:y.jsx(he.span,{...a,ref:e,"data-state":Tl(i.checked)})})});bh.displayName=El;var EE="MenuSeparator",Sh=T.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t;return y.jsx(he.div,{role:"separator","aria-orientation":"horizontal",...n,ref:e})});Sh.displayName=EE;var TE="MenuArrow",xh=T.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t,a=On(r);return y.jsx(nk,{...a,...n,ref:e})});xh.displayName=TE;var AE="MenuSub",[tI,wh]=jt(AE),Or="MenuSubTrigger",Ch=T.forwardRef((t,e)=>{const r=Wt(Or,t.__scopeMenu),n=_r(Or,t.__scopeMenu),a=wh(Or,t.__scopeMenu),i=wl(Or,t.__scopeMenu),o=T.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:l}=i,c={__scopeMenu:t.__scopeMenu},d=T.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return T.useEffect(()=>d,[d]),T.useEffect(()=>{const u=s.current;return()=>{window.clearTimeout(u),l(null)}},[s,l]),y.jsx(Sl,{asChild:!0,...c,children:y.jsx(ph,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":a.contentId,"data-state":Th(r.open),...t,ref:Sr(e,a.onTriggerChange),onClick:u=>{t.onClick?.(u),!(t.disabled||u.defaultPrevented)&&(u.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:ie(t.onPointerMove,Pr(u=>{i.onItemEnter(u),!u.defaultPrevented&&!t.disabled&&!r.open&&!o.current&&(i.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{r.onOpenChange(!0),d()},100))})),onPointerLeave:ie(t.onPointerLeave,Pr(u=>{d();const p=r.content?.getBoundingClientRect();if(p){const f=r.content?.dataset.side,v=f==="right",m=v?-5:5,g=p[v?"left":"right"],C=p[v?"right":"left"];i.onPointerGraceIntentChange({area:[{x:u.clientX+m,y:u.clientY},{x:g,y:p.top},{x:C,y:p.top},{x:C,y:p.bottom},{x:g,y:p.bottom}],side:f}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(u),u.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:ie(t.onKeyDown,u=>{const p=i.searchRef.current!=="";t.disabled||p&&u.key===" "||sE[n.dir].includes(u.key)&&(r.onOpenChange(!0),r.content?.focus(),u.preventDefault())})})})});Ch.displayName=Or;var kh="MenuSubContent",Eh=T.forwardRef((t,e)=>{const r=sh(qe,t.__scopeMenu),{forceMount:n=r.forceMount,...a}=t,i=Wt(qe,t.__scopeMenu),o=_r(qe,t.__scopeMenu),s=wh(kh,t.__scopeMenu),l=T.useRef(null),c=me(e,l);return y.jsx(Ar.Provider,{scope:t.__scopeMenu,children:y.jsx(wt,{present:n||i.open,children:y.jsx(Ar.Slot,{scope:t.__scopeMenu,children:y.jsx(Cl,{id:s.contentId,"aria-labelledby":s.triggerId,...a,ref:c,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{o.isUsingKeyboardRef.current&&l.current?.focus(),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:ie(t.onFocusOutside,d=>{d.target!==s.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:ie(t.onEscapeKeyDown,d=>{o.onClose(),d.preventDefault()}),onKeyDown:ie(t.onKeyDown,d=>{const u=d.currentTarget.contains(d.target),p=lE[o.dir].includes(d.key);u&&p&&(i.onOpenChange(!1),s.trigger?.focus(),d.preventDefault())})})})})})});Eh.displayName=kh;function Th(t){return t?"open":"closed"}function Nn(t){return t==="indeterminate"}function Tl(t){return Nn(t)?"indeterminate":t?"checked":"unchecked"}function _E(t){const e=document.activeElement;for(const r of t)if(r===e||(r.focus(),document.activeElement!==e))return}function OE(t,e){return t.map((r,n)=>t[(e+n)%t.length])}function PE(t,e,r){const a=e.length>1&&Array.from(e).every(c=>c===e[0])?e[0]:e,i=r?t.indexOf(r):-1;let o=OE(t,Math.max(i,0));a.length===1&&(o=o.filter(c=>c!==r));const l=o.find(c=>c.toLowerCase().startsWith(a.toLowerCase()));return l!==r?l:void 0}function IE(t,e){const{x:r,y:n}=t;let a=!1;for(let i=0,o=e.length-1;i<e.length;o=i++){const s=e[i],l=e[o],c=s.x,d=s.y,u=l.x,p=l.y;d>n!=p>n&&r<(u-c)*(n-d)/(p-d)+c&&(a=!a)}return a}function NE(t,e){if(!e)return!1;const r={x:t.clientX,y:t.clientY};return IE(r,e)}function Pr(t){return e=>e.pointerType==="mouse"?t(e):void 0}var ME=oh,DE=Sl,zE=lh,LE=ch,jE=kl,WE=dh,BE=In,qE=fh,RE=hh,FE=vh,$E=bh,GE=Sh,VE=xh,HE=Ch,UE=Eh,Mn="DropdownMenu",[KE]=st(Mn,[ah]),_e=ah(),[YE,Ah]=KE(Mn),_h=t=>{const{__scopeDropdownMenu:e,children:r,dir:n,open:a,defaultOpen:i,onOpenChange:o,modal:s=!0}=t,l=_e(e),c=T.useRef(null),[d,u]=xr({prop:a,defaultProp:i??!1,onChange:o,caller:Mn});return y.jsx(YE,{scope:e,triggerId:Yt(),triggerRef:c,contentId:Yt(),open:d,onOpenChange:u,onOpenToggle:T.useCallback(()=>u(p=>!p),[u]),modal:s,children:y.jsx(ME,{...l,open:d,onOpenChange:u,dir:n,modal:s,children:r})})};_h.displayName=Mn;var Oh="DropdownMenuTrigger",Ph=T.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...a}=t,i=Ah(Oh,r),o=_e(r);return y.jsx(DE,{asChild:!0,...o,children:y.jsx(he.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...a,ref:Sr(e,i.triggerRef),onPointerDown:ie(t.onPointerDown,s=>{!n&&s.button===0&&s.ctrlKey===!1&&(i.onOpenToggle(),i.open||s.preventDefault())}),onKeyDown:ie(t.onKeyDown,s=>{n||(["Enter"," "].includes(s.key)&&i.onOpenToggle(),s.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(s.key)&&s.preventDefault())})})})});Ph.displayName=Oh;var XE="DropdownMenuPortal",Ih=t=>{const{__scopeDropdownMenu:e,...r}=t,n=_e(e);return y.jsx(zE,{...n,...r})};Ih.displayName=XE;var Nh="DropdownMenuContent",Mh=T.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,a=Ah(Nh,r),i=_e(r),o=T.useRef(!1);return y.jsx(LE,{id:a.contentId,"aria-labelledby":a.triggerId,...i,...n,ref:e,onCloseAutoFocus:ie(t.onCloseAutoFocus,s=>{o.current||a.triggerRef.current?.focus(),o.current=!1,s.preventDefault()}),onInteractOutside:ie(t.onInteractOutside,s=>{const l=s.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,d=l.button===2||c;(!a.modal||d)&&(o.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Mh.displayName=Nh;var ZE="DropdownMenuGroup",QE=T.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,a=_e(r);return y.jsx(jE,{...a,...n,ref:e})});QE.displayName=ZE;var JE="DropdownMenuLabel",Dh=T.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,a=_e(r);return y.jsx(WE,{...a,...n,ref:e})});Dh.displayName=JE;var eT="DropdownMenuItem",zh=T.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,a=_e(r);return y.jsx(BE,{...a,...n,ref:e})});zh.displayName=eT;var tT="DropdownMenuCheckboxItem",Lh=T.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,a=_e(r);return y.jsx(qE,{...a,...n,ref:e})});Lh.displayName=tT;var rT="DropdownMenuRadioGroup",jh=T.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,a=_e(r);return y.jsx(RE,{...a,...n,ref:e})});jh.displayName=rT;var nT="DropdownMenuRadioItem",Wh=T.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,a=_e(r);return y.jsx(FE,{...a,...n,ref:e})});Wh.displayName=nT;var aT="DropdownMenuItemIndicator",iT=T.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,a=_e(r);return y.jsx($E,{...a,...n,ref:e})});iT.displayName=aT;var oT="DropdownMenuSeparator",Bh=T.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,a=_e(r);return y.jsx(GE,{...a,...n,ref:e})});Bh.displayName=oT;var sT="DropdownMenuArrow",lT=T.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,a=_e(r);return y.jsx(VE,{...a,...n,ref:e})});lT.displayName=sT;var cT="DropdownMenuSubTrigger",qh=T.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,a=_e(r);return y.jsx(HE,{...a,...n,ref:e})});qh.displayName=cT;var dT="DropdownMenuSubContent",Rh=T.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,a=_e(r);return y.jsx(UE,{...a,...n,ref:e,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Rh.displayName=dT;var uT=_h,pT=Ph,fT=Ih,Fh=Mh,$h=Dh,Gh=zh,Vh=Lh,mT=jh,Hh=Wh,Uh=Bh,Kh=qh,Yh=Rh;const Dn=uT,zn=pT,hT=mT,gT=T.forwardRef(({className:t,inset:e,children:r,...n},a)=>y.jsx(Kh,{ref:a,className:pe("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-gray-100 data-[state=open]:bg-gray-100",e&&"pl-8",t),...n,children:r}));gT.displayName=Kh.displayName;const vT=T.forwardRef(({className:t,...e},r)=>y.jsx(Yh,{ref:r,className:pe("z-50 min-w-[8rem] overflow-hidden rounded-md border border-gray-200 bg-white p-1 text-gray-900 shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...e}));vT.displayName=Yh.displayName;const Ir=T.forwardRef(({className:t,sideOffset:e=4,...r},n)=>{const{portalContainer:a}=zs();return y.jsx(fT,{container:a||void 0,children:y.jsx(Fh,{ref:n,sideOffset:e,"data-uhuu-editor":!0,className:pe("z-50 min-w-[8rem] overflow-hidden rounded-md border border-gray-200 bg-white p-1 text-gray-900 shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...r})})});Ir.displayName=Fh.displayName;const Bt=T.forwardRef(({className:t,inset:e,...r},n)=>y.jsx(Gh,{ref:n,className:pe("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-gray-100 focus:text-gray-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e&&"pl-8",t),...r}));Bt.displayName=Gh.displayName;const yT=T.forwardRef(({className:t,children:e,checked:r,...n},a)=>y.jsx(Vh,{ref:a,className:pe("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-gray-100 focus:text-gray-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),checked:r,...n,children:e}));yT.displayName=Vh.displayName;const Xh=T.forwardRef(({className:t,children:e,...r},n)=>y.jsx(Hh,{ref:n,className:pe("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-gray-100 focus:text-gray-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...r,children:e}));Xh.displayName=Hh.displayName;const Al=T.forwardRef(({className:t,inset:e,...r},n)=>y.jsx($h,{ref:n,className:pe("px-2 py-1.5 text-sm font-medium",e&&"pl-8",t),...r}));Al.displayName=$h.displayName;const Ln=T.forwardRef(({className:t,...e},r)=>y.jsx(Uh,{ref:r,className:pe("-mx-1 my-1 h-px bg-gray-200",t),...e}));Ln.displayName=Uh.displayName;const bT=(t,e)=>{if(t.stopPropagation(),e.onSelect){e.onSelect(t);return}e.dialog&&typeof window<"u"&&window.$uhuu?.editDialog?.(e.dialog)},_l=(t,e)=>{if(!t)return null;const r=t.trim();if(r.startsWith("<")){const a=r.replace(/<svg\b([^>]*)>/i,(i,o)=>{let s=o;return/\bwidth=/.test(s)?s=s.replace(/\bwidth=(\"[^\"]*\"|'[^']*'|[^\s>]+)/i,'width="100%"'):s+=' width="100%"',/\bheight=/.test(s)?s=s.replace(/\bheight=(\"[^\"]*\"|'[^']*'|[^\s>]+)/i,'height="100%"'):s+=' height="100%"',/\bpreserveAspectRatio=/.test(s)?s=s.replace(/\bpreserveAspectRatio=(\"[^\"]*\"|'[^']*'|[^\s>]+)/i,'preserveAspectRatio="xMidYMid slice"'):s+=' preserveAspectRatio="xMidYMid slice"',`<svg${s}>`});return y.jsx("div",{className:pe("pointer-events-none absolute inset-0 z-10",e),"aria-hidden":"true",dangerouslySetInnerHTML:{__html:a}})}return y.jsx("img",{src:t,alt:"","aria-hidden":"true",className:pe("pointer-events-none absolute inset-0 z-10 h-full w-full object-cover",e)})},Ol=(t,e)=>e?y.jsx("div",{className:"absolute right-2 top-2 z-20",children:y.jsxs(Dn,{modal:!1,children:[y.jsx(zn,{asChild:!0,children:y.jsx(Ae,{variant:"secondary",size:"icon",title:"Image options",className:"h-7 w-7 shadow-sm",onPointerDown:r=>r.stopPropagation(),onClick:r=>r.stopPropagation(),children:y.jsx(mf,{className:"h-4 w-4"})})}),y.jsx(Ir,{className:"w-40 p-1.5",align:"end",children:t.map(r=>y.jsxs(Bt,{onSelect:n=>bT(n,r),disabled:r.disabled,children:[r.icon&&y.jsx("span",{className:"mr-2 inline-flex",children:r.icon}),y.jsx("span",{children:r.label})]},r.id))})]})}):null,Pl=(t=[])=>{const e=js();return t.length>0&&!e},ST=({className:t,style:e,overlaySvg:r,overlayClassName:n,options:a=[],dialog:i,dialogProps:o,bleedProps:s,children:l})=>{const c=O.useContext(Mt),d=Pl(a),u=i?Kt({dialog:i},c):{};return T.useMemo(()=>{if(!o)return u;const p={...u,...o};return(u.className||o.className)&&(p.className=`${u.className||""} ${o.className||""}`.trim()),Object.keys(u).forEach(f=>{const v=u[f],m=o[f];f.startsWith("on")&&typeof v=="function"&&typeof m=="function"&&(p[f]=g=>{v(g),m(g)})}),p},[u,o]),y.jsxs(y.Fragment,{children:[y.jsxs(Ns,{...s,dialog:i,children:[_l(r,n),l]}),Ol(a,d)]})};function Il(t){const e=O.useContext(Mt),r=t.bleed??e?.page?.bleed??0,n=t.pageWidth??e?.page?.width??210,a=t.pageHeight??e?.page?.height??297,{src:i,side:o,backgroundColor:s,width:l,height:c,left:d=0,right:u=0,top:p=0,bottom:f=0}=t,[v,m]=O.useState("h-full w-full object-cover object-center"),g=D=>`${D}mm`,C=()=>{let D=l;return l||(D=2*n,d||(D+=2*r),u||(D+=2*r),(d||u)&&(D-=(d??0)+(u??0))),D},x=()=>{let D=c;return c||(D=a,p||(D+=r),f||(D+=r),(p||f)&&(D-=(p??0)+(f??0))),D},h=C(),b=x(),S=D=>D!==void 0?g(D):void 0,E=D=>Object.fromEntries(Object.entries(D).filter(([F,q])=>q!==void 0)),k=d>0?d+r:-1*r,w=p>0?p+r:-1*r,A=f>0?f+r:-1*r,_=-1*n+k,I=p>0&&f>0,M=E({backgroundColor:s,width:S(h),...I?{height:S(b)}:{},left:S(k),top:S(w),bottom:S(A)}),z=E({width:S(h),...I?{height:S(b)}:{},left:S(_),top:S(w),bottom:S(A)}),R=b!=0?h/b:h/(a-(p??0)-(f??0)),H=D=>{let q=D.target.naturalWidth/D.target.naturalHeight>R?"cover-vertical":"cover-horizontal";m(q)};return y.jsx("div",{className:"uhuu-image-container",style:o=="end"?z:M,...t.dataUhuu!==void 0?{"data-uhuu":t.dataUhuu}:{},children:y.jsxs("div",{className:"uhuu-image-inner",...Kt(t,e),children:[y.jsx("img",{className:v,src:i||null,onLoad:D=>H(D)},`${i}-${h}-${b}`),t.children]})})}const xT=({overlaySvg:t,overlayClassName:e,options:r=[],dialog:n,spreadProps:a,children:i})=>{const o=Pl(r);return y.jsxs(y.Fragment,{children:[y.jsxs(Il,{...a,dialog:n,children:[_l(t,e),i]}),Ol(r,o)]})},wT=({src:t,alt:e="",className:r,imageClassName:n,style:a,imageStyle:i,overlaySvg:o,overlayClassName:s,options:l=[],dialog:c,dialogProps:d,placeholder:u,children:p,imageProps:f,renderImage:v})=>{const m=O.useContext(Mt),g=c?Kt({dialog:c},m):{},C=Pl(l),x=T.useMemo(()=>{if(!d)return g;const w={...g,...d};return(g.className||d.className)&&(w.className=pe(g.className,d.className)),Object.keys(g).forEach(A=>{const _=g[A],I=d[A];A.startsWith("on")&&typeof _=="function"&&typeof I=="function"&&(w[A]=M=>{_(M),I(M)})}),w},[g,d]),h=()=>{const w=f?.className,A=f?.style,_=f?.src??t,I=f?.alt??e,M={...f,src:_,alt:I,className:pe("h-full w-full object-cover",n,w),style:{...i,...A}};return v?v(M):_?y.jsx("img",{...M}):u??null},b=x["data-uhuu"],S=T.Children.toArray(p).some(w=>T.isValidElement(w)?w.type===Il||w.type===Ns:!1);S&&delete x["data-uhuu"];const E=T.Children.map(p,w=>T.isValidElement(w)?T.cloneElement(w,{dataUhuu:b}):w),k=S?"relative h-full w-full":"relative";return y.jsxs("div",{className:pe(k,r),style:a,children:[y.jsxs("div",{className:"relative h-full w-full",...x,children:[h(),E,_l(o,s)]}),Ol(l,C)]})},CT=t=>{const{computedOverlaySvg:e,computedOptions:r,computedDirectDialog:n}=O.useMemo(()=>{const{annotation:H,dialog:D,overlaySvg:F,options:q,src:P}=t;if(!H&&!D)return{computedOverlaySvg:F,computedOptions:q,computedDirectDialog:void 0};const j=H?.value||{},Y=F??j.annotationSvg??"",X=[];if(H){if(D){const $={...D};if(D.type==="satellite"){const{path:Z,type:le,...oe}=D;$.config={...oe,path:"image"},$.path=Z,$.type=le}X.push({id:"edit",label:"Edit image",dialog:$})}const B=Array.isArray(j.annotations)?j.annotations:[],{path:V,value:U,annotations:se,...ae}=H,N={path:H.path,type:"annotation",image:P,annotations:B,...ae};X.push({id:"annotate",label:"Annotate",dialog:N})}const W=q?[...X,...q]:X;let L;if(D){const B={...D};if(D.type==="satellite"){const{path:V,type:U,...se}=D;B.config={...se,path:"image"},B.path=V,B.type=U}L=B}return{computedOverlaySvg:Y,computedOptions:W.length>0?W:void 0,computedDirectDialog:L}},[t.annotation,t.dialog,t.overlaySvg,t.options,t.src]),a=O.useMemo(()=>t.mode?t.mode:t.side!==void 0?"spread":t.width!==void 0||t.height!==void 0||t.left!==void 0||t.right!==void 0||t.top!==void 0||t.bottom!==void 0?"bleed":"auto",[t.mode,t.side,t.width,t.height,t.left,t.right,t.top,t.bottom]),i=a==="auto"||r&&r.length>0||e||n||t.renderImage!==void 0||t.placeholder!==void 0||t.children!==void 0,{mode:o,side:s,src:l,alt:c,className:d,imageClassName:u,style:p,imageStyle:f,backgroundColor:v,width:m,height:g,left:C,right:x,top:h,bottom:b,pageWidth:S,pageHeight:E,bleed:k,overlayClassName:w,dialogProps:A,placeholder:_,children:I,imageProps:M,renderImage:z}=t,R={src:l,backgroundColor:v,width:m,height:g,left:C,right:x,top:h,bottom:b,pageWidth:S,pageHeight:E,bleed:k};if(a==="auto")return y.jsx(wT,{src:l,alt:c,className:d,style:p,imageClassName:u,imageStyle:f,overlaySvg:e,overlayClassName:w,options:r,dialog:n,dialogProps:A,placeholder:_,children:I,imageProps:M,renderImage:z});if(a==="spread"){const H={...R,side:s};return i&&(e||r?.length||n)?y.jsx(xT,{className:d,style:p,overlaySvg:e,overlayClassName:w,options:r,dialog:n,dialogProps:A,spreadProps:H,children:I}):y.jsx(Il,{...H})}return i&&(e||r?.length||n)?y.jsx(ST,{className:d,style:p,overlaySvg:e,overlayClassName:w,options:r,dialog:n,dialogProps:A,bleedProps:R,children:I}):y.jsx(Ns,{...R})},kT=t=>{const e=O.useContext(Mt);return y.jsx("div",{className:t.className,...Kt(t,e),children:t.children})},qt="uhuu_page_editor";function Oe(t){return t.kind==="group"}function ET(t){const e=[];let r=1;for(const n of t)if(Oe(n))for(const a of n.pages)e.push({...a,kind:"page",pageNum:r++});else e.push({...n,pageNum:r++});return e}function TT(t){const e=[];let r=1;for(const n of t)if(Oe(n)){const a=n.pages.map(i=>({...i,kind:"page",pageNum:r++}));e.push({...n,pages:a})}else e.push({...n,pageNum:r++});return e}function Ct(t){return ET(t).length}function AT(t){return t.map(e=>{const r=e.strictPosition;if(Oe(e)){const n=e.pages[0],a=n?.componentKey??n?.id;return{kind:"group",id:e.id,groupId:e.id,firstPageId:n?.id,firstPageComponentKey:a,firstPageComponent:n?.component,pageCount:e.pages.length,label:e.label||`${e.id} (${e.pages.length} pages)`,strictPosition:r}}else{const n=e.componentKey??e.id;return{kind:"page",id:e.id,label:e.label,pageId:e.id,pageComponentKey:n,pageLabel:e.label,pageNum:e.pageNum,pageComponent:e.component,strictPosition:r}}})}function _T(t,e){const r=new Map;e.forEach(a=>{r.set(a.id,a)});const n=[];for(const a of t){const i=r.get(a.id);i&&n.push(i)}return n}function Nl(t){return t.map(e=>{if("kind"in e&&e.kind)return e;if(e.pages&&Array.isArray(e.pages))return{kind:"group",...e,pages:(e.pages??[]).map(i=>{const{kind:o,...s}=i||{};return{kind:"page",...s}})};const{kind:n,...a}=e;return{kind:"page",...a}})}function Zh(t,e=qt){const r=Nl(t);return{key:e,items:r,totalPages:Ct(r),updatedAt:new Date().toISOString()}}function OT(t,e=qt){const r=t?.[e];if(!r?.items)return null;const n=Nl(r.items);return{key:e,items:n,totalPages:Ct(n),updatedAt:r.updatedAt||new Date().toISOString()}}function PT(t,e,r=qt){const n=Zh(e,r);return{...t??{},[r]:n}}function Qh(){return Math.random().toString(36).slice(2,11)}function Jh(t,e,r){return{kind:"page",id:r?.repeatable?Qh():t,componentKey:e,templateId:t,label:r?.label,repeatable:r?.repeatable,maxInstances:r?.maxInstances,...r}}function eg(t,e,r){const n=r?.repeatable?Qh():t;return{kind:"group",id:n,templateId:t,label:r?.label,repeatable:r?.repeatable??!1,maxInstances:r?.maxInstances??null,pages:e.map((a,i)=>{const o=typeof a=="string"?a:a.key,s=typeof a=="string"?void 0:a.dataKey;return{id:`${n}__${s??o}__${i}`,componentKey:o,templateId:o,...s?{dataKey:s}:{}}}),...r}}function tg(t,e){return t<0?e+t+1:t}function rg(t,e,r){for(const n of e){const a=tg(n.start,r),i=tg(n.end,r);if(t>=a&&t<=i)return!0}return!1}function IT(t,e,r=2){switch(t){case"all":return[{start:1,end:e}];case"cover":return[{start:1,end:r},{start:-r,end:-1}];case"text":return e<=r*2?[]:[{start:r+1,end:-(r+1)}];default:return[]}}function NT(t,e){if(!e||e.mode==="all")return t;const r=Ct(t),n=e.mode??"all",a=e.coverPageCount??2,i=n==="custom"&&e.ranges?e.ranges:IT(n,r,a);if(i.length===0)return[];const o=[];for(const s of t)if(Oe(s)){const l=s.pages.filter(c=>c.pageNum&&rg(c.pageNum,i,r));l.length>0&&o.push({...s,pages:l})}else s.pageNum&&rg(s.pageNum,i,r)&&o.push(s);return o}function ng(t,e){if(t?.integrations)return t.integrations[e]}function MT(t,e){return e&&Oe(e)?e.id:t?.id??null}function ag(t,e,r){const n=MT(e,r);return n?{instanceId:n,integration:ng(t,n)}:{instanceId:null,integration:void 0}}function ig(t,e,r){return ag(t,e,r).integration}function og(t,e){if(!t)return null;const r=`integrations.${t}`;return e?`${r}.${e}`:r}function DT(t){if(!t)return{instanceId:null,fieldPath:t,isIntegrationPath:!1};const e="integrations.";if(t.startsWith(e)){const r=t.slice(e.length),n=r.indexOf(".");if(n>0){const a=r.slice(0,n),i=r.slice(n+1);return{instanceId:a,fieldPath:i,isIntegrationPath:!0}}else return{instanceId:r,fieldPath:"",isIntegrationPath:!0}}return{instanceId:null,fieldPath:t,isIntegrationPath:!1}}function zT(t,e,r){if(!e)return r;const n=e.split("."),a={...t};let i=a;for(let s=0;s<n.length-1;s++){const l=n[s];!(l in i)||typeof i[l]!="object"||i[l]===null?i[l]={}:i[l]={...i[l]},i=i[l]}const o=n[n.length-1];return i[o]=r,a}function LT(t,e,r){const n=DT(e);if(!n.isIntegrationPath||!n.instanceId)return t;const{instanceId:a,fieldPath:i}=n,o=ng(t,a)||{},s=zT(o,i,r);return{...t,integrations:{...t?.integrations||{},[a]:s}}}function jn(t,e){if(!t||!e)return;const r=typeof e=="string"?e:e?.id,n=typeof e=="string"?void 0:e?.templateId??e?.componentKey,a=typeof e=="string"?void 0:e?.componentKey,i=Array.from(new Set([r,n,a].filter(Boolean)));for(const o of i)if(t?.pages?.[o]!==void 0)return t.pages[o];for(const o of i)if(t?.groups?.[o]!==void 0)return t.groups[o];for(const o of i)if(t[o]!==void 0)return t[o]}const Nr=T.createContext(null);function jT(t=qt){return[t]}function WT(t,e,r){if(!e)return t;if(!t)return e;const n={...e};return r.forEach(a=>{t[a]!==void 0&&(n[a]=t[a])}),n}function sg({payload:t,onPayloadChange:e,children:r,stateKey:n=qt}){const[a,i]=T.useState(t??{}),o=T.useRef(null),s=T.useRef(!1),l=T.useRef(null),c=T.useRef(0),d=T.useRef(!0),u=T.useCallback(w=>{try{return JSON.stringify(w)}catch{return String(w)}},[]),p=T.useMemo(()=>jT(n),[n]),f=T.useCallback((w,A)=>{if(!w)return null;const _={...w};return A.forEach(I=>{delete _[I]}),_},[]);T.useEffect(()=>{if(d.current){d.current=!1,t&&(o.current=t,i(t));return}if(s.current){s.current=!1,l.current=t,c.current=Date.now(),o.current=t;return}if(t===o.current)return;if(Date.now()-c.current<500&&l.current!==null){const _=f(t,p),I=f(l.current,p),M=_?u(_):null,z=I?u(I):null;if(M&&M===z){l.current=null,o.current=t;return}}o.current=t,i(_=>t?WT(_,t,p):_)},[t,p,u,f]);const v=T.useCallback(w=>{if(e?.(w),typeof window>"u")return;const A=window.$uhuu;A?.emitPayload&&A.emitPayload(w)},[e]),m=T.useCallback(w=>{s.current=!0,i(A=>{const _=typeof w=="function"?w(A):w;let I=_;return _&&typeof _=="object"&&Object.keys(_).filter(z=>z.startsWith("integrations.")||z==="integrations").length>0&&_.integrations&&(I=_),l.current=I,c.current=Date.now(),v(I),I})},[v]),g=T.useCallback((w,A,_)=>{m(I=>({...I??{},pages:{...I?.pages??{},[w]:{...I?.pages?.[w]??{},[A]:_}}}))},[m]),C=T.useCallback((w,A)=>{m(_=>{const I=_?.integrations??{},M=I[w],z=typeof A=="function"?A(M):A;return{..._??{},integrations:{...I,[w]:z}}})},[m]),x=T.useCallback((w,A,_)=>{C(w,I=>({...I??{},[A]:_}))},[C]),h=T.useCallback(w=>{m(A=>{if(!A?.integrations||!A.integrations[w])return A;const{[w]:_,...I}=A.integrations;return{...A,integrations:Object.keys(I).length>0?I:void 0}})},[m]),b=T.useCallback((w,A)=>{m(_=>LT(_,w,A))},[m]),S=T.useCallback((w,A)=>{const _=A??n;m(I=>PT(I,w,_))},[m,n]),E=T.useCallback(w=>jn(a,w),[a]),k=T.useMemo(()=>({payload:a,setPayload:m,setPageOptionValue:g,setIntegrationPayload:C,setIntegrationPayloadValue:x,removeIntegrationPayload:h,updateIntegrationByDialogPath:b,mergePageEditorState:S,getPagePayload:E}),[a,m,g,C,x,h,b,S,E]);return y.jsx(Nr.Provider,{value:k,children:r})}function BT(t){return t.defaultValue!==void 0?t.defaultValue:t.type==="toggle"?!1:t.type==="slider"||t.type==="counter"?0:""}function qT(t,e){return t.type==="toggle"?e===!0||e==="true":t.type==="slider"||t.type==="counter"?Number(e):e}function RT(t,e,r){const n=t.field??t.id;return{...t,getValue:i=>{const o=e?.pages?.[i.id]?.[n];return o===void 0?BT(t):t.type==="toggle"?!!o:o},onChange:(i,o)=>{r(i,n,qT(t,o))}}}const Wn=O.createContext({zoom:100,scaleValue:1,hideUI:!1});function FT({children:t,layout:e="spread"}){const{scaleValue:r}=O.useContext(Wn),n=O.useRef(null);return O.useEffect(()=>{if(!n.current)return;const a=()=>{const s=n.current?.querySelectorAll("[data-section-content]");if(!s?.length)return;const l=Array.from(s).reduce((c,d)=>{const u=Number.parseInt(d.getAttribute("data-natural-width")||"0");return c+u},0);if(l>0){const c=l*r;n.current?.style.setProperty("--uhuu-group-pair-width",`${c}px`)}};a();const i=new ResizeObserver(a);return n.current.querySelectorAll("[data-section-content]").forEach(s=>i.observe(s)),()=>i.disconnect()},[t,r]),y.jsx("div",{ref:n,className:`two-pages-pair two-pages-pair--${e}`,children:t})}function Bn({children:t,title:e,className:r="",controls:n,origin:a="center"}){const{scaleValue:i,hideUI:o}=O.useContext(Wn),s=O.useRef(null),[l,c]=O.useState(0),[d,u]=O.useState(0);O.useEffect(()=>{if(s.current){const C=()=>{const h=s.current;if(h){const b=h.style.transform;h.style.transform="scale(1)";const S=h.scrollHeight,E=h.scrollWidth;h.style.transform=b,c(S),u(E)}};C();const x=new ResizeObserver(C);return x.observe(s.current),()=>{x.disconnect()}}},[t]);const p=l*i,f=Math.max(d*i,150),v={left:{justify:"justify-start",origin:"top left"},right:{justify:"justify-end",origin:"top right"},center:{justify:"justify-center",origin:"top center"}},{justify:m,origin:g}=v[a];return o?y.jsx("div",{className:r,children:t}):y.jsxs("div",{className:`group/section ${r}`,style:{width:`${f}px`,minWidth:"150px"},children:[y.jsx("div",{children:n??y.jsx("div",{className:"px-4 py-2 border-b border-gray-200",children:y.jsxs("div",{className:"text-sm font-medium text-gray-700",children:[e," Controls"]})})}),y.jsx("div",{className:"pt-1",style:{height:p>0?`${p+32}px`:"auto",minHeight:"100px"},children:y.jsx("div",{className:`flex items-start ${m}`,children:y.jsx("div",{ref:s,"data-section-content":!0,"data-natural-width":d,"data-natural-height":l,style:{transform:`scale(${i})`,transformOrigin:g},children:t})})})]})}function $T({children:t,className:e="",defaultZoom:r=100,minZoom:n=25,maxZoom:a=200,onAddPage:i,menuItems:o,hideUI:s,preview:l="single_page"}){const c=js(),d=s??c,[u,p]=O.useState(r),[f,v]=O.useState("none"),m=O.useRef(null),g=O.useRef(null),[C,x]=O.useState(!1),[h,b]=O.useState(0),[S,E]=O.useState(!0),k=M=>{if(!m.current||!g.current)return u;const z=m.current.getBoundingClientRect(),R=g.current.querySelector("[data-section-content]");if(!R)return u;let H=Number.parseInt(R.getAttribute("data-natural-width")||"0");const D=Number.parseInt(R.getAttribute("data-natural-height")||"0");if(H===0||D===0)return u;l==="two_pages"&&(H=H*2);const F=z.width-32,q=screen.height-120,P=F/H*100,j=q/D*100;switch(M){case"width":return Math.min(Math.max(P,n),a);case"height":return Math.min(Math.max(j,n),a);case"both":return Math.min(Math.max(Math.min(P,j),n),a);default:return u}},w=M=>{if(v(M),M!=="none"){const z=k(M);p(z)}},A=()=>{const M=Math.min(u+25,a);p(M),v("none")},_=()=>{const M=Math.max(u-25,n);p(M),v("none")};O.useEffect(()=>{const M=()=>{if(!m.current||!g.current)return;const H=m.current.getBoundingClientRect().width;if(!C){const D=g.current.querySelector("[data-section-content]");if(D){const F=Number.parseInt(D.getAttribute("data-natural-width")||"0");if(F>0){if(F>H-48){const q=k("both");v("both"),p(q)}x(!0),b(H),E(!1);return}}if(S){setTimeout(M,50);return}}E(!1)},z=()=>{if(!m.current||S)return;const H=m.current.getBoundingClientRect().width;if(Math.abs(H-h)>10){if(f!=="none"){const D=k(f);p(D)}b(H)}};return M(),window.addEventListener("resize",z),()=>{window.removeEventListener("resize",z)}},[f,n,a,C,h,S]);const I=u/100;return d?y.jsx(Wn.Provider,{value:{zoom:100,scaleValue:1,hideUI:!0},children:y.jsx("div",{className:e,children:t})}):y.jsx(Wn.Provider,{value:{zoom:u,scaleValue:I,hideUI:!1},children:y.jsxs("div",{ref:m,className:`flex flex-col min-h-0 ${e}`,children:[y.jsxs("div",{"data-uhuu-editor":!0,className:"fixed right-4 bottom-4 z-50 flex items-center gap-1.5 px-2.5 py-1.5 bg-white/90 backdrop-blur-md border border-gray-200/60 rounded-lg shadow-sm",children:[o,y.jsx("div",{className:"h-4 w-px bg-gray-200 mx-0.5"}),y.jsxs(Dn,{modal:!1,children:[y.jsx(zn,{asChild:!0,children:y.jsxs(Ae,{variant:"ghost",size:"sm",title:"Zoom",className:"text-xs font-medium text-gray-700 hover:bg-gray-100/80 h-7 px-2.5",children:[Math.round(u),"%",y.jsx(iw,{className:"w-3 h-3 ml-1 opacity-60"})]})}),y.jsxs(Ir,{className:"w-52 p-1.5",align:"end",children:[y.jsxs(Bt,{onClick:()=>w("width"),className:`cursor-pointer flex items-center ${f==="width"?"bg-gray-100":""}`,children:[y.jsx(uw,{className:"w-4 h-4 mr-2"}),y.jsx("span",{children:"Fit to Width"})]}),y.jsxs(Bt,{onClick:()=>w("height"),className:`cursor-pointer flex items-center ${f==="height"?"bg-gray-100":""}`,children:[y.jsx(pw,{className:"w-4 h-4 mr-2"}),y.jsx("span",{children:"Fit to Height"})]}),y.jsxs(Bt,{onClick:()=>w("both"),className:`cursor-pointer flex items-center ${f==="both"?"bg-gray-100":""}`,children:[y.jsx(sw,{className:"w-4 h-4 mr-2"}),y.jsx("span",{children:"Fit to Page"})]}),y.jsx(Ln,{className:"my-1.5"}),y.jsxs("div",{className:"flex items-center justify-center gap-2 px-3 py-2.5",onClick:M=>M.stopPropagation(),children:[y.jsx(Ae,{variant:"ghost",size:"sm",onClick:M=>{M.stopPropagation(),_()},disabled:u<=n,className:"h-8 w-8 p-0 hover:bg-gray-100 disabled:opacity-40",title:"Zoom out (25%)",children:y.jsx(mw,{className:"w-4 h-4"})}),y.jsxs("div",{className:"relative",children:[y.jsx("input",{type:"number",value:Math.round(u),onChange:M=>{const z=Number.parseInt(M.target.value);if(!isNaN(z)){const R=Math.min(Math.max(z,n),a);p(R),v("none")}},onFocus:M=>M.target.select(),className:"w-20 pr-6 text-center text-sm text-gray-700 bg-white border border-gray-300 rounded px-2 py-1.5 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all",min:n,max:a}),y.jsx("span",{className:"absolute right-2 top-1/2 -translate-y-1/2 text-xs text-gray-400 pointer-events-none",children:"%"})]}),y.jsx(Ae,{variant:"ghost",size:"sm",onClick:M=>{M.stopPropagation(),A()},disabled:u>=a,className:"h-8 w-8 p-0 hover:bg-gray-100 disabled:opacity-40",title:"Zoom in (25%)",children:y.jsx(fw,{className:"w-4 h-4"})})]})]})]})]}),y.jsx("div",{ref:g,children:y.jsx("div",{className:l==="two_pages"?"group_two_pages":"flex flex-col items-center",children:t})}),y.jsx("div",{className:"flex justify-center pb-16",children:y.jsx(Ae,{size:"sm",variant:"outline",onClick:()=>i?i():null,children:y.jsx(it,{})})})]})})}var qn="Dialog",[lg,cg]=st(qn),[GT,He]=lg(qn),dg=t=>{const{__scopeDialog:e,children:r,open:n,defaultOpen:a,onOpenChange:i,modal:o=!0}=t,s=T.useRef(null),l=T.useRef(null),[c,d]=xr({prop:n,defaultProp:a??!1,onChange:i,caller:qn});return y.jsx(GT,{scope:e,triggerRef:s,contentRef:l,contentId:Yt(),titleId:Yt(),descriptionId:Yt(),open:c,onOpenChange:d,onOpenToggle:T.useCallback(()=>d(u=>!u),[d]),modal:o,children:r})};dg.displayName=qn;var ug="DialogTrigger",pg=T.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,a=He(ug,r),i=me(e,a.triggerRef);return y.jsx(he.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":zl(a.open),...n,ref:i,onClick:ie(t.onClick,a.onOpenToggle)})});pg.displayName=ug;var Ml="DialogPortal",[VT,fg]=lg(Ml,{forceMount:void 0}),mg=t=>{const{__scopeDialog:e,forceMount:r,children:n,container:a}=t,i=He(Ml,e);return y.jsx(VT,{scope:e,forceMount:r,children:T.Children.map(n,o=>y.jsx(wt,{present:r||i.open,children:y.jsx(dl,{asChild:!0,container:a,children:o})}))})};mg.displayName=Ml;var Rn="DialogOverlay",hg=T.forwardRef((t,e)=>{const r=fg(Rn,t.__scopeDialog),{forceMount:n=r.forceMount,...a}=t,i=He(Rn,t.__scopeDialog);return i.modal?y.jsx(wt,{present:n||i.open,children:y.jsx(UT,{...a,ref:e})}):null});hg.displayName=Rn;var HT=wr("DialogOverlay.RemoveScroll"),UT=T.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,a=He(Rn,r);return y.jsx(yl,{as:HT,allowPinchZoom:!0,shards:[a.contentRef],children:y.jsx(he.div,{"data-state":zl(a.open),...n,ref:e,style:{pointerEvents:"auto",...n.style}})})}),Rt="DialogContent",gg=T.forwardRef((t,e)=>{const r=fg(Rt,t.__scopeDialog),{forceMount:n=r.forceMount,...a}=t,i=He(Rt,t.__scopeDialog);return y.jsx(wt,{present:n||i.open,children:i.modal?y.jsx(KT,{...a,ref:e}):y.jsx(YT,{...a,ref:e})})});gg.displayName=Rt;var KT=T.forwardRef((t,e)=>{const r=He(Rt,t.__scopeDialog),n=T.useRef(null),a=me(e,r.contentRef,n);return T.useEffect(()=>{const i=n.current;if(i)return Gm(i)},[]),y.jsx(vg,{...t,ref:a,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ie(t.onCloseAutoFocus,i=>{i.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:ie(t.onPointerDownOutside,i=>{const o=i.detail.originalEvent,s=o.button===0&&o.ctrlKey===!0;(o.button===2||s)&&i.preventDefault()}),onFocusOutside:ie(t.onFocusOutside,i=>i.preventDefault())})}),YT=T.forwardRef((t,e)=>{const r=He(Rt,t.__scopeDialog),n=T.useRef(!1),a=T.useRef(!1);return y.jsx(vg,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{t.onCloseAutoFocus?.(i),i.defaultPrevented||(n.current||r.triggerRef.current?.focus(),i.preventDefault()),n.current=!1,a.current=!1},onInteractOutside:i=>{t.onInteractOutside?.(i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const o=i.target;r.triggerRef.current?.contains(o)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),vg=T.forwardRef((t,e)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:a,onCloseAutoFocus:i,...o}=t,s=He(Rt,r),l=T.useRef(null),c=me(e,l);return Zf(),y.jsxs(y.Fragment,{children:[y.jsx(Ys,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:a,onUnmountAutoFocus:i,children:y.jsx(Vs,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":zl(s.open),...o,ref:c,onDismiss:()=>s.onOpenChange(!1)})}),y.jsxs(y.Fragment,{children:[y.jsx(ZT,{titleId:s.titleId}),y.jsx(JT,{contentRef:l,descriptionId:s.descriptionId})]})]})}),Dl="DialogTitle",yg=T.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,a=He(Dl,r);return y.jsx(he.h2,{id:a.titleId,...n,ref:e})});yg.displayName=Dl;var bg="DialogDescription",Sg=T.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,a=He(bg,r);return y.jsx(he.p,{id:a.descriptionId,...n,ref:e})});Sg.displayName=bg;var xg="DialogClose",wg=T.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,a=He(xg,r);return y.jsx(he.button,{type:"button",...n,ref:e,onClick:ie(t.onClick,()=>a.onOpenChange(!1))})});wg.displayName=xg;function zl(t){return t?"open":"closed"}var Cg="DialogTitleWarning",[XT,kg]=oC(Cg,{contentName:Rt,titleName:Dl,docsSlug:"dialog"}),ZT=({titleId:t})=>{const e=kg(Cg),r=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users.
|
|
875
875
|
|
|
876
876
|
If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
877
877
|
|