uhuu-components 0.2.58 → 0.2.59
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 xp(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 YS{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(KS),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=xp(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 US(r,this.hooks);await n.parse(e);for(let a of n.imported){let i=await xp(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 wp={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 XS 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=wp[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=wp[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:(y,m,g)=>{let w=y.name;w==="top"?y.name="flex-start":w==="middle"?y.name="center":w==="bottom"&&(y.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 y=G.clone(u);y.property="max-width",f.appendData(y)}if(u.property==="height"&&(i==="left-top"||i==="left-middle"||i==="left-bottom"||i==="right-top"||i==="right-middle"||i==="right-bottom")){let y=G.clone(u);y.property="max-height",f.appendData(y)}}});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,y,m)=>{f.property!=="content"&&m.remove(y),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,y,m,g;if(!i)u=te(r),p=te(n),f=te(r),y=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)} )`,y=`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 C=this.createVariable("--pagedjs-bleed-top",te(i.top)),_=this.createVariable("--pagedjs-bleed-right",te(i.right)),A=this.createVariable("--pagedjs-bleed-bottom",te(i.bottom)),I=this.createVariable("--pagedjs-bleed-left",te(i.left)),N=this.createVariable("--pagedjs-bleed-right-top",te(i.top)),D=this.createVariable("--pagedjs-bleed-right-right",te(i.right)),q=this.createVariable("--pagedjs-bleed-right-bottom",te(i.bottom)),H=this.createVariable("--pagedjs-bleed-right-left",te(i.left)),L=this.createVariable("--pagedjs-bleed-left-top",te(i.top)),F=this.createVariable("--pagedjs-bleed-left-right",te(i.right)),R=this.createVariable("--pagedjs-bleed-left-bottom",te(i.bottom)),P=this.createVariable("--pagedjs-bleed-left-left",te(i.left));o&&(N=this.createVariable("--pagedjs-bleed-right-top",te(o.top)),D=this.createVariable("--pagedjs-bleed-right-right",te(o.right)),q=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)} )`,y=`calc( ${te(n)} + ${te(o.top)} + ${te(o.bottom)} )`),s&&(L=this.createVariable("--pagedjs-bleed-left-top",te(s.top)),F=this.createVariable("--pagedjs-bleed-left-right",te(s.right)),R=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(C,_,A,I,N,D,q,H,L,F,R,P,j,Y)}if(l&&l.forEach(C=>{let _=this.createVariable("--pagedjs-mark-"+C+"-display","block");c.push(_)}),a){let C=this.createVariable("--pagedjs-orientation",a);c.push(C),a!=="portrait"&&([u,p]=[p,u],[f,y]=[y,f],[m,g]=[g,m])}let w=this.createVariable("--pagedjs-width",u),x=this.createVariable("--pagedjs-height",p),h=this.createVariable("--pagedjs-width-right",f),b=this.createVariable("--pagedjs-height-right",y),S=this.createVariable("--pagedjs-width-left",m),E=this.createVariable("--pagedjs-height-left",g);c.push(w,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,y=new G.List,m=new G.List;if(n){let w=new G.List,x=new G.List;w.appendData({type:"Dimension",unit:o.unit,value:o.value}),w.appendData({type:"WhiteSpace",value:" "}),w.appendData({type:"Operator",value:"+"}),w.appendData({type:"WhiteSpace",value:" "}),w.appendData({type:"Dimension",unit:n.left.unit,value:n.left.value}),w.appendData({type:"WhiteSpace",value:" "}),w.appendData({type:"Operator",value:"+"}),w.appendData({type:"WhiteSpace",value:" "}),w.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:w}),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 w=new G.List,x=new G.List;w.appendData({type:"Dimension",unit:o.unit,value:o.value}),w.appendData({type:"WhiteSpace",value:" "}),w.appendData({type:"Operator",value:"+"}),w.appendData({type:"WhiteSpace",value:" "}),w.appendData({type:"Dimension",unit:i.left.unit,value:i.left.value}),w.appendData({type:"WhiteSpace",value:" "}),w.appendData({type:"Operator",value:"+"}),w.appendData({type:"WhiteSpace",value:" "}),w.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}),y.appendData({type:"Function",name:"calc",children:w}),y.appendData({type:"WhiteSpace",value:" "}),y.appendData({type:"Function",name:"calc",children:x}),u.appendData({type:"Declaration",property:"size",loc:null,value:{type:"Value",children:y}});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 w=new G.List,x=new G.List;w.appendData({type:"Dimension",unit:o.unit,value:o.value}),w.appendData({type:"WhiteSpace",value:" "}),w.appendData({type:"Operator",value:"+"}),w.appendData({type:"WhiteSpace",value:" "}),w.appendData({type:"Dimension",unit:a.left.unit,value:a.left.value}),w.appendData({type:"WhiteSpace",value:" "}),w.appendData({type:"Operator",value:"+"}),w.appendData({type:"WhiteSpace",value:" "}),w.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:w}),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=kc(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,y,m;if(u&&(y=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(y!=="none"&&y!=="auto")m!=="none"&&m!=="auto"?o.style["grid-template-columns"]=y+" 1fr "+m:o.style["grid-template-columns"]=y+" 1fr "+y;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,w=s.offsetWidth,x=c.offsetWidth,h=g+w+x,b=w*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(y!=="none"&&y!=="auto")o.style["grid-template-columns"]=y+" 1fr "+y;else{o.style["grid-template-columns"]="auto auto 1fr",l.style["white-space"]="nowrap",s.style["white-space"]="nowrap";let g=l.offsetWidth,w=s.offsetWidth,x=g+w,h=w*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,w=s.offsetWidth,x=g+w,h=w*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&&y!=="none"&&y!=="auto"?o.style["grid-template-columns"]=y+" "+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(y!=="none"&&y!=="auto")m!=="none"&&m!=="auto"?o.style["grid-template-columns"]=y+" 1fr "+m:o.style["grid-template-columns"]=y+" 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,w=c.offsetWidth,x=g+w,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,y;d&&(f=window.getComputedStyle(l)["max-height"]),u&&(y=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"?y!=="none"&&y!=="auto"?s.style["grid-template-rows"]=f+" calc(100% - "+f+" - "+y+") "+y:s.style["grid-template-rows"]=f+" calc(100% - "+f+"*2) "+f:y!=="none"&&y!=="auto"&&(s.style["grid-template-rows"]=y+" calc(100% - "+y+"*2) "+y):f!=="none"&&f!=="auto"&&(s.style["grid-template-rows"]=f+" calc(100% - "+f+"*2) "+f):y!=="none"&&y!=="auto"&&(s.style["grid-template-rows"]=y+" calc(100% - "+y+"*2) "+y):d&&f!=="none"&&f!=="auto"?s.style["grid-template-rows"]=f+" "+p+" calc(100% - ("+f+" + "+p+"))":u&&y!=="none"&&y!=="auto"?s.style["grid-template-rows"]="1fr "+p+" "+y:s.style["grid-template-rows"]="calc((100% - "+p+")/2) "+p+" calc((100% - "+p+")/2)"):d?u?f!=="none"&&f!=="auto"?y!=="none"&&y!=="auto"?s.style["grid-template-rows"]=f+" 1fr "+y:s.style["grid-template-rows"]=f+" 0 1fr":y!=="none"&&y!=="auto"?s.style["grid-template-rows"]="1fr 0 "+y:s.style["grid-template-rows"]="1fr 0 1fr":s.style["grid-template-rows"]="1fr 0 0":y!=="none"&&y!=="auto"?s.style["grid-template-rows"]="1fr 0 "+y: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 ZS 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=Cc(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=Ey(i[n],e);if(s){if(o.value==="page"&&Ec(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=Cc(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 QS 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 JS 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 ex 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 tx 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 rx 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 nx 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 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(/:(first|last|nth)-of-type/)){let i=G.generate(e.block);i=i.replace(/[{}]/g,"");let o="nth-of-type-"+ot();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 ix 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-"+ot();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 ox 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(Tc(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(!De(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(),y=a.getBoundingClientRect(),m=this.marginsHeight(i),g=this.paddingHeight(i),w=this.borderHeight(i),x=m+g+w,h=Math.floor(y.top);y.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,N=new Range;I?N.setStartBefore(I):N.setStartBefore(s),N.setEndAfter(s);let D=N.getBoundingClientRect();if(S=D.bottom,!b||b==="auto")E=Math.ceil(D.bottom);else if(b==="line")E=Math.ceil(D.top);else if(b==="block"){let q=s.closest("p").previousElementSibling;q?E=Math.ceil(q.getBoundingClientRect().bottom):E=Math.ceil(D.bottom)}}let k=c+x-y.height,C=S?h-S:0,_=S?Math.floor(y.top)-E:0,A=a.querySelector("[data-note='footnote']");if(n&&f.left>p)e.remove();else if(!A&&n&&x>C){r.style.setProperty("--pagedjs-footnotes-height","0px");let I=document.createElement("div");I.appendChild(e),this.needsLayout.push(I)}else n?S<y.top-k?r.style.setProperty("--pagedjs-footnotes-height",`${c+m+w}px`):(r.style.setProperty("--pagedjs-footnotes-height",`${y.height+_}px`),o.style.height=y.height+_-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 Ra(o,void 0,a.settings).findOverflow(l,c);if(p){let{startContainer:f,startOffset:y}=p,m;if(De(f)){let E=f.childNodes[y];m=De(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 w=l.getBoundingClientRect(),{height:x}=w,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 sx=[QS,XS,ZS,JS,ex,tx,rx,nx,ax,ix,ox];class lx 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 cx(t){if(t!=null)return t.replace(new RegExp("::footnote-call","g"),"").replace(new RegExp("::footnote-marker","g"),"")}class dx 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,y=o[0].closest(".pagedjs_page_content").getBoundingClientRect().top;p==y?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 ux 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 y="target-counter-"+ot();o.split(",").forEach(m=>{this.counterTargets[m]={func:l,args:d,value:c,counter:u,style:p,selector:m,fullSelector:o,variable:y}}),e.name="counter",e.children=new G.List,e.children.appendData({type:"Identifier",loc:0,name:y}),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=bc(d,o.args),f=a.pagesArea.querySelector(Sc(p));if(f){let y=ot();d.setAttribute("data-"+o.variable,y);let m="";if(s.length>1&&(m+="::"+s[1]),o.counter==="page"){let w=a.pagesArea.querySelectorAll(".pagedjs_page"),x=0;for(let h=0;h<w.length;h++){let b=w[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}="${y}"]${m} { counter-reset: ${o.variable} ${x}; }`,this.styleSheet.cssRules.length)}else{let w=f.getAttribute(`data-counter-${o.counter}-value`);w&&this.styleSheet.insertRule(`[data-${o.variable}="${y}"]${m} { counter-reset: ${o.variable} ${o.variable} ${parseInt(w)}; }`,this.styleSheet.cssRules.length)}let g=document.querySelector(`[data-${o.variable}="${y}"]`);g&&(g.style.display="none",g.clientHeight,g.style.removeProperty("display"))}})})}}class px 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-"+ot();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=bc(l,n.args),u=e.querySelector(Sc(d));if(u)if(n.style){this.selector=ot(),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 fx=[lx,dx,ux,px];class mx extends ve{constructor(e,r,n){super(e,r,n)}filter(e){Oc(e,r=>this.filterEmpty(r),NodeFilter.SHOW_TEXT)}filterEmpty(e){if(e.textContent.length>1&&Qr(e)){let r=e.parentNode;if(De(r)&&r.closest("pre"))return NodeFilter.FILTER_REJECT;const a=ga(e),i=ya(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 hx extends ve{constructor(e,r,n){super(e,r,n)}filter(e){Oc(e,null,NodeFilter.SHOW_COMMENT)}}class gx extends ve{constructor(e,r,n){super(e,r,n)}filter(e){e.querySelectorAll("script").forEach(r=>{r.remove()})}}var rs={},Cp;function vx(){return Cp||(Cp=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,w,x,h){var b=h.match(g);if(b)for(var S=0;S<b.length;S++)x[w]++,h=h.replace(b[S]," ");return h},p=function(g){var w=g.indexOf(",");w!==-1&&(g=g.substring(0,w));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 w=f[g];return w===void 0&&(w=p(g),f[g]=w),w};var y={},m=null;t.isSelectorValid=function(g){var w=y[g];if(w===void 0){m==null&&(m=document.createElement("div"));try{m.querySelector(g),w=!0}catch{w=!1}y[g]=w}return w},t.validateSelector=function(g){if(!t.isSelectorValid(g)){var w=new SyntaxError(g+" is not a valid selector");throw w.code="EBADSELECTOR",w}}})(rs)),rs}var yx=vx();class bx 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:yx.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(cx(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 Sx=[mx,hx,gx,bx];var ns,kp;function xx(){return kp||(kp=1,ns=function(){var t=Array.from,e,r;return typeof t!="function"?!1:(e=["raz","dwa"],r=t(e),!!(r&&r!==e&&r[1]==="dwa"))}),ns}var as,Ep;function wx(){return Ep||(Ep=1,as=function(){return typeof globalThis!="object"||!globalThis?!1:globalThis.Array===Array}),as}var is,Tp;function Cx(){if(Tp)return is;Tp=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 is=(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__}})(),is}var os,Ap;function sn(){return Ap||(Ap=1,os=wx()()?globalThis:Cx()),os}var ss,_p;function kx(){if(_p)return ss;_p=1;var t=sn(),e={object:!0,symbol:!0};return ss=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])},ss}var ls,Op;function Ex(){return Op||(Op=1,ls=function(t){return t?typeof t=="symbol"?!0:!t.constructor||t.constructor.name!=="Symbol"?!1:t[t.constructor.toStringTag]==="Symbol":!1}),ls}var cs,Pp;function Ip(){if(Pp)return cs;Pp=1;var t=Ex();return cs=function(e){if(!t(e))throw new TypeError(e+" is not a symbol");return e},cs}var ds,Np;function Tx(){if(Np)return ds;Np=1;var t=Gt(),e=Object.create,r=Object.defineProperty,n=Object.prototype,a=e(null);return ds=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},ds}var us,Mp;function Ax(){if(Mp)return us;Mp=1;var t=Gt(),e=sn().Symbol;return us=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"))})},us}var ps,Dp;function _x(){if(Dp)return ps;Dp=1;var t=Gt(),e=Ip(),r=Object.create(null);return ps=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})})},ps}var fs,zp;function Ox(){if(zp)return fs;zp=1;var t=Gt(),e=Ip(),r=sn().Symbol,n=Tx(),a=Ax(),i=_x(),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)},fs=c=function p(f){var y;if(this instanceof p)throw new TypeError("Symbol is not a constructor");return u?r(f):(y=o(d.prototype),f=f===void 0?"":String(f),s(y,{__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])),fs}var ms,Lp;function Px(){return Lp||(Lp=1,ms=kx()()?sn().Symbol:Ox()),ms}var hs,jp;function Ix(){if(jp)return hs;jp=1;var t=Object.prototype.toString,e=t.call((function(){return arguments})());return hs=function(r){return t.call(r)===e},hs}var gs,Wp;function Nx(){if(Wp)return gs;Wp=1;var t=Object.prototype.toString,e=RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);return gs=function(r){return typeof r=="function"&&e(t.call(r))},gs}var vs,Bp;function Mx(){return Bp||(Bp=1,vs=function(){var t=Math.sign;return typeof t!="function"?!1:t(10)===1&&t(-20)===-1}),vs}var ys,qp;function Dx(){return qp||(qp=1,ys=function(t){return t=Number(t),isNaN(t)||t===0?t:t>0?1:-1}),ys}var bs,Rp;function zx(){return Rp||(Rp=1,bs=Mx()()?Math.sign:Dx()),bs}var Ss,Fp;function Lx(){if(Fp)return Ss;Fp=1;var t=zx(),e=Math.abs,r=Math.floor;return Ss=function(n){return isNaN(n)?0:(n=Number(n),n===0||!isFinite(n)?n:t(n)*r(e(n)))},Ss}var xs,$p;function Gp(){if($p)return xs;$p=1;var t=Lx(),e=Math.max;return xs=function(r){return e(0,t(r))},xs}var ws,Vp;function jx(){if(Vp)return ws;Vp=1;var t=Object.prototype.toString,e=t.call("");return ws=function(r){return typeof r=="string"||r&&typeof r=="object"&&(r instanceof String||t.call(r)===e)||!1},ws}var Cs,Hp;function Wx(){if(Hp)return Cs;Hp=1;var t=Px().iterator,e=Ix(),r=Nx(),n=Gp(),a=Zc(),i=Ma(),o=gr(),s=jx(),l=Array.isArray,c=Function.prototype.call,d={configurable:!0,enumerable:!0,writable:!0,value:null},u=Object.defineProperty;return Cs=function(p){var f=arguments[1],y=arguments[2],m,g,w,x,h,b,S,E,k,C;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;)C=f?c.call(f,y,E.value,g):E.value,m?(d.value=C,u(x,g,d)):x[g]=C,E=S.next(),++g;h=g}else if(s(p)){for(h=p.length,m&&(x=new m),g=0,w=0;g<h;++g)C=p[g],g+1<h&&(b=C.charCodeAt(0),b>=55296&&b<=56319&&(C+=p[++g])),C=f?c.call(f,y,C,w):C,m?(d.value=C,u(x,w,d)):x[w]=C,++w;h=w}}if(h===void 0)for(h=n(p.length),m&&(x=new m(h)),g=0;g<h;++g)C=f?c.call(f,y,p[g],g):p[g],m?(d.value=C,u(x,g,d)):x[g]=C;return m&&(d.value=null,x.length=h),x},Cs}var ks,Up;function Bx(){return Up||(Up=1,ks=xx()()?Array.from:Wx()),ks}var Es,Kp;function qx(){return Kp||(Kp=1,Es=function(){var t=Number.isNaN;return typeof t!="function"?!1:!t({})&&t(NaN)&&!t(34)}),Es}var Ts,Yp;function Rx(){return Yp||(Yp=1,Ts=function(t){return t!==t}),Ts}var As,Xp;function Fx(){return Xp||(Xp=1,As=qx()()?Number.isNaN:Rx()),As}var _s,Zp;function $x(){if(Zp)return _s;Zp=1;var t=Fx(),e=Gp(),r=Ma(),n=Array.prototype.indexOf,a=Object.prototype.hasOwnProperty,i=Math.abs,o=Math.floor;return _s=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},_s}var Os,Qp;function Gx(){if(Qp)return Os;Qp=1;var t=$x(),e=Array.prototype.forEach,r=Array.prototype.splice;return Os=function(n){e.call(arguments,function(a){var i=t.call(this,a);i!==-1&&r.call(this,i,1)},this)},Os}var Ps,Jp;function Vx(){if(Jp)return Ps;Jp=1;var t=gr(),e={function:!0,object:!0};return Ps=function(r){return t(r)&&e[typeof r]||!1},Ps}var Is,ef;function Hx(){if(ef)return Is;ef=1;var t=Vx();return Is=function(e){if(!t(e))throw new TypeError(e+" is not an Object");return e},Is}var Ns,tf;function Ux(){if(tf)return Ns;tf=1;var t=Bx(),e=Gx(),r=Hx(),n=Gt(),a=Jc().methods.emit,i=Object.defineProperty,o=Object.prototype.hasOwnProperty,s=Object.getOwnPropertyDescriptor;return Ns=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 y,m,g=t(d);for(a.apply(this,arguments),y=0;m=g[y];++y)a.apply(m,arguments)},i(l,f,p),u)},Ns}var Kx=Ux();const Yx=ba(Kx);let rf=[...sx,...fx,...Sx];class nf{constructor(e,r,n){rf.forEach(a=>{let i=new a(e,r,n);Yx(i,this)})}}Vt(nf.prototype);function af(){for(var t=0;t<arguments.length;t++)rf.push(arguments[t])}function Xx(t,e,r){return new nf(t,e,r)}class Ms{constructor(e){this.settings=e||{},this.polisher=new YS(!1),this.chunker=new ed(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=Xx(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 af.apply(af,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(Ms.prototype);function of(t,e){let r;return function(...a){clearTimeout(r),r=setTimeout(()=>t.apply(this,a),e)}}let Zx=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 sf{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 zt=O.createContext(null),lf=({config:t,children:e})=>v.jsx(zt.Provider,{value:t,children:e}),Qx=({children:t,className:e,setup:r})=>{const[n,a]=O.useState(!1),i=O.useRef(null),o=O.useRef(null),s=O.useRef(new Zx),l=O.useRef(!1),c=sf.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),y=`
|
|
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 {${y}${m}}`;d=d.replace(p,g)}else d=`@page {${y}}
|
|
834
|
-
${d}`}const u=of(()=>{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 Ms,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(y){console.error("Error during Paged.js preview rendering:",y),a(!1)}},500);return O.useEffect(()=>{u()},[t,r]),v.jsxs(lf,{config:c,children:[v.jsx("div",{className:[e??"",n?"rendering":"rendered",c?.page?.showBleed?"uhuu-bleed-visible":"",c?.page?.preview??""].filter(Boolean).join(" "),ref:i}),v.jsx("div",{className:"uhuu-reactive-content",style:{display:"none"},ref:o,children:t})]})},Jx=({children:t})=>v.jsx(v.Fragment,{children:t});class ln{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(){ln.handlePageBreakStyles(),ln.handleUhuuDialogs()}}class cf{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 df=({children:t,className:e,setup:r})=>{const n=sf.pageParams("static",r);O.useEffect(()=>{n?.page?.compatibility&&ln.handle();const i=cf.setupPageStyles(n?.page?.printCssUrl);return()=>{i&&cf.removePageStyles(i)}},[r,n?.page?.compatibility,n?.page?.printCssUrl]);const a=[e,n?.page?.preview].filter(Boolean).join(" ");return v.jsx(lf,{config:n,children:v.jsx("div",{className:a,children:t})})},uf=O.forwardRef(({children:t,className:e="",style:r,pageNo:n,overlay:a,showBleed:i,"data-page-key":o},s)=>{const l=O.useContext(zt),c=i??l?.page?.showBleed??!1;return v.jsxs("div",{className:`uhuu-page-sheet ${e}`,style:r,ref:s,"data-page-key":o,children:[t,a&&a({pageNo:n}),c&&v.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":""}:{}},Ds=t=>{const e=O.useContext(zt),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=S=>`${S}mm`,y=()=>{let S=l;return l||(S=a,u||(S+=r),p||(S+=r),(u||p)&&(S-=(u??0)+(p??0))),S},g=(()=>{let S=s;return s||(S=n,c||(S+=r),d||(S+=r),(c||d)&&(S-=(c??0)+(d??0))),S})(),w=y(),x=S=>S!==void 0?f(S):void 0,b=(S=>Object.fromEntries(Object.entries(S).filter(([E,k])=>k!==void 0)))({backgroundColor:o,width:x(g),height:x(w),left:x(c>0?c+r:c),right:x(d>0?d+r:d),top:x(u>0?u+r:u),bottom:x(p>0?p+r:p)});return v.jsx("div",{className:"uhuu-image-container",style:b,...t.dataUhuu!==void 0?{"data-uhuu":t.dataUhuu}:{},children:v.jsxs("div",{className:"uhuu-image-inner",...Kt(t,e),children:[v.jsx("img",{className:"cover-image",src:i||null}),t.children]})})};const ew=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),tw=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,r,n)=>n?n.toUpperCase():r.toLowerCase()),pf=t=>{const e=tw(t);return e.charAt(0).toUpperCase()+e.slice(1)},ff=(...t)=>t.filter((e,r,n)=>!!e&&e.trim()!==""&&n.indexOf(e)===r).join(" ").trim(),rw=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};var nw={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 aw=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,...nw,width:e,height:e,stroke:t,strokeWidth:n?Number(r)*24/Number(e):r,className:ff("lucide",a),...!i&&!rw(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(aw,{ref:i,iconNode:e,className:ff(`lucide-${ew(pf(t))}`,`lucide-${t}`,n),...a}));return r.displayName=pf(t),r};const mf=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 iw=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 cn=Se("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const ow=Se("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const sw=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 hf=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 gf=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 zs=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 lw=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 cw=Se("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);const st=Se("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const dw=Se("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);const uw=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 pw=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 fw=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 vf=Se("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);const mw=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 hw=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"}]]),yf=T.createContext({portalContainer:null});function Ls(){return T.useContext(yf)}function gw({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)}},[]),v.jsx(yf.Provider,{value:{portalContainer:e},children:t})}const bf=O.createContext({interactive:!0,setInteractive:()=>{},enableDevTools:!1});function js(){return O.useContext(bf)}function Ws(){const{interactive:t}=js();return!t}function vw({children:t,defaultInteractive:e=!0,enableDevTools:r=!1}){const a=!!(typeof window<"u"&&window?.$uhuu_renderer)?!1:e,[i,o]=O.useState(a);return v.jsx(bf.Provider,{value:{interactive:i,setInteractive:o,enableDevTools:r},children:v.jsx(gw,{children:v.jsx("div",{"data-uhuu-interactive":i?"":void 0,style:{display:"contents"},children:t})})})}function Sf(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=Sf(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function xf(){for(var t,e,r=0,n="",a=arguments.length;r<a;r++)(t=arguments[r])&&(e=Sf(t))&&(n&&(n+=" "),n+=e);return n}const wf=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,Cf=xf,kf=(t,e)=>r=>{var n;if(e?.variants==null)return Cf(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=wf(d)||wf(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(y=>{let[m,g]=y;return Array.isArray(g)?g.includes({...i,...s}[m]):{...i,...s}[m]===g})?[...c,u,p]:c},[]);return Cf(t,o,l,r?.class,r?.className)},yw=(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},bw=(t,e)=>({classGroupId:t,validator:e}),Ef=(t=new Map,e=null,r)=>({nextPart:t,validators:e,classGroupId:r}),dn="-",Tf=[],Sw="arbitrary..",xw=t=>{const e=Cw(t),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=t;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return ww(o);const s=o.split(dn),l=s[0]===""&&s.length>1?1:0;return Af(s,l,e)},getConflictingClassGroupIds:(o,s)=>{if(s){const l=n[o],c=r[o];return l?c?yw(c,l):l:c||Tf}return r[o]||Tf}}},Af=(t,e,r)=>{if(t.length-e===0)return r.classGroupId;const a=t[e],i=r.nextPart.get(a);if(i){const c=Af(t,e+1,i);if(c)return c}const o=r.validators;if(o===null)return;const s=e===0?t.join(dn):t.slice(e).join(dn),l=o.length;for(let c=0;c<l;c++){const d=o[c];if(d.validator(s))return d.classGroupId}},ww=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?Sw+n:void 0})(),Cw=t=>{const{theme:e,classGroups:r}=t;return kw(r,e)},kw=(t,e)=>{const r=Ef();for(const n in t){const a=t[n];Bs(a,r,n,e)}return r},Bs=(t,e,r,n)=>{const a=t.length;for(let i=0;i<a;i++){const o=t[i];Ew(o,e,r,n)}},Ew=(t,e,r,n)=>{if(typeof t=="string"){Tw(t,e,r);return}if(typeof t=="function"){Aw(t,e,r,n);return}_w(t,e,r,n)},Tw=(t,e,r)=>{const n=t===""?e:_f(e,t);n.classGroupId=r},Aw=(t,e,r,n)=>{if(Ow(t)){Bs(t(n),e,r,n);return}e.validators===null&&(e.validators=[]),e.validators.push(bw(r,t))},_w=(t,e,r,n)=>{const a=Object.entries(t),i=a.length;for(let o=0;o<i;o++){const[s,l]=a[o];Bs(l,_f(e,s),r,n)}},_f=(t,e)=>{let r=t;const n=e.split(dn),a=n.length;for(let i=0;i<a;i++){const o=n[i];let s=r.nextPart.get(o);s||(s=Ef(),r.nextPart.set(o,s)),r=s}return r},Ow=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,Pw=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)}}},qs="!",Of=":",Iw=[],Pf=(t,e,r,n,a)=>({modifiers:t,hasImportantModifier:e,baseClassName:r,maybePostfixModifierPosition:n,isExternal:a}),Nw=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===Of){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(qs)?(p=u.slice(0,-1),f=!0):u.startsWith(qs)&&(p=u.slice(1),f=!0);const y=c&&c>l?c-l:void 0;return Pf(i,f,p,y)};if(e){const a=e+Of,i=n;n=o=>o.startsWith(a)?i(o.slice(a.length)):Pf(Iw,!1,o,void 0,!0)}if(r){const a=n;n=i=>r({className:i,parseClassName:a})}return n},Mw=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}},Dw=t=>({cache:Pw(t.cacheSize),parseClassName:Nw(t),sortModifiers:Mw(t),...xw(t)}),zw=/\s+/,Lw=(t,e)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:a,sortModifiers:i}=e,o=[],s=t.trim().split(zw);let l="";for(let c=s.length-1;c>=0;c-=1){const d=s[c],{isExternal:u,modifiers:p,hasImportantModifier:f,baseClassName:y,maybePostfixModifierPosition:m}=r(d);if(u){l=d+(l.length>0?" "+l:l);continue}let g=!!m,w=n(g?y.substring(0,m):y);if(!w){if(!g){l=d+(l.length>0?" "+l:l);continue}if(w=n(y),!w){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+qs:x,b=h+w;if(o.indexOf(b)>-1)continue;o.push(b);const S=a(w,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},jw=(...t)=>{let e=0,r,n,a="";for(;e<t.length;)(r=t[e++])&&(n=If(r))&&(a&&(a+=" "),a+=n);return a},If=t=>{if(typeof t=="string")return t;let e,r="";for(let n=0;n<t.length;n++)t[n]&&(e=If(t[n]))&&(r&&(r+=" "),r+=e);return r},Ww=(t,...e)=>{let r,n,a,i;const o=l=>{const c=e.reduce((d,u)=>u(d),t());return r=Dw(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=Lw(l,r);return a(l,d),d};return i=o,(...l)=>i(jw(...l))},Bw=[],ye=t=>{const e=r=>r[t]||Bw;return e.isThemeGetter=!0,e},Nf=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Mf=/^\((?:(\w[\w-]*):)?(.+)\)$/i,qw=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Rw=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Fw=/\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$/,$w=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Gw=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Vw=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,vt=t=>qw.test(t),ce=t=>!!t&&!Number.isNaN(Number(t)),yt=t=>!!t&&Number.isInteger(Number(t)),Rs=t=>t.endsWith("%")&&ce(t.slice(0,-1)),lt=t=>Rw.test(t),Df=()=>!0,Hw=t=>Fw.test(t)&&!$w.test(t),Fs=()=>!1,Uw=t=>Gw.test(t),Kw=t=>Vw.test(t),Yw=t=>!Q(t)&&!ee(t),Xw=t=>bt(t,qf,Fs),Q=t=>Nf.test(t),Lt=t=>bt(t,Rf,Hw),zf=t=>bt(t,aC,ce),Zw=t=>bt(t,$f,Df),Qw=t=>bt(t,Ff,Fs),Lf=t=>bt(t,Wf,Fs),Jw=t=>bt(t,Bf,Kw),un=t=>bt(t,Gf,Uw),ee=t=>Mf.test(t),yr=t=>jt(t,Rf),eC=t=>jt(t,Ff),jf=t=>jt(t,Wf),tC=t=>jt(t,qf),rC=t=>jt(t,Bf),pn=t=>jt(t,Gf,!0),nC=t=>jt(t,$f,!0),bt=(t,e,r)=>{const n=Nf.exec(t);return n?n[1]?e(n[1]):r(n[2]):!1},jt=(t,e,r=!1)=>{const n=Mf.exec(t);return n?n[1]?e(n[1]):r:!1},Wf=t=>t==="position"||t==="percentage",Bf=t=>t==="image"||t==="url",qf=t=>t==="length"||t==="size"||t==="bg-size",Rf=t=>t==="length",aC=t=>t==="number",Ff=t=>t==="family-name",$f=t=>t==="number"||t==="weight",Gf=t=>t==="shadow",iC=Ww(()=>{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"),y=ye("blur"),m=ye("perspective"),g=ye("aspect"),w=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"],C=()=>[ee,Q,l],_=()=>[vt,"full","auto",...C()],A=()=>[yt,"none","subgrid",ee,Q],I=()=>["auto",{span:["full",yt,ee,Q]},yt,ee,Q],N=()=>[yt,"auto",ee,Q],D=()=>["auto","min","max","fr",ee,Q],q=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],H=()=>["start","end","center","stretch","center-safe","end-safe"],L=()=>["auto",...C()],F=()=>[vt,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...C()],R=()=>[vt,"screen","full","dvw","lvw","svw","min","max","fit",...C()],P=()=>[vt,"screen","full","lh","dvh","lvh","svh","min","max","fit",...C()],j=()=>[t,ee,Q],Y=()=>[...b(),jf,Lf,{position:[ee,Q]}],Z=()=>["no-repeat",{repeat:["","x","y","space","round"]}],W=()=>["auto","cover","contain",tC,Xw,{size:[ee,Q]}],z=()=>[Rs,yr,Lt],B=()=>["","none","full",c,ee,Q],V=()=>["",ce,yr,Lt],K=()=>["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"],re=()=>[ce,Rs,jf,Lf],M=()=>["","none",y,ee,Q],$=()=>["none",ce,ee,Q],X=()=>["none",ce,ee,Q],oe=()=>[ce,ee,Q],le=()=>[vt,"full",...C()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[lt],breakpoint:[lt],color:[Df],container:[lt],"drop-shadow":[lt],ease:["in","out","in-out"],font:[Yw],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[lt],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[lt],shadow:[lt],spacing:["px",ce],text:[lt],"text-shadow":[lt],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",vt,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:_()}],"inset-x":[{"inset-x":_()}],"inset-y":[{"inset-y":_()}],start:[{"inset-s":_(),start:_()}],end:[{"inset-e":_(),end:_()}],"inset-bs":[{"inset-bs":_()}],"inset-be":[{"inset-be":_()}],top:[{top:_()}],right:[{right:_()}],bottom:[{bottom:_()}],left:[{left:_()}],visibility:["visible","invisible","collapse"],z:[{z:[yt,"auto",ee,Q]}],basis:[{basis:[vt,"full","auto",s,...C()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ce,vt,"auto","initial","none",Q]}],grow:[{grow:["",ce,ee,Q]}],shrink:[{shrink:["",ce,ee,Q]}],order:[{order:[yt,"first","last","none",ee,Q]}],"grid-cols":[{"grid-cols":A()}],"col-start-end":[{col:I()}],"col-start":[{"col-start":N()}],"col-end":[{"col-end":N()}],"grid-rows":[{"grid-rows":A()}],"row-start-end":[{row:I()}],"row-start":[{"row-start":N()}],"row-end":[{"row-end":N()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":D()}],"auto-rows":[{"auto-rows":D()}],gap:[{gap:C()}],"gap-x":[{"gap-x":C()}],"gap-y":[{"gap-y":C()}],"justify-content":[{justify:[...q(),"normal"]}],"justify-items":[{"justify-items":[...H(),"normal"]}],"justify-self":[{"justify-self":["auto",...H()]}],"align-content":[{content:["normal",...q()]}],"align-items":[{items:[...H(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...H(),{baseline:["","last"]}]}],"place-content":[{"place-content":q()}],"place-items":[{"place-items":[...H(),"baseline"]}],"place-self":[{"place-self":["auto",...H()]}],p:[{p:C()}],px:[{px:C()}],py:[{py:C()}],ps:[{ps:C()}],pe:[{pe:C()}],pbs:[{pbs:C()}],pbe:[{pbe:C()}],pt:[{pt:C()}],pr:[{pr:C()}],pb:[{pb:C()}],pl:[{pl:C()}],m:[{m:L()}],mx:[{mx:L()}],my:[{my:L()}],ms:[{ms:L()}],me:[{me:L()}],mbs:[{mbs:L()}],mbe:[{mbe:L()}],mt:[{mt:L()}],mr:[{mr:L()}],mb:[{mb:L()}],ml:[{ml:L()}],"space-x":[{"space-x":C()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":C()}],"space-y-reverse":["space-y-reverse"],size:[{size:F()}],"inline-size":[{inline:["auto",...R()]}],"min-inline-size":[{"min-inline":["auto",...R()]}],"max-inline-size":[{"max-inline":["none",...R()]}],"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,yr,Lt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,nC,Zw]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Rs,Q]}],"font-family":[{font:[eC,Qw,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,zf]}],leading:[{leading:[i,...C()]}],"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:[...K(),"wavy"]}],"text-decoration-thickness":[{decoration:[ce,"from-font","auto",ee,Lt]}],"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:C()}],"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:Z()}],"bg-size":[{bg:W()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},yt,ee,Q],radial:["",ee,Q],conic:[yt,ee,Q]},rC,Jw]}],"bg-color":[{bg:j()}],"gradient-from-pos":[{from:z()}],"gradient-via-pos":[{via:z()}],"gradient-to-pos":[{to:z()}],"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:[...K(),"hidden","none"]}],"divide-style":[{divide:[...K(),"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:[...K(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ce,ee,Q]}],"outline-w":[{outline:["",ce,yr,Lt]}],"outline-color":[{outline:j()}],shadow:[{shadow:["","none",d,pn,un]}],"shadow-color":[{shadow:j()}],"inset-shadow":[{"inset-shadow":["none",u,pn,un]}],"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,Lt]}],"ring-offset-color":[{"ring-offset":j()}],"inset-ring-w":[{"inset-ring":V()}],"inset-ring-color":[{"inset-ring":j()}],"text-shadow":[{"text-shadow":["none",p,pn,un]}],"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":re()}],"mask-image-linear-to-pos":[{"mask-linear-to":re()}],"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":re()}],"mask-image-t-to-pos":[{"mask-t-to":re()}],"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":re()}],"mask-image-r-to-pos":[{"mask-r-to":re()}],"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":re()}],"mask-image-b-to-pos":[{"mask-b-to":re()}],"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":re()}],"mask-image-l-to-pos":[{"mask-l-to":re()}],"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":re()}],"mask-image-x-to-pos":[{"mask-x-to":re()}],"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":re()}],"mask-image-y-to-pos":[{"mask-y-to":re()}],"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":re()}],"mask-image-radial-to-pos":[{"mask-radial-to":re()}],"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":re()}],"mask-image-conic-to-pos":[{"mask-conic-to":re()}],"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:Z()}],"mask-size":[{mask:W()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ee,Q]}],filter:[{filter:["","none",ee,Q]}],blur:[{blur:M()}],brightness:[{brightness:[ce,ee,Q]}],contrast:[{contrast:[ce,ee,Q]}],"drop-shadow":[{"drop-shadow":["","none",f,pn,un]}],"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":M()}],"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":C()}],"border-spacing-x":[{"border-spacing-x":C()}],"border-spacing-y":[{"border-spacing-y":C()}],"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",w,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:X()}],"scale-x":[{"scale-x":X()}],"scale-y":[{"scale-y":X()}],"scale-z":[{"scale-z":X()}],"scale-3d":["scale-3d"],skew:[{skew:oe()}],"skew-x":[{"skew-x":oe()}],"skew-y":[{"skew-y":oe()}],transform:[{transform:[ee,Q,"","none","gpu","cpu"]}],"transform-origin":[{origin:S()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:le()}],"translate-x":[{"translate-x":le()}],"translate-y":[{"translate-y":le()}],"translate-z":[{"translate-z":le()}],"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":C()}],"scroll-mx":[{"scroll-mx":C()}],"scroll-my":[{"scroll-my":C()}],"scroll-ms":[{"scroll-ms":C()}],"scroll-me":[{"scroll-me":C()}],"scroll-mbs":[{"scroll-mbs":C()}],"scroll-mbe":[{"scroll-mbe":C()}],"scroll-mt":[{"scroll-mt":C()}],"scroll-mr":[{"scroll-mr":C()}],"scroll-mb":[{"scroll-mb":C()}],"scroll-ml":[{"scroll-ml":C()}],"scroll-p":[{"scroll-p":C()}],"scroll-px":[{"scroll-px":C()}],"scroll-py":[{"scroll-py":C()}],"scroll-ps":[{"scroll-ps":C()}],"scroll-pe":[{"scroll-pe":C()}],"scroll-pbs":[{"scroll-pbs":C()}],"scroll-pbe":[{"scroll-pbe":C()}],"scroll-pt":[{"scroll-pt":C()}],"scroll-pr":[{"scroll-pr":C()}],"scroll-pb":[{"scroll-pb":C()}],"scroll-pl":[{"scroll-pl":C()}],"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,yr,Lt,zf]}],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 iC(xf(t))}const oC=kf("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"}}),ke=T.forwardRef(({className:t,variant:e,size:r,...n},a)=>v.jsx("button",{className:pe(oC({variant:e,size:r,className:t})),ref:a,...n}));ke.displayName="Button";function ie(t,e,{checkForDefaultPrevented:r=!0}={}){return function(a){if(t?.(a),r===!1||!a.defaultPrevented)return e?.(a)}}function Vf(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function br(...t){return e=>{let r=!1;const n=t.map(a=>{const i=Vf(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():Vf(t[a],null)}}}}function me(...t){return T.useCallback(br(...t),t)}function sC(t,e){const r=T.createContext(e),n=i=>{const{children:o,...s}=i,l=T.useMemo(()=>s,Object.values(s));return v.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 ct(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,...y}=u,m=p?.[t]?.[l]||s,g=T.useMemo(()=>y,Object.values(y));return v.jsx(m.Provider,{value:g,children:f})};c.displayName=i+"Provider";function d(u,p){const f=p?.[t]?.[l]||s,y=T.useContext(f);if(y)return y;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,lC(a,...e)]}function lC(...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 St=globalThis?.document?T.useLayoutEffect:()=>{},cC=T[" useInsertionEffect ".trim().toString()]||St;function Sr({prop:t,defaultProp:e,onChange:r=()=>{},caller:n}){const[a,i,o]=dC({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=uC(d)?d(t):d;u!==t&&o.current?.(u)}else i(d)},[s,t,i,o]);return[l,c]}function dC({defaultProp:t,onChange:e}){const[r,n]=T.useState(t),a=T.useRef(r),i=T.useRef(e);return cC(()=>{i.current=e},[e]),T.useEffect(()=>{a.current!==r&&(i.current?.(r),a.current=r)},[r,a]),[r,n,i]}function uC(t){return typeof t=="function"}function xr(t){const e=pC(t),r=T.forwardRef((n,a)=>{const{children:i,...o}=n,s=T.Children.toArray(i),l=s.find(mC);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 v.jsx(e,{...o,ref:a,children:T.isValidElement(c)?T.cloneElement(c,void 0,d):null})}return v.jsx(e,{...o,ref:a,children:i})});return r.displayName=`${t}.Slot`,r}function pC(t){const e=T.forwardRef((r,n)=>{const{children:a,...i}=r;if(T.isValidElement(a)){const o=gC(a),s=hC(i,a.props);return a.type!==T.Fragment&&(s.ref=n?br(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 Hf=Symbol("radix.slottable");function fC(t){const e=({children:r})=>v.jsx(v.Fragment,{children:r});return e.displayName=`${t}.Slottable`,e.__radixId=Hf,e}function mC(t){return T.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===Hf}function hC(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 gC(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 vC=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],he=vC.reduce((t,e)=>{const r=xr(`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),v.jsx(l,{...s,ref:i})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function Uf(t,e){t&&yc.flushSync(()=>t.dispatchEvent(e))}function $s(t){const e=t+"CollectionProvider",[r,n]=ct(e),[a,i]=r(e,{collectionRef:{current:null},itemMap:new Map}),o=m=>{const{scope:g,children:w}=m,x=O.useRef(null),h=O.useRef(new Map).current;return v.jsx(a,{scope:g,itemMap:h,collectionRef:x,children:w})};o.displayName=e;const s=t+"CollectionSlot",l=xr(s),c=O.forwardRef((m,g)=>{const{scope:w,children:x}=m,h=i(s,w),b=me(g,h.collectionRef);return v.jsx(l,{ref:b,children:x})});c.displayName=s;const d=t+"CollectionItemSlot",u="data-radix-collection-item",p=xr(d),f=O.forwardRef((m,g)=>{const{scope:w,children:x,...h}=m,b=O.useRef(null),S=me(g,b),E=i(d,w);return O.useEffect(()=>(E.itemMap.set(b,{ref:b,...h}),()=>{E.itemMap.delete(b)})),v.jsx(p,{[u]:"",ref:S,children:x})});f.displayName=d;function y(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},y,n]}var yC=T.createContext(void 0);function Gs(t){const e=T.useContext(yC);return t||e||"ltr"}function dt(t){const e=T.useRef(t);return T.useEffect(()=>{e.current=t}),T.useMemo(()=>(...r)=>e.current?.(...r),[])}function bC(t,e=globalThis?.document){const r=dt(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 SC="DismissableLayer",Vs="dismissableLayer.update",xC="dismissableLayer.pointerDownOutside",wC="dismissableLayer.focusOutside",Kf,Yf=T.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Hs=T.forwardRef((t,e)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:o,onDismiss:s,...l}=t,c=T.useContext(Yf),[d,u]=T.useState(null),p=d?.ownerDocument??globalThis?.document,[,f]=T.useState({}),y=me(e,k=>u(k)),m=Array.from(c.layers),[g]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),w=m.indexOf(g),x=d?m.indexOf(d):-1,h=c.layersWithOutsidePointerEventsDisabled.size>0,b=x>=w,S=EC(k=>{const C=k.target,_=[...c.branches].some(A=>A.contains(C));!b||_||(a?.(k),o?.(k),k.defaultPrevented||s?.())},p),E=TC(k=>{const C=k.target;[...c.branches].some(A=>A.contains(C))||(i?.(k),o?.(k),k.defaultPrevented||s?.())},p);return bC(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&&(Kf=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(d)),c.layers.add(d),Xf(),()=>{r&&c.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=Kf)}},[d,p,r,c]),T.useEffect(()=>()=>{d&&(c.layers.delete(d),c.layersWithOutsidePointerEventsDisabled.delete(d),Xf())},[d,c]),T.useEffect(()=>{const k=()=>f({});return document.addEventListener(Vs,k),()=>document.removeEventListener(Vs,k)},[]),v.jsx(he.div,{...l,ref:y,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)})});Hs.displayName=SC;var CC="DismissableLayerBranch",kC=T.forwardRef((t,e)=>{const r=T.useContext(Yf),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]),v.jsx(he.div,{...t,ref:a})});kC.displayName=CC;function EC(t,e=globalThis?.document){const r=dt(t),n=T.useRef(!1),a=T.useRef(()=>{});return T.useEffect(()=>{const i=s=>{if(s.target&&!n.current){let l=function(){Zf(xC,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 TC(t,e=globalThis?.document){const r=dt(t),n=T.useRef(!1);return T.useEffect(()=>{const a=i=>{i.target&&!n.current&&Zf(wC,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 Xf(){const t=new CustomEvent(Vs);document.dispatchEvent(t)}function Zf(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?Uf(a,i):a.dispatchEvent(i)}var Us=0;function Qf(){T.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??Jf()),document.body.insertAdjacentElement("beforeend",t[1]??Jf()),Us++,()=>{Us===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Us--}},[])}function Jf(){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 Ks="focusScope.autoFocusOnMount",Ys="focusScope.autoFocusOnUnmount",em={bubbles:!1,cancelable:!0},AC="FocusScope",Xs=T.forwardRef((t,e)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...o}=t,[s,l]=T.useState(null),c=dt(a),d=dt(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:xt(u.current,{select:!0})},g=function(h){if(f.paused||!s)return;const b=h.relatedTarget;b!==null&&(s.contains(b)||xt(u.current,{select:!0}))},w=function(h){if(document.activeElement===document.body)for(const S of h)S.removedNodes.length>0&&xt(s)};document.addEventListener("focusin",m),document.addEventListener("focusout",g);const x=new MutationObserver(w);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){nm.add(f);const m=document.activeElement;if(!s.contains(m)){const w=new CustomEvent(Ks,em);s.addEventListener(Ks,c),s.dispatchEvent(w),w.defaultPrevented||(_C(MC(tm(s)),{select:!0}),document.activeElement===m&&xt(s))}return()=>{s.removeEventListener(Ks,c),setTimeout(()=>{const w=new CustomEvent(Ys,em);s.addEventListener(Ys,d),s.dispatchEvent(w),w.defaultPrevented||xt(m??document.body,{select:!0}),s.removeEventListener(Ys,d),nm.remove(f)},0)}}},[s,c,d,f]);const y=T.useCallback(m=>{if(!r&&!n||f.paused)return;const g=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,w=document.activeElement;if(g&&w){const x=m.currentTarget,[h,b]=OC(x);h&&b?!m.shiftKey&&w===b?(m.preventDefault(),r&&xt(h,{select:!0})):m.shiftKey&&w===h&&(m.preventDefault(),r&&xt(b,{select:!0})):w===x&&m.preventDefault()}},[r,n,f.paused]);return v.jsx(he.div,{tabIndex:-1,...o,ref:p,onKeyDown:y})});Xs.displayName=AC;function _C(t,{select:e=!1}={}){const r=document.activeElement;for(const n of t)if(xt(n,{select:e}),document.activeElement!==r)return}function OC(t){const e=tm(t),r=rm(e,t),n=rm(e.reverse(),t);return[r,n]}function tm(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 rm(t,e){for(const r of t)if(!PC(r,{upTo:e}))return r}function PC(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 IC(t){return t instanceof HTMLInputElement&&"select"in t}function xt(t,{select:e=!1}={}){if(t&&t.focus){const r=document.activeElement;t.focus({preventScroll:!0}),t!==r&&IC(t)&&e&&t.select()}}var nm=NC();function NC(){let t=[];return{add(e){const r=t[0];e!==r&&r?.pause(),t=am(t,e),t.unshift(e)},remove(e){t=am(t,e),t[0]?.resume()}}}function am(t,e){const r=[...t],n=r.indexOf(e);return n!==-1&&r.splice(n,1),r}function MC(t){return t.filter(e=>e.tagName!=="A")}var DC=T[" useId ".trim().toString()]||(()=>{}),zC=0;function Yt(t){const[e,r]=T.useState(DC());return St(()=>{r(n=>n??String(zC++))},[t]),e?`radix-${e}`:""}const LC=["top","right","bottom","left"],wt=Math.min,je=Math.max,fn=Math.round,mn=Math.floor,Ze=t=>({x:t,y:t}),jC={left:"right",right:"left",bottom:"top",top:"bottom"},WC={start:"end",end:"start"};function Zs(t,e,r){return je(t,wt(e,r))}function ut(t,e){return typeof t=="function"?t(e):t}function pt(t){return t.split("-")[0]}function Xt(t){return t.split("-")[1]}function Qs(t){return t==="x"?"y":"x"}function Js(t){return t==="y"?"height":"width"}const BC=new Set(["top","bottom"]);function Qe(t){return BC.has(pt(t))?"y":"x"}function el(t){return Qs(Qe(t))}function qC(t,e,r){r===void 0&&(r=!1);const n=Xt(t),a=el(t),i=Js(a);let o=a==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(o=hn(o)),[o,hn(o)]}function RC(t){const e=hn(t);return[tl(t),e,tl(e)]}function tl(t){return t.replace(/start|end/g,e=>WC[e])}const im=["left","right"],om=["right","left"],FC=["top","bottom"],$C=["bottom","top"];function GC(t,e,r){switch(t){case"top":case"bottom":return r?e?om:im:e?im:om;case"left":case"right":return e?FC:$C;default:return[]}}function VC(t,e,r,n){const a=Xt(t);let i=GC(pt(t),r==="start",n);return a&&(i=i.map(o=>o+"-"+a),e&&(i=i.concat(i.map(tl)))),i}function hn(t){return t.replace(/left|right|bottom|top/g,e=>jC[e])}function HC(t){return{top:0,right:0,bottom:0,left:0,...t}}function sm(t){return typeof t!="number"?HC(t):{top:t,right:t,bottom:t,left:t}}function gn(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 lm(t,e,r){let{reference:n,floating:a}=t;const i=Qe(e),o=el(e),s=Js(o),l=pt(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 UC(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}=ut(e,t),y=sm(f),g=s[p?u==="floating"?"reference":"floating":u],w=gn(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=gn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:x,offsetParent:h,strategy:l}):x);return{top:(w.top-S.top+y.top)/b.y,bottom:(S.bottom-w.bottom+y.bottom)/b.y,left:(w.left-S.left+y.left)/b.x,right:(S.right-w.right+y.right)/b.x}}const KC=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}=lm(c,n,l),p=n,f={},y=0;for(let g=0;g<s.length;g++){var m;const{name:w,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:UC},elements:{reference:t,floating:e}});d=h??d,u=b??u,f={...f,[w]:{...f[w],...S}},E&&y<=50&&(y++,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}=lm(c,p,l)),g=-1)}return{x:d,y:u,placement:p,strategy:a,middlewareData:f}},YC=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}=ut(t,e)||{};if(c==null)return{};const u=sm(d),p={x:r,y:n},f=el(a),y=Js(f),m=await o.getDimensions(c),g=f==="y",w=g?"top":"left",x=g?"bottom":"right",h=g?"clientHeight":"clientWidth",b=i.reference[y]+i.reference[f]-p[f]-i.floating[y],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[y]);const C=b/2-S/2,_=k/2-m[y]/2-1,A=wt(u[w],_),I=wt(u[x],_),N=A,D=k-m[y]-I,q=k/2-m[y]/2+C,H=Zs(N,q,D),L=!l.arrow&&Xt(a)!=null&&q!==H&&i.reference[y]/2-(q<N?A:I)-m[y]/2<0,F=L?q<N?q-N:q-D:0;return{[f]:p[f]+F,data:{[f]:H,centerOffset:q-H-F,...L&&{alignmentOffset:F}},reset:L}}}),XC=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:y="none",flipAlignment:m=!0,...g}=ut(t,e);if((r=i.arrow)!=null&&r.alignmentOffset)return{};const w=pt(a),x=Qe(s),h=pt(s)===s,b=await(l.isRTL==null?void 0:l.isRTL(c.floating)),S=p||(h||!m?[hn(s)]:RC(s)),E=y!=="none";!p&&E&&S.push(...VC(s,m,y,b));const k=[s,...S],C=await l.detectOverflow(e,g),_=[];let A=((n=i.flip)==null?void 0:n.overflows)||[];if(d&&_.push(C[w]),u){const q=qC(a,o,b);_.push(C[q[0]],C[q[1]])}if(A=[...A,{placement:a,overflows:_}],!_.every(q=>q<=0)){var I,N;const q=(((I=i.flip)==null?void 0:I.index)||0)+1,H=k[q];if(H&&(!(u==="alignment"?x!==Qe(H):!1)||A.every(R=>Qe(R.placement)===x?R.overflows[0]>0:!0)))return{data:{index:q,overflows:A},reset:{placement:H}};let L=(N=A.filter(F=>F.overflows[0]<=0).sort((F,R)=>F.overflows[1]-R.overflows[1])[0])==null?void 0:N.placement;if(!L)switch(f){case"bestFit":{var D;const F=(D=A.filter(R=>{if(E){const P=Qe(R.placement);return P===x||P==="y"}return!0}).map(R=>[R.placement,R.overflows.filter(P=>P>0).reduce((P,j)=>P+j,0)]).sort((R,P)=>R[1]-P[1])[0])==null?void 0:D[0];F&&(L=F);break}case"initialPlacement":L=s;break}if(a!==L)return{reset:{placement:L}}}return{}}}};function cm(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function dm(t){return LC.some(e=>t[e]>=0)}const ZC=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:r,platform:n}=e,{strategy:a="referenceHidden",...i}=ut(t,e);switch(a){case"referenceHidden":{const o=await n.detectOverflow(e,{...i,elementContext:"reference"}),s=cm(o,r.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:dm(s)}}}case"escaped":{const o=await n.detectOverflow(e,{...i,altBoundary:!0}),s=cm(o,r.floating);return{data:{escapedOffsets:s,escaped:dm(s)}}}default:return{}}}}},um=new Set(["left","top"]);async function QC(t,e){const{placement:r,platform:n,elements:a}=t,i=await(n.isRTL==null?void 0:n.isRTL(a.floating)),o=pt(r),s=Xt(r),l=Qe(r)==="y",c=um.has(o)?-1:1,d=i&&l?-1:1,u=ut(e,t);let{mainAxis:p,crossAxis:f,alignmentAxis:y}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return s&&typeof y=="number"&&(f=s==="end"?y*-1:y),l?{x:f*d,y:p*c}:{x:p*c,y:f*d}}const JC=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 QC(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}}}}},e0=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:w=>{let{x,y:h}=w;return{x,y:h}}},...c}=ut(t,e),d={x:r,y:n},u=await i.detectOverflow(e,c),p=Qe(pt(a)),f=Qs(p);let y=d[f],m=d[p];if(o){const w=f==="y"?"top":"left",x=f==="y"?"bottom":"right",h=y+u[w],b=y-u[x];y=Zs(h,y,b)}if(s){const w=p==="y"?"top":"left",x=p==="y"?"bottom":"right",h=m+u[w],b=m-u[x];m=Zs(h,m,b)}const g=l.fn({...e,[f]:y,[p]:m});return{...g,data:{x:g.x-r,y:g.y-n,enabled:{[f]:o,[p]:s}}}}}},t0=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}=ut(t,e),d={x:r,y:n},u=Qe(a),p=Qs(u);let f=d[p],y=d[u];const m=ut(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 w,x;const h=p==="y"?"width":"height",b=um.has(pt(a)),S=i.reference[u]-i.floating[h]+(b&&((w=o.offset)==null?void 0:w[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);y<S?y=S:y>E&&(y=E)}return{[p]:f,[u]:y}}}},r0=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}=ut(t,e),d=await o.detectOverflow(e,c),u=pt(a),p=Xt(a),f=Qe(a)==="y",{width:y,height:m}=i.floating;let g,w;u==="top"||u==="bottom"?(g=u,w=p===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?"start":"end")?"left":"right"):(w=u,g=p==="end"?"top":"bottom");const x=m-d.top-d.bottom,h=y-d.left-d.right,b=wt(m-d[g],x),S=wt(y-d[w],h),E=!e.middlewareData.shift;let k=b,C=S;if((r=e.middlewareData.shift)!=null&&r.enabled.x&&(C=h),(n=e.middlewareData.shift)!=null&&n.enabled.y&&(k=x),E&&!p){const A=je(d.left,0),I=je(d.right,0),N=je(d.top,0),D=je(d.bottom,0);f?C=y-2*(A!==0||I!==0?A+I:je(d.left,d.right)):k=m-2*(N!==0||D!==0?N+D:je(d.top,d.bottom))}await l({...e,availableWidth:C,availableHeight:k});const _=await o.getDimensions(s.floating);return y!==_.width||m!==_.height?{reset:{rects:!0}}:{}}}};function vn(){return typeof window<"u"}function Zt(t){return pm(t)?(t.nodeName||"").toLowerCase():"#document"}function We(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Je(t){var e;return(e=(pm(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function pm(t){return vn()?t instanceof Node||t instanceof We(t).Node:!1}function Ge(t){return vn()?t instanceof Element||t instanceof We(t).Element:!1}function et(t){return vn()?t instanceof HTMLElement||t instanceof We(t).HTMLElement:!1}function fm(t){return!vn()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof We(t).ShadowRoot}const n0=new Set(["inline","contents"]);function wr(t){const{overflow:e,overflowX:r,overflowY:n,display:a}=Ve(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+r)&&!n0.has(a)}const a0=new Set(["table","td","th"]);function i0(t){return a0.has(Zt(t))}const o0=[":popover-open",":modal"];function yn(t){return o0.some(e=>{try{return t.matches(e)}catch{return!1}})}const s0=["transform","translate","scale","rotate","perspective"],l0=["transform","translate","scale","rotate","perspective","filter"],c0=["paint","layout","strict","content"];function rl(t){const e=nl(),r=Ge(t)?Ve(t):t;return s0.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)||l0.some(n=>(r.willChange||"").includes(n))||c0.some(n=>(r.contain||"").includes(n))}function d0(t){let e=Ct(t);for(;et(e)&&!Qt(e);){if(rl(e))return e;if(yn(e))return null;e=Ct(e)}return null}function nl(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const u0=new Set(["html","body","#document"]);function Qt(t){return u0.has(Zt(t))}function Ve(t){return We(t).getComputedStyle(t)}function bn(t){return Ge(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Ct(t){if(Zt(t)==="html")return t;const e=t.assignedSlot||t.parentNode||fm(t)&&t.host||Je(t);return fm(e)?e.host:e}function mm(t){const e=Ct(t);return Qt(e)?t.ownerDocument?t.ownerDocument.body:t.body:et(e)&&wr(e)?e:mm(e)}function Cr(t,e,r){var n;e===void 0&&(e=[]),r===void 0&&(r=!0);const a=mm(t),i=a===((n=t.ownerDocument)==null?void 0:n.body),o=We(a);if(i){const s=al(o);return e.concat(o,o.visualViewport||[],wr(a)?a:[],s&&r?Cr(s):[])}return e.concat(a,Cr(a,[],r))}function al(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function hm(t){const e=Ve(t);let r=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const a=et(t),i=a?t.offsetWidth:r,o=a?t.offsetHeight:n,s=fn(r)!==i||fn(n)!==o;return s&&(r=i,n=o),{width:r,height:n,$:s}}function il(t){return Ge(t)?t:t.contextElement}function Jt(t){const e=il(t);if(!et(e))return Ze(1);const r=e.getBoundingClientRect(),{width:n,height:a,$:i}=hm(e);let o=(i?fn(r.width):r.width)/n,s=(i?fn(r.height):r.height)/a;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}const p0=Ze(0);function gm(t){const e=We(t);return!nl()||!e.visualViewport?p0:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function f0(t,e,r){return e===void 0&&(e=!1),!r||e&&r!==We(t)?!1:e}function Wt(t,e,r,n){e===void 0&&(e=!1),r===void 0&&(r=!1);const a=t.getBoundingClientRect(),i=il(t);let o=Ze(1);e&&(n?Ge(n)&&(o=Jt(n)):o=Jt(t));const s=f0(i,r,n)?gm(i):Ze(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=We(i),f=n&&Ge(n)?We(n):n;let y=p,m=al(y);for(;m&&n&&f!==y;){const g=Jt(m),w=m.getBoundingClientRect(),x=Ve(m),h=w.left+(m.clientLeft+parseFloat(x.paddingLeft))*g.x,b=w.top+(m.clientTop+parseFloat(x.paddingTop))*g.y;l*=g.x,c*=g.y,d*=g.x,u*=g.y,l+=h,c+=b,y=We(m),m=al(y)}}return gn({width:d,height:u,x:l,y:c})}function Sn(t,e){const r=bn(t).scrollLeft;return e?e.left+r:Wt(Je(t)).left+r}function vm(t,e){const r=t.getBoundingClientRect(),n=r.left+e.scrollLeft-Sn(t,r),a=r.top+e.scrollTop;return{x:n,y:a}}function m0(t){let{elements:e,rect:r,offsetParent:n,strategy:a}=t;const i=a==="fixed",o=Je(n),s=e?yn(e.floating):!1;if(n===o||s&&i)return r;let l={scrollLeft:0,scrollTop:0},c=Ze(1);const d=Ze(0),u=et(n);if((u||!u&&!i)&&((Zt(n)!=="body"||wr(o))&&(l=bn(n)),et(n))){const f=Wt(n);c=Jt(n),d.x=f.x+n.clientLeft,d.y=f.y+n.clientTop}const p=o&&!u&&!i?vm(o,l):Ze(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 h0(t){return Array.from(t.getClientRects())}function g0(t){const e=Je(t),r=bn(t),n=t.ownerDocument.body,a=je(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=je(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let o=-r.scrollLeft+Sn(t);const s=-r.scrollTop;return Ve(n).direction==="rtl"&&(o+=je(e.clientWidth,n.clientWidth)-a),{width:a,height:i,x:o,y:s}}const ym=25;function v0(t,e){const r=We(t),n=Je(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=nl();(!d||d&&e==="fixed")&&(s=a.offsetLeft,l=a.offsetTop)}const c=Sn(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,y=Math.abs(n.clientWidth-u.clientWidth-f);y<=ym&&(i-=y)}else c<=ym&&(i+=c);return{width:i,height:o,x:s,y:l}}const y0=new Set(["absolute","fixed"]);function b0(t,e){const r=Wt(t,!0,e==="fixed"),n=r.top+t.clientTop,a=r.left+t.clientLeft,i=et(t)?Jt(t):Ze(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 bm(t,e,r){let n;if(e==="viewport")n=v0(t,r);else if(e==="document")n=g0(Je(t));else if(Ge(e))n=b0(e,r);else{const a=gm(t);n={x:e.x-a.x,y:e.y-a.y,width:e.width,height:e.height}}return gn(n)}function Sm(t,e){const r=Ct(t);return r===e||!Ge(r)||Qt(r)?!1:Ve(r).position==="fixed"||Sm(r,e)}function S0(t,e){const r=e.get(t);if(r)return r;let n=Cr(t,[],!1).filter(s=>Ge(s)&&Zt(s)!=="body"),a=null;const i=Ve(t).position==="fixed";let o=i?Ct(t):t;for(;Ge(o)&&!Qt(o);){const s=Ve(o),l=rl(o);!l&&s.position==="fixed"&&(a=null),(i?!l&&!a:!l&&s.position==="static"&&!!a&&y0.has(a.position)||wr(o)&&!l&&Sm(t,o))?n=n.filter(d=>d!==o):a=s,o=Ct(o)}return e.set(t,n),n}function x0(t){let{element:e,boundary:r,rootBoundary:n,strategy:a}=t;const o=[...r==="clippingAncestors"?yn(e)?[]:S0(e,this._c):[].concat(r),n],s=o[0],l=o.reduce((c,d)=>{const u=bm(e,d,a);return c.top=je(u.top,c.top),c.right=wt(u.right,c.right),c.bottom=wt(u.bottom,c.bottom),c.left=je(u.left,c.left),c},bm(e,s,a));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function w0(t){const{width:e,height:r}=hm(t);return{width:e,height:r}}function C0(t,e,r){const n=et(e),a=Je(e),i=r==="fixed",o=Wt(t,!0,i,e);let s={scrollLeft:0,scrollTop:0};const l=Ze(0);function c(){l.x=Sn(a)}if(n||!n&&!i)if((Zt(e)!=="body"||wr(a))&&(s=bn(e)),n){const f=Wt(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?vm(a,s):Ze(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 ol(t){return Ve(t).position==="static"}function xm(t,e){if(!et(t)||Ve(t).position==="fixed")return null;if(e)return e(t);let r=t.offsetParent;return Je(t)===r&&(r=r.ownerDocument.body),r}function wm(t,e){const r=We(t);if(yn(t))return r;if(!et(t)){let a=Ct(t);for(;a&&!Qt(a);){if(Ge(a)&&!ol(a))return a;a=Ct(a)}return r}let n=xm(t,e);for(;n&&i0(n)&&ol(n);)n=xm(n,e);return n&&Qt(n)&&ol(n)&&!rl(n)?r:n||d0(t)||r}const k0=async function(t){const e=this.getOffsetParent||wm,r=this.getDimensions,n=await r(t.floating);return{reference:C0(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function E0(t){return Ve(t).direction==="rtl"}const T0={convertOffsetParentRelativeRectToViewportRelativeRect:m0,getDocumentElement:Je,getClippingRect:x0,getOffsetParent:wm,getElementRects:k0,getClientRects:h0,getDimensions:w0,getScale:Jt,isElement:Ge,isRTL:E0};function Cm(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function A0(t,e){let r=null,n;const a=Je(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 y=mn(u),m=mn(a.clientWidth-(d+p)),g=mn(a.clientHeight-(u+f)),w=mn(d),h={rootMargin:-y+"px "+-m+"px "+-g+"px "+-w+"px",threshold:je(0,wt(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&&!Cm(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 _0(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=il(t),d=a||i?[...c?Cr(c):[],...Cr(e)]:[];d.forEach(w=>{a&&w.addEventListener("scroll",r,{passive:!0}),i&&w.addEventListener("resize",r)});const u=c&&s?A0(c,r):null;let p=-1,f=null;o&&(f=new ResizeObserver(w=>{let[x]=w;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 y,m=l?Wt(t):null;l&&g();function g(){const w=Wt(t);m&&!Cm(m,w)&&r(),m=w,y=requestAnimationFrame(g)}return r(),()=>{var w;d.forEach(x=>{a&&x.removeEventListener("scroll",r),i&&x.removeEventListener("resize",r)}),u?.(),(w=f)==null||w.disconnect(),f=null,l&&cancelAnimationFrame(y)}}const O0=JC,P0=e0,I0=XC,N0=r0,M0=ZC,km=YC,D0=t0,z0=(t,e,r)=>{const n=new Map,a={platform:T0,...r},i={...a.platform,_c:n};return KC(t,e,{...a,platform:i})};var L0=typeof document<"u",j0=function(){},xn=L0?O.useLayoutEffect:j0;function wn(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(!wn(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)&&!wn(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function Em(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Tm(t,e){const r=Em(t);return Math.round(e*r)/r}function sl(t){const e=T.useRef(t);return xn(()=>{e.current=t}),e}function W0(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);wn(p,n)||f(n);const[y,m]=T.useState(null),[g,w]=T.useState(null),x=T.useCallback(R=>{R!==E.current&&(E.current=R,m(R))},[]),h=T.useCallback(R=>{R!==k.current&&(k.current=R,w(R))},[]),b=i||y,S=o||g,E=T.useRef(null),k=T.useRef(null),C=T.useRef(d),_=l!=null,A=sl(l),I=sl(a),N=sl(c),D=T.useCallback(()=>{if(!E.current||!k.current)return;const R={placement:e,strategy:r,middleware:p};I.current&&(R.platform=I.current),z0(E.current,k.current,R).then(P=>{const j={...P,isPositioned:N.current!==!1};q.current&&!wn(C.current,j)&&(C.current=j,yc.flushSync(()=>{u(j)}))})},[p,e,r,I,N]);xn(()=>{c===!1&&C.current.isPositioned&&(C.current.isPositioned=!1,u(R=>({...R,isPositioned:!1})))},[c]);const q=T.useRef(!1);xn(()=>(q.current=!0,()=>{q.current=!1}),[]),xn(()=>{if(b&&(E.current=b),S&&(k.current=S),b&&S){if(A.current)return A.current(b,S,D);D()}},[b,S,D,A,_]);const H=T.useMemo(()=>({reference:E,floating:k,setReference:x,setFloating:h}),[x,h]),L=T.useMemo(()=>({reference:b,floating:S}),[b,S]),F=T.useMemo(()=>{const R={position:r,left:0,top:0};if(!L.floating)return R;const P=Tm(L.floating,d.x),j=Tm(L.floating,d.y);return s?{...R,transform:"translate("+P+"px, "+j+"px)",...Em(L.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:P,top:j}},[r,s,L.floating,d.x,d.y]);return T.useMemo(()=>({...d,update:D,refs:H,elements:L,floatingStyles:F}),[d,D,H,L,F])}const B0=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?km({element:n.current,padding:a}).fn(r):{}:n?km({element:n,padding:a}).fn(r):{}}}},q0=(t,e)=>({...O0(t),options:[t,e]}),R0=(t,e)=>({...P0(t),options:[t,e]}),F0=(t,e)=>({...D0(t),options:[t,e]}),$0=(t,e)=>({...I0(t),options:[t,e]}),G0=(t,e)=>({...N0(t),options:[t,e]}),V0=(t,e)=>({...M0(t),options:[t,e]}),H0=(t,e)=>({...B0(t),options:[t,e]});var U0="Arrow",Am=T.forwardRef((t,e)=>{const{children:r,width:n=10,height:a=5,...i}=t;return v.jsx(he.svg,{...i,ref:e,width:n,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?r:v.jsx("polygon",{points:"0,0 30,0 15,10"})})});Am.displayName=U0;var K0=Am;function ll(t){const[e,r]=T.useState(void 0);return St(()=>{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 cl="Popper",[_m,Om]=ct(cl),[Y0,Pm]=_m(cl),Im=t=>{const{__scopePopper:e,children:r}=t,[n,a]=T.useState(null);return v.jsx(Y0,{scope:e,anchor:n,onAnchorChange:a,children:r})};Im.displayName=cl;var Nm="PopperAnchor",Mm=T.forwardRef((t,e)=>{const{__scopePopper:r,virtualRef:n,...a}=t,i=Pm(Nm,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:v.jsx(he.div,{...a,ref:s})});Mm.displayName=Nm;var dl="PopperContent",[X0,Z0]=_m(dl),Dm=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:y,...m}=t,g=Pm(dl,r),[w,x]=T.useState(null),h=me(e,K=>x(K)),[b,S]=T.useState(null),E=ll(b),k=E?.width??0,C=E?.height??0,_=n+(i!=="center"?"-"+i:""),A=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},I=Array.isArray(c)?c:[c],N=I.length>0,D={padding:A,boundary:I.filter(J0),altBoundary:N},{refs:q,floatingStyles:H,placement:L,isPositioned:F,middlewareData:R}=W0({strategy:"fixed",placement:_,whileElementsMounted:(...K)=>_0(...K,{animationFrame:f==="always"}),elements:{reference:g.anchor},middleware:[q0({mainAxis:a+C,alignmentAxis:o}),l&&R0({mainAxis:!0,crossAxis:!1,limiter:u==="partial"?F0():void 0,...D}),l&&$0({...D}),G0({...D,apply:({elements:K,rects:se,availableWidth:re,availableHeight:M})=>{const{width:$,height:X}=se.reference,oe=K.floating.style;oe.setProperty("--radix-popper-available-width",`${re}px`),oe.setProperty("--radix-popper-available-height",`${M}px`),oe.setProperty("--radix-popper-anchor-width",`${$}px`),oe.setProperty("--radix-popper-anchor-height",`${X}px`)}}),b&&H0({element:b,padding:s}),ek({arrowWidth:k,arrowHeight:C}),p&&V0({strategy:"referenceHidden",...D})]}),[P,j]=jm(L),Y=dt(y);St(()=>{F&&Y?.()},[F,Y]);const Z=R.arrow?.x,W=R.arrow?.y,z=R.arrow?.centerOffset!==0,[B,V]=T.useState();return St(()=>{w&&V(window.getComputedStyle(w).zIndex)},[w]),v.jsx("div",{ref:q.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:F?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:B,"--radix-popper-transform-origin":[R.transformOrigin?.x,R.transformOrigin?.y].join(" "),...R.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:v.jsx(X0,{scope:r,placedSide:P,onArrowChange:S,arrowX:Z,arrowY:W,shouldHideArrow:z,children:v.jsx(he.div,{"data-side":P,"data-align":j,...m,ref:h,style:{...m.style,animation:F?void 0:"none"}})})})});Dm.displayName=dl;var zm="PopperArrow",Q0={top:"bottom",right:"left",bottom:"top",left:"right"},Lm=T.forwardRef(function(e,r){const{__scopePopper:n,...a}=e,i=Z0(zm,n),o=Q0[i.placedSide];return v.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:v.jsx(K0,{...a,ref:r,style:{...a.style,display:"block"}})})});Lm.displayName=zm;function J0(t){return t!==null}var ek=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]=jm(r),u={start:"0%",center:"50%",end:"100%"}[d],p=(a.arrow?.x??0)+s/2,f=(a.arrow?.y??0)+l/2;let y="",m="";return c==="bottom"?(y=o?u:`${p}px`,m=`${-l}px`):c==="top"?(y=o?u:`${p}px`,m=`${n.floating.height+l}px`):c==="right"?(y=`${-l}px`,m=o?u:`${f}px`):c==="left"&&(y=`${n.floating.width+l}px`,m=o?u:`${f}px`),{data:{x:y,y:m}}}});function jm(t){const[e,r="center"]=t.split("-");return[e,r]}var tk=Im,rk=Mm,nk=Dm,ak=Lm,ik="Portal",ul=T.forwardRef((t,e)=>{const{container:r,...n}=t,[a,i]=T.useState(!1);St(()=>i(!0),[]);const o=r||a&&globalThis?.document?.body;return o?Nt.createPortal(v.jsx(he.div,{...n,ref:e}),o):null});ul.displayName=ik;function ok(t,e){return T.useReducer((r,n)=>e[r][n]??r,t)}var kt=t=>{const{present:e,children:r}=t,n=sk(e),a=typeof r=="function"?r({present:n.isPresent}):T.Children.only(r),i=me(n.ref,lk(a));return typeof r=="function"||n.isPresent?T.cloneElement(a,{ref:i}):null};kt.displayName="Presence";function sk(t){const[e,r]=T.useState(),n=T.useRef(null),a=T.useRef(t),i=T.useRef("none"),o=t?"mounted":"unmounted",[s,l]=ok(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return T.useEffect(()=>{const c=Cn(n.current);i.current=s==="mounted"?c:"none"},[s]),St(()=>{const c=n.current,d=a.current;if(d!==t){const p=i.current,f=Cn(c);t?l("MOUNT"):f==="none"||c?.display==="none"?l("UNMOUNT"):l(d&&p!==f?"ANIMATION_OUT":"UNMOUNT"),a.current=t}},[t,l]),St(()=>{if(e){let c;const d=e.ownerDocument.defaultView??window,u=f=>{const m=Cn(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=Cn(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 Cn(t){return t?.animationName||"none"}function lk(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 pl="rovingFocusGroup.onEntryFocus",ck={bubbles:!1,cancelable:!0},kr="RovingFocusGroup",[fl,Wm,dk]=$s(kr),[uk,Bm]=ct(kr,[dk]),[pk,fk]=uk(kr),qm=T.forwardRef((t,e)=>v.jsx(fl.Provider,{scope:t.__scopeRovingFocusGroup,children:v.jsx(fl.Slot,{scope:t.__scopeRovingFocusGroup,children:v.jsx(mk,{...t,ref:e})})}));qm.displayName=kr;var mk=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),y=Gs(i),[m,g]=Sr({prop:o,defaultProp:s??null,onChange:l,caller:kr}),[w,x]=T.useState(!1),h=dt(c),b=Wm(r),S=T.useRef(!1),[E,k]=T.useState(0);return T.useEffect(()=>{const C=p.current;if(C)return C.addEventListener(pl,h),()=>C.removeEventListener(pl,h)},[h]),v.jsx(pk,{scope:r,orientation:n,dir:y,loop:a,currentTabStopId:m,onItemFocus:T.useCallback(C=>g(C),[g]),onItemShiftTab:T.useCallback(()=>x(!0),[]),onFocusableItemAdd:T.useCallback(()=>k(C=>C+1),[]),onFocusableItemRemove:T.useCallback(()=>k(C=>C-1),[]),children:v.jsx(he.div,{tabIndex:w||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,C=>{const _=!S.current;if(C.target===C.currentTarget&&_&&!w){const A=new CustomEvent(pl,ck);if(C.currentTarget.dispatchEvent(A),!A.defaultPrevented){const I=b().filter(L=>L.focusable),N=I.find(L=>L.active),D=I.find(L=>L.id===m),H=[N,D,...I].filter(Boolean).map(L=>L.ref.current);$m(H,d)}}S.current=!1}),onBlur:ie(t.onBlur,()=>x(!1))})})}),Rm="RovingFocusGroupItem",Fm=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=fk(Rm,r),u=d.currentTabStopId===c,p=Wm(r),{onFocusableItemAdd:f,onFocusableItemRemove:y,currentTabStopId:m}=d;return T.useEffect(()=>{if(n)return f(),()=>y()},[n,f,y]),v.jsx(fl.ItemSlot,{scope:r,id:c,focusable:n,active:a,children:v.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 w=vk(g,d.orientation,d.dir);if(w!==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(w==="last")h.reverse();else if(w==="prev"||w==="next"){w==="prev"&&h.reverse();const b=h.indexOf(g.currentTarget);h=d.loop?yk(h,b+1):h.slice(b+1)}setTimeout(()=>$m(h))}}),children:typeof o=="function"?o({isCurrentTabStop:u,hasTabStop:m!=null}):o})})});Fm.displayName=Rm;var hk={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function gk(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function vk(t,e,r){const n=gk(t.key,r);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return hk[n]}function $m(t,e=!1){const r=document.activeElement;for(const n of t)if(n===r||(n.focus({preventScroll:e}),document.activeElement!==r))return}function yk(t,e){return t.map((r,n)=>t[(e+n)%t.length])}var bk=qm,Sk=Fm,xk=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},er=new WeakMap,kn=new WeakMap,En={},ml=0,Gm=function(t){return t&&(t.host||Gm(t.parentNode))},wk=function(t,e){return e.map(function(r){if(t.contains(r))return r;var n=Gm(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})},Ck=function(t,e,r,n){var a=wk(e,Array.isArray(t)?t:[t]);En[r]||(En[r]=new WeakMap);var i=En[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),y=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&&y&&kn.set(p,!0),g===1&&p.setAttribute(r,"true"),y||p.setAttribute(n,"true")}catch(w){console.error("aria-hidden: cannot operate on ",p,w)}})};return d(e),s.clear(),ml++,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||(kn.has(u)||u.removeAttribute(n),kn.delete(u)),f||u.removeAttribute(r)}),ml--,ml||(er=new WeakMap,er=new WeakMap,kn=new WeakMap,En={})}},Vm=function(t,e,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(t)?t:[t]),a=xk(t);return a?(n.push.apply(n,Array.from(a.querySelectorAll("[aria-live], script"))),Ck(n,a,r,"aria-hidden")):function(){return null}},tt=function(){return tt=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},tt.apply(this,arguments)};function Hm(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 kk(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 Tn="right-scroll-bar-position",An="width-before-scroll-bar",Ek="with-scroll-bars-hidden",Tk="--removed-body-scroll-bar-size";function hl(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function Ak(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 _k=typeof window<"u"?T.useLayoutEffect:T.useEffect,Um=new WeakMap;function Ok(t,e){var r=Ak(null,function(n){return t.forEach(function(a){return hl(a,n)})});return _k(function(){var n=Um.get(r);if(n){var a=new Set(n),i=new Set(t),o=r.current;a.forEach(function(s){i.has(s)||hl(s,null)}),i.forEach(function(s){a.has(s)||hl(s,o)})}Um.set(r,t)},[t]),r}function Pk(t){return t}function Ik(t,e){e===void 0&&(e=Pk);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 Nk(t){t===void 0&&(t={});var e=Ik(null);return e.options=tt({async:!0,ssr:!1},t),e}var Km=function(t){var e=t.sideCar,r=Hm(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,tt({},r))};Km.isSideCarExport=!0;function Mk(t,e){return t.useMedium(e),Km}var Ym=Nk(),gl=function(){},_n=T.forwardRef(function(t,e){var r=T.useRef(null),n=T.useState({onScrollCapture:gl,onWheelCapture:gl,onTouchMoveCapture:gl}),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,y=t.noIsolation,m=t.inert,g=t.allowPinchZoom,w=t.as,x=w===void 0?"div":w,h=t.gapMode,b=Hm(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=p,E=Ok([r,e]),k=tt(tt({},b),a);return T.createElement(T.Fragment,null,d&&T.createElement(S,{sideCar:Ym,removeScrollBar:c,shards:u,noRelative:f,noIsolation:y,inert:m,setCallbacks:i,allowPinchZoom:!!g,lockRef:r,gapMode:h}),o?T.cloneElement(T.Children.only(s),tt(tt({},k),{ref:E})):T.createElement(x,tt({},k,{className:l,ref:E}),s))});_n.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},_n.classNames={fullWidth:An,zeroRight:Tn};var Dk=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function zk(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=Dk();return e&&t.setAttribute("nonce",e),t}function Lk(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function jk(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var Wk=function(){var t=0,e=null;return{add:function(r){t==0&&(e=zk())&&(Lk(e,r),jk(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},Bk=function(){var t=Wk();return function(e,r){T.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&r])}},Xm=function(){var t=Bk(),e=function(r){var n=r.styles,a=r.dynamic;return t(n,a),null};return e},qk={left:0,top:0,right:0,gap:0},vl=function(t){return parseInt(t||"",10)||0},Rk=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[vl(r),vl(n),vl(a)]},Fk=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return qk;var e=Rk(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])}},$k=Xm(),tr="data-scroll-locked",Gk=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=of(()=>{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 Ms,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(y){console.error("Error during Paged.js preview rendering:",y),a(!1)}},500);return O.useEffect(()=>{u()},[t,r]),v.jsxs(lf,{config:c,children:[v.jsx("div",{className:[e??"",n?"rendering":"rendered",c?.page?.showBleed?"uhuu-bleed-visible":"",c?.page?.preview??""].filter(Boolean).join(" "),ref:i}),v.jsx("div",{className:"uhuu-reactive-content",style:{display:"none"},ref:o,children:t})]})},Jx=({children:t})=>v.jsx(v.Fragment,{children:t});class ln{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(){ln.handlePageBreakStyles(),ln.handleUhuuDialogs()}}class cf{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 df=({children:t,className:e,setup:r})=>{const n=sf.pageParams("static",r);O.useEffect(()=>{n?.page?.compatibility&&ln.handle();const i=cf.setupPageStyles(n?.page?.printCssUrl);return()=>{i&&cf.removePageStyles(i)}},[r,n?.page?.compatibility,n?.page?.printCssUrl]);const a=[e,n?.page?.preview].filter(Boolean).join(" ");return v.jsx(lf,{config:n,children:v.jsx("div",{className:a,children:t})})},uf=O.forwardRef(({children:t,className:e="",style:r,pageNo:n,overlay:a,showBleed:i,"data-page-key":o},s)=>{const l=O.useContext(zt),c=i??l?.page?.showBleed??!1;return v.jsxs("div",{className:`uhuu-page-sheet ${e}`,style:r,ref:s,"data-page-key":o,children:[t,a&&a({pageNo:n}),c&&v.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":""}:{}},Ds=t=>{const e=O.useContext(zt),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=S=>`${S}mm`,y=()=>{let S=s;return s?!c&&!d&&(S+=r):(S=n,c||(S+=r),d||(S+=r),(c||d)&&(S-=(c??0)+(d??0))),S},m=()=>{let S=l;return l?!u&&!p&&(S+=r):(S=a,u||(S+=r),p||(S+=r),(u||p)&&(S-=(u??0)+(p??0))),S},g=y(),w=m(),x=S=>S!==void 0?f(S):void 0,b=(S=>Object.fromEntries(Object.entries(S).filter(([E,k])=>k!==void 0)))({backgroundColor:o,width:x(g),height:x(w),left:x(c>0?c+r:c),right:x(d>0?d+r:d),top:x(u>0?u+r:u),bottom:x(p>0?p+r:p)});return v.jsx("div",{className:"uhuu-image-container",style:b,...t.dataUhuu!==void 0?{"data-uhuu":t.dataUhuu}:{},children:v.jsxs("div",{className:"uhuu-image-inner",...Kt(t,e),children:[v.jsx("img",{className:"cover-image",src:i||null}),t.children]})})};const ew=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),tw=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,r,n)=>n?n.toUpperCase():r.toLowerCase()),pf=t=>{const e=tw(t);return e.charAt(0).toUpperCase()+e.slice(1)},ff=(...t)=>t.filter((e,r,n)=>!!e&&e.trim()!==""&&n.indexOf(e)===r).join(" ").trim(),rw=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};var nw={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 aw=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,...nw,width:e,height:e,stroke:t,strokeWidth:n?Number(r)*24/Number(e):r,className:ff("lucide",a),...!i&&!rw(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(aw,{ref:i,iconNode:e,className:ff(`lucide-${ew(pf(t))}`,`lucide-${t}`,n),...a}));return r.displayName=pf(t),r};const mf=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 iw=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 cn=Se("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const ow=Se("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const sw=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 hf=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 gf=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 zs=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 lw=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 cw=Se("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);const st=Se("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const dw=Se("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);const uw=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 pw=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 fw=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 vf=Se("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);const mw=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 hw=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"}]]),yf=T.createContext({portalContainer:null});function Ls(){return T.useContext(yf)}function gw({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)}},[]),v.jsx(yf.Provider,{value:{portalContainer:e},children:t})}const bf=O.createContext({interactive:!0,setInteractive:()=>{},enableDevTools:!1});function js(){return O.useContext(bf)}function Ws(){const{interactive:t}=js();return!t}function vw({children:t,defaultInteractive:e=!0,enableDevTools:r=!1}){const a=!!(typeof window<"u"&&window?.$uhuu_renderer)?!1:e,[i,o]=O.useState(a);return v.jsx(bf.Provider,{value:{interactive:i,setInteractive:o,enableDevTools:r},children:v.jsx(gw,{children:v.jsx("div",{"data-uhuu-interactive":i?"":void 0,style:{display:"contents"},children:t})})})}function Sf(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=Sf(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function xf(){for(var t,e,r=0,n="",a=arguments.length;r<a;r++)(t=arguments[r])&&(e=Sf(t))&&(n&&(n+=" "),n+=e);return n}const wf=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,Cf=xf,kf=(t,e)=>r=>{var n;if(e?.variants==null)return Cf(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=wf(d)||wf(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(y=>{let[m,g]=y;return Array.isArray(g)?g.includes({...i,...s}[m]):{...i,...s}[m]===g})?[...c,u,p]:c},[]);return Cf(t,o,l,r?.class,r?.className)},yw=(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},bw=(t,e)=>({classGroupId:t,validator:e}),Ef=(t=new Map,e=null,r)=>({nextPart:t,validators:e,classGroupId:r}),dn="-",Tf=[],Sw="arbitrary..",xw=t=>{const e=Cw(t),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=t;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return ww(o);const s=o.split(dn),l=s[0]===""&&s.length>1?1:0;return Af(s,l,e)},getConflictingClassGroupIds:(o,s)=>{if(s){const l=n[o],c=r[o];return l?c?yw(c,l):l:c||Tf}return r[o]||Tf}}},Af=(t,e,r)=>{if(t.length-e===0)return r.classGroupId;const a=t[e],i=r.nextPart.get(a);if(i){const c=Af(t,e+1,i);if(c)return c}const o=r.validators;if(o===null)return;const s=e===0?t.join(dn):t.slice(e).join(dn),l=o.length;for(let c=0;c<l;c++){const d=o[c];if(d.validator(s))return d.classGroupId}},ww=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?Sw+n:void 0})(),Cw=t=>{const{theme:e,classGroups:r}=t;return kw(r,e)},kw=(t,e)=>{const r=Ef();for(const n in t){const a=t[n];Bs(a,r,n,e)}return r},Bs=(t,e,r,n)=>{const a=t.length;for(let i=0;i<a;i++){const o=t[i];Ew(o,e,r,n)}},Ew=(t,e,r,n)=>{if(typeof t=="string"){Tw(t,e,r);return}if(typeof t=="function"){Aw(t,e,r,n);return}_w(t,e,r,n)},Tw=(t,e,r)=>{const n=t===""?e:_f(e,t);n.classGroupId=r},Aw=(t,e,r,n)=>{if(Ow(t)){Bs(t(n),e,r,n);return}e.validators===null&&(e.validators=[]),e.validators.push(bw(r,t))},_w=(t,e,r,n)=>{const a=Object.entries(t),i=a.length;for(let o=0;o<i;o++){const[s,l]=a[o];Bs(l,_f(e,s),r,n)}},_f=(t,e)=>{let r=t;const n=e.split(dn),a=n.length;for(let i=0;i<a;i++){const o=n[i];let s=r.nextPart.get(o);s||(s=Ef(),r.nextPart.set(o,s)),r=s}return r},Ow=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,Pw=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)}}},qs="!",Of=":",Iw=[],Pf=(t,e,r,n,a)=>({modifiers:t,hasImportantModifier:e,baseClassName:r,maybePostfixModifierPosition:n,isExternal:a}),Nw=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===Of){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(qs)?(p=u.slice(0,-1),f=!0):u.startsWith(qs)&&(p=u.slice(1),f=!0);const y=c&&c>l?c-l:void 0;return Pf(i,f,p,y)};if(e){const a=e+Of,i=n;n=o=>o.startsWith(a)?i(o.slice(a.length)):Pf(Iw,!1,o,void 0,!0)}if(r){const a=n;n=i=>r({className:i,parseClassName:a})}return n},Mw=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}},Dw=t=>({cache:Pw(t.cacheSize),parseClassName:Nw(t),sortModifiers:Mw(t),...xw(t)}),zw=/\s+/,Lw=(t,e)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:a,sortModifiers:i}=e,o=[],s=t.trim().split(zw);let l="";for(let c=s.length-1;c>=0;c-=1){const d=s[c],{isExternal:u,modifiers:p,hasImportantModifier:f,baseClassName:y,maybePostfixModifierPosition:m}=r(d);if(u){l=d+(l.length>0?" "+l:l);continue}let g=!!m,w=n(g?y.substring(0,m):y);if(!w){if(!g){l=d+(l.length>0?" "+l:l);continue}if(w=n(y),!w){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+qs:x,b=h+w;if(o.indexOf(b)>-1)continue;o.push(b);const S=a(w,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},jw=(...t)=>{let e=0,r,n,a="";for(;e<t.length;)(r=t[e++])&&(n=If(r))&&(a&&(a+=" "),a+=n);return a},If=t=>{if(typeof t=="string")return t;let e,r="";for(let n=0;n<t.length;n++)t[n]&&(e=If(t[n]))&&(r&&(r+=" "),r+=e);return r},Ww=(t,...e)=>{let r,n,a,i;const o=l=>{const c=e.reduce((d,u)=>u(d),t());return r=Dw(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=Lw(l,r);return a(l,d),d};return i=o,(...l)=>i(jw(...l))},Bw=[],ye=t=>{const e=r=>r[t]||Bw;return e.isThemeGetter=!0,e},Nf=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Mf=/^\((?:(\w[\w-]*):)?(.+)\)$/i,qw=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Rw=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Fw=/\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$/,$w=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Gw=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Vw=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,vt=t=>qw.test(t),ce=t=>!!t&&!Number.isNaN(Number(t)),yt=t=>!!t&&Number.isInteger(Number(t)),Rs=t=>t.endsWith("%")&&ce(t.slice(0,-1)),lt=t=>Rw.test(t),Df=()=>!0,Hw=t=>Fw.test(t)&&!$w.test(t),Fs=()=>!1,Uw=t=>Gw.test(t),Kw=t=>Vw.test(t),Yw=t=>!Q(t)&&!ee(t),Xw=t=>bt(t,qf,Fs),Q=t=>Nf.test(t),Lt=t=>bt(t,Rf,Hw),zf=t=>bt(t,aC,ce),Zw=t=>bt(t,$f,Df),Qw=t=>bt(t,Ff,Fs),Lf=t=>bt(t,Wf,Fs),Jw=t=>bt(t,Bf,Kw),un=t=>bt(t,Gf,Uw),ee=t=>Mf.test(t),yr=t=>jt(t,Rf),eC=t=>jt(t,Ff),jf=t=>jt(t,Wf),tC=t=>jt(t,qf),rC=t=>jt(t,Bf),pn=t=>jt(t,Gf,!0),nC=t=>jt(t,$f,!0),bt=(t,e,r)=>{const n=Nf.exec(t);return n?n[1]?e(n[1]):r(n[2]):!1},jt=(t,e,r=!1)=>{const n=Mf.exec(t);return n?n[1]?e(n[1]):r:!1},Wf=t=>t==="position"||t==="percentage",Bf=t=>t==="image"||t==="url",qf=t=>t==="length"||t==="size"||t==="bg-size",Rf=t=>t==="length",aC=t=>t==="number",Ff=t=>t==="family-name",$f=t=>t==="number"||t==="weight",Gf=t=>t==="shadow",iC=Ww(()=>{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"),y=ye("blur"),m=ye("perspective"),g=ye("aspect"),w=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"],C=()=>[ee,Q,l],_=()=>[vt,"full","auto",...C()],A=()=>[yt,"none","subgrid",ee,Q],I=()=>["auto",{span:["full",yt,ee,Q]},yt,ee,Q],N=()=>[yt,"auto",ee,Q],D=()=>["auto","min","max","fr",ee,Q],q=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],H=()=>["start","end","center","stretch","center-safe","end-safe"],L=()=>["auto",...C()],F=()=>[vt,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...C()],R=()=>[vt,"screen","full","dvw","lvw","svw","min","max","fit",...C()],P=()=>[vt,"screen","full","lh","dvh","lvh","svh","min","max","fit",...C()],j=()=>[t,ee,Q],Y=()=>[...b(),jf,Lf,{position:[ee,Q]}],Z=()=>["no-repeat",{repeat:["","x","y","space","round"]}],W=()=>["auto","cover","contain",tC,Xw,{size:[ee,Q]}],z=()=>[Rs,yr,Lt],B=()=>["","none","full",c,ee,Q],V=()=>["",ce,yr,Lt],K=()=>["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"],re=()=>[ce,Rs,jf,Lf],M=()=>["","none",y,ee,Q],$=()=>["none",ce,ee,Q],X=()=>["none",ce,ee,Q],oe=()=>[ce,ee,Q],le=()=>[vt,"full",...C()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[lt],breakpoint:[lt],color:[Df],container:[lt],"drop-shadow":[lt],ease:["in","out","in-out"],font:[Yw],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[lt],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[lt],shadow:[lt],spacing:["px",ce],text:[lt],"text-shadow":[lt],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",vt,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:_()}],"inset-x":[{"inset-x":_()}],"inset-y":[{"inset-y":_()}],start:[{"inset-s":_(),start:_()}],end:[{"inset-e":_(),end:_()}],"inset-bs":[{"inset-bs":_()}],"inset-be":[{"inset-be":_()}],top:[{top:_()}],right:[{right:_()}],bottom:[{bottom:_()}],left:[{left:_()}],visibility:["visible","invisible","collapse"],z:[{z:[yt,"auto",ee,Q]}],basis:[{basis:[vt,"full","auto",s,...C()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ce,vt,"auto","initial","none",Q]}],grow:[{grow:["",ce,ee,Q]}],shrink:[{shrink:["",ce,ee,Q]}],order:[{order:[yt,"first","last","none",ee,Q]}],"grid-cols":[{"grid-cols":A()}],"col-start-end":[{col:I()}],"col-start":[{"col-start":N()}],"col-end":[{"col-end":N()}],"grid-rows":[{"grid-rows":A()}],"row-start-end":[{row:I()}],"row-start":[{"row-start":N()}],"row-end":[{"row-end":N()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":D()}],"auto-rows":[{"auto-rows":D()}],gap:[{gap:C()}],"gap-x":[{"gap-x":C()}],"gap-y":[{"gap-y":C()}],"justify-content":[{justify:[...q(),"normal"]}],"justify-items":[{"justify-items":[...H(),"normal"]}],"justify-self":[{"justify-self":["auto",...H()]}],"align-content":[{content:["normal",...q()]}],"align-items":[{items:[...H(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...H(),{baseline:["","last"]}]}],"place-content":[{"place-content":q()}],"place-items":[{"place-items":[...H(),"baseline"]}],"place-self":[{"place-self":["auto",...H()]}],p:[{p:C()}],px:[{px:C()}],py:[{py:C()}],ps:[{ps:C()}],pe:[{pe:C()}],pbs:[{pbs:C()}],pbe:[{pbe:C()}],pt:[{pt:C()}],pr:[{pr:C()}],pb:[{pb:C()}],pl:[{pl:C()}],m:[{m:L()}],mx:[{mx:L()}],my:[{my:L()}],ms:[{ms:L()}],me:[{me:L()}],mbs:[{mbs:L()}],mbe:[{mbe:L()}],mt:[{mt:L()}],mr:[{mr:L()}],mb:[{mb:L()}],ml:[{ml:L()}],"space-x":[{"space-x":C()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":C()}],"space-y-reverse":["space-y-reverse"],size:[{size:F()}],"inline-size":[{inline:["auto",...R()]}],"min-inline-size":[{"min-inline":["auto",...R()]}],"max-inline-size":[{"max-inline":["none",...R()]}],"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,yr,Lt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,nC,Zw]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Rs,Q]}],"font-family":[{font:[eC,Qw,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,zf]}],leading:[{leading:[i,...C()]}],"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:[...K(),"wavy"]}],"text-decoration-thickness":[{decoration:[ce,"from-font","auto",ee,Lt]}],"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:C()}],"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:Z()}],"bg-size":[{bg:W()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},yt,ee,Q],radial:["",ee,Q],conic:[yt,ee,Q]},rC,Jw]}],"bg-color":[{bg:j()}],"gradient-from-pos":[{from:z()}],"gradient-via-pos":[{via:z()}],"gradient-to-pos":[{to:z()}],"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:[...K(),"hidden","none"]}],"divide-style":[{divide:[...K(),"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:[...K(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ce,ee,Q]}],"outline-w":[{outline:["",ce,yr,Lt]}],"outline-color":[{outline:j()}],shadow:[{shadow:["","none",d,pn,un]}],"shadow-color":[{shadow:j()}],"inset-shadow":[{"inset-shadow":["none",u,pn,un]}],"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,Lt]}],"ring-offset-color":[{"ring-offset":j()}],"inset-ring-w":[{"inset-ring":V()}],"inset-ring-color":[{"inset-ring":j()}],"text-shadow":[{"text-shadow":["none",p,pn,un]}],"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":re()}],"mask-image-linear-to-pos":[{"mask-linear-to":re()}],"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":re()}],"mask-image-t-to-pos":[{"mask-t-to":re()}],"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":re()}],"mask-image-r-to-pos":[{"mask-r-to":re()}],"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":re()}],"mask-image-b-to-pos":[{"mask-b-to":re()}],"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":re()}],"mask-image-l-to-pos":[{"mask-l-to":re()}],"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":re()}],"mask-image-x-to-pos":[{"mask-x-to":re()}],"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":re()}],"mask-image-y-to-pos":[{"mask-y-to":re()}],"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":re()}],"mask-image-radial-to-pos":[{"mask-radial-to":re()}],"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":re()}],"mask-image-conic-to-pos":[{"mask-conic-to":re()}],"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:Z()}],"mask-size":[{mask:W()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ee,Q]}],filter:[{filter:["","none",ee,Q]}],blur:[{blur:M()}],brightness:[{brightness:[ce,ee,Q]}],contrast:[{contrast:[ce,ee,Q]}],"drop-shadow":[{"drop-shadow":["","none",f,pn,un]}],"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":M()}],"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":C()}],"border-spacing-x":[{"border-spacing-x":C()}],"border-spacing-y":[{"border-spacing-y":C()}],"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",w,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:X()}],"scale-x":[{"scale-x":X()}],"scale-y":[{"scale-y":X()}],"scale-z":[{"scale-z":X()}],"scale-3d":["scale-3d"],skew:[{skew:oe()}],"skew-x":[{"skew-x":oe()}],"skew-y":[{"skew-y":oe()}],transform:[{transform:[ee,Q,"","none","gpu","cpu"]}],"transform-origin":[{origin:S()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:le()}],"translate-x":[{"translate-x":le()}],"translate-y":[{"translate-y":le()}],"translate-z":[{"translate-z":le()}],"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":C()}],"scroll-mx":[{"scroll-mx":C()}],"scroll-my":[{"scroll-my":C()}],"scroll-ms":[{"scroll-ms":C()}],"scroll-me":[{"scroll-me":C()}],"scroll-mbs":[{"scroll-mbs":C()}],"scroll-mbe":[{"scroll-mbe":C()}],"scroll-mt":[{"scroll-mt":C()}],"scroll-mr":[{"scroll-mr":C()}],"scroll-mb":[{"scroll-mb":C()}],"scroll-ml":[{"scroll-ml":C()}],"scroll-p":[{"scroll-p":C()}],"scroll-px":[{"scroll-px":C()}],"scroll-py":[{"scroll-py":C()}],"scroll-ps":[{"scroll-ps":C()}],"scroll-pe":[{"scroll-pe":C()}],"scroll-pbs":[{"scroll-pbs":C()}],"scroll-pbe":[{"scroll-pbe":C()}],"scroll-pt":[{"scroll-pt":C()}],"scroll-pr":[{"scroll-pr":C()}],"scroll-pb":[{"scroll-pb":C()}],"scroll-pl":[{"scroll-pl":C()}],"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,yr,Lt,zf]}],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 iC(xf(t))}const oC=kf("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"}}),ke=T.forwardRef(({className:t,variant:e,size:r,...n},a)=>v.jsx("button",{className:pe(oC({variant:e,size:r,className:t})),ref:a,...n}));ke.displayName="Button";function ie(t,e,{checkForDefaultPrevented:r=!0}={}){return function(a){if(t?.(a),r===!1||!a.defaultPrevented)return e?.(a)}}function Vf(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function br(...t){return e=>{let r=!1;const n=t.map(a=>{const i=Vf(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():Vf(t[a],null)}}}}function me(...t){return T.useCallback(br(...t),t)}function sC(t,e){const r=T.createContext(e),n=i=>{const{children:o,...s}=i,l=T.useMemo(()=>s,Object.values(s));return v.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 ct(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,...y}=u,m=p?.[t]?.[l]||s,g=T.useMemo(()=>y,Object.values(y));return v.jsx(m.Provider,{value:g,children:f})};c.displayName=i+"Provider";function d(u,p){const f=p?.[t]?.[l]||s,y=T.useContext(f);if(y)return y;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,lC(a,...e)]}function lC(...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 St=globalThis?.document?T.useLayoutEffect:()=>{},cC=T[" useInsertionEffect ".trim().toString()]||St;function Sr({prop:t,defaultProp:e,onChange:r=()=>{},caller:n}){const[a,i,o]=dC({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=uC(d)?d(t):d;u!==t&&o.current?.(u)}else i(d)},[s,t,i,o]);return[l,c]}function dC({defaultProp:t,onChange:e}){const[r,n]=T.useState(t),a=T.useRef(r),i=T.useRef(e);return cC(()=>{i.current=e},[e]),T.useEffect(()=>{a.current!==r&&(i.current?.(r),a.current=r)},[r,a]),[r,n,i]}function uC(t){return typeof t=="function"}function xr(t){const e=pC(t),r=T.forwardRef((n,a)=>{const{children:i,...o}=n,s=T.Children.toArray(i),l=s.find(mC);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 v.jsx(e,{...o,ref:a,children:T.isValidElement(c)?T.cloneElement(c,void 0,d):null})}return v.jsx(e,{...o,ref:a,children:i})});return r.displayName=`${t}.Slot`,r}function pC(t){const e=T.forwardRef((r,n)=>{const{children:a,...i}=r;if(T.isValidElement(a)){const o=gC(a),s=hC(i,a.props);return a.type!==T.Fragment&&(s.ref=n?br(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 Hf=Symbol("radix.slottable");function fC(t){const e=({children:r})=>v.jsx(v.Fragment,{children:r});return e.displayName=`${t}.Slottable`,e.__radixId=Hf,e}function mC(t){return T.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===Hf}function hC(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 gC(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 vC=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],he=vC.reduce((t,e)=>{const r=xr(`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),v.jsx(l,{...s,ref:i})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function Uf(t,e){t&&yc.flushSync(()=>t.dispatchEvent(e))}function $s(t){const e=t+"CollectionProvider",[r,n]=ct(e),[a,i]=r(e,{collectionRef:{current:null},itemMap:new Map}),o=m=>{const{scope:g,children:w}=m,x=O.useRef(null),h=O.useRef(new Map).current;return v.jsx(a,{scope:g,itemMap:h,collectionRef:x,children:w})};o.displayName=e;const s=t+"CollectionSlot",l=xr(s),c=O.forwardRef((m,g)=>{const{scope:w,children:x}=m,h=i(s,w),b=me(g,h.collectionRef);return v.jsx(l,{ref:b,children:x})});c.displayName=s;const d=t+"CollectionItemSlot",u="data-radix-collection-item",p=xr(d),f=O.forwardRef((m,g)=>{const{scope:w,children:x,...h}=m,b=O.useRef(null),S=me(g,b),E=i(d,w);return O.useEffect(()=>(E.itemMap.set(b,{ref:b,...h}),()=>{E.itemMap.delete(b)})),v.jsx(p,{[u]:"",ref:S,children:x})});f.displayName=d;function y(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},y,n]}var yC=T.createContext(void 0);function Gs(t){const e=T.useContext(yC);return t||e||"ltr"}function dt(t){const e=T.useRef(t);return T.useEffect(()=>{e.current=t}),T.useMemo(()=>(...r)=>e.current?.(...r),[])}function bC(t,e=globalThis?.document){const r=dt(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 SC="DismissableLayer",Vs="dismissableLayer.update",xC="dismissableLayer.pointerDownOutside",wC="dismissableLayer.focusOutside",Kf,Yf=T.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Hs=T.forwardRef((t,e)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:o,onDismiss:s,...l}=t,c=T.useContext(Yf),[d,u]=T.useState(null),p=d?.ownerDocument??globalThis?.document,[,f]=T.useState({}),y=me(e,k=>u(k)),m=Array.from(c.layers),[g]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),w=m.indexOf(g),x=d?m.indexOf(d):-1,h=c.layersWithOutsidePointerEventsDisabled.size>0,b=x>=w,S=EC(k=>{const C=k.target,_=[...c.branches].some(A=>A.contains(C));!b||_||(a?.(k),o?.(k),k.defaultPrevented||s?.())},p),E=TC(k=>{const C=k.target;[...c.branches].some(A=>A.contains(C))||(i?.(k),o?.(k),k.defaultPrevented||s?.())},p);return bC(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&&(Kf=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(d)),c.layers.add(d),Xf(),()=>{r&&c.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=Kf)}},[d,p,r,c]),T.useEffect(()=>()=>{d&&(c.layers.delete(d),c.layersWithOutsidePointerEventsDisabled.delete(d),Xf())},[d,c]),T.useEffect(()=>{const k=()=>f({});return document.addEventListener(Vs,k),()=>document.removeEventListener(Vs,k)},[]),v.jsx(he.div,{...l,ref:y,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)})});Hs.displayName=SC;var CC="DismissableLayerBranch",kC=T.forwardRef((t,e)=>{const r=T.useContext(Yf),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]),v.jsx(he.div,{...t,ref:a})});kC.displayName=CC;function EC(t,e=globalThis?.document){const r=dt(t),n=T.useRef(!1),a=T.useRef(()=>{});return T.useEffect(()=>{const i=s=>{if(s.target&&!n.current){let l=function(){Zf(xC,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 TC(t,e=globalThis?.document){const r=dt(t),n=T.useRef(!1);return T.useEffect(()=>{const a=i=>{i.target&&!n.current&&Zf(wC,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 Xf(){const t=new CustomEvent(Vs);document.dispatchEvent(t)}function Zf(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?Uf(a,i):a.dispatchEvent(i)}var Us=0;function Qf(){T.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??Jf()),document.body.insertAdjacentElement("beforeend",t[1]??Jf()),Us++,()=>{Us===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Us--}},[])}function Jf(){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 Ks="focusScope.autoFocusOnMount",Ys="focusScope.autoFocusOnUnmount",em={bubbles:!1,cancelable:!0},AC="FocusScope",Xs=T.forwardRef((t,e)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...o}=t,[s,l]=T.useState(null),c=dt(a),d=dt(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:xt(u.current,{select:!0})},g=function(h){if(f.paused||!s)return;const b=h.relatedTarget;b!==null&&(s.contains(b)||xt(u.current,{select:!0}))},w=function(h){if(document.activeElement===document.body)for(const S of h)S.removedNodes.length>0&&xt(s)};document.addEventListener("focusin",m),document.addEventListener("focusout",g);const x=new MutationObserver(w);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){nm.add(f);const m=document.activeElement;if(!s.contains(m)){const w=new CustomEvent(Ks,em);s.addEventListener(Ks,c),s.dispatchEvent(w),w.defaultPrevented||(_C(MC(tm(s)),{select:!0}),document.activeElement===m&&xt(s))}return()=>{s.removeEventListener(Ks,c),setTimeout(()=>{const w=new CustomEvent(Ys,em);s.addEventListener(Ys,d),s.dispatchEvent(w),w.defaultPrevented||xt(m??document.body,{select:!0}),s.removeEventListener(Ys,d),nm.remove(f)},0)}}},[s,c,d,f]);const y=T.useCallback(m=>{if(!r&&!n||f.paused)return;const g=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,w=document.activeElement;if(g&&w){const x=m.currentTarget,[h,b]=OC(x);h&&b?!m.shiftKey&&w===b?(m.preventDefault(),r&&xt(h,{select:!0})):m.shiftKey&&w===h&&(m.preventDefault(),r&&xt(b,{select:!0})):w===x&&m.preventDefault()}},[r,n,f.paused]);return v.jsx(he.div,{tabIndex:-1,...o,ref:p,onKeyDown:y})});Xs.displayName=AC;function _C(t,{select:e=!1}={}){const r=document.activeElement;for(const n of t)if(xt(n,{select:e}),document.activeElement!==r)return}function OC(t){const e=tm(t),r=rm(e,t),n=rm(e.reverse(),t);return[r,n]}function tm(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 rm(t,e){for(const r of t)if(!PC(r,{upTo:e}))return r}function PC(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 IC(t){return t instanceof HTMLInputElement&&"select"in t}function xt(t,{select:e=!1}={}){if(t&&t.focus){const r=document.activeElement;t.focus({preventScroll:!0}),t!==r&&IC(t)&&e&&t.select()}}var nm=NC();function NC(){let t=[];return{add(e){const r=t[0];e!==r&&r?.pause(),t=am(t,e),t.unshift(e)},remove(e){t=am(t,e),t[0]?.resume()}}}function am(t,e){const r=[...t],n=r.indexOf(e);return n!==-1&&r.splice(n,1),r}function MC(t){return t.filter(e=>e.tagName!=="A")}var DC=T[" useId ".trim().toString()]||(()=>{}),zC=0;function Yt(t){const[e,r]=T.useState(DC());return St(()=>{r(n=>n??String(zC++))},[t]),e?`radix-${e}`:""}const LC=["top","right","bottom","left"],wt=Math.min,je=Math.max,fn=Math.round,mn=Math.floor,Ze=t=>({x:t,y:t}),jC={left:"right",right:"left",bottom:"top",top:"bottom"},WC={start:"end",end:"start"};function Zs(t,e,r){return je(t,wt(e,r))}function ut(t,e){return typeof t=="function"?t(e):t}function pt(t){return t.split("-")[0]}function Xt(t){return t.split("-")[1]}function Qs(t){return t==="x"?"y":"x"}function Js(t){return t==="y"?"height":"width"}const BC=new Set(["top","bottom"]);function Qe(t){return BC.has(pt(t))?"y":"x"}function el(t){return Qs(Qe(t))}function qC(t,e,r){r===void 0&&(r=!1);const n=Xt(t),a=el(t),i=Js(a);let o=a==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(o=hn(o)),[o,hn(o)]}function RC(t){const e=hn(t);return[tl(t),e,tl(e)]}function tl(t){return t.replace(/start|end/g,e=>WC[e])}const im=["left","right"],om=["right","left"],FC=["top","bottom"],$C=["bottom","top"];function GC(t,e,r){switch(t){case"top":case"bottom":return r?e?om:im:e?im:om;case"left":case"right":return e?FC:$C;default:return[]}}function VC(t,e,r,n){const a=Xt(t);let i=GC(pt(t),r==="start",n);return a&&(i=i.map(o=>o+"-"+a),e&&(i=i.concat(i.map(tl)))),i}function hn(t){return t.replace(/left|right|bottom|top/g,e=>jC[e])}function HC(t){return{top:0,right:0,bottom:0,left:0,...t}}function sm(t){return typeof t!="number"?HC(t):{top:t,right:t,bottom:t,left:t}}function gn(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 lm(t,e,r){let{reference:n,floating:a}=t;const i=Qe(e),o=el(e),s=Js(o),l=pt(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 UC(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}=ut(e,t),y=sm(f),g=s[p?u==="floating"?"reference":"floating":u],w=gn(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=gn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:x,offsetParent:h,strategy:l}):x);return{top:(w.top-S.top+y.top)/b.y,bottom:(S.bottom-w.bottom+y.bottom)/b.y,left:(w.left-S.left+y.left)/b.x,right:(S.right-w.right+y.right)/b.x}}const KC=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}=lm(c,n,l),p=n,f={},y=0;for(let g=0;g<s.length;g++){var m;const{name:w,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:UC},elements:{reference:t,floating:e}});d=h??d,u=b??u,f={...f,[w]:{...f[w],...S}},E&&y<=50&&(y++,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}=lm(c,p,l)),g=-1)}return{x:d,y:u,placement:p,strategy:a,middlewareData:f}},YC=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}=ut(t,e)||{};if(c==null)return{};const u=sm(d),p={x:r,y:n},f=el(a),y=Js(f),m=await o.getDimensions(c),g=f==="y",w=g?"top":"left",x=g?"bottom":"right",h=g?"clientHeight":"clientWidth",b=i.reference[y]+i.reference[f]-p[f]-i.floating[y],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[y]);const C=b/2-S/2,_=k/2-m[y]/2-1,A=wt(u[w],_),I=wt(u[x],_),N=A,D=k-m[y]-I,q=k/2-m[y]/2+C,H=Zs(N,q,D),L=!l.arrow&&Xt(a)!=null&&q!==H&&i.reference[y]/2-(q<N?A:I)-m[y]/2<0,F=L?q<N?q-N:q-D:0;return{[f]:p[f]+F,data:{[f]:H,centerOffset:q-H-F,...L&&{alignmentOffset:F}},reset:L}}}),XC=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:y="none",flipAlignment:m=!0,...g}=ut(t,e);if((r=i.arrow)!=null&&r.alignmentOffset)return{};const w=pt(a),x=Qe(s),h=pt(s)===s,b=await(l.isRTL==null?void 0:l.isRTL(c.floating)),S=p||(h||!m?[hn(s)]:RC(s)),E=y!=="none";!p&&E&&S.push(...VC(s,m,y,b));const k=[s,...S],C=await l.detectOverflow(e,g),_=[];let A=((n=i.flip)==null?void 0:n.overflows)||[];if(d&&_.push(C[w]),u){const q=qC(a,o,b);_.push(C[q[0]],C[q[1]])}if(A=[...A,{placement:a,overflows:_}],!_.every(q=>q<=0)){var I,N;const q=(((I=i.flip)==null?void 0:I.index)||0)+1,H=k[q];if(H&&(!(u==="alignment"?x!==Qe(H):!1)||A.every(R=>Qe(R.placement)===x?R.overflows[0]>0:!0)))return{data:{index:q,overflows:A},reset:{placement:H}};let L=(N=A.filter(F=>F.overflows[0]<=0).sort((F,R)=>F.overflows[1]-R.overflows[1])[0])==null?void 0:N.placement;if(!L)switch(f){case"bestFit":{var D;const F=(D=A.filter(R=>{if(E){const P=Qe(R.placement);return P===x||P==="y"}return!0}).map(R=>[R.placement,R.overflows.filter(P=>P>0).reduce((P,j)=>P+j,0)]).sort((R,P)=>R[1]-P[1])[0])==null?void 0:D[0];F&&(L=F);break}case"initialPlacement":L=s;break}if(a!==L)return{reset:{placement:L}}}return{}}}};function cm(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function dm(t){return LC.some(e=>t[e]>=0)}const ZC=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:r,platform:n}=e,{strategy:a="referenceHidden",...i}=ut(t,e);switch(a){case"referenceHidden":{const o=await n.detectOverflow(e,{...i,elementContext:"reference"}),s=cm(o,r.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:dm(s)}}}case"escaped":{const o=await n.detectOverflow(e,{...i,altBoundary:!0}),s=cm(o,r.floating);return{data:{escapedOffsets:s,escaped:dm(s)}}}default:return{}}}}},um=new Set(["left","top"]);async function QC(t,e){const{placement:r,platform:n,elements:a}=t,i=await(n.isRTL==null?void 0:n.isRTL(a.floating)),o=pt(r),s=Xt(r),l=Qe(r)==="y",c=um.has(o)?-1:1,d=i&&l?-1:1,u=ut(e,t);let{mainAxis:p,crossAxis:f,alignmentAxis:y}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return s&&typeof y=="number"&&(f=s==="end"?y*-1:y),l?{x:f*d,y:p*c}:{x:p*c,y:f*d}}const JC=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 QC(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}}}}},e0=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:w=>{let{x,y:h}=w;return{x,y:h}}},...c}=ut(t,e),d={x:r,y:n},u=await i.detectOverflow(e,c),p=Qe(pt(a)),f=Qs(p);let y=d[f],m=d[p];if(o){const w=f==="y"?"top":"left",x=f==="y"?"bottom":"right",h=y+u[w],b=y-u[x];y=Zs(h,y,b)}if(s){const w=p==="y"?"top":"left",x=p==="y"?"bottom":"right",h=m+u[w],b=m-u[x];m=Zs(h,m,b)}const g=l.fn({...e,[f]:y,[p]:m});return{...g,data:{x:g.x-r,y:g.y-n,enabled:{[f]:o,[p]:s}}}}}},t0=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}=ut(t,e),d={x:r,y:n},u=Qe(a),p=Qs(u);let f=d[p],y=d[u];const m=ut(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 w,x;const h=p==="y"?"width":"height",b=um.has(pt(a)),S=i.reference[u]-i.floating[h]+(b&&((w=o.offset)==null?void 0:w[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);y<S?y=S:y>E&&(y=E)}return{[p]:f,[u]:y}}}},r0=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}=ut(t,e),d=await o.detectOverflow(e,c),u=pt(a),p=Xt(a),f=Qe(a)==="y",{width:y,height:m}=i.floating;let g,w;u==="top"||u==="bottom"?(g=u,w=p===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?"start":"end")?"left":"right"):(w=u,g=p==="end"?"top":"bottom");const x=m-d.top-d.bottom,h=y-d.left-d.right,b=wt(m-d[g],x),S=wt(y-d[w],h),E=!e.middlewareData.shift;let k=b,C=S;if((r=e.middlewareData.shift)!=null&&r.enabled.x&&(C=h),(n=e.middlewareData.shift)!=null&&n.enabled.y&&(k=x),E&&!p){const A=je(d.left,0),I=je(d.right,0),N=je(d.top,0),D=je(d.bottom,0);f?C=y-2*(A!==0||I!==0?A+I:je(d.left,d.right)):k=m-2*(N!==0||D!==0?N+D:je(d.top,d.bottom))}await l({...e,availableWidth:C,availableHeight:k});const _=await o.getDimensions(s.floating);return y!==_.width||m!==_.height?{reset:{rects:!0}}:{}}}};function vn(){return typeof window<"u"}function Zt(t){return pm(t)?(t.nodeName||"").toLowerCase():"#document"}function We(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Je(t){var e;return(e=(pm(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function pm(t){return vn()?t instanceof Node||t instanceof We(t).Node:!1}function Ge(t){return vn()?t instanceof Element||t instanceof We(t).Element:!1}function et(t){return vn()?t instanceof HTMLElement||t instanceof We(t).HTMLElement:!1}function fm(t){return!vn()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof We(t).ShadowRoot}const n0=new Set(["inline","contents"]);function wr(t){const{overflow:e,overflowX:r,overflowY:n,display:a}=Ve(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+r)&&!n0.has(a)}const a0=new Set(["table","td","th"]);function i0(t){return a0.has(Zt(t))}const o0=[":popover-open",":modal"];function yn(t){return o0.some(e=>{try{return t.matches(e)}catch{return!1}})}const s0=["transform","translate","scale","rotate","perspective"],l0=["transform","translate","scale","rotate","perspective","filter"],c0=["paint","layout","strict","content"];function rl(t){const e=nl(),r=Ge(t)?Ve(t):t;return s0.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)||l0.some(n=>(r.willChange||"").includes(n))||c0.some(n=>(r.contain||"").includes(n))}function d0(t){let e=Ct(t);for(;et(e)&&!Qt(e);){if(rl(e))return e;if(yn(e))return null;e=Ct(e)}return null}function nl(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const u0=new Set(["html","body","#document"]);function Qt(t){return u0.has(Zt(t))}function Ve(t){return We(t).getComputedStyle(t)}function bn(t){return Ge(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Ct(t){if(Zt(t)==="html")return t;const e=t.assignedSlot||t.parentNode||fm(t)&&t.host||Je(t);return fm(e)?e.host:e}function mm(t){const e=Ct(t);return Qt(e)?t.ownerDocument?t.ownerDocument.body:t.body:et(e)&&wr(e)?e:mm(e)}function Cr(t,e,r){var n;e===void 0&&(e=[]),r===void 0&&(r=!0);const a=mm(t),i=a===((n=t.ownerDocument)==null?void 0:n.body),o=We(a);if(i){const s=al(o);return e.concat(o,o.visualViewport||[],wr(a)?a:[],s&&r?Cr(s):[])}return e.concat(a,Cr(a,[],r))}function al(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function hm(t){const e=Ve(t);let r=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const a=et(t),i=a?t.offsetWidth:r,o=a?t.offsetHeight:n,s=fn(r)!==i||fn(n)!==o;return s&&(r=i,n=o),{width:r,height:n,$:s}}function il(t){return Ge(t)?t:t.contextElement}function Jt(t){const e=il(t);if(!et(e))return Ze(1);const r=e.getBoundingClientRect(),{width:n,height:a,$:i}=hm(e);let o=(i?fn(r.width):r.width)/n,s=(i?fn(r.height):r.height)/a;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}const p0=Ze(0);function gm(t){const e=We(t);return!nl()||!e.visualViewport?p0:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function f0(t,e,r){return e===void 0&&(e=!1),!r||e&&r!==We(t)?!1:e}function Wt(t,e,r,n){e===void 0&&(e=!1),r===void 0&&(r=!1);const a=t.getBoundingClientRect(),i=il(t);let o=Ze(1);e&&(n?Ge(n)&&(o=Jt(n)):o=Jt(t));const s=f0(i,r,n)?gm(i):Ze(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=We(i),f=n&&Ge(n)?We(n):n;let y=p,m=al(y);for(;m&&n&&f!==y;){const g=Jt(m),w=m.getBoundingClientRect(),x=Ve(m),h=w.left+(m.clientLeft+parseFloat(x.paddingLeft))*g.x,b=w.top+(m.clientTop+parseFloat(x.paddingTop))*g.y;l*=g.x,c*=g.y,d*=g.x,u*=g.y,l+=h,c+=b,y=We(m),m=al(y)}}return gn({width:d,height:u,x:l,y:c})}function Sn(t,e){const r=bn(t).scrollLeft;return e?e.left+r:Wt(Je(t)).left+r}function vm(t,e){const r=t.getBoundingClientRect(),n=r.left+e.scrollLeft-Sn(t,r),a=r.top+e.scrollTop;return{x:n,y:a}}function m0(t){let{elements:e,rect:r,offsetParent:n,strategy:a}=t;const i=a==="fixed",o=Je(n),s=e?yn(e.floating):!1;if(n===o||s&&i)return r;let l={scrollLeft:0,scrollTop:0},c=Ze(1);const d=Ze(0),u=et(n);if((u||!u&&!i)&&((Zt(n)!=="body"||wr(o))&&(l=bn(n)),et(n))){const f=Wt(n);c=Jt(n),d.x=f.x+n.clientLeft,d.y=f.y+n.clientTop}const p=o&&!u&&!i?vm(o,l):Ze(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 h0(t){return Array.from(t.getClientRects())}function g0(t){const e=Je(t),r=bn(t),n=t.ownerDocument.body,a=je(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=je(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let o=-r.scrollLeft+Sn(t);const s=-r.scrollTop;return Ve(n).direction==="rtl"&&(o+=je(e.clientWidth,n.clientWidth)-a),{width:a,height:i,x:o,y:s}}const ym=25;function v0(t,e){const r=We(t),n=Je(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=nl();(!d||d&&e==="fixed")&&(s=a.offsetLeft,l=a.offsetTop)}const c=Sn(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,y=Math.abs(n.clientWidth-u.clientWidth-f);y<=ym&&(i-=y)}else c<=ym&&(i+=c);return{width:i,height:o,x:s,y:l}}const y0=new Set(["absolute","fixed"]);function b0(t,e){const r=Wt(t,!0,e==="fixed"),n=r.top+t.clientTop,a=r.left+t.clientLeft,i=et(t)?Jt(t):Ze(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 bm(t,e,r){let n;if(e==="viewport")n=v0(t,r);else if(e==="document")n=g0(Je(t));else if(Ge(e))n=b0(e,r);else{const a=gm(t);n={x:e.x-a.x,y:e.y-a.y,width:e.width,height:e.height}}return gn(n)}function Sm(t,e){const r=Ct(t);return r===e||!Ge(r)||Qt(r)?!1:Ve(r).position==="fixed"||Sm(r,e)}function S0(t,e){const r=e.get(t);if(r)return r;let n=Cr(t,[],!1).filter(s=>Ge(s)&&Zt(s)!=="body"),a=null;const i=Ve(t).position==="fixed";let o=i?Ct(t):t;for(;Ge(o)&&!Qt(o);){const s=Ve(o),l=rl(o);!l&&s.position==="fixed"&&(a=null),(i?!l&&!a:!l&&s.position==="static"&&!!a&&y0.has(a.position)||wr(o)&&!l&&Sm(t,o))?n=n.filter(d=>d!==o):a=s,o=Ct(o)}return e.set(t,n),n}function x0(t){let{element:e,boundary:r,rootBoundary:n,strategy:a}=t;const o=[...r==="clippingAncestors"?yn(e)?[]:S0(e,this._c):[].concat(r),n],s=o[0],l=o.reduce((c,d)=>{const u=bm(e,d,a);return c.top=je(u.top,c.top),c.right=wt(u.right,c.right),c.bottom=wt(u.bottom,c.bottom),c.left=je(u.left,c.left),c},bm(e,s,a));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function w0(t){const{width:e,height:r}=hm(t);return{width:e,height:r}}function C0(t,e,r){const n=et(e),a=Je(e),i=r==="fixed",o=Wt(t,!0,i,e);let s={scrollLeft:0,scrollTop:0};const l=Ze(0);function c(){l.x=Sn(a)}if(n||!n&&!i)if((Zt(e)!=="body"||wr(a))&&(s=bn(e)),n){const f=Wt(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?vm(a,s):Ze(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 ol(t){return Ve(t).position==="static"}function xm(t,e){if(!et(t)||Ve(t).position==="fixed")return null;if(e)return e(t);let r=t.offsetParent;return Je(t)===r&&(r=r.ownerDocument.body),r}function wm(t,e){const r=We(t);if(yn(t))return r;if(!et(t)){let a=Ct(t);for(;a&&!Qt(a);){if(Ge(a)&&!ol(a))return a;a=Ct(a)}return r}let n=xm(t,e);for(;n&&i0(n)&&ol(n);)n=xm(n,e);return n&&Qt(n)&&ol(n)&&!rl(n)?r:n||d0(t)||r}const k0=async function(t){const e=this.getOffsetParent||wm,r=this.getDimensions,n=await r(t.floating);return{reference:C0(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function E0(t){return Ve(t).direction==="rtl"}const T0={convertOffsetParentRelativeRectToViewportRelativeRect:m0,getDocumentElement:Je,getClippingRect:x0,getOffsetParent:wm,getElementRects:k0,getClientRects:h0,getDimensions:w0,getScale:Jt,isElement:Ge,isRTL:E0};function Cm(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function A0(t,e){let r=null,n;const a=Je(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 y=mn(u),m=mn(a.clientWidth-(d+p)),g=mn(a.clientHeight-(u+f)),w=mn(d),h={rootMargin:-y+"px "+-m+"px "+-g+"px "+-w+"px",threshold:je(0,wt(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&&!Cm(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 _0(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=il(t),d=a||i?[...c?Cr(c):[],...Cr(e)]:[];d.forEach(w=>{a&&w.addEventListener("scroll",r,{passive:!0}),i&&w.addEventListener("resize",r)});const u=c&&s?A0(c,r):null;let p=-1,f=null;o&&(f=new ResizeObserver(w=>{let[x]=w;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 y,m=l?Wt(t):null;l&&g();function g(){const w=Wt(t);m&&!Cm(m,w)&&r(),m=w,y=requestAnimationFrame(g)}return r(),()=>{var w;d.forEach(x=>{a&&x.removeEventListener("scroll",r),i&&x.removeEventListener("resize",r)}),u?.(),(w=f)==null||w.disconnect(),f=null,l&&cancelAnimationFrame(y)}}const O0=JC,P0=e0,I0=XC,N0=r0,M0=ZC,km=YC,D0=t0,z0=(t,e,r)=>{const n=new Map,a={platform:T0,...r},i={...a.platform,_c:n};return KC(t,e,{...a,platform:i})};var L0=typeof document<"u",j0=function(){},xn=L0?O.useLayoutEffect:j0;function wn(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(!wn(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)&&!wn(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function Em(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Tm(t,e){const r=Em(t);return Math.round(e*r)/r}function sl(t){const e=T.useRef(t);return xn(()=>{e.current=t}),e}function W0(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);wn(p,n)||f(n);const[y,m]=T.useState(null),[g,w]=T.useState(null),x=T.useCallback(R=>{R!==E.current&&(E.current=R,m(R))},[]),h=T.useCallback(R=>{R!==k.current&&(k.current=R,w(R))},[]),b=i||y,S=o||g,E=T.useRef(null),k=T.useRef(null),C=T.useRef(d),_=l!=null,A=sl(l),I=sl(a),N=sl(c),D=T.useCallback(()=>{if(!E.current||!k.current)return;const R={placement:e,strategy:r,middleware:p};I.current&&(R.platform=I.current),z0(E.current,k.current,R).then(P=>{const j={...P,isPositioned:N.current!==!1};q.current&&!wn(C.current,j)&&(C.current=j,yc.flushSync(()=>{u(j)}))})},[p,e,r,I,N]);xn(()=>{c===!1&&C.current.isPositioned&&(C.current.isPositioned=!1,u(R=>({...R,isPositioned:!1})))},[c]);const q=T.useRef(!1);xn(()=>(q.current=!0,()=>{q.current=!1}),[]),xn(()=>{if(b&&(E.current=b),S&&(k.current=S),b&&S){if(A.current)return A.current(b,S,D);D()}},[b,S,D,A,_]);const H=T.useMemo(()=>({reference:E,floating:k,setReference:x,setFloating:h}),[x,h]),L=T.useMemo(()=>({reference:b,floating:S}),[b,S]),F=T.useMemo(()=>{const R={position:r,left:0,top:0};if(!L.floating)return R;const P=Tm(L.floating,d.x),j=Tm(L.floating,d.y);return s?{...R,transform:"translate("+P+"px, "+j+"px)",...Em(L.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:P,top:j}},[r,s,L.floating,d.x,d.y]);return T.useMemo(()=>({...d,update:D,refs:H,elements:L,floatingStyles:F}),[d,D,H,L,F])}const B0=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?km({element:n.current,padding:a}).fn(r):{}:n?km({element:n,padding:a}).fn(r):{}}}},q0=(t,e)=>({...O0(t),options:[t,e]}),R0=(t,e)=>({...P0(t),options:[t,e]}),F0=(t,e)=>({...D0(t),options:[t,e]}),$0=(t,e)=>({...I0(t),options:[t,e]}),G0=(t,e)=>({...N0(t),options:[t,e]}),V0=(t,e)=>({...M0(t),options:[t,e]}),H0=(t,e)=>({...B0(t),options:[t,e]});var U0="Arrow",Am=T.forwardRef((t,e)=>{const{children:r,width:n=10,height:a=5,...i}=t;return v.jsx(he.svg,{...i,ref:e,width:n,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?r:v.jsx("polygon",{points:"0,0 30,0 15,10"})})});Am.displayName=U0;var K0=Am;function ll(t){const[e,r]=T.useState(void 0);return St(()=>{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 cl="Popper",[_m,Om]=ct(cl),[Y0,Pm]=_m(cl),Im=t=>{const{__scopePopper:e,children:r}=t,[n,a]=T.useState(null);return v.jsx(Y0,{scope:e,anchor:n,onAnchorChange:a,children:r})};Im.displayName=cl;var Nm="PopperAnchor",Mm=T.forwardRef((t,e)=>{const{__scopePopper:r,virtualRef:n,...a}=t,i=Pm(Nm,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:v.jsx(he.div,{...a,ref:s})});Mm.displayName=Nm;var dl="PopperContent",[X0,Z0]=_m(dl),Dm=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:y,...m}=t,g=Pm(dl,r),[w,x]=T.useState(null),h=me(e,K=>x(K)),[b,S]=T.useState(null),E=ll(b),k=E?.width??0,C=E?.height??0,_=n+(i!=="center"?"-"+i:""),A=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},I=Array.isArray(c)?c:[c],N=I.length>0,D={padding:A,boundary:I.filter(J0),altBoundary:N},{refs:q,floatingStyles:H,placement:L,isPositioned:F,middlewareData:R}=W0({strategy:"fixed",placement:_,whileElementsMounted:(...K)=>_0(...K,{animationFrame:f==="always"}),elements:{reference:g.anchor},middleware:[q0({mainAxis:a+C,alignmentAxis:o}),l&&R0({mainAxis:!0,crossAxis:!1,limiter:u==="partial"?F0():void 0,...D}),l&&$0({...D}),G0({...D,apply:({elements:K,rects:se,availableWidth:re,availableHeight:M})=>{const{width:$,height:X}=se.reference,oe=K.floating.style;oe.setProperty("--radix-popper-available-width",`${re}px`),oe.setProperty("--radix-popper-available-height",`${M}px`),oe.setProperty("--radix-popper-anchor-width",`${$}px`),oe.setProperty("--radix-popper-anchor-height",`${X}px`)}}),b&&H0({element:b,padding:s}),ek({arrowWidth:k,arrowHeight:C}),p&&V0({strategy:"referenceHidden",...D})]}),[P,j]=jm(L),Y=dt(y);St(()=>{F&&Y?.()},[F,Y]);const Z=R.arrow?.x,W=R.arrow?.y,z=R.arrow?.centerOffset!==0,[B,V]=T.useState();return St(()=>{w&&V(window.getComputedStyle(w).zIndex)},[w]),v.jsx("div",{ref:q.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:F?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:B,"--radix-popper-transform-origin":[R.transformOrigin?.x,R.transformOrigin?.y].join(" "),...R.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:v.jsx(X0,{scope:r,placedSide:P,onArrowChange:S,arrowX:Z,arrowY:W,shouldHideArrow:z,children:v.jsx(he.div,{"data-side":P,"data-align":j,...m,ref:h,style:{...m.style,animation:F?void 0:"none"}})})})});Dm.displayName=dl;var zm="PopperArrow",Q0={top:"bottom",right:"left",bottom:"top",left:"right"},Lm=T.forwardRef(function(e,r){const{__scopePopper:n,...a}=e,i=Z0(zm,n),o=Q0[i.placedSide];return v.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:v.jsx(K0,{...a,ref:r,style:{...a.style,display:"block"}})})});Lm.displayName=zm;function J0(t){return t!==null}var ek=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]=jm(r),u={start:"0%",center:"50%",end:"100%"}[d],p=(a.arrow?.x??0)+s/2,f=(a.arrow?.y??0)+l/2;let y="",m="";return c==="bottom"?(y=o?u:`${p}px`,m=`${-l}px`):c==="top"?(y=o?u:`${p}px`,m=`${n.floating.height+l}px`):c==="right"?(y=`${-l}px`,m=o?u:`${f}px`):c==="left"&&(y=`${n.floating.width+l}px`,m=o?u:`${f}px`),{data:{x:y,y:m}}}});function jm(t){const[e,r="center"]=t.split("-");return[e,r]}var tk=Im,rk=Mm,nk=Dm,ak=Lm,ik="Portal",ul=T.forwardRef((t,e)=>{const{container:r,...n}=t,[a,i]=T.useState(!1);St(()=>i(!0),[]);const o=r||a&&globalThis?.document?.body;return o?Nt.createPortal(v.jsx(he.div,{...n,ref:e}),o):null});ul.displayName=ik;function ok(t,e){return T.useReducer((r,n)=>e[r][n]??r,t)}var kt=t=>{const{present:e,children:r}=t,n=sk(e),a=typeof r=="function"?r({present:n.isPresent}):T.Children.only(r),i=me(n.ref,lk(a));return typeof r=="function"||n.isPresent?T.cloneElement(a,{ref:i}):null};kt.displayName="Presence";function sk(t){const[e,r]=T.useState(),n=T.useRef(null),a=T.useRef(t),i=T.useRef("none"),o=t?"mounted":"unmounted",[s,l]=ok(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return T.useEffect(()=>{const c=Cn(n.current);i.current=s==="mounted"?c:"none"},[s]),St(()=>{const c=n.current,d=a.current;if(d!==t){const p=i.current,f=Cn(c);t?l("MOUNT"):f==="none"||c?.display==="none"?l("UNMOUNT"):l(d&&p!==f?"ANIMATION_OUT":"UNMOUNT"),a.current=t}},[t,l]),St(()=>{if(e){let c;const d=e.ownerDocument.defaultView??window,u=f=>{const m=Cn(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=Cn(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 Cn(t){return t?.animationName||"none"}function lk(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 pl="rovingFocusGroup.onEntryFocus",ck={bubbles:!1,cancelable:!0},kr="RovingFocusGroup",[fl,Wm,dk]=$s(kr),[uk,Bm]=ct(kr,[dk]),[pk,fk]=uk(kr),qm=T.forwardRef((t,e)=>v.jsx(fl.Provider,{scope:t.__scopeRovingFocusGroup,children:v.jsx(fl.Slot,{scope:t.__scopeRovingFocusGroup,children:v.jsx(mk,{...t,ref:e})})}));qm.displayName=kr;var mk=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),y=Gs(i),[m,g]=Sr({prop:o,defaultProp:s??null,onChange:l,caller:kr}),[w,x]=T.useState(!1),h=dt(c),b=Wm(r),S=T.useRef(!1),[E,k]=T.useState(0);return T.useEffect(()=>{const C=p.current;if(C)return C.addEventListener(pl,h),()=>C.removeEventListener(pl,h)},[h]),v.jsx(pk,{scope:r,orientation:n,dir:y,loop:a,currentTabStopId:m,onItemFocus:T.useCallback(C=>g(C),[g]),onItemShiftTab:T.useCallback(()=>x(!0),[]),onFocusableItemAdd:T.useCallback(()=>k(C=>C+1),[]),onFocusableItemRemove:T.useCallback(()=>k(C=>C-1),[]),children:v.jsx(he.div,{tabIndex:w||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,C=>{const _=!S.current;if(C.target===C.currentTarget&&_&&!w){const A=new CustomEvent(pl,ck);if(C.currentTarget.dispatchEvent(A),!A.defaultPrevented){const I=b().filter(L=>L.focusable),N=I.find(L=>L.active),D=I.find(L=>L.id===m),H=[N,D,...I].filter(Boolean).map(L=>L.ref.current);$m(H,d)}}S.current=!1}),onBlur:ie(t.onBlur,()=>x(!1))})})}),Rm="RovingFocusGroupItem",Fm=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=fk(Rm,r),u=d.currentTabStopId===c,p=Wm(r),{onFocusableItemAdd:f,onFocusableItemRemove:y,currentTabStopId:m}=d;return T.useEffect(()=>{if(n)return f(),()=>y()},[n,f,y]),v.jsx(fl.ItemSlot,{scope:r,id:c,focusable:n,active:a,children:v.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 w=vk(g,d.orientation,d.dir);if(w!==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(w==="last")h.reverse();else if(w==="prev"||w==="next"){w==="prev"&&h.reverse();const b=h.indexOf(g.currentTarget);h=d.loop?yk(h,b+1):h.slice(b+1)}setTimeout(()=>$m(h))}}),children:typeof o=="function"?o({isCurrentTabStop:u,hasTabStop:m!=null}):o})})});Fm.displayName=Rm;var hk={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function gk(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function vk(t,e,r){const n=gk(t.key,r);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return hk[n]}function $m(t,e=!1){const r=document.activeElement;for(const n of t)if(n===r||(n.focus({preventScroll:e}),document.activeElement!==r))return}function yk(t,e){return t.map((r,n)=>t[(e+n)%t.length])}var bk=qm,Sk=Fm,xk=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},er=new WeakMap,kn=new WeakMap,En={},ml=0,Gm=function(t){return t&&(t.host||Gm(t.parentNode))},wk=function(t,e){return e.map(function(r){if(t.contains(r))return r;var n=Gm(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})},Ck=function(t,e,r,n){var a=wk(e,Array.isArray(t)?t:[t]);En[r]||(En[r]=new WeakMap);var i=En[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),y=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&&y&&kn.set(p,!0),g===1&&p.setAttribute(r,"true"),y||p.setAttribute(n,"true")}catch(w){console.error("aria-hidden: cannot operate on ",p,w)}})};return d(e),s.clear(),ml++,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||(kn.has(u)||u.removeAttribute(n),kn.delete(u)),f||u.removeAttribute(r)}),ml--,ml||(er=new WeakMap,er=new WeakMap,kn=new WeakMap,En={})}},Vm=function(t,e,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(t)?t:[t]),a=xk(t);return a?(n.push.apply(n,Array.from(a.querySelectorAll("[aria-live], script"))),Ck(n,a,r,"aria-hidden")):function(){return null}},tt=function(){return tt=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},tt.apply(this,arguments)};function Hm(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 kk(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 Tn="right-scroll-bar-position",An="width-before-scroll-bar",Ek="with-scroll-bars-hidden",Tk="--removed-body-scroll-bar-size";function hl(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function Ak(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 _k=typeof window<"u"?T.useLayoutEffect:T.useEffect,Um=new WeakMap;function Ok(t,e){var r=Ak(null,function(n){return t.forEach(function(a){return hl(a,n)})});return _k(function(){var n=Um.get(r);if(n){var a=new Set(n),i=new Set(t),o=r.current;a.forEach(function(s){i.has(s)||hl(s,null)}),i.forEach(function(s){a.has(s)||hl(s,o)})}Um.set(r,t)},[t]),r}function Pk(t){return t}function Ik(t,e){e===void 0&&(e=Pk);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 Nk(t){t===void 0&&(t={});var e=Ik(null);return e.options=tt({async:!0,ssr:!1},t),e}var Km=function(t){var e=t.sideCar,r=Hm(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,tt({},r))};Km.isSideCarExport=!0;function Mk(t,e){return t.useMedium(e),Km}var Ym=Nk(),gl=function(){},_n=T.forwardRef(function(t,e){var r=T.useRef(null),n=T.useState({onScrollCapture:gl,onWheelCapture:gl,onTouchMoveCapture:gl}),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,y=t.noIsolation,m=t.inert,g=t.allowPinchZoom,w=t.as,x=w===void 0?"div":w,h=t.gapMode,b=Hm(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=p,E=Ok([r,e]),k=tt(tt({},b),a);return T.createElement(T.Fragment,null,d&&T.createElement(S,{sideCar:Ym,removeScrollBar:c,shards:u,noRelative:f,noIsolation:y,inert:m,setCallbacks:i,allowPinchZoom:!!g,lockRef:r,gapMode:h}),o?T.cloneElement(T.Children.only(s),tt(tt({},k),{ref:E})):T.createElement(x,tt({},k,{className:l,ref:E}),s))});_n.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},_n.classNames={fullWidth:An,zeroRight:Tn};var Dk=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function zk(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=Dk();return e&&t.setAttribute("nonce",e),t}function Lk(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function jk(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var Wk=function(){var t=0,e=null;return{add:function(r){t==0&&(e=zk())&&(Lk(e,r),jk(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},Bk=function(){var t=Wk();return function(e,r){T.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&r])}},Xm=function(){var t=Bk(),e=function(r){var n=r.styles,a=r.dynamic;return t(n,a),null};return e},qk={left:0,top:0,right:0,gap:0},vl=function(t){return parseInt(t||"",10)||0},Rk=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[vl(r),vl(n),vl(a)]},Fk=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return qk;var e=Rk(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])}},$k=Xm(),tr="data-scroll-locked",Gk=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(Ek,` {
|
|
836
836
|
overflow: hidden `).concat(n,`;
|
|
837
837
|
padding-right: `).concat(s,"px ").concat(n,`;
|
|
@@ -871,7 +871,7 @@ ${d}`}const u=of(()=>{if(!i.current||!o.current){console.warn("Container or page
|
|
|
871
871
|
`)},Zm=function(){var t=parseInt(document.body.getAttribute(tr)||"0",10);return isFinite(t)?t:0},Vk=function(){T.useEffect(function(){return document.body.setAttribute(tr,(Zm()+1).toString()),function(){var t=Zm()-1;t<=0?document.body.removeAttribute(tr):document.body.setAttribute(tr,t.toString())}},[])},Hk=function(t){var e=t.noRelative,r=t.noImportant,n=t.gapMode,a=n===void 0?"margin":n;Vk();var i=T.useMemo(function(){return Fk(a)},[a]);return T.createElement($k,{styles:Gk(i,!e,a,r?"":"!important")})},yl=!1;if(typeof window<"u")try{var On=Object.defineProperty({},"passive",{get:function(){return yl=!0,!0}});window.addEventListener("test",On,On),window.removeEventListener("test",On,On)}catch{yl=!1}var rr=yl?{passive:!1}:!1,Uk=function(t){return t.tagName==="TEXTAREA"},Qm=function(t,e){if(!(t instanceof Element))return!1;var r=window.getComputedStyle(t);return r[e]!=="hidden"&&!(r.overflowY===r.overflowX&&!Uk(t)&&r[e]==="visible")},Kk=function(t){return Qm(t,"overflowY")},Yk=function(t){return Qm(t,"overflowX")},Jm=function(t,e){var r=e.ownerDocument,n=e;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var a=eh(t,n);if(a){var i=th(t,n),o=i[1],s=i[2];if(o>s)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},Xk=function(t){var e=t.scrollTop,r=t.scrollHeight,n=t.clientHeight;return[e,r,n]},Zk=function(t){var e=t.scrollLeft,r=t.scrollWidth,n=t.clientWidth;return[e,r,n]},eh=function(t,e){return t==="v"?Kk(e):Yk(e)},th=function(t,e){return t==="v"?Xk(e):Zk(e)},Qk=function(t,e){return t==="h"&&e==="rtl"?-1:1},Jk=function(t,e,r,n,a){var i=Qk(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=th(t,s),y=f[0],m=f[1],g=f[2],w=m-g-i*y;(y||w)&&eh(t,s)&&(u+=w,p+=y);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},Pn=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},rh=function(t){return[t.deltaX,t.deltaY]},nh=function(t){return t&&"current"in t?t.current:t},eE=function(t,e){return t[0]===e[0]&&t[1]===e[1]},tE=function(t){return`
|
|
872
872
|
.block-interactivity-`.concat(t,` {pointer-events: none;}
|
|
873
873
|
.allow-interactivity-`).concat(t,` {pointer-events: all;}
|
|
874
|
-
`)},rE=0,nr=[];function nE(t){var e=T.useRef([]),r=T.useRef([0,0]),n=T.useRef(),a=T.useState(rE++)[0],i=T.useState(Xm)[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=kk([t.lockRef.current],(t.shards||[]).map(nh),!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 w=Pn(m),x=r.current,h="deltaX"in m?m.deltaX:x[0]-w[0],b="deltaY"in m?m.deltaY:x[1]-w[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 C=window.getSelection(),_=C&&C.anchorNode,A=_?_===E||_.contains(E):!1;if(A)return!1;var I=Jm(k,E);if(!I)return!0;if(I?S=k:(S=k==="v"?"h":"v",I=Jm(k,E)),!I)return!1;if(!n.current&&"changedTouches"in m&&(h||b)&&(n.current=S),!S)return!0;var N=n.current||S;return Jk(N,g,m,N==="h"?h:b)},[]),l=T.useCallback(function(m){var g=m;if(!(!nr.length||nr[nr.length-1]!==i)){var w="deltaY"in g?rh(g):Pn(g),x=e.current.filter(function(S){return S.name===g.type&&(S.target===g.target||g.target===S.shadowParent)&&eE(S.delta,w)})[0];if(x&&x.should){g.cancelable&&g.preventDefault();return}if(!x){var h=(o.current.shards||[]).map(nh).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,w,x){var h={name:m,delta:g,target:w,should:x,shadowParent:aE(w)};e.current.push(h),setTimeout(function(){e.current=e.current.filter(function(b){return b!==h})},1)},[]),d=T.useCallback(function(m){r.current=Pn(m),n.current=void 0},[]),u=T.useCallback(function(m){c(m.type,rh(m),m.target,s(m,t.lockRef.current))},[]),p=T.useCallback(function(m){c(m.type,Pn(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,y=t.inert;return T.createElement(T.Fragment,null,y?T.createElement(i,{styles:tE(a)}):null,f?T.createElement(Hk,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function aE(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const iE=Mk(Ym,nE);var bl=T.forwardRef(function(t,e){return T.createElement(_n,tt({},t,{ref:e,sideCar:iE}))});bl.classNames=_n.classNames;var Sl=["Enter"," "],oE=["ArrowDown","PageUp","Home"],ah=["ArrowUp","PageDown","End"],sE=[...oE,...ah],lE={ltr:[...Sl,"ArrowRight"],rtl:[...Sl,"ArrowLeft"]},cE={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Er="Menu",[Tr,dE,uE]=$s(Er),[Bt,ih]=ct(Er,[uE,Om,Bm]),In=Om(),oh=Bm(),[pE,qt]=Bt(Er),[fE,Ar]=Bt(Er),sh=t=>{const{__scopeMenu:e,open:r=!1,children:n,dir:a,onOpenChange:i,modal:o=!0}=t,s=In(e),[l,c]=T.useState(null),d=T.useRef(!1),u=dt(i),p=Gs(a);return T.useEffect(()=>{const f=()=>{d.current=!0,document.addEventListener("pointerdown",y,{capture:!0,once:!0}),document.addEventListener("pointermove",y,{capture:!0,once:!0})},y=()=>d.current=!1;return document.addEventListener("keydown",f,{capture:!0}),()=>{document.removeEventListener("keydown",f,{capture:!0}),document.removeEventListener("pointerdown",y,{capture:!0}),document.removeEventListener("pointermove",y,{capture:!0})}},[]),v.jsx(tk,{...s,children:v.jsx(pE,{scope:e,open:r,onOpenChange:u,content:l,onContentChange:c,children:v.jsx(fE,{scope:e,onClose:T.useCallback(()=>u(!1),[u]),isUsingKeyboardRef:d,dir:p,modal:o,children:n})})})};sh.displayName=Er;var mE="MenuAnchor",xl=T.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t,a=In(r);return v.jsx(rk,{...a,...n,ref:e})});xl.displayName=mE;var wl="MenuPortal",[hE,lh]=Bt(wl,{forceMount:void 0}),ch=t=>{const{__scopeMenu:e,forceMount:r,children:n,container:a}=t,i=qt(wl,e);return v.jsx(hE,{scope:e,forceMount:r,children:v.jsx(kt,{present:r||i.open,children:v.jsx(ul,{asChild:!0,container:a,children:n})})})};ch.displayName=wl;var Re="MenuContent",[gE,Cl]=Bt(Re),dh=T.forwardRef((t,e)=>{const r=lh(Re,t.__scopeMenu),{forceMount:n=r.forceMount,...a}=t,i=qt(Re,t.__scopeMenu),o=Ar(Re,t.__scopeMenu);return v.jsx(Tr.Provider,{scope:t.__scopeMenu,children:v.jsx(kt,{present:n||i.open,children:v.jsx(Tr.Slot,{scope:t.__scopeMenu,children:o.modal?v.jsx(vE,{...a,ref:e}):v.jsx(yE,{...a,ref:e})})})})}),vE=T.forwardRef((t,e)=>{const r=qt(Re,t.__scopeMenu),n=T.useRef(null),a=me(e,n);return T.useEffect(()=>{const i=n.current;if(i)return Vm(i)},[]),v.jsx(kl,{...t,ref:a,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:ie(t.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),yE=T.forwardRef((t,e)=>{const r=qt(Re,t.__scopeMenu);return v.jsx(kl,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),bE=xr("MenuContent.ScrollLock"),kl=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:y,...m}=t,g=qt(Re,r),w=Ar(Re,r),x=In(r),h=oh(r),b=dE(r),[S,E]=T.useState(null),k=T.useRef(null),C=me(e,k,g.onContentChange),_=T.useRef(0),A=T.useRef(""),I=T.useRef(0),N=T.useRef(null),D=T.useRef("right"),q=T.useRef(0),H=y?bl:T.Fragment,L=y?{as:bE,allowPinchZoom:!0}:void 0,F=P=>{const j=A.current+P,Y=b().filter(K=>!K.disabled),Z=document.activeElement,W=Y.find(K=>K.ref.current===Z)?.textValue,z=Y.map(K=>K.textValue),B=IE(z,j,W),V=Y.find(K=>K.textValue===B)?.ref.current;(function K(se){A.current=se,window.clearTimeout(_.current),se!==""&&(_.current=window.setTimeout(()=>K(""),1e3))})(j),V&&setTimeout(()=>V.focus())};T.useEffect(()=>()=>window.clearTimeout(_.current),[]),Qf();const R=T.useCallback(P=>D.current===N.current?.side&&ME(P,N.current?.area),[]);return v.jsx(gE,{scope:r,searchRef:A,onItemEnter:T.useCallback(P=>{R(P)&&P.preventDefault()},[R]),onItemLeave:T.useCallback(P=>{R(P)||(k.current?.focus(),E(null))},[R]),onTriggerLeave:T.useCallback(P=>{R(P)&&P.preventDefault()},[R]),pointerGraceTimerRef:I,onPointerGraceIntentChange:T.useCallback(P=>{N.current=P},[]),children:v.jsx(H,{...L,children:v.jsx(Xs,{asChild:!0,trapped:a,onMountAutoFocus:ie(i,P=>{P.preventDefault(),k.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:v.jsx(Hs,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:u,onInteractOutside:p,onDismiss:f,children:v.jsx(bk,{asChild:!0,...h,dir:w.dir,orientation:"vertical",loop:n,currentTabStopId:S,onCurrentTabStopIdChange:E,onEntryFocus:ie(l,P=>{w.isUsingKeyboardRef.current||P.preventDefault()}),preventScrollOnEntryFocus:!0,children:v.jsx(nk,{role:"menu","aria-orientation":"vertical","data-state":Ah(g.open),"data-radix-menu-content":"",dir:w.dir,...x,...m,ref:C,style:{outline:"none",...m.style},onKeyDown:ie(m.onKeyDown,P=>{const Y=P.target.closest("[data-radix-menu-content]")===P.currentTarget,Z=P.ctrlKey||P.altKey||P.metaKey,W=P.key.length===1;Y&&(P.key==="Tab"&&P.preventDefault(),!Z&&W&&F(P.key));const z=k.current;if(P.target!==z||!sE.includes(P.key))return;P.preventDefault();const V=b().filter(K=>!K.disabled).map(K=>K.ref.current);ah.includes(P.key)&&V.reverse(),OE(V)}),onBlur:ie(t.onBlur,P=>{P.currentTarget.contains(P.target)||(window.clearTimeout(_.current),A.current="")}),onPointerMove:ie(t.onPointerMove,Or(P=>{const j=P.target,Y=q.current!==P.clientX;if(P.currentTarget.contains(j)&&Y){const Z=P.clientX>q.current?"right":"left";D.current=Z,q.current=P.clientX}}))})})})})})})});dh.displayName=Re;var SE="MenuGroup",El=T.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t;return v.jsx(he.div,{role:"group",...n,ref:e})});El.displayName=SE;var xE="MenuLabel",uh=T.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t;return v.jsx(he.div,{...n,ref:e})});uh.displayName=xE;var Nn="MenuItem",ph="menu.itemSelect",Mn=T.forwardRef((t,e)=>{const{disabled:r=!1,onSelect:n,...a}=t,i=T.useRef(null),o=Ar(Nn,t.__scopeMenu),s=Cl(Nn,t.__scopeMenu),l=me(e,i),c=T.useRef(!1),d=()=>{const u=i.current;if(!r&&u){const p=new CustomEvent(ph,{bubbles:!0,cancelable:!0});u.addEventListener(ph,f=>n?.(f),{once:!0}),Uf(u,p),p.defaultPrevented?c.current=!1:o.onClose()}};return v.jsx(fh,{...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===" "||Sl.includes(u.key)&&(u.currentTarget.click(),u.preventDefault())})})});Mn.displayName=Nn;var fh=T.forwardRef((t,e)=>{const{__scopeMenu:r,disabled:n=!1,textValue:a,...i}=t,o=Cl(Nn,r),s=oh(r),l=T.useRef(null),c=me(e,l),[d,u]=T.useState(!1),[p,f]=T.useState("");return T.useEffect(()=>{const y=l.current;y&&f((y.textContent??"").trim())},[i.children]),v.jsx(Tr.ItemSlot,{scope:r,disabled:n,textValue:a??p,children:v.jsx(Sk,{asChild:!0,...s,focusable:!n,children:v.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,Or(y=>{n?o.onItemLeave(y):(o.onItemEnter(y),y.defaultPrevented||y.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ie(t.onPointerLeave,Or(y=>o.onItemLeave(y))),onFocus:ie(t.onFocus,()=>u(!0)),onBlur:ie(t.onBlur,()=>u(!1))})})})}),wE="MenuCheckboxItem",mh=T.forwardRef((t,e)=>{const{checked:r=!1,onCheckedChange:n,...a}=t;return v.jsx(bh,{scope:t.__scopeMenu,checked:r,children:v.jsx(Mn,{role:"menuitemcheckbox","aria-checked":Dn(r)?"mixed":r,...a,ref:e,"data-state":Al(r),onSelect:ie(a.onSelect,()=>n?.(Dn(r)?!0:!r),{checkForDefaultPrevented:!1})})})});mh.displayName=wE;var hh="MenuRadioGroup",[CE,kE]=Bt(hh,{value:void 0,onValueChange:()=>{}}),gh=T.forwardRef((t,e)=>{const{value:r,onValueChange:n,...a}=t,i=dt(n);return v.jsx(CE,{scope:t.__scopeMenu,value:r,onValueChange:i,children:v.jsx(El,{...a,ref:e})})});gh.displayName=hh;var vh="MenuRadioItem",yh=T.forwardRef((t,e)=>{const{value:r,...n}=t,a=kE(vh,t.__scopeMenu),i=r===a.value;return v.jsx(bh,{scope:t.__scopeMenu,checked:i,children:v.jsx(Mn,{role:"menuitemradio","aria-checked":i,...n,ref:e,"data-state":Al(i),onSelect:ie(n.onSelect,()=>a.onValueChange?.(r),{checkForDefaultPrevented:!1})})})});yh.displayName=vh;var Tl="MenuItemIndicator",[bh,EE]=Bt(Tl,{checked:!1}),Sh=T.forwardRef((t,e)=>{const{__scopeMenu:r,forceMount:n,...a}=t,i=EE(Tl,r);return v.jsx(kt,{present:n||Dn(i.checked)||i.checked===!0,children:v.jsx(he.span,{...a,ref:e,"data-state":Al(i.checked)})})});Sh.displayName=Tl;var TE="MenuSeparator",xh=T.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t;return v.jsx(he.div,{role:"separator","aria-orientation":"horizontal",...n,ref:e})});xh.displayName=TE;var AE="MenuArrow",wh=T.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t,a=In(r);return v.jsx(ak,{...a,...n,ref:e})});wh.displayName=AE;var _E="MenuSub",[rI,Ch]=Bt(_E),_r="MenuSubTrigger",kh=T.forwardRef((t,e)=>{const r=qt(_r,t.__scopeMenu),n=Ar(_r,t.__scopeMenu),a=Ch(_r,t.__scopeMenu),i=Cl(_r,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]),v.jsx(xl,{asChild:!0,...c,children:v.jsx(fh,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":a.contentId,"data-state":Ah(r.open),...t,ref:br(e,a.onTriggerChange),onClick:u=>{t.onClick?.(u),!(t.disabled||u.defaultPrevented)&&(u.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:ie(t.onPointerMove,Or(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,Or(u=>{d();const p=r.content?.getBoundingClientRect();if(p){const f=r.content?.dataset.side,y=f==="right",m=y?-5:5,g=p[y?"left":"right"],w=p[y?"right":"left"];i.onPointerGraceIntentChange({area:[{x:u.clientX+m,y:u.clientY},{x:g,y:p.top},{x:w,y:p.top},{x:w,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===" "||lE[n.dir].includes(u.key)&&(r.onOpenChange(!0),r.content?.focus(),u.preventDefault())})})})});kh.displayName=_r;var Eh="MenuSubContent",Th=T.forwardRef((t,e)=>{const r=lh(Re,t.__scopeMenu),{forceMount:n=r.forceMount,...a}=t,i=qt(Re,t.__scopeMenu),o=Ar(Re,t.__scopeMenu),s=Ch(Eh,t.__scopeMenu),l=T.useRef(null),c=me(e,l);return v.jsx(Tr.Provider,{scope:t.__scopeMenu,children:v.jsx(kt,{present:n||i.open,children:v.jsx(Tr.Slot,{scope:t.__scopeMenu,children:v.jsx(kl,{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=cE[o.dir].includes(d.key);u&&p&&(i.onOpenChange(!1),s.trigger?.focus(),d.preventDefault())})})})})})});Th.displayName=Eh;function Ah(t){return t?"open":"closed"}function Dn(t){return t==="indeterminate"}function Al(t){return Dn(t)?"indeterminate":t?"checked":"unchecked"}function OE(t){const e=document.activeElement;for(const r of t)if(r===e||(r.focus(),document.activeElement!==e))return}function PE(t,e){return t.map((r,n)=>t[(e+n)%t.length])}function IE(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=PE(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 NE(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 ME(t,e){if(!e)return!1;const r={x:t.clientX,y:t.clientY};return NE(r,e)}function Or(t){return e=>e.pointerType==="mouse"?t(e):void 0}var DE=sh,zE=xl,LE=ch,jE=dh,WE=El,BE=uh,qE=Mn,RE=mh,FE=gh,$E=yh,GE=Sh,VE=xh,HE=wh,UE=kh,KE=Th,zn="DropdownMenu",[YE]=ct(zn,[ih]),Oe=ih(),[XE,_h]=YE(zn),Oh=t=>{const{__scopeDropdownMenu:e,children:r,dir:n,open:a,defaultOpen:i,onOpenChange:o,modal:s=!0}=t,l=Oe(e),c=T.useRef(null),[d,u]=Sr({prop:a,defaultProp:i??!1,onChange:o,caller:zn});return v.jsx(XE,{scope:e,triggerId:Yt(),triggerRef:c,contentId:Yt(),open:d,onOpenChange:u,onOpenToggle:T.useCallback(()=>u(p=>!p),[u]),modal:s,children:v.jsx(DE,{...l,open:d,onOpenChange:u,dir:n,modal:s,children:r})})};Oh.displayName=zn;var Ph="DropdownMenuTrigger",Ih=T.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...a}=t,i=_h(Ph,r),o=Oe(r);return v.jsx(zE,{asChild:!0,...o,children:v.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:br(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())})})})});Ih.displayName=Ph;var ZE="DropdownMenuPortal",Nh=t=>{const{__scopeDropdownMenu:e,...r}=t,n=Oe(e);return v.jsx(LE,{...n,...r})};Nh.displayName=ZE;var Mh="DropdownMenuContent",Dh=T.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,a=_h(Mh,r),i=Oe(r),o=T.useRef(!1);return v.jsx(jE,{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)"}})});Dh.displayName=Mh;var QE="DropdownMenuGroup",JE=T.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,a=Oe(r);return v.jsx(WE,{...a,...n,ref:e})});JE.displayName=QE;var eT="DropdownMenuLabel",zh=T.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,a=Oe(r);return v.jsx(BE,{...a,...n,ref:e})});zh.displayName=eT;var tT="DropdownMenuItem",Lh=T.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,a=Oe(r);return v.jsx(qE,{...a,...n,ref:e})});Lh.displayName=tT;var rT="DropdownMenuCheckboxItem",jh=T.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,a=Oe(r);return v.jsx(RE,{...a,...n,ref:e})});jh.displayName=rT;var nT="DropdownMenuRadioGroup",Wh=T.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,a=Oe(r);return v.jsx(FE,{...a,...n,ref:e})});Wh.displayName=nT;var aT="DropdownMenuRadioItem",Bh=T.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,a=Oe(r);return v.jsx($E,{...a,...n,ref:e})});Bh.displayName=aT;var iT="DropdownMenuItemIndicator",oT=T.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,a=Oe(r);return v.jsx(GE,{...a,...n,ref:e})});oT.displayName=iT;var sT="DropdownMenuSeparator",qh=T.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,a=Oe(r);return v.jsx(VE,{...a,...n,ref:e})});qh.displayName=sT;var lT="DropdownMenuArrow",cT=T.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,a=Oe(r);return v.jsx(HE,{...a,...n,ref:e})});cT.displayName=lT;var dT="DropdownMenuSubTrigger",Rh=T.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,a=Oe(r);return v.jsx(UE,{...a,...n,ref:e})});Rh.displayName=dT;var uT="DropdownMenuSubContent",Fh=T.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,a=Oe(r);return v.jsx(KE,{...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)"}})});Fh.displayName=uT;var pT=Oh,fT=Ih,mT=Nh,$h=Dh,Gh=zh,Vh=Lh,Hh=jh,hT=Wh,Uh=Bh,Kh=qh,Yh=Rh,Xh=Fh;const Ln=pT,jn=fT,gT=hT,vT=T.forwardRef(({className:t,inset:e,children:r,...n},a)=>v.jsx(Yh,{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}));vT.displayName=Yh.displayName;const yT=T.forwardRef(({className:t,...e},r)=>v.jsx(Xh,{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}));yT.displayName=Xh.displayName;const Pr=T.forwardRef(({className:t,sideOffset:e=4,...r},n)=>{const{portalContainer:a}=Ls();return v.jsx(mT,{container:a||void 0,children:v.jsx($h,{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})})});Pr.displayName=$h.displayName;const Rt=T.forwardRef(({className:t,inset:e,...r},n)=>v.jsx(Vh,{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}));Rt.displayName=Vh.displayName;const bT=T.forwardRef(({className:t,children:e,checked:r,...n},a)=>v.jsx(Hh,{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}));bT.displayName=Hh.displayName;const Zh=T.forwardRef(({className:t,children:e,...r},n)=>v.jsx(Uh,{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}));Zh.displayName=Uh.displayName;const _l=T.forwardRef(({className:t,inset:e,...r},n)=>v.jsx(Gh,{ref:n,className:pe("px-2 py-1.5 text-sm font-medium",e&&"pl-8",t),...r}));_l.displayName=Gh.displayName;const Wn=T.forwardRef(({className:t,...e},r)=>v.jsx(Kh,{ref:r,className:pe("-mx-1 my-1 h-px bg-gray-200",t),...e}));Wn.displayName=Kh.displayName;const ST=(t,e)=>{if(t.stopPropagation(),e.onSelect){e.onSelect(t);return}e.dialog&&typeof window<"u"&&window.$uhuu?.editDialog?.(e.dialog)},Ol=(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 v.jsx("div",{className:pe("pointer-events-none absolute inset-0 z-10",e),"aria-hidden":"true",dangerouslySetInnerHTML:{__html:a}})}return v.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)})},Pl=(t,e)=>e?v.jsx("div",{className:"absolute right-2 top-2 z-20",children:v.jsxs(Ln,{modal:!1,children:[v.jsx(jn,{asChild:!0,children:v.jsx(ke,{variant:"secondary",size:"icon",title:"Image options",className:"h-7 w-7 shadow-sm",onPointerDown:r=>r.stopPropagation(),onClick:r=>r.stopPropagation(),children:v.jsx(hf,{className:"h-4 w-4"})})}),v.jsx(Pr,{className:"w-40 p-1.5",align:"end",children:t.map(r=>v.jsxs(Rt,{onSelect:n=>ST(n,r),disabled:r.disabled,children:[r.icon&&v.jsx("span",{className:"mr-2 inline-flex",children:r.icon}),v.jsx("span",{children:r.label})]},r.id))})]})}):null,Il=(t=[])=>{const e=Ws();return t.length>0&&!e},xT=({className:t,style:e,overlaySvg:r,overlayClassName:n,options:a=[],dialog:i,dialogProps:o,bleedProps:s,children:l})=>{const c=O.useContext(zt),d=Il(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 y=u[f],m=o[f];f.startsWith("on")&&typeof y=="function"&&typeof m=="function"&&(p[f]=g=>{y(g),m(g)})}),p},[u,o]),v.jsxs(v.Fragment,{children:[v.jsxs(Ds,{...s,dialog:i,children:[Ol(r,n),l]}),Pl(a,d)]})};function Nl(t){const e=O.useContext(zt),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,y=N=>`${N}mm`,m=()=>{let N=l;return l||(N=2*n,d||(N+=2*r),u||(N+=2*r),(d||u)&&(N-=(d??0)+(u??0))),N},g=()=>{let N=c;return c||(N=a,p||(N+=r),f||(N+=r),(p||f)&&(N-=(p??0)+(f??0))),N},w=m(),x=g(),h=N=>N!==void 0?y(N):void 0,b=N=>Object.fromEntries(Object.entries(N).filter(([D,q])=>q!==void 0)),S=d>0?d+r:-1*r,E=p>0?p+r:-1*r,k=f>0?f+r:-1*r,C=-1*n+S,_=p>0&&f>0,A=b({backgroundColor:s,width:h(w),..._?{height:h(x)}:{},left:h(S),top:h(E),bottom:h(k)}),I=b({width:h(w),..._?{height:h(x)}:{},left:h(C),top:h(E),bottom:h(k)});return v.jsx("div",{className:"uhuu-image-container",style:o=="end"?I:A,...t.dataUhuu!==void 0?{"data-uhuu":t.dataUhuu}:{},children:v.jsxs("div",{className:"uhuu-image-inner",...Kt(t,e),children:[v.jsx("img",{className:"cover-image",src:i||null}),t.children]})})}const wT=({overlaySvg:t,overlayClassName:e,options:r=[],dialog:n,spreadProps:a,children:i})=>{const o=Il(r);return v.jsxs(v.Fragment,{children:[v.jsxs(Nl,{...a,dialog:n,children:[Ol(t,e),i]}),Pl(r,o)]})},CT=({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:y})=>{const m=O.useContext(zt),g=c?Kt({dialog:c},m):{},w=Il(l),x=T.useMemo(()=>{if(!d)return g;const C={...g,...d};return(g.className||d.className)&&(C.className=pe(g.className,d.className)),Object.keys(g).forEach(_=>{const A=g[_],I=d[_];_.startsWith("on")&&typeof A=="function"&&typeof I=="function"&&(C[_]=N=>{A(N),I(N)})}),C},[g,d]),h=()=>{const C=f?.className,_=f?.style,A=f?.src??t,I=f?.alt??e,N={...f,src:A,alt:I,className:pe("h-full w-full object-cover",n,C),style:{...i,..._}};return y?y(N):A?v.jsx("img",{...N}):u??null},b=x["data-uhuu"],S=T.Children.toArray(p).some(C=>T.isValidElement(C)?C.type===Nl||C.type===Ds:!1);S&&delete x["data-uhuu"];const E=T.Children.map(p,C=>T.isValidElement(C)?T.cloneElement(C,{dataUhuu:b}):C),k=S?"relative h-full w-full":"relative";return v.jsxs("div",{className:pe(k,r),style:a,children:[v.jsxs("div",{className:"relative h-full w-full",...x,children:[h(),E,Ol(o,s)]}),Pl(l,w)]})},kT=t=>{const{computedOverlaySvg:e,computedOptions:r,computedDirectDialog:n}=O.useMemo(()=>{const{annotation:H,dialog:L,overlaySvg:F,options:R,src:P}=t;if(!H&&!L)return{computedOverlaySvg:F,computedOptions:R,computedDirectDialog:void 0};const j=H?.value||{},Y=F??j.annotationSvg??"",Z=[];if(H){if(L){const $={...L};if(L.type==="satellite"){const{path:X,type:oe,...le}=L;$.config={...le,path:"image"},$.path=X,$.type=oe}Z.push({id:"edit",label:"Edit image",dialog:$})}const B=Array.isArray(j.annotations)?j.annotations:[],{path:V,value:K,annotations:se,...re}=H,M={path:H.path,type:"annotation",image:P,annotations:B,...re};Z.push({id:"annotate",label:"Annotate",dialog:M})}const W=R?[...Z,...R]:Z;let z;if(L){const B={...L};if(L.type==="satellite"){const{path:V,type:K,...se}=L;B.config={...se,path:"image"},B.path=V,B.type=K}z=B}return{computedOverlaySvg:Y,computedOptions:W.length>0?W:void 0,computedDirectDialog:z}},[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:y,width:m,height:g,left:w,right:x,top:h,bottom:b,pageWidth:S,pageHeight:E,bleed:k,overlayClassName:C,dialogProps:_,placeholder:A,children:I,imageProps:N,renderImage:D}=t,q={src:l,backgroundColor:y,width:m,height:g,left:w,right:x,top:h,bottom:b,pageWidth:S,pageHeight:E,bleed:k};if(a==="auto")return v.jsx(CT,{src:l,alt:c,className:d,style:p,imageClassName:u,imageStyle:f,overlaySvg:e,overlayClassName:C,options:r,dialog:n,dialogProps:_,placeholder:A,children:I,imageProps:N,renderImage:D});if(a==="spread"){const H={...q,side:s};return i&&(e||r?.length||n)?v.jsx(wT,{className:d,style:p,overlaySvg:e,overlayClassName:C,options:r,dialog:n,dialogProps:_,spreadProps:H,children:I}):v.jsx(Nl,{...H})}return i&&(e||r?.length||n)?v.jsx(xT,{className:d,style:p,overlaySvg:e,overlayClassName:C,options:r,dialog:n,dialogProps:_,bleedProps:q,children:I}):v.jsx(Ds,{...q})},ET=t=>{const e=O.useContext(zt);return v.jsx("div",{className:t.className,...Kt(t,e),children:t.children})},Ft="uhuu_page_editor";function Pe(t){return t.kind==="group"}function TT(t){const e=[];let r=1;for(const n of t)if(Pe(n))for(const a of n.pages)e.push({...a,kind:"page",pageNum:r++});else e.push({...n,pageNum:r++});return e}function AT(t){const e=[];let r=1;for(const n of t)if(Pe(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 Et(t){return TT(t).length}function _T(t){return t.map(e=>{const r=e.strictPosition;if(Pe(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 OT(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 Ml(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 Qh(t,e=Ft){const r=Ml(t);return{key:e,items:r,totalPages:Et(r),updatedAt:new Date().toISOString()}}function PT(t,e=Ft){const r=t?.[e];if(!r?.items)return null;const n=Ml(r.items);return{key:e,items:n,totalPages:Et(n),updatedAt:r.updatedAt||new Date().toISOString()}}function IT(t,e,r=Ft){const n=Qh(e,r);return{...t??{},[r]:n}}function Jh(){return Math.random().toString(36).slice(2,11)}function eg(t,e,r){return{kind:"page",id:r?.repeatable?Jh():t,componentKey:e,templateId:t,label:r?.label,repeatable:r?.repeatable,maxInstances:r?.maxInstances,...r}}function tg(t,e,r){const n=r?.repeatable?Jh():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 rg(t,e){return t<0?e+t+1:t}function ng(t,e,r){for(const n of e){const a=rg(n.start,r),i=rg(n.end,r);if(t>=a&&t<=i)return!0}return!1}function NT(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 MT(t,e){if(!e||e.mode==="all")return t;const r=Et(t),n=e.mode??"all",a=e.coverPageCount??2,i=n==="custom"&&e.ranges?e.ranges:NT(n,r,a);if(i.length===0)return[];const o=[];for(const s of t)if(Pe(s)){const l=s.pages.filter(c=>c.pageNum&&ng(c.pageNum,i,r));l.length>0&&o.push({...s,pages:l})}else s.pageNum&&ng(s.pageNum,i,r)&&o.push(s);return o}function ag(t,e){if(t?.integrations)return t.integrations[e]}function DT(t,e){return e&&Pe(e)?e.id:t?.id??null}function ig(t,e,r){const n=DT(e,r);return n?{instanceId:n,integration:ag(t,n)}:{instanceId:null,integration:void 0}}function og(t,e,r){return ig(t,e,r).integration}function sg(t,e){if(!t)return null;const r=`integrations.${t}`;return e?`${r}.${e}`:r}function zT(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 LT(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 jT(t,e,r){const n=zT(e);if(!n.isIntegrationPath||!n.instanceId)return t;const{instanceId:a,fieldPath:i}=n,o=ag(t,a)||{},s=LT(o,i,r);return{...t,integrations:{...t?.integrations||{},[a]:s}}}function Bn(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 Ir=T.createContext(null);function WT(t=Ft){return[t]}function BT(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 lg({payload:t,onPayloadChange:e,children:r,stateKey:n=Ft}){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(C=>{try{return JSON.stringify(C)}catch{return String(C)}},[]),p=T.useMemo(()=>WT(n),[n]),f=T.useCallback((C,_)=>{if(!C)return null;const A={...C};return _.forEach(I=>{delete A[I]}),A},[]);T.useEffect(()=>{if(d.current){d.current=!1,t&&(o.current=t,i(t));return}if(s.current){s.current=!1;const A=l.current!==null?u(f(l.current,p)):null,I=u(f(t,p));if(A!==null&&A===I){o.current=t;return}}if(t===o.current)return;if(Date.now()-c.current<500&&l.current!==null){const A=f(t,p),I=f(l.current,p),N=A?u(A):null,D=I?u(I):null;if(N&&N===D){l.current=null,o.current=t;return}}o.current=t,i(A=>t?BT(A,t,p):A)},[t,p,u,f]);const y=T.useCallback(C=>{if(e?.(C),typeof window>"u")return;const _=window.$uhuu;_?.emitPayload&&_.emitPayload(C)},[e]),m=T.useCallback(C=>{s.current=!0,i(_=>{const A=typeof C=="function"?C(_):C;let I=A;return A&&typeof A=="object"&&Object.keys(A).filter(D=>D.startsWith("integrations.")||D==="integrations").length>0&&A.integrations&&(I=A),l.current=I,c.current=Date.now(),y(I),I})},[y]),g=T.useCallback((C,_,A)=>{m(I=>({...I??{},pages:{...I?.pages??{},[C]:{...I?.pages?.[C]??{},[_]:A}}}))},[m]),w=T.useCallback((C,_)=>{m(A=>{const I=A?.integrations??{},N=I[C],D=typeof _=="function"?_(N):_;return{...A??{},integrations:{...I,[C]:D}}})},[m]),x=T.useCallback((C,_,A)=>{w(C,I=>({...I??{},[_]:A}))},[w]),h=T.useCallback(C=>{m(_=>{if(!_?.integrations||!_.integrations[C])return _;const{[C]:A,...I}=_.integrations;return{..._,integrations:Object.keys(I).length>0?I:void 0}})},[m]),b=T.useCallback((C,_)=>{m(A=>jT(A,C,_))},[m]),S=T.useCallback((C,_)=>{const A=_??n;m(I=>IT(I,C,A))},[m,n]),E=T.useCallback(C=>Bn(a,C),[a]),k=T.useMemo(()=>({payload:a,setPayload:m,setPageOptionValue:g,setIntegrationPayload:w,setIntegrationPayloadValue:x,removeIntegrationPayload:h,updateIntegrationByDialogPath:b,mergePageEditorState:S,getPagePayload:E}),[a,m,g,w,x,h,b,S,E]);return v.jsx(Ir.Provider,{value:k,children:r})}function qT(t){return t.defaultValue!==void 0?t.defaultValue:t.type==="toggle"?!1:t.type==="slider"||t.type==="counter"?0:""}function RT(t,e){return t.type==="toggle"?e===!0||e==="true":t.type==="slider"||t.type==="counter"?Number(e):e}function FT(t,e,r){const n=t.field??t.id;return{...t,getValue:i=>{const o=e?.pages?.[i.id]?.[n];return o===void 0?qT(t):t.type==="toggle"?!!o:o},onChange:(i,o)=>{r(i,n,RT(t,o))}}}const qn=O.createContext({zoom:100,scaleValue:1,hideUI:!1});function $T({children:t,layout:e="spread"}){const{scaleValue:r}=O.useContext(qn),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]),v.jsx("div",{ref:n,className:`two-pages-pair two-pages-pair--${e}`,children:t})}function Rn({children:t,title:e,className:r="",controls:n,origin:a="center"}){const{scaleValue:i,hideUI:o}=O.useContext(qn),s=O.useRef(null),[l,c]=O.useState(0),[d,u]=O.useState(0);O.useEffect(()=>{if(s.current){const w=()=>{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)}};w();const x=new ResizeObserver(w);return x.observe(s.current),()=>{x.disconnect()}}},[t]);const p=l*i,f=Math.max(d*i,150),y={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}=y[a];return o?v.jsx("div",{className:r,children:t}):v.jsxs("div",{className:`group/section ${r}`,style:{width:`${f}px`,minWidth:"150px"},children:[v.jsx("div",{children:n??v.jsx("div",{className:"px-4 py-2 border-b border-gray-200",children:v.jsxs("div",{className:"text-sm font-medium text-gray-700",children:[e," Controls"]})})}),v.jsx("div",{className:"pt-1",style:{height:p>0?`${p+32}px`:"auto",minHeight:"100px"},children:v.jsx("div",{className:`flex items-start ${m}`,children:v.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 GT({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=Ws(),d=s??c,[u,p]=O.useState(r),[f,y]=O.useState("none"),m=O.useRef(null),g=O.useRef(null),[w,x]=O.useState(!1),[h,b]=O.useState(0),[S,E]=O.useState(!0),k=N=>{if(!m.current||!g.current)return u;const D=m.current.getBoundingClientRect(),q=g.current.querySelector("[data-section-content]");if(!q)return u;let H=Number.parseInt(q.getAttribute("data-natural-width")||"0");const L=Number.parseInt(q.getAttribute("data-natural-height")||"0");if(H===0||L===0)return u;l==="two_pages"&&(H=H*2);const F=D.width-32,R=screen.height-120,P=F/H*100,j=R/L*100;switch(N){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}},C=N=>{if(y(N),N!=="none"){const D=k(N);p(D)}},_=()=>{const N=Math.min(u+25,a);p(N),y("none")},A=()=>{const N=Math.max(u-25,n);p(N),y("none")};O.useEffect(()=>{const N=()=>{if(!m.current||!g.current)return;const H=m.current.getBoundingClientRect().width;if(!w){const L=g.current.querySelector("[data-section-content]");if(L){const F=Number.parseInt(L.getAttribute("data-natural-width")||"0");if(F>0){if(F>H-48){const R=k("both");y("both"),p(R)}x(!0),b(H),E(!1);return}}if(S){setTimeout(N,50);return}}E(!1)},D=()=>{if(!m.current||S)return;const H=m.current.getBoundingClientRect().width;if(Math.abs(H-h)>10){if(f!=="none"){const L=k(f);p(L)}b(H)}};return N(),window.addEventListener("resize",D),()=>{window.removeEventListener("resize",D)}},[f,n,a,w,h,S]);const I=u/100;return d?v.jsx(qn.Provider,{value:{zoom:100,scaleValue:1,hideUI:!0},children:v.jsx("div",{className:e,children:t})}):v.jsx(qn.Provider,{value:{zoom:u,scaleValue:I,hideUI:!1},children:v.jsxs("div",{ref:m,className:`flex flex-col min-h-0 ${e}`,children:[v.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,v.jsx("div",{className:"h-4 w-px bg-gray-200 mx-0.5"}),v.jsxs(Ln,{modal:!1,children:[v.jsx(jn,{asChild:!0,children:v.jsxs(ke,{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),"%",v.jsx(ow,{className:"w-3 h-3 ml-1 opacity-60"})]})}),v.jsxs(Pr,{className:"w-52 p-1.5",align:"end",children:[v.jsxs(Rt,{onClick:()=>C("width"),className:`cursor-pointer flex items-center ${f==="width"?"bg-gray-100":""}`,children:[v.jsx(pw,{className:"w-4 h-4 mr-2"}),v.jsx("span",{children:"Fit to Width"})]}),v.jsxs(Rt,{onClick:()=>C("height"),className:`cursor-pointer flex items-center ${f==="height"?"bg-gray-100":""}`,children:[v.jsx(fw,{className:"w-4 h-4 mr-2"}),v.jsx("span",{children:"Fit to Height"})]}),v.jsxs(Rt,{onClick:()=>C("both"),className:`cursor-pointer flex items-center ${f==="both"?"bg-gray-100":""}`,children:[v.jsx(lw,{className:"w-4 h-4 mr-2"}),v.jsx("span",{children:"Fit to Page"})]}),v.jsx(Wn,{className:"my-1.5"}),v.jsxs("div",{className:"flex items-center justify-center gap-2 px-3 py-2.5",onClick:N=>N.stopPropagation(),children:[v.jsx(ke,{variant:"ghost",size:"sm",onClick:N=>{N.stopPropagation(),A()},disabled:u<=n,className:"h-8 w-8 p-0 hover:bg-gray-100 disabled:opacity-40",title:"Zoom out (25%)",children:v.jsx(hw,{className:"w-4 h-4"})}),v.jsxs("div",{className:"relative",children:[v.jsx("input",{type:"number",value:Math.round(u),onChange:N=>{const D=Number.parseInt(N.target.value);if(!isNaN(D)){const q=Math.min(Math.max(D,n),a);p(q),y("none")}},onFocus:N=>N.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}),v.jsx("span",{className:"absolute right-2 top-1/2 -translate-y-1/2 text-xs text-gray-400 pointer-events-none",children:"%"})]}),v.jsx(ke,{variant:"ghost",size:"sm",onClick:N=>{N.stopPropagation(),_()},disabled:u>=a,className:"h-8 w-8 p-0 hover:bg-gray-100 disabled:opacity-40",title:"Zoom in (25%)",children:v.jsx(mw,{className:"w-4 h-4"})})]})]})]})]}),v.jsx("div",{ref:g,children:v.jsx("div",{className:l==="two_pages"?"group_two_pages":"flex flex-col items-center",children:t})}),v.jsx("div",{className:"flex justify-center pb-16",children:v.jsx(ke,{size:"sm",variant:"outline",onClick:()=>i?i():null,children:v.jsx(st,{})})})]})})}var Fn="Dialog",[cg,dg]=ct(Fn),[VT,He]=cg(Fn),ug=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]=Sr({prop:n,defaultProp:a??!1,onChange:i,caller:Fn});return v.jsx(VT,{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})};ug.displayName=Fn;var pg="DialogTrigger",fg=T.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,a=He(pg,r),i=me(e,a.triggerRef);return v.jsx(he.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":Ll(a.open),...n,ref:i,onClick:ie(t.onClick,a.onOpenToggle)})});fg.displayName=pg;var Dl="DialogPortal",[HT,mg]=cg(Dl,{forceMount:void 0}),hg=t=>{const{__scopeDialog:e,forceMount:r,children:n,container:a}=t,i=He(Dl,e);return v.jsx(HT,{scope:e,forceMount:r,children:T.Children.map(n,o=>v.jsx(kt,{present:r||i.open,children:v.jsx(ul,{asChild:!0,container:a,children:o})}))})};hg.displayName=Dl;var $n="DialogOverlay",gg=T.forwardRef((t,e)=>{const r=mg($n,t.__scopeDialog),{forceMount:n=r.forceMount,...a}=t,i=He($n,t.__scopeDialog);return i.modal?v.jsx(kt,{present:n||i.open,children:v.jsx(KT,{...a,ref:e})}):null});gg.displayName=$n;var UT=xr("DialogOverlay.RemoveScroll"),KT=T.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,a=He($n,r);return v.jsx(bl,{as:UT,allowPinchZoom:!0,shards:[a.contentRef],children:v.jsx(he.div,{"data-state":Ll(a.open),...n,ref:e,style:{pointerEvents:"auto",...n.style}})})}),$t="DialogContent",vg=T.forwardRef((t,e)=>{const r=mg($t,t.__scopeDialog),{forceMount:n=r.forceMount,...a}=t,i=He($t,t.__scopeDialog);return v.jsx(kt,{present:n||i.open,children:i.modal?v.jsx(YT,{...a,ref:e}):v.jsx(XT,{...a,ref:e})})});vg.displayName=$t;var YT=T.forwardRef((t,e)=>{const r=He($t,t.__scopeDialog),n=T.useRef(null),a=me(e,r.contentRef,n);return T.useEffect(()=>{const i=n.current;if(i)return Vm(i)},[]),v.jsx(yg,{...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())})}),XT=T.forwardRef((t,e)=>{const r=He($t,t.__scopeDialog),n=T.useRef(!1),a=T.useRef(!1);return v.jsx(yg,{...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()}})}),yg=T.forwardRef((t,e)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:a,onCloseAutoFocus:i,...o}=t,s=He($t,r),l=T.useRef(null),c=me(e,l);return Qf(),v.jsxs(v.Fragment,{children:[v.jsx(Xs,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:a,onUnmountAutoFocus:i,children:v.jsx(Hs,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":Ll(s.open),...o,ref:c,onDismiss:()=>s.onOpenChange(!1)})}),v.jsxs(v.Fragment,{children:[v.jsx(QT,{titleId:s.titleId}),v.jsx(eA,{contentRef:l,descriptionId:s.descriptionId})]})]})}),zl="DialogTitle",bg=T.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,a=He(zl,r);return v.jsx(he.h2,{id:a.titleId,...n,ref:e})});bg.displayName=zl;var Sg="DialogDescription",xg=T.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,a=He(Sg,r);return v.jsx(he.p,{id:a.descriptionId,...n,ref:e})});xg.displayName=Sg;var wg="DialogClose",Cg=T.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,a=He(wg,r);return v.jsx(he.button,{type:"button",...n,ref:e,onClick:ie(t.onClick,()=>a.onOpenChange(!1))})});Cg.displayName=wg;function Ll(t){return t?"open":"closed"}var kg="DialogTitleWarning",[ZT,Eg]=sC(kg,{contentName:$t,titleName:zl,docsSlug:"dialog"}),QT=({titleId:t})=>{const e=Eg(kg),r=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users.
|
|
874
|
+
`)},rE=0,nr=[];function nE(t){var e=T.useRef([]),r=T.useRef([0,0]),n=T.useRef(),a=T.useState(rE++)[0],i=T.useState(Xm)[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=kk([t.lockRef.current],(t.shards||[]).map(nh),!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 w=Pn(m),x=r.current,h="deltaX"in m?m.deltaX:x[0]-w[0],b="deltaY"in m?m.deltaY:x[1]-w[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 C=window.getSelection(),_=C&&C.anchorNode,A=_?_===E||_.contains(E):!1;if(A)return!1;var I=Jm(k,E);if(!I)return!0;if(I?S=k:(S=k==="v"?"h":"v",I=Jm(k,E)),!I)return!1;if(!n.current&&"changedTouches"in m&&(h||b)&&(n.current=S),!S)return!0;var N=n.current||S;return Jk(N,g,m,N==="h"?h:b)},[]),l=T.useCallback(function(m){var g=m;if(!(!nr.length||nr[nr.length-1]!==i)){var w="deltaY"in g?rh(g):Pn(g),x=e.current.filter(function(S){return S.name===g.type&&(S.target===g.target||g.target===S.shadowParent)&&eE(S.delta,w)})[0];if(x&&x.should){g.cancelable&&g.preventDefault();return}if(!x){var h=(o.current.shards||[]).map(nh).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,w,x){var h={name:m,delta:g,target:w,should:x,shadowParent:aE(w)};e.current.push(h),setTimeout(function(){e.current=e.current.filter(function(b){return b!==h})},1)},[]),d=T.useCallback(function(m){r.current=Pn(m),n.current=void 0},[]),u=T.useCallback(function(m){c(m.type,rh(m),m.target,s(m,t.lockRef.current))},[]),p=T.useCallback(function(m){c(m.type,Pn(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,y=t.inert;return T.createElement(T.Fragment,null,y?T.createElement(i,{styles:tE(a)}):null,f?T.createElement(Hk,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function aE(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const iE=Mk(Ym,nE);var bl=T.forwardRef(function(t,e){return T.createElement(_n,tt({},t,{ref:e,sideCar:iE}))});bl.classNames=_n.classNames;var Sl=["Enter"," "],oE=["ArrowDown","PageUp","Home"],ah=["ArrowUp","PageDown","End"],sE=[...oE,...ah],lE={ltr:[...Sl,"ArrowRight"],rtl:[...Sl,"ArrowLeft"]},cE={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Er="Menu",[Tr,dE,uE]=$s(Er),[Bt,ih]=ct(Er,[uE,Om,Bm]),In=Om(),oh=Bm(),[pE,qt]=Bt(Er),[fE,Ar]=Bt(Er),sh=t=>{const{__scopeMenu:e,open:r=!1,children:n,dir:a,onOpenChange:i,modal:o=!0}=t,s=In(e),[l,c]=T.useState(null),d=T.useRef(!1),u=dt(i),p=Gs(a);return T.useEffect(()=>{const f=()=>{d.current=!0,document.addEventListener("pointerdown",y,{capture:!0,once:!0}),document.addEventListener("pointermove",y,{capture:!0,once:!0})},y=()=>d.current=!1;return document.addEventListener("keydown",f,{capture:!0}),()=>{document.removeEventListener("keydown",f,{capture:!0}),document.removeEventListener("pointerdown",y,{capture:!0}),document.removeEventListener("pointermove",y,{capture:!0})}},[]),v.jsx(tk,{...s,children:v.jsx(pE,{scope:e,open:r,onOpenChange:u,content:l,onContentChange:c,children:v.jsx(fE,{scope:e,onClose:T.useCallback(()=>u(!1),[u]),isUsingKeyboardRef:d,dir:p,modal:o,children:n})})})};sh.displayName=Er;var mE="MenuAnchor",xl=T.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t,a=In(r);return v.jsx(rk,{...a,...n,ref:e})});xl.displayName=mE;var wl="MenuPortal",[hE,lh]=Bt(wl,{forceMount:void 0}),ch=t=>{const{__scopeMenu:e,forceMount:r,children:n,container:a}=t,i=qt(wl,e);return v.jsx(hE,{scope:e,forceMount:r,children:v.jsx(kt,{present:r||i.open,children:v.jsx(ul,{asChild:!0,container:a,children:n})})})};ch.displayName=wl;var Re="MenuContent",[gE,Cl]=Bt(Re),dh=T.forwardRef((t,e)=>{const r=lh(Re,t.__scopeMenu),{forceMount:n=r.forceMount,...a}=t,i=qt(Re,t.__scopeMenu),o=Ar(Re,t.__scopeMenu);return v.jsx(Tr.Provider,{scope:t.__scopeMenu,children:v.jsx(kt,{present:n||i.open,children:v.jsx(Tr.Slot,{scope:t.__scopeMenu,children:o.modal?v.jsx(vE,{...a,ref:e}):v.jsx(yE,{...a,ref:e})})})})}),vE=T.forwardRef((t,e)=>{const r=qt(Re,t.__scopeMenu),n=T.useRef(null),a=me(e,n);return T.useEffect(()=>{const i=n.current;if(i)return Vm(i)},[]),v.jsx(kl,{...t,ref:a,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:ie(t.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),yE=T.forwardRef((t,e)=>{const r=qt(Re,t.__scopeMenu);return v.jsx(kl,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),bE=xr("MenuContent.ScrollLock"),kl=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:y,...m}=t,g=qt(Re,r),w=Ar(Re,r),x=In(r),h=oh(r),b=dE(r),[S,E]=T.useState(null),k=T.useRef(null),C=me(e,k,g.onContentChange),_=T.useRef(0),A=T.useRef(""),I=T.useRef(0),N=T.useRef(null),D=T.useRef("right"),q=T.useRef(0),H=y?bl:T.Fragment,L=y?{as:bE,allowPinchZoom:!0}:void 0,F=P=>{const j=A.current+P,Y=b().filter(K=>!K.disabled),Z=document.activeElement,W=Y.find(K=>K.ref.current===Z)?.textValue,z=Y.map(K=>K.textValue),B=IE(z,j,W),V=Y.find(K=>K.textValue===B)?.ref.current;(function K(se){A.current=se,window.clearTimeout(_.current),se!==""&&(_.current=window.setTimeout(()=>K(""),1e3))})(j),V&&setTimeout(()=>V.focus())};T.useEffect(()=>()=>window.clearTimeout(_.current),[]),Qf();const R=T.useCallback(P=>D.current===N.current?.side&&ME(P,N.current?.area),[]);return v.jsx(gE,{scope:r,searchRef:A,onItemEnter:T.useCallback(P=>{R(P)&&P.preventDefault()},[R]),onItemLeave:T.useCallback(P=>{R(P)||(k.current?.focus(),E(null))},[R]),onTriggerLeave:T.useCallback(P=>{R(P)&&P.preventDefault()},[R]),pointerGraceTimerRef:I,onPointerGraceIntentChange:T.useCallback(P=>{N.current=P},[]),children:v.jsx(H,{...L,children:v.jsx(Xs,{asChild:!0,trapped:a,onMountAutoFocus:ie(i,P=>{P.preventDefault(),k.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:v.jsx(Hs,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:u,onInteractOutside:p,onDismiss:f,children:v.jsx(bk,{asChild:!0,...h,dir:w.dir,orientation:"vertical",loop:n,currentTabStopId:S,onCurrentTabStopIdChange:E,onEntryFocus:ie(l,P=>{w.isUsingKeyboardRef.current||P.preventDefault()}),preventScrollOnEntryFocus:!0,children:v.jsx(nk,{role:"menu","aria-orientation":"vertical","data-state":Ah(g.open),"data-radix-menu-content":"",dir:w.dir,...x,...m,ref:C,style:{outline:"none",...m.style},onKeyDown:ie(m.onKeyDown,P=>{const Y=P.target.closest("[data-radix-menu-content]")===P.currentTarget,Z=P.ctrlKey||P.altKey||P.metaKey,W=P.key.length===1;Y&&(P.key==="Tab"&&P.preventDefault(),!Z&&W&&F(P.key));const z=k.current;if(P.target!==z||!sE.includes(P.key))return;P.preventDefault();const V=b().filter(K=>!K.disabled).map(K=>K.ref.current);ah.includes(P.key)&&V.reverse(),OE(V)}),onBlur:ie(t.onBlur,P=>{P.currentTarget.contains(P.target)||(window.clearTimeout(_.current),A.current="")}),onPointerMove:ie(t.onPointerMove,Or(P=>{const j=P.target,Y=q.current!==P.clientX;if(P.currentTarget.contains(j)&&Y){const Z=P.clientX>q.current?"right":"left";D.current=Z,q.current=P.clientX}}))})})})})})})});dh.displayName=Re;var SE="MenuGroup",El=T.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t;return v.jsx(he.div,{role:"group",...n,ref:e})});El.displayName=SE;var xE="MenuLabel",uh=T.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t;return v.jsx(he.div,{...n,ref:e})});uh.displayName=xE;var Nn="MenuItem",ph="menu.itemSelect",Mn=T.forwardRef((t,e)=>{const{disabled:r=!1,onSelect:n,...a}=t,i=T.useRef(null),o=Ar(Nn,t.__scopeMenu),s=Cl(Nn,t.__scopeMenu),l=me(e,i),c=T.useRef(!1),d=()=>{const u=i.current;if(!r&&u){const p=new CustomEvent(ph,{bubbles:!0,cancelable:!0});u.addEventListener(ph,f=>n?.(f),{once:!0}),Uf(u,p),p.defaultPrevented?c.current=!1:o.onClose()}};return v.jsx(fh,{...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===" "||Sl.includes(u.key)&&(u.currentTarget.click(),u.preventDefault())})})});Mn.displayName=Nn;var fh=T.forwardRef((t,e)=>{const{__scopeMenu:r,disabled:n=!1,textValue:a,...i}=t,o=Cl(Nn,r),s=oh(r),l=T.useRef(null),c=me(e,l),[d,u]=T.useState(!1),[p,f]=T.useState("");return T.useEffect(()=>{const y=l.current;y&&f((y.textContent??"").trim())},[i.children]),v.jsx(Tr.ItemSlot,{scope:r,disabled:n,textValue:a??p,children:v.jsx(Sk,{asChild:!0,...s,focusable:!n,children:v.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,Or(y=>{n?o.onItemLeave(y):(o.onItemEnter(y),y.defaultPrevented||y.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ie(t.onPointerLeave,Or(y=>o.onItemLeave(y))),onFocus:ie(t.onFocus,()=>u(!0)),onBlur:ie(t.onBlur,()=>u(!1))})})})}),wE="MenuCheckboxItem",mh=T.forwardRef((t,e)=>{const{checked:r=!1,onCheckedChange:n,...a}=t;return v.jsx(bh,{scope:t.__scopeMenu,checked:r,children:v.jsx(Mn,{role:"menuitemcheckbox","aria-checked":Dn(r)?"mixed":r,...a,ref:e,"data-state":Al(r),onSelect:ie(a.onSelect,()=>n?.(Dn(r)?!0:!r),{checkForDefaultPrevented:!1})})})});mh.displayName=wE;var hh="MenuRadioGroup",[CE,kE]=Bt(hh,{value:void 0,onValueChange:()=>{}}),gh=T.forwardRef((t,e)=>{const{value:r,onValueChange:n,...a}=t,i=dt(n);return v.jsx(CE,{scope:t.__scopeMenu,value:r,onValueChange:i,children:v.jsx(El,{...a,ref:e})})});gh.displayName=hh;var vh="MenuRadioItem",yh=T.forwardRef((t,e)=>{const{value:r,...n}=t,a=kE(vh,t.__scopeMenu),i=r===a.value;return v.jsx(bh,{scope:t.__scopeMenu,checked:i,children:v.jsx(Mn,{role:"menuitemradio","aria-checked":i,...n,ref:e,"data-state":Al(i),onSelect:ie(n.onSelect,()=>a.onValueChange?.(r),{checkForDefaultPrevented:!1})})})});yh.displayName=vh;var Tl="MenuItemIndicator",[bh,EE]=Bt(Tl,{checked:!1}),Sh=T.forwardRef((t,e)=>{const{__scopeMenu:r,forceMount:n,...a}=t,i=EE(Tl,r);return v.jsx(kt,{present:n||Dn(i.checked)||i.checked===!0,children:v.jsx(he.span,{...a,ref:e,"data-state":Al(i.checked)})})});Sh.displayName=Tl;var TE="MenuSeparator",xh=T.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t;return v.jsx(he.div,{role:"separator","aria-orientation":"horizontal",...n,ref:e})});xh.displayName=TE;var AE="MenuArrow",wh=T.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t,a=In(r);return v.jsx(ak,{...a,...n,ref:e})});wh.displayName=AE;var _E="MenuSub",[rI,Ch]=Bt(_E),_r="MenuSubTrigger",kh=T.forwardRef((t,e)=>{const r=qt(_r,t.__scopeMenu),n=Ar(_r,t.__scopeMenu),a=Ch(_r,t.__scopeMenu),i=Cl(_r,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]),v.jsx(xl,{asChild:!0,...c,children:v.jsx(fh,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":a.contentId,"data-state":Ah(r.open),...t,ref:br(e,a.onTriggerChange),onClick:u=>{t.onClick?.(u),!(t.disabled||u.defaultPrevented)&&(u.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:ie(t.onPointerMove,Or(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,Or(u=>{d();const p=r.content?.getBoundingClientRect();if(p){const f=r.content?.dataset.side,y=f==="right",m=y?-5:5,g=p[y?"left":"right"],w=p[y?"right":"left"];i.onPointerGraceIntentChange({area:[{x:u.clientX+m,y:u.clientY},{x:g,y:p.top},{x:w,y:p.top},{x:w,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===" "||lE[n.dir].includes(u.key)&&(r.onOpenChange(!0),r.content?.focus(),u.preventDefault())})})})});kh.displayName=_r;var Eh="MenuSubContent",Th=T.forwardRef((t,e)=>{const r=lh(Re,t.__scopeMenu),{forceMount:n=r.forceMount,...a}=t,i=qt(Re,t.__scopeMenu),o=Ar(Re,t.__scopeMenu),s=Ch(Eh,t.__scopeMenu),l=T.useRef(null),c=me(e,l);return v.jsx(Tr.Provider,{scope:t.__scopeMenu,children:v.jsx(kt,{present:n||i.open,children:v.jsx(Tr.Slot,{scope:t.__scopeMenu,children:v.jsx(kl,{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=cE[o.dir].includes(d.key);u&&p&&(i.onOpenChange(!1),s.trigger?.focus(),d.preventDefault())})})})})})});Th.displayName=Eh;function Ah(t){return t?"open":"closed"}function Dn(t){return t==="indeterminate"}function Al(t){return Dn(t)?"indeterminate":t?"checked":"unchecked"}function OE(t){const e=document.activeElement;for(const r of t)if(r===e||(r.focus(),document.activeElement!==e))return}function PE(t,e){return t.map((r,n)=>t[(e+n)%t.length])}function IE(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=PE(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 NE(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 ME(t,e){if(!e)return!1;const r={x:t.clientX,y:t.clientY};return NE(r,e)}function Or(t){return e=>e.pointerType==="mouse"?t(e):void 0}var DE=sh,zE=xl,LE=ch,jE=dh,WE=El,BE=uh,qE=Mn,RE=mh,FE=gh,$E=yh,GE=Sh,VE=xh,HE=wh,UE=kh,KE=Th,zn="DropdownMenu",[YE]=ct(zn,[ih]),Oe=ih(),[XE,_h]=YE(zn),Oh=t=>{const{__scopeDropdownMenu:e,children:r,dir:n,open:a,defaultOpen:i,onOpenChange:o,modal:s=!0}=t,l=Oe(e),c=T.useRef(null),[d,u]=Sr({prop:a,defaultProp:i??!1,onChange:o,caller:zn});return v.jsx(XE,{scope:e,triggerId:Yt(),triggerRef:c,contentId:Yt(),open:d,onOpenChange:u,onOpenToggle:T.useCallback(()=>u(p=>!p),[u]),modal:s,children:v.jsx(DE,{...l,open:d,onOpenChange:u,dir:n,modal:s,children:r})})};Oh.displayName=zn;var Ph="DropdownMenuTrigger",Ih=T.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...a}=t,i=_h(Ph,r),o=Oe(r);return v.jsx(zE,{asChild:!0,...o,children:v.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:br(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())})})})});Ih.displayName=Ph;var ZE="DropdownMenuPortal",Nh=t=>{const{__scopeDropdownMenu:e,...r}=t,n=Oe(e);return v.jsx(LE,{...n,...r})};Nh.displayName=ZE;var Mh="DropdownMenuContent",Dh=T.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,a=_h(Mh,r),i=Oe(r),o=T.useRef(!1);return v.jsx(jE,{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)"}})});Dh.displayName=Mh;var QE="DropdownMenuGroup",JE=T.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,a=Oe(r);return v.jsx(WE,{...a,...n,ref:e})});JE.displayName=QE;var eT="DropdownMenuLabel",zh=T.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,a=Oe(r);return v.jsx(BE,{...a,...n,ref:e})});zh.displayName=eT;var tT="DropdownMenuItem",Lh=T.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,a=Oe(r);return v.jsx(qE,{...a,...n,ref:e})});Lh.displayName=tT;var rT="DropdownMenuCheckboxItem",jh=T.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,a=Oe(r);return v.jsx(RE,{...a,...n,ref:e})});jh.displayName=rT;var nT="DropdownMenuRadioGroup",Wh=T.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,a=Oe(r);return v.jsx(FE,{...a,...n,ref:e})});Wh.displayName=nT;var aT="DropdownMenuRadioItem",Bh=T.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,a=Oe(r);return v.jsx($E,{...a,...n,ref:e})});Bh.displayName=aT;var iT="DropdownMenuItemIndicator",oT=T.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,a=Oe(r);return v.jsx(GE,{...a,...n,ref:e})});oT.displayName=iT;var sT="DropdownMenuSeparator",qh=T.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,a=Oe(r);return v.jsx(VE,{...a,...n,ref:e})});qh.displayName=sT;var lT="DropdownMenuArrow",cT=T.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,a=Oe(r);return v.jsx(HE,{...a,...n,ref:e})});cT.displayName=lT;var dT="DropdownMenuSubTrigger",Rh=T.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,a=Oe(r);return v.jsx(UE,{...a,...n,ref:e})});Rh.displayName=dT;var uT="DropdownMenuSubContent",Fh=T.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,a=Oe(r);return v.jsx(KE,{...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)"}})});Fh.displayName=uT;var pT=Oh,fT=Ih,mT=Nh,$h=Dh,Gh=zh,Vh=Lh,Hh=jh,hT=Wh,Uh=Bh,Kh=qh,Yh=Rh,Xh=Fh;const Ln=pT,jn=fT,gT=hT,vT=T.forwardRef(({className:t,inset:e,children:r,...n},a)=>v.jsx(Yh,{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}));vT.displayName=Yh.displayName;const yT=T.forwardRef(({className:t,...e},r)=>v.jsx(Xh,{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}));yT.displayName=Xh.displayName;const Pr=T.forwardRef(({className:t,sideOffset:e=4,...r},n)=>{const{portalContainer:a}=Ls();return v.jsx(mT,{container:a||void 0,children:v.jsx($h,{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})})});Pr.displayName=$h.displayName;const Rt=T.forwardRef(({className:t,inset:e,...r},n)=>v.jsx(Vh,{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}));Rt.displayName=Vh.displayName;const bT=T.forwardRef(({className:t,children:e,checked:r,...n},a)=>v.jsx(Hh,{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}));bT.displayName=Hh.displayName;const Zh=T.forwardRef(({className:t,children:e,...r},n)=>v.jsx(Uh,{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}));Zh.displayName=Uh.displayName;const _l=T.forwardRef(({className:t,inset:e,...r},n)=>v.jsx(Gh,{ref:n,className:pe("px-2 py-1.5 text-sm font-medium",e&&"pl-8",t),...r}));_l.displayName=Gh.displayName;const Wn=T.forwardRef(({className:t,...e},r)=>v.jsx(Kh,{ref:r,className:pe("-mx-1 my-1 h-px bg-gray-200",t),...e}));Wn.displayName=Kh.displayName;const ST=(t,e)=>{if(t.stopPropagation(),e.onSelect){e.onSelect(t);return}e.dialog&&typeof window<"u"&&window.$uhuu?.editDialog?.(e.dialog)},Ol=(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 v.jsx("div",{className:pe("pointer-events-none absolute inset-0 z-10",e),"aria-hidden":"true",dangerouslySetInnerHTML:{__html:a}})}return v.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)})},Pl=(t,e)=>e?v.jsx("div",{className:"absolute right-2 top-2 z-20",children:v.jsxs(Ln,{modal:!1,children:[v.jsx(jn,{asChild:!0,children:v.jsx(ke,{variant:"secondary",size:"icon",title:"Image options",className:"h-7 w-7 shadow-sm",onPointerDown:r=>r.stopPropagation(),onClick:r=>r.stopPropagation(),children:v.jsx(hf,{className:"h-4 w-4"})})}),v.jsx(Pr,{className:"w-40 p-1.5",align:"end",children:t.map(r=>v.jsxs(Rt,{onSelect:n=>ST(n,r),disabled:r.disabled,children:[r.icon&&v.jsx("span",{className:"mr-2 inline-flex",children:r.icon}),v.jsx("span",{children:r.label})]},r.id))})]})}):null,Il=(t=[])=>{const e=Ws();return t.length>0&&!e},xT=({className:t,style:e,overlaySvg:r,overlayClassName:n,options:a=[],dialog:i,dialogProps:o,bleedProps:s,children:l})=>{const c=O.useContext(zt),d=Il(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 y=u[f],m=o[f];f.startsWith("on")&&typeof y=="function"&&typeof m=="function"&&(p[f]=g=>{y(g),m(g)})}),p},[u,o]),v.jsxs(v.Fragment,{children:[v.jsxs(Ds,{...s,dialog:i,children:[Ol(r,n),l]}),Pl(a,d)]})};function Nl(t){const e=O.useContext(zt),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,y=N=>`${N}mm`,m=()=>{let N=l;return l?!d&&!u&&(N+=r):(N=2*n,d||(N+=2*r),u||(N+=2*r),(d||u)&&(N-=(d??0)+(u??0))),N},g=()=>{let N=c;return c?!p&&!f&&(N+=r):(N=a,p||(N+=r),f||(N+=r),(p||f)&&(N-=(p??0)+(f??0))),N},w=m(),x=g(),h=N=>N!==void 0?y(N):void 0,b=N=>Object.fromEntries(Object.entries(N).filter(([D,q])=>q!==void 0)),S=d>0?d+r:0,E=p>0?p+r:0,k=f>0?f+r:0,C=-1*n+S,_=p>0&&f>0,A=b({backgroundColor:s,width:h(w),..._?{height:h(x)}:{},left:h(S),top:h(E),bottom:h(k)}),I=b({width:h(w),..._?{height:h(x)}:{},left:h(C),top:h(E),bottom:h(k)});return v.jsx("div",{className:"uhuu-image-container",style:o=="end"?I:A,...t.dataUhuu!==void 0?{"data-uhuu":t.dataUhuu}:{},children:v.jsxs("div",{className:"uhuu-image-inner",...Kt(t,e),children:[v.jsx("img",{className:"cover-image",src:i||null}),t.children]})})}const wT=({overlaySvg:t,overlayClassName:e,options:r=[],dialog:n,spreadProps:a,children:i})=>{const o=Il(r);return v.jsxs(v.Fragment,{children:[v.jsxs(Nl,{...a,dialog:n,children:[Ol(t,e),i]}),Pl(r,o)]})},CT=({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:y})=>{const m=O.useContext(zt),g=c?Kt({dialog:c},m):{},w=Il(l),x=T.useMemo(()=>{if(!d)return g;const C={...g,...d};return(g.className||d.className)&&(C.className=pe(g.className,d.className)),Object.keys(g).forEach(_=>{const A=g[_],I=d[_];_.startsWith("on")&&typeof A=="function"&&typeof I=="function"&&(C[_]=N=>{A(N),I(N)})}),C},[g,d]),h=()=>{const C=f?.className,_=f?.style,A=f?.src??t,I=f?.alt??e,N={...f,src:A,alt:I,className:pe("h-full w-full object-cover",n,C),style:{...i,..._}};return y?y(N):A?v.jsx("img",{...N}):u??null},b=x["data-uhuu"],S=T.Children.toArray(p).some(C=>T.isValidElement(C)?C.type===Nl||C.type===Ds:!1);S&&delete x["data-uhuu"];const E=T.Children.map(p,C=>T.isValidElement(C)?T.cloneElement(C,{dataUhuu:b}):C),k=S?"relative h-full w-full":"relative";return v.jsxs("div",{className:pe(k,r),style:a,children:[v.jsxs("div",{className:"relative h-full w-full",...x,children:[h(),E,Ol(o,s)]}),Pl(l,w)]})},kT=t=>{const{computedOverlaySvg:e,computedOptions:r,computedDirectDialog:n}=O.useMemo(()=>{const{annotation:H,dialog:L,overlaySvg:F,options:R,src:P}=t;if(!H&&!L)return{computedOverlaySvg:F,computedOptions:R,computedDirectDialog:void 0};const j=H?.value||{},Y=F??j.annotationSvg??"",Z=[];if(H){if(L){const $={...L};if(L.type==="satellite"){const{path:X,type:oe,...le}=L;$.config={...le,path:"image"},$.path=X,$.type=oe}Z.push({id:"edit",label:"Edit image",dialog:$})}const B=Array.isArray(j.annotations)?j.annotations:[],{path:V,value:K,annotations:se,...re}=H,M={path:H.path,type:"annotation",image:P,annotations:B,...re};Z.push({id:"annotate",label:"Annotate",dialog:M})}const W=R?[...Z,...R]:Z;let z;if(L){const B={...L};if(L.type==="satellite"){const{path:V,type:K,...se}=L;B.config={...se,path:"image"},B.path=V,B.type=K}z=B}return{computedOverlaySvg:Y,computedOptions:W.length>0?W:void 0,computedDirectDialog:z}},[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:y,width:m,height:g,left:w,right:x,top:h,bottom:b,pageWidth:S,pageHeight:E,bleed:k,overlayClassName:C,dialogProps:_,placeholder:A,children:I,imageProps:N,renderImage:D}=t,q={src:l,backgroundColor:y,width:m,height:g,left:w,right:x,top:h,bottom:b,pageWidth:S,pageHeight:E,bleed:k};if(a==="auto")return v.jsx(CT,{src:l,alt:c,className:d,style:p,imageClassName:u,imageStyle:f,overlaySvg:e,overlayClassName:C,options:r,dialog:n,dialogProps:_,placeholder:A,children:I,imageProps:N,renderImage:D});if(a==="spread"){const H={...q,side:s};return i&&(e||r?.length||n)?v.jsx(wT,{className:d,style:p,overlaySvg:e,overlayClassName:C,options:r,dialog:n,dialogProps:_,spreadProps:H,children:I}):v.jsx(Nl,{...H})}return i&&(e||r?.length||n)?v.jsx(xT,{className:d,style:p,overlaySvg:e,overlayClassName:C,options:r,dialog:n,dialogProps:_,bleedProps:q,children:I}):v.jsx(Ds,{...q})},ET=t=>{const e=O.useContext(zt);return v.jsx("div",{className:t.className,...Kt(t,e),children:t.children})},Ft="uhuu_page_editor";function Pe(t){return t.kind==="group"}function TT(t){const e=[];let r=1;for(const n of t)if(Pe(n))for(const a of n.pages)e.push({...a,kind:"page",pageNum:r++});else e.push({...n,pageNum:r++});return e}function AT(t){const e=[];let r=1;for(const n of t)if(Pe(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 Et(t){return TT(t).length}function _T(t){return t.map(e=>{const r=e.strictPosition;if(Pe(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 OT(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 Ml(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 Qh(t,e=Ft){const r=Ml(t);return{key:e,items:r,totalPages:Et(r),updatedAt:new Date().toISOString()}}function PT(t,e=Ft){const r=t?.[e];if(!r?.items)return null;const n=Ml(r.items);return{key:e,items:n,totalPages:Et(n),updatedAt:r.updatedAt||new Date().toISOString()}}function IT(t,e,r=Ft){const n=Qh(e,r);return{...t??{},[r]:n}}function Jh(){return Math.random().toString(36).slice(2,11)}function eg(t,e,r){return{kind:"page",id:r?.repeatable?Jh():t,componentKey:e,templateId:t,label:r?.label,repeatable:r?.repeatable,maxInstances:r?.maxInstances,...r}}function tg(t,e,r){const n=r?.repeatable?Jh():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 rg(t,e){return t<0?e+t+1:t}function ng(t,e,r){for(const n of e){const a=rg(n.start,r),i=rg(n.end,r);if(t>=a&&t<=i)return!0}return!1}function NT(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 MT(t,e){if(!e||e.mode==="all")return t;const r=Et(t),n=e.mode??"all",a=e.coverPageCount??2,i=n==="custom"&&e.ranges?e.ranges:NT(n,r,a);if(i.length===0)return[];const o=[];for(const s of t)if(Pe(s)){const l=s.pages.filter(c=>c.pageNum&&ng(c.pageNum,i,r));l.length>0&&o.push({...s,pages:l})}else s.pageNum&&ng(s.pageNum,i,r)&&o.push(s);return o}function ag(t,e){if(t?.integrations)return t.integrations[e]}function DT(t,e){return e&&Pe(e)?e.id:t?.id??null}function ig(t,e,r){const n=DT(e,r);return n?{instanceId:n,integration:ag(t,n)}:{instanceId:null,integration:void 0}}function og(t,e,r){return ig(t,e,r).integration}function sg(t,e){if(!t)return null;const r=`integrations.${t}`;return e?`${r}.${e}`:r}function zT(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 LT(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 jT(t,e,r){const n=zT(e);if(!n.isIntegrationPath||!n.instanceId)return t;const{instanceId:a,fieldPath:i}=n,o=ag(t,a)||{},s=LT(o,i,r);return{...t,integrations:{...t?.integrations||{},[a]:s}}}function Bn(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 Ir=T.createContext(null);function WT(t=Ft){return[t]}function BT(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 lg({payload:t,onPayloadChange:e,children:r,stateKey:n=Ft}){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(C=>{try{return JSON.stringify(C)}catch{return String(C)}},[]),p=T.useMemo(()=>WT(n),[n]),f=T.useCallback((C,_)=>{if(!C)return null;const A={...C};return _.forEach(I=>{delete A[I]}),A},[]);T.useEffect(()=>{if(d.current){d.current=!1,t&&(o.current=t,i(t));return}if(s.current){s.current=!1;const A=l.current!==null?u(f(l.current,p)):null,I=u(f(t,p));if(A!==null&&A===I){o.current=t;return}}if(t===o.current)return;if(Date.now()-c.current<500&&l.current!==null){const A=f(t,p),I=f(l.current,p),N=A?u(A):null,D=I?u(I):null;if(N&&N===D){l.current=null,o.current=t;return}}o.current=t,i(A=>t?BT(A,t,p):A)},[t,p,u,f]);const y=T.useCallback(C=>{if(e?.(C),typeof window>"u")return;const _=window.$uhuu;_?.emitPayload&&_.emitPayload(C)},[e]),m=T.useCallback(C=>{s.current=!0,i(_=>{const A=typeof C=="function"?C(_):C;let I=A;return A&&typeof A=="object"&&Object.keys(A).filter(D=>D.startsWith("integrations.")||D==="integrations").length>0&&A.integrations&&(I=A),l.current=I,c.current=Date.now(),y(I),I})},[y]),g=T.useCallback((C,_,A)=>{m(I=>({...I??{},pages:{...I?.pages??{},[C]:{...I?.pages?.[C]??{},[_]:A}}}))},[m]),w=T.useCallback((C,_)=>{m(A=>{const I=A?.integrations??{},N=I[C],D=typeof _=="function"?_(N):_;return{...A??{},integrations:{...I,[C]:D}}})},[m]),x=T.useCallback((C,_,A)=>{w(C,I=>({...I??{},[_]:A}))},[w]),h=T.useCallback(C=>{m(_=>{if(!_?.integrations||!_.integrations[C])return _;const{[C]:A,...I}=_.integrations;return{..._,integrations:Object.keys(I).length>0?I:void 0}})},[m]),b=T.useCallback((C,_)=>{m(A=>jT(A,C,_))},[m]),S=T.useCallback((C,_)=>{const A=_??n;m(I=>IT(I,C,A))},[m,n]),E=T.useCallback(C=>Bn(a,C),[a]),k=T.useMemo(()=>({payload:a,setPayload:m,setPageOptionValue:g,setIntegrationPayload:w,setIntegrationPayloadValue:x,removeIntegrationPayload:h,updateIntegrationByDialogPath:b,mergePageEditorState:S,getPagePayload:E}),[a,m,g,w,x,h,b,S,E]);return v.jsx(Ir.Provider,{value:k,children:r})}function qT(t){return t.defaultValue!==void 0?t.defaultValue:t.type==="toggle"?!1:t.type==="slider"||t.type==="counter"?0:""}function RT(t,e){return t.type==="toggle"?e===!0||e==="true":t.type==="slider"||t.type==="counter"?Number(e):e}function FT(t,e,r){const n=t.field??t.id;return{...t,getValue:i=>{const o=e?.pages?.[i.id]?.[n];return o===void 0?qT(t):t.type==="toggle"?!!o:o},onChange:(i,o)=>{r(i,n,RT(t,o))}}}const qn=O.createContext({zoom:100,scaleValue:1,hideUI:!1});function $T({children:t,layout:e="spread"}){const{scaleValue:r}=O.useContext(qn),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]),v.jsx("div",{ref:n,className:`two-pages-pair two-pages-pair--${e}`,children:t})}function Rn({children:t,title:e,className:r="",controls:n,origin:a="center"}){const{scaleValue:i,hideUI:o}=O.useContext(qn),s=O.useRef(null),[l,c]=O.useState(0),[d,u]=O.useState(0);O.useEffect(()=>{if(s.current){const w=()=>{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)}};w();const x=new ResizeObserver(w);return x.observe(s.current),()=>{x.disconnect()}}},[t]);const p=l*i,f=Math.max(d*i,150),y={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}=y[a];return o?v.jsx("div",{className:r,children:t}):v.jsxs("div",{className:`group/section ${r}`,style:{width:`${f}px`,minWidth:"150px"},children:[v.jsx("div",{children:n??v.jsx("div",{className:"px-4 py-2 border-b border-gray-200",children:v.jsxs("div",{className:"text-sm font-medium text-gray-700",children:[e," Controls"]})})}),v.jsx("div",{className:"pt-1",style:{height:p>0?`${p+32}px`:"auto",minHeight:"100px"},children:v.jsx("div",{className:`flex items-start ${m}`,children:v.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 GT({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=Ws(),d=s??c,[u,p]=O.useState(r),[f,y]=O.useState("none"),m=O.useRef(null),g=O.useRef(null),[w,x]=O.useState(!1),[h,b]=O.useState(0),[S,E]=O.useState(!0),k=N=>{if(!m.current||!g.current)return u;const D=m.current.getBoundingClientRect(),q=g.current.querySelector("[data-section-content]");if(!q)return u;let H=Number.parseInt(q.getAttribute("data-natural-width")||"0");const L=Number.parseInt(q.getAttribute("data-natural-height")||"0");if(H===0||L===0)return u;l==="two_pages"&&(H=H*2);const F=D.width-32,R=screen.height-120,P=F/H*100,j=R/L*100;switch(N){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}},C=N=>{if(y(N),N!=="none"){const D=k(N);p(D)}},_=()=>{const N=Math.min(u+25,a);p(N),y("none")},A=()=>{const N=Math.max(u-25,n);p(N),y("none")};O.useEffect(()=>{const N=()=>{if(!m.current||!g.current)return;const H=m.current.getBoundingClientRect().width;if(!w){const L=g.current.querySelector("[data-section-content]");if(L){const F=Number.parseInt(L.getAttribute("data-natural-width")||"0");if(F>0){if(F>H-48){const R=k("both");y("both"),p(R)}x(!0),b(H),E(!1);return}}if(S){setTimeout(N,50);return}}E(!1)},D=()=>{if(!m.current||S)return;const H=m.current.getBoundingClientRect().width;if(Math.abs(H-h)>10){if(f!=="none"){const L=k(f);p(L)}b(H)}};return N(),window.addEventListener("resize",D),()=>{window.removeEventListener("resize",D)}},[f,n,a,w,h,S]);const I=u/100;return d?v.jsx(qn.Provider,{value:{zoom:100,scaleValue:1,hideUI:!0},children:v.jsx("div",{className:e,children:t})}):v.jsx(qn.Provider,{value:{zoom:u,scaleValue:I,hideUI:!1},children:v.jsxs("div",{ref:m,className:`flex flex-col min-h-0 ${e}`,children:[v.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,v.jsx("div",{className:"h-4 w-px bg-gray-200 mx-0.5"}),v.jsxs(Ln,{modal:!1,children:[v.jsx(jn,{asChild:!0,children:v.jsxs(ke,{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),"%",v.jsx(ow,{className:"w-3 h-3 ml-1 opacity-60"})]})}),v.jsxs(Pr,{className:"w-52 p-1.5",align:"end",children:[v.jsxs(Rt,{onClick:()=>C("width"),className:`cursor-pointer flex items-center ${f==="width"?"bg-gray-100":""}`,children:[v.jsx(pw,{className:"w-4 h-4 mr-2"}),v.jsx("span",{children:"Fit to Width"})]}),v.jsxs(Rt,{onClick:()=>C("height"),className:`cursor-pointer flex items-center ${f==="height"?"bg-gray-100":""}`,children:[v.jsx(fw,{className:"w-4 h-4 mr-2"}),v.jsx("span",{children:"Fit to Height"})]}),v.jsxs(Rt,{onClick:()=>C("both"),className:`cursor-pointer flex items-center ${f==="both"?"bg-gray-100":""}`,children:[v.jsx(lw,{className:"w-4 h-4 mr-2"}),v.jsx("span",{children:"Fit to Page"})]}),v.jsx(Wn,{className:"my-1.5"}),v.jsxs("div",{className:"flex items-center justify-center gap-2 px-3 py-2.5",onClick:N=>N.stopPropagation(),children:[v.jsx(ke,{variant:"ghost",size:"sm",onClick:N=>{N.stopPropagation(),A()},disabled:u<=n,className:"h-8 w-8 p-0 hover:bg-gray-100 disabled:opacity-40",title:"Zoom out (25%)",children:v.jsx(hw,{className:"w-4 h-4"})}),v.jsxs("div",{className:"relative",children:[v.jsx("input",{type:"number",value:Math.round(u),onChange:N=>{const D=Number.parseInt(N.target.value);if(!isNaN(D)){const q=Math.min(Math.max(D,n),a);p(q),y("none")}},onFocus:N=>N.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}),v.jsx("span",{className:"absolute right-2 top-1/2 -translate-y-1/2 text-xs text-gray-400 pointer-events-none",children:"%"})]}),v.jsx(ke,{variant:"ghost",size:"sm",onClick:N=>{N.stopPropagation(),_()},disabled:u>=a,className:"h-8 w-8 p-0 hover:bg-gray-100 disabled:opacity-40",title:"Zoom in (25%)",children:v.jsx(mw,{className:"w-4 h-4"})})]})]})]})]}),v.jsx("div",{ref:g,children:v.jsx("div",{className:l==="two_pages"?"group_two_pages":"flex flex-col items-center",children:t})}),v.jsx("div",{className:"flex justify-center pb-16",children:v.jsx(ke,{size:"sm",variant:"outline",onClick:()=>i?i():null,children:v.jsx(st,{})})})]})})}var Fn="Dialog",[cg,dg]=ct(Fn),[VT,He]=cg(Fn),ug=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]=Sr({prop:n,defaultProp:a??!1,onChange:i,caller:Fn});return v.jsx(VT,{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})};ug.displayName=Fn;var pg="DialogTrigger",fg=T.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,a=He(pg,r),i=me(e,a.triggerRef);return v.jsx(he.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":Ll(a.open),...n,ref:i,onClick:ie(t.onClick,a.onOpenToggle)})});fg.displayName=pg;var Dl="DialogPortal",[HT,mg]=cg(Dl,{forceMount:void 0}),hg=t=>{const{__scopeDialog:e,forceMount:r,children:n,container:a}=t,i=He(Dl,e);return v.jsx(HT,{scope:e,forceMount:r,children:T.Children.map(n,o=>v.jsx(kt,{present:r||i.open,children:v.jsx(ul,{asChild:!0,container:a,children:o})}))})};hg.displayName=Dl;var $n="DialogOverlay",gg=T.forwardRef((t,e)=>{const r=mg($n,t.__scopeDialog),{forceMount:n=r.forceMount,...a}=t,i=He($n,t.__scopeDialog);return i.modal?v.jsx(kt,{present:n||i.open,children:v.jsx(KT,{...a,ref:e})}):null});gg.displayName=$n;var UT=xr("DialogOverlay.RemoveScroll"),KT=T.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,a=He($n,r);return v.jsx(bl,{as:UT,allowPinchZoom:!0,shards:[a.contentRef],children:v.jsx(he.div,{"data-state":Ll(a.open),...n,ref:e,style:{pointerEvents:"auto",...n.style}})})}),$t="DialogContent",vg=T.forwardRef((t,e)=>{const r=mg($t,t.__scopeDialog),{forceMount:n=r.forceMount,...a}=t,i=He($t,t.__scopeDialog);return v.jsx(kt,{present:n||i.open,children:i.modal?v.jsx(YT,{...a,ref:e}):v.jsx(XT,{...a,ref:e})})});vg.displayName=$t;var YT=T.forwardRef((t,e)=>{const r=He($t,t.__scopeDialog),n=T.useRef(null),a=me(e,r.contentRef,n);return T.useEffect(()=>{const i=n.current;if(i)return Vm(i)},[]),v.jsx(yg,{...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())})}),XT=T.forwardRef((t,e)=>{const r=He($t,t.__scopeDialog),n=T.useRef(!1),a=T.useRef(!1);return v.jsx(yg,{...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()}})}),yg=T.forwardRef((t,e)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:a,onCloseAutoFocus:i,...o}=t,s=He($t,r),l=T.useRef(null),c=me(e,l);return Qf(),v.jsxs(v.Fragment,{children:[v.jsx(Xs,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:a,onUnmountAutoFocus:i,children:v.jsx(Hs,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":Ll(s.open),...o,ref:c,onDismiss:()=>s.onOpenChange(!1)})}),v.jsxs(v.Fragment,{children:[v.jsx(QT,{titleId:s.titleId}),v.jsx(eA,{contentRef:l,descriptionId:s.descriptionId})]})]})}),zl="DialogTitle",bg=T.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,a=He(zl,r);return v.jsx(he.h2,{id:a.titleId,...n,ref:e})});bg.displayName=zl;var Sg="DialogDescription",xg=T.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,a=He(Sg,r);return v.jsx(he.p,{id:a.descriptionId,...n,ref:e})});xg.displayName=Sg;var wg="DialogClose",Cg=T.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,a=He(wg,r);return v.jsx(he.button,{type:"button",...n,ref:e,onClick:ie(t.onClick,()=>a.onOpenChange(!1))})});Cg.displayName=wg;function Ll(t){return t?"open":"closed"}var kg="DialogTitleWarning",[ZT,Eg]=sC(kg,{contentName:$t,titleName:zl,docsSlug:"dialog"}),QT=({titleId:t})=>{const e=Eg(kg),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
|
|