@kodezen/editor 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +120 -119
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,145 +1,146 @@
1
- import{forwardRef as $0,useImperativeHandle as U0,useRef as Z0}from"react";var po={version:2,groups:[{key:"content",label:"Content"},{key:"style",label:"Style"},{key:"spacing",label:"Spacing"},{key:"border",label:"Border"},{key:"effects",label:"Effects"},{key:"advanced",label:"Advanced"}],blocks:{email:{name:"Email",root:!0,category:"structure",attributes:{bgColor:{type:"color",default:"#F1F5F9",group:"style",label:"Page background"},contentBg:{type:"color",default:"#FFFFFF",group:"style",label:"Content background"},fontFamily:{type:"string",default:"Arial, sans-serif",group:"style",label:"Default font family"},contentWidth:{type:"number",default:600,min:320,max:800,group:"spacing",label:"Content width"},padding:{type:"spacing",default:[40,20,40,20],group:"spacing",label:"Content padding"},contentBorder:{type:"border",group:"border",label:"Content border",default:{width:0,style:"solid",color:"#E2E8F0",radius:0}},contentBoxShadow:{type:"boxShadow",group:"effects",label:"Content shadow",default:{enabled:!1,x:0,y:2,blur:8,spread:0,color:"rgba(0,0,0,.08)",inset:!1}}}},heading:{name:"Heading",category:"content",attributes:{text:{type:"richtext",default:"Your heading",group:"content",label:"Text"},tag:{type:"select",default:"h2",options:["h1","h2","h3","h4"],group:"content",label:"Tag"},alignment:{type:"alignment",default:"left",group:"style",label:"Alignment"},typography:{type:"typography",group:"style",label:"Typography",default:{fontFamily:"inherit",fontSize:24,fontWeight:"700",fontStyle:"normal",lineHeight:1.3,letterSpacing:0,textTransform:"none",textDecoration:"none",color:"#111111"}},padding:{type:"spacing",default:[0,0,0,0],group:"spacing",label:"Padding"},margin:{type:"spacing",default:[0,0,0,0],group:"spacing",label:"Margin"},border:{type:"border",group:"border",label:"Border",default:{width:0,style:"solid",color:"#000000",radius:0}}}},text:{name:"Text",category:"content",attributes:{text:{type:"richtext",default:"Type your text here.",group:"content",label:"Text"},alignment:{type:"alignment",default:"left",group:"style",label:"Alignment"},typography:{type:"typography",group:"style",label:"Typography",default:{fontFamily:"inherit",fontSize:14,fontWeight:"400",fontStyle:"normal",lineHeight:1.6,letterSpacing:0,textTransform:"none",textDecoration:"none",color:"#333333"}},padding:{type:"spacing",default:[0,0,0,0],group:"spacing",label:"Padding"},margin:{type:"spacing",default:[0,0,0,0],group:"spacing",label:"Margin"},border:{type:"border",group:"border",label:"Border",default:{width:0,style:"solid",color:"#000000",radius:0}}}},button:{name:"Button",category:"content",attributes:{text:{type:"string",default:"Click here",group:"content",label:"Label"},href:{type:"url",default:"#",group:"content",label:"Link URL"},openInNewTab:{type:"boolean",default:!0,group:"advanced",label:"Open in new tab"},noFollow:{type:"boolean",default:!1,group:"advanced",label:'Add rel="nofollow"'},alignment:{type:"alignment",default:"left",group:"style",label:"Alignment",options:["left","center","right"]},bg:{type:"color",default:"#0073e6",group:"style",label:"Background color"},typography:{type:"typography",group:"style",label:"Typography",default:{fontFamily:"inherit",fontSize:14,fontWeight:"600",fontStyle:"normal",lineHeight:1.2,letterSpacing:0,textTransform:"none",textDecoration:"none",color:"#FFFFFF"}},padding:{type:"spacing",default:[12,24,12,24],group:"spacing",label:"Padding"},margin:{type:"spacing",default:[0,0,0,0],group:"spacing",label:"Margin"},border:{type:"border",group:"border",label:"Border",default:{width:0,style:"solid",color:"#000000",radius:4}},boxShadow:{type:"boxShadow",group:"effects",label:"Box shadow",default:{enabled:!1,x:0,y:2,blur:4,spread:0,color:"rgba(0,0,0,.15)",inset:!1}}}},divider:{name:"Divider",category:"structure",attributes:{color:{type:"color",default:"#E2E8F0",group:"style",label:"Color"},thickness:{type:"number",default:1,min:1,max:10,group:"style",label:"Thickness (px)"},style:{type:"select",default:"solid",options:["solid","dashed","dotted","double"],group:"style",label:"Style"},width:{type:"number",default:100,min:10,max:100,group:"style",label:"Width (%)"},alignment:{type:"alignment",default:"left",options:["left","center","right"],group:"style",label:"Alignment"},padding:{type:"spacing",default:[16,0,16,0],group:"spacing",label:"Padding"}}},spacer:{name:"Spacer",category:"structure",attributes:{height:{type:"number",default:24,min:1,max:400,group:"content",label:"Height (px)"}}},image:{name:"Image",category:"media",attributes:{src:{type:"image",default:"https://via.placeholder.com/600x300",group:"content",label:"Image",media:!0},alt:{type:"string",default:"Image",group:"content",label:"Alt text"},href:{type:"url",default:"",group:"content",label:"Link URL (optional)"},openInNewTab:{type:"boolean",default:!0,group:"advanced",label:"Open link in new tab"},width:{type:"number",default:600,min:10,max:1e3,group:"style",label:"Max width (px)",hidden:!0},alignment:{type:"alignment",default:"left",options:["left","center","right"],group:"style",label:"Alignment"},padding:{type:"spacing",default:[0,0,0,0],group:"spacing",label:"Padding"},margin:{type:"spacing",default:[0,0,0,0],group:"spacing",label:"Margin"},border:{type:"border",group:"border",label:"Border",default:{width:0,style:"solid",color:"#000000",radius:0}}}},video:{name:"Video",category:"media",attributes:{thumbnail:{type:"url",default:"https://via.placeholder.com/600x340/0F172A/FFFFFF?text=%E2%96%B6%EF%B8%8E",group:"content",label:"Thumbnail URL",media:!0},videoUrl:{type:"url",default:"https://",group:"content",label:"Video page URL"},alt:{type:"string",default:"Watch video",group:"content",label:"Alt text"},caption:{type:"string",default:"\u25B6 Watch the video",group:"content",label:"Caption (optional)"},width:{type:"number",default:600,min:10,max:1e3,group:"style",label:"Max width (px)"},alignment:{type:"alignment",default:"left",options:["left","center","right"],group:"style",label:"Alignment"},padding:{type:"spacing",default:[0,0,0,0],group:"spacing",label:"Padding"}}},list:{name:"List",category:"content",attributes:{type:{type:"select",default:"unordered",options:["unordered","ordered"],group:"content",label:"Type"},items:{type:"richtext",default:`First item
1
+ import{forwardRef as G0,useImperativeHandle as K0,useRef as X0}from"react";var po={version:2,groups:[{key:"content",label:"Content"},{key:"style",label:"Style"},{key:"spacing",label:"Spacing"},{key:"border",label:"Border"},{key:"effects",label:"Effects"},{key:"advanced",label:"Advanced"}],blocks:{email:{name:"Email",root:!0,category:"structure",attributes:{bgColor:{type:"color",default:"#F1F5F9",group:"style",label:"Page background"},contentBg:{type:"color",default:"#FFFFFF",group:"style",label:"Content background"},fontFamily:{type:"string",default:"Arial, sans-serif",group:"style",label:"Default font family"},contentWidth:{type:"number",default:600,min:320,max:800,group:"spacing",label:"Content width"},padding:{type:"spacing",default:[40,20,40,20],group:"spacing",label:"Content padding"},contentBorder:{type:"border",group:"border",label:"Content border",default:{width:0,style:"solid",color:"#E2E8F0",radius:0}},contentBoxShadow:{type:"boxShadow",group:"effects",label:"Content shadow",default:{enabled:!1,x:0,y:2,blur:8,spread:0,color:"rgba(0,0,0,.08)",inset:!1}}}},heading:{name:"Heading",category:"content",attributes:{text:{type:"richtext",default:"Your heading",group:"content",label:"Text"},tag:{type:"select",default:"h2",options:["h1","h2","h3","h4"],group:"content",label:"Tag"},alignment:{type:"alignment",default:"left",group:"style",label:"Alignment"},typography:{type:"typography",group:"style",label:"Typography",default:{fontFamily:"inherit",fontSize:24,fontWeight:"700",fontStyle:"normal",lineHeight:1.3,letterSpacing:0,textTransform:"none",textDecoration:"none",color:"#111111"}},padding:{type:"spacing",default:[0,0,0,0],group:"spacing",label:"Padding"},margin:{type:"spacing",default:[0,0,0,0],group:"spacing",label:"Margin"},border:{type:"border",group:"border",label:"Border",default:{width:0,style:"solid",color:"#000000",radius:0}}}},text:{name:"Text",category:"content",attributes:{text:{type:"richtext",default:"Type your text here.",group:"content",label:"Text"},alignment:{type:"alignment",default:"left",group:"style",label:"Alignment"},typography:{type:"typography",group:"style",label:"Typography",default:{fontFamily:"inherit",fontSize:14,fontWeight:"400",fontStyle:"normal",lineHeight:1.6,letterSpacing:0,textTransform:"none",textDecoration:"none",color:"#333333"}},padding:{type:"spacing",default:[0,0,0,0],group:"spacing",label:"Padding"},margin:{type:"spacing",default:[0,0,0,0],group:"spacing",label:"Margin"},border:{type:"border",group:"border",label:"Border",default:{width:0,style:"solid",color:"#000000",radius:0}}}},button:{name:"Button",category:"content",attributes:{text:{type:"string",default:"Click here",group:"content",label:"Label"},href:{type:"url",default:"#",group:"content",label:"Link URL"},openInNewTab:{type:"boolean",default:!0,group:"advanced",label:"Open in new tab"},noFollow:{type:"boolean",default:!1,group:"advanced",label:'Add rel="nofollow"'},alignment:{type:"alignment",default:"left",group:"style",label:"Alignment",options:["left","center","right"]},bg:{type:"color",default:"#0073e6",group:"style",label:"Background color"},typography:{type:"typography",group:"style",label:"Typography",default:{fontFamily:"inherit",fontSize:14,fontWeight:"600",fontStyle:"normal",lineHeight:1.2,letterSpacing:0,textTransform:"none",textDecoration:"none",color:"#FFFFFF"}},padding:{type:"spacing",default:[12,24,12,24],group:"spacing",label:"Padding"},margin:{type:"spacing",default:[0,0,0,0],group:"spacing",label:"Margin"},border:{type:"border",group:"border",label:"Border",default:{width:0,style:"solid",color:"#000000",radius:4}},boxShadow:{type:"boxShadow",group:"effects",label:"Box shadow",default:{enabled:!1,x:0,y:2,blur:4,spread:0,color:"rgba(0,0,0,.15)",inset:!1}}}},divider:{name:"Divider",category:"structure",attributes:{color:{type:"color",default:"#E2E8F0",group:"style",label:"Color"},thickness:{type:"number",default:1,min:1,max:10,group:"style",label:"Thickness (px)"},style:{type:"select",default:"solid",options:["solid","dashed","dotted","double"],group:"style",label:"Style"},width:{type:"number",default:100,min:10,max:100,group:"style",label:"Width (%)"},alignment:{type:"alignment",default:"left",options:["left","center","right"],group:"style",label:"Alignment"},padding:{type:"spacing",default:[16,0,16,0],group:"spacing",label:"Padding"}}},spacer:{name:"Spacer",category:"structure",attributes:{height:{type:"number",default:24,min:1,max:400,group:"content",label:"Height (px)"}}},image:{name:"Image",category:"media",attributes:{src:{type:"image",default:"https://via.placeholder.com/600x300",group:"content",label:"Image",media:!0},alt:{type:"string",default:"Image",group:"content",label:"Alt text"},href:{type:"url",default:"",group:"content",label:"Link URL (optional)"},openInNewTab:{type:"boolean",default:!0,group:"advanced",label:"Open link in new tab"},width:{type:"number",default:600,min:10,max:1e3,group:"style",label:"Max width (px)",hidden:!0},alignment:{type:"alignment",default:"left",options:["left","center","right"],group:"style",label:"Alignment"},padding:{type:"spacing",default:[0,0,0,0],group:"spacing",label:"Padding"},margin:{type:"spacing",default:[0,0,0,0],group:"spacing",label:"Margin"},border:{type:"border",group:"border",label:"Border",default:{width:0,style:"solid",color:"#000000",radius:0}}}},video:{name:"Video",category:"media",attributes:{thumbnail:{type:"url",default:"https://via.placeholder.com/600x340/0F172A/FFFFFF?text=%E2%96%B6%EF%B8%8E",group:"content",label:"Thumbnail URL",media:!0},videoUrl:{type:"url",default:"https://",group:"content",label:"Video page URL"},alt:{type:"string",default:"Watch video",group:"content",label:"Alt text"},caption:{type:"string",default:"\u25B6 Watch the video",group:"content",label:"Caption (optional)"},width:{type:"number",default:600,min:10,max:1e3,group:"style",label:"Max width (px)"},alignment:{type:"alignment",default:"left",options:["left","center","right"],group:"style",label:"Alignment"},padding:{type:"spacing",default:[0,0,0,0],group:"spacing",label:"Padding"}}},list:{name:"List",category:"content",attributes:{type:{type:"select",default:"unordered",options:["unordered","ordered"],group:"content",label:"Type"},items:{type:"richtext",default:`First item
2
2
  Second item
3
3
  Third item`,group:"content",label:"Items (one per line)"},alignment:{type:"alignment",default:"left",options:["left","center","right"],group:"style",label:"Alignment"},markerStyle:{type:"select",default:"default",options:["default","disc","circle","square","decimal","lower-alpha","upper-alpha","lower-roman","upper-roman","none"],group:"style",label:"Marker style"},markerColor:{type:"color",default:"#334155",group:"style",label:"Marker color"},itemSpacing:{type:"number",default:6,min:0,max:60,group:"style",label:"Item spacing (px)"},indent:{type:"number",default:20,min:0,max:80,group:"style",label:"Indent (px)"},bg:{type:"color",default:"transparent",group:"style",label:"Background color"},typography:{type:"typography",group:"style",label:"Typography",default:{fontFamily:"inherit",fontSize:14,fontWeight:"400",fontStyle:"normal",lineHeight:1.7,letterSpacing:0,textTransform:"none",textDecoration:"none",color:"#334155"}},border:{type:"border",group:"border",label:"Border",default:{width:0,style:"solid",color:"#000000",radius:0}},padding:{type:"spacing",default:[0,0,0,0],group:"spacing",label:"Padding"},margin:{type:"spacing",default:[0,0,0,0],group:"spacing",label:"Margin"}}},social:{name:"Social",category:"content",attributes:{facebook:{type:"url",default:"",group:"content",label:"Facebook URL"},twitter:{type:"url",default:"",group:"content",label:"X (Twitter) URL"},instagram:{type:"url",default:"",group:"content",label:"Instagram URL"},linkedin:{type:"url",default:"",group:"content",label:"LinkedIn URL"},youtube:{type:"url",default:"",group:"content",label:"YouTube URL"},github:{type:"url",default:"",group:"content",label:"GitHub URL"},iconSize:{type:"number",default:36,min:16,max:64,group:"style",label:"Icon size (px)"},gap:{type:"number",default:8,min:0,max:40,group:"style",label:"Gap between icons (px)"},shape:{type:"select",default:"circle",options:["circle","square","rounded"],group:"style",label:"Shape"},alignment:{type:"alignment",default:"left",options:["left","center","right"],group:"style",label:"Alignment"},padding:{type:"spacing",default:[0,0,0,0],group:"spacing",label:"Padding"}}},address:{name:"Address",category:"content",attributes:{lines:{type:"richtext",default:`Acme Inc.
4
4
  123 Main Street
5
- Anywhere, CA 94000`,group:"content",label:"Address (one line each)"},alignment:{type:"alignment",default:"left",options:["left","center","right"],group:"style",label:"Alignment"},typography:{type:"typography",group:"style",label:"Typography",default:{fontFamily:"inherit",fontSize:12,fontWeight:"400",fontStyle:"normal",lineHeight:1.6,letterSpacing:0,textTransform:"none",textDecoration:"none",color:"#64748B"}},padding:{type:"spacing",default:[0,0,0,0],group:"spacing",label:"Padding"},margin:{type:"spacing",default:[0,0,0,0],group:"spacing",label:"Margin"}}},signature:{name:"Signature",category:"content",attributes:{greeting:{type:"string",default:"Cheers,",group:"content",label:"Greeting"},name:{type:"string",default:"Your Name",group:"content",label:"Name"},title:{type:"string",default:"Your Title",group:"content",label:"Title"},company:{type:"string",default:"",group:"content",label:"Company (optional)"},alignment:{type:"alignment",default:"left",options:["left","center","right"],group:"style",label:"Alignment"},typography:{type:"typography",group:"style",label:"Typography",default:{fontFamily:"inherit",fontSize:14,fontWeight:"400",fontStyle:"normal",lineHeight:1.5,letterSpacing:0,textTransform:"none",textDecoration:"none",color:"#334155"}},padding:{type:"spacing",default:[0,0,0,0],group:"spacing",label:"Padding"},margin:{type:"spacing",default:[0,0,0,0],group:"spacing",label:"Margin"}}},date:{name:"Date",category:"content",attributes:{text:{type:"string",default:"{{date}}",group:"content",label:"Text (supports {{date}} tag)"},alignment:{type:"alignment",default:"left",options:["left","center","right"],group:"style",label:"Alignment"},typography:{type:"typography",group:"style",label:"Typography",default:{fontFamily:"inherit",fontSize:12,fontWeight:"500",fontStyle:"normal",lineHeight:1.5,letterSpacing:1,textTransform:"uppercase",textDecoration:"none",color:"#94A3B8"}},padding:{type:"spacing",default:[0,0,0,0],group:"spacing",label:"Padding"},margin:{type:"spacing",default:[0,0,0,0],group:"spacing",label:"Margin"}}},timer:{name:"Timer",category:"content",attributes:{mode:{type:"select",default:"boxes",options:["boxes","text","image"],group:"content",label:"Display mode"},endDate:{type:"datetime",default:"2030-12-31T23:59:59",group:"content",label:"End date & time"},labelPrefix:{type:"string",default:"Offer ends in",group:"content",label:"Prefix label (text mode)"},imageUrl:{type:"url",default:"",group:"content",label:"Countdown image URL (image mode)",media:!0},linkUrl:{type:"url",default:"",group:"content",label:"Link URL (optional)"},labels:{type:"string",default:"DAYS,HOURS,MINUTES,SECONDS",group:"content",label:"Box labels (comma-separated)"},boxBg:{type:"color",default:"#0F172A",group:"style",label:"Box background"},boxColor:{type:"color",default:"#FFFFFF",group:"style",label:"Box text color"},boxSize:{type:"number",default:64,min:32,max:120,group:"style",label:"Box size (px)"},boxRadius:{type:"number",default:6,min:0,max:999,group:"style",label:"Box radius (px)"},labelColor:{type:"color",default:"#64748B",group:"style",label:"Label color"},alignment:{type:"alignment",default:"left",options:["left","center","right"],group:"style",label:"Alignment"},padding:{type:"spacing",default:[0,0,0,0],group:"spacing",label:"Padding"},margin:{type:"spacing",default:[0,0,0,0],group:"spacing",label:"Margin"}}},html:{name:"Custom HTML",category:"content",attributes:{html:{type:"html",default:"",group:"content",label:"HTML"},padding:{type:"spacing",default:[0,0,0,0],group:"spacing",label:"Padding"},margin:{type:"spacing",default:[0,0,0,0],group:"spacing",label:"Margin"}}},columns:{name:"Columns",category:"structure",attributes:{columns:{type:"number",default:2,min:1,max:4,group:"content",label:"Number of columns"},gap:{type:"number",default:16,min:0,max:60,group:"spacing",label:"Gap between columns (px)"},valign:{type:"select",default:"top",options:["top","middle","bottom"],group:"style",label:"Vertical align"},backgroundColor:{type:"color",default:"transparent",group:"style",label:"Background color"},padding:{type:"spacing",default:[0,0,0,0],group:"spacing",label:"Padding"},margin:{type:"spacing",default:[0,0,0,0],group:"spacing",label:"Margin"}}},column:{name:"Column",category:"structure",acceptsChildren:!0,hidden:!0,attributes:{padding:{type:"spacing",default:[0,0,0,0],group:"spacing",label:"Padding"}}},section:{name:"Section",category:"structure",acceptsChildren:!0,attributes:{backgroundColor:{type:"color",default:"#FFFFFF",group:"style",label:"Background color"},alignment:{type:"alignment",default:"left",options:["left","center","right"],group:"style",label:"Content alignment"},maxWidth:{type:"number",default:0,min:0,max:800,group:"spacing",label:"Max width (px, 0 = full)"},minHeight:{type:"number",default:0,min:0,max:1e3,group:"spacing",label:"Min height (px)"},padding:{type:"spacing",default:[24,24,24,24],group:"spacing",label:"Padding"},margin:{type:"spacing",default:[0,0,0,0],group:"spacing",label:"Margin"},border:{type:"border",group:"border",label:"Border",default:{width:0,style:"solid",color:"#E2E8F0",radius:0}},boxShadow:{type:"boxShadow",group:"effects",label:"Box shadow",default:{enabled:!1,x:0,y:2,blur:8,spread:0,color:"rgba(0,0,0,.08)",inset:!1}}}}}};var Wi={version:2,groups:[{key:"content",label:"Content"},{key:"style",label:"Style"},{key:"spacing",label:"Spacing"},{key:"border",label:"Border"},{key:"effects",label:"Effects"},{key:"advanced",label:"Advanced"}],blocks:{form:{name:"Form",root:!0,category:"structure",attributes:{bgColor:{type:"color",default:"#FFFFFF",group:"style",label:"Form background"},contentWidth:{type:"number",default:560,min:280,max:900,group:"spacing",label:"Form width"},padding:{type:"spacing",default:[24,24,24,24],group:"spacing",label:"Form padding"},fontFamily:{type:"string",default:"system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif",group:"style",label:"Font family"},labelColor:{type:"color",default:"#334155",group:"style",label:"Label color"},inputBg:{type:"color",default:"#FFFFFF",group:"style",label:"Input background"},inputText:{type:"color",default:"#0F172A",group:"style",label:"Input text"},inputBorder:{type:"color",default:"#CBD5E1",group:"style",label:"Input border"},radius:{type:"number",default:6,min:0,max:40,group:"style",label:"Field radius (px)"},stackBelow:{type:"number",default:600,min:320,max:1024,group:"advanced",label:"Stack columns below (px)"},formBorder:{type:"border",group:"border",label:"Form border",default:{width:0,style:"solid",color:"#E2E8F0",radius:8}},formBoxShadow:{type:"boxShadow",group:"effects",label:"Form shadow",default:{enabled:!1,x:0,y:2,blur:12,spread:0,color:"rgba(0,0,0,.08)",inset:!1}}}},field:{name:"Input",category:"fields",attributes:{name:{type:"fieldName",default:"field",group:"content",label:"Field name (key)"},inputType:{type:"select",default:"text",options:["text","email","number","tel","url","date","password"],group:"content",label:"Input type"},label:{type:"string",default:"Label",group:"content",label:"Label"},placeholder:{type:"string",default:"",group:"content",label:"Placeholder"},required:{type:"boolean",default:!1,group:"content",label:"Required"},defaultValue:{type:"string",default:"",group:"advanced",label:"Default value"},helpText:{type:"string",default:"",group:"advanced",label:"Help text"},showLabel:{type:"boolean",default:!0,group:"style",label:"Show label"},padding:{type:"spacing",default:[0,0,12,0],group:"spacing",label:"Spacing"}}},textarea:{name:"Textarea",category:"fields",attributes:{name:{type:"fieldName",default:"message",group:"content",label:"Field name (key)"},label:{type:"string",default:"Message",group:"content",label:"Label"},placeholder:{type:"string",default:"",group:"content",label:"Placeholder"},rows:{type:"number",default:4,min:2,max:20,group:"content",label:"Rows"},required:{type:"boolean",default:!1,group:"content",label:"Required"},helpText:{type:"string",default:"",group:"advanced",label:"Help text"},showLabel:{type:"boolean",default:!0,group:"style",label:"Show label"},padding:{type:"spacing",default:[0,0,12,0],group:"spacing",label:"Spacing"}}},select:{name:"Dropdown",category:"fields",attributes:{name:{type:"fieldName",default:"choice",group:"content",label:"Field name (key)"},label:{type:"string",default:"Choose one",group:"content",label:"Label"},placeholder:{type:"string",default:"Select\u2026",group:"content",label:"Placeholder option"},options:{type:"options",default:[{label:"Option 1",value:"option-1"},{label:"Option 2",value:"option-2"}],group:"content",label:"Options"},required:{type:"boolean",default:!1,group:"content",label:"Required"},helpText:{type:"string",default:"",group:"advanced",label:"Help text"},showLabel:{type:"boolean",default:!0,group:"style",label:"Show label"},padding:{type:"spacing",default:[0,0,12,0],group:"spacing",label:"Spacing"}}},radio:{name:"Radio group",category:"fields",attributes:{name:{type:"fieldName",default:"option",group:"content",label:"Field name (key)"},label:{type:"string",default:"Pick one",group:"content",label:"Label"},options:{type:"options",default:[{label:"Option 1",value:"option-1"},{label:"Option 2",value:"option-2"}],group:"content",label:"Options"},required:{type:"boolean",default:!1,group:"content",label:"Required"},inline:{type:"boolean",default:!1,group:"style",label:"Inline options"},showLabel:{type:"boolean",default:!0,group:"style",label:"Show label"},padding:{type:"spacing",default:[0,0,12,0],group:"spacing",label:"Spacing"}}},checkbox:{name:"Checkboxes",category:"fields",attributes:{name:{type:"fieldName",default:"choices",group:"content",label:"Field name (key)"},label:{type:"string",default:"Select all that apply",group:"content",label:"Label"},options:{type:"options",default:[{label:"Option 1",value:"option-1"},{label:"Option 2",value:"option-2"}],group:"content",label:"Options"},required:{type:"boolean",default:!1,group:"content",label:"Required"},inline:{type:"boolean",default:!1,group:"style",label:"Inline options"},showLabel:{type:"boolean",default:!0,group:"style",label:"Show label"},padding:{type:"spacing",default:[0,0,12,0],group:"spacing",label:"Spacing"}}},submit:{name:"Submit button",category:"structure",attributes:{text:{type:"string",default:"Submit",group:"content",label:"Button label"},alignment:{type:"alignment",default:"left",options:["left","center","right"],group:"style",label:"Alignment"},bg:{type:"color",default:"#0073E6",group:"style",label:"Background color"},color:{type:"color",default:"#FFFFFF",group:"style",label:"Text color"},fullWidth:{type:"boolean",default:!1,group:"style",label:"Full width"},padding:{type:"spacing",default:[12,24,12,24],group:"spacing",label:"Padding"},border:{type:"border",group:"border",label:"Border",default:{width:0,style:"solid",color:"#000000",radius:6}}}},heading:{name:"Heading",category:"content",attributes:{text:{type:"string",default:"Form heading",group:"content",label:"Text"},tag:{type:"select",default:"h3",options:["h1","h2","h3","h4"],group:"content",label:"Tag"},alignment:{type:"alignment",default:"left",group:"style",label:"Alignment"},color:{type:"color",default:"#0F172A",group:"style",label:"Color"},padding:{type:"spacing",default:[0,0,8,0],group:"spacing",label:"Spacing"}}},text:{name:"Text",category:"content",attributes:{text:{type:"richtext",default:"Helper text here.",group:"content",label:"Text"},alignment:{type:"alignment",default:"left",group:"style",label:"Alignment"},color:{type:"color",default:"#475569",group:"style",label:"Color"},padding:{type:"spacing",default:[0,0,8,0],group:"spacing",label:"Spacing"}}},divider:{name:"Divider",category:"structure",attributes:{color:{type:"color",default:"#E2E8F0",group:"style",label:"Color"},thickness:{type:"number",default:1,min:1,max:10,group:"style",label:"Thickness (px)"},padding:{type:"spacing",default:[8,0,8,0],group:"spacing",label:"Spacing"}}},spacer:{name:"Spacer",category:"structure",attributes:{height:{type:"number",default:16,min:1,max:200,group:"content",label:"Height (px)"}}},columns:{name:"Columns",category:"structure",attributes:{columns:{type:"number",default:2,min:1,max:4,group:"content",label:"Number of columns"},gap:{type:"number",default:16,min:0,max:60,group:"spacing",label:"Gap between columns (px)"},valign:{type:"select",default:"top",options:["top","middle","bottom"],group:"style",label:"Vertical align"},backgroundColor:{type:"color",default:"transparent",group:"style",label:"Background color"},padding:{type:"spacing",default:[0,0,0,0],group:"spacing",label:"Padding"},margin:{type:"spacing",default:[0,0,0,0],group:"spacing",label:"Margin"}}},column:{name:"Column",category:"structure",acceptsChildren:!0,hidden:!0,attributes:{padding:{type:"spacing",default:[0,0,0,0],group:"spacing",label:"Padding"}}},section:{name:"Section",category:"structure",acceptsChildren:!0,attributes:{backgroundColor:{type:"color",default:"transparent",group:"style",label:"Background color"},alignment:{type:"alignment",default:"left",options:["left","center","right"],group:"style",label:"Content alignment"},maxWidth:{type:"number",default:0,min:0,max:900,group:"spacing",label:"Max width (px, 0 = full)"},minHeight:{type:"number",default:0,min:0,max:1e3,group:"spacing",label:"Min height (px)"},padding:{type:"spacing",default:[0,0,0,0],group:"spacing",label:"Padding"},margin:{type:"spacing",default:[0,0,0,0],group:"spacing",label:"Margin"},border:{type:"border",group:"border",label:"Border",default:{width:0,style:"solid",color:"#E2E8F0",radius:0}},boxShadow:{type:"boxShadow",group:"effects",label:"Box shadow",default:{enabled:!1,x:0,y:2,blur:8,spread:0,color:"rgba(0,0,0,.08)",inset:!1}}}}}};import{createContext as H2,useContext as A2,useReducer as V2,useMemo as ji}from"react";import{jsx as z2}from"react/jsx-runtime";var D2=t=>{var r,e;return{tree:t,selectedId:(e=(r=t==null?void 0:t.root)==null?void 0:r.id)!=null?e:"root",editingId:null,dirty:!1,past:[],future:[],_lastCommit:null}},fo=50,T2=new Set(["UPDATE_ATTRS","ADD_CHILD","MOVE_NODE","REMOVE_NODE","REPLACE_NODE"]);function R2(t,r){var e,a;switch(r.type){case"SET_TREE":return{...t,tree:r.tree,dirty:!1};case"SELECT":return{...t,selectedId:r.id};case"START_EDITING":return{...t,selectedId:r.id,editingId:r.id};case"STOP_EDITING":return{...t,editingId:null};case"UPDATE_ATTRS":{let o=ge(t.tree),i=Kt(o.root,r.id);return i&&(i.attributes={...i.attributes||{},...r.attributes},i.type==="columns"&&"columns"in r.attributes&&F2(i)),{...t,tree:o,dirty:!0}}case"ADD_CHILD":{let o=ge(t.tree),i=r.containerId==="root"?o.root:Kt(o.root,r.containerId);if(!i)return t;i.children=i.children||[];let n=r.index==null||r.index<0?i.children.length:Math.max(0,Math.min(r.index,i.children.length));return i.children.splice(n,0,r.node),{...t,tree:o,selectedId:r.node.id,dirty:!0}}case"MOVE_NODE":{let o=ge(t.tree),i=or(o.root,r.activeId);if(!i)return t;let[n]=i.container.children.splice(i.index,1),d=r.destContainerId==="root"?o.root:Kt(o.root,r.destContainerId);if(!d)return i.container.children.splice(i.index,0,n),t;d.children=d.children||[];let l=r.destIndex==null||r.destIndex<0?d.children.length:r.destIndex;return i.container===d&&i.index<l&&(l-=1),l=Math.max(0,Math.min(l,d.children.length)),d.children.splice(l,0,n),{...t,tree:o,dirty:!0}}case"REMOVE_NODE":{let o=ge(t.tree),i=or(o.root,r.id);return i?(i.container.children.splice(i.index,1),{...t,tree:o,selectedId:t.selectedId===r.id?"root":t.selectedId,editingId:t.editingId===r.id?null:t.editingId,dirty:!0}):t}case"REPLACE_NODE":{let o=Array.isArray(r.nodes)?r.nodes:[];if(!o.length)return t;let i=ge(t.tree),n=or(i.root,r.id);return n?(n.container.children.splice(n.index,1,...o),{...t,tree:i,selectedId:(a=(e=o[0])==null?void 0:e.id)!=null?a:"root",editingId:t.editingId===r.id?null:t.editingId,dirty:!0}):t}case"MARK_CLEAN":return{...t,dirty:!1};default:return t}}var Si=(t,r)=>Kt(t.root,r)?r:"root";function E2(t,r){var a;if(r.type==="UNDO"){if(!t.past.length)return t;let o=t.past.slice(),i=o[o.length-1];return o.pop(),{...t,tree:i,past:o,future:[t.tree,...t.future].slice(0,fo),selectedId:Si(i,t.selectedId),editingId:null,dirty:!0,_lastCommit:null}}if(r.type==="REDO"){if(!t.future.length)return t;let[o,...i]=t.future;return{...t,tree:o,past:[...t.past,t.tree].slice(-fo),future:i,selectedId:Si(o,t.selectedId),editingId:null,dirty:!0,_lastCommit:null}}let e=R2(t,r);if(e===t)return e;if(r.type==="SET_TREE")return{...e,past:[],future:[],_lastCommit:null};if(T2.has(r.type)&&e.tree!==t.tree){let o=Date.now(),i=r.type==="UPDATE_ATTRS"&&((a=t._lastCommit)==null?void 0:a.type)==="UPDATE_ATTRS"&&t._lastCommit.id===r.id&&o-t._lastCommit.time<600;return{...e,past:i?t.past:[...t.past,t.tree].slice(-fo),future:[],_lastCommit:{type:r.type,id:r.id,time:o}}}return e}var ge=t=>JSON.parse(JSON.stringify(t)),Kt=(t,r)=>{if(!t)return null;if(t.id===r)return t;for(let e of t.children||[]){let a=Kt(e,r);if(a)return a}return null},or=(t,r)=>{var e;for(let a=0;a<(t.children||[]).length;a++){let o=t.children[a];if(o.id===r)return{container:t,index:a};if((e=o.children)!=null&&e.length){let i=or(o,r);if(i)return i}}return null},Hi=H2(null);function Xe({tree:t,children:r}){let[e,a]=V2(E2,void 0,()=>D2(t)),o=ji(()=>({setTree:n=>a({type:"SET_TREE",tree:n}),select:n=>a({type:"SELECT",id:n}),startEditing:n=>a({type:"START_EDITING",id:n}),stopEditing:()=>a({type:"STOP_EDITING"}),updateAttrs:(n,d)=>a({type:"UPDATE_ATTRS",id:n,attributes:d}),addChild:(n,d,l)=>a({type:"ADD_CHILD",containerId:n,node:d,index:l}),moveNode:(n,d,l)=>a({type:"MOVE_NODE",activeId:n,destContainerId:d,destIndex:l}),removeNode:n=>a({type:"REMOVE_NODE",id:n}),replaceNode:(n,d)=>a({type:"REPLACE_NODE",id:n,nodes:d}),markClean:()=>a({type:"MARK_CLEAN"}),undo:()=>a({type:"UNDO"}),redo:()=>a({type:"REDO"})}),[]),i=ji(()=>({state:e,canUndo:e.past.length>0,canRedo:e.future.length>0,...o}),[e,o]);return z2(Hi.Provider,{value:i,children:r})}var $=()=>{let t=A2(Hi);if(!t)throw new Error("useEditor must be inside EditorStoreProvider");return t},Ye=()=>{let{state:t}=$();return Kt(t.tree.root,t.selectedId)};function Hr(t,r){var o;let e={};Object.entries(r.attributes||{}).forEach(([i,n])=>{e[i]=N2(n.default)});let a={id:Ai(),type:t,attributes:e,children:[]};if(t==="columns"){let i=Math.max(1,parseInt((o=e.columns)!=null?o:2,10)||2);a.children=Array.from({length:i},Vi)}return a}var Ai=()=>`n_${Math.random().toString(36).slice(2,10)}`;function Vi(){return{id:Ai(),type:"column",attributes:{padding:[0,0,0,0]},children:[]}}function F2(t){var a,o;let r=Math.max(1,parseInt((o=(a=t.attributes)==null?void 0:a.columns)!=null?o:1,10)||1);t.children=t.children||[];let e=t.children.filter(i=>i.type==="column");if(e.length<r)for(let i=e.length;i<r;i++)t.children.push(Vi());else if(e.length>r){let i=new Set(e.slice(r).map(n=>n.id));t.children=t.children.filter(n=>!i.has(n.id))}}var N2=t=>t==null||typeof t!="object"?t:JSON.parse(JSON.stringify(t));import{createContext as I2,useContext as ko,useMemo as P2}from"react";var pe=({allowedTypes:t=["image"],multiple:r=!1}={})=>new Promise((e,a)=>{if(typeof document=="undefined"){a(new Error("No document available to open a file picker"));return}let o=t.map(h=>h.includes("/")?h:`${h}/*`).join(","),i=document.createElement("input");i.type="file",i.accept=o,i.multiple=r,i.style.display="none";let n=!1,d=h=>{n||(n=!0,i.remove(),e(h))},l=h=>new Promise((s,u)=>{let f=new FileReader;f.onload=()=>s(f.result),f.onerror=()=>u(f.error||new Error("Failed to read the selected file")),f.readAsDataURL(h)}),c=h=>new Promise(s=>{let u=new Image;u.onload=()=>s({width:u.naturalWidth,height:u.naturalHeight}),u.onerror=()=>s({}),u.src=h});i.addEventListener("cancel",()=>d(null)),i.addEventListener("change",async()=>{let h=i.files&&i.files[0];if(!h){d(null);return}try{let s=await l(h),u=h.name.replace(/\.[^./\\]+$/,""),p=h.type.startsWith("image/")?await c(s):{};d({id:void 0,url:s,alt:u,...p})}catch(s){n=!0,i.remove(),a(s)}}),document.body.appendChild(i),i.click()});var Je={add_a_text_block:"Add a text block",add_block:"Add block",add_option:"Add option",advanced:"Advanced",align:"Align",align_center:"Align center",align_left:"Align left",align_right:"Align right",alt:"Alt",alt_text_accessibility:"Alt text (accessibility)",back_to_blocks:"Back to blocks",back_to_visual_editor:"Back to visual editor",blocks:"Blocks",bold:"Bold",bold_700:"Bold (700)",border:"Border",bulleted_list:"Bulleted list",capitalize:"Capitalize",choose_a_block:"Choose a block",choose_a_template:"Choose a template",choose_from_media_library:"Choose from media library",choose_from_the_media_library:"Choose from the media library",clear_formatting:"Clear formatting",close:"Close",close_esc:"Close (ESC)",close_navigator:"Close navigator",columns:"Columns",content:"Content",convert_to_blocks:"Convert to blocks",custom_width_in_pixels:"Custom width in pixels",delete:"Delete",delete_block:"Delete block",delete_columns:"Delete columns",delete_section:"Delete section",delete_this_block:"Delete this block?",desktop:"Desktop",drag_blocks_here:"Drag blocks here, or use \u201CAdd block\u201D above.",drag_columns:"Drag columns",drag_form_fields_here:"Drag form fields here, or use \u201CAdd block\u201D above.",drag_section:"Drag section",drag_to_reorder:"Drag to reorder",edit_html_source:"Edit HTML source",editing:"Editing",effects:"Effects",email_preview:"Email preview",email_settings:"Email settings",empty_drop_here:"Empty \u2014 drop here",enable_shadow:"Enable shadow",format:"Format",full:"Full",full_width_100:"Full width (100%)",heading_1:"Heading 1",heading_2:"Heading 2",heading_3:"Heading 3",heading_4:"Heading 4",heading_5:"Heading 5",heading_6:"Heading 6",image_size:"Image size",insert:"Insert",insert_block:"Insert block",insert_image:"Insert image",insert_link:"Insert link",insert_merge_tag:"Insert merge tag",insert_shortcode:"Insert shortcode",inset:"Inset",italic:"Italic",label:"Label",large:"Large",large_75:"Large (75%)",line_through:"Line-through",lowercase:"lowercase",medium:"Medium",medium_50:"Medium (50%)",mobile:"Mobile",navigator:"Navigator",no_blocks_found:"No blocks found",no_blocks_yet:"No blocks yet. Add blocks from the Blocks tab.",no_matching_tags:"No matching tags",no_options_in_this_tab:"No options in this tab.",no_templates_available:"No templates available.",none:"None",nothing_to_convert:"Nothing to convert \u2014 this block has no recognizable HTML content.",numbered_list:"Numbered list",paragraph:"Paragraph",paragraph_format:"Paragraph format",parse_html_help_text:"Parse this HTML into editable blocks \u2014 headings, text, images, lists. Anything unrecognized stays as HTML.",preview:"Preview",px_max_width:"px max width",redo_shortcut:"Redo (Ctrl+Shift+Z)",reload:"Reload",remove:"Remove",remove_image:"Remove image",remove_link:"Remove link",remove_option:"Remove option",rendering:"Rendering\u2026",replace:"Replace",replace_content_confirm:"Replace the current content with this template?",replace_image:"Replace image",search_blocks:"Search blocks\u2026",search_or_type_a_tag:"Search or type a tag\u2026",section:"Section",select_block_hint:"Select a block to edit its settings.",settings:"Settings",size:"Size",small:"Small",small_25:"Small (25%)",spacing_layout:"Spacing & layout",strikethrough:"Strikethrough",style:"Style",templates:"Templates",text_color:"Text color",toggle_navigator:"Toggle navigator",underline:"Underline",undo_shortcut:"Undo (Ctrl+Z)",unknown_block:"Unknown block",upload_image:"Upload image",uppercase:"UPPERCASE",value:"Value",block_email:"Email",block_heading:"Heading",block_text:"Text",block_button:"Button",block_divider:"Divider",block_spacer:"Spacer",block_image:"Image",block_video:"Video",block_list:"List",block_social:"Social",block_address:"Address",block_signature:"Signature",block_date:"Date",block_timer:"Timer",block_html:"Custom HTML",block_columns:"Columns",block_column:"Column",block_section:"Section",block_certificate:"Certificate",block_qr:"QR code",block_form:"Form",block_field:"Input",block_textarea:"Textarea",block_select:"Dropdown",block_radio:"Radio group",block_checkbox:"Checkboxes",block_submit:"Submit button",category_fields:"Fields",category_structure:"Structure",category_content:"Content",category_media:"Media",category_other:"Other"};import{jsx as _2}from"react/jsx-runtime";var O2={mergeTags:[],mediaUpload:pe,config:Je},Qe=I2(O2);function fe({value:t,children:r}){let e=P2(()=>{var a,o;return{mergeTags:(a=t==null?void 0:t.mergeTags)!=null?a:[],mediaUpload:(o=t==null?void 0:t.mediaUpload)!=null?o:pe,config:t!=null&&t.config?{...Je,...t.config}:Je}},[t==null?void 0:t.mergeTags,t==null?void 0:t.mediaUpload,t==null?void 0:t.config]);return _2(Qe.Provider,{value:e,children:r})}var E=()=>ko(Qe),ir=()=>ko(Qe).mergeTags||[],ke=()=>ko(Qe).mediaUpload||pe;import{useEffect as ei,useMemo as Yh,useRef as Jh,useState as ai}from"react";import et,{createContext as Be,useContext as xr,useEffect as J,useState as Bt,useCallback as Tt,useMemo as Y,useRef as dt,memo as X2,useReducer as Y2,cloneElement as J2,forwardRef as Q2}from"react";import{createPortal as tl,unstable_batchedUpdates as aa}from"react-dom";import{useMemo as vo,useLayoutEffect as $2,useEffect as Ti,useRef as Ar,useCallback as ta}from"react";function Ri(){for(var t=arguments.length,r=new Array(t),e=0;e<t;e++)r[e]=arguments[e];return vo(()=>a=>{r.forEach(o=>o(a))},r)}var xe=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined";function sr(t){let r=Object.prototype.toString.call(t);return r==="[object Window]"||r==="[object global]"}function ra(t){return"nodeType"in t}function ct(t){var r,e;return t?sr(t)?t:ra(t)&&(r=(e=t.ownerDocument)==null?void 0:e.defaultView)!=null?r:window:window}function ea(t){let{Document:r}=ct(t);return t instanceof r}function Vr(t){return sr(t)?!1:t instanceof ct(t).HTMLElement}function Lo(t){return t instanceof ct(t).SVGElement}function ur(t){return t?sr(t)?t.document:ra(t)?ea(t)?t:Vr(t)||Lo(t)?t.ownerDocument:document:document:document}var Ct=xe?$2:Ti;function ve(t){let r=Ar(t);return Ct(()=>{r.current=t}),ta(function(){for(var e=arguments.length,a=new Array(e),o=0;o<e;o++)a[o]=arguments[o];return r.current==null?void 0:r.current(...a)},[])}function Ei(){let t=Ar(null),r=ta((a,o)=>{t.current=setInterval(a,o)},[]),e=ta(()=>{t.current!==null&&(clearInterval(t.current),t.current=null)},[]);return[r,e]}function Dr(t,r){r===void 0&&(r=[t]);let e=Ar(t);return Ct(()=>{e.current!==t&&(e.current=t)},r),e}function Tr(t,r){let e=Ar();return vo(()=>{let a=t(e.current);return e.current=a,a},[...r])}function Le(t){let r=ve(t),e=Ar(null),a=ta(o=>{o!==e.current&&(r==null||r(o,e.current)),e.current=o},[]);return[e,a]}function me(t){let r=Ar();return Ti(()=>{r.current=t},[t]),r.current}var xo={};function gr(t,r){return vo(()=>{if(r)return r;let e=xo[t]==null?0:xo[t]+1;return xo[t]=e,t+"-"+e},[t,r])}function Fi(t){return function(r){for(var e=arguments.length,a=new Array(e>1?e-1:0),o=1;o<e;o++)a[o-1]=arguments[o];return a.reduce((i,n)=>{let d=Object.entries(n);for(let[l,c]of d){let h=i[l];h!=null&&(i[l]=h+t*c)}return i},{...r})}}var pr=Fi(1),Rr=Fi(-1);function U2(t){return"clientX"in t&&"clientY"in t}function Er(t){if(!t)return!1;let{KeyboardEvent:r}=ct(t.target);return r&&t instanceof r}function Z2(t){if(!t)return!1;let{TouchEvent:r}=ct(t.target);return r&&t instanceof r}function Me(t){if(Z2(t)){if(t.touches&&t.touches.length){let{clientX:r,clientY:e}=t.touches[0];return{x:r,y:e}}else if(t.changedTouches&&t.changedTouches.length){let{clientX:r,clientY:e}=t.changedTouches[0];return{x:r,y:e}}}return U2(t)?{x:t.clientX,y:t.clientY}:null}var kt=Object.freeze({Translate:{toString(t){if(!t)return;let{x:r,y:e}=t;return"translate3d("+(r?Math.round(r):0)+"px, "+(e?Math.round(e):0)+"px, 0)"}},Scale:{toString(t){if(!t)return;let{scaleX:r,scaleY:e}=t;return"scaleX("+r+") scaleY("+e+")"}},Transform:{toString(t){if(t)return[kt.Translate.toString(t),kt.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:r,duration:e,easing:a}=t;return r+" "+e+"ms "+a}}}),Di="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Ni(t){return t.matches(Di)?t:t.querySelector(Di)}import zi,{useState as q2,useCallback as G2}from"react";var K2={display:"none"};function Ii(t){let{id:r,value:e}=t;return zi.createElement("div",{id:r,style:K2},e)}function Pi(t){let{id:r,announcement:e,ariaLiveType:a="assertive"}=t,o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return zi.createElement("div",{id:r,style:o,role:"status","aria-live":a,"aria-atomic":!0},e)}function Oi(){let[t,r]=q2("");return{announce:G2(a=>{a!=null&&r(a)},[]),announcement:t}}var rn=Be(null);function rl(t){let r=xr(rn);J(()=>{if(!r)throw new Error("useDndMonitor must be used within a children of <DndContext>");return r(t)},[t,r])}function el(){let[t]=Bt(()=>new Set),r=Tt(a=>(t.add(a),()=>t.delete(a)),[t]);return[Tt(a=>{let{type:o,event:i}=a;t.forEach(n=>{var d;return(d=n[o])==null?void 0:d.call(n,i)})},[t]),r]}var al={draggable:`
5
+ Anywhere, CA 94000`,group:"content",label:"Address (one line each)"},alignment:{type:"alignment",default:"left",options:["left","center","right"],group:"style",label:"Alignment"},typography:{type:"typography",group:"style",label:"Typography",default:{fontFamily:"inherit",fontSize:12,fontWeight:"400",fontStyle:"normal",lineHeight:1.6,letterSpacing:0,textTransform:"none",textDecoration:"none",color:"#64748B"}},padding:{type:"spacing",default:[0,0,0,0],group:"spacing",label:"Padding"},margin:{type:"spacing",default:[0,0,0,0],group:"spacing",label:"Margin"}}},signature:{name:"Signature",category:"content",attributes:{greeting:{type:"string",default:"Cheers,",group:"content",label:"Greeting"},name:{type:"string",default:"Your Name",group:"content",label:"Name"},title:{type:"string",default:"Your Title",group:"content",label:"Title"},company:{type:"string",default:"",group:"content",label:"Company (optional)"},alignment:{type:"alignment",default:"left",options:["left","center","right"],group:"style",label:"Alignment"},typography:{type:"typography",group:"style",label:"Typography",default:{fontFamily:"inherit",fontSize:14,fontWeight:"400",fontStyle:"normal",lineHeight:1.5,letterSpacing:0,textTransform:"none",textDecoration:"none",color:"#334155"}},padding:{type:"spacing",default:[0,0,0,0],group:"spacing",label:"Padding"},margin:{type:"spacing",default:[0,0,0,0],group:"spacing",label:"Margin"}}},date:{name:"Date",category:"content",attributes:{text:{type:"string",default:"{{date}}",group:"content",label:"Text (supports {{date}} tag)"},alignment:{type:"alignment",default:"left",options:["left","center","right"],group:"style",label:"Alignment"},typography:{type:"typography",group:"style",label:"Typography",default:{fontFamily:"inherit",fontSize:12,fontWeight:"500",fontStyle:"normal",lineHeight:1.5,letterSpacing:1,textTransform:"uppercase",textDecoration:"none",color:"#94A3B8"}},padding:{type:"spacing",default:[0,0,0,0],group:"spacing",label:"Padding"},margin:{type:"spacing",default:[0,0,0,0],group:"spacing",label:"Margin"}}},timer:{name:"Timer",category:"content",attributes:{mode:{type:"select",default:"boxes",options:["boxes","text","image"],group:"content",label:"Display mode"},endDate:{type:"datetime",default:"2030-12-31T23:59:59",group:"content",label:"End date & time"},labelPrefix:{type:"string",default:"Offer ends in",group:"content",label:"Prefix label (text mode)"},imageUrl:{type:"url",default:"",group:"content",label:"Countdown image URL (image mode)",media:!0},linkUrl:{type:"url",default:"",group:"content",label:"Link URL (optional)"},labels:{type:"string",default:"DAYS,HOURS,MINUTES,SECONDS",group:"content",label:"Box labels (comma-separated)"},boxBg:{type:"color",default:"#0F172A",group:"style",label:"Box background"},boxColor:{type:"color",default:"#FFFFFF",group:"style",label:"Box text color"},boxSize:{type:"number",default:64,min:32,max:120,group:"style",label:"Box size (px)"},boxRadius:{type:"number",default:6,min:0,max:999,group:"style",label:"Box radius (px)"},labelColor:{type:"color",default:"#64748B",group:"style",label:"Label color"},alignment:{type:"alignment",default:"left",options:["left","center","right"],group:"style",label:"Alignment"},padding:{type:"spacing",default:[0,0,0,0],group:"spacing",label:"Padding"},margin:{type:"spacing",default:[0,0,0,0],group:"spacing",label:"Margin"}}},html:{name:"Custom HTML",category:"content",attributes:{html:{type:"html",default:"",group:"content",label:"HTML"},padding:{type:"spacing",default:[0,0,0,0],group:"spacing",label:"Padding"},margin:{type:"spacing",default:[0,0,0,0],group:"spacing",label:"Margin"}}},columns:{name:"Columns",category:"structure",attributes:{columns:{type:"number",default:2,min:1,max:4,group:"content",label:"Number of columns"},gap:{type:"number",default:16,min:0,max:60,group:"spacing",label:"Gap between columns (px)"},valign:{type:"select",default:"top",options:["top","middle","bottom"],group:"style",label:"Vertical align"},backgroundColor:{type:"color",default:"transparent",group:"style",label:"Background color"},padding:{type:"spacing",default:[0,0,0,0],group:"spacing",label:"Padding"},margin:{type:"spacing",default:[0,0,0,0],group:"spacing",label:"Margin"}}},column:{name:"Column",category:"structure",acceptsChildren:!0,hidden:!0,attributes:{padding:{type:"spacing",default:[0,0,0,0],group:"spacing",label:"Padding"}}},section:{name:"Section",category:"structure",acceptsChildren:!0,attributes:{backgroundColor:{type:"color",default:"#FFFFFF",group:"style",label:"Background color"},alignment:{type:"alignment",default:"left",options:["left","center","right"],group:"style",label:"Content alignment"},maxWidth:{type:"number",default:0,min:0,max:800,group:"spacing",label:"Max width (px, 0 = full)"},minHeight:{type:"number",default:0,min:0,max:1e3,group:"spacing",label:"Min height (px)"},padding:{type:"spacing",default:[24,24,24,24],group:"spacing",label:"Padding"},margin:{type:"spacing",default:[0,0,0,0],group:"spacing",label:"Margin"},border:{type:"border",group:"border",label:"Border",default:{width:0,style:"solid",color:"#E2E8F0",radius:0}},boxShadow:{type:"boxShadow",group:"effects",label:"Box shadow",default:{enabled:!1,x:0,y:2,blur:8,spread:0,color:"rgba(0,0,0,.08)",inset:!1}}}}}};var Wi={version:2,groups:[{key:"content",label:"Content"},{key:"style",label:"Style"},{key:"spacing",label:"Spacing"},{key:"border",label:"Border"},{key:"effects",label:"Effects"},{key:"advanced",label:"Advanced"}],blocks:{form:{name:"Form",root:!0,category:"structure",attributes:{bgColor:{type:"color",default:"#FFFFFF",group:"style",label:"Form background"},contentWidth:{type:"number",default:560,min:280,max:900,group:"spacing",label:"Form width"},padding:{type:"spacing",default:[24,24,24,24],group:"spacing",label:"Form padding"},fontFamily:{type:"string",default:"system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif",group:"style",label:"Font family"},labelColor:{type:"color",default:"#334155",group:"style",label:"Label color"},inputBg:{type:"color",default:"#FFFFFF",group:"style",label:"Input background"},inputText:{type:"color",default:"#0F172A",group:"style",label:"Input text"},inputBorder:{type:"color",default:"#CBD5E1",group:"style",label:"Input border"},radius:{type:"number",default:6,min:0,max:40,group:"style",label:"Field radius (px)"},stackBelow:{type:"number",default:600,min:320,max:1024,group:"advanced",label:"Stack columns below (px)"},formBorder:{type:"border",group:"border",label:"Form border",default:{width:0,style:"solid",color:"#E2E8F0",radius:8}},formBoxShadow:{type:"boxShadow",group:"effects",label:"Form shadow",default:{enabled:!1,x:0,y:2,blur:12,spread:0,color:"rgba(0,0,0,.08)",inset:!1}}}},field:{name:"Input",category:"fields",attributes:{name:{type:"fieldName",default:"field",group:"content",label:"Field name (key)"},inputType:{type:"select",default:"text",options:["text","email","number","tel","url","date","password"],group:"content",label:"Input type"},label:{type:"string",default:"Label",group:"content",label:"Label"},placeholder:{type:"string",default:"",group:"content",label:"Placeholder"},required:{type:"boolean",default:!1,group:"content",label:"Required"},defaultValue:{type:"string",default:"",group:"advanced",label:"Default value"},helpText:{type:"string",default:"",group:"advanced",label:"Help text"},showLabel:{type:"boolean",default:!0,group:"style",label:"Show label"},padding:{type:"spacing",default:[0,0,12,0],group:"spacing",label:"Spacing"}}},textarea:{name:"Textarea",category:"fields",attributes:{name:{type:"fieldName",default:"message",group:"content",label:"Field name (key)"},label:{type:"string",default:"Message",group:"content",label:"Label"},placeholder:{type:"string",default:"",group:"content",label:"Placeholder"},rows:{type:"number",default:4,min:2,max:20,group:"content",label:"Rows"},required:{type:"boolean",default:!1,group:"content",label:"Required"},helpText:{type:"string",default:"",group:"advanced",label:"Help text"},showLabel:{type:"boolean",default:!0,group:"style",label:"Show label"},padding:{type:"spacing",default:[0,0,12,0],group:"spacing",label:"Spacing"}}},select:{name:"Dropdown",category:"fields",attributes:{name:{type:"fieldName",default:"choice",group:"content",label:"Field name (key)"},label:{type:"string",default:"Choose one",group:"content",label:"Label"},placeholder:{type:"string",default:"Select\u2026",group:"content",label:"Placeholder option"},options:{type:"options",default:[{label:"Option 1",value:"option-1"},{label:"Option 2",value:"option-2"}],group:"content",label:"Options"},required:{type:"boolean",default:!1,group:"content",label:"Required"},helpText:{type:"string",default:"",group:"advanced",label:"Help text"},showLabel:{type:"boolean",default:!0,group:"style",label:"Show label"},padding:{type:"spacing",default:[0,0,12,0],group:"spacing",label:"Spacing"}}},radio:{name:"Radio group",category:"fields",attributes:{name:{type:"fieldName",default:"option",group:"content",label:"Field name (key)"},label:{type:"string",default:"Pick one",group:"content",label:"Label"},options:{type:"options",default:[{label:"Option 1",value:"option-1"},{label:"Option 2",value:"option-2"}],group:"content",label:"Options"},required:{type:"boolean",default:!1,group:"content",label:"Required"},inline:{type:"boolean",default:!1,group:"style",label:"Inline options"},showLabel:{type:"boolean",default:!0,group:"style",label:"Show label"},padding:{type:"spacing",default:[0,0,12,0],group:"spacing",label:"Spacing"}}},checkbox:{name:"Checkboxes",category:"fields",attributes:{name:{type:"fieldName",default:"choices",group:"content",label:"Field name (key)"},label:{type:"string",default:"Select all that apply",group:"content",label:"Label"},options:{type:"options",default:[{label:"Option 1",value:"option-1"},{label:"Option 2",value:"option-2"}],group:"content",label:"Options"},required:{type:"boolean",default:!1,group:"content",label:"Required"},inline:{type:"boolean",default:!1,group:"style",label:"Inline options"},showLabel:{type:"boolean",default:!0,group:"style",label:"Show label"},padding:{type:"spacing",default:[0,0,12,0],group:"spacing",label:"Spacing"}}},submit:{name:"Submit button",category:"structure",attributes:{text:{type:"string",default:"Submit",group:"content",label:"Button label"},alignment:{type:"alignment",default:"left",options:["left","center","right"],group:"style",label:"Alignment"},bg:{type:"color",default:"#0073E6",group:"style",label:"Background color"},color:{type:"color",default:"#FFFFFF",group:"style",label:"Text color"},fullWidth:{type:"boolean",default:!1,group:"style",label:"Full width"},padding:{type:"spacing",default:[12,24,12,24],group:"spacing",label:"Padding"},border:{type:"border",group:"border",label:"Border",default:{width:0,style:"solid",color:"#000000",radius:6}}}},heading:{name:"Heading",category:"content",attributes:{text:{type:"string",default:"Form heading",group:"content",label:"Text"},tag:{type:"select",default:"h3",options:["h1","h2","h3","h4"],group:"content",label:"Tag"},alignment:{type:"alignment",default:"left",group:"style",label:"Alignment"},color:{type:"color",default:"#0F172A",group:"style",label:"Color"},padding:{type:"spacing",default:[0,0,8,0],group:"spacing",label:"Spacing"}}},text:{name:"Text",category:"content",attributes:{text:{type:"richtext",default:"Helper text here.",group:"content",label:"Text"},alignment:{type:"alignment",default:"left",group:"style",label:"Alignment"},color:{type:"color",default:"#475569",group:"style",label:"Color"},padding:{type:"spacing",default:[0,0,8,0],group:"spacing",label:"Spacing"}}},divider:{name:"Divider",category:"structure",attributes:{color:{type:"color",default:"#E2E8F0",group:"style",label:"Color"},thickness:{type:"number",default:1,min:1,max:10,group:"style",label:"Thickness (px)"},padding:{type:"spacing",default:[8,0,8,0],group:"spacing",label:"Spacing"}}},spacer:{name:"Spacer",category:"structure",attributes:{height:{type:"number",default:16,min:1,max:200,group:"content",label:"Height (px)"}}},columns:{name:"Columns",category:"structure",attributes:{columns:{type:"number",default:2,min:1,max:4,group:"content",label:"Number of columns"},gap:{type:"number",default:16,min:0,max:60,group:"spacing",label:"Gap between columns (px)"},valign:{type:"select",default:"top",options:["top","middle","bottom"],group:"style",label:"Vertical align"},backgroundColor:{type:"color",default:"transparent",group:"style",label:"Background color"},padding:{type:"spacing",default:[0,0,0,0],group:"spacing",label:"Padding"},margin:{type:"spacing",default:[0,0,0,0],group:"spacing",label:"Margin"}}},column:{name:"Column",category:"structure",acceptsChildren:!0,hidden:!0,attributes:{padding:{type:"spacing",default:[0,0,0,0],group:"spacing",label:"Padding"}}},section:{name:"Section",category:"structure",acceptsChildren:!0,attributes:{backgroundColor:{type:"color",default:"transparent",group:"style",label:"Background color"},alignment:{type:"alignment",default:"left",options:["left","center","right"],group:"style",label:"Content alignment"},maxWidth:{type:"number",default:0,min:0,max:900,group:"spacing",label:"Max width (px, 0 = full)"},minHeight:{type:"number",default:0,min:0,max:1e3,group:"spacing",label:"Min height (px)"},padding:{type:"spacing",default:[0,0,0,0],group:"spacing",label:"Padding"},margin:{type:"spacing",default:[0,0,0,0],group:"spacing",label:"Margin"},border:{type:"border",group:"border",label:"Border",default:{width:0,style:"solid",color:"#E2E8F0",radius:0}},boxShadow:{type:"boxShadow",group:"effects",label:"Box shadow",default:{enabled:!1,x:0,y:2,blur:8,spread:0,color:"rgba(0,0,0,.08)",inset:!1}}}}}};import{createContext as A2,useContext as V2,useReducer as D2,useMemo as ji}from"react";import{jsx as P2}from"react/jsx-runtime";var T2=t=>{var r,e;return{tree:t,selectedId:(e=(r=t==null?void 0:t.root)==null?void 0:r.id)!=null?e:"root",editingId:null,dirty:!1,past:[],future:[],_lastCommit:null}},ko=50,E2=new Set(["UPDATE_ATTRS","ADD_CHILD","MOVE_NODE","REMOVE_NODE","REPLACE_NODE"]);function R2(t,r){var e,a;switch(r.type){case"SET_TREE":return{...t,tree:r.tree,dirty:!1};case"SELECT":return{...t,selectedId:r.id};case"START_EDITING":return{...t,selectedId:r.id,editingId:r.id};case"STOP_EDITING":return{...t,editingId:null};case"UPDATE_ATTRS":{let o=ge(t.tree),i=Kt(o.root,r.id);return i&&(i.attributes={...i.attributes||{},...r.attributes},i.type==="columns"&&"columns"in r.attributes&&N2(i)),{...t,tree:o,dirty:!0}}case"ADD_CHILD":{let o=ge(t.tree),i=r.containerId==="root"?o.root:Kt(o.root,r.containerId);if(!i)return t;i.children=i.children||[];let n=r.index==null||r.index<0?i.children.length:Math.max(0,Math.min(r.index,i.children.length));return i.children.splice(n,0,r.node),{...t,tree:o,selectedId:r.node.id,dirty:!0}}case"MOVE_NODE":{let o=ge(t.tree),i=or(o.root,r.activeId);if(!i)return t;let[n]=i.container.children.splice(i.index,1),d=r.destContainerId==="root"?o.root:Kt(o.root,r.destContainerId);if(!d)return i.container.children.splice(i.index,0,n),t;d.children=d.children||[];let l=r.destIndex==null||r.destIndex<0?d.children.length:r.destIndex;return i.container===d&&i.index<l&&(l-=1),l=Math.max(0,Math.min(l,d.children.length)),d.children.splice(l,0,n),{...t,tree:o,dirty:!0}}case"REMOVE_NODE":{let o=ge(t.tree),i=or(o.root,r.id);return i?(i.container.children.splice(i.index,1),{...t,tree:o,selectedId:t.selectedId===r.id?"root":t.selectedId,editingId:t.editingId===r.id?null:t.editingId,dirty:!0}):t}case"REPLACE_NODE":{let o=Array.isArray(r.nodes)?r.nodes:[];if(!o.length)return t;let i=ge(t.tree),n=or(i.root,r.id);return n?(n.container.children.splice(n.index,1,...o),{...t,tree:i,selectedId:(a=(e=o[0])==null?void 0:e.id)!=null?a:"root",editingId:t.editingId===r.id?null:t.editingId,dirty:!0}):t}case"MARK_CLEAN":return{...t,dirty:!1};default:return t}}var zi=(t,r)=>Kt(t.root,r)?r:"root";function F2(t,r){var a;if(r.type==="UNDO"){if(!t.past.length)return t;let o=t.past.slice(),i=o[o.length-1];return o.pop(),{...t,tree:i,past:o,future:[t.tree,...t.future].slice(0,ko),selectedId:zi(i,t.selectedId),editingId:null,dirty:!0,_lastCommit:null}}if(r.type==="REDO"){if(!t.future.length)return t;let[o,...i]=t.future;return{...t,tree:o,past:[...t.past,t.tree].slice(-ko),future:i,selectedId:zi(o,t.selectedId),editingId:null,dirty:!0,_lastCommit:null}}let e=R2(t,r);if(e===t)return e;if(r.type==="SET_TREE")return{...e,past:[],future:[],_lastCommit:null};if(E2.has(r.type)&&e.tree!==t.tree){let o=Date.now(),i=r.type==="UPDATE_ATTRS"&&((a=t._lastCommit)==null?void 0:a.type)==="UPDATE_ATTRS"&&t._lastCommit.id===r.id&&o-t._lastCommit.time<600;return{...e,past:i?t.past:[...t.past,t.tree].slice(-ko),future:[],_lastCommit:{type:r.type,id:r.id,time:o}}}return e}var ge=t=>JSON.parse(JSON.stringify(t)),Kt=(t,r)=>{if(!t)return null;if(t.id===r)return t;for(let e of t.children||[]){let a=Kt(e,r);if(a)return a}return null},or=(t,r)=>{var e;for(let a=0;a<(t.children||[]).length;a++){let o=t.children[a];if(o.id===r)return{container:t,index:a};if((e=o.children)!=null&&e.length){let i=or(o,r);if(i)return i}}return null},Si=A2(null);function Xe({tree:t,children:r}){let[e,a]=D2(F2,void 0,()=>T2(t)),o=ji(()=>({setTree:n=>a({type:"SET_TREE",tree:n}),select:n=>a({type:"SELECT",id:n}),startEditing:n=>a({type:"START_EDITING",id:n}),stopEditing:()=>a({type:"STOP_EDITING"}),updateAttrs:(n,d)=>a({type:"UPDATE_ATTRS",id:n,attributes:d}),addChild:(n,d,l)=>a({type:"ADD_CHILD",containerId:n,node:d,index:l}),moveNode:(n,d,l)=>a({type:"MOVE_NODE",activeId:n,destContainerId:d,destIndex:l}),removeNode:n=>a({type:"REMOVE_NODE",id:n}),replaceNode:(n,d)=>a({type:"REPLACE_NODE",id:n,nodes:d}),markClean:()=>a({type:"MARK_CLEAN"}),undo:()=>a({type:"UNDO"}),redo:()=>a({type:"REDO"})}),[]),i=ji(()=>({state:e,canUndo:e.past.length>0,canRedo:e.future.length>0,...o}),[e,o]);return P2(Si.Provider,{value:i,children:r})}var $=()=>{let t=V2(Si);if(!t)throw new Error("useEditor must be inside EditorStoreProvider");return t},Ye=()=>{let{state:t}=$();return Kt(t.tree.root,t.selectedId)};function Sr(t,r){var o;let e={};Object.entries(r.attributes||{}).forEach(([i,n])=>{e[i]=I2(n.default)});let a={id:Hi(),type:t,attributes:e,children:[]};if(t==="columns"){let i=Math.max(1,parseInt((o=e.columns)!=null?o:2,10)||2);a.children=Array.from({length:i},Ai)}return a}var Hi=()=>`n_${Math.random().toString(36).slice(2,10)}`;function Ai(){return{id:Hi(),type:"column",attributes:{padding:[0,0,0,0]},children:[]}}function N2(t){var a,o;let r=Math.max(1,parseInt((o=(a=t.attributes)==null?void 0:a.columns)!=null?o:1,10)||1);t.children=t.children||[];let e=t.children.filter(i=>i.type==="column");if(e.length<r)for(let i=e.length;i<r;i++)t.children.push(Ai());else if(e.length>r){let i=new Set(e.slice(r).map(n=>n.id));t.children=t.children.filter(n=>!i.has(n.id))}}var I2=t=>t==null||typeof t!="object"?t:JSON.parse(JSON.stringify(t));import{createContext as O2,useContext as fo,useMemo as _2}from"react";var pe=({allowedTypes:t=["image"],multiple:r=!1}={})=>new Promise((e,a)=>{if(typeof document=="undefined"){a(new Error("No document available to open a file picker"));return}let o=t.map(h=>h.includes("/")?h:`${h}/*`).join(","),i=document.createElement("input");i.type="file",i.accept=o,i.multiple=r,i.style.display="none";let n=!1,d=h=>{n||(n=!0,i.remove(),e(h))},l=h=>new Promise((s,u)=>{let k=new FileReader;k.onload=()=>s(k.result),k.onerror=()=>u(k.error||new Error("Failed to read the selected file")),k.readAsDataURL(h)}),c=h=>new Promise(s=>{let u=new Image;u.onload=()=>s({width:u.naturalWidth,height:u.naturalHeight}),u.onerror=()=>s({}),u.src=h});i.addEventListener("cancel",()=>d(null)),i.addEventListener("change",async()=>{let h=i.files&&i.files[0];if(!h){d(null);return}try{let s=await l(h),u=h.name.replace(/\.[^./\\]+$/,""),p=h.type.startsWith("image/")?await c(s):{};d({id:void 0,url:s,alt:u,...p})}catch(s){n=!0,i.remove(),a(s)}}),document.body.appendChild(i),i.click()});var Je={add_a_text_block:"Add a text block",add_block:"Add block",add_option:"Add option",advanced:"Advanced",align:"Align",align_center:"Align center",align_left:"Align left",align_right:"Align right",alt:"Alt",alt_text_accessibility:"Alt text (accessibility)",back_to_blocks:"Back to blocks",back_to_visual_editor:"Back to visual editor",blocks:"Blocks",bold:"Bold",bold_700:"Bold (700)",border:"Border",bulleted_list:"Bulleted list",capitalize:"Capitalize",choose_a_block:"Choose a block",choose_a_template:"Choose a template",choose_from_media_library:"Choose from media library",choose_from_the_media_library:"Choose from the media library",clear_formatting:"Clear formatting",close:"Close",close_esc:"Close (ESC)",close_navigator:"Close navigator",columns:"Columns",content:"Content",convert_to_blocks:"Convert to blocks",custom_width_in_pixels:"Custom width in pixels",delete:"Delete",delete_block:"Delete block",delete_columns:"Delete columns",delete_section:"Delete section",delete_this_block:"Delete this block?",desktop:"Desktop",drag_blocks_here:"Drag blocks here, or use \u201CAdd block\u201D above.",drag_columns:"Drag columns",drag_form_fields_here:"Drag form fields here, or use \u201CAdd block\u201D above.",drag_section:"Drag section",drag_to_reorder:"Drag to reorder",edit_html_source:"Edit HTML source",editing:"Editing",effects:"Effects",email_preview:"Email preview",email_settings:"Email settings",empty_drop_here:"Empty \u2014 drop here",enable_shadow:"Enable shadow",format:"Format",full:"Full",full_width_100:"Full width (100%)",heading_1:"Heading 1",heading_2:"Heading 2",heading_3:"Heading 3",heading_4:"Heading 4",heading_5:"Heading 5",heading_6:"Heading 6",image_size:"Image size",insert:"Insert",insert_block:"Insert block",insert_image:"Insert image",insert_link:"Insert link",insert_merge_tag:"Insert merge tag",insert_shortcode:"Insert shortcode",inset:"Inset",italic:"Italic",label:"Label",large:"Large",large_75:"Large (75%)",line_through:"Line-through",lowercase:"lowercase",medium:"Medium",medium_50:"Medium (50%)",mobile:"Mobile",navigator:"Navigator",no_blocks_found:"No blocks found",no_blocks_yet:"No blocks yet. Add blocks from the Blocks tab.",no_matching_tags:"No matching tags",no_options_in_this_tab:"No options in this tab.",no_templates_available:"No templates available.",none:"None",nothing_to_convert:"Nothing to convert \u2014 this block has no recognizable HTML content.",numbered_list:"Numbered list",paragraph:"Paragraph",paragraph_format:"Paragraph format",parse_html_help_text:"Parse this HTML into editable blocks \u2014 headings, text, images, lists. Anything unrecognized stays as HTML.",preview:"Preview",px_max_width:"px max width",redo_shortcut:"Redo (Ctrl+Shift+Z)",reload:"Reload",remove:"Remove",remove_image:"Remove image",remove_link:"Remove link",remove_option:"Remove option",rendering:"Rendering\u2026",replace:"Replace",replace_content_confirm:"Replace the current content with this template?",replace_image:"Replace image",search_blocks:"Search blocks\u2026",search_or_type_a_tag:"Search or type a tag\u2026",section:"Section",select_block_hint:"Select a block to edit its settings.",settings:"Settings",size:"Size",small:"Small",small_25:"Small (25%)",spacing_layout:"Spacing & layout",strikethrough:"Strikethrough",style:"Style",templates:"Templates",text_color:"Text color",toggle_navigator:"Toggle navigator",underline:"Underline",undo_shortcut:"Undo (Ctrl+Z)",unknown_block:"Unknown block",upload_image:"Upload image",uppercase:"UPPERCASE",value:"Value",block_email:"Email",block_heading:"Heading",block_text:"Text",block_button:"Button",block_divider:"Divider",block_spacer:"Spacer",block_image:"Image",block_video:"Video",block_list:"List",block_social:"Social",block_address:"Address",block_signature:"Signature",block_date:"Date",block_timer:"Timer",block_html:"Custom HTML",block_columns:"Columns",block_column:"Column",block_section:"Section",block_certificate:"Certificate",block_qr:"QR code",block_form:"Form",block_field:"Input",block_textarea:"Textarea",block_select:"Dropdown",block_radio:"Radio group",block_checkbox:"Checkboxes",block_submit:"Submit button",category_fields:"Fields",category_structure:"Structure",category_content:"Content",category_media:"Media",category_other:"Other"};import{jsx as U2}from"react/jsx-runtime";var $2={mergeTags:[],mediaUpload:pe,config:Je},Qe=O2($2);function ke({value:t,children:r}){let e=_2(()=>{var a,o;return{mergeTags:(a=t==null?void 0:t.mergeTags)!=null?a:[],mediaUpload:(o=t==null?void 0:t.mediaUpload)!=null?o:pe,config:t!=null&&t.config?{...Je,...t.config}:Je}},[t==null?void 0:t.mergeTags,t==null?void 0:t.mediaUpload,t==null?void 0:t.config]);return U2(Qe.Provider,{value:e,children:r})}var E=()=>fo(Qe),ir=()=>fo(Qe).mergeTags||[],fe=()=>fo(Qe).mediaUpload||pe;import{useEffect as ei,useMemo as r0,useRef as e0,useState as ai}from"react";import et,{createContext as Be,useContext as xr,useEffect as J,useState as Bt,useCallback as Dt,useMemo as Y,useRef as dt,memo as J2,useReducer as Q2,cloneElement as tl,forwardRef as rl}from"react";import{createPortal as el,unstable_batchedUpdates as aa}from"react-dom";import{useMemo as vo,useLayoutEffect as Z2,useEffect as Di,useRef as Hr,useCallback as ta}from"react";function Ti(){for(var t=arguments.length,r=new Array(t),e=0;e<t;e++)r[e]=arguments[e];return vo(()=>a=>{r.forEach(o=>o(a))},r)}var xe=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined";function sr(t){let r=Object.prototype.toString.call(t);return r==="[object Window]"||r==="[object global]"}function ra(t){return"nodeType"in t}function ct(t){var r,e;return t?sr(t)?t:ra(t)&&(r=(e=t.ownerDocument)==null?void 0:e.defaultView)!=null?r:window:window}function ea(t){let{Document:r}=ct(t);return t instanceof r}function Ar(t){return sr(t)?!1:t instanceof ct(t).HTMLElement}function Lo(t){return t instanceof ct(t).SVGElement}function ur(t){return t?sr(t)?t.document:ra(t)?ea(t)?t:Ar(t)||Lo(t)?t.ownerDocument:document:document:document}var Ct=xe?Z2:Di;function ve(t){let r=Hr(t);return Ct(()=>{r.current=t}),ta(function(){for(var e=arguments.length,a=new Array(e),o=0;o<e;o++)a[o]=arguments[o];return r.current==null?void 0:r.current(...a)},[])}function Ei(){let t=Hr(null),r=ta((a,o)=>{t.current=setInterval(a,o)},[]),e=ta(()=>{t.current!==null&&(clearInterval(t.current),t.current=null)},[]);return[r,e]}function Vr(t,r){r===void 0&&(r=[t]);let e=Hr(t);return Ct(()=>{e.current!==t&&(e.current=t)},r),e}function Dr(t,r){let e=Hr();return vo(()=>{let a=t(e.current);return e.current=a,a},[...r])}function Le(t){let r=ve(t),e=Hr(null),a=ta(o=>{o!==e.current&&(r==null||r(o,e.current)),e.current=o},[]);return[e,a]}function me(t){let r=Hr();return Di(()=>{r.current=t},[t]),r.current}var xo={};function gr(t,r){return vo(()=>{if(r)return r;let e=xo[t]==null?0:xo[t]+1;return xo[t]=e,t+"-"+e},[t,r])}function Ri(t){return function(r){for(var e=arguments.length,a=new Array(e>1?e-1:0),o=1;o<e;o++)a[o-1]=arguments[o];return a.reduce((i,n)=>{let d=Object.entries(n);for(let[l,c]of d){let h=i[l];h!=null&&(i[l]=h+t*c)}return i},{...r})}}var pr=Ri(1),Tr=Ri(-1);function q2(t){return"clientX"in t&&"clientY"in t}function Er(t){if(!t)return!1;let{KeyboardEvent:r}=ct(t.target);return r&&t instanceof r}function G2(t){if(!t)return!1;let{TouchEvent:r}=ct(t.target);return r&&t instanceof r}function Me(t){if(G2(t)){if(t.touches&&t.touches.length){let{clientX:r,clientY:e}=t.touches[0];return{x:r,y:e}}else if(t.changedTouches&&t.changedTouches.length){let{clientX:r,clientY:e}=t.changedTouches[0];return{x:r,y:e}}}return q2(t)?{x:t.clientX,y:t.clientY}:null}var xt=Object.freeze({Translate:{toString(t){if(!t)return;let{x:r,y:e}=t;return"translate3d("+(r?Math.round(r):0)+"px, "+(e?Math.round(e):0)+"px, 0)"}},Scale:{toString(t){if(!t)return;let{scaleX:r,scaleY:e}=t;return"scaleX("+r+") scaleY("+e+")"}},Transform:{toString(t){if(t)return[xt.Translate.toString(t),xt.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:r,duration:e,easing:a}=t;return r+" "+e+"ms "+a}}}),Vi="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Fi(t){return t.matches(Vi)?t:t.querySelector(Vi)}import Ni,{useState as K2,useCallback as X2}from"react";var Y2={display:"none"};function Ii(t){let{id:r,value:e}=t;return Ni.createElement("div",{id:r,style:Y2},e)}function Pi(t){let{id:r,announcement:e,ariaLiveType:a="assertive"}=t,o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return Ni.createElement("div",{id:r,style:o,role:"status","aria-live":a,"aria-atomic":!0},e)}function Oi(){let[t,r]=K2("");return{announce:X2(a=>{a!=null&&r(a)},[]),announcement:t}}var rn=Be(null);function al(t){let r=xr(rn);J(()=>{if(!r)throw new Error("useDndMonitor must be used within a children of <DndContext>");return r(t)},[t,r])}function ol(){let[t]=Bt(()=>new Set),r=Dt(a=>(t.add(a),()=>t.delete(a)),[t]);return[Dt(a=>{let{type:o,event:i}=a;t.forEach(n=>{var d;return(d=n[o])==null?void 0:d.call(n,i)})},[t]),r]}var il={draggable:`
6
6
  To pick up a draggable item, press the space bar.
7
7
  While dragging, use the arrow keys to move the item.
8
8
  Press space again to drop the item in its new position, or press escape to cancel.
9
- `},ol={onDragStart(t){let{active:r}=t;return"Picked up draggable item "+r.id+"."},onDragOver(t){let{active:r,over:e}=t;return e?"Draggable item "+r.id+" was moved over droppable area "+e.id+".":"Draggable item "+r.id+" is no longer over a droppable area."},onDragEnd(t){let{active:r,over:e}=t;return e?"Draggable item "+r.id+" was dropped over droppable area "+e.id:"Draggable item "+r.id+" was dropped."},onDragCancel(t){let{active:r}=t;return"Dragging was cancelled. Draggable item "+r.id+" was dropped."}};function il(t){let{announcements:r=ol,container:e,hiddenTextDescribedById:a,screenReaderInstructions:o=al}=t,{announce:i,announcement:n}=Oi(),d=gr("DndLiveRegion"),[l,c]=Bt(!1);if(J(()=>{c(!0)},[]),rl(Y(()=>({onDragStart(s){let{active:u}=s;i(r.onDragStart({active:u}))},onDragMove(s){let{active:u,over:f}=s;r.onDragMove&&i(r.onDragMove({active:u,over:f}))},onDragOver(s){let{active:u,over:f}=s;i(r.onDragOver({active:u,over:f}))},onDragEnd(s){let{active:u,over:f}=s;i(r.onDragEnd({active:u,over:f}))},onDragCancel(s){let{active:u,over:f}=s;i(r.onDragCancel({active:u,over:f}))}}),[i,r])),!l)return null;let h=et.createElement(et.Fragment,null,et.createElement(Ii,{id:a,value:o.draggable}),et.createElement(Pi,{id:d,announcement:n}));return e?tl(h,e):h}var rt;(function(t){t.DragStart="dragStart",t.DragMove="dragMove",t.DragEnd="dragEnd",t.DragCancel="dragCancel",t.DragOver="dragOver",t.RegisterDroppable="registerDroppable",t.SetDroppableDisabled="setDroppableDisabled",t.UnregisterDroppable="unregisterDroppable"})(rt||(rt={}));function ia(){}function en(t,r){return Y(()=>({sensor:t,options:r!=null?r:{}}),[t,r])}function an(){for(var t=arguments.length,r=new Array(t),e=0;e<t;e++)r[e]=arguments[e];return Y(()=>[...r].filter(a=>a!=null),[...r])}var Rt=Object.freeze({x:0,y:0});function nl(t,r){return Math.sqrt(Math.pow(t.x-r.x,2)+Math.pow(t.y-r.y,2))}function dl(t,r){let e=Me(t);if(!e)return"0 0";let a={x:(e.x-r.left)/r.width*100,y:(e.y-r.top)/r.height*100};return a.x+"% "+a.y+"%"}function ll(t,r){let{data:{value:e}}=t,{data:{value:a}}=r;return e-a}function cl(t,r){let{data:{value:e}}=t,{data:{value:a}}=r;return a-e}function on(t,r){if(!t||t.length===0)return null;let[e]=t;return r?e[r]:e}function _i(t,r,e){return r===void 0&&(r=t.left),e===void 0&&(e=t.top),{x:r+t.width*.5,y:e+t.height*.5}}var la=t=>{let{collisionRect:r,droppableRects:e,droppableContainers:a}=t,o=_i(r,r.left,r.top),i=[];for(let n of a){let{id:d}=n,l=e.get(d);if(l){let c=nl(_i(l),o);i.push({id:d,data:{droppableContainer:n,value:c}})}}return i.sort(ll)};function hl(t,r){let e=Math.max(r.top,t.top),a=Math.max(r.left,t.left),o=Math.min(r.left+r.width,t.left+t.width),i=Math.min(r.top+r.height,t.top+t.height),n=o-a,d=i-e;if(a<o&&e<i){let l=r.width*r.height,c=t.width*t.height,h=n*d,s=h/(l+c-h);return Number(s.toFixed(4))}return 0}var sl=t=>{let{collisionRect:r,droppableRects:e,droppableContainers:a}=t,o=[];for(let i of a){let{id:n}=i,d=e.get(n);if(d){let l=hl(d,r);l>0&&o.push({id:n,data:{droppableContainer:i,value:l}})}}return o.sort(cl)};function ul(t,r,e){return{...t,scaleX:r&&e?r.width/e.width:1,scaleY:r&&e?r.height/e.height:1}}function nn(t,r){return t&&r?{x:t.left-r.left,y:t.top-r.top}:Rt}function gl(t){return function(e){for(var a=arguments.length,o=new Array(a>1?a-1:0),i=1;i<a;i++)o[i-1]=arguments[i];return o.reduce((n,d)=>({...n,top:n.top+t*d.y,bottom:n.bottom+t*d.y,left:n.left+t*d.x,right:n.right+t*d.x}),{...e})}}var pl=gl(1);function dn(t){if(t.startsWith("matrix3d(")){let r=t.slice(9,-1).split(/, /);return{x:+r[12],y:+r[13],scaleX:+r[0],scaleY:+r[5]}}else if(t.startsWith("matrix(")){let r=t.slice(7,-1).split(/, /);return{x:+r[4],y:+r[5],scaleX:+r[0],scaleY:+r[3]}}return null}function fl(t,r,e){let a=dn(r);if(!a)return t;let{scaleX:o,scaleY:i,x:n,y:d}=a,l=t.left-n-(1-o)*parseFloat(e),c=t.top-d-(1-i)*parseFloat(e.slice(e.indexOf(" ")+1)),h=o?t.width/o:t.width,s=i?t.height/i:t.height;return{width:h,height:s,top:c,right:l+h,bottom:c+s,left:l}}var kl={ignoreTransform:!1};function vr(t,r){r===void 0&&(r=kl);let e=t.getBoundingClientRect();if(r.ignoreTransform){let{transform:c,transformOrigin:h}=ct(t).getComputedStyle(t);c&&(e=fl(e,c,h))}let{top:a,left:o,width:i,height:n,bottom:d,right:l}=e;return{top:a,left:o,width:i,height:n,bottom:d,right:l}}function $i(t){return vr(t,{ignoreTransform:!0})}function xl(t){let r=t.innerWidth,e=t.innerHeight;return{top:0,left:0,right:r,bottom:e,width:r,height:e}}function vl(t,r){return r===void 0&&(r=ct(t).getComputedStyle(t)),r.position==="fixed"}function Ll(t,r){r===void 0&&(r=ct(t).getComputedStyle(t));let e=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{let i=r[o];return typeof i=="string"?e.test(i):!1})}function ca(t,r){let e=[];function a(o){if(r!=null&&e.length>=r||!o)return e;if(ea(o)&&o.scrollingElement!=null&&!e.includes(o.scrollingElement))return e.push(o.scrollingElement),e;if(!Vr(o)||Lo(o)||e.includes(o))return e;let i=ct(t).getComputedStyle(o);return o!==t&&Ll(o,i)&&e.push(o),vl(o,i)?e:a(o.parentNode)}return t?a(t):e}function ln(t){let[r]=ca(t,1);return r!=null?r:null}function mo(t){return!xe||!t?null:sr(t)?t:ra(t)?ea(t)||t===ur(t).scrollingElement?window:Vr(t)?t:null:null}function cn(t){return sr(t)?t.scrollX:t.scrollLeft}function hn(t){return sr(t)?t.scrollY:t.scrollTop}function yo(t){return{x:cn(t),y:hn(t)}}var at;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(at||(at={}));function sn(t){return!xe||!t?!1:t===document.scrollingElement}function un(t){let r={x:0,y:0},e=sn(t)?{height:window.innerHeight,width:window.innerWidth}:{height:t.clientHeight,width:t.clientWidth},a={x:t.scrollWidth-e.width,y:t.scrollHeight-e.height},o=t.scrollTop<=r.y,i=t.scrollLeft<=r.x,n=t.scrollTop>=a.y,d=t.scrollLeft>=a.x;return{isTop:o,isLeft:i,isBottom:n,isRight:d,maxScroll:a,minScroll:r}}var ml={x:.2,y:.2};function Ml(t,r,e,a,o){let{top:i,left:n,right:d,bottom:l}=e;a===void 0&&(a=10),o===void 0&&(o=ml);let{isTop:c,isBottom:h,isLeft:s,isRight:u}=un(t),f={x:0,y:0},p={x:0,y:0},g={height:r.height*o.y,width:r.width*o.x};return!c&&i<=r.top+g.height?(f.y=at.Backward,p.y=a*Math.abs((r.top+g.height-i)/g.height)):!h&&l>=r.bottom-g.height&&(f.y=at.Forward,p.y=a*Math.abs((r.bottom-g.height-l)/g.height)),!u&&d>=r.right-g.width?(f.x=at.Forward,p.x=a*Math.abs((r.right-g.width-d)/g.width)):!s&&n<=r.left+g.width&&(f.x=at.Backward,p.x=a*Math.abs((r.left+g.width-n)/g.width)),{direction:f,speed:p}}function bl(t){if(t===document.scrollingElement){let{innerWidth:i,innerHeight:n}=window;return{top:0,left:0,right:i,bottom:n,width:i,height:n}}let{top:r,left:e,right:a,bottom:o}=t.getBoundingClientRect();return{top:r,left:e,right:a,bottom:o,width:t.clientWidth,height:t.clientHeight}}function gn(t){return t.reduce((r,e)=>pr(r,yo(e)),Rt)}function yl(t){return t.reduce((r,e)=>r+cn(e),0)}function wl(t){return t.reduce((r,e)=>r+hn(e),0)}function pn(t,r){if(r===void 0&&(r=vr),!t)return;let{top:e,left:a,bottom:o,right:i}=r(t);ln(t)&&(o<=0||i<=0||e>=window.innerHeight||a>=window.innerWidth)&&t.scrollIntoView({block:"center",inline:"center"})}var Cl=[["x",["left","right"],yl],["y",["top","bottom"],wl]],ye=class{constructor(r,e){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;let a=ca(e),o=gn(a);this.rect={...r},this.width=r.width,this.height=r.height;for(let[i,n,d]of Cl)for(let l of n)Object.defineProperty(this,l,{get:()=>{let c=d(a),h=o[i]-c;return this.rect[l]+h},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}},fr=class{constructor(r){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>{var a;return(a=this.target)==null?void 0:a.removeEventListener(...e)})},this.target=r}add(r,e,a){var o;(o=this.target)==null||o.addEventListener(r,e,a),this.listeners.push([r,e,a])}};function Bl(t){let{EventTarget:r}=ct(t);return t instanceof r?t:ur(t)}function Mo(t,r){let e=Math.abs(t.x),a=Math.abs(t.y);return typeof r=="number"?Math.sqrt(e**2+a**2)>r:"x"in r&&"y"in r?e>r.x&&a>r.y:"x"in r?e>r.x:"y"in r?a>r.y:!1}var Vt;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(Vt||(Vt={}));function Ui(t){t.preventDefault()}function Wl(t){t.stopPropagation()}var I;(function(t){t.Space="Space",t.Down="ArrowDown",t.Right="ArrowRight",t.Left="ArrowLeft",t.Up="ArrowUp",t.Esc="Escape",t.Enter="Enter",t.Tab="Tab"})(I||(I={}));var fn={start:[I.Space,I.Enter],cancel:[I.Esc],end:[I.Space,I.Enter,I.Tab]},jl=(t,r)=>{let{currentCoordinates:e}=r;switch(t.code){case I.Right:return{...e,x:e.x+25};case I.Left:return{...e,x:e.x-25};case I.Down:return{...e,y:e.y+25};case I.Up:return{...e,y:e.y-25}}},na=class{constructor(r){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=r;let{event:{target:e}}=r;this.props=r,this.listeners=new fr(ur(e)),this.windowListeners=new fr(ct(e)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Vt.Resize,this.handleCancel),this.windowListeners.add(Vt.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Vt.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:r,onStart:e}=this.props,a=r.node.current;a&&pn(a),e(Rt)}handleKeyDown(r){if(Er(r)){let{active:e,context:a,options:o}=this.props,{keyboardCodes:i=fn,coordinateGetter:n=jl,scrollBehavior:d="smooth"}=o,{code:l}=r;if(i.end.includes(l)){this.handleEnd(r);return}if(i.cancel.includes(l)){this.handleCancel(r);return}let{collisionRect:c}=a.current,h=c?{x:c.left,y:c.top}:Rt;this.referenceCoordinates||(this.referenceCoordinates=h);let s=n(r,{active:e,context:a.current,currentCoordinates:h});if(s){let u=Rr(s,h),f={x:0,y:0},{scrollableAncestors:p}=a.current;for(let g of p){let x=r.code,{isTop:y,isRight:M,isLeft:v,isBottom:k,maxScroll:m,minScroll:L}=un(g),w=bl(g),B={x:Math.min(x===I.Right?w.right-w.width/2:w.right,Math.max(x===I.Right?w.left:w.left+w.width/2,s.x)),y:Math.min(x===I.Down?w.bottom-w.height/2:w.bottom,Math.max(x===I.Down?w.top:w.top+w.height/2,s.y))},H=x===I.Right&&!M||x===I.Left&&!v,W=x===I.Down&&!k||x===I.Up&&!y;if(H&&B.x!==s.x){let S=g.scrollLeft+u.x,N=x===I.Right&&S<=m.x||x===I.Left&&S>=L.x;if(N&&!u.y){g.scrollTo({left:S,behavior:d});return}N?f.x=g.scrollLeft-S:f.x=x===I.Right?g.scrollLeft-m.x:g.scrollLeft-L.x,f.x&&g.scrollBy({left:-f.x,behavior:d});break}else if(W&&B.y!==s.y){let S=g.scrollTop+u.y,N=x===I.Down&&S<=m.y||x===I.Up&&S>=L.y;if(N&&!u.x){g.scrollTo({top:S,behavior:d});return}N?f.y=g.scrollTop-S:f.y=x===I.Down?g.scrollTop-m.y:g.scrollTop-L.y,f.y&&g.scrollBy({top:-f.y,behavior:d});break}}this.handleMove(r,pr(Rr(s,this.referenceCoordinates),f))}}}handleMove(r,e){let{onMove:a}=this.props;r.preventDefault(),a(e)}handleEnd(r){let{onEnd:e}=this.props;r.preventDefault(),this.detach(),e()}handleCancel(r){let{onCancel:e}=this.props;r.preventDefault(),this.detach(),e()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}};na.activators=[{eventName:"onKeyDown",handler:(t,r,e)=>{let{keyboardCodes:a=fn,onActivation:o}=r,{active:i}=e,{code:n}=t.nativeEvent;if(a.start.includes(n)){let d=i.activatorNode.current;return d&&t.target!==d?!1:(t.preventDefault(),o==null||o({event:t.nativeEvent}),!0)}return!1}}];function Zi(t){return!!(t&&"distance"in t)}function qi(t){return!!(t&&"delay"in t)}var we=class{constructor(r,e,a){var o;a===void 0&&(a=Bl(r.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=r,this.events=e;let{event:i}=r,{target:n}=i;this.props=r,this.events=e,this.document=ur(n),this.documentListeners=new fr(this.document),this.listeners=new fr(a),this.windowListeners=new fr(ct(n)),this.initialCoordinates=(o=Me(i))!=null?o:Rt,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){let{events:r,props:{options:{activationConstraint:e,bypassActivationConstraint:a}}}=this;if(this.listeners.add(r.move.name,this.handleMove,{passive:!1}),this.listeners.add(r.end.name,this.handleEnd),r.cancel&&this.listeners.add(r.cancel.name,this.handleCancel),this.windowListeners.add(Vt.Resize,this.handleCancel),this.windowListeners.add(Vt.DragStart,Ui),this.windowListeners.add(Vt.VisibilityChange,this.handleCancel),this.windowListeners.add(Vt.ContextMenu,Ui),this.documentListeners.add(Vt.Keydown,this.handleKeydown),e){if(a!=null&&a({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(qi(e)){this.timeoutId=setTimeout(this.handleStart,e.delay),this.handlePending(e);return}if(Zi(e)){this.handlePending(e);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(r,e){let{active:a,onPending:o}=this.props;o(a,r,this.initialCoordinates,e)}handleStart(){let{initialCoordinates:r}=this,{onStart:e}=this.props;r&&(this.activated=!0,this.documentListeners.add(Vt.Click,Wl,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Vt.SelectionChange,this.removeTextSelection),e(r))}handleMove(r){var e;let{activated:a,initialCoordinates:o,props:i}=this,{onMove:n,options:{activationConstraint:d}}=i;if(!o)return;let l=(e=Me(r))!=null?e:Rt,c=Rr(o,l);if(!a&&d){if(Zi(d)){if(d.tolerance!=null&&Mo(c,d.tolerance))return this.handleCancel();if(Mo(c,d.distance))return this.handleStart()}if(qi(d)&&Mo(c,d.tolerance))return this.handleCancel();this.handlePending(d,c);return}r.cancelable&&r.preventDefault(),n(l)}handleEnd(){let{onAbort:r,onEnd:e}=this.props;this.detach(),this.activated||r(this.props.active),e()}handleCancel(){let{onAbort:r,onCancel:e}=this.props;this.detach(),this.activated||r(this.props.active),e()}handleKeydown(r){r.code===I.Esc&&this.handleCancel()}removeTextSelection(){var r;(r=this.document.getSelection())==null||r.removeAllRanges()}},Sl={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}},Fr=class extends we{constructor(r){let{event:e}=r,a=ur(e.target);super(r,Sl,a)}};Fr.activators=[{eventName:"onPointerDown",handler:(t,r)=>{let{nativeEvent:e}=t,{onActivation:a}=r;return!e.isPrimary||e.button!==0?!1:(a==null||a({event:e}),!0)}}];var Hl={move:{name:"mousemove"},end:{name:"mouseup"}},wo;(function(t){t[t.RightClick=2]="RightClick"})(wo||(wo={}));var Co=class extends we{constructor(r){super(r,Hl,ur(r.event.target))}};Co.activators=[{eventName:"onMouseDown",handler:(t,r)=>{let{nativeEvent:e}=t,{onActivation:a}=r;return e.button===wo.RightClick?!1:(a==null||a({event:e}),!0)}}];var bo={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}},Bo=class extends we{constructor(r){super(r,bo)}static setup(){return window.addEventListener(bo.move.name,r,{capture:!1,passive:!1}),function(){window.removeEventListener(bo.move.name,r)};function r(){}}};Bo.activators=[{eventName:"onTouchStart",handler:(t,r)=>{let{nativeEvent:e}=t,{onActivation:a}=r,{touches:o}=e;return o.length>1?!1:(a==null||a({event:e}),!0)}}];var be;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(be||(be={}));var da;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(da||(da={}));function Al(t){let{acceleration:r,activator:e=be.Pointer,canScroll:a,draggingRect:o,enabled:i,interval:n=5,order:d=da.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:h,delta:s,threshold:u}=t,f=Dl({delta:s,disabled:!i}),[p,g]=Ei(),x=dt({x:0,y:0}),y=dt({x:0,y:0}),M=Y(()=>{switch(e){case be.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case be.DraggableRect:return o}},[e,o,l]),v=dt(null),k=Tt(()=>{let L=v.current;if(!L)return;let w=x.current.x*y.current.x,B=x.current.y*y.current.y;L.scrollBy(w,B)},[]),m=Y(()=>d===da.TreeOrder?[...c].reverse():c,[d,c]);J(()=>{if(!i||!c.length||!M){g();return}for(let L of m){if((a==null?void 0:a(L))===!1)continue;let w=c.indexOf(L),B=h[w];if(!B)continue;let{direction:H,speed:W}=Ml(L,B,M,r,u);for(let S of["x","y"])f[S][H[S]]||(W[S]=0,H[S]=0);if(W.x>0||W.y>0){g(),v.current=L,p(k,n),x.current=W,y.current=H;return}}x.current={x:0,y:0},y.current={x:0,y:0},g()},[r,k,a,g,i,n,JSON.stringify(M),JSON.stringify(f),p,c,m,h,JSON.stringify(u)])}var Vl={x:{[at.Backward]:!1,[at.Forward]:!1},y:{[at.Backward]:!1,[at.Forward]:!1}};function Dl(t){let{delta:r,disabled:e}=t,a=me(r);return Tr(o=>{if(e||!a||!o)return Vl;let i={x:Math.sign(r.x-a.x),y:Math.sign(r.y-a.y)};return{x:{[at.Backward]:o.x[at.Backward]||i.x===-1,[at.Forward]:o.x[at.Forward]||i.x===1},y:{[at.Backward]:o.y[at.Backward]||i.y===-1,[at.Forward]:o.y[at.Forward]||i.y===1}}},[e,r,a])}function Tl(t,r){let e=r!=null?t.get(r):void 0,a=e?e.node.current:null;return Tr(o=>{var i;return r==null?null:(i=a!=null?a:o)!=null?i:null},[a,r])}function Rl(t,r){return Y(()=>t.reduce((e,a)=>{let{sensor:o}=a,i=o.activators.map(n=>({eventName:n.eventName,handler:r(n.handler,a)}));return[...e,...i]},[]),[t,r])}var Ce;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(Ce||(Ce={}));var Wo;(function(t){t.Optimized="optimized"})(Wo||(Wo={}));var Gi=new Map;function El(t,r){let{dragging:e,dependencies:a,config:o}=r,[i,n]=Bt(null),{frequency:d,measure:l,strategy:c}=o,h=dt(t),s=x(),u=Dr(s),f=Tt(function(y){y===void 0&&(y=[]),!u.current&&n(M=>M===null?y:M.concat(y.filter(v=>!M.includes(v))))},[u]),p=dt(null),g=Tr(y=>{if(s&&!e)return Gi;if(!y||y===Gi||h.current!==t||i!=null){let M=new Map;for(let v of t){if(!v)continue;if(i&&i.length>0&&!i.includes(v.id)&&v.rect.current){M.set(v.id,v.rect.current);continue}let k=v.node.current,m=k?new ye(l(k),k):null;v.rect.current=m,m&&M.set(v.id,m)}return M}return y},[t,i,e,s,l]);return J(()=>{h.current=t},[t]),J(()=>{s||f()},[e,s]),J(()=>{i&&i.length>0&&n(null)},[JSON.stringify(i)]),J(()=>{s||typeof d!="number"||p.current!==null||(p.current=setTimeout(()=>{f(),p.current=null},d))},[d,s,f,...a]),{droppableRects:g,measureDroppableContainers:f,measuringScheduled:i!=null};function x(){switch(c){case Ce.Always:return!1;case Ce.BeforeDragging:return e;default:return!e}}}function jo(t,r){return Tr(e=>t?e||(typeof r=="function"?r(t):t):null,[r,t])}function Fl(t,r){return jo(t,r)}function Nl(t){let{callback:r,disabled:e}=t,a=ve(r),o=Y(()=>{if(e||typeof window=="undefined"||typeof window.MutationObserver=="undefined")return;let{MutationObserver:i}=window;return new i(a)},[a,e]);return J(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function ha(t){let{callback:r,disabled:e}=t,a=ve(r),o=Y(()=>{if(e||typeof window=="undefined"||typeof window.ResizeObserver=="undefined")return;let{ResizeObserver:i}=window;return new i(a)},[e]);return J(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function zl(t){return new ye(vr(t),t)}function Ki(t,r,e){r===void 0&&(r=zl);let[a,o]=Bt(null);function i(){o(l=>{if(!t)return null;if(t.isConnected===!1){var c;return(c=l!=null?l:e)!=null?c:null}let h=r(t);return JSON.stringify(l)===JSON.stringify(h)?l:h})}let n=Nl({callback(l){if(t)for(let c of l){let{type:h,target:s}=c;if(h==="childList"&&s instanceof HTMLElement&&s.contains(t)){i();break}}}}),d=ha({callback:i});return Ct(()=>{i(),t?(d==null||d.observe(t),n==null||n.observe(document.body,{childList:!0,subtree:!0})):(d==null||d.disconnect(),n==null||n.disconnect())},[t]),a}function Il(t){let r=jo(t);return nn(t,r)}var Xi=[];function Pl(t){let r=dt(t),e=Tr(a=>t?a&&a!==Xi&&t&&r.current&&t.parentNode===r.current.parentNode?a:ca(t):Xi,[t]);return J(()=>{r.current=t},[t]),e}function Ol(t){let[r,e]=Bt(null),a=dt(t),o=Tt(i=>{let n=mo(i.target);n&&e(d=>d?(d.set(n,yo(n)),new Map(d)):null)},[]);return J(()=>{let i=a.current;if(t!==i){n(i);let d=t.map(l=>{let c=mo(l);return c?(c.addEventListener("scroll",o,{passive:!0}),[c,yo(c)]):null}).filter(l=>l!=null);e(d.length?new Map(d):null),a.current=t}return()=>{n(t),n(i)};function n(d){d.forEach(l=>{let c=mo(l);c==null||c.removeEventListener("scroll",o)})}},[o,t]),Y(()=>t.length?r?Array.from(r.values()).reduce((i,n)=>pr(i,n),Rt):gn(t):Rt,[t,r])}function Yi(t,r){r===void 0&&(r=[]);let e=dt(null);return J(()=>{e.current=null},r),J(()=>{let a=t!==Rt;a&&!e.current&&(e.current=t),!a&&e.current&&(e.current=null)},[t]),e.current?Rr(t,e.current):Rt}function _l(t){J(()=>{if(!xe)return;let r=t.map(e=>{let{sensor:a}=e;return a.setup==null?void 0:a.setup()});return()=>{for(let e of r)e==null||e()}},t.map(r=>{let{sensor:e}=r;return e}))}function $l(t,r){return Y(()=>t.reduce((e,a)=>{let{eventName:o,handler:i}=a;return e[o]=n=>{i(n,r)},e},{}),[t,r])}function kn(t){return Y(()=>t?xl(t):null,[t])}var Ji=[];function Ul(t,r){r===void 0&&(r=vr);let[e]=t,a=kn(e?ct(e):null),[o,i]=Bt(Ji);function n(){i(()=>t.length?t.map(l=>sn(l)?a:new ye(r(l),l)):Ji)}let d=ha({callback:n});return Ct(()=>{d==null||d.disconnect(),n(),t.forEach(l=>d==null?void 0:d.observe(l))},[t]),o}function xn(t){if(!t)return null;if(t.children.length>1)return t;let r=t.children[0];return Vr(r)?r:t}function Zl(t){let{measure:r}=t,[e,a]=Bt(null),o=Tt(c=>{for(let{target:h}of c)if(Vr(h)){a(s=>{let u=r(h);return s?{...s,width:u.width,height:u.height}:u});break}},[r]),i=ha({callback:o}),n=Tt(c=>{let h=xn(c);i==null||i.disconnect(),h&&(i==null||i.observe(h)),a(h?r(h):null)},[r,i]),[d,l]=Le(n);return Y(()=>({nodeRef:d,rect:e,setRef:l}),[e,d,l])}var ql=[{sensor:Fr,options:{}},{sensor:na,options:{}}],Gl={current:{}},oa={draggable:{measure:$i},droppable:{measure:$i,strategy:Ce.WhileDragging,frequency:Wo.Optimized},dragOverlay:{measure:vr}},kr=class extends Map{get(r){var e;return r!=null&&(e=super.get(r))!=null?e:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(r=>{let{disabled:e}=r;return!e})}getNodeFor(r){var e,a;return(e=(a=this.get(r))==null?void 0:a.node.current)!=null?e:void 0}},Kl={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new kr,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:ia},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:oa,measureDroppableContainers:ia,windowRect:null,measuringScheduled:!1},vn={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:ia,draggableNodes:new Map,over:null,measureDroppableContainers:ia},We=Be(vn),Ln=Be(Kl);function Xl(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new kr}}}function Yl(t,r){switch(r.type){case rt.DragStart:return{...t,draggable:{...t.draggable,initialCoordinates:r.initialCoordinates,active:r.active}};case rt.DragMove:return t.draggable.active==null?t:{...t,draggable:{...t.draggable,translate:{x:r.coordinates.x-t.draggable.initialCoordinates.x,y:r.coordinates.y-t.draggable.initialCoordinates.y}}};case rt.DragEnd:case rt.DragCancel:return{...t,draggable:{...t.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case rt.RegisterDroppable:{let{element:e}=r,{id:a}=e,o=new kr(t.droppable.containers);return o.set(a,e),{...t,droppable:{...t.droppable,containers:o}}}case rt.SetDroppableDisabled:{let{id:e,key:a,disabled:o}=r,i=t.droppable.containers.get(e);if(!i||a!==i.key)return t;let n=new kr(t.droppable.containers);return n.set(e,{...i,disabled:o}),{...t,droppable:{...t.droppable,containers:n}}}case rt.UnregisterDroppable:{let{id:e,key:a}=r,o=t.droppable.containers.get(e);if(!o||a!==o.key)return t;let i=new kr(t.droppable.containers);return i.delete(e),{...t,droppable:{...t.droppable,containers:i}}}default:return t}}function Jl(t){let{disabled:r}=t,{active:e,activatorEvent:a,draggableNodes:o}=xr(We),i=me(a),n=me(e==null?void 0:e.id);return J(()=>{if(!r&&!a&&i&&n!=null){if(!Er(i)||document.activeElement===i.target)return;let d=o.get(n);if(!d)return;let{activatorNode:l,node:c}=d;if(!l.current&&!c.current)return;requestAnimationFrame(()=>{for(let h of[l.current,c.current]){if(!h)continue;let s=Ni(h);if(s){s.focus();break}}})}},[a,r,o,n,i]),null}function mn(t,r){let{transform:e,...a}=r;return t!=null&&t.length?t.reduce((o,i)=>i({transform:o,...a}),e):e}function Ql(t){return Y(()=>({draggable:{...oa.draggable,...t==null?void 0:t.draggable},droppable:{...oa.droppable,...t==null?void 0:t.droppable},dragOverlay:{...oa.dragOverlay,...t==null?void 0:t.dragOverlay}}),[t==null?void 0:t.draggable,t==null?void 0:t.droppable,t==null?void 0:t.dragOverlay])}function tc(t){let{activeNode:r,measure:e,initialRect:a,config:o=!0}=t,i=dt(!1),{x:n,y:d}=typeof o=="boolean"?{x:o,y:o}:o;Ct(()=>{if(!n&&!d||!r){i.current=!1;return}if(i.current||!a)return;let c=r==null?void 0:r.node.current;if(!c||c.isConnected===!1)return;let h=e(c),s=nn(h,a);if(n||(s.x=0),d||(s.y=0),i.current=!0,Math.abs(s.x)>0||Math.abs(s.y)>0){let u=ln(c);u&&u.scrollBy({top:s.y,left:s.x})}},[r,n,d,a,e])}var sa=Be({...Rt,scaleX:1,scaleY:1}),nr;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(nr||(nr={}));var ua=X2(function(r){var e,a,o,i;let{id:n,accessibility:d,autoScroll:l=!0,children:c,sensors:h=ql,collisionDetection:s=sl,measuring:u,modifiers:f,...p}=r,g=Y2(Yl,void 0,Xl),[x,y]=g,[M,v]=el(),[k,m]=Bt(nr.Uninitialized),L=k===nr.Initialized,{draggable:{active:w,nodes:B,translate:H},droppable:{containers:W}}=x,S=w!=null?B.get(w):null,N=dt({initial:null,translated:null}),V=Y(()=>{var lt;return w!=null?{id:w,data:(lt=S==null?void 0:S.data)!=null?lt:Gl,rect:N}:null},[w,S]),A=dt(null),[z,G]=Bt(null),[O,U]=Bt(null),vt=Dr(p,Object.values(p)),mt=gr("DndDescribedBy",n),Lt=Y(()=>W.getEnabled(),[W]),tt=Ql(u),{droppableRects:Ht,measureDroppableContainers:It,measuringScheduled:hr}=El(Lt,{dragging:L,dependencies:[H.x,H.y],config:tt.droppable}),Mt=Tl(B,w),qe=Y(()=>O?Me(O):null,[O]),Jt=W2(),Zt=Fl(Mt,tt.draggable.measure);tc({activeNode:w!=null?B.get(w):null,config:Jt.layoutShiftCompensation,initialRect:Zt,measure:tt.draggable.measure});let _=Ki(Mt,tt.draggable.measure,Zt),le=Ki(Mt?Mt.parentElement:null),Pt=dt({activatorEvent:null,active:null,activeNode:Mt,collisionRect:null,collisions:null,droppableRects:Ht,draggableNodes:B,draggingNode:null,draggingNodeRect:null,droppableContainers:W,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),wr=W.getNodeFor((e=Pt.current.over)==null?void 0:e.id),qt=Zl({measure:tt.dragOverlay.measure}),Cr=(a=qt.nodeRef.current)!=null?a:Mt,Br=L?(o=qt.rect)!=null?o:_:null,Li=!!(qt.nodeRef.current&&qt.rect),mi=Il(Li?null:_),so=kn(Cr?ct(Cr):null),Qt=Pl(L?wr!=null?wr:Mt:null),Ge=Ul(Qt),Ke=mn(f,{transform:{x:H.x-mi.x,y:H.y-mi.y,scaleX:1,scaleY:1},activatorEvent:O,active:V,activeNodeRect:_,containerNodeRect:le,draggingNodeRect:Br,over:Pt.current.over,overlayNodeRect:qt.rect,scrollableAncestors:Qt,scrollableAncestorRects:Ge,windowRect:so}),Mi=qe?pr(qe,H):null,bi=Ol(Qt),m2=Yi(bi),M2=Yi(bi,[_]),Wr=pr(Ke,m2),jr=Br?pl(Br,Ke):null,ce=V&&jr?s({active:V,collisionRect:jr,droppableRects:Ht,droppableContainers:Lt,pointerCoordinates:Mi}):null,yi=on(ce,"id"),[tr,wi]=Bt(null),b2=Li?Ke:pr(Ke,M2),y2=ul(b2,(i=tr==null?void 0:tr.rect)!=null?i:null,_),uo=dt(null),Ci=Tt((lt,bt)=>{let{sensor:yt,options:rr}=bt;if(A.current==null)return;let At=B.get(A.current);if(!At)return;let wt=lt.nativeEvent,Ot=new yt({active:A.current,activeNode:At,event:wt,options:rr,context:Pt,onAbort(nt){if(!B.get(nt))return;let{onDragAbort:_t}=vt.current,Gt={id:nt};_t==null||_t(Gt),M({type:"onDragAbort",event:Gt})},onPending(nt,er,_t,Gt){if(!B.get(nt))return;let{onDragPending:se}=vt.current,ar={id:nt,constraint:er,initialCoordinates:_t,offset:Gt};se==null||se(ar),M({type:"onDragPending",event:ar})},onStart(nt){let er=A.current;if(er==null)return;let _t=B.get(er);if(!_t)return;let{onDragStart:Gt}=vt.current,he={activatorEvent:wt,active:{id:er,data:_t.data,rect:N}};aa(()=>{Gt==null||Gt(he),m(nr.Initializing),y({type:rt.DragStart,initialCoordinates:nt,active:er}),M({type:"onDragStart",event:he}),G(uo.current),U(wt)})},onMove(nt){y({type:rt.DragMove,coordinates:nt})},onEnd:Sr(rt.DragEnd),onCancel:Sr(rt.DragCancel)});uo.current=Ot;function Sr(nt){return async function(){let{active:_t,collisions:Gt,over:he,scrollAdjustedTranslate:se}=Pt.current,ar=null;if(_t&&se){let{cancelDrop:ue}=vt.current;ar={activatorEvent:wt,active:_t,collisions:Gt,delta:se,over:he},nt===rt.DragEnd&&typeof ue=="function"&&await Promise.resolve(ue(ar))&&(nt=rt.DragCancel)}A.current=null,aa(()=>{y({type:nt}),m(nr.Uninitialized),wi(null),G(null),U(null),uo.current=null;let ue=nt===rt.DragEnd?"onDragEnd":"onDragCancel";if(ar){let go=vt.current[ue];go==null||go(ar),M({type:ue,event:ar})}})}}},[B]),w2=Tt((lt,bt)=>(yt,rr)=>{let At=yt.nativeEvent,wt=B.get(rr);if(A.current!==null||!wt||At.dndKit||At.defaultPrevented)return;let Ot={active:wt};lt(yt,bt.options,Ot)===!0&&(At.dndKit={capturedBy:bt.sensor},A.current=rr,Ci(yt,bt))},[B,Ci]),Bi=Rl(h,w2);_l(h),Ct(()=>{_&&k===nr.Initializing&&m(nr.Initialized)},[_,k]),J(()=>{let{onDragMove:lt}=vt.current,{active:bt,activatorEvent:yt,collisions:rr,over:At}=Pt.current;if(!bt||!yt)return;let wt={active:bt,activatorEvent:yt,collisions:rr,delta:{x:Wr.x,y:Wr.y},over:At};aa(()=>{lt==null||lt(wt),M({type:"onDragMove",event:wt})})},[Wr.x,Wr.y]),J(()=>{let{active:lt,activatorEvent:bt,collisions:yt,droppableContainers:rr,scrollAdjustedTranslate:At}=Pt.current;if(!lt||A.current==null||!bt||!At)return;let{onDragOver:wt}=vt.current,Ot=rr.get(yi),Sr=Ot&&Ot.rect.current?{id:Ot.id,rect:Ot.rect.current,data:Ot.data,disabled:Ot.disabled}:null,nt={active:lt,activatorEvent:bt,collisions:yt,delta:{x:At.x,y:At.y},over:Sr};aa(()=>{wi(Sr),wt==null||wt(nt),M({type:"onDragOver",event:nt})})},[yi]),Ct(()=>{Pt.current={activatorEvent:O,active:V,activeNode:Mt,collisionRect:jr,collisions:ce,droppableRects:Ht,draggableNodes:B,draggingNode:Cr,draggingNodeRect:Br,droppableContainers:W,over:tr,scrollableAncestors:Qt,scrollAdjustedTranslate:Wr},N.current={initial:Br,translated:jr}},[V,Mt,ce,jr,B,Cr,Br,Ht,W,tr,Qt,Wr]),Al({...Jt,delta:H,draggingRect:jr,pointerCoordinates:Mi,scrollableAncestors:Qt,scrollableAncestorRects:Ge});let C2=Y(()=>({active:V,activeNode:Mt,activeNodeRect:_,activatorEvent:O,collisions:ce,containerNodeRect:le,dragOverlay:qt,draggableNodes:B,droppableContainers:W,droppableRects:Ht,over:tr,measureDroppableContainers:It,scrollableAncestors:Qt,scrollableAncestorRects:Ge,measuringConfiguration:tt,measuringScheduled:hr,windowRect:so}),[V,Mt,_,O,ce,le,qt,B,W,Ht,tr,It,Qt,Ge,tt,hr,so]),B2=Y(()=>({activatorEvent:O,activators:Bi,active:V,activeNodeRect:_,ariaDescribedById:{draggable:mt},dispatch:y,draggableNodes:B,over:tr,measureDroppableContainers:It}),[O,Bi,V,_,y,mt,B,tr,It]);return et.createElement(rn.Provider,{value:v},et.createElement(We.Provider,{value:B2},et.createElement(Ln.Provider,{value:C2},et.createElement(sa.Provider,{value:y2},c)),et.createElement(Jl,{disabled:(d==null?void 0:d.restoreFocus)===!1})),et.createElement(il,{...d,hiddenTextDescribedById:mt}));function W2(){let lt=(z==null?void 0:z.autoScrollEnabled)===!1,bt=typeof l=="object"?l.enabled===!1:l===!1,yt=L&&!lt&&!bt;return typeof l=="object"?{...l,enabled:yt}:{enabled:yt}}}),rc=Be(null),Qi="button",ec="Draggable";function ga(t){let{id:r,data:e,disabled:a=!1,attributes:o}=t,i=gr(ec),{activators:n,activatorEvent:d,active:l,activeNodeRect:c,ariaDescribedById:h,draggableNodes:s,over:u}=xr(We),{role:f=Qi,roleDescription:p="draggable",tabIndex:g=0}=o!=null?o:{},x=(l==null?void 0:l.id)===r,y=xr(x?sa:rc),[M,v]=Le(),[k,m]=Le(),L=$l(n,r),w=Dr(e);Ct(()=>(s.set(r,{id:r,key:i,node:M,activatorNode:k,data:w}),()=>{let H=s.get(r);H&&H.key===i&&s.delete(r)}),[s,r]);let B=Y(()=>({role:f,tabIndex:g,"aria-disabled":a,"aria-pressed":x&&f===Qi?!0:void 0,"aria-roledescription":p,"aria-describedby":h.draggable}),[a,f,g,x,p,h.draggable]);return{active:l,activatorEvent:d,activeNodeRect:c,attributes:B,isDragging:x,listeners:a?void 0:L,node:M,over:u,setNodeRef:v,setActivatorNodeRef:m,transform:y}}function So(){return xr(Ln)}var ac="Droppable",oc={timeout:25};function pa(t){let{data:r,disabled:e=!1,id:a,resizeObserverConfig:o}=t,i=gr(ac),{active:n,dispatch:d,over:l,measureDroppableContainers:c}=xr(We),h=dt({disabled:e}),s=dt(!1),u=dt(null),f=dt(null),{disabled:p,updateMeasurementsFor:g,timeout:x}={...oc,...o},y=Dr(g!=null?g:a),M=Tt(()=>{if(!s.current){s.current=!0;return}f.current!=null&&clearTimeout(f.current),f.current=setTimeout(()=>{c(Array.isArray(y.current)?y.current:[y.current]),f.current=null},x)},[x]),v=ha({callback:M,disabled:p||!n}),k=Tt((B,H)=>{v&&(H&&(v.unobserve(H),s.current=!1),B&&v.observe(B))},[v]),[m,L]=Le(k),w=Dr(r);return J(()=>{!v||!m.current||(v.disconnect(),s.current=!1,v.observe(m.current))},[m,v]),J(()=>(d({type:rt.RegisterDroppable,element:{id:a,key:i,disabled:e,node:m,rect:u,data:w}}),()=>d({type:rt.UnregisterDroppable,key:i,id:a})),[a]),J(()=>{e!==h.current.disabled&&(d({type:rt.SetDroppableDisabled,id:a,key:i,disabled:e}),h.current.disabled=e)},[a,i,e,d]),{active:n,rect:u,isOver:(l==null?void 0:l.id)===a,node:m,over:l,setNodeRef:L}}function ic(t){let{animation:r,children:e}=t,[a,o]=Bt(null),[i,n]=Bt(null),d=me(e);return!e&&!a&&d&&o(d),Ct(()=>{if(!i)return;let l=a==null?void 0:a.key,c=a==null?void 0:a.props.id;if(l==null||c==null){o(null);return}Promise.resolve(r(c,i)).then(()=>{o(null)})},[r,a,i]),et.createElement(et.Fragment,null,e,a?J2(a,{ref:n}):null)}var nc={x:0,y:0,scaleX:1,scaleY:1};function dc(t){let{children:r}=t;return et.createElement(We.Provider,{value:vn},et.createElement(sa.Provider,{value:nc},r))}var lc={position:"fixed",touchAction:"none"},cc=t=>Er(t)?"transform 250ms ease":void 0,hc=Q2((t,r)=>{let{as:e,activatorEvent:a,adjustScale:o,children:i,className:n,rect:d,style:l,transform:c,transition:h=cc}=t;if(!d)return null;let s=o?c:{...c,scaleX:1,scaleY:1},u={...lc,width:d.width,height:d.height,top:d.top,left:d.left,transform:kt.Transform.toString(s),transformOrigin:o&&a?dl(a,d):void 0,transition:typeof h=="function"?h(a):h,...l};return et.createElement(e,{className:n,style:u,ref:r},i)}),sc=t=>r=>{let{active:e,dragOverlay:a}=r,o={},{styles:i,className:n}=t;if(i!=null&&i.active)for(let[d,l]of Object.entries(i.active))l!==void 0&&(o[d]=e.node.style.getPropertyValue(d),e.node.style.setProperty(d,l));if(i!=null&&i.dragOverlay)for(let[d,l]of Object.entries(i.dragOverlay))l!==void 0&&a.node.style.setProperty(d,l);return n!=null&&n.active&&e.node.classList.add(n.active),n!=null&&n.dragOverlay&&a.node.classList.add(n.dragOverlay),function(){for(let[l,c]of Object.entries(o))e.node.style.setProperty(l,c);n!=null&&n.active&&e.node.classList.remove(n.active)}},uc=t=>{let{transform:{initial:r,final:e}}=t;return[{transform:kt.Transform.toString(r)},{transform:kt.Transform.toString(e)}]},gc={duration:250,easing:"ease",keyframes:uc,sideEffects:sc({styles:{active:{opacity:"0"}}})};function pc(t){let{config:r,draggableNodes:e,droppableContainers:a,measuringConfiguration:o}=t;return ve((i,n)=>{if(r===null)return;let d=e.get(i);if(!d)return;let l=d.node.current;if(!l)return;let c=xn(n);if(!c)return;let{transform:h}=ct(n).getComputedStyle(n),s=dn(h);if(!s)return;let u=typeof r=="function"?r:fc(r);return pn(l,o.draggable.measure),u({active:{id:i,data:d.data,node:l,rect:o.draggable.measure(l)},draggableNodes:e,dragOverlay:{node:n,rect:o.dragOverlay.measure(c)},droppableContainers:a,measuringConfiguration:o,transform:s})})}function fc(t){let{duration:r,easing:e,sideEffects:a,keyframes:o}={...gc,...t};return i=>{let{active:n,dragOverlay:d,transform:l,...c}=i;if(!r)return;let h={x:d.rect.left-n.rect.left,y:d.rect.top-n.rect.top},s={scaleX:l.scaleX!==1?n.rect.width*l.scaleX/d.rect.width:1,scaleY:l.scaleY!==1?n.rect.height*l.scaleY/d.rect.height:1},u={x:l.x-h.x,y:l.y-h.y,...s},f=o({...c,active:n,dragOverlay:d,transform:{initial:l,final:u}}),[p]=f,g=f[f.length-1];if(JSON.stringify(p)===JSON.stringify(g))return;let x=a==null?void 0:a({active:n,dragOverlay:d,...c}),y=d.node.animate(f,{duration:r,easing:e,fill:"forwards"});return new Promise(M=>{y.onfinish=()=>{x==null||x(),M()}})}}var tn=0;function kc(t){return Y(()=>{if(t!=null)return tn++,tn},[t])}var fa=et.memo(t=>{let{adjustScale:r=!1,children:e,dropAnimation:a,style:o,transition:i,modifiers:n,wrapperElement:d="div",className:l,zIndex:c=999}=t,{activatorEvent:h,active:s,activeNodeRect:u,containerNodeRect:f,draggableNodes:p,droppableContainers:g,dragOverlay:x,over:y,measuringConfiguration:M,scrollableAncestors:v,scrollableAncestorRects:k,windowRect:m}=So(),L=xr(sa),w=kc(s==null?void 0:s.id),B=mn(n,{activatorEvent:h,active:s,activeNodeRect:u,containerNodeRect:f,draggingNodeRect:x.rect,over:y,overlayNodeRect:x.rect,scrollableAncestors:v,scrollableAncestorRects:k,transform:L,windowRect:m}),H=jo(u),W=pc({config:a,draggableNodes:p,droppableContainers:g,measuringConfiguration:M}),S=H?x.setRef:void 0;return et.createElement(dc,null,et.createElement(ic,{animation:W},s&&w?et.createElement(hc,{key:w,id:s.id,ref:S,as:d,activatorEvent:h,adjustScale:r,className:l,transition:i,rect:H,style:{zIndex:c,...o},transform:B},e):null))});import je from"react";import Mn from"react";var Ho={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Ao=Mn.createContext&&Mn.createContext(Ho);var xc=["attr","size","title"];function vc(t,r){if(t==null)return{};var e,a,o=Lc(t,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(a=0;a<i.length;a++)e=i[a],r.indexOf(e)===-1&&{}.propertyIsEnumerable.call(t,e)&&(o[e]=t[e])}return o}function Lc(t,r){if(t==null)return{};var e={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(r.indexOf(a)!==-1)continue;e[a]=t[a]}return e}function ka(){return ka=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var e=arguments[r];for(var a in e)({}).hasOwnProperty.call(e,a)&&(t[a]=e[a])}return t},ka.apply(null,arguments)}function bn(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);r&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),e.push.apply(e,a)}return e}function xa(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?bn(Object(e),!0).forEach(function(a){mc(t,a,e[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):bn(Object(e)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(e,a))})}return t}function mc(t,r,e){return(r=Mc(r))in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}function Mc(t){var r=bc(t,"string");return typeof r=="symbol"?r:r+""}function bc(t,r){if(typeof t!="object"||!t)return t;var e=t[Symbol.toPrimitive];if(e!==void 0){var a=e.call(t,r||"default");if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(t)}function yn(t){return t&&t.map((r,e)=>je.createElement(r.tag,xa({key:e},r.attr),yn(r.child)))}function D(t){return r=>je.createElement(yc,ka({attr:xa({},t.attr)},r),yn(t.child))}function yc(t){var r=e=>{var a=t.attr,o=t.size,i=t.title,n=vc(t,xc),d=o||e.size||"1em",l;return e.className&&(l=e.className),t.className&&(l=(l?l+" ":"")+t.className),je.createElement("svg",ka({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},e.attr,a,n,{className:l,style:xa(xa({color:t.color||e.color},e.style),t.style),height:d,width:d,xmlns:"http://www.w3.org/2000/svg"}),i&&je.createElement("title",null,i),t.children)};return Ao!==void 0?je.createElement(Ao.Consumer,null,e=>r(e)):r(Ho)}function Nr(t){return D({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M18 6 6 18"},child:[]},{tag:"path",attr:{d:"m6 6 12 12"},child:[]}]})(t)}function wn(t){return D({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5"},child:[]},{tag:"rect",attr:{x:"2",y:"6",width:"14",height:"12",rx:"2"},child:[]}]})(t)}function Cn(t){return D({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"},child:[]},{tag:"polyline",attr:{points:"17 8 12 3 7 8"},child:[]},{tag:"line",attr:{x1:"12",x2:"12",y1:"3",y2:"15"},child:[]}]})(t)}function Bn(t){return D({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71"},child:[]},{tag:"path",attr:{d:"m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71"},child:[]},{tag:"line",attr:{x1:"8",x2:"8",y1:"2",y2:"5"},child:[]},{tag:"line",attr:{x1:"2",x2:"5",y1:"8",y2:"8"},child:[]},{tag:"line",attr:{x1:"16",x2:"16",y1:"19",y2:"22"},child:[]},{tag:"line",attr:{x1:"19",x2:"22",y1:"16",y2:"16"},child:[]}]})(t)}function Wn(t){return D({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M9 14 4 9l5-5"},child:[]},{tag:"path",attr:{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11"},child:[]}]})(t)}function zr(t){return D({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M6 4v6a6 6 0 0 0 12 0V4"},child:[]},{tag:"line",attr:{x1:"4",x2:"20",y1:"20",y2:"20"},child:[]}]})(t)}function jn(t){return D({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"4 7 4 4 20 4 20 7"},child:[]},{tag:"line",attr:{x1:"9",x2:"15",y1:"20",y2:"20"},child:[]},{tag:"line",attr:{x1:"12",x2:"12",y1:"4",y2:"20"},child:[]}]})(t)}function Ir(t){return D({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M3 6h18"},child:[]},{tag:"path",attr:{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"},child:[]},{tag:"path",attr:{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"},child:[]},{tag:"line",attr:{x1:"10",x2:"10",y1:"11",y2:"17"},child:[]},{tag:"line",attr:{x1:"14",x2:"14",y1:"11",y2:"17"},child:[]}]})(t)}function Sn(t){return D({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"10",x2:"14",y1:"2",y2:"2"},child:[]},{tag:"line",attr:{x1:"12",x2:"15",y1:"14",y2:"11"},child:[]},{tag:"circle",attr:{cx:"12",cy:"14",r:"8"},child:[]}]})(t)}function Pr(t){return D({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z"},child:[]},{tag:"circle",attr:{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor"},child:[]}]})(t)}function Or(t){return D({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M16 4H9a3 3 0 0 0-2.83 4"},child:[]},{tag:"path",attr:{d:"M14 12a4 4 0 0 1 0 8H6"},child:[]},{tag:"line",attr:{x1:"4",x2:"20",y1:"12",y2:"12"},child:[]}]})(t)}function Hn(t){return D({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2"},child:[]},{tag:"path",attr:{d:"M12 18h.01"},child:[]}]})(t)}function An(t){return D({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"18",cy:"5",r:"3"},child:[]},{tag:"circle",attr:{cx:"6",cy:"12",r:"3"},child:[]},{tag:"circle",attr:{cx:"18",cy:"19",r:"3"},child:[]},{tag:"line",attr:{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49"},child:[]},{tag:"line",attr:{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49"},child:[]}]})(t)}function Vn(t){return D({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"},child:[]},{tag:"circle",attr:{cx:"12",cy:"12",r:"3"},child:[]}]})(t)}function va(t){return D({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"11",cy:"11",r:"8"},child:[]},{tag:"path",attr:{d:"m21 21-4.3-4.3"},child:[]}]})(t)}function Dn(t){return D({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m2 9 3-3 3 3"},child:[]},{tag:"path",attr:{d:"M13 18H7a2 2 0 0 1-2-2V6"},child:[]},{tag:"path",attr:{d:"m22 15-3 3-3-3"},child:[]},{tag:"path",attr:{d:"M11 6h6a2 2 0 0 1 2 2v10"},child:[]}]})(t)}function Tn(t){return D({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M4 7V4h16v3"},child:[]},{tag:"path",attr:{d:"M5 20h6"},child:[]},{tag:"path",attr:{d:"M13 4 8 20"},child:[]},{tag:"path",attr:{d:"m15 15 5 5"},child:[]},{tag:"path",attr:{d:"m20 15-5 5"},child:[]}]})(t)}function Rn(t){return D({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"},child:[]},{tag:"path",attr:{d:"M3 3v5h5"},child:[]},{tag:"path",attr:{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16"},child:[]},{tag:"path",attr:{d:"M16 16h5v5"},child:[]}]})(t)}function En(t){return D({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m15 14 5-5-5-5"},child:[]},{tag:"path",attr:{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13"},child:[]}]})(t)}function Fn(t){return D({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{width:"5",height:"5",x:"3",y:"3",rx:"1"},child:[]},{tag:"rect",attr:{width:"5",height:"5",x:"16",y:"3",rx:"1"},child:[]},{tag:"rect",attr:{width:"5",height:"5",x:"3",y:"16",rx:"1"},child:[]},{tag:"path",attr:{d:"M21 16h-3a2 2 0 0 0-2 2v3"},child:[]},{tag:"path",attr:{d:"M21 21v.01"},child:[]},{tag:"path",attr:{d:"M12 7v3a2 2 0 0 1-2 2H7"},child:[]},{tag:"path",attr:{d:"M3 12h.01"},child:[]},{tag:"path",attr:{d:"M12 3h.01"},child:[]},{tag:"path",attr:{d:"M12 16v.01"},child:[]},{tag:"path",attr:{d:"M16 12h1"},child:[]},{tag:"path",attr:{d:"M21 12v.01"},child:[]},{tag:"path",attr:{d:"M12 21v-1"},child:[]}]})(t)}function Vo(t){return D({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M5 12h14"},child:[]},{tag:"path",attr:{d:"M12 5v14"},child:[]}]})(t)}function Nn(t){return D({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M12 20h9"},child:[]},{tag:"path",attr:{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z"},child:[]}]})(t)}function zn(t){return D({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M14 4.1 12 6"},child:[]},{tag:"path",attr:{d:"m5.1 8-2.9-.8"},child:[]},{tag:"path",attr:{d:"m6 12-1.9 2"},child:[]},{tag:"path",attr:{d:"M7.2 2.2 8 5.1"},child:[]},{tag:"path",attr:{d:"M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z"},child:[]}]})(t)}function In(t){return D({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{width:"20",height:"14",x:"2",y:"3",rx:"2"},child:[]},{tag:"line",attr:{x1:"8",x2:"16",y1:"21",y2:"21"},child:[]},{tag:"line",attr:{x1:"12",x2:"12",y1:"17",y2:"21"},child:[]}]})(t)}function Pn(t){return D({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M5 12h14"},child:[]}]})(t)}function On(t){return D({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0"},child:[]},{tag:"circle",attr:{cx:"12",cy:"10",r:"3"},child:[]}]})(t)}function La(t){return D({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M3 12h.01"},child:[]},{tag:"path",attr:{d:"M3 18h.01"},child:[]},{tag:"path",attr:{d:"M3 6h.01"},child:[]},{tag:"path",attr:{d:"M8 12h13"},child:[]},{tag:"path",attr:{d:"M8 18h13"},child:[]},{tag:"path",attr:{d:"M8 6h13"},child:[]}]})(t)}function _n(t){return D({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M21 12h-8"},child:[]},{tag:"path",attr:{d:"M21 6H8"},child:[]},{tag:"path",attr:{d:"M21 18h-8"},child:[]},{tag:"path",attr:{d:"M3 6v4c0 1.1.9 2 2 2h3"},child:[]},{tag:"path",attr:{d:"M3 10v6c0 1.1.9 2 2 2h3"},child:[]}]})(t)}function $n(t){return D({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M10 12h11"},child:[]},{tag:"path",attr:{d:"M10 18h11"},child:[]},{tag:"path",attr:{d:"M10 6h11"},child:[]},{tag:"path",attr:{d:"M4 10h2"},child:[]},{tag:"path",attr:{d:"M4 6h1v4"},child:[]},{tag:"path",attr:{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1"},child:[]}]})(t)}function ma(t){return D({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"},child:[]},{tag:"path",attr:{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"},child:[]}]})(t)}function Ma(t){return D({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{width:"18",height:"7",x:"3",y:"3",rx:"1"},child:[]},{tag:"rect",attr:{width:"9",height:"7",x:"3",y:"14",rx:"1"},child:[]},{tag:"rect",attr:{width:"5",height:"7",x:"16",y:"14",rx:"1"},child:[]}]})(t)}function _r(t){return D({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"19",x2:"10",y1:"4",y2:"4"},child:[]},{tag:"line",attr:{x1:"14",x2:"5",y1:"20",y2:"20"},child:[]},{tag:"line",attr:{x1:"15",x2:"9",y1:"4",y2:"20"},child:[]}]})(t)}function $r(t){return D({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2"},child:[]},{tag:"circle",attr:{cx:"9",cy:"9",r:"2"},child:[]},{tag:"path",attr:{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"},child:[]}]})(t)}function Un(t){return D({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M6 12h12"},child:[]},{tag:"path",attr:{d:"M6 20V4"},child:[]},{tag:"path",attr:{d:"M18 20V4"},child:[]}]})(t)}function ba(t){return D({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"},child:[]},{tag:"circle",attr:{cx:"12",cy:"12",r:"3"},child:[]}]})(t)}function Zn(t){return D({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M22 7.7c0-.6-.4-1.2-.8-1.5l-6.3-3.9a1.72 1.72 0 0 0-1.7 0l-10.3 6c-.5.2-.9.8-.9 1.4v6.6c0 .5.4 1.2.8 1.5l6.3 3.9a1.72 1.72 0 0 0 1.7 0l10.3-6c.5-.3.9-1 .9-1.5Z"},child:[]},{tag:"path",attr:{d:"M10 21.9V14L2.1 9.1"},child:[]},{tag:"path",attr:{d:"m10 14 11.9-6.9"},child:[]},{tag:"path",attr:{d:"M14 19.8v-8.1"},child:[]},{tag:"path",attr:{d:"M18 17.5V9.4"},child:[]}]})(t)}function qn(t){return D({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{width:"18",height:"18",x:"3",y:"3",rx:"2"},child:[]},{tag:"path",attr:{d:"M9 3v18"},child:[]},{tag:"path",attr:{d:"M15 3v18"},child:[]}]})(t)}function ya(t){return D({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"16 18 22 12 16 6"},child:[]},{tag:"polyline",attr:{points:"8 6 2 12 8 18"},child:[]}]})(t)}function wa(t){return D({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m9 18 6-6-6-6"},child:[]}]})(t)}function Gn(t){return D({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m15 18-6-6 6-6"},child:[]}]})(t)}function Ca(t){return D({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m6 9 6 6 6-6"},child:[]}]})(t)}function Kn(t){return D({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m3 15 4-8 4 8"},child:[]},{tag:"path",attr:{d:"M4 13h6"},child:[]},{tag:"path",attr:{d:"M15 11h4.5a2 2 0 0 1 0 4H15V7h4a2 2 0 0 1 0 4"},child:[]}]})(t)}function Xn(t){return D({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m3 15 4-8 4 8"},child:[]},{tag:"path",attr:{d:"M4 13h6"},child:[]},{tag:"circle",attr:{cx:"18",cy:"12",r:"3"},child:[]},{tag:"path",attr:{d:"M21 9v6"},child:[]}]})(t)}function Yn(t){return D({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"7",cy:"12",r:"3"},child:[]},{tag:"path",attr:{d:"M10 9v6"},child:[]},{tag:"circle",attr:{cx:"17",cy:"12",r:"3"},child:[]},{tag:"path",attr:{d:"M14 7v8"},child:[]}]})(t)}function Jn(t){return D({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M8 2v4"},child:[]},{tag:"path",attr:{d:"M16 2v4"},child:[]},{tag:"rect",attr:{width:"18",height:"18",x:"3",y:"4",rx:"2"},child:[]},{tag:"path",attr:{d:"M3 10h18"},child:[]}]})(t)}function Ur(t){return D({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8"},child:[]}]})(t)}function Qn(t){return D({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M4 20h16"},child:[]},{tag:"path",attr:{d:"m6 16 6-12 6 12"},child:[]},{tag:"path",attr:{d:"M8 12h8"},child:[]}]})(t)}function td(t){return D({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m3 16 4 4 4-4"},child:[]},{tag:"path",attr:{d:"M7 20V4"},child:[]},{tag:"path",attr:{d:"m21 8-4-4-4 4"},child:[]},{tag:"path",attr:{d:"M17 4v16"},child:[]}]})(t)}function Zr(t){return D({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M21 12H9"},child:[]},{tag:"path",attr:{d:"M21 18H7"},child:[]},{tag:"path",attr:{d:"M21 6H3"},child:[]}]})(t)}function qr(t){return D({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M15 12H3"},child:[]},{tag:"path",attr:{d:"M17 18H3"},child:[]},{tag:"path",attr:{d:"M21 6H3"},child:[]}]})(t)}function rd(t){return D({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M3 12h18"},child:[]},{tag:"path",attr:{d:"M3 18h18"},child:[]},{tag:"path",attr:{d:"M3 6h18"},child:[]}]})(t)}function Gr(t){return D({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M17 12H7"},child:[]},{tag:"path",attr:{d:"M19 18H5"},child:[]},{tag:"path",attr:{d:"M21 6H3"},child:[]}]})(t)}var Kr=wc;function wc(t,r,e){var a=null,o=null,i=function(){a&&(clearTimeout(a),o=null,a=null)},n=function(){var l=o;i(),l&&l()},d=function(){if(!r)return t.apply(this,arguments);var l=this,c=arguments,h=e&&!a;if(i(),o=function(){t.apply(l,c)},a=setTimeout(function(){if(a=null,!h){var s=o;return o=null,s()}},r),h)return o()};return d.cancel=i,d.flush=n,d}import{useState as ed}from"react";function Ba({blocks:t}){let{state:r,addChild:e,moveNode:a}=$(),[o,i]=ed(null),[n,d]=ed(null),l=an(en(Fr,{activationConstraint:{distance:4}})),c=f=>{if(!f)return null;if(typeof f=="string"&&f.startsWith("drop-end-"))return{containerId:f.slice(9),index:-1};let p=or(r.tree.root,f);return p?{containerId:p.container===r.tree.root?"root":p.container.id,index:p.index}:null};return{sensors:l,activeDrag:o,overId:n,handlers:{onDragStart:f=>i(f.active),onDragOver:f=>{var p;return d(((p=f.over)==null?void 0:p.id)||null)},onDragEnd:f=>{var M,v;i(null),d(null);let{active:p,over:g}=f;if(!g)return;let x=c(g.id);if(!x)return;if(((v=(M=p.data)==null?void 0:M.current)==null?void 0:v.source)==="library"){let k=p.data.current.type,m=t[k];if(!m)return;let L=Hr(k,m);e(x.containerId,L,x.index);return}p.id!==g.id&&a(p.id,x.containerId,x.index)}}}}import{useEffect as k1,useState as x1}from"react";import{useState as Bc}from"react";var T=(t,r)=>r?`${t} ${t}--${r}`:t;var ad=".emb-embed-root *,.emb-embed-root :after,.emb-embed-root :before{border-style:solid;border-width:0}.emb-embed-root .pointer-events-none{pointer-events:none}.emb-embed-root .visible{visibility:visible}.emb-embed-root .collapse{visibility:collapse}.emb-embed-root .static{position:static}.emb-embed-root .fixed{position:fixed}.emb-embed-root .absolute{position:absolute}.emb-embed-root .relative{position:relative}.emb-embed-root .sticky{position:sticky}.emb-embed-root .-top-0{top:0}.emb-embed-root .-top-0\\.5{top:-.125rem}.emb-embed-root .-top-3{top:-.75rem}.emb-embed-root .-top-3\\.5{top:-.875rem}.emb-embed-root .left-0{left:0}.emb-embed-root .right-0{right:0}.emb-embed-root .right-\\[3px\\]{right:3px}.emb-embed-root .top-8{top:2rem}.emb-embed-root .top-\\[-22px\\]{top:-22px}.emb-embed-root .top-\\[3px\\]{top:3px}.emb-embed-root .top-\\[5px\\]{top:5px}.emb-embed-root .z-\\[2\\]{z-index:2}.emb-embed-root .z-\\[3\\]{z-index:3}.emb-embed-root .m-0{margin:0}.emb-embed-root .mx-0{margin-left:0;margin-right:0}.emb-embed-root .mx-0\\.5{margin-left:.125rem;margin-right:.125rem}.emb-embed-root .my-0{margin-bottom:0;margin-top:0}.emb-embed-root .my-0\\.5{margin-bottom:.125rem;margin-top:.125rem}.emb-embed-root .mb-0{margin-bottom:0}.emb-embed-root .mb-1{margin-bottom:.25rem}.emb-embed-root .mb-1\\.5{margin-bottom:.375rem}.emb-embed-root .mb-10{margin-bottom:2.5rem}.emb-embed-root .mb-2{margin-bottom:.5rem}.emb-embed-root .mb-4{margin-bottom:1rem}.emb-embed-root .mb-5{margin-bottom:1.25rem}.emb-embed-root .mb-6{margin-bottom:1.5rem}.emb-embed-root .mb-\\[18px\\]{margin-bottom:18px}.emb-embed-root .ml-1{margin-left:.25rem}.emb-embed-root .ml-auto{margin-left:auto}.emb-embed-root .mr-2{margin-right:.5rem}.emb-embed-root .mt-2{margin-top:.5rem}.emb-embed-root .mt-3{margin-top:.75rem}.emb-embed-root .box-border{box-sizing:border-box}.emb-embed-root .block{display:block}.emb-embed-root .inline-block{display:inline-block}.emb-embed-root .inline{display:inline}.emb-embed-root .flex{display:flex}.emb-embed-root .inline-flex{display:inline-flex}.emb-embed-root .table{display:table}.emb-embed-root .grid{display:grid}.emb-embed-root .contents{display:contents}.emb-embed-root .hidden{display:none}.emb-embed-root .h-0{height:0}.emb-embed-root .h-3{height:.75rem}.emb-embed-root .h-4{height:1rem}.emb-embed-root .h-5{height:1.25rem}.emb-embed-root .h-6{height:1.5rem}.emb-embed-root .h-9{height:2.25rem}.emb-embed-root .h-\\[22px\\]{height:22px}.emb-embed-root .h-\\[30px\\]{height:30px}.emb-embed-root .h-\\[34px\\]{height:34px}.emb-embed-root .h-\\[3px\\]{height:3px}.emb-embed-root .max-h-\\[160px\\]{max-height:160px}.emb-embed-root .max-h-\\[200px\\]{max-height:200px}.emb-embed-root .w-10{width:2.5rem}.emb-embed-root .w-3{width:.75rem}.emb-embed-root .w-4{width:1rem}.emb-embed-root .w-5{width:1.25rem}.emb-embed-root .w-6{width:1.5rem}.emb-embed-root .w-7{width:1.75rem}.emb-embed-root .w-\\[22px\\]{width:22px}.emb-embed-root .w-\\[34px\\]{width:34px}.emb-embed-root .w-\\[90px\\]{width:90px}.emb-embed-root .w-full{width:100%}.emb-embed-root .min-w-0{min-width:0}.emb-embed-root .flex-1{flex:1 1 0%}.emb-embed-root .flex-shrink{flex-shrink:1}.emb-embed-root .shrink-0{flex-shrink:0}.emb-embed-root .grow{flex-grow:1}.emb-embed-root .transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.emb-embed-root .animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(1turn)}}.emb-embed-root .animate-spin{animation:spin 1s linear infinite}.emb-embed-root .cursor-pointer{cursor:pointer}.emb-embed-root .select-none{user-select:none}.emb-embed-root .resize{resize:both}.emb-embed-root .grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.emb-embed-root .grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.emb-embed-root .flex-row{flex-direction:row}.emb-embed-root .flex-col{flex-direction:column}.emb-embed-root .flex-wrap{flex-wrap:wrap}.emb-embed-root .items-start{align-items:flex-start}.emb-embed-root .items-center{align-items:center}.emb-embed-root .justify-end{justify-content:flex-end}.emb-embed-root .justify-center{justify-content:center}.emb-embed-root .justify-between{justify-content:space-between}.emb-embed-root .gap-1{gap:.25rem}.emb-embed-root .gap-1\\.5{gap:.375rem}.emb-embed-root .gap-2{gap:.5rem}.emb-embed-root .gap-3{gap:.75rem}.emb-embed-root .gap-3\\.5{gap:.875rem}.emb-embed-root .gap-4{gap:1rem}.emb-embed-root .overflow-hidden{overflow:hidden}.emb-embed-root .overflow-x-auto{overflow-x:auto}.emb-embed-root .overflow-y-auto{overflow-y:auto}.emb-embed-root .text-ellipsis{text-overflow:ellipsis}.emb-embed-root .whitespace-nowrap{white-space:nowrap}.emb-embed-root .rounded{border-radius:.25rem}.emb-embed-root .rounded-\\[2px\\]{border-radius:2px}.emb-embed-root .rounded-\\[3px\\]{border-radius:3px}.emb-embed-root .rounded-full{border-radius:9999px}.emb-embed-root .rounded-lg{border-radius:.5rem}.emb-embed-root .rounded-md{border-radius:.375rem}.emb-embed-root .border{border-width:1px}.emb-embed-root .border-0{border-width:0}.emb-embed-root .border-2{border-width:2px}.emb-embed-root .border-b{border-bottom-width:1px}.emb-embed-root .border-t{border-top-width:1px}.emb-embed-root .border-solid{border-style:solid}.emb-embed-root .border-dashed{border-style:dashed}.emb-embed-root .border-none{border-style:none}.emb-embed-root .border-\\[\\#0073e6\\]{--tw-border-opacity:1;border-color:rgb(0 115 230/var(--tw-border-opacity,1))}.emb-embed-root .border-\\[\\#cbd5e1\\]{--tw-border-opacity:1;border-color:rgb(203 213 225/var(--tw-border-opacity,1))}.emb-embed-root .border-\\[\\#e2e8f0\\]{--tw-border-opacity:1;border-color:rgb(226 232 240/var(--tw-border-opacity,1))}.emb-embed-root .border-\\[\\#f1f5f9\\]{--tw-border-opacity:1;border-color:rgb(241 245 249/var(--tw-border-opacity,1))}.emb-embed-root .border-transparent{border-color:transparent}.emb-embed-root .border-t-transparent{border-top-color:transparent}.emb-embed-root .bg-\\[\\#0073e6\\]{--tw-bg-opacity:1;background-color:rgb(0 115 230/var(--tw-bg-opacity,1))}.emb-embed-root .bg-\\[\\#ef4444\\]{--tw-bg-opacity:1;background-color:rgb(239 68 68/var(--tw-bg-opacity,1))}.emb-embed-root .bg-\\[\\#f1f5f9\\]{--tw-bg-opacity:1;background-color:rgb(241 245 249/var(--tw-bg-opacity,1))}.emb-embed-root .bg-\\[\\#f8fafc\\]{--tw-bg-opacity:1;background-color:rgb(248 250 252/var(--tw-bg-opacity,1))}.emb-embed-root .bg-black{--tw-bg-opacity:1;background-color:rgb(0 0 0/var(--tw-bg-opacity,1))}.emb-embed-root .bg-gray-200{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity,1))}.emb-embed-root .bg-transparent{background-color:transparent}.emb-embed-root .bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.emb-embed-root .object-contain{object-fit:contain}.emb-embed-root .p-0{padding:0}.emb-embed-root .p-1{padding:.25rem}.emb-embed-root .p-2{padding:.5rem}.emb-embed-root .p-4{padding:1rem}.emb-embed-root .p-6{padding:1.5rem}.emb-embed-root .px-1{padding-left:.25rem;padding-right:.25rem}.emb-embed-root .px-1\\.5{padding-left:.375rem;padding-right:.375rem}.emb-embed-root .px-2{padding-left:.5rem;padding-right:.5rem}.emb-embed-root .px-2\\.5{padding-left:.625rem;padding-right:.625rem}.emb-embed-root .px-3{padding-left:.75rem;padding-right:.75rem}.emb-embed-root .px-4{padding-left:1rem;padding-right:1rem}.emb-embed-root .px-5{padding-left:1.25rem;padding-right:1.25rem}.emb-embed-root .py-0{padding-bottom:0;padding-top:0}.emb-embed-root .py-0\\.5{padding-bottom:.125rem;padding-top:.125rem}.emb-embed-root .py-1{padding-bottom:.25rem;padding-top:.25rem}.emb-embed-root .py-1\\.5{padding-bottom:.375rem;padding-top:.375rem}.emb-embed-root .py-16{padding-bottom:4rem;padding-top:4rem}.emb-embed-root .py-2{padding-bottom:.5rem;padding-top:.5rem}.emb-embed-root .py-2\\.5{padding-bottom:.625rem;padding-top:.625rem}.emb-embed-root .py-3{padding-bottom:.75rem;padding-top:.75rem}.emb-embed-root .py-\\[22px\\]{padding-bottom:22px;padding-top:22px}.emb-embed-root .pb-3{padding-bottom:.75rem}.emb-embed-root .pb-4{padding-bottom:1rem}.emb-embed-root .pb-5{padding-bottom:1.25rem}.emb-embed-root .pl-2{padding-left:.5rem}.emb-embed-root .pl-3{padding-left:.75rem}.emb-embed-root .pr-2{padding-right:.5rem}.emb-embed-root .pt-1{padding-top:.25rem}.emb-embed-root .pt-2{padding-top:.5rem}.emb-embed-root .pt-3{padding-top:.75rem}.emb-embed-root .text-left{text-align:left}.emb-embed-root .text-center{text-align:center}.emb-embed-root .text-\\[10px\\]{font-size:10px}.emb-embed-root .text-\\[11px\\]{font-size:11px}.emb-embed-root .text-\\[13px\\]{font-size:13px}.emb-embed-root .text-base{font-size:1rem;line-height:1.5rem}.emb-embed-root .text-lg{font-size:1.125rem;line-height:1.75rem}.emb-embed-root .text-sm{font-size:.875rem;line-height:1.25rem}.emb-embed-root .text-xs{font-size:.75rem;line-height:1rem}.emb-embed-root .font-bold{font-weight:700}.emb-embed-root .font-medium{font-weight:500}.emb-embed-root .font-normal{font-weight:400}.emb-embed-root .font-semibold{font-weight:600}.emb-embed-root .uppercase{text-transform:uppercase}.emb-embed-root .lowercase{text-transform:lowercase}.emb-embed-root .capitalize{text-transform:capitalize}.emb-embed-root .italic{font-style:italic}.emb-embed-root .leading-5{line-height:1.25rem}.emb-embed-root .leading-\\[1\\.2\\]{line-height:1.2}.emb-embed-root .leading-\\[1\\.5\\]{line-height:1.5}.emb-embed-root .tracking-\\[\\.04em\\]{letter-spacing:.04em}.emb-embed-root .tracking-\\[\\.05em\\],.emb-embed-root .tracking-wider{letter-spacing:.05em}.emb-embed-root .text-\\[\\#0073e6\\]{--tw-text-opacity:1;color:rgb(0 115 230/var(--tw-text-opacity,1))}.emb-embed-root .text-\\[\\#475569\\]{--tw-text-opacity:1;color:rgb(71 85 105/var(--tw-text-opacity,1))}.emb-embed-root .text-\\[\\#64748b\\]{--tw-text-opacity:1;color:rgb(100 116 139/var(--tw-text-opacity,1))}.emb-embed-root .text-\\[\\#94a3b8\\]{--tw-text-opacity:1;color:rgb(148 163 184/var(--tw-text-opacity,1))}.emb-embed-root .text-\\[\\#b91c1c\\]{--tw-text-opacity:1;color:rgb(185 28 28/var(--tw-text-opacity,1))}.emb-embed-root .text-\\[\\#ef4444\\]{--tw-text-opacity:1;color:rgb(239 68 68/var(--tw-text-opacity,1))}.emb-embed-root .text-\\[var\\(--emb-text-muted\\2c \\#94a3b8\\)\\]{color:var(--emb-text-muted,#94a3b8)}.emb-embed-root .text-inherit{color:inherit}.emb-embed-root .text-red-500{--tw-text-opacity:1;color:rgb(239 68 68/var(--tw-text-opacity,1))}.emb-embed-root .text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.emb-embed-root .underline{text-decoration-line:underline}.emb-embed-root .overline{text-decoration-line:overline}.emb-embed-root .line-through{text-decoration-line:line-through}.emb-embed-root .opacity-50{opacity:.5}.emb-embed-root .opacity-60{opacity:.6}.emb-embed-root .opacity-\\[\\.55\\]{opacity:.55}.emb-embed-root .shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.emb-embed-root .outline{outline-style:solid}.emb-embed-root .outline-offset-\\[-1px\\]{outline-offset:-1px}.emb-embed-root .ring{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.emb-embed-root .blur{--tw-blur:blur(8px)}.emb-embed-root .blur,.emb-embed-root .filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.emb-embed-root .transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.emb-embed-root .transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.emb-embed-root .transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.emb-embed-root .duration-150{transition-duration:.15s}";var od="emb-embed-styles",Cc=`
10
- .emb-embed-root{display:flex;flex-direction:column;height:640px;border:1px solid var(--emb-shell-border,#e2e8f0);border-radius:8px;overflow:hidden;background:var(--emb-shell-bg,#fff)}
11
- .emb-embed-root--richtext{height:320px}
12
- .emb-shell-header{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 12px;background:var(--emb-header-bg,#fff);border-bottom:1px solid var(--emb-border,#e2e8f0);flex-shrink:0}
13
- .emb-shell-body{display:flex;flex:1;overflow:hidden}
14
-
15
- .emb-undo-redo{display:inline-flex;gap:4px}
16
- .emb-undo-redo button{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:4px;border:1px solid var(--emb-border-strong,#cbd5e1);background:var(--emb-surface-alt-bg,#fff);color:var(--emb-text-secondary,#334155);cursor:pointer;padding:0}
17
- .emb-undo-redo button:disabled{color:var(--emb-border-strong,#cbd5e1);cursor:not-allowed}
18
-
19
- .emb-templates-btn{display:inline-flex;align-items:center;gap:6px;padding:6px 12px;background:var(--emb-surface-alt-bg,#fff);color:var(--emb-text-secondary,#334155);border:1px solid var(--emb-border-strong,#cbd5e1);border-radius:4px;font-size:12px;font-weight:600;cursor:pointer}
20
- .emb-preview-btn{display:inline-flex;align-items:center;gap:6px;padding:6px 12px;background:var(--emb-primary,#0073e6);color:#fff;border:1px solid var(--emb-primary,#0073e6);border-radius:4px;font-size:12px;font-weight:600;cursor:pointer}
21
-
22
- .emb-drag-chip{padding:8px 12px;background:var(--emb-surface-bg,#fff);border:1px solid #60a5fa;border-radius:6px;box-shadow:0 6px 16px rgba(0,0,0,.12);font-size:13px;color:var(--emb-text,#0f172a)}
23
-
24
- .emb-left-panel,.emb-navigator-panel{flex-shrink:0;height:100%;box-sizing:border-box;border-right:1px solid var(--emb-border,#e2e8f0);background:var(--emb-surface-bg,#fff);display:flex;flex-direction:column}
25
- .emb-left-panel{width:300px}
26
- .emb-navigator-panel{width:250px}
27
- .emb-panel-header{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 14px;border-bottom:1px solid var(--emb-border,#e2e8f0);background:var(--emb-surface-alt-bg,#f8fafc);flex-shrink:0;min-height:44px}
28
- .emb-panel-title{font-size:12px;font-weight:700;letter-spacing:.04em;color:var(--emb-text,#0f172a);text-transform:uppercase}
29
- .emb-back-btn{display:inline-flex;align-items:center;gap:6px;background:transparent;border:none;cursor:pointer;color:var(--emb-text,#0f172a);padding:0;overflow:hidden}
30
- .emb-icon-btn{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:4px;border:1px solid var(--emb-border,#e2e8f0);background:var(--emb-surface-bg,#fff);color:var(--emb-text-secondary,#475569);cursor:pointer;flex-shrink:0;padding:0}
31
- .emb-icon-btn.is-active{background:var(--emb-primary,#0073e6);border-color:var(--emb-primary,#0073e6);color:#fff}
32
- .emb-panel-scroll{flex:1;overflow-y:auto}
33
- .emb-inspector-tabs{display:flex;border-bottom:1px solid var(--emb-border,#e2e8f0);background:var(--emb-surface-bg,#fff);position:sticky;top:0;z-index:1}
34
- .emb-inspector-tab{flex:1;padding:10px 8px;background:transparent;border:none;border-bottom:2px solid transparent;cursor:pointer;font-size:12px;font-weight:600;color:var(--emb-text-secondary,#64748b)}
35
- .emb-inspector-tab.is-active{color:var(--emb-primary,#0073e6);border-bottom-color:var(--emb-primary,#0073e6)}
9
+ `},nl={onDragStart(t){let{active:r}=t;return"Picked up draggable item "+r.id+"."},onDragOver(t){let{active:r,over:e}=t;return e?"Draggable item "+r.id+" was moved over droppable area "+e.id+".":"Draggable item "+r.id+" is no longer over a droppable area."},onDragEnd(t){let{active:r,over:e}=t;return e?"Draggable item "+r.id+" was dropped over droppable area "+e.id:"Draggable item "+r.id+" was dropped."},onDragCancel(t){let{active:r}=t;return"Dragging was cancelled. Draggable item "+r.id+" was dropped."}};function dl(t){let{announcements:r=nl,container:e,hiddenTextDescribedById:a,screenReaderInstructions:o=il}=t,{announce:i,announcement:n}=Oi(),d=gr("DndLiveRegion"),[l,c]=Bt(!1);if(J(()=>{c(!0)},[]),al(Y(()=>({onDragStart(s){let{active:u}=s;i(r.onDragStart({active:u}))},onDragMove(s){let{active:u,over:k}=s;r.onDragMove&&i(r.onDragMove({active:u,over:k}))},onDragOver(s){let{active:u,over:k}=s;i(r.onDragOver({active:u,over:k}))},onDragEnd(s){let{active:u,over:k}=s;i(r.onDragEnd({active:u,over:k}))},onDragCancel(s){let{active:u,over:k}=s;i(r.onDragCancel({active:u,over:k}))}}),[i,r])),!l)return null;let h=et.createElement(et.Fragment,null,et.createElement(Ii,{id:a,value:o.draggable}),et.createElement(Pi,{id:d,announcement:n}));return e?el(h,e):h}var rt;(function(t){t.DragStart="dragStart",t.DragMove="dragMove",t.DragEnd="dragEnd",t.DragCancel="dragCancel",t.DragOver="dragOver",t.RegisterDroppable="registerDroppable",t.SetDroppableDisabled="setDroppableDisabled",t.UnregisterDroppable="unregisterDroppable"})(rt||(rt={}));function ia(){}function en(t,r){return Y(()=>({sensor:t,options:r!=null?r:{}}),[t,r])}function an(){for(var t=arguments.length,r=new Array(t),e=0;e<t;e++)r[e]=arguments[e];return Y(()=>[...r].filter(a=>a!=null),[...r])}var Tt=Object.freeze({x:0,y:0});function ll(t,r){return Math.sqrt(Math.pow(t.x-r.x,2)+Math.pow(t.y-r.y,2))}function cl(t,r){let e=Me(t);if(!e)return"0 0";let a={x:(e.x-r.left)/r.width*100,y:(e.y-r.top)/r.height*100};return a.x+"% "+a.y+"%"}function hl(t,r){let{data:{value:e}}=t,{data:{value:a}}=r;return e-a}function sl(t,r){let{data:{value:e}}=t,{data:{value:a}}=r;return a-e}function on(t,r){if(!t||t.length===0)return null;let[e]=t;return r?e[r]:e}function _i(t,r,e){return r===void 0&&(r=t.left),e===void 0&&(e=t.top),{x:r+t.width*.5,y:e+t.height*.5}}var la=t=>{let{collisionRect:r,droppableRects:e,droppableContainers:a}=t,o=_i(r,r.left,r.top),i=[];for(let n of a){let{id:d}=n,l=e.get(d);if(l){let c=ll(_i(l),o);i.push({id:d,data:{droppableContainer:n,value:c}})}}return i.sort(hl)};function ul(t,r){let e=Math.max(r.top,t.top),a=Math.max(r.left,t.left),o=Math.min(r.left+r.width,t.left+t.width),i=Math.min(r.top+r.height,t.top+t.height),n=o-a,d=i-e;if(a<o&&e<i){let l=r.width*r.height,c=t.width*t.height,h=n*d,s=h/(l+c-h);return Number(s.toFixed(4))}return 0}var gl=t=>{let{collisionRect:r,droppableRects:e,droppableContainers:a}=t,o=[];for(let i of a){let{id:n}=i,d=e.get(n);if(d){let l=ul(d,r);l>0&&o.push({id:n,data:{droppableContainer:i,value:l}})}}return o.sort(sl)};function pl(t,r,e){return{...t,scaleX:r&&e?r.width/e.width:1,scaleY:r&&e?r.height/e.height:1}}function nn(t,r){return t&&r?{x:t.left-r.left,y:t.top-r.top}:Tt}function kl(t){return function(e){for(var a=arguments.length,o=new Array(a>1?a-1:0),i=1;i<a;i++)o[i-1]=arguments[i];return o.reduce((n,d)=>({...n,top:n.top+t*d.y,bottom:n.bottom+t*d.y,left:n.left+t*d.x,right:n.right+t*d.x}),{...e})}}var fl=kl(1);function dn(t){if(t.startsWith("matrix3d(")){let r=t.slice(9,-1).split(/, /);return{x:+r[12],y:+r[13],scaleX:+r[0],scaleY:+r[5]}}else if(t.startsWith("matrix(")){let r=t.slice(7,-1).split(/, /);return{x:+r[4],y:+r[5],scaleX:+r[0],scaleY:+r[3]}}return null}function xl(t,r,e){let a=dn(r);if(!a)return t;let{scaleX:o,scaleY:i,x:n,y:d}=a,l=t.left-n-(1-o)*parseFloat(e),c=t.top-d-(1-i)*parseFloat(e.slice(e.indexOf(" ")+1)),h=o?t.width/o:t.width,s=i?t.height/i:t.height;return{width:h,height:s,top:c,right:l+h,bottom:c+s,left:l}}var vl={ignoreTransform:!1};function vr(t,r){r===void 0&&(r=vl);let e=t.getBoundingClientRect();if(r.ignoreTransform){let{transform:c,transformOrigin:h}=ct(t).getComputedStyle(t);c&&(e=xl(e,c,h))}let{top:a,left:o,width:i,height:n,bottom:d,right:l}=e;return{top:a,left:o,width:i,height:n,bottom:d,right:l}}function $i(t){return vr(t,{ignoreTransform:!0})}function Ll(t){let r=t.innerWidth,e=t.innerHeight;return{top:0,left:0,right:r,bottom:e,width:r,height:e}}function ml(t,r){return r===void 0&&(r=ct(t).getComputedStyle(t)),r.position==="fixed"}function Ml(t,r){r===void 0&&(r=ct(t).getComputedStyle(t));let e=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{let i=r[o];return typeof i=="string"?e.test(i):!1})}function ca(t,r){let e=[];function a(o){if(r!=null&&e.length>=r||!o)return e;if(ea(o)&&o.scrollingElement!=null&&!e.includes(o.scrollingElement))return e.push(o.scrollingElement),e;if(!Ar(o)||Lo(o)||e.includes(o))return e;let i=ct(t).getComputedStyle(o);return o!==t&&Ml(o,i)&&e.push(o),ml(o,i)?e:a(o.parentNode)}return t?a(t):e}function ln(t){let[r]=ca(t,1);return r!=null?r:null}function mo(t){return!xe||!t?null:sr(t)?t:ra(t)?ea(t)||t===ur(t).scrollingElement?window:Ar(t)?t:null:null}function cn(t){return sr(t)?t.scrollX:t.scrollLeft}function hn(t){return sr(t)?t.scrollY:t.scrollTop}function bo(t){return{x:cn(t),y:hn(t)}}var at;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(at||(at={}));function sn(t){return!xe||!t?!1:t===document.scrollingElement}function un(t){let r={x:0,y:0},e=sn(t)?{height:window.innerHeight,width:window.innerWidth}:{height:t.clientHeight,width:t.clientWidth},a={x:t.scrollWidth-e.width,y:t.scrollHeight-e.height},o=t.scrollTop<=r.y,i=t.scrollLeft<=r.x,n=t.scrollTop>=a.y,d=t.scrollLeft>=a.x;return{isTop:o,isLeft:i,isBottom:n,isRight:d,maxScroll:a,minScroll:r}}var yl={x:.2,y:.2};function bl(t,r,e,a,o){let{top:i,left:n,right:d,bottom:l}=e;a===void 0&&(a=10),o===void 0&&(o=yl);let{isTop:c,isBottom:h,isLeft:s,isRight:u}=un(t),k={x:0,y:0},p={x:0,y:0},g={height:r.height*o.y,width:r.width*o.x};return!c&&i<=r.top+g.height?(k.y=at.Backward,p.y=a*Math.abs((r.top+g.height-i)/g.height)):!h&&l>=r.bottom-g.height&&(k.y=at.Forward,p.y=a*Math.abs((r.bottom-g.height-l)/g.height)),!u&&d>=r.right-g.width?(k.x=at.Forward,p.x=a*Math.abs((r.right-g.width-d)/g.width)):!s&&n<=r.left+g.width&&(k.x=at.Backward,p.x=a*Math.abs((r.left+g.width-n)/g.width)),{direction:k,speed:p}}function wl(t){if(t===document.scrollingElement){let{innerWidth:i,innerHeight:n}=window;return{top:0,left:0,right:i,bottom:n,width:i,height:n}}let{top:r,left:e,right:a,bottom:o}=t.getBoundingClientRect();return{top:r,left:e,right:a,bottom:o,width:t.clientWidth,height:t.clientHeight}}function gn(t){return t.reduce((r,e)=>pr(r,bo(e)),Tt)}function Cl(t){return t.reduce((r,e)=>r+cn(e),0)}function Bl(t){return t.reduce((r,e)=>r+hn(e),0)}function pn(t,r){if(r===void 0&&(r=vr),!t)return;let{top:e,left:a,bottom:o,right:i}=r(t);ln(t)&&(o<=0||i<=0||e>=window.innerHeight||a>=window.innerWidth)&&t.scrollIntoView({block:"center",inline:"center"})}var Wl=[["x",["left","right"],Cl],["y",["top","bottom"],Bl]],be=class{constructor(r,e){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;let a=ca(e),o=gn(a);this.rect={...r},this.width=r.width,this.height=r.height;for(let[i,n,d]of Wl)for(let l of n)Object.defineProperty(this,l,{get:()=>{let c=d(a),h=o[i]-c;return this.rect[l]+h},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}},kr=class{constructor(r){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>{var a;return(a=this.target)==null?void 0:a.removeEventListener(...e)})},this.target=r}add(r,e,a){var o;(o=this.target)==null||o.addEventListener(r,e,a),this.listeners.push([r,e,a])}};function jl(t){let{EventTarget:r}=ct(t);return t instanceof r?t:ur(t)}function Mo(t,r){let e=Math.abs(t.x),a=Math.abs(t.y);return typeof r=="number"?Math.sqrt(e**2+a**2)>r:"x"in r&&"y"in r?e>r.x&&a>r.y:"x"in r?e>r.x:"y"in r?a>r.y:!1}var At;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(At||(At={}));function Ui(t){t.preventDefault()}function zl(t){t.stopPropagation()}var I;(function(t){t.Space="Space",t.Down="ArrowDown",t.Right="ArrowRight",t.Left="ArrowLeft",t.Up="ArrowUp",t.Esc="Escape",t.Enter="Enter",t.Tab="Tab"})(I||(I={}));var kn={start:[I.Space,I.Enter],cancel:[I.Esc],end:[I.Space,I.Enter,I.Tab]},Sl=(t,r)=>{let{currentCoordinates:e}=r;switch(t.code){case I.Right:return{...e,x:e.x+25};case I.Left:return{...e,x:e.x-25};case I.Down:return{...e,y:e.y+25};case I.Up:return{...e,y:e.y-25}}},na=class{constructor(r){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=r;let{event:{target:e}}=r;this.props=r,this.listeners=new kr(ur(e)),this.windowListeners=new kr(ct(e)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(At.Resize,this.handleCancel),this.windowListeners.add(At.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(At.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:r,onStart:e}=this.props,a=r.node.current;a&&pn(a),e(Tt)}handleKeyDown(r){if(Er(r)){let{active:e,context:a,options:o}=this.props,{keyboardCodes:i=kn,coordinateGetter:n=Sl,scrollBehavior:d="smooth"}=o,{code:l}=r;if(i.end.includes(l)){this.handleEnd(r);return}if(i.cancel.includes(l)){this.handleCancel(r);return}let{collisionRect:c}=a.current,h=c?{x:c.left,y:c.top}:Tt;this.referenceCoordinates||(this.referenceCoordinates=h);let s=n(r,{active:e,context:a.current,currentCoordinates:h});if(s){let u=Tr(s,h),k={x:0,y:0},{scrollableAncestors:p}=a.current;for(let g of p){let x=r.code,{isTop:b,isRight:m,isLeft:v,isBottom:f,maxScroll:M,minScroll:L}=un(g),w=wl(g),B={x:Math.min(x===I.Right?w.right-w.width/2:w.right,Math.max(x===I.Right?w.left:w.left+w.width/2,s.x)),y:Math.min(x===I.Down?w.bottom-w.height/2:w.bottom,Math.max(x===I.Down?w.top:w.top+w.height/2,s.y))},S=x===I.Right&&!m||x===I.Left&&!v,W=x===I.Down&&!f||x===I.Up&&!b;if(S&&B.x!==s.x){let z=g.scrollLeft+u.x,F=x===I.Right&&z<=M.x||x===I.Left&&z>=L.x;if(F&&!u.y){g.scrollTo({left:z,behavior:d});return}F?k.x=g.scrollLeft-z:k.x=x===I.Right?g.scrollLeft-M.x:g.scrollLeft-L.x,k.x&&g.scrollBy({left:-k.x,behavior:d});break}else if(W&&B.y!==s.y){let z=g.scrollTop+u.y,F=x===I.Down&&z<=M.y||x===I.Up&&z>=L.y;if(F&&!u.x){g.scrollTo({top:z,behavior:d});return}F?k.y=g.scrollTop-z:k.y=x===I.Down?g.scrollTop-M.y:g.scrollTop-L.y,k.y&&g.scrollBy({top:-k.y,behavior:d});break}}this.handleMove(r,pr(Tr(s,this.referenceCoordinates),k))}}}handleMove(r,e){let{onMove:a}=this.props;r.preventDefault(),a(e)}handleEnd(r){let{onEnd:e}=this.props;r.preventDefault(),this.detach(),e()}handleCancel(r){let{onCancel:e}=this.props;r.preventDefault(),this.detach(),e()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}};na.activators=[{eventName:"onKeyDown",handler:(t,r,e)=>{let{keyboardCodes:a=kn,onActivation:o}=r,{active:i}=e,{code:n}=t.nativeEvent;if(a.start.includes(n)){let d=i.activatorNode.current;return d&&t.target!==d?!1:(t.preventDefault(),o==null||o({event:t.nativeEvent}),!0)}return!1}}];function Zi(t){return!!(t&&"distance"in t)}function qi(t){return!!(t&&"delay"in t)}var we=class{constructor(r,e,a){var o;a===void 0&&(a=jl(r.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=r,this.events=e;let{event:i}=r,{target:n}=i;this.props=r,this.events=e,this.document=ur(n),this.documentListeners=new kr(this.document),this.listeners=new kr(a),this.windowListeners=new kr(ct(n)),this.initialCoordinates=(o=Me(i))!=null?o:Tt,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){let{events:r,props:{options:{activationConstraint:e,bypassActivationConstraint:a}}}=this;if(this.listeners.add(r.move.name,this.handleMove,{passive:!1}),this.listeners.add(r.end.name,this.handleEnd),r.cancel&&this.listeners.add(r.cancel.name,this.handleCancel),this.windowListeners.add(At.Resize,this.handleCancel),this.windowListeners.add(At.DragStart,Ui),this.windowListeners.add(At.VisibilityChange,this.handleCancel),this.windowListeners.add(At.ContextMenu,Ui),this.documentListeners.add(At.Keydown,this.handleKeydown),e){if(a!=null&&a({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(qi(e)){this.timeoutId=setTimeout(this.handleStart,e.delay),this.handlePending(e);return}if(Zi(e)){this.handlePending(e);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(r,e){let{active:a,onPending:o}=this.props;o(a,r,this.initialCoordinates,e)}handleStart(){let{initialCoordinates:r}=this,{onStart:e}=this.props;r&&(this.activated=!0,this.documentListeners.add(At.Click,zl,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(At.SelectionChange,this.removeTextSelection),e(r))}handleMove(r){var e;let{activated:a,initialCoordinates:o,props:i}=this,{onMove:n,options:{activationConstraint:d}}=i;if(!o)return;let l=(e=Me(r))!=null?e:Tt,c=Tr(o,l);if(!a&&d){if(Zi(d)){if(d.tolerance!=null&&Mo(c,d.tolerance))return this.handleCancel();if(Mo(c,d.distance))return this.handleStart()}if(qi(d)&&Mo(c,d.tolerance))return this.handleCancel();this.handlePending(d,c);return}r.cancelable&&r.preventDefault(),n(l)}handleEnd(){let{onAbort:r,onEnd:e}=this.props;this.detach(),this.activated||r(this.props.active),e()}handleCancel(){let{onAbort:r,onCancel:e}=this.props;this.detach(),this.activated||r(this.props.active),e()}handleKeydown(r){r.code===I.Esc&&this.handleCancel()}removeTextSelection(){var r;(r=this.document.getSelection())==null||r.removeAllRanges()}},Hl={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}},Rr=class extends we{constructor(r){let{event:e}=r,a=ur(e.target);super(r,Hl,a)}};Rr.activators=[{eventName:"onPointerDown",handler:(t,r)=>{let{nativeEvent:e}=t,{onActivation:a}=r;return!e.isPrimary||e.button!==0?!1:(a==null||a({event:e}),!0)}}];var Al={move:{name:"mousemove"},end:{name:"mouseup"}},wo;(function(t){t[t.RightClick=2]="RightClick"})(wo||(wo={}));var Co=class extends we{constructor(r){super(r,Al,ur(r.event.target))}};Co.activators=[{eventName:"onMouseDown",handler:(t,r)=>{let{nativeEvent:e}=t,{onActivation:a}=r;return e.button===wo.RightClick?!1:(a==null||a({event:e}),!0)}}];var yo={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}},Bo=class extends we{constructor(r){super(r,yo)}static setup(){return window.addEventListener(yo.move.name,r,{capture:!1,passive:!1}),function(){window.removeEventListener(yo.move.name,r)};function r(){}}};Bo.activators=[{eventName:"onTouchStart",handler:(t,r)=>{let{nativeEvent:e}=t,{onActivation:a}=r,{touches:o}=e;return o.length>1?!1:(a==null||a({event:e}),!0)}}];var ye;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(ye||(ye={}));var da;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(da||(da={}));function Vl(t){let{acceleration:r,activator:e=ye.Pointer,canScroll:a,draggingRect:o,enabled:i,interval:n=5,order:d=da.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:h,delta:s,threshold:u}=t,k=Tl({delta:s,disabled:!i}),[p,g]=Ei(),x=dt({x:0,y:0}),b=dt({x:0,y:0}),m=Y(()=>{switch(e){case ye.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case ye.DraggableRect:return o}},[e,o,l]),v=dt(null),f=Dt(()=>{let L=v.current;if(!L)return;let w=x.current.x*b.current.x,B=x.current.y*b.current.y;L.scrollBy(w,B)},[]),M=Y(()=>d===da.TreeOrder?[...c].reverse():c,[d,c]);J(()=>{if(!i||!c.length||!m){g();return}for(let L of M){if((a==null?void 0:a(L))===!1)continue;let w=c.indexOf(L),B=h[w];if(!B)continue;let{direction:S,speed:W}=bl(L,B,m,r,u);for(let z of["x","y"])k[z][S[z]]||(W[z]=0,S[z]=0);if(W.x>0||W.y>0){g(),v.current=L,p(f,n),x.current=W,b.current=S;return}}x.current={x:0,y:0},b.current={x:0,y:0},g()},[r,f,a,g,i,n,JSON.stringify(m),JSON.stringify(k),p,c,M,h,JSON.stringify(u)])}var Dl={x:{[at.Backward]:!1,[at.Forward]:!1},y:{[at.Backward]:!1,[at.Forward]:!1}};function Tl(t){let{delta:r,disabled:e}=t,a=me(r);return Dr(o=>{if(e||!a||!o)return Dl;let i={x:Math.sign(r.x-a.x),y:Math.sign(r.y-a.y)};return{x:{[at.Backward]:o.x[at.Backward]||i.x===-1,[at.Forward]:o.x[at.Forward]||i.x===1},y:{[at.Backward]:o.y[at.Backward]||i.y===-1,[at.Forward]:o.y[at.Forward]||i.y===1}}},[e,r,a])}function El(t,r){let e=r!=null?t.get(r):void 0,a=e?e.node.current:null;return Dr(o=>{var i;return r==null?null:(i=a!=null?a:o)!=null?i:null},[a,r])}function Rl(t,r){return Y(()=>t.reduce((e,a)=>{let{sensor:o}=a,i=o.activators.map(n=>({eventName:n.eventName,handler:r(n.handler,a)}));return[...e,...i]},[]),[t,r])}var Ce;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(Ce||(Ce={}));var Wo;(function(t){t.Optimized="optimized"})(Wo||(Wo={}));var Gi=new Map;function Fl(t,r){let{dragging:e,dependencies:a,config:o}=r,[i,n]=Bt(null),{frequency:d,measure:l,strategy:c}=o,h=dt(t),s=x(),u=Vr(s),k=Dt(function(b){b===void 0&&(b=[]),!u.current&&n(m=>m===null?b:m.concat(b.filter(v=>!m.includes(v))))},[u]),p=dt(null),g=Dr(b=>{if(s&&!e)return Gi;if(!b||b===Gi||h.current!==t||i!=null){let m=new Map;for(let v of t){if(!v)continue;if(i&&i.length>0&&!i.includes(v.id)&&v.rect.current){m.set(v.id,v.rect.current);continue}let f=v.node.current,M=f?new be(l(f),f):null;v.rect.current=M,M&&m.set(v.id,M)}return m}return b},[t,i,e,s,l]);return J(()=>{h.current=t},[t]),J(()=>{s||k()},[e,s]),J(()=>{i&&i.length>0&&n(null)},[JSON.stringify(i)]),J(()=>{s||typeof d!="number"||p.current!==null||(p.current=setTimeout(()=>{k(),p.current=null},d))},[d,s,k,...a]),{droppableRects:g,measureDroppableContainers:k,measuringScheduled:i!=null};function x(){switch(c){case Ce.Always:return!1;case Ce.BeforeDragging:return e;default:return!e}}}function jo(t,r){return Dr(e=>t?e||(typeof r=="function"?r(t):t):null,[r,t])}function Nl(t,r){return jo(t,r)}function Il(t){let{callback:r,disabled:e}=t,a=ve(r),o=Y(()=>{if(e||typeof window=="undefined"||typeof window.MutationObserver=="undefined")return;let{MutationObserver:i}=window;return new i(a)},[a,e]);return J(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function ha(t){let{callback:r,disabled:e}=t,a=ve(r),o=Y(()=>{if(e||typeof window=="undefined"||typeof window.ResizeObserver=="undefined")return;let{ResizeObserver:i}=window;return new i(a)},[e]);return J(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function Pl(t){return new be(vr(t),t)}function Ki(t,r,e){r===void 0&&(r=Pl);let[a,o]=Bt(null);function i(){o(l=>{if(!t)return null;if(t.isConnected===!1){var c;return(c=l!=null?l:e)!=null?c:null}let h=r(t);return JSON.stringify(l)===JSON.stringify(h)?l:h})}let n=Il({callback(l){if(t)for(let c of l){let{type:h,target:s}=c;if(h==="childList"&&s instanceof HTMLElement&&s.contains(t)){i();break}}}}),d=ha({callback:i});return Ct(()=>{i(),t?(d==null||d.observe(t),n==null||n.observe(document.body,{childList:!0,subtree:!0})):(d==null||d.disconnect(),n==null||n.disconnect())},[t]),a}function Ol(t){let r=jo(t);return nn(t,r)}var Xi=[];function _l(t){let r=dt(t),e=Dr(a=>t?a&&a!==Xi&&t&&r.current&&t.parentNode===r.current.parentNode?a:ca(t):Xi,[t]);return J(()=>{r.current=t},[t]),e}function $l(t){let[r,e]=Bt(null),a=dt(t),o=Dt(i=>{let n=mo(i.target);n&&e(d=>d?(d.set(n,bo(n)),new Map(d)):null)},[]);return J(()=>{let i=a.current;if(t!==i){n(i);let d=t.map(l=>{let c=mo(l);return c?(c.addEventListener("scroll",o,{passive:!0}),[c,bo(c)]):null}).filter(l=>l!=null);e(d.length?new Map(d):null),a.current=t}return()=>{n(t),n(i)};function n(d){d.forEach(l=>{let c=mo(l);c==null||c.removeEventListener("scroll",o)})}},[o,t]),Y(()=>t.length?r?Array.from(r.values()).reduce((i,n)=>pr(i,n),Tt):gn(t):Tt,[t,r])}function Yi(t,r){r===void 0&&(r=[]);let e=dt(null);return J(()=>{e.current=null},r),J(()=>{let a=t!==Tt;a&&!e.current&&(e.current=t),!a&&e.current&&(e.current=null)},[t]),e.current?Tr(t,e.current):Tt}function Ul(t){J(()=>{if(!xe)return;let r=t.map(e=>{let{sensor:a}=e;return a.setup==null?void 0:a.setup()});return()=>{for(let e of r)e==null||e()}},t.map(r=>{let{sensor:e}=r;return e}))}function Zl(t,r){return Y(()=>t.reduce((e,a)=>{let{eventName:o,handler:i}=a;return e[o]=n=>{i(n,r)},e},{}),[t,r])}function fn(t){return Y(()=>t?Ll(t):null,[t])}var Ji=[];function ql(t,r){r===void 0&&(r=vr);let[e]=t,a=fn(e?ct(e):null),[o,i]=Bt(Ji);function n(){i(()=>t.length?t.map(l=>sn(l)?a:new be(r(l),l)):Ji)}let d=ha({callback:n});return Ct(()=>{d==null||d.disconnect(),n(),t.forEach(l=>d==null?void 0:d.observe(l))},[t]),o}function xn(t){if(!t)return null;if(t.children.length>1)return t;let r=t.children[0];return Ar(r)?r:t}function Gl(t){let{measure:r}=t,[e,a]=Bt(null),o=Dt(c=>{for(let{target:h}of c)if(Ar(h)){a(s=>{let u=r(h);return s?{...s,width:u.width,height:u.height}:u});break}},[r]),i=ha({callback:o}),n=Dt(c=>{let h=xn(c);i==null||i.disconnect(),h&&(i==null||i.observe(h)),a(h?r(h):null)},[r,i]),[d,l]=Le(n);return Y(()=>({nodeRef:d,rect:e,setRef:l}),[e,d,l])}var Kl=[{sensor:Rr,options:{}},{sensor:na,options:{}}],Xl={current:{}},oa={draggable:{measure:$i},droppable:{measure:$i,strategy:Ce.WhileDragging,frequency:Wo.Optimized},dragOverlay:{measure:vr}},fr=class extends Map{get(r){var e;return r!=null&&(e=super.get(r))!=null?e:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(r=>{let{disabled:e}=r;return!e})}getNodeFor(r){var e,a;return(e=(a=this.get(r))==null?void 0:a.node.current)!=null?e:void 0}},Yl={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new fr,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:ia},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:oa,measureDroppableContainers:ia,windowRect:null,measuringScheduled:!1},vn={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:ia,draggableNodes:new Map,over:null,measureDroppableContainers:ia},We=Be(vn),Ln=Be(Yl);function Jl(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new fr}}}function Ql(t,r){switch(r.type){case rt.DragStart:return{...t,draggable:{...t.draggable,initialCoordinates:r.initialCoordinates,active:r.active}};case rt.DragMove:return t.draggable.active==null?t:{...t,draggable:{...t.draggable,translate:{x:r.coordinates.x-t.draggable.initialCoordinates.x,y:r.coordinates.y-t.draggable.initialCoordinates.y}}};case rt.DragEnd:case rt.DragCancel:return{...t,draggable:{...t.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case rt.RegisterDroppable:{let{element:e}=r,{id:a}=e,o=new fr(t.droppable.containers);return o.set(a,e),{...t,droppable:{...t.droppable,containers:o}}}case rt.SetDroppableDisabled:{let{id:e,key:a,disabled:o}=r,i=t.droppable.containers.get(e);if(!i||a!==i.key)return t;let n=new fr(t.droppable.containers);return n.set(e,{...i,disabled:o}),{...t,droppable:{...t.droppable,containers:n}}}case rt.UnregisterDroppable:{let{id:e,key:a}=r,o=t.droppable.containers.get(e);if(!o||a!==o.key)return t;let i=new fr(t.droppable.containers);return i.delete(e),{...t,droppable:{...t.droppable,containers:i}}}default:return t}}function tc(t){let{disabled:r}=t,{active:e,activatorEvent:a,draggableNodes:o}=xr(We),i=me(a),n=me(e==null?void 0:e.id);return J(()=>{if(!r&&!a&&i&&n!=null){if(!Er(i)||document.activeElement===i.target)return;let d=o.get(n);if(!d)return;let{activatorNode:l,node:c}=d;if(!l.current&&!c.current)return;requestAnimationFrame(()=>{for(let h of[l.current,c.current]){if(!h)continue;let s=Fi(h);if(s){s.focus();break}}})}},[a,r,o,n,i]),null}function mn(t,r){let{transform:e,...a}=r;return t!=null&&t.length?t.reduce((o,i)=>i({transform:o,...a}),e):e}function rc(t){return Y(()=>({draggable:{...oa.draggable,...t==null?void 0:t.draggable},droppable:{...oa.droppable,...t==null?void 0:t.droppable},dragOverlay:{...oa.dragOverlay,...t==null?void 0:t.dragOverlay}}),[t==null?void 0:t.draggable,t==null?void 0:t.droppable,t==null?void 0:t.dragOverlay])}function ec(t){let{activeNode:r,measure:e,initialRect:a,config:o=!0}=t,i=dt(!1),{x:n,y:d}=typeof o=="boolean"?{x:o,y:o}:o;Ct(()=>{if(!n&&!d||!r){i.current=!1;return}if(i.current||!a)return;let c=r==null?void 0:r.node.current;if(!c||c.isConnected===!1)return;let h=e(c),s=nn(h,a);if(n||(s.x=0),d||(s.y=0),i.current=!0,Math.abs(s.x)>0||Math.abs(s.y)>0){let u=ln(c);u&&u.scrollBy({top:s.y,left:s.x})}},[r,n,d,a,e])}var sa=Be({...Tt,scaleX:1,scaleY:1}),nr;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(nr||(nr={}));var ua=J2(function(r){var e,a,o,i;let{id:n,accessibility:d,autoScroll:l=!0,children:c,sensors:h=Kl,collisionDetection:s=gl,measuring:u,modifiers:k,...p}=r,g=Q2(Ql,void 0,Jl),[x,b]=g,[m,v]=ol(),[f,M]=Bt(nr.Uninitialized),L=f===nr.Initialized,{draggable:{active:w,nodes:B,translate:S},droppable:{containers:W}}=x,z=w!=null?B.get(w):null,F=dt({initial:null,translated:null}),A=Y(()=>{var lt;return w!=null?{id:w,data:(lt=z==null?void 0:z.data)!=null?lt:Xl,rect:F}:null},[w,z]),H=dt(null),[N,G]=Bt(null),[O,U]=Bt(null),Lt=Vr(p,Object.values(p)),mt=gr("DndDescribedBy",n),Mt=Y(()=>W.getEnabled(),[W]),tt=rc(u),{droppableRects:St,measureDroppableContainers:Ut,measuringScheduled:hr}=Fl(Mt,{dragging:L,dependencies:[S.x,S.y],config:tt.droppable}),ft=El(B,w),qe=Y(()=>O?Me(O):null,[O]),Jt=z2(),Zt=Nl(ft,tt.draggable.measure);ec({activeNode:w!=null?B.get(w):null,config:Jt.layoutShiftCompensation,initialRect:Zt,measure:tt.draggable.measure});let _=Ki(ft,tt.draggable.measure,Zt),le=Ki(ft?ft.parentElement:null),It=dt({activatorEvent:null,active:null,activeNode:ft,collisionRect:null,collisions:null,droppableRects:St,draggableNodes:B,draggingNode:null,draggingNodeRect:null,droppableContainers:W,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),wr=W.getNodeFor((e=It.current.over)==null?void 0:e.id),qt=Gl({measure:tt.dragOverlay.measure}),Cr=(a=qt.nodeRef.current)!=null?a:ft,Br=L?(o=qt.rect)!=null?o:_:null,Li=!!(qt.nodeRef.current&&qt.rect),mi=Ol(Li?null:_),so=fn(Cr?ct(Cr):null),Qt=_l(L?wr!=null?wr:ft:null),Ge=ql(Qt),Ke=mn(k,{transform:{x:S.x-mi.x,y:S.y-mi.y,scaleX:1,scaleY:1},activatorEvent:O,active:A,activeNodeRect:_,containerNodeRect:le,draggingNodeRect:Br,over:It.current.over,overlayNodeRect:qt.rect,scrollableAncestors:Qt,scrollableAncestorRects:Ge,windowRect:so}),Mi=qe?pr(qe,S):null,yi=$l(Qt),y2=Yi(yi),b2=Yi(yi,[_]),Wr=pr(Ke,y2),jr=Br?fl(Br,Ke):null,ce=A&&jr?s({active:A,collisionRect:jr,droppableRects:St,droppableContainers:Mt,pointerCoordinates:Mi}):null,bi=on(ce,"id"),[tr,wi]=Bt(null),w2=Li?Ke:pr(Ke,b2),C2=pl(w2,(i=tr==null?void 0:tr.rect)!=null?i:null,_),uo=dt(null),Ci=Dt((lt,yt)=>{let{sensor:bt,options:rr}=yt;if(H.current==null)return;let Ht=B.get(H.current);if(!Ht)return;let wt=lt.nativeEvent,Pt=new bt({active:H.current,activeNode:Ht,event:wt,options:rr,context:It,onAbort(nt){if(!B.get(nt))return;let{onDragAbort:Ot}=Lt.current,Gt={id:nt};Ot==null||Ot(Gt),m({type:"onDragAbort",event:Gt})},onPending(nt,er,Ot,Gt){if(!B.get(nt))return;let{onDragPending:se}=Lt.current,ar={id:nt,constraint:er,initialCoordinates:Ot,offset:Gt};se==null||se(ar),m({type:"onDragPending",event:ar})},onStart(nt){let er=H.current;if(er==null)return;let Ot=B.get(er);if(!Ot)return;let{onDragStart:Gt}=Lt.current,he={activatorEvent:wt,active:{id:er,data:Ot.data,rect:F}};aa(()=>{Gt==null||Gt(he),M(nr.Initializing),b({type:rt.DragStart,initialCoordinates:nt,active:er}),m({type:"onDragStart",event:he}),G(uo.current),U(wt)})},onMove(nt){b({type:rt.DragMove,coordinates:nt})},onEnd:zr(rt.DragEnd),onCancel:zr(rt.DragCancel)});uo.current=Pt;function zr(nt){return async function(){let{active:Ot,collisions:Gt,over:he,scrollAdjustedTranslate:se}=It.current,ar=null;if(Ot&&se){let{cancelDrop:ue}=Lt.current;ar={activatorEvent:wt,active:Ot,collisions:Gt,delta:se,over:he},nt===rt.DragEnd&&typeof ue=="function"&&await Promise.resolve(ue(ar))&&(nt=rt.DragCancel)}H.current=null,aa(()=>{b({type:nt}),M(nr.Uninitialized),wi(null),G(null),U(null),uo.current=null;let ue=nt===rt.DragEnd?"onDragEnd":"onDragCancel";if(ar){let go=Lt.current[ue];go==null||go(ar),m({type:ue,event:ar})}})}}},[B]),B2=Dt((lt,yt)=>(bt,rr)=>{let Ht=bt.nativeEvent,wt=B.get(rr);if(H.current!==null||!wt||Ht.dndKit||Ht.defaultPrevented)return;let Pt={active:wt};lt(bt,yt.options,Pt)===!0&&(Ht.dndKit={capturedBy:yt.sensor},H.current=rr,Ci(bt,yt))},[B,Ci]),Bi=Rl(h,B2);Ul(h),Ct(()=>{_&&f===nr.Initializing&&M(nr.Initialized)},[_,f]),J(()=>{let{onDragMove:lt}=Lt.current,{active:yt,activatorEvent:bt,collisions:rr,over:Ht}=It.current;if(!yt||!bt)return;let wt={active:yt,activatorEvent:bt,collisions:rr,delta:{x:Wr.x,y:Wr.y},over:Ht};aa(()=>{lt==null||lt(wt),m({type:"onDragMove",event:wt})})},[Wr.x,Wr.y]),J(()=>{let{active:lt,activatorEvent:yt,collisions:bt,droppableContainers:rr,scrollAdjustedTranslate:Ht}=It.current;if(!lt||H.current==null||!yt||!Ht)return;let{onDragOver:wt}=Lt.current,Pt=rr.get(bi),zr=Pt&&Pt.rect.current?{id:Pt.id,rect:Pt.rect.current,data:Pt.data,disabled:Pt.disabled}:null,nt={active:lt,activatorEvent:yt,collisions:bt,delta:{x:Ht.x,y:Ht.y},over:zr};aa(()=>{wi(zr),wt==null||wt(nt),m({type:"onDragOver",event:nt})})},[bi]),Ct(()=>{It.current={activatorEvent:O,active:A,activeNode:ft,collisionRect:jr,collisions:ce,droppableRects:St,draggableNodes:B,draggingNode:Cr,draggingNodeRect:Br,droppableContainers:W,over:tr,scrollableAncestors:Qt,scrollAdjustedTranslate:Wr},F.current={initial:Br,translated:jr}},[A,ft,ce,jr,B,Cr,Br,St,W,tr,Qt,Wr]),Vl({...Jt,delta:S,draggingRect:jr,pointerCoordinates:Mi,scrollableAncestors:Qt,scrollableAncestorRects:Ge});let W2=Y(()=>({active:A,activeNode:ft,activeNodeRect:_,activatorEvent:O,collisions:ce,containerNodeRect:le,dragOverlay:qt,draggableNodes:B,droppableContainers:W,droppableRects:St,over:tr,measureDroppableContainers:Ut,scrollableAncestors:Qt,scrollableAncestorRects:Ge,measuringConfiguration:tt,measuringScheduled:hr,windowRect:so}),[A,ft,_,O,ce,le,qt,B,W,St,tr,Ut,Qt,Ge,tt,hr,so]),j2=Y(()=>({activatorEvent:O,activators:Bi,active:A,activeNodeRect:_,ariaDescribedById:{draggable:mt},dispatch:b,draggableNodes:B,over:tr,measureDroppableContainers:Ut}),[O,Bi,A,_,b,mt,B,tr,Ut]);return et.createElement(rn.Provider,{value:v},et.createElement(We.Provider,{value:j2},et.createElement(Ln.Provider,{value:W2},et.createElement(sa.Provider,{value:C2},c)),et.createElement(tc,{disabled:(d==null?void 0:d.restoreFocus)===!1})),et.createElement(dl,{...d,hiddenTextDescribedById:mt}));function z2(){let lt=(N==null?void 0:N.autoScrollEnabled)===!1,yt=typeof l=="object"?l.enabled===!1:l===!1,bt=L&&!lt&&!yt;return typeof l=="object"?{...l,enabled:bt}:{enabled:bt}}}),ac=Be(null),Qi="button",oc="Draggable";function ga(t){let{id:r,data:e,disabled:a=!1,attributes:o}=t,i=gr(oc),{activators:n,activatorEvent:d,active:l,activeNodeRect:c,ariaDescribedById:h,draggableNodes:s,over:u}=xr(We),{role:k=Qi,roleDescription:p="draggable",tabIndex:g=0}=o!=null?o:{},x=(l==null?void 0:l.id)===r,b=xr(x?sa:ac),[m,v]=Le(),[f,M]=Le(),L=Zl(n,r),w=Vr(e);Ct(()=>(s.set(r,{id:r,key:i,node:m,activatorNode:f,data:w}),()=>{let S=s.get(r);S&&S.key===i&&s.delete(r)}),[s,r]);let B=Y(()=>({role:k,tabIndex:g,"aria-disabled":a,"aria-pressed":x&&k===Qi?!0:void 0,"aria-roledescription":p,"aria-describedby":h.draggable}),[a,k,g,x,p,h.draggable]);return{active:l,activatorEvent:d,activeNodeRect:c,attributes:B,isDragging:x,listeners:a?void 0:L,node:m,over:u,setNodeRef:v,setActivatorNodeRef:M,transform:b}}function zo(){return xr(Ln)}var ic="Droppable",nc={timeout:25};function pa(t){let{data:r,disabled:e=!1,id:a,resizeObserverConfig:o}=t,i=gr(ic),{active:n,dispatch:d,over:l,measureDroppableContainers:c}=xr(We),h=dt({disabled:e}),s=dt(!1),u=dt(null),k=dt(null),{disabled:p,updateMeasurementsFor:g,timeout:x}={...nc,...o},b=Vr(g!=null?g:a),m=Dt(()=>{if(!s.current){s.current=!0;return}k.current!=null&&clearTimeout(k.current),k.current=setTimeout(()=>{c(Array.isArray(b.current)?b.current:[b.current]),k.current=null},x)},[x]),v=ha({callback:m,disabled:p||!n}),f=Dt((B,S)=>{v&&(S&&(v.unobserve(S),s.current=!1),B&&v.observe(B))},[v]),[M,L]=Le(f),w=Vr(r);return J(()=>{!v||!M.current||(v.disconnect(),s.current=!1,v.observe(M.current))},[M,v]),J(()=>(d({type:rt.RegisterDroppable,element:{id:a,key:i,disabled:e,node:M,rect:u,data:w}}),()=>d({type:rt.UnregisterDroppable,key:i,id:a})),[a]),J(()=>{e!==h.current.disabled&&(d({type:rt.SetDroppableDisabled,id:a,key:i,disabled:e}),h.current.disabled=e)},[a,i,e,d]),{active:n,rect:u,isOver:(l==null?void 0:l.id)===a,node:M,over:l,setNodeRef:L}}function dc(t){let{animation:r,children:e}=t,[a,o]=Bt(null),[i,n]=Bt(null),d=me(e);return!e&&!a&&d&&o(d),Ct(()=>{if(!i)return;let l=a==null?void 0:a.key,c=a==null?void 0:a.props.id;if(l==null||c==null){o(null);return}Promise.resolve(r(c,i)).then(()=>{o(null)})},[r,a,i]),et.createElement(et.Fragment,null,e,a?tl(a,{ref:n}):null)}var lc={x:0,y:0,scaleX:1,scaleY:1};function cc(t){let{children:r}=t;return et.createElement(We.Provider,{value:vn},et.createElement(sa.Provider,{value:lc},r))}var hc={position:"fixed",touchAction:"none"},sc=t=>Er(t)?"transform 250ms ease":void 0,uc=rl((t,r)=>{let{as:e,activatorEvent:a,adjustScale:o,children:i,className:n,rect:d,style:l,transform:c,transition:h=sc}=t;if(!d)return null;let s=o?c:{...c,scaleX:1,scaleY:1},u={...hc,width:d.width,height:d.height,top:d.top,left:d.left,transform:xt.Transform.toString(s),transformOrigin:o&&a?cl(a,d):void 0,transition:typeof h=="function"?h(a):h,...l};return et.createElement(e,{className:n,style:u,ref:r},i)}),gc=t=>r=>{let{active:e,dragOverlay:a}=r,o={},{styles:i,className:n}=t;if(i!=null&&i.active)for(let[d,l]of Object.entries(i.active))l!==void 0&&(o[d]=e.node.style.getPropertyValue(d),e.node.style.setProperty(d,l));if(i!=null&&i.dragOverlay)for(let[d,l]of Object.entries(i.dragOverlay))l!==void 0&&a.node.style.setProperty(d,l);return n!=null&&n.active&&e.node.classList.add(n.active),n!=null&&n.dragOverlay&&a.node.classList.add(n.dragOverlay),function(){for(let[l,c]of Object.entries(o))e.node.style.setProperty(l,c);n!=null&&n.active&&e.node.classList.remove(n.active)}},pc=t=>{let{transform:{initial:r,final:e}}=t;return[{transform:xt.Transform.toString(r)},{transform:xt.Transform.toString(e)}]},kc={duration:250,easing:"ease",keyframes:pc,sideEffects:gc({styles:{active:{opacity:"0"}}})};function fc(t){let{config:r,draggableNodes:e,droppableContainers:a,measuringConfiguration:o}=t;return ve((i,n)=>{if(r===null)return;let d=e.get(i);if(!d)return;let l=d.node.current;if(!l)return;let c=xn(n);if(!c)return;let{transform:h}=ct(n).getComputedStyle(n),s=dn(h);if(!s)return;let u=typeof r=="function"?r:xc(r);return pn(l,o.draggable.measure),u({active:{id:i,data:d.data,node:l,rect:o.draggable.measure(l)},draggableNodes:e,dragOverlay:{node:n,rect:o.dragOverlay.measure(c)},droppableContainers:a,measuringConfiguration:o,transform:s})})}function xc(t){let{duration:r,easing:e,sideEffects:a,keyframes:o}={...kc,...t};return i=>{let{active:n,dragOverlay:d,transform:l,...c}=i;if(!r)return;let h={x:d.rect.left-n.rect.left,y:d.rect.top-n.rect.top},s={scaleX:l.scaleX!==1?n.rect.width*l.scaleX/d.rect.width:1,scaleY:l.scaleY!==1?n.rect.height*l.scaleY/d.rect.height:1},u={x:l.x-h.x,y:l.y-h.y,...s},k=o({...c,active:n,dragOverlay:d,transform:{initial:l,final:u}}),[p]=k,g=k[k.length-1];if(JSON.stringify(p)===JSON.stringify(g))return;let x=a==null?void 0:a({active:n,dragOverlay:d,...c}),b=d.node.animate(k,{duration:r,easing:e,fill:"forwards"});return new Promise(m=>{b.onfinish=()=>{x==null||x(),m()}})}}var tn=0;function vc(t){return Y(()=>{if(t!=null)return tn++,tn},[t])}var ka=et.memo(t=>{let{adjustScale:r=!1,children:e,dropAnimation:a,style:o,transition:i,modifiers:n,wrapperElement:d="div",className:l,zIndex:c=999}=t,{activatorEvent:h,active:s,activeNodeRect:u,containerNodeRect:k,draggableNodes:p,droppableContainers:g,dragOverlay:x,over:b,measuringConfiguration:m,scrollableAncestors:v,scrollableAncestorRects:f,windowRect:M}=zo(),L=xr(sa),w=vc(s==null?void 0:s.id),B=mn(n,{activatorEvent:h,active:s,activeNodeRect:u,containerNodeRect:k,draggingNodeRect:x.rect,over:b,overlayNodeRect:x.rect,scrollableAncestors:v,scrollableAncestorRects:f,transform:L,windowRect:M}),S=jo(u),W=fc({config:a,draggableNodes:p,droppableContainers:g,measuringConfiguration:m}),z=S?x.setRef:void 0;return et.createElement(cc,null,et.createElement(dc,{animation:W},s&&w?et.createElement(uc,{key:w,id:s.id,ref:z,as:d,activatorEvent:h,adjustScale:r,className:l,transition:i,rect:S,style:{zIndex:c,...o},transform:B},e):null))});import je from"react";import Mn from"react";var So={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Ho=Mn.createContext&&Mn.createContext(So);var Lc=["attr","size","title"];function mc(t,r){if(t==null)return{};var e,a,o=Mc(t,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(a=0;a<i.length;a++)e=i[a],r.indexOf(e)===-1&&{}.propertyIsEnumerable.call(t,e)&&(o[e]=t[e])}return o}function Mc(t,r){if(t==null)return{};var e={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(r.indexOf(a)!==-1)continue;e[a]=t[a]}return e}function fa(){return fa=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var e=arguments[r];for(var a in e)({}).hasOwnProperty.call(e,a)&&(t[a]=e[a])}return t},fa.apply(null,arguments)}function yn(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);r&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),e.push.apply(e,a)}return e}function xa(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?yn(Object(e),!0).forEach(function(a){yc(t,a,e[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):yn(Object(e)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(e,a))})}return t}function yc(t,r,e){return(r=bc(r))in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}function bc(t){var r=wc(t,"string");return typeof r=="symbol"?r:r+""}function wc(t,r){if(typeof t!="object"||!t)return t;var e=t[Symbol.toPrimitive];if(e!==void 0){var a=e.call(t,r||"default");if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(t)}function bn(t){return t&&t.map((r,e)=>je.createElement(r.tag,xa({key:e},r.attr),bn(r.child)))}function V(t){return r=>je.createElement(Cc,fa({attr:xa({},t.attr)},r),bn(t.child))}function Cc(t){var r=e=>{var a=t.attr,o=t.size,i=t.title,n=mc(t,Lc),d=o||e.size||"1em",l;return e.className&&(l=e.className),t.className&&(l=(l?l+" ":"")+t.className),je.createElement("svg",fa({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},e.attr,a,n,{className:l,style:xa(xa({color:t.color||e.color},e.style),t.style),height:d,width:d,xmlns:"http://www.w3.org/2000/svg"}),i&&je.createElement("title",null,i),t.children)};return Ho!==void 0?je.createElement(Ho.Consumer,null,e=>r(e)):r(So)}function Fr(t){return V({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M18 6 6 18"},child:[]},{tag:"path",attr:{d:"m6 6 12 12"},child:[]}]})(t)}function wn(t){return V({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5"},child:[]},{tag:"rect",attr:{x:"2",y:"6",width:"14",height:"12",rx:"2"},child:[]}]})(t)}function Cn(t){return V({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"},child:[]},{tag:"polyline",attr:{points:"17 8 12 3 7 8"},child:[]},{tag:"line",attr:{x1:"12",x2:"12",y1:"3",y2:"15"},child:[]}]})(t)}function Bn(t){return V({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71"},child:[]},{tag:"path",attr:{d:"m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71"},child:[]},{tag:"line",attr:{x1:"8",x2:"8",y1:"2",y2:"5"},child:[]},{tag:"line",attr:{x1:"2",x2:"5",y1:"8",y2:"8"},child:[]},{tag:"line",attr:{x1:"16",x2:"16",y1:"19",y2:"22"},child:[]},{tag:"line",attr:{x1:"19",x2:"22",y1:"16",y2:"16"},child:[]}]})(t)}function Wn(t){return V({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M9 14 4 9l5-5"},child:[]},{tag:"path",attr:{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11"},child:[]}]})(t)}function Nr(t){return V({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M6 4v6a6 6 0 0 0 12 0V4"},child:[]},{tag:"line",attr:{x1:"4",x2:"20",y1:"20",y2:"20"},child:[]}]})(t)}function jn(t){return V({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"4 7 4 4 20 4 20 7"},child:[]},{tag:"line",attr:{x1:"9",x2:"15",y1:"20",y2:"20"},child:[]},{tag:"line",attr:{x1:"12",x2:"12",y1:"4",y2:"20"},child:[]}]})(t)}function Ir(t){return V({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M3 6h18"},child:[]},{tag:"path",attr:{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"},child:[]},{tag:"path",attr:{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"},child:[]},{tag:"line",attr:{x1:"10",x2:"10",y1:"11",y2:"17"},child:[]},{tag:"line",attr:{x1:"14",x2:"14",y1:"11",y2:"17"},child:[]}]})(t)}function zn(t){return V({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"10",x2:"14",y1:"2",y2:"2"},child:[]},{tag:"line",attr:{x1:"12",x2:"15",y1:"14",y2:"11"},child:[]},{tag:"circle",attr:{cx:"12",cy:"14",r:"8"},child:[]}]})(t)}function Pr(t){return V({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z"},child:[]},{tag:"circle",attr:{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor"},child:[]}]})(t)}function Or(t){return V({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M16 4H9a3 3 0 0 0-2.83 4"},child:[]},{tag:"path",attr:{d:"M14 12a4 4 0 0 1 0 8H6"},child:[]},{tag:"line",attr:{x1:"4",x2:"20",y1:"12",y2:"12"},child:[]}]})(t)}function Sn(t){return V({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2"},child:[]},{tag:"path",attr:{d:"M12 18h.01"},child:[]}]})(t)}function Hn(t){return V({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"18",cy:"5",r:"3"},child:[]},{tag:"circle",attr:{cx:"6",cy:"12",r:"3"},child:[]},{tag:"circle",attr:{cx:"18",cy:"19",r:"3"},child:[]},{tag:"line",attr:{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49"},child:[]},{tag:"line",attr:{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49"},child:[]}]})(t)}function An(t){return V({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"},child:[]},{tag:"circle",attr:{cx:"12",cy:"12",r:"3"},child:[]}]})(t)}function va(t){return V({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"11",cy:"11",r:"8"},child:[]},{tag:"path",attr:{d:"m21 21-4.3-4.3"},child:[]}]})(t)}function Vn(t){return V({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m2 9 3-3 3 3"},child:[]},{tag:"path",attr:{d:"M13 18H7a2 2 0 0 1-2-2V6"},child:[]},{tag:"path",attr:{d:"m22 15-3 3-3-3"},child:[]},{tag:"path",attr:{d:"M11 6h6a2 2 0 0 1 2 2v10"},child:[]}]})(t)}function Dn(t){return V({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M4 7V4h16v3"},child:[]},{tag:"path",attr:{d:"M5 20h6"},child:[]},{tag:"path",attr:{d:"M13 4 8 20"},child:[]},{tag:"path",attr:{d:"m15 15 5 5"},child:[]},{tag:"path",attr:{d:"m20 15-5 5"},child:[]}]})(t)}function Tn(t){return V({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"},child:[]},{tag:"path",attr:{d:"M3 3v5h5"},child:[]},{tag:"path",attr:{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16"},child:[]},{tag:"path",attr:{d:"M16 16h5v5"},child:[]}]})(t)}function En(t){return V({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m15 14 5-5-5-5"},child:[]},{tag:"path",attr:{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13"},child:[]}]})(t)}function Rn(t){return V({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{width:"5",height:"5",x:"3",y:"3",rx:"1"},child:[]},{tag:"rect",attr:{width:"5",height:"5",x:"16",y:"3",rx:"1"},child:[]},{tag:"rect",attr:{width:"5",height:"5",x:"3",y:"16",rx:"1"},child:[]},{tag:"path",attr:{d:"M21 16h-3a2 2 0 0 0-2 2v3"},child:[]},{tag:"path",attr:{d:"M21 21v.01"},child:[]},{tag:"path",attr:{d:"M12 7v3a2 2 0 0 1-2 2H7"},child:[]},{tag:"path",attr:{d:"M3 12h.01"},child:[]},{tag:"path",attr:{d:"M12 3h.01"},child:[]},{tag:"path",attr:{d:"M12 16v.01"},child:[]},{tag:"path",attr:{d:"M16 12h1"},child:[]},{tag:"path",attr:{d:"M21 12v.01"},child:[]},{tag:"path",attr:{d:"M12 21v-1"},child:[]}]})(t)}function Ao(t){return V({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M5 12h14"},child:[]},{tag:"path",attr:{d:"M12 5v14"},child:[]}]})(t)}function Fn(t){return V({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M12 20h9"},child:[]},{tag:"path",attr:{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z"},child:[]}]})(t)}function Nn(t){return V({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M14 4.1 12 6"},child:[]},{tag:"path",attr:{d:"m5.1 8-2.9-.8"},child:[]},{tag:"path",attr:{d:"m6 12-1.9 2"},child:[]},{tag:"path",attr:{d:"M7.2 2.2 8 5.1"},child:[]},{tag:"path",attr:{d:"M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z"},child:[]}]})(t)}function In(t){return V({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{width:"20",height:"14",x:"2",y:"3",rx:"2"},child:[]},{tag:"line",attr:{x1:"8",x2:"16",y1:"21",y2:"21"},child:[]},{tag:"line",attr:{x1:"12",x2:"12",y1:"17",y2:"21"},child:[]}]})(t)}function Pn(t){return V({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M5 12h14"},child:[]}]})(t)}function On(t){return V({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0"},child:[]},{tag:"circle",attr:{cx:"12",cy:"10",r:"3"},child:[]}]})(t)}function La(t){return V({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M3 12h.01"},child:[]},{tag:"path",attr:{d:"M3 18h.01"},child:[]},{tag:"path",attr:{d:"M3 6h.01"},child:[]},{tag:"path",attr:{d:"M8 12h13"},child:[]},{tag:"path",attr:{d:"M8 18h13"},child:[]},{tag:"path",attr:{d:"M8 6h13"},child:[]}]})(t)}function _n(t){return V({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M21 12h-8"},child:[]},{tag:"path",attr:{d:"M21 6H8"},child:[]},{tag:"path",attr:{d:"M21 18h-8"},child:[]},{tag:"path",attr:{d:"M3 6v4c0 1.1.9 2 2 2h3"},child:[]},{tag:"path",attr:{d:"M3 10v6c0 1.1.9 2 2 2h3"},child:[]}]})(t)}function $n(t){return V({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M10 12h11"},child:[]},{tag:"path",attr:{d:"M10 18h11"},child:[]},{tag:"path",attr:{d:"M10 6h11"},child:[]},{tag:"path",attr:{d:"M4 10h2"},child:[]},{tag:"path",attr:{d:"M4 6h1v4"},child:[]},{tag:"path",attr:{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1"},child:[]}]})(t)}function ma(t){return V({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"},child:[]},{tag:"path",attr:{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"},child:[]}]})(t)}function Ma(t){return V({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{width:"18",height:"7",x:"3",y:"3",rx:"1"},child:[]},{tag:"rect",attr:{width:"9",height:"7",x:"3",y:"14",rx:"1"},child:[]},{tag:"rect",attr:{width:"5",height:"7",x:"16",y:"14",rx:"1"},child:[]}]})(t)}function _r(t){return V({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"19",x2:"10",y1:"4",y2:"4"},child:[]},{tag:"line",attr:{x1:"14",x2:"5",y1:"20",y2:"20"},child:[]},{tag:"line",attr:{x1:"15",x2:"9",y1:"4",y2:"20"},child:[]}]})(t)}function $r(t){return V({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2"},child:[]},{tag:"circle",attr:{cx:"9",cy:"9",r:"2"},child:[]},{tag:"path",attr:{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"},child:[]}]})(t)}function Un(t){return V({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M6 12h12"},child:[]},{tag:"path",attr:{d:"M6 20V4"},child:[]},{tag:"path",attr:{d:"M18 20V4"},child:[]}]})(t)}function ya(t){return V({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"},child:[]},{tag:"circle",attr:{cx:"12",cy:"12",r:"3"},child:[]}]})(t)}function Zn(t){return V({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M22 7.7c0-.6-.4-1.2-.8-1.5l-6.3-3.9a1.72 1.72 0 0 0-1.7 0l-10.3 6c-.5.2-.9.8-.9 1.4v6.6c0 .5.4 1.2.8 1.5l6.3 3.9a1.72 1.72 0 0 0 1.7 0l10.3-6c.5-.3.9-1 .9-1.5Z"},child:[]},{tag:"path",attr:{d:"M10 21.9V14L2.1 9.1"},child:[]},{tag:"path",attr:{d:"m10 14 11.9-6.9"},child:[]},{tag:"path",attr:{d:"M14 19.8v-8.1"},child:[]},{tag:"path",attr:{d:"M18 17.5V9.4"},child:[]}]})(t)}function qn(t){return V({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{width:"18",height:"18",x:"3",y:"3",rx:"2"},child:[]},{tag:"path",attr:{d:"M9 3v18"},child:[]},{tag:"path",attr:{d:"M15 3v18"},child:[]}]})(t)}function ba(t){return V({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"16 18 22 12 16 6"},child:[]},{tag:"polyline",attr:{points:"8 6 2 12 8 18"},child:[]}]})(t)}function wa(t){return V({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m9 18 6-6-6-6"},child:[]}]})(t)}function Gn(t){return V({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m15 18-6-6 6-6"},child:[]}]})(t)}function Ca(t){return V({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m6 9 6 6 6-6"},child:[]}]})(t)}function Kn(t){return V({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m3 15 4-8 4 8"},child:[]},{tag:"path",attr:{d:"M4 13h6"},child:[]},{tag:"path",attr:{d:"M15 11h4.5a2 2 0 0 1 0 4H15V7h4a2 2 0 0 1 0 4"},child:[]}]})(t)}function Xn(t){return V({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m3 15 4-8 4 8"},child:[]},{tag:"path",attr:{d:"M4 13h6"},child:[]},{tag:"circle",attr:{cx:"18",cy:"12",r:"3"},child:[]},{tag:"path",attr:{d:"M21 9v6"},child:[]}]})(t)}function Yn(t){return V({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"7",cy:"12",r:"3"},child:[]},{tag:"path",attr:{d:"M10 9v6"},child:[]},{tag:"circle",attr:{cx:"17",cy:"12",r:"3"},child:[]},{tag:"path",attr:{d:"M14 7v8"},child:[]}]})(t)}function Jn(t){return V({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M8 2v4"},child:[]},{tag:"path",attr:{d:"M16 2v4"},child:[]},{tag:"rect",attr:{width:"18",height:"18",x:"3",y:"4",rx:"2"},child:[]},{tag:"path",attr:{d:"M3 10h18"},child:[]}]})(t)}function Ur(t){return V({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8"},child:[]}]})(t)}function Qn(t){return V({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M4 20h16"},child:[]},{tag:"path",attr:{d:"m6 16 6-12 6 12"},child:[]},{tag:"path",attr:{d:"M8 12h8"},child:[]}]})(t)}function td(t){return V({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m3 16 4 4 4-4"},child:[]},{tag:"path",attr:{d:"M7 20V4"},child:[]},{tag:"path",attr:{d:"m21 8-4-4-4 4"},child:[]},{tag:"path",attr:{d:"M17 4v16"},child:[]}]})(t)}function Zr(t){return V({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M21 12H9"},child:[]},{tag:"path",attr:{d:"M21 18H7"},child:[]},{tag:"path",attr:{d:"M21 6H3"},child:[]}]})(t)}function qr(t){return V({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M15 12H3"},child:[]},{tag:"path",attr:{d:"M17 18H3"},child:[]},{tag:"path",attr:{d:"M21 6H3"},child:[]}]})(t)}function rd(t){return V({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M3 12h18"},child:[]},{tag:"path",attr:{d:"M3 18h18"},child:[]},{tag:"path",attr:{d:"M3 6h18"},child:[]}]})(t)}function Gr(t){return V({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M17 12H7"},child:[]},{tag:"path",attr:{d:"M19 18H5"},child:[]},{tag:"path",attr:{d:"M21 6H3"},child:[]}]})(t)}var Kr=Bc;function Bc(t,r,e){var a=null,o=null,i=function(){a&&(clearTimeout(a),o=null,a=null)},n=function(){var l=o;i(),l&&l()},d=function(){if(!r)return t.apply(this,arguments);var l=this,c=arguments,h=e&&!a;if(i(),o=function(){t.apply(l,c)},a=setTimeout(function(){if(a=null,!h){var s=o;return o=null,s()}},r),h)return o()};return d.cancel=i,d.flush=n,d}import{useState as ed}from"react";function Ba({blocks:t}){let{state:r,addChild:e,moveNode:a}=$(),[o,i]=ed(null),[n,d]=ed(null),l=an(en(Rr,{activationConstraint:{distance:4}})),c=k=>{if(!k)return null;if(typeof k=="string"&&k.startsWith("drop-end-"))return{containerId:k.slice(9),index:-1};let p=or(r.tree.root,k);return p?{containerId:p.container===r.tree.root?"root":p.container.id,index:p.index}:null};return{sensors:l,activeDrag:o,overId:n,handlers:{onDragStart:k=>i(k.active),onDragOver:k=>{var p;return d(((p=k.over)==null?void 0:p.id)||null)},onDragEnd:k=>{var m,v;i(null),d(null);let{active:p,over:g}=k;if(!g)return;let x=c(g.id);if(!x)return;if(((v=(m=p.data)==null?void 0:m.current)==null?void 0:v.source)==="library"){let f=p.data.current.type,M=t[f];if(!M)return;let L=Sr(f,M);e(x.containerId,L,x.index);return}p.id!==g.id&&a(p.id,x.containerId,x.index)}}}}import{useEffect as v1,useState as L1}from"react";import{useState as jc}from"react";var D=(t,r)=>r?`${t} ${t}--${r}`:t;var ad=".kzeditor-embed-root *,.kzeditor-embed-root :after,.kzeditor-embed-root :before{border-style:solid;border-width:0}.kzeditor-embed-root .pointer-events-none{pointer-events:none}.kzeditor-embed-root .visible{visibility:visible}.kzeditor-embed-root .invisible{visibility:hidden}.kzeditor-embed-root .collapse{visibility:collapse}.kzeditor-embed-root .static{position:static}.kzeditor-embed-root .fixed{position:fixed}.kzeditor-embed-root .absolute{position:absolute}.kzeditor-embed-root .relative{position:relative}.kzeditor-embed-root .sticky{position:sticky}.kzeditor-embed-root .-top-0{top:0}.kzeditor-embed-root .-top-0\\.5{top:-.125rem}.kzeditor-embed-root .-top-3{top:-.75rem}.kzeditor-embed-root .-top-3\\.5{top:-.875rem}.kzeditor-embed-root .left-0{left:0}.kzeditor-embed-root .right-0{right:0}.kzeditor-embed-root .right-\\[3px\\]{right:3px}.kzeditor-embed-root .top-8{top:2rem}.kzeditor-embed-root .top-\\[-22px\\]{top:-22px}.kzeditor-embed-root .top-\\[3px\\]{top:3px}.kzeditor-embed-root .top-\\[5px\\]{top:5px}.kzeditor-embed-root .z-\\[2\\]{z-index:2}.kzeditor-embed-root .z-\\[3\\]{z-index:3}.kzeditor-embed-root .m-0{margin:0}.kzeditor-embed-root .mx-0{margin-left:0;margin-right:0}.kzeditor-embed-root .mx-0\\.5{margin-left:.125rem;margin-right:.125rem}.kzeditor-embed-root .my-0{margin-bottom:0;margin-top:0}.kzeditor-embed-root .my-0\\.5{margin-bottom:.125rem;margin-top:.125rem}.kzeditor-embed-root .mb-0{margin-bottom:0}.kzeditor-embed-root .mb-1{margin-bottom:.25rem}.kzeditor-embed-root .mb-1\\.5{margin-bottom:.375rem}.kzeditor-embed-root .mb-10{margin-bottom:2.5rem}.kzeditor-embed-root .mb-2{margin-bottom:.5rem}.kzeditor-embed-root .mb-4{margin-bottom:1rem}.kzeditor-embed-root .mb-5{margin-bottom:1.25rem}.kzeditor-embed-root .mb-6{margin-bottom:1.5rem}.kzeditor-embed-root .mb-\\[18px\\]{margin-bottom:18px}.kzeditor-embed-root .ml-1{margin-left:.25rem}.kzeditor-embed-root .ml-auto{margin-left:auto}.kzeditor-embed-root .mr-2{margin-right:.5rem}.kzeditor-embed-root .mt-2{margin-top:.5rem}.kzeditor-embed-root .mt-3{margin-top:.75rem}.kzeditor-embed-root .box-border{box-sizing:border-box}.kzeditor-embed-root .block{display:block}.kzeditor-embed-root .inline-block{display:inline-block}.kzeditor-embed-root .inline{display:inline}.kzeditor-embed-root .flex{display:flex}.kzeditor-embed-root .inline-flex{display:inline-flex}.kzeditor-embed-root .table{display:table}.kzeditor-embed-root .grid{display:grid}.kzeditor-embed-root .contents{display:contents}.kzeditor-embed-root .hidden{display:none}.kzeditor-embed-root .h-0{height:0}.kzeditor-embed-root .h-3{height:.75rem}.kzeditor-embed-root .h-4{height:1rem}.kzeditor-embed-root .h-5{height:1.25rem}.kzeditor-embed-root .h-6{height:1.5rem}.kzeditor-embed-root .h-9{height:2.25rem}.kzeditor-embed-root .h-\\[22px\\]{height:22px}.kzeditor-embed-root .h-\\[30px\\]{height:30px}.kzeditor-embed-root .h-\\[34px\\]{height:34px}.kzeditor-embed-root .h-\\[3px\\]{height:3px}.kzeditor-embed-root .max-h-\\[160px\\]{max-height:160px}.kzeditor-embed-root .max-h-\\[200px\\]{max-height:200px}.kzeditor-embed-root .w-10{width:2.5rem}.kzeditor-embed-root .w-3{width:.75rem}.kzeditor-embed-root .w-4{width:1rem}.kzeditor-embed-root .w-5{width:1.25rem}.kzeditor-embed-root .w-6{width:1.5rem}.kzeditor-embed-root .w-7{width:1.75rem}.kzeditor-embed-root .w-\\[22px\\]{width:22px}.kzeditor-embed-root .w-\\[34px\\]{width:34px}.kzeditor-embed-root .w-\\[90px\\]{width:90px}.kzeditor-embed-root .w-full{width:100%}.kzeditor-embed-root .min-w-0{min-width:0}.kzeditor-embed-root .flex-1{flex:1 1 0%}.kzeditor-embed-root .flex-shrink{flex-shrink:1}.kzeditor-embed-root .shrink-0{flex-shrink:0}.kzeditor-embed-root .grow{flex-grow:1}.kzeditor-embed-root .transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.kzeditor-embed-root .animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(1turn)}}.kzeditor-embed-root .animate-spin{animation:spin 1s linear infinite}.kzeditor-embed-root .cursor-pointer{cursor:pointer}.kzeditor-embed-root .select-none{user-select:none}.kzeditor-embed-root .resize{resize:both}.kzeditor-embed-root .grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.kzeditor-embed-root .grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.kzeditor-embed-root .flex-row{flex-direction:row}.kzeditor-embed-root .flex-col{flex-direction:column}.kzeditor-embed-root .flex-wrap{flex-wrap:wrap}.kzeditor-embed-root .items-start{align-items:flex-start}.kzeditor-embed-root .items-center{align-items:center}.kzeditor-embed-root .justify-end{justify-content:flex-end}.kzeditor-embed-root .justify-center{justify-content:center}.kzeditor-embed-root .justify-between{justify-content:space-between}.kzeditor-embed-root .gap-1{gap:.25rem}.kzeditor-embed-root .gap-1\\.5{gap:.375rem}.kzeditor-embed-root .gap-2{gap:.5rem}.kzeditor-embed-root .gap-3{gap:.75rem}.kzeditor-embed-root .gap-3\\.5{gap:.875rem}.kzeditor-embed-root .gap-4{gap:1rem}.kzeditor-embed-root .overflow-hidden{overflow:hidden}.kzeditor-embed-root .overflow-x-auto{overflow-x:auto}.kzeditor-embed-root .overflow-y-auto{overflow-y:auto}.kzeditor-embed-root .text-ellipsis{text-overflow:ellipsis}.kzeditor-embed-root .whitespace-nowrap{white-space:nowrap}.kzeditor-embed-root .rounded{border-radius:.25rem}.kzeditor-embed-root .rounded-\\[2px\\]{border-radius:2px}.kzeditor-embed-root .rounded-\\[3px\\]{border-radius:3px}.kzeditor-embed-root .rounded-full{border-radius:9999px}.kzeditor-embed-root .rounded-lg{border-radius:.5rem}.kzeditor-embed-root .rounded-md{border-radius:.375rem}.kzeditor-embed-root .border{border-width:1px}.kzeditor-embed-root .border-0{border-width:0}.kzeditor-embed-root .border-2{border-width:2px}.kzeditor-embed-root .border-b{border-bottom-width:1px}.kzeditor-embed-root .border-t{border-top-width:1px}.kzeditor-embed-root .border-solid{border-style:solid}.kzeditor-embed-root .border-dashed{border-style:dashed}.kzeditor-embed-root .border-none{border-style:none}.kzeditor-embed-root .border-\\[\\#0073e6\\]{--tw-border-opacity:1;border-color:rgb(0 115 230/var(--tw-border-opacity,1))}.kzeditor-embed-root .border-\\[\\#cbd5e1\\]{--tw-border-opacity:1;border-color:rgb(203 213 225/var(--tw-border-opacity,1))}.kzeditor-embed-root .border-\\[\\#e2e8f0\\]{--tw-border-opacity:1;border-color:rgb(226 232 240/var(--tw-border-opacity,1))}.kzeditor-embed-root .border-\\[\\#f1f5f9\\]{--tw-border-opacity:1;border-color:rgb(241 245 249/var(--tw-border-opacity,1))}.kzeditor-embed-root .border-transparent{border-color:transparent}.kzeditor-embed-root .border-t-transparent{border-top-color:transparent}.kzeditor-embed-root .bg-\\[\\#0073e6\\]{--tw-bg-opacity:1;background-color:rgb(0 115 230/var(--tw-bg-opacity,1))}.kzeditor-embed-root .bg-\\[\\#ef4444\\]{--tw-bg-opacity:1;background-color:rgb(239 68 68/var(--tw-bg-opacity,1))}.kzeditor-embed-root .bg-\\[\\#f1f5f9\\]{--tw-bg-opacity:1;background-color:rgb(241 245 249/var(--tw-bg-opacity,1))}.kzeditor-embed-root .bg-\\[\\#f8fafc\\]{--tw-bg-opacity:1;background-color:rgb(248 250 252/var(--tw-bg-opacity,1))}.kzeditor-embed-root .bg-black{--tw-bg-opacity:1;background-color:rgb(0 0 0/var(--tw-bg-opacity,1))}.kzeditor-embed-root .bg-gray-200{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity,1))}.kzeditor-embed-root .bg-transparent{background-color:transparent}.kzeditor-embed-root .bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.kzeditor-embed-root .object-contain{object-fit:contain}.kzeditor-embed-root .p-0{padding:0}.kzeditor-embed-root .p-1{padding:.25rem}.kzeditor-embed-root .p-2{padding:.5rem}.kzeditor-embed-root .p-4{padding:1rem}.kzeditor-embed-root .p-6{padding:1.5rem}.kzeditor-embed-root .px-1{padding-left:.25rem;padding-right:.25rem}.kzeditor-embed-root .px-1\\.5{padding-left:.375rem;padding-right:.375rem}.kzeditor-embed-root .px-2{padding-left:.5rem;padding-right:.5rem}.kzeditor-embed-root .px-2\\.5{padding-left:.625rem;padding-right:.625rem}.kzeditor-embed-root .px-3{padding-left:.75rem;padding-right:.75rem}.kzeditor-embed-root .px-4{padding-left:1rem;padding-right:1rem}.kzeditor-embed-root .px-5{padding-left:1.25rem;padding-right:1.25rem}.kzeditor-embed-root .py-0{padding-bottom:0;padding-top:0}.kzeditor-embed-root .py-0\\.5{padding-bottom:.125rem;padding-top:.125rem}.kzeditor-embed-root .py-1{padding-bottom:.25rem;padding-top:.25rem}.kzeditor-embed-root .py-1\\.5{padding-bottom:.375rem;padding-top:.375rem}.kzeditor-embed-root .py-16{padding-bottom:4rem;padding-top:4rem}.kzeditor-embed-root .py-2{padding-bottom:.5rem;padding-top:.5rem}.kzeditor-embed-root .py-2\\.5{padding-bottom:.625rem;padding-top:.625rem}.kzeditor-embed-root .py-3{padding-bottom:.75rem;padding-top:.75rem}.kzeditor-embed-root .py-\\[22px\\]{padding-bottom:22px;padding-top:22px}.kzeditor-embed-root .pb-3{padding-bottom:.75rem}.kzeditor-embed-root .pb-4{padding-bottom:1rem}.kzeditor-embed-root .pb-5{padding-bottom:1.25rem}.kzeditor-embed-root .pl-2{padding-left:.5rem}.kzeditor-embed-root .pl-3{padding-left:.75rem}.kzeditor-embed-root .pr-2{padding-right:.5rem}.kzeditor-embed-root .pt-1{padding-top:.25rem}.kzeditor-embed-root .pt-2{padding-top:.5rem}.kzeditor-embed-root .pt-3{padding-top:.75rem}.kzeditor-embed-root .text-left{text-align:left}.kzeditor-embed-root .text-center{text-align:center}.kzeditor-embed-root .text-\\[10px\\]{font-size:10px}.kzeditor-embed-root .text-\\[11px\\]{font-size:11px}.kzeditor-embed-root .text-\\[13px\\]{font-size:13px}.kzeditor-embed-root .text-base{font-size:1rem;line-height:1.5rem}.kzeditor-embed-root .text-lg{font-size:1.125rem;line-height:1.75rem}.kzeditor-embed-root .text-sm{font-size:.875rem;line-height:1.25rem}.kzeditor-embed-root .text-xs{font-size:.75rem;line-height:1rem}.kzeditor-embed-root .font-bold{font-weight:700}.kzeditor-embed-root .font-medium{font-weight:500}.kzeditor-embed-root .font-normal{font-weight:400}.kzeditor-embed-root .font-semibold{font-weight:600}.kzeditor-embed-root .uppercase{text-transform:uppercase}.kzeditor-embed-root .lowercase{text-transform:lowercase}.kzeditor-embed-root .capitalize{text-transform:capitalize}.kzeditor-embed-root .italic{font-style:italic}.kzeditor-embed-root .leading-5{line-height:1.25rem}.kzeditor-embed-root .leading-\\[1\\.2\\]{line-height:1.2}.kzeditor-embed-root .leading-\\[1\\.5\\]{line-height:1.5}.kzeditor-embed-root .tracking-\\[\\.04em\\]{letter-spacing:.04em}.kzeditor-embed-root .tracking-\\[\\.05em\\],.kzeditor-embed-root .tracking-wider{letter-spacing:.05em}.kzeditor-embed-root .text-\\[\\#0073e6\\]{--tw-text-opacity:1;color:rgb(0 115 230/var(--tw-text-opacity,1))}.kzeditor-embed-root .text-\\[\\#475569\\]{--tw-text-opacity:1;color:rgb(71 85 105/var(--tw-text-opacity,1))}.kzeditor-embed-root .text-\\[\\#64748b\\]{--tw-text-opacity:1;color:rgb(100 116 139/var(--tw-text-opacity,1))}.kzeditor-embed-root .text-\\[\\#94a3b8\\]{--tw-text-opacity:1;color:rgb(148 163 184/var(--tw-text-opacity,1))}.kzeditor-embed-root .text-\\[\\#b91c1c\\]{--tw-text-opacity:1;color:rgb(185 28 28/var(--tw-text-opacity,1))}.kzeditor-embed-root .text-\\[\\#ef4444\\]{--tw-text-opacity:1;color:rgb(239 68 68/var(--tw-text-opacity,1))}.kzeditor-embed-root .text-\\[var\\(--kzeditor-text-muted\\2c \\#94a3b8\\)\\]{color:var(--kzeditor-text-muted,#94a3b8)}.kzeditor-embed-root .text-inherit{color:inherit}.kzeditor-embed-root .text-red-500{--tw-text-opacity:1;color:rgb(239 68 68/var(--tw-text-opacity,1))}.kzeditor-embed-root .text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.kzeditor-embed-root .underline{text-decoration-line:underline}.kzeditor-embed-root .overline{text-decoration-line:overline}.kzeditor-embed-root .line-through{text-decoration-line:line-through}.kzeditor-embed-root .opacity-50{opacity:.5}.kzeditor-embed-root .opacity-60{opacity:.6}.kzeditor-embed-root .opacity-\\[\\.55\\]{opacity:.55}.kzeditor-embed-root .shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.kzeditor-embed-root .outline{outline-style:solid}.kzeditor-embed-root .outline-offset-\\[-1px\\]{outline-offset:-1px}.kzeditor-embed-root .ring{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.kzeditor-embed-root .blur{--tw-blur:blur(8px)}.kzeditor-embed-root .blur,.kzeditor-embed-root .filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.kzeditor-embed-root .transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.kzeditor-embed-root .transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.kzeditor-embed-root .transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.kzeditor-embed-root .duration-150{transition-duration:.15s}";var od="kzeditor-embed-styles",Wc=`
10
+ .kzeditor-embed-root{display:flex;flex-direction:column;height:640px;border:1px solid var(--kzeditor-shell-border,#e2e8f0);border-radius:8px;overflow:hidden;background:var(--kzeditor-shell-bg,#fff)}
11
+ .kzeditor-embed-root--richtext{height:320px}
12
+ .kzeditor-shell-header{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 12px;background:var(--kzeditor-header-bg,#fff);border-bottom:1px solid var(--kzeditor-border,#e2e8f0);flex-shrink:0}
13
+ .kzeditor-shell-body{display:flex;flex:1;overflow:hidden}
14
+
15
+ .kzeditor-undo-redo{display:inline-flex;gap:4px}
16
+ .kzeditor-undo-redo button{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:4px;border:1px solid var(--kzeditor-border-strong,#cbd5e1);background:var(--kzeditor-surface-alt-bg,#fff);color:var(--kzeditor-text-secondary,#334155);cursor:pointer;padding:0}
17
+ .kzeditor-undo-redo button:disabled{color:var(--kzeditor-border-strong,#cbd5e1);cursor:not-allowed}
18
+
19
+ .kzeditor-templates-btn{display:inline-flex;align-items:center;gap:6px;padding:6px 12px;background:var(--kzeditor-surface-alt-bg,#fff);color:var(--kzeditor-text-secondary,#334155);border:1px solid var(--kzeditor-border-strong,#cbd5e1);border-radius:4px;font-size:12px;font-weight:600;cursor:pointer}
20
+ .kzeditor-preview-btn{display:inline-flex;align-items:center;gap:6px;padding:6px 12px;background:var(--kzeditor-primary,#0073e6);color:#fff;border:1px solid var(--kzeditor-primary,#0073e6);border-radius:4px;font-size:12px;font-weight:600;cursor:pointer}
21
+
22
+ .kzeditor-drag-chip{padding:8px 12px;background:var(--kzeditor-surface-bg,#fff);border:1px solid #60a5fa;border-radius:6px;box-shadow:0 6px 16px rgba(0,0,0,.12);font-size:13px;color:var(--kzeditor-text,#0f172a)}
23
+
24
+ .kzeditor-left-panel,.kzeditor-navigator-panel{flex-shrink:0;height:100%;box-sizing:border-box;border-right:1px solid var(--kzeditor-border,#e2e8f0);background:var(--kzeditor-surface-bg,#fff);display:flex;flex-direction:column}
25
+ .kzeditor-left-panel{width:300px}
26
+ .kzeditor-navigator-panel{width:250px}
27
+ .kzeditor-panel-header{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 14px;border-bottom:1px solid var(--kzeditor-border,#e2e8f0);background:var(--kzeditor-surface-alt-bg,#f8fafc);flex-shrink:0;min-height:44px}
28
+ .kzeditor-panel-title{font-size:12px;font-weight:700;letter-spacing:.04em;color:var(--kzeditor-text,#0f172a);text-transform:uppercase}
29
+ .kzeditor-back-btn{display:inline-flex;align-items:center;gap:6px;background:transparent;border:none;cursor:pointer;color:var(--kzeditor-text,#0f172a);padding:0;overflow:hidden}
30
+ .kzeditor-icon-btn{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:4px;border:1px solid var(--kzeditor-border,#e2e8f0);background:var(--kzeditor-surface-bg,#fff);color:var(--kzeditor-text-secondary,#475569);cursor:pointer;flex-shrink:0;padding:0}
31
+ .kzeditor-icon-btn.is-active{background:var(--kzeditor-primary,#0073e6);border-color:var(--kzeditor-primary,#0073e6);color:#fff}
32
+ .kzeditor-panel-scroll{flex:1;overflow-y:auto}
33
+ .kzeditor-inspector-tabs{display:flex;border-bottom:1px solid var(--kzeditor-border,#e2e8f0);background:var(--kzeditor-surface-bg,#fff);position:sticky;top:0;z-index:1}
34
+ .kzeditor-inspector-tab{flex:1;padding:10px 8px;background:transparent;border:none;border-bottom:2px solid transparent;cursor:pointer;font-size:12px;font-weight:600;color:var(--kzeditor-text-secondary,#64748b)}
35
+ .kzeditor-inspector-tab.is-active{color:var(--kzeditor-primary,#0073e6);border-bottom-color:var(--kzeditor-primary,#0073e6)}
36
36
 
37
37
  /* Shared field chrome for Inspector controls (text/number/url/select/textarea). */
38
- .emb-field-input{width:100%;box-sizing:border-box;padding:6px 8px;border:1px solid var(--emb-border-strong,#cbd5e1);border-radius:4px;font-size:13px;font-family:inherit;background:var(--emb-surface-bg,#fff);color:var(--emb-text,#0f172a)}
39
- .emb-field-input::placeholder{color:var(--emb-text-muted,#94a3b8)}
38
+ .kzeditor-field-input{width:100%;box-sizing:border-box;padding:6px 8px;border:1px solid var(--kzeditor-border-strong,#cbd5e1);border-radius:4px;font-size:13px;font-family:inherit;background:var(--kzeditor-surface-bg,#fff);color:var(--kzeditor-text,#0f172a)}
39
+ .kzeditor-field-input::placeholder{color:var(--kzeditor-text-muted,#94a3b8)}
40
40
 
41
41
  /* Segmented icon-button groups (alignment, typography style toggles). */
42
- .emb-toggle-group{display:flex;border:1px solid var(--emb-border-strong,#cbd5e1);border-radius:4px;overflow:hidden}
43
- .emb-toggle-btn{flex:1;padding:7px 0;border:0;border-left:1px solid var(--emb-border-strong,#cbd5e1);cursor:pointer;display:inline-flex;align-items:center;justify-content:center;background:var(--emb-surface-bg,#fff);color:var(--emb-text-secondary,#475569)}
44
- .emb-toggle-btn:first-child{border-left:0}
45
- .emb-toggle-btn.is-active{background:var(--emb-primary,#0073e6);color:#fff}
42
+ .kzeditor-toggle-group{display:flex;border:1px solid var(--kzeditor-border-strong,#cbd5e1);border-radius:6px;overflow:hidden}
43
+ .kzeditor-toggle-btn{flex:1;padding:11px 0;border:0;border-left:1px solid var(--kzeditor-border-strong,#cbd5e1);cursor:pointer;display:inline-flex;align-items:center;justify-content:center;background:var(--kzeditor-surface-bg,#fff);color:var(--kzeditor-text-secondary,#475569);transition:background 120ms,color 120ms}
44
+ .kzeditor-toggle-btn:first-child{border-left:0}
45
+ .kzeditor-toggle-btn:hover:not(.is-active){background:var(--kzeditor-surface-alt-bg,#f1f5f9)}
46
+ .kzeditor-toggle-btn.is-active{background:var(--kzeditor-primary,#0073e6);color:#fff}
46
47
 
47
48
  /* Standalone style-toggle buttons (bold/italic/decoration/transform) \u2014 same
48
- active/inactive palette as .emb-toggle-btn but each keeps its own full
49
+ active/inactive palette as .kzeditor-toggle-btn but each keeps its own full
49
50
  border + radius since they're not joined into one segmented strip. */
50
- .emb-style-btn{border:1px solid var(--emb-border-strong,#cbd5e1);border-radius:4px;background:var(--emb-surface-bg,#fff);color:var(--emb-text-secondary,#475569);cursor:pointer;display:inline-flex;align-items:center;justify-content:center}
51
- .emb-style-btn.is-active{background:var(--emb-primary,#0073e6);border-color:var(--emb-primary,#0073e6);color:#fff}
51
+ .kzeditor-style-btn{border:1px solid var(--kzeditor-border-strong,#cbd5e1);border-radius:4px;background:var(--kzeditor-surface-bg,#fff);color:var(--kzeditor-text-secondary,#475569);cursor:pointer;display:inline-flex;align-items:center;justify-content:center}
52
+ .kzeditor-style-btn.is-active{background:var(--kzeditor-primary,#0073e6);border-color:var(--kzeditor-primary,#0073e6);color:#fff}
52
53
 
53
54
  /* Inline merge-tag insert trigger + dropdown \u2014 shared by Inspector fields
54
55
  (controls.js) and the floating RichTextToolbar. */
55
- .emb-merge-tag-trigger{width:24px;height:24px;flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;background:var(--emb-surface-alt-bg,#f8fafc);border:1px solid var(--emb-border,#e2e8f0);border-radius:4px;color:var(--emb-text-secondary,#64748b);cursor:pointer}
56
- .emb-merge-tag-menu{background:var(--emb-surface-bg,#fff);color:var(--emb-text,#0f172a);border:1px solid var(--emb-border,#e2e8f0);border-radius:6px;box-shadow:0 8px 24px rgba(0,0,0,.2);min-width:200px;max-height:260px;overflow-y:auto;padding:4px}
57
- .emb-merge-tag-item{display:flex;align-items:center;width:100%;text-align:left;background:transparent;border:none;border-radius:4px;font-size:12px;color:var(--emb-text,#0f172a);cursor:pointer;padding:6px 8px}
58
- .emb-merge-tag-item:hover{background:var(--emb-surface-alt-bg,#f1f5f9)}
59
- .emb-merge-tag-empty{padding:8px;font-size:11px;color:var(--emb-text-muted,#94a3b8)}
60
- .emb-merge-tag-search{flex:1;min-width:0;border:1px solid var(--emb-border-strong,#cbd5e1);border-radius:4px;outline:none;color:var(--emb-text,#0f172a);background:var(--emb-surface-bg,#fff);font-size:12px;padding:5px 7px}
61
- .emb-merge-tag-insert{flex-shrink:0;border:1px solid var(--emb-primary,#0073e6);background:var(--emb-primary,#0073e6);color:#fff;border-radius:4px;font-size:12px;font-weight:600;cursor:pointer;padding:0 10px}
56
+ .kzeditor-merge-tag-trigger{width:24px;height:24px;flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;background:var(--kzeditor-surface-alt-bg,#f8fafc);border:1px solid var(--kzeditor-border,#e2e8f0);border-radius:4px;color:var(--kzeditor-text-secondary,#64748b);cursor:pointer}
57
+ .kzeditor-merge-tag-menu{background:var(--kzeditor-surface-bg,#fff);color:var(--kzeditor-text,#0f172a);border:1px solid var(--kzeditor-border,#e2e8f0);border-radius:6px;box-shadow:0 8px 24px rgba(0,0,0,.2);min-width:200px;max-height:260px;overflow-y:auto;padding:4px}
58
+ .kzeditor-merge-tag-item{display:flex;align-items:center;width:100%;text-align:left;background:transparent;border:none;border-radius:4px;font-size:12px;color:var(--kzeditor-text,#0f172a);cursor:pointer;padding:6px 8px}
59
+ .kzeditor-merge-tag-item:hover{background:var(--kzeditor-surface-alt-bg,#f1f5f9)}
60
+ .kzeditor-merge-tag-empty{padding:8px;font-size:11px;color:var(--kzeditor-text-muted,#94a3b8)}
61
+ .kzeditor-merge-tag-search{flex:1;min-width:0;border:1px solid var(--kzeditor-border-strong,#cbd5e1);border-radius:4px;outline:none;color:var(--kzeditor-text,#0f172a);background:var(--kzeditor-surface-bg,#fff);font-size:12px;padding:5px 7px}
62
+ .kzeditor-merge-tag-insert{flex-shrink:0;border:1px solid var(--kzeditor-primary,#0073e6);background:var(--kzeditor-primary,#0073e6);color:#fff;border-radius:4px;font-size:12px;font-weight:600;cursor:pointer;padding:0 10px}
62
63
 
63
64
  /* Floating Medium-style selection toolbar \u2014 intentionally dark always,
64
65
  regardless of host theme (a tooltip-like overlay, not app chrome). */
65
- .emb-rt-toolbar{position:fixed;background:#0f172a;color:#fff;border-radius:6px;display:flex;align-items:center;gap:2px;padding:4px;box-shadow:0 6px 18px rgba(0,0,0,.25);z-index:1000;-webkit-user-select:none;user-select:none}
66
- .emb-rt-toolbar-btn{background:transparent;border:none;color:#fff;width:26px;height:26px;display:inline-flex;align-items:center;justify-content:center;border-radius:3px;cursor:pointer}
67
- .emb-rt-toolbar-btn:hover{background:#1e293b}
68
- .emb-rt-sep{width:1px;height:16px;background:#475569;margin:0 2px}
66
+ .kzeditor-rt-toolbar{position:fixed;background:#0f172a;color:#fff;border-radius:6px;display:flex;align-items:center;gap:2px;padding:4px;box-shadow:0 6px 18px rgba(0,0,0,.25);z-index:1000;-webkit-user-select:none;user-select:none}
67
+ .kzeditor-rt-toolbar-btn{background:transparent;border:none;color:#fff;width:26px;height:26px;display:inline-flex;align-items:center;justify-content:center;border-radius:3px;cursor:pointer}
68
+ .kzeditor-rt-toolbar-btn:hover{background:#1e293b}
69
+ .kzeditor-rt-sep{width:1px;height:16px;background:#475569;margin:0 2px}
69
70
 
70
71
  /* Inspector footer actions (Convert to blocks / Delete block). */
71
- .emb-inspector-btn-primary{width:100%;padding:8px 12px;background:var(--emb-primary,#0073e6);color:#fff;border:1px solid var(--emb-primary,#0073e6);border-radius:4px;font-size:12px;font-weight:600;cursor:pointer}
72
- .emb-inspector-btn-danger{width:100%;padding:8px 12px;background:var(--emb-surface-bg,#fff);color:#dc2626;border:1px solid var(--emb-border,#e2e8f0);border-radius:4px;font-size:12px;font-weight:600;cursor:pointer}
73
-
74
- .emb-block-library{padding:16px}
75
- .emb-search{display:flex;align-items:center;gap:6px;height:32px;padding:0 9px;margin-bottom:16px;border:1px solid var(--emb-border,#e2e8f0);border-radius:6px;background:var(--emb-surface-alt-bg,#f8fafc);box-sizing:border-box;transition:border-color 120ms,box-shadow 120ms}
76
- .emb-search:focus-within{border-color:var(--emb-primary,#0073e6);box-shadow:0 0 0 1px var(--emb-primary,#0073e6);background:var(--emb-surface-bg,#fff)}
77
- .emb-search>svg{color:var(--emb-text-muted,#94a3b8);flex-shrink:0}
78
- .emb-search input.emb-search-input{flex:1;min-width:0;height:100%;padding:0;margin:0;border:none;outline:none;box-shadow:none;background:transparent;font-size:12px;line-height:normal;color:var(--emb-text,#0f172a)}
79
- .emb-search input.emb-search-input::placeholder{color:var(--emb-text-muted,#94a3b8)}
80
- .emb-category-label{font-size:11px;font-weight:700;letter-spacing:.05em;color:var(--emb-text-muted,#64748b);text-transform:uppercase;margin-bottom:8px}
81
- .emb-lib-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}
82
- .emb-lib-empty{padding:20px 10px;text-align:center;font-size:12px;color:var(--emb-text-muted,#94a3b8)}
83
- .emb-v2-lib-item{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;padding:14px 6px;background:var(--emb-surface-alt-bg,#fff);border:1px solid var(--emb-border,#e2e8f0);border-radius:6px;cursor:grab;text-align:center;color:var(--emb-text-secondary,#475569);font-size:11px;font-weight:500;min-height:70px}
84
- .emb-v2-lib-item:hover{border-color:var(--emb-primary,#0073e6);color:var(--emb-primary,#0073e6)}
85
- .emb-v2-lib-item.is-dragging{opacity:.4}
86
-
87
- .emb-quick-add{position:relative;margin-top:10px}
88
- .emb-quick-add.is-compact{display:flex;justify-content:flex-end;margin-top:4px}
89
- .emb-quick-add.is-centered{margin:0;justify-content:center}
90
- .emb-quick-add.is-append{margin:2px 0 0;justify-content:center}
91
- .emb-plus-btn{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border-radius:50%;border:1px solid var(--emb-primary,#0073e6);background:var(--emb-surface-bg,#fff);color:var(--emb-primary,#0073e6);cursor:pointer;transition:all 120ms;padding:0}
92
- .emb-plus-btn:hover{background:var(--emb-primary,#0073e6);color:#fff}
93
- .emb-split-btn{display:flex;border:1px dashed var(--emb-border-strong,#cbd5e1);border-radius:6px;overflow:hidden;background:var(--emb-surface-bg,#fff)}
94
- .emb-split-main{flex:1;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:10px 12px;background:transparent;border:none;cursor:pointer;color:var(--emb-text-secondary,#475569);font-size:13px;font-weight:500}
95
- .emb-split-main:hover{background:var(--emb-surface-alt-bg,#f8fafc)}
96
- .emb-split-caret{display:inline-flex;align-items:center;justify-content:center;width:36px;background:transparent;border:none;border-left:1px dashed var(--emb-border-strong,#cbd5e1);cursor:pointer;color:var(--emb-text-secondary,#475569)}
97
- .emb-split-caret:hover{background:var(--emb-surface-alt-bg,#f8fafc)}
98
- .emb-quick-add-menu{position:absolute;top:100%;left:0;min-width:240px;margin-top:6px;max-height:320px;display:flex;flex-direction:column;background:var(--emb-surface-bg,#fff);border:1px solid var(--emb-border,#e2e8f0);border-radius:8px;box-shadow:0 10px 30px rgba(0,0,0,.12);padding:6px;z-index:50}
99
- .emb-quick-add-menu.is-compact{left:auto;right:0;transform:none}
100
- .emb-quick-add-menu .emb-search{padding:0 8px;margin:0 0 6px;flex-shrink:0}
101
- .emb-quick-add-menu .emb-search input.emb-search-input{font-size:13px}
102
- .emb-quick-add-menu .emb-lib-empty{padding:14px 10px}
103
- .emb-menu-list{overflow-y:auto;display:flex;flex-direction:column;gap:2px}
104
- .emb-menu-item{display:flex;align-items:center;gap:8px;padding:8px 10px;background:transparent;border:none;border-radius:6px;cursor:pointer;font-size:13px;color:var(--emb-text,#0f172a);text-align:left;width:100%}
105
- .emb-menu-item:hover{background:var(--emb-surface-alt-bg,#f1f5f9)}
106
- .emb-menu-icon{width:24px;height:24px;border-radius:4px;background:var(--emb-surface-alt-bg,#f1f5f9);display:inline-flex;align-items:center;justify-content:center;color:var(--emb-text-secondary,#475569);flex-shrink:0;font-weight:700}
107
-
108
- .emb-preview-backdrop{position:fixed;inset:0;background:rgba(15,23,42,.65);backdrop-filter:blur(2px);z-index:100000;display:flex;align-items:center;justify-content:center;padding:24px}
109
- .emb-preview-dialog{background:var(--emb-surface-bg,#fff);color:var(--emb-text,#0f172a);border-radius:8px;box-shadow:0 20px 60px rgba(0,0,0,.35);width:100%;max-width:980px;max-height:92vh;display:flex;flex-direction:column;overflow:hidden}
110
- .emb-preview-header{display:flex;align-items:center;gap:12px;padding:12px 16px;border-bottom:1px solid var(--emb-border,#e2e8f0)}
111
- .emb-preview-title{font-weight:600;font-size:14px;color:var(--emb-text,#0f172a);flex:1}
112
- .emb-device-tab{display:inline-flex;align-items:center;gap:6px;padding:6px 10px;border-radius:4px;font-size:12px;font-weight:500;cursor:pointer;border:1px solid var(--emb-border-strong,#cbd5e1);background:var(--emb-surface-bg,#fff);color:var(--emb-text-secondary,#475569)}
113
- .emb-device-tab.is-active{background:var(--emb-primary,#0073e6);color:#fff;border-color:var(--emb-primary,#0073e6)}
114
- .emb-preview-icon-btn{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;background:var(--emb-surface-bg,#fff);border:1px solid var(--emb-border,#e2e8f0);border-radius:4px;cursor:pointer;color:var(--emb-text-secondary,#475569)}
115
- .emb-preview-body{flex:1;background:var(--emb-surface-alt-bg,#f1f5f9);overflow-y:auto;display:flex;justify-content:center;padding:24px}
116
- .emb-preview-loading{font-size:13px;padding:40px;background:var(--emb-surface-bg,#fff);border-radius:4px;border:1px solid var(--emb-border,#e2e8f0);align-self:flex-start;color:var(--emb-text-secondary,#64748b)}
117
- .emb-preview-loading.is-error{color:#b91c1c}
118
- .emb-preview-frame{max-width:100%;height:100%;min-height:560px;border:1px solid var(--emb-border,#e2e8f0);background:var(--emb-content-bg,#fff);border-radius:4px;transition:width 220ms ease}
119
-
120
- .emb-canvas{flex:1;padding:32px;overflow-y:auto;position:relative;transition:background 120ms;background:var(--emb-canvas-backdrop,#f1f5f9)}
121
- .emb-canvas--form{background:#eef2f6}
122
-
123
- .emb-empty-drop{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:20px;text-align:center;color:var(--emb-text-muted,#94a3b8);border:2px dashed var(--emb-border-strong,#cbd5e1);border-radius:6px;font-size:13px;background:transparent;transition:all 120ms}
124
- .emb-empty-drop.is-compact{gap:4px;padding:10px 8px;font-size:11px;border-width:1px}
125
- .emb-empty-drop.is-over{border-color:var(--emb-primary,#0073e6);background:#eff6ff}
126
-
127
- .emb-canvas-page{margin:0 auto;width:100%;box-sizing:border-box;border-radius:2px;box-shadow:0 1px 3px rgba(0,0,0,.06),0 1px 2px rgba(0,0,0,.04);max-width:var(--emb-content-width,600px);background:var(--emb-content-bg,#fff);font-family:var(--emb-content-font,Arial,sans-serif);padding:var(--emb-content-padding,40px 20px);--emb-surface-bg:#fff;--emb-surface-alt-bg:#f8fafc;--emb-border:#e2e8f0;--emb-border-strong:#cbd5e1;--emb-text:#0f172a;--emb-text-secondary:#475569;--emb-text-muted:#94a3b8}
128
- .emb-canvas-page--form{max-width:var(--emb-content-width,560px);font-family:var(--emb-content-font,system-ui,-apple-system,"Segoe UI",Roboto,sans-serif);padding:var(--emb-content-padding,24px);border-radius:8px;box-shadow:0 1px 3px rgba(0,0,0,.08),0 1px 2px rgba(0,0,0,.04)}
72
+ .kzeditor-inspector-btn-primary{width:100%;padding:8px 12px;background:var(--kzeditor-primary,#0073e6);color:#fff;border:1px solid var(--kzeditor-primary,#0073e6);border-radius:4px;font-size:12px;font-weight:600;cursor:pointer}
73
+ .kzeditor-inspector-btn-danger{width:100%;padding:8px 12px;background:var(--kzeditor-surface-bg,#fff);color:#dc2626;border:1px solid var(--kzeditor-border,#e2e8f0);border-radius:4px;font-size:12px;font-weight:600;cursor:pointer}
74
+
75
+ .kzeditor-block-library{padding:16px}
76
+ .kzeditor-search{display:flex;align-items:center;gap:6px;height:32px;padding:0 9px;margin-bottom:16px;border:1px solid var(--kzeditor-border,#e2e8f0);border-radius:6px;background:var(--kzeditor-surface-alt-bg,#f8fafc);box-sizing:border-box;transition:border-color 120ms,box-shadow 120ms}
77
+ .kzeditor-search:focus-within{border-color:var(--kzeditor-primary,#0073e6);box-shadow:0 0 0 1px var(--kzeditor-primary,#0073e6);background:var(--kzeditor-surface-bg,#fff)}
78
+ .kzeditor-search>svg{color:var(--kzeditor-text-muted,#94a3b8);flex-shrink:0}
79
+ .kzeditor-search input.kzeditor-search-input{flex:1;min-width:0;height:100%;padding:0;margin:0;border:none;outline:none;box-shadow:none;background:transparent;font-size:12px;line-height:normal;color:var(--kzeditor-text,#0f172a)}
80
+ .kzeditor-search input.kzeditor-search-input::placeholder{color:var(--kzeditor-text-muted,#94a3b8)}
81
+ .kzeditor-category-label{font-size:11px;font-weight:700;letter-spacing:.05em;color:var(--kzeditor-text-muted,#64748b);text-transform:uppercase;margin-bottom:8px}
82
+ .kzeditor-lib-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}
83
+ .kzeditor-lib-empty{padding:20px 10px;text-align:center;font-size:12px;color:var(--kzeditor-text-muted,#94a3b8)}
84
+ .kzeditor-v2-lib-item{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;padding:14px 6px;background:var(--kzeditor-surface-alt-bg,#fff);border:1px solid var(--kzeditor-border,#e2e8f0);border-radius:6px;cursor:grab;text-align:center;color:var(--kzeditor-text-secondary,#475569);font-size:11px;font-weight:500;min-height:70px}
85
+ .kzeditor-v2-lib-item:hover{border-color:var(--kzeditor-primary,#0073e6);color:var(--kzeditor-primary,#0073e6)}
86
+ .kzeditor-v2-lib-item.is-dragging{opacity:.4}
87
+
88
+ .kzeditor-quick-add{position:relative;margin-top:10px}
89
+ .kzeditor-quick-add.is-compact{display:flex;justify-content:flex-end;margin-top:4px}
90
+ .kzeditor-quick-add.is-centered{margin:0;justify-content:center}
91
+ .kzeditor-quick-add.is-append{margin:2px 0 0;justify-content:center}
92
+ .kzeditor-plus-btn{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border-radius:50%;border:1px solid var(--kzeditor-primary,#0073e6);background:var(--kzeditor-surface-bg,#fff);color:var(--kzeditor-primary,#0073e6);cursor:pointer;transition:all 120ms;padding:0}
93
+ .kzeditor-plus-btn:hover{background:var(--kzeditor-primary,#0073e6);color:#fff}
94
+ .kzeditor-split-btn{display:flex;border:1px dashed var(--kzeditor-border-strong,#cbd5e1);border-radius:6px;overflow:hidden;background:var(--kzeditor-surface-bg,#fff)}
95
+ .kzeditor-split-main{flex:1;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:10px 12px;background:transparent;border:none;cursor:pointer;color:var(--kzeditor-text-secondary,#475569);font-size:13px;font-weight:500}
96
+ .kzeditor-split-main:hover{background:var(--kzeditor-surface-alt-bg,#f8fafc)}
97
+ .kzeditor-split-caret{display:inline-flex;align-items:center;justify-content:center;width:36px;background:transparent;border:none;border-left:1px dashed var(--kzeditor-border-strong,#cbd5e1);cursor:pointer;color:var(--kzeditor-text-secondary,#475569)}
98
+ .kzeditor-split-caret:hover{background:var(--kzeditor-surface-alt-bg,#f8fafc)}
99
+ .kzeditor-quick-add-menu{position:absolute;top:100%;left:0;min-width:240px;margin-top:6px;max-height:320px;display:flex;flex-direction:column;background:var(--kzeditor-surface-bg,#fff);border:1px solid var(--kzeditor-border,#e2e8f0);border-radius:8px;box-shadow:0 10px 30px rgba(0,0,0,.12);padding:6px;z-index:50}
100
+ .kzeditor-quick-add-menu.is-compact{left:auto;right:0;transform:none}
101
+ .kzeditor-quick-add-menu .kzeditor-search{padding:0 8px;margin:0 0 6px;flex-shrink:0}
102
+ .kzeditor-quick-add-menu .kzeditor-search input.kzeditor-search-input{font-size:13px}
103
+ .kzeditor-quick-add-menu .kzeditor-lib-empty{padding:14px 10px}
104
+ .kzeditor-menu-list{overflow-y:auto;display:flex;flex-direction:column;gap:2px}
105
+ .kzeditor-menu-item{display:flex;align-items:center;gap:8px;padding:8px 10px;background:transparent;border:none;border-radius:6px;cursor:pointer;font-size:13px;color:var(--kzeditor-text,#0f172a);text-align:left;width:100%}
106
+ .kzeditor-menu-item:hover{background:var(--kzeditor-surface-alt-bg,#f1f5f9)}
107
+ .kzeditor-menu-icon{width:24px;height:24px;border-radius:4px;background:var(--kzeditor-surface-alt-bg,#f1f5f9);display:inline-flex;align-items:center;justify-content:center;color:var(--kzeditor-text-secondary,#475569);flex-shrink:0;font-weight:700}
108
+
109
+ .kzeditor-preview-backdrop{position:fixed;inset:0;background:rgba(15,23,42,.65);backdrop-filter:blur(2px);z-index:100000;display:flex;align-items:center;justify-content:center;padding:24px}
110
+ .kzeditor-preview-dialog{background:var(--kzeditor-surface-bg,#fff);color:var(--kzeditor-text,#0f172a);border-radius:8px;box-shadow:0 20px 60px rgba(0,0,0,.35);width:100%;max-width:980px;max-height:92vh;display:flex;flex-direction:column;overflow:hidden}
111
+ .kzeditor-preview-header{display:flex;align-items:center;gap:12px;padding:12px 16px;border-bottom:1px solid var(--kzeditor-border,#e2e8f0)}
112
+ .kzeditor-preview-title{font-weight:600;font-size:14px;color:var(--kzeditor-text,#0f172a);flex:1}
113
+ .kzeditor-device-tab{display:inline-flex;align-items:center;gap:6px;padding:6px 10px;border-radius:4px;font-size:12px;font-weight:500;cursor:pointer;border:1px solid var(--kzeditor-border-strong,#cbd5e1);background:var(--kzeditor-surface-bg,#fff);color:var(--kzeditor-text-secondary,#475569)}
114
+ .kzeditor-device-tab.is-active{background:var(--kzeditor-primary,#0073e6);color:#fff;border-color:var(--kzeditor-primary,#0073e6)}
115
+ .kzeditor-preview-icon-btn{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;background:var(--kzeditor-surface-bg,#fff);border:1px solid var(--kzeditor-border,#e2e8f0);border-radius:4px;cursor:pointer;color:var(--kzeditor-text-secondary,#475569)}
116
+ .kzeditor-preview-body{flex:1;background:var(--kzeditor-surface-alt-bg,#f1f5f9);overflow-y:auto;display:flex;justify-content:center;padding:24px}
117
+ .kzeditor-preview-loading{font-size:13px;padding:40px;background:var(--kzeditor-surface-bg,#fff);border-radius:4px;border:1px solid var(--kzeditor-border,#e2e8f0);align-self:flex-start;color:var(--kzeditor-text-secondary,#64748b)}
118
+ .kzeditor-preview-loading.is-error{color:#b91c1c}
119
+ .kzeditor-preview-frame{max-width:100%;height:100%;min-height:560px;border:1px solid var(--kzeditor-border,#e2e8f0);background:var(--kzeditor-content-bg,#fff);border-radius:4px;transition:width 220ms ease}
120
+
121
+ .kzeditor-canvas{flex:1;padding:32px;overflow-y:auto;position:relative;transition:background 120ms;background:var(--kzeditor-canvas-backdrop,#f1f5f9)}
122
+ .kzeditor-canvas--form{background:#eef2f6}
123
+
124
+ .kzeditor-empty-drop{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:20px;text-align:center;color:var(--kzeditor-text-muted,#94a3b8);border:2px dashed var(--kzeditor-border-strong,#cbd5e1);border-radius:6px;font-size:13px;background:transparent;transition:all 120ms}
125
+ .kzeditor-empty-drop.is-compact{gap:4px;padding:10px 8px;font-size:11px;border-width:1px}
126
+ .kzeditor-empty-drop.is-over{border-color:var(--kzeditor-primary,#0073e6);background:#eff6ff}
127
+
128
+ .kzeditor-canvas-page{margin:0 auto;width:100%;box-sizing:border-box;border-radius:2px;box-shadow:0 1px 3px rgba(0,0,0,.06),0 1px 2px rgba(0,0,0,.04);max-width:var(--kzeditor-content-width,600px);background:var(--kzeditor-content-bg,#fff);font-family:var(--kzeditor-content-font,Arial,sans-serif);padding:var(--kzeditor-content-padding,40px 20px);--kzeditor-surface-bg:#fff;--kzeditor-surface-alt-bg:#f8fafc;--kzeditor-border:#e2e8f0;--kzeditor-border-strong:#cbd5e1;--kzeditor-text:#0f172a;--kzeditor-text-secondary:#475569;--kzeditor-text-muted:#94a3b8}
129
+ .kzeditor-canvas-page--form{max-width:var(--kzeditor-content-width,560px);font-family:var(--kzeditor-content-font,system-ui,-apple-system,"Segoe UI",Roboto,sans-serif);padding:var(--kzeditor-content-padding,24px);border-radius:8px;box-shadow:0 1px 3px rgba(0,0,0,.08),0 1px 2px rgba(0,0,0,.04)}
129
130
 
130
131
  /* Certificate mode: the canvas page is a fixed-aspect landscape sheet (sizing +
131
132
  background are applied inline by Canvas from the tree). Wider than an email
132
133
  and with a stronger shadow so it reads as a printed page. */
133
- .emb-canvas-page--certificate{max-width:1040px;border-radius:4px;box-shadow:0 8px 30px rgba(0,0,0,.22)}
134
- `,Do=!1;function q(){if(Do||typeof document=="undefined")return;if(document.getElementById(od)){Do=!0;return}let t=document.createElement("style");t.id=od,t.textContent=Cc+(ad||""),document.head.appendChild(t),Do=!0}import{jsx as $t,jsxs as Wa}from"react/jsx-runtime";q();var nd={heading:Un,text:jn,html:ya,button:zn,divider:Pn,spacer:td,section:Zn,columns:qn,image:$r,video:wn,list:La,social:An,address:On,signature:Nn,date:Jn,timer:Sn,qr:Fn},ja=nd;function Wc({type:t,spec:r,suffix:e}){var s;let{attributes:a,listeners:o,setNodeRef:i,isDragging:n}=ga({id:`lib-${t}`,data:{source:"library",type:t}}),{config:d}=E(),l=nd[t],c=r.name||t,h=(s=d["block_"+t])!=null?s:c;return Wa("button",{ref:i,...o,...a,type:"button",className:`${T("emb-v2-lib-item",e)} ${n?"is-dragging":""}`,children:[$t("span",{className:"inline-flex items-center justify-center text-inherit",children:l?$t(l,{size:20}):$t("span",{className:"font-bold text-base",children:h[0].toUpperCase()})}),$t("span",{className:"leading-[1.2]",children:h})]})}var jc={fields:"Fields",structure:"Structure",content:"Content",media:"Media",other:"Other"},id=["fields","structure","content","media","other"];function Sc(t){let r={};return Object.entries(t||{}).forEach(([e,a])=>{if(a.root||a.hidden)return;let o=a.category||"other";r[o]||(r[o]=[]),r[o].push([e,a])}),r}function To({blocks:t,suffix:r}){let{config:e}=E(),[a,o]=Bc(""),i=a.trim().toLowerCase(),n=i?Object.fromEntries(Object.entries(t||{}).filter(([c,h])=>(h.name||c).toLowerCase().includes(i)||c.toLowerCase().includes(i))):t,d=Sc(n),l=id.some(c=>{var h;return(h=d[c])==null?void 0:h.length});return Wa("div",{className:T("emb-block-library",r),children:[Wa("div",{className:T("emb-search",r),children:[$t(va,{size:14}),$t("input",{type:"text",className:"emb-search-input",value:a,onChange:c=>o(c.target.value),placeholder:e.search_blocks})]}),l?id.map(c=>{var u;let h=d[c];if(!h||h.length===0)return null;let s=jc[c]||c;return Wa("div",{className:"mb-[18px]",children:[$t("div",{className:"emb-category-label",children:(u=e["category_"+c])!=null?u:s}),$t("div",{className:"emb-lib-grid",children:h.map(([f,p])=>$t(Wc,{type:f,spec:p,suffix:r},f))})]},c)}):$t("div",{className:"emb-lib-empty",children:e.no_blocks_found})]})}import{useState as pd}from"react";import{createContext as n1,useContext as d1}from"react";import{useEffect as Vc,useRef as Ro,useState as Dc}from"react";var Hc=/^[a-z][a-z0-9+.-]*:/i,Ac=/^[\w-]+(\.[\w-]+)+$/,Sa=t=>{let r=String(t!=null?t:"").trim();if(r===""||r.startsWith("#")||r.startsWith("{{")||Hc.test(r))return r;if(r.startsWith("//"))return`https:${r}`;if(r.startsWith("/"))return r;let e=r.split(/[/?#]/,1)[0];return Ac.test(e)?`https://${r}`:r};import{Fragment as cd,jsx as C,jsxs as P}from"react/jsx-runtime";var Tc="block text-[11px] font-semibold text-[#475569] uppercase tracking-[.04em] mb-1.5",dd="block text-[10px] text-[#64748b] mb-1",K="emb-field-input",ld=({inputRef:t,value:r,onChange:e})=>{let a=ir(),{config:o}=E(),[i,n]=Dc(!1),d=Ro(null);if(Vc(()=>{if(!i)return;let c=h=>{d.current&&!d.current.contains(h.target)&&n(!1)};return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[i]),!a.length)return null;let l=c=>{let h=t.current,s=r!=null?r:"",u=h&&h.selectionStart!=null?h.selectionStart:s.length,f=h&&h.selectionEnd!=null?h.selectionEnd:u;e(s.slice(0,u)+c+s.slice(f)),n(!1),requestAnimationFrame(()=>{if(!h)return;h.focus();let p=u+c.length;try{h.setSelectionRange(p,p)}catch{}})};return P("div",{ref:d,className:"absolute top-[3px] right-[3px]",style:{position:"absolute",top:3,right:3},children:[C("button",{type:"button",title:o.insert_shortcode,onMouseDown:c=>{c.preventDefault(),n(h=>!h)},className:"emb-merge-tag-trigger",children:C(Pr,{size:12})}),i&&C("div",{className:"emb-merge-tag-menu",style:{position:"absolute",top:"100%",right:0,marginTop:4,zIndex:1002},children:a.map(c=>P("button",{type:"button",onMouseDown:h=>{h.preventDefault(),l(c.tag)},className:"emb-merge-tag-item",children:[C("span",{className:"font-semibold",children:c.label||c.tag}),C("span",{style:{opacity:.55,marginLeft:"auto",paddingLeft:12,fontSize:11},children:c.tag})]},c.tag))})]})},ht=({label:t,children:r})=>P("label",{className:"block",children:[C("span",{className:Tc,children:t}),r]}),ot=({label:t,children:r,style:e})=>P("label",{className:"block",style:e,children:[C("span",{className:dd,children:t}),r]}),Rc=({label:t,value:r,onChange:e})=>{let a=Ro(null);return C(ht,{label:t,children:P("div",{className:"relative",children:[C("input",{ref:a,type:"text",className:"emb-field-input",style:{paddingRight:30},value:r!=null?r:"",onChange:o=>e(o.target.value)}),C(ld,{inputRef:a,value:r,onChange:e})]})})},Ec=({label:t,value:r,onChange:e})=>{let a=Ro(null);return C(ht,{label:t,children:P("div",{className:"relative",children:[C("textarea",{ref:a,className:"emb-field-input",style:{minHeight:70,paddingRight:30,resize:"vertical"},value:r!=null?r:"",onChange:o=>e(o.target.value)}),C(ld,{inputRef:a,value:r,onChange:e})]})})},Fc=({label:t,value:r,onChange:e})=>C(ht,{label:t,children:C("textarea",{className:"emb-field-input",style:{minHeight:180,fontFamily:"monospace",fontSize:12,resize:"vertical",whiteSpace:"pre"},value:r!=null?r:"",onChange:a=>e(a.target.value),spellCheck:!1})}),Nc=({label:t,spec:r,value:e,onChange:a})=>{var o;return C(ht,{label:t,children:C("input",{type:"number",className:K,value:(o=e!=null?e:r.default)!=null?o:0,min:r.min,max:r.max,onChange:i=>{let n=Number(i.target.value);a(Number.isFinite(n)?n:0)}})})},zc=({label:t,value:r,onChange:e})=>C(ht,{label:t,children:C(Ha,{value:r,onChange:e})}),Ha=({value:t,onChange:r})=>P("div",{className:"flex gap-2 items-center",children:[C("input",{type:"color",value:Ic(t),onChange:e=>r(e.target.value.toUpperCase()),className:"emb-field-input shrink-0",style:{width:36,height:32,padding:0,flexShrink:0}}),C("input",{type:"text",className:`${K} flex-1`,value:t!=null?t:"",onChange:e=>r(e.target.value)})]}),Ic=t=>typeof t!="string"?"#000000":/^#[0-9a-fA-F]{6}$/.test(t)?t:/^#[0-9a-fA-F]{3}$/.test(t)?"#"+t.slice(1).split("").map(r=>r+r).join(""):"#000000",Pc=({label:t,spec:r,value:e,onChange:a})=>{let o=ke(),{config:i}=E(),n=!!(r!=null&&r.media),d=async()=>{try{let l=await o({allowedTypes:["image"]});l&&l.url&&a(l.url)}catch{}};return C(ht,{label:t,children:P("div",{className:"flex gap-2 items-center",children:[C("input",{type:"url",className:`${K} flex-1`,value:e!=null?e:"",onChange:l=>a(l.target.value),onBlur:l=>{let c=Sa(l.target.value);c!==l.target.value&&a(c)},placeholder:"https://"}),n&&C("button",{type:"button",onClick:d,title:i.choose_from_media_library,className:"shrink-0 w-[34px] h-[34px] inline-flex items-center justify-center bg-white border border-solid border-[#cbd5e1] rounded text-[#475569] cursor-pointer",children:C(Cn,{size:14})})]})})},Oc=t=>!t||/via\.placeholder\.com|placehold\.co/i.test(String(t)),_c=({label:t,spec:r,value:e,onChange:a,node:o,updateAttrs:i})=>{var p,g;let n=ke(),{config:d}=E(),l=!Oc(e),c=[{label:d.small,px:150},{label:d.medium,px:300},{label:d.large,px:450},{label:d.full,px:600}],h=async()=>{var x;try{let y=await n({allowedTypes:["image"]});if(y&&y.url){a(y.url);let M=(x=o==null?void 0:o.attributes)==null?void 0:x.alt;y.alt&&(!M||M==="Image")&&(i==null||i(o.id,{alt:y.alt}))}}catch{}},s=()=>a((r==null?void 0:r.default)||""),u=parseInt((g=(p=o==null?void 0:o.attributes)==null?void 0:p.width)!=null?g:600,10)||600,f=x=>{let y=Math.max(10,Math.min(1e3,parseInt(x,10)||0));i==null||i(o.id,{width:y})};return C(ht,{label:t,children:l?P(cd,{children:[P("div",{className:"border border-solid border-[#e2e8f0] rounded-md overflow-hidden bg-white",children:[C("img",{src:e,alt:"",className:"block w-full max-h-[160px] object-contain bg-[#f1f5f9]"}),P("div",{className:"flex border-0 border-t border-solid border-[#e2e8f0]",children:[P("button",{type:"button",onClick:h,title:d.replace_image,className:"flex-1 inline-flex items-center justify-center gap-1.5 py-2 px-1.5 bg-white border-none cursor-pointer text-xs font-semibold text-[#475569]",children:[C(Dn,{size:14}),C("span",{children:d.replace})]}),P("button",{type:"button",onClick:s,title:d.remove_image,className:"flex-1 inline-flex items-center justify-center gap-1.5 py-2 px-1.5 bg-white border-none cursor-pointer text-xs font-semibold text-[#b91c1c]",children:[C(Ir,{size:14}),C("span",{children:d.remove})]})]})]}),P("div",{className:"mt-3",children:[C("span",{className:dd,children:d.image_size}),C("div",{className:"grid grid-cols-4 gap-1.5",children:c.map(x=>{let y=u===x.px;return C("button",{type:"button",onClick:()=>f(x.px),className:y?"py-1.5 px-1 rounded text-xs font-semibold cursor-pointer bg-[#0073e6] border border-solid border-[#0073e6] text-white":"py-1.5 px-1 rounded text-xs font-semibold cursor-pointer bg-white border border-solid border-[#cbd5e1] text-[#475569]",children:x.label},x.px)})}),P("div",{className:"flex items-center gap-2 mt-2",children:[C("input",{type:"number",min:10,max:1e3,value:u,onChange:x=>f(x.target.value),className:"py-1.5 pl-2 pr-2 border border-solid border-[#cbd5e1] rounded text-[13px] bg-white box-border w-[90px]"}),C("span",{className:"text-xs text-[#64748b]",children:d.px_max_width})]})]})]}):P("button",{type:"button",onClick:h,className:"w-full flex flex-col items-center justify-center gap-1.5 py-[22px] px-3 bg-[#f8fafc] border border-dashed border-[#cbd5e1] rounded-md text-[#475569] cursor-pointer text-center",children:[C($r,{size:22}),C("span",{className:"text-[13px] font-semibold",children:d.upload_image}),C("span",{className:"text-[11px] text-[#94a3b8]",children:d.choose_from_the_media_library})]})})},$c=({label:t,value:r,onChange:e})=>P("label",{className:"flex items-center gap-2 text-[13px] cursor-pointer",children:[C("input",{type:"checkbox",checked:!!r,onChange:a=>e(a.target.checked)}),C("span",{children:t})]}),Uc=({label:t,spec:r,value:e,onChange:a})=>{var o;return C(ht,{label:t,children:C("select",{className:K,value:(o=e!=null?e:r.default)!=null?o:"",onChange:i=>a(i.target.value),children:(r.options||[]).map(i=>C("option",{value:i,children:i},i))})})},Zc=({label:t,value:r,onChange:e})=>{let a=Array.isArray(r)?[...r]:[0,0,0,0];for(;a.length<4;)a.push(0);return C(ht,{label:t,children:C("div",{className:"grid grid-cols-2 gap-1.5",children:["Top","Right","Bottom","Left"].map((i,n)=>C(ot,{label:i,children:C("input",{type:"number",className:K,value:a[n],onChange:d=>{let l=[...a];l[n]=Number(d.target.value)||0,e(l)}})},i))})})},qc=[{value:"left",Icon:qr,title:"Left"},{value:"center",Icon:Gr,title:"Center"},{value:"right",Icon:Zr,title:"Right"},{value:"justify",Icon:rd,title:"Justify"}],Gc=({label:t,spec:r,value:e,onChange:a})=>{let o=r.options||["left","center","right"],i=qc.filter(n=>o.includes(n.value));return C(ht,{label:t,children:C("div",{className:"emb-toggle-group",children:i.map(({value:n,Icon:d,title:l})=>C("button",{type:"button",title:l,onClick:()=>a(n),className:`emb-toggle-btn ${e===n?"is-active":""}`,children:C(d,{size:14})},n))})})},Kc=[{value:"inherit",label:"Inherit (page default)"},{value:"Arial, sans-serif",label:"Arial"},{value:"Helvetica, Arial, sans-serif",label:"Helvetica"},{value:"Georgia, serif",label:"Georgia"},{value:'"Times New Roman", Times, serif',label:"Times New Roman"},{value:"Verdana, Geneva, sans-serif",label:"Verdana"},{value:"Tahoma, Geneva, sans-serif",label:"Tahoma"},{value:'"Trebuchet MS", sans-serif',label:"Trebuchet MS"},{value:'"Courier New", Courier, monospace',label:"Courier New"}],Xc=["100","200","300","400","500","600","700","800","900"],Yc=({label:t,value:r,onChange:e})=>{var l,c,h,s,u,f;let a=r||{},{config:o}=E(),i=(p,g)=>e({...a,[p]:g}),n=p=>`emb-style-btn ${p?"is-active":""}`.trim(),d={width:32,height:30};return C(ht,{label:t,children:P("div",{className:"flex flex-col gap-2",children:[C(ot,{label:"Font family",children:C("select",{className:K,value:(l=a.fontFamily)!=null?l:"inherit",onChange:p=>i("fontFamily",p.target.value),children:Kc.map(p=>C("option",{value:p.value,children:p.label},p.value))})}),P("div",{className:"grid grid-cols-2 gap-1.5",children:[C(ot,{label:"Size (px)",children:C("input",{type:"number",min:6,max:96,className:K,value:(c=a.fontSize)!=null?c:14,onChange:p=>i("fontSize",Number(p.target.value)||0)})}),C(ot,{label:"Line height",children:C("input",{type:"number",min:.5,max:5,step:.1,className:K,value:(h=a.lineHeight)!=null?h:1.5,onChange:p=>i("lineHeight",Number(p.target.value)||0)})})]}),C(ot,{label:"Color",children:C(Ha,{value:(s=a.color)!=null?s:"#000000",onChange:p=>i("color",p)})}),C(ot,{label:"Weight",children:P("div",{className:"flex items-center gap-1.5",children:[C("select",{className:`${K} flex-1`,value:(u=a.fontWeight)!=null?u:"400",onChange:p=>i("fontWeight",p.target.value),children:Xc.map(p=>C("option",{value:p,children:p},p))}),C("button",{type:"button",title:o.bold_700,className:n(a.fontWeight==="700"),style:d,onClick:()=>i("fontWeight",a.fontWeight==="700"?"400":"700"),children:C(Ur,{size:13})}),C("button",{type:"button",title:o.italic,className:n(a.fontStyle==="italic"),style:d,onClick:()=>i("fontStyle",a.fontStyle==="italic"?"normal":"italic"),children:C(_r,{size:13})})]})}),C(ot,{label:"Decoration",children:P("div",{className:"flex gap-1.5",children:[C("button",{type:"button",title:o.underline,className:`${n(a.textDecoration==="underline")} flex-1`,style:{height:30},onClick:()=>i("textDecoration",a.textDecoration==="underline"?"none":"underline"),children:C(zr,{size:13})}),C("button",{type:"button",title:o.line_through,className:`${n(a.textDecoration==="line-through")} flex-1`,style:{height:30},onClick:()=>i("textDecoration",a.textDecoration==="line-through"?"none":"line-through"),children:C(Or,{size:13})})]})}),C(ot,{label:"Transform",children:P("div",{className:"flex gap-1.5",children:[C("button",{type:"button",title:o.none,className:`${n(!a.textTransform||a.textTransform==="none")} flex-1`,style:{height:30},onClick:()=>i("textTransform","none"),children:C(Xn,{size:13})}),C("button",{type:"button",title:o.uppercase,className:`${n(a.textTransform==="uppercase")} flex-1`,style:{height:30},onClick:()=>i("textTransform","uppercase"),children:C(Kn,{size:13})}),C("button",{type:"button",title:o.lowercase,className:`${n(a.textTransform==="lowercase")} flex-1`,style:{height:30},onClick:()=>i("textTransform","lowercase"),children:C(Yn,{size:13})}),C("button",{type:"button",title:o.capitalize,className:`${n(a.textTransform==="capitalize")} flex-1`,style:{height:30,fontSize:11,fontWeight:600},onClick:()=>i("textTransform","capitalize"),children:"Aa"})]})}),C(ot,{label:"Letter spacing (px)",children:C("input",{type:"number",min:-10,max:20,step:.5,className:K,value:(f=a.letterSpacing)!=null?f:0,onChange:p=>i("letterSpacing",Number(p.target.value)||0)})})]})})},Jc=["solid","dashed","dotted","double","none"],Qc=({label:t,value:r,onChange:e})=>{var i,n,d,l;let a=r||{},o=(c,h)=>e({...a,[c]:h});return C(ht,{label:t,children:P("div",{className:"flex flex-col gap-2",children:[P("div",{className:"grid grid-cols-2 gap-1.5",children:[C(ot,{label:"Width (px)",children:C("input",{type:"number",min:0,max:20,className:K,value:(i=a.width)!=null?i:0,onChange:c=>o("width",Number(c.target.value)||0)})}),C(ot,{label:"Style",children:C("select",{className:K,value:(n=a.style)!=null?n:"solid",onChange:c=>o("style",c.target.value),children:Jc.map(c=>C("option",{value:c,children:c},c))})})]}),C(ot,{label:"Color",children:C(Ha,{value:(d=a.color)!=null?d:"#000000",onChange:c=>o("color",c)})}),C(ot,{label:"Radius (px)",children:C("input",{type:"number",min:0,max:999,className:K,value:(l=a.radius)!=null?l:0,onChange:c=>o("radius",Number(c.target.value)||0)})})]})})},t1=({label:t,value:r,onChange:e})=>{var d,l,c,h,s;let a=r||{},{config:o}=E(),i=(u,f)=>e({...a,[u]:f}),n=!!a.enabled;return C(ht,{label:t,children:P("div",{className:"flex flex-col gap-2",children:[P("label",{className:"flex items-center gap-2 text-xs cursor-pointer",children:[C("input",{type:"checkbox",checked:n,onChange:u=>i("enabled",u.target.checked)}),C("span",{children:o.enable_shadow})]}),n&&P(cd,{children:[P("div",{className:"grid grid-cols-2 gap-1.5",children:[C(ot,{label:"X (px)",children:C("input",{type:"number",min:-50,max:50,className:K,value:(d=a.x)!=null?d:0,onChange:u=>i("x",Number(u.target.value)||0)})}),C(ot,{label:"Y (px)",children:C("input",{type:"number",min:-50,max:50,className:K,value:(l=a.y)!=null?l:2,onChange:u=>i("y",Number(u.target.value)||0)})}),C(ot,{label:"Blur (px)",children:C("input",{type:"number",min:0,max:100,className:K,value:(c=a.blur)!=null?c:4,onChange:u=>i("blur",Number(u.target.value)||0)})}),C(ot,{label:"Spread (px)",children:C("input",{type:"number",min:-50,max:50,className:K,value:(h=a.spread)!=null?h:0,onChange:u=>i("spread",Number(u.target.value)||0)})})]}),C(ot,{label:"Color",children:C(Ha,{value:(s=a.color)!=null?s:"rgba(0,0,0,.15)",onChange:u=>i("color",u)})}),P("label",{className:"flex items-center gap-2 text-xs cursor-pointer",children:[C("input",{type:"checkbox",checked:!!a.inset,onChange:u=>i("inset",u.target.checked)}),C("span",{children:o.inset})]})]})]})})},r1=t=>String(t!=null?t:"").toLowerCase().replace(/[^a-z0-9_]+/g,"_").replace(/^_+|_+$/g,""),e1=({label:t,value:r,onChange:e})=>C(ht,{label:t,children:C("input",{type:"text",className:K,value:r!=null?r:"",onChange:a=>e(r1(a.target.value)),placeholder:"field_name",spellCheck:!1})}),a1=({label:t,value:r,onChange:e})=>{let{config:a}=E(),o=Array.isArray(r)?r:[],i=c=>e(c),n=(c,h,s)=>i(o.map((u,f)=>f===c?{...u,[h]:s}:u)),d=()=>i([...o,{label:`Option ${o.length+1}`,value:`option-${o.length+1}`}]),l=c=>i(o.filter((h,s)=>s!==c));return C(ht,{label:t,children:P("div",{className:"flex flex-col gap-1.5",children:[o.map((c,h)=>{var s,u;return P("div",{className:"flex gap-1 items-center",children:[C("input",{className:`${K} flex-1`,placeholder:a.label,value:(s=c.label)!=null?s:"",onChange:f=>n(h,"label",f.target.value)}),C("input",{className:`${K} flex-1`,placeholder:a.value,value:(u=c.value)!=null?u:"",onChange:f=>n(h,"value",f.target.value)}),C("button",{type:"button",onClick:()=>l(h),title:a.remove_option,className:"shrink-0 w-7 h-[30px] border border-solid border-[#cbd5e1] bg-white rounded text-[#ef4444] cursor-pointer",children:"\u2715"})]},h)}),P("button",{type:"button",onClick:d,className:"py-1.5 px-2.5 border border-dashed border-[#cbd5e1] bg-white rounded text-[#0073e6] text-xs font-semibold cursor-pointer",children:["+ ",a.add_option]})]})})},o1=t=>{if(!t)return"";let r=new Date(String(t).trim().replace(" ","T"));if(Number.isNaN(r.getTime()))return"";let e=a=>String(a).padStart(2,"0");return`${r.getFullYear()}-${e(r.getMonth()+1)}-${e(r.getDate())}T${e(r.getHours())}:${e(r.getMinutes())}`},i1=({label:t,value:r,onChange:e})=>C(ht,{label:t,children:C("input",{type:"datetime-local",className:K,value:o1(r),onChange:a=>e(a.target.value?`${a.target.value}:00`:"")})}),Xr={string:Rc,datetime:i1,richtext:Ec,html:Fc,number:Nc,color:zc,url:Pc,image:_c,boolean:$c,select:Uc,spacing:Zc,alignment:Gc,typography:Yc,border:Qc,boxShadow:t1,fieldName:e1,options:a1};var Eo=n1(Xr),hd=()=>d1(Eo);var sd={H1:"h1",H2:"h2",H3:"h3",H4:"h4",H5:"h4",H6:"h4"},l1=new Set(["P","DIV","SECTION","ARTICLE","H1","H2","H3","H4","H5","H6","UL","OL","HR","IMG","FIGURE","BLOCKQUOTE","TABLE","PRE"]),c1=new Set(["SPAN","STRONG","EM","B","I","U","A","FONT","SMALL","MARK","CODE","SUB","SUP","BR"]),Et=(t,r,e)=>{let a=t==null?void 0:t[r];if(!a)return null;let o=Hr(r,a);return o.attributes={...o.attributes,...e},o},ud=(t,r)=>{let e=String(r||"").trim();return e?Et(t,"html",{html:e}):null},Aa=(t,r)=>{let e=t.getAttribute("src")||"";if(!e)return null;let a={src:e,alt:t.getAttribute("alt")||""},o=parseInt(t.getAttribute("width")||"",10);Number.isFinite(o)&&o>0&&(a.width=o);let i=t.closest("a");return i&&i.getAttribute("href")&&(a.href=i.getAttribute("href")),Et(r,"image",a)},h1=(t,r)=>{let e=Array.from(t.children).filter(a=>a.tagName==="LI").map(a=>a.textContent.trim()).filter(Boolean);return e.length?Et(r,"list",{type:t.tagName==="OL"?"ordered":"unordered",items:e.join(`
135
- `)}):null},s1=(t,r,e)=>{let a=t.tagName;if(sd[a]){let o=t.innerHTML.trim();o&&t.textContent.trim()&&e.push(Et(r,"heading",{text:o,tag:sd[a]}));return}if(a==="IMG"){e.push(Aa(t,r));return}if(a==="FIGURE"){let o=t.querySelector("img");e.push(o?Aa(o,r):ud(r,t.outerHTML));return}if(a==="UL"||a==="OL"){e.push(h1(t,r));return}if(a==="HR"){e.push(Et(r,"divider",{}));return}if(a==="P"){let o=t.querySelector("img");if(o&&!t.textContent.trim()){e.push(Aa(o,r));return}if(!t.textContent.trim())return;e.push(Et(r,"text",{text:t.innerHTML.trim()}));return}if(a==="BLOCKQUOTE"){let o=t.innerHTML.trim();o&&e.push(Et(r,"text",{text:o}));return}if(a==="A"){let o=t.querySelector("img");if(o&&!t.textContent.trim()){e.push(Aa(o,r));return}t.textContent.trim()&&e.push(Et(r,"text",{text:t.outerHTML.trim()}));return}if(a==="DIV"||a==="SECTION"||a==="ARTICLE"||a==="BODY"){if(Array.from(t.children).some(i=>l1.has(i.tagName))){gd(t,r,e);return}t.textContent.trim()&&e.push(Et(r,"text",{text:t.innerHTML.trim()}));return}if(c1.has(a)){(t.textContent.trim()||t.querySelector("img"))&&e.push(Et(r,"text",{text:t.outerHTML.trim()}));return}e.push(ud(r,t.outerHTML))};function gd(t,r,e){t.childNodes.forEach(a=>{if(a.nodeType===3){let o=a.textContent.trim();o&&e.push(Et(r,"text",{text:o}));return}a.nodeType===1&&s1(a,r,e)})}function Yr(t,r){if(!t||typeof t!="string"||!r)return[];let e;try{e=new DOMParser().parseFromString(t,"text/html")}catch{return[]}e.querySelectorAll("style, meta, title, link, script").forEach(n=>n.remove());let a=e.body,o=a.querySelector('b[id^="docs-internal-guid"]');o&&(a=o);let i=[];return gd(a,r,i),i.filter(Boolean)}import{jsx as st,jsxs as Jr}from"react/jsx-runtime";var u1=new Set(["advanced"]);function No({blocks:t,suffix:r}){var L,w;let{updateAttrs:e,removeNode:a,replaceNode:o}=$(),i=Ye(),{config:n}=E(),d=[{key:"content",label:n.content,groups:["content"]},{key:"style",label:n.style,groups:["style","border","effects"]},{key:"advanced",label:n.advanced,groups:["spacing","advanced"]}],l={content:n.content,style:n.style,spacing:n.spacing_layout,border:n.border,effects:n.effects,advanced:n.advanced},c=()=>{var H;let B=Yr(((H=i==null?void 0:i.attributes)==null?void 0:H.html)||"",t);if(!B.length){alert(n.nothing_to_convert);return}o(i.id,B)},h=hd(),[s,u]=pd(null);if(!i)return st("div",{className:Fo,children:n.select_block_hint});let f=t[i.type];if(!f)return Jr("div",{className:Fo,children:[n.unknown_block,": ",i.type]});let p=i.id==="root",g=g1(f.attributes||{}),x=d.filter(B=>B.groups.some(H=>g[H]&&g[H].length)),y=s&&x.some(B=>B.key===s)?s:(w=(L=x[0])==null?void 0:L.key)!=null?w:"content",M=B=>st("div",{className:"flex flex-col gap-3.5",children:B.map(({key:H,spec:W})=>{var N,V,A;let S=h[W.type]||h.string;return st(S,{label:W.label&&((N=n[W.label])!=null?N:W.label)||f1(H),spec:W,value:(A=(V=i.attributes)==null?void 0:V[H])!=null?A:W.default,onChange:z=>e(i.id,{[H]:z}),node:i,updateAttrs:e},H)})}),v=x.find(B=>B.key===y)||x[0]||d[0],k=v.groups.filter(B=>g[B]&&g[B].length),m=k.length===1;return Jr("div",{children:[st("div",{className:T("emb-inspector-tabs",r),role:"tablist",children:x.map(B=>st("button",{type:"button",role:"tab",onClick:()=>u(B.key),className:`${T("emb-inspector-tab",r)} ${B.key===v.key?"is-active":""}`,children:B.label},B.key))}),Jr("div",{className:"py-2",children:[k.length===0&&st("div",{className:Fo,children:n.no_options_in_this_tab}),k.map(B=>m?st("div",{className:"pt-2 px-4 pb-3",children:M(g[B])},B):st(p1,{title:l[B]||B,defaultOpen:!u1.has(B),children:M(g[B])},B)),i.type==="html"&&Jr("div",{className:"pt-3 px-4",children:[st("button",{type:"button",onClick:c,className:"emb-inspector-btn-primary",children:n.convert_to_blocks}),st("p",{className:"mt-2 mx-0.5 mb-0 text-[11px] leading-[1.5] text-[#94a3b8]",children:n.parse_html_help_text})]}),!p&&st("div",{className:"pt-3 px-4 pb-5",children:st("button",{type:"button",onClick:()=>{confirm(n.delete_this_block)&&a(i.id)},className:"emb-inspector-btn-danger",children:n.delete_block})})]})]})}var Fo="p-6 text-[13px] text-[#94a3b8] text-center";function g1(t){let r={};return Object.entries(t).forEach(([e,a])=>{if(a.hidden)return;let o=a.group||"content";r[o]||(r[o]=[]),r[o].push({key:e,spec:a})}),r}function p1({title:t,defaultOpen:r,children:e}){let[a,o]=pd(r);return Jr("div",{className:"border-0 border-b border-solid border-[#f1f5f9]",children:[Jr("button",{type:"button",onClick:()=>o(i=>!i),className:"w-full flex items-center gap-1.5 py-2.5 px-4 bg-transparent border-none cursor-pointer text-[11px] font-bold tracking-[.05em] text-[#475569] uppercase",children:[a?st(Ca,{size:12}):st(wa,{size:12}),st("span",{children:t})]}),a&&st("div",{className:"pt-1 px-4 pb-4",children:e})]})}function f1(t){return t.replace(/([A-Z])/g," $1").replace(/^./,r=>r.toUpperCase())}import{Fragment as fd,jsx as Ft,jsxs as Qr}from"react/jsx-runtime";q();function Se({blocks:t,width:r,navOpen:e=!1,onToggleNav:a,suffix:o}){var v,k,m,L;let{state:i,select:n}=$(),d=Ye(),{config:l}=E(),[c,h]=x1("blocks");k1(()=>{i.selectedId&&i.selectedId!=="root"&&h("settings")},[i.selectedId]);let s=d&&t[d.type],u=(s==null?void 0:s.name)||(d==null?void 0:d.type),f=u?(v=l["block_"+d.type])!=null?v:u:l.settings,p=(m=(k=i.tree)==null?void 0:k.root)==null?void 0:m.type,g=t[p],x=g!=null&&g.name?`${(L=l["block_"+p])!=null?L:g.name} ${l.settings}`:l.email_settings,y=Ft("button",{type:"button",title:x,onClick:()=>{n("root"),h("settings")},className:`emb-icon-btn ${c==="settings"&&i.selectedId==="root"?"is-active":""}`,children:Ft(Vn,{size:15})}),M=a?Ft("button",{type:"button",onClick:a,className:`emb-icon-btn ${e?"is-active":""}`,title:l.toggle_navigator,children:Ft(_n,{size:15})}):null;return Qr("aside",{className:T("emb-left-panel",o),style:r!=null?{width:r}:void 0,children:[Ft("header",{className:T("emb-panel-header",o),children:c==="settings"?Qr(fd,{children:[Qr("button",{type:"button",onClick:()=>h("blocks"),className:"emb-back-btn",title:l.back_to_blocks,children:[Ft(Gn,{size:16}),Ft("span",{className:"emb-panel-title",children:f})]}),Qr("div",{className:"flex gap-1.5",children:[M,y]})]}):Qr(fd,{children:[Ft("span",{className:"emb-panel-title",children:l.blocks}),Qr("div",{className:"flex gap-1.5",children:[M,y]})]})}),Ft("div",{className:"emb-panel-scroll",children:c==="settings"?Ft(No,{blocks:t,suffix:o}):Ft(To,{blocks:t,suffix:o})})]})}import"react";import{useState as zo}from"react";import{jsx as Nt,jsxs as kd}from"react/jsx-runtime";var v1=new Set(["section","columns","column"]);function Io({blocks:t}){let{state:r,select:e,moveNode:a,removeNode:o}=$(),{config:i}=E(),[n,d]=zo(null),[l,c]=zo(null),[h,s]=zo(null),u=()=>{d(null),c(null),s(null)},f=(M,v)=>{if(!M||M===v)return!1;let k=Kt(r.tree.root,M);return!!(k&&Kt(k,v))},p=M=>{if(n&&n!==M&&!f(n,M)){let v=or(r.tree.root,M);if(v){let k=v.container===r.tree.root?"root":v.container.id;a(n,k,v.index)}}u()},g=M=>{n&&n!==M&&!f(n,M)&&a(n,M,-1),u()},x=(M,v)=>M.map(k=>{var V;let m=t[k.type]||{},L=ja[k.type],w=v1.has(k.type),B=k.type==="column",H=r.selectedId===k.id,W=m.name||k.type,S=(V=i["block_"+k.type])!=null?V:W,N=k.children||[];return kd("div",{children:[kd("div",{draggable:!B,onDragStart:A=>{A.stopPropagation(),d(k.id)},onDragEnd:u,onDragOver:A=>{A.preventDefault(),A.stopPropagation(),B||c(k.id)},onDrop:A=>{A.preventDefault(),A.stopPropagation(),B?g(k.id):p(k.id)},onClick:A=>{A.stopPropagation(),e(k.id)},style:L1(v,H,l===k.id,B),title:S,children:[w?Nt(wa,{size:12,className:"shrink-0 opacity-50"}):Nt("span",{className:"w-3 shrink-0"}),Nt("span",{className:"inline-flex shrink-0",children:L?Nt(L,{size:13}):null}),Nt("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap",children:S}),!B&&Nt("button",{type:"button",onClick:A=>{A.stopPropagation(),o(k.id)},className:"shrink-0 inline-flex items-center justify-center w-5 h-5 border-0 bg-transparent text-inherit opacity-60 cursor-pointer rounded-[3px]",title:i.delete,children:Nt(Ir,{size:12})})]}),w&&Nt("div",{onDragOver:A=>{A.preventDefault(),A.stopPropagation(),s(k.id)},onDrop:A=>{A.preventDefault(),A.stopPropagation(),g(k.id)},children:N.length>0?x(N,v+1):Nt("div",{style:m1(v+1,h===k.id),children:i.empty_drop_here})})]},k.id)}),y=r.tree.root.children||[];return Nt("div",{className:"py-2 px-1.5",onDragEnd:u,children:y.length===0?Nt("div",{className:"p-6 text-center text-xs text-[var(--emb-text-muted,#94a3b8)]",children:i.no_blocks_yet}):x(y,0)})}var L1=(t,r,e,a)=>({display:"flex",alignItems:"center",gap:6,padding:"5px 6px",paddingLeft:6+t*14,marginBottom:2,borderRadius:4,cursor:a?"default":"grab",fontSize:12,color:r?"#fff":"var(--emb-text-secondary, #334155)",background:r?"#0073e6":e?"#e0efff":"transparent",borderTop:e?"2px solid #0073e6":"2px solid transparent",userSelect:"none"}),m1=(t,r)=>({margin:"2px 6px 4px",marginLeft:6+t*14,padding:"6px 8px",fontSize:11,color:r?"#0073e6":"var(--emb-text-muted, #94a3b8)",border:`1px dashed ${r?"#0073e6":"var(--emb-border-strong, #cbd5e1)"}`,borderRadius:4,background:r?"#eff6ff":"transparent"});import{jsx as He,jsxs as xd}from"react/jsx-runtime";q();function Ae({blocks:t,onClose:r,width:e,suffix:a}){let{config:o}=E();return xd("aside",{className:T("emb-navigator-panel",a),style:e!=null?{width:e}:void 0,children:[xd("header",{className:T("emb-panel-header",a),children:[He("span",{className:"emb-panel-title",children:o.navigator}),He("button",{type:"button",onClick:r,className:"emb-icon-btn",title:o.close_navigator,children:He(Nr,{size:15})})]}),He("div",{className:"emb-panel-scroll",children:He(Io,{blocks:t})})]})}import{useEffect as Ch,useMemo as Zd}from"react";var j=t=>Object.entries(t).filter(([,r])=>r!=null&&r!=="").map(([r,e])=>`${r}:${e}`).join(";"),R=t=>{if(!Array.isArray(t))return"0";let r=t.slice(0,4).map(e=>parseInt(e,10)||0);for(;r.length<4;)r.push(0);return r.map(e=>`${e}px`).join(" ")},Lr=t=>`${parseInt(t,10)||0}px`,M1=t=>{let r=Number(t)||0;return`${(Math.round(r*1e3)/1e3).toString()}px`},b1=t=>(typeof t=="number"||typeof t=="string"&&/^-?\d/.test(t),String(t)),dr=(t={},r=null)=>{var o;let e={},a=(o=t.fontFamily)!=null?o:"inherit";return a&&a!=="inherit"?e["font-family"]=a:r&&(e["font-family"]=r),t.fontSize&&(e["font-size"]=Lr(t.fontSize)),t.fontWeight&&(e["font-weight"]=String(t.fontWeight)),t.fontStyle&&t.fontStyle!=="normal"&&(e["font-style"]=t.fontStyle),t.lineHeight!=null&&(e["line-height"]=b1(t.lineHeight)),t.letterSpacing&&(e["letter-spacing"]=M1(t.letterSpacing)),t.textTransform&&t.textTransform!=="none"&&(e["text-transform"]=t.textTransform),t.textDecoration&&t.textDecoration!=="none"&&(e["text-decoration"]=t.textDecoration),t.color&&(e.color=t.color),e},X=(t={})=>{var i,n,d,l;let r={},e=parseInt((i=t.width)!=null?i:0,10),a=(n=t.style)!=null?n:"solid";e>0&&a!=="none"&&(r.border=`${Lr(e)} ${a} ${(d=t.color)!=null?d:"#000"}`);let o=parseInt((l=t.radius)!=null?l:0,10);return o>0&&(r["border-radius"]=Lr(o)),r},xt=(t={})=>{var e,a,o,i,n;return t.enabled?{"box-shadow":`${t.inset?"inset ":""}${Lr((e=t.x)!=null?e:0)} ${Lr((a=t.y)!=null?a:2)} ${Lr((o=t.blur)!=null?o:4)} ${Lr((i=t.spread)!=null?i:0)} ${(n=t.color)!=null?n:"rgba(0,0,0,.15)"}`}:{}},b=t=>String(t!=null?t:"").replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),Z=t=>String(t!=null?t:"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");var y1=["h1","h2","h3","h4"],w1=(t,r)=>{var p,g,x,y,M,v,k;let e=t.attributes||{},a=y1.includes(e.tag)?e.tag:"h2",o=(p=e.text)!=null?p:"",i=(g=e.alignment)!=null?g:"left",n=(x=e.padding)!=null?x:[0,0,0,0],d=(y=e.margin)!=null?y:[0,0,0,0],l=(M=e.typography)!=null?M:{},c=(v=e.border)!=null?v:{},h=(k=r.fontFamily)!=null?k:"Arial, sans-serif",s=j({margin:R(d)}),u=j({padding:R(n),"text-align":i,...X(c)}),f=j({margin:"0","text-align":i,...dr(l,h)});return`<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="${b(s)}"><tr><td align="${b(i)}" style="${b(u)}"><${a} data-emb-editable="richtext" data-emb-merge-tags="off" data-emb-field="text" style="${b(f)}">`+o+`</${a}></td></tr></table>`},C1=(t,r)=>{var u,f,p,g,x,y,M;let e=t.attributes||{},a=(u=e.text)!=null?u:"",o=(f=e.alignment)!=null?f:"left",i=(p=e.padding)!=null?p:[0,0,0,0],n=(g=e.margin)!=null?g:[0,0,0,0],d=(x=e.typography)!=null?x:{},l=(y=e.border)!=null?y:{},c=(M=r.fontFamily)!=null?M:"Arial, sans-serif",h=j({margin:R(n)}),s=j({padding:R(i),"text-align":o,...dr(d,c),...X(l)});return`<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="${b(h)}"><tr><td align="${b(o)}" style="${b(s)}"><div data-emb-editable="richtext" data-emb-field="text">`+a+"</div></td></tr></table>"},B1=t=>{var d,l,c;let r=t.attributes||{},e=(d=r.html)!=null?d:"",a=(l=r.padding)!=null?l:[0,0,0,0],o=(c=r.margin)!=null?c:[0,0,0,0],i=j({margin:R(o)}),n=j({padding:R(a)});return`<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="${b(i)}"><tr><td style="${b(n)}">`+e+"</td></tr></table>"},W1=(t,r)=>{var L,w,B,H,W,S,N,V,A,z,G,O;let e=t.attributes||{},a=(L=e.text)!=null?L:"Click here",o=(w=e.href)!=null?w:"",i=(B=e.bg)!=null?B:"#0073e6",n=(H=e.padding)!=null?H:[12,24,12,24],d=(W=e.margin)!=null?W:[0,0,0,0],l=(S=e.alignment)!=null?S:"left",c=!!((N=e.openInNewTab)==null||N),h=!!((V=e.noFollow)!=null&&V),s=(A=e.typography)!=null?A:{},u=(z=e.border)!=null?z:{},f=(G=e.boxShadow)!=null?G:{},p=(O=r.fontFamily)!=null?O:"Arial, sans-serif",g=!!o&&o!=="#",x=j({width:"100%",margin:R(d)}),y=j({padding:"0","text-align":l}),M=j({background:i,padding:R(n),"mso-padding-alt":R(n),"text-align":"center",...X(u),...xt(f)}),v=j({display:"inline-block","text-decoration":"none",...dr(s,p)}),k=[];h&&k.push("nofollow"),k.push("noopener"),c&&k.push("noreferrer");let m=g?`<a href="${b(o)}" style="${b(v)}" rel="${b(k.join(" "))}" data-emb-editable="text" data-emb-field="text"${c?' target="_blank"':""}>${Z(a)}</a>`:`<span style="${b(v)}" data-emb-editable="text" data-emb-field="text">${Z(a)}</span>`;return`<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="${b(x)}"><tr><td align="${b(l)}" style="${b(y)}"><table role="presentation" align="${b(l)}" cellpadding="0" cellspacing="0" border="0" style="display:inline-block;border-collapse:separate;line-height:100%"><tr><td align="center" bgcolor="${b(i)}" style="${b(M)}">${m}</td></tr></table></td></tr></table>`},j1=t=>{var h,s,u,f,p,g;let r=t.attributes||{},e=(h=r.color)!=null?h:"#E2E8F0",a=parseInt((s=r.thickness)!=null?s:1,10),o=(u=r.style)!=null?u:"solid",i=parseInt((f=r.width)!=null?f:100,10),n=(p=r.alignment)!=null?p:"left",d=(g=r.padding)!=null?g:[16,0,16,0],l=j({padding:R(d)}),c=j({"border-top":`${a}px ${o} ${e}`,"line-height":"0","font-size":"0"});return`<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td align="${b(n)}" style="${b(l)}"><table role="presentation" align="${b(n)}" width="${i}%" cellpadding="0" cellspacing="0" border="0" style="${b(c)}"><tr><td style="height:0;line-height:0;font-size:0;">&nbsp;</td></tr></table></td></tr></table>`},S1=t=>{var o;let r=t.attributes||{},e=parseInt((o=r.height)!=null?o:24,10),a=j({height:`${e}px`,"line-height":`${e}px`,"font-size":"0"});return`<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td height="${e}" style="${b(a)}">&nbsp;</td></tr></table>`},H1=t=>{var x,y,M,v,k,m,L,w,B;let r=t.attributes||{},e=(x=r.src)!=null?x:"",a=(y=r.alt)!=null?y:"",o=(M=r.href)!=null?M:"",i=!!((v=r.openInNewTab)==null||v),n=parseInt((k=r.width)!=null?k:600,10),d=(m=r.alignment)!=null?m:"left",l=(L=r.padding)!=null?L:[0,0,0,0],c=(w=r.margin)!=null?w:[0,0,0,0],h=(B=r.border)!=null?B:{},s=d==="center"?"0 auto":d==="right"?"0 0 0 auto":"0 auto 0 0",u=!e||/via\.placeholder\.com|placehold\.co/i.test(String(e)),f=j({margin:R(c)}),p=j({padding:R(l),"text-align":d}),g;if(u){let H=j({display:"block",width:"100%","max-width":`${n}px`,margin:s,"box-sizing":"border-box",padding:"34px 16px",background:"#f1f5f9",border:"2px dashed #cbd5e1","border-radius":"6px",color:"#94a3b8","font-family":"Arial, sans-serif","font-size":"13px","font-weight":"600","text-align":"center"});g=`<div style="${b(H)}">`+'<svg xmlns="http://www.w3.org/2000/svg" width="34" height="34" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" style="display:block;margin:0 auto 8px;"><rect width="18" height="18" x="3" y="3" rx="2" ry="2"/><circle cx="9" cy="9" r="2"/><path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"/></svg>'+"Add an image</div>"}else{let H=j({display:"block",width:"100%","max-width":`${n}px`,margin:s,height:"auto",border:"0",outline:"none","text-decoration":"none",...X(h)});if(g=`<img src="${b(e)}" alt="${b(a)}" width="${n}" style="${b(H)}">`,o){let W=i?' target="_blank"':"";g=`<a href="${b(o)}"${W} rel="noopener noreferrer">${g}</a>`}}return`<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="${b(f)}"><tr><td align="${b(d)}" style="${b(p)}">`+g+"</td></tr></table>"},A1=/(?:youtu\.be\/|youtube\.com\/(?:watch\?v=|embed\/|shorts\/|v\/))([\w-]{11})/,V1=t=>{let r=String(t||"").match(A1);return r?`https://img.youtube.com/vi/${r[1]}/hqdefault.jpg`:""},D1=(t,r)=>(!t||/via\.placeholder\.com|placehold\.co/.test(String(t)))&&V1(r)||t,T1=t=>{var f,p,g,x,y,M,v;let r=t.attributes||{},e=(f=r.videoUrl)!=null?f:"",a=D1((p=r.thumbnail)!=null?p:"",e),o=(g=r.alt)!=null?g:"Watch video",i=(x=r.caption)!=null?x:"",n=parseInt((y=r.width)!=null?y:600,10),d=(M=r.alignment)!=null?M:"left",l=(v=r.padding)!=null?v:[0,0,0,0],c=j({padding:R(l),"text-align":d}),h=j({display:"block",width:"100%","max-width":`${n}px`,height:"auto",border:"0"}),s=`<img src="${b(a)}" alt="${b(o)}" width="${n}" style="${b(h)}">`;e&&(s=`<a href="${b(e)}" target="_blank" rel="noopener noreferrer">${s}</a>`);let u="";if(i){let k=j({display:"block","margin-top":"8px","font-size":"13px",color:"#64748B","text-align":d}),m=e?`<a href="${b(e)}" target="_blank" rel="noopener noreferrer" style="color:inherit;text-decoration:none;">${Z(i)}</a>`:Z(i);u=`<div style="${b(k)}">${m}</div>`}return`<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td align="${b(d)}" style="${b(c)}">${s}${u}</td></tr></table>`},vd=t=>String(t!=null?t:"").split(/(?:\r?\n|<br\s*\/?>)/i).map(r=>r.trim()).filter(r=>r!==""),R1=(t,r)=>{var S,N,V,A,z,G,O,U,vt,mt,Lt,tt,Ht;let e=t.attributes||{},a=(S=e.type)!=null?S:"unordered",o=(N=e.items)!=null?N:"",i=(V=e.alignment)!=null?V:"left",n=(A=e.markerStyle)!=null?A:"default",d=(z=e.markerColor)!=null?z:"",l=parseInt((G=e.itemSpacing)!=null?G:6,10),c=parseInt((O=e.indent)!=null?O:20,10),h=(U=e.bg)!=null?U:"",s=(vt=e.border)!=null?vt:{},u=(mt=e.padding)!=null?mt:[0,0,0,0],f=(Lt=e.margin)!=null?Lt:[0,0,0,0],p=(tt=e.typography)!=null?tt:{},g=(Ht=r.fontFamily)!=null?Ht:"Arial, sans-serif",x=a==="ordered"?"ol":"ul",y=n==="default"?a==="ordered"?"decimal":"disc":n,M=p.color,v=j({margin:`0 0 ${l}px 0`,...d?{color:d}:{}}),k=!!d&&!!M,m=k?j({color:M}):"",L=vd(o).map(It=>{let hr=k?`<span style="${b(m)}">${It}</span>`:It;return`<li style="${b(v)}">${hr}</li>`}).join(""),w=h&&h!=="transparent",B=j({margin:R(f)}),H=j({padding:R(u),"text-align":i,...w?{background:h}:{},...X(s),...dr(p,g)}),W=j({margin:"0","padding-left":`${c}px`,"list-style-type":y,"list-style-position":i==="left"?"outside":"inside"});return`<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="${b(B)}"><tr><td align="${b(i)}" style="${b(H)}"><${x} style="${b(W)}">${L}</${x}></td></tr></table>`},E1={facebook:{bg:"#1877F2",label:"f"},twitter:{bg:"#000000",label:"X"},instagram:{bg:"#E4405F",label:"ig"},linkedin:{bg:"#0A66C2",label:"in"},youtube:{bg:"#FF0000",label:"yt"},github:{bg:"#181717",label:"g"}},F1=t=>{var f,p,g,x,y;let r=t.attributes||{},e=parseInt((f=r.iconSize)!=null?f:36,10),a=parseInt((p=r.gap)!=null?p:8,10),o=(g=r.shape)!=null?g:"circle",i=(x=r.alignment)!=null?x:"left",n=(y=r.padding)!=null?y:[0,0,0,0],d=o==="circle"?e/2:o==="rounded"?Math.max(4,Math.floor(e/4)):0,l=Math.max(11,Math.floor(e/2)),c=Object.entries(E1).map(([M,v])=>{let k=r[M];if(!k)return null;let m=`<svg width="${e}" height="${e}" viewBox="0 0 ${e} ${e}" xmlns="http://www.w3.org/2000/svg" style="display:block"><rect width="${e}" height="${e}" rx="${d}" ry="${d}" fill="${b(v.bg)}"/><text x="${e/2}" y="${e/2+l*.35}" text-anchor="middle" fill="#FFFFFF" font-family="Arial, sans-serif" font-size="${l}" font-weight="700">${Z(v.label)}</text></svg>`;return`<td align="center">${`<a href="${b(k)}" target="_blank" rel="noopener noreferrer" style="display:block;text-decoration:none" title="${b(M.charAt(0).toUpperCase()+M.slice(1))}">${m}</a>`}</td>`}).filter(Boolean),h=`<td style="width:${a}px;line-height:1px;font-size:0">&nbsp;</td>`,s=c.join(h),u=j({padding:R(n),"text-align":i});return`<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td align="${b(i)}" style="${b(u)}"><table role="presentation" align="${b(i)}" cellpadding="0" cellspacing="0" border="0" style="display:inline-block;width:auto;border-collapse:separate"><tr>${s}</tr></table></td></tr></table>`},N1=(t,r)=>{var u,f,p,g,x,y;let e=t.attributes||{},a=(u=e.lines)!=null?u:"",o=(f=e.alignment)!=null?f:"left",i=(p=e.padding)!=null?p:[0,0,0,0],n=(g=e.margin)!=null?g:[0,0,0,0],d=(x=e.typography)!=null?x:{},l=(y=r.fontFamily)!=null?y:"Arial, sans-serif",c=vd(a).map(M=>`<div>${M}</div>`).join(""),h=j({margin:R(n)}),s=j({padding:R(i),"text-align":o,...dr(d,l)});return`<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="${b(h)}"><tr><td align="${b(o)}" style="${b(s)}">${c}</td></tr></table>`},z1=(t,r)=>{var g,x,y,M,v,k,m,L,w;let e=t.attributes||{},a=(g=e.greeting)!=null?g:"",o=(x=e.name)!=null?x:"",i=(y=e.title)!=null?y:"",n=(M=e.company)!=null?M:"",d=(v=e.alignment)!=null?v:"left",l=(k=e.padding)!=null?k:[0,0,0,0],c=(m=e.margin)!=null?m:[0,0,0,0],h=(L=e.typography)!=null?L:{},s=(w=r.fontFamily)!=null?w:"Arial, sans-serif",u="";a&&(u+=`<div style="margin-bottom:8px;">${Z(a)}</div>`),o&&(u+=`<div style="font-weight:700;">${Z(o)}</div>`),i&&(u+=`<div>${Z(i)}</div>`),n&&(u+=`<div style="opacity:.7;">${Z(n)}</div>`);let f=j({margin:R(c)}),p=j({padding:R(l),"text-align":d,...dr(h,s)});return`<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="${b(f)}"><tr><td align="${b(d)}" style="${b(p)}">${u}</td></tr></table>`},I1=(t,r)=>{var s,u,f,p,g,x;let e=t.attributes||{},a=(s=e.text)!=null?s:"",o=(u=e.alignment)!=null?u:"left",i=(f=e.padding)!=null?f:[0,0,0,0],n=(p=e.margin)!=null?p:[0,0,0,0],d=(g=e.typography)!=null?g:{},l=(x=r.fontFamily)!=null?x:"Arial, sans-serif",c=j({margin:R(n)}),h=j({padding:R(i),"text-align":o,...dr(d,l)});return`<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="${b(c)}"><tr><td align="${b(o)}" style="${b(h)}">${Z(a)}</td></tr></table>`},Ld=t=>{if(!t)return NaN;let r=new Date(t).getTime();if(Number.isFinite(r))return r;let e=String(t).trim().replace(" ","T");return new Date(e).getTime()},P1=t=>{let r=Ld(t);if(!Number.isFinite(r))return{days:0,hours:0,minutes:0,seconds:0};let e=Math.max(0,Math.floor((r-Date.now())/1e3));return{days:Math.floor(e/86400),hours:Math.floor(e%86400/3600),minutes:Math.floor(e%3600/60),seconds:e%60}},O1=t=>{let r=Ld(t);return Number.isFinite(r)?new Date(r).toLocaleString(void 0,{month:"long",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"}):t},_1=t=>String(t).padStart(2,"0"),$1=t=>{var s,u,f,p,g,x,y,M,v,k,m,L,w,B,H;let r=t.attributes||{},e=(s=r.mode)!=null?s:"boxes",a=(u=r.endDate)!=null?u:"",o=(f=r.linkUrl)!=null?f:"",i=(p=r.alignment)!=null?p:"left",n=(g=r.padding)!=null?g:[0,0,0,0],d=(x=r.margin)!=null?x:[0,0,0,0],l=j({margin:R(d)}),c=j({padding:R(n),"text-align":i}),h="";if(e==="image"){let W=(y=r.imageUrl)!=null?y:"",S=(M=r.labelPrefix)!=null?M:"Countdown";h=W?`<img src="${b(W)}" alt="${b(S)}" style="display:block;max-width:100%;border:0;outline:none;text-decoration:none;">`:'<span style="color:#94A3B8;font-size:12px;">[ Set a countdown image URL ]</span>'}else if(e==="text"){let W=(v=r.labelPrefix)!=null?v:"Offer ends in",S=O1(a);h=`<span style="font-family:Arial,sans-serif;font-size:14px;color:#0F172A;">${Z(W)}${W?" ":""}<strong>${Z(S)}</strong></span>`}else{let W=P1(a),S=(k=r.boxBg)!=null?k:"#0F172A",N=(m=r.boxColor)!=null?m:"#FFFFFF",V=parseInt((L=r.boxSize)!=null?L:64,10),A=parseInt((w=r.boxRadius)!=null?w:6,10),z=(B=r.labelColor)!=null?B:"#64748B",G=String((H=r.labels)!=null?H:"DAYS,HOURS,MINUTES,SECONDS").split(",").map(Lt=>Lt.trim());for(;G.length<4;)G.push("");let O=j({display:"inline-block",width:`${V}px`,height:`${V}px`,"line-height":`${V}px`,background:S,color:N,"border-radius":`${A}px`,"font-family":"Arial, sans-serif","font-size":`${Math.max(18,Math.floor(V/2.2))}px`,"font-weight":"700","text-align":"center"}),U=j({display:"block","margin-top":"6px","font-family":"Arial, sans-serif","font-size":"11px","font-weight":"600","letter-spacing":"1px",color:z}),mt=[W.days,W.hours,W.minutes,W.seconds].map(_1).map((Lt,tt)=>`<td align="center" style="padding:0 8px;"><div style="${b(O)}">${Z(Lt)}</div><span style="${b(U)}">${Z(G[tt])}</span></td>`).join("");h=`<table role="presentation" align="${b(i)}" cellpadding="0" cellspacing="0" border="0"><tr>${mt}</tr></table>`}return o&&(e==="image"||e==="boxes")&&(h=`<a href="${b(o)}" target="_blank" rel="noopener noreferrer" style="text-decoration:none;color:inherit;">${h}</a>`),`<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="${b(l)}"><tr><td align="${b(i)}" style="${b(c)}">${h}</td></tr></table>`},Va=t=>{var o,i,n,d,l,c,h;let r=t.attributes||{},e=parseInt((o=r.maxWidth)!=null?o:0,10)||0,a=parseInt((i=r.minHeight)!=null?i:0,10)||0;return j({background:(n=r.backgroundColor)!=null?n:"#FFFFFF",padding:R((d=r.padding)!=null?d:[24,24,24,24]),"text-align":(l=r.alignment)!=null?l:"left",...e>0?{"max-width":`${e}px`,"margin-left":"auto","margin-right":"auto"}:{},...a>0?{"min-height":`${a}px`}:{},...X((c=r.border)!=null?c:{}),...xt((h=r.boxShadow)!=null?h:{})})},Da=t=>{var e;let r=t.attributes||{};return j({width:"100%",margin:R((e=r.margin)!=null?e:[0,0,0,0])})},md=t=>{var e;let r=t.attributes||{};return j({width:"100%",margin:R((e=r.margin)!=null?e:[0,0,0,0])})},Md=t=>{var a,o;let r=t.attributes||{},e=(a=r.backgroundColor)!=null?a:"transparent";return j({padding:R((o=r.padding)!=null?o:[0,0,0,0]),...e&&e!=="transparent"?{background:e}:{}})};var Ta=t=>{let r=Math.max(1,t);return Math.round(100/r*1e4)/1e4},bd=(t,r,e)=>{var n,d;let a=t.attributes||{},o=parseInt((n=a.gap)!=null?n:16,10)||0,i=(d=a.valign)!=null?d:"top";return j({"vertical-align":i,"padding-left":`${r>0?Math.round(o/2):0}px`,"padding-right":`${r<e-1?Math.round(o/2):0}px`})},U1=t=>{var u,f,p,g,x,y,M;let r=t.attributes||{},e=(u=r.value)!=null?u:"",a=parseInt((f=r.size)!=null?f:120,10)||120,o=(p=r.fg)!=null?p:"#000000",i=(g=r.bg)!=null?g:"#FFFFFF",n=(x=r.alignment)!=null?x:"center",d=(y=r.padding)!=null?y:[8,0,8,0],l=(M=r.margin)!=null?M:[0,0,0,0],c=j({margin:R(l)}),h=j({padding:R(d),"text-align":n}),s=j({display:"inline-block",width:`${a}px`,height:`${a}px`,background:i,padding:`${Math.round(a*.06)}px`,"box-sizing":"border-box"});return`<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="${b(c)}"><tr><td align="${b(n)}" style="${b(h)}"><div data-emb-qr="${b(e)}" style="${b(s)}">${Z1(o,i)}</div></td></tr></table>`},Z1=(t,r)=>{let e=(o,i)=>`<rect x="${o}" y="${i}" width="7" height="7" fill="none" stroke="${b(t)}" stroke-width="1.4"/><rect x="${o+2}" y="${i+2}" width="3" height="3" fill="${b(t)}"/>`,a=[[13,1],[15,1],[17,3],[13,5],[19,5],[1,13],[3,13],[5,15],[7,13],[1,17],[13,13],[15,15],[17,13],[19,17],[13,19],[17,19],[15,11],[11,15]].map(([o,i])=>`<rect x="${o}" y="${i}" width="1.6" height="1.6" fill="${b(t)}"/>`).join("");return`<svg viewBox="0 0 22 22" width="100%" height="100%" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg"><rect width="22" height="22" fill="${b(r)}"/>`+e(0,0)+e(15,0)+e(0,15)+a+"</svg>"},Ra={heading:w1,text:C1,html:B1,button:W1,divider:j1,spacer:S1,image:H1,video:T1,list:R1,social:F1,address:N1,signature:z1,date:I1,timer:$1,qr:U1},Ea=new Set(["section"]);var yd=t=>{var e,a,o,i,n,d,l,c,h,s,u,f,p,g;let r=(a=(e=t==null?void 0:t.root)==null?void 0:e.attributes)!=null?a:{};return{bgColor:(o=r.bgColor)!=null?o:"#F1F5F9",contentBg:(i=r.contentBg)!=null?i:"#FFFFFF",contentWidth:parseInt((n=r.contentWidth)!=null?n:600,10),padding:Array.isArray(r.padding)?r.padding:[40,20,40,20],fontFamily:(d=r.fontFamily)!=null?d:"Arial, sans-serif",contentBorder:(l=r.contentBorder)!=null?l:null,contentBoxShadow:(c=r.contentBoxShadow)!=null?c:null,rootType:(s=(h=t==null?void 0:t.root)==null?void 0:h.type)!=null?s:"email",pageSize:(u=r.pageSize)!=null?u:null,orientation:(f=r.orientation)!=null?f:null,bgImage:(p=r.bgImage)!=null?p:null,bgSize:(g=r.bgSize)!=null?g:"cover"}};var mr=(t,r)=>{if(!t||typeof t!="object")return"";let e=t.type||"",a=Array.isArray(t.children)?t.children:[];if(e==="columns")return q1(t,r);if(e==="section"||Ea.has(e)){let i=a.map(l=>mr(l,r)).join(""),n=Da(t),d=Va(t);return`<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="${b(n)}"><tr><td style="${b(d)}">${i}</td></tr></table>`}let o=Ra[e];return o?o(t,r):a.map(i=>mr(i,r)).join("")},q1=(t,r)=>{let e=(t.children||[]).filter(d=>d.type==="column"),a=Math.max(1,e.length),o=Ta(a),i=t.attributes&&t.attributes.valign||"top",n=e.map((d,l)=>{let c=(d.children||[]).map(h=>mr(h,r)).join("");return`<td width="${o}%" valign="${b(i)}" style="width:${o}%;${bd(t,l,a)}">`+c+"</td>"}).join("");return`<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="${b(md(t))}"><tr><td style="${b(Md(t))}"><table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="width:100%"><tr>${n}</tr></table></td></tr></table>`},Fa=t=>{var v,k,m,L,w,B;let r=t&&t.root;if(!r||typeof r!="object")return"";let e=r.attributes||{},a=(v=e.bgColor)!=null?v:"#F1F5F9",o=(k=e.contentBg)!=null?k:"#FFFFFF",i=parseInt((m=e.contentWidth)!=null?m:600,10),n=Array.isArray(e.padding)?e.padding:[40,20,40,20],d=(L=e.fontFamily)!=null?L:"Arial, sans-serif",l=(w=e.contentBorder)!=null?w:{},c=(B=e.contentBoxShadow)!=null?B:{},h={fontFamily:d,contentWidth:i},s=(r.children||[]).map(H=>mr(H,h)).join(""),u=j({margin:"0",padding:"0",background:a,"font-family":d}),f=j({background:a}),p=j({width:"100%","max-width":`${i}px`,background:o,"font-family":d,...X(l),...xt(c)}),g=j({padding:R(n)}),x=`<!--[if mso | IE]><table role="presentation" align="center" border="0" cellpadding="0" cellspacing="0" width="${i}"><tr><td><![endif]-->`,y="<!--[if mso | IE]></td></tr></table><![endif]-->",M=typeof document!="undefined"&&document.documentElement&&document.documentElement.lang||"en";return`<!doctype html><html lang="${b(M)}" xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><meta name="x-apple-disable-message-reformatting"><title></title></head><body style="${b(u)}"><table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="${b(f)}"><tr><td align="center" style="padding:0">`+x+`<table role="presentation" align="center" width="100%" cellpadding="0" cellspacing="0" border="0" style="${b(p)}"><tr><td style="${b(g)}">`+s+"</td></tr></table>"+y+"</td></tr></table></body></html>"},Po=t=>{var g,x,y,M,v;let r=t&&t.root;if(!r||typeof r!="object")return"";let e=r.attributes||{},a=(g=e.contentBg)!=null?g:"#FFFFFF",o=parseInt((x=e.contentWidth)!=null?x:600,10),i=Array.isArray(e.padding)?e.padding:[40,20,40,20],n=(y=e.fontFamily)!=null?y:"Arial, sans-serif",d=(M=e.contentBorder)!=null?M:{},l=(v=e.contentBoxShadow)!=null?v:{},c={fontFamily:n,contentWidth:o},h=(r.children||[]).map(k=>mr(k,c)).join(""),s=j({width:"100%","max-width":`${o}px`,background:a,"font-family":n,margin:"0 auto",...X(d),...xt(l)}),u=j({padding:R(i)});return`<!--[if mso | IE]><table role="presentation" align="center" border="0" cellpadding="0" cellspacing="0" width="${o}"><tr><td><![endif]-->`+`<table role="presentation" align="center" width="100%" cellpadding="0" cellspacing="0" border="0" style="${b(s)}"><tr><td style="${b(u)}">`+h+"</td></tr></table>"+"<!--[if mso | IE]></td></tr></table><![endif]-->"};var wd={A4:[297,210],Letter:[279.4,215.9]},Cd=25.4/96,Ve=t=>{var d;let r=t&&t.attributes||{},[e,a]=wd[r.pageSize]||wd.A4,o=((d=r.orientation)!=null?d:"landscape")!=="portrait",i=o?e:a,n=o?a:e;return{wMm:i,hMm:n,wPx:Math.round(i/Cd),hPx:Math.round(n/Cd),ratio:i/n}},Oo=t=>{var a;let r=t&&t.attributes||{},e={background:(a=r.bgColor)!=null?a:"#FFFFFF"};if(r.bgImage){let o=r.bgSize==="contain"?"contain":r.bgSize==="stretch"?"100% 100%":"cover";e["background-image"]=`url("${String(r.bgImage).replace(/"/g,"&quot;")}")`,e["background-size"]=o,e["background-position"]="center center",e["background-repeat"]="no-repeat"}return e},G1=t=>{let r=t&&t.attributes||{},e=Array.isArray(r.padding)?r.padding:[48,56,48,56],a=Ve(t).wPx;return{fontFamily:r.fontFamily||"Poppins",contentWidth:a,innerWidth:Math.max(1,a-(e[1]||0)-(e[3]||0))}},Na=t=>{let r=t&&t.root;if(!r||typeof r!="object")return"";let e=r.attributes||{},a=G1(r),o=Array.isArray(e.padding)?e.padding:[48,56,48,56],i=e.contentBg&&e.contentBg!=="transparent"?e.contentBg:null,n=(r.children||[]).map(c=>mr(c,a)).join(""),d=j({width:"100%","font-family":a.fontFamily,...i?{background:i}:{}}),l=j({padding:R(o),"vertical-align":"top"});return`<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="${b(d)}"><tr><td style="${b(l)}">${n}</td></tr></table>`},_o=t=>{let r=t&&t.root;if(!r||typeof r!="object")return"";let{wMm:e,hMm:a,wPx:o}=Ve(r),i=j({position:"relative",width:`${e}mm`,height:`${a}mm`,margin:"0 auto",overflow:"hidden",...Oo(r)}),n=j({margin:"0",padding:"24px",background:"#64748b","text-align":"center"});return`<!doctype html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><style>.emb-cert-page{box-shadow:0 8px 30px rgba(0,0,0,.35);transform-origin:top center}.emb-cert-page table{border-collapse:collapse}</style></head><body style="${b(n)}"><div id="emb-cert-scale" style="display:inline-block"><div class="emb-cert-page" style="${b(i)}">${Na(t)}</div></div><script>(function(){var p=document.querySelector('.emb-cert-page');if(!p)return;function fit(){var s=Math.min(1,(window.innerWidth-48)/${o});p.style.transform='scale('+s+')';document.getElementById('emb-cert-scale').style.height=(p.offsetHeight*s)+'px';}window.addEventListener('resize',fit);fit();})();<\/script></body></html>`};import bh from"react";import Bd,{useMemo as Pa,useRef as $o,useEffect as Oa,useState as K1,useContext as X1}from"react";function Wd(t,r,e){let a=t.slice();return a.splice(e<0?a.length+e:e,0,a.splice(r,1)[0]),a}function Y1(t,r){return t.reduce((e,a,o)=>{let i=r.get(a);return i&&(e[o]=i),e},Array(t.length))}function za(t){return t!==null&&t>=0}function J1(t,r){if(t===r)return!0;if(t.length!==r.length)return!1;for(let e=0;e<t.length;e++)if(t[e]!==r[e])return!1;return!0}function Q1(t){return typeof t=="boolean"?{draggable:t,droppable:t}:t}var jd=t=>{let{rects:r,activeIndex:e,overIndex:a,index:o}=t,i=Wd(r,a,e),n=r[o],d=i[o];return!d||!n?null:{x:d.left-n.left,y:d.top-n.top,scaleX:d.width/n.width,scaleY:d.height/n.height}};var Ia={scaleX:1,scaleY:1},Sd=t=>{var r;let{activeIndex:e,activeNodeRect:a,index:o,rects:i,overIndex:n}=t,d=(r=i[e])!=null?r:a;if(!d)return null;if(o===e){let c=i[n];return c?{x:0,y:e<n?c.top+c.height-(d.top+d.height):c.top-d.top,...Ia}:null}let l=th(i,o,e);return o>e&&o<=n?{x:0,y:-d.height-l,...Ia}:o<e&&o>=n?{x:0,y:d.height+l,...Ia}:{x:0,y:0,...Ia}};function th(t,r,e){let a=t[r],o=t[r-1],i=t[r+1];return a?e<r?o?a.top-(o.top+o.height):i?i.top-(a.top+a.height):0:i?i.top-(a.top+a.height):o?a.top-(o.top+o.height):0:0}var Hd="Sortable",Ad=Bd.createContext({activeIndex:-1,containerId:Hd,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:jd,disabled:{draggable:!1,droppable:!1}});function Vd(t){let{children:r,id:e,items:a,strategy:o=jd,disabled:i=!1}=t,{active:n,dragOverlay:d,droppableRects:l,over:c,measureDroppableContainers:h}=So(),s=gr(Hd,e),u=d.rect!==null,f=Pa(()=>a.map(L=>typeof L=="object"&&"id"in L?L.id:L),[a]),p=n!=null,g=n?f.indexOf(n.id):-1,x=c?f.indexOf(c.id):-1,y=$o(f),M=!J1(f,y.current),v=x!==-1&&g===-1||M,k=Q1(i);Ct(()=>{M&&p&&h(f)},[M,f,p,h]),Oa(()=>{y.current=f},[f]);let m=Pa(()=>({activeIndex:g,containerId:s,disabled:k,disableTransforms:v,items:f,overIndex:x,useDragOverlay:u,sortedRects:Y1(f,l),strategy:o}),[g,s,k.draggable,k.droppable,v,f,x,l,u,o]);return Bd.createElement(Ad.Provider,{value:m},r)}var rh=t=>{let{id:r,items:e,activeIndex:a,overIndex:o}=t;return Wd(e,a,o).indexOf(r)},eh=t=>{let{containerId:r,isSorting:e,wasDragging:a,index:o,items:i,newIndex:n,previousItems:d,previousContainerId:l,transition:c}=t;return!c||!a||d!==i&&o===n?!1:e?!0:n!==o&&r===l},ah={duration:200,easing:"ease"},Dd="transform",oh=kt.Transition.toString({property:Dd,duration:0,easing:"linear"}),ih={roleDescription:"sortable"};function nh(t){let{disabled:r,index:e,node:a,rect:o}=t,[i,n]=K1(null),d=$o(e);return Ct(()=>{if(!r&&e!==d.current&&a.current){let l=o.current;if(l){let c=vr(a.current,{ignoreTransform:!0}),h={x:l.left-c.left,y:l.top-c.top,scaleX:l.width/c.width,scaleY:l.height/c.height};(h.x||h.y)&&n(h)}}e!==d.current&&(d.current=e)},[r,e,a,o]),Oa(()=>{i&&n(null)},[i]),i}function te(t){let{animateLayoutChanges:r=eh,attributes:e,disabled:a,data:o,getNewIndex:i=rh,id:n,strategy:d,resizeObserverConfig:l,transition:c=ah}=t,{items:h,containerId:s,activeIndex:u,disabled:f,disableTransforms:p,sortedRects:g,overIndex:x,useDragOverlay:y,strategy:M}=X1(Ad),v=dh(a,f),k=h.indexOf(n),m=Pa(()=>({sortable:{containerId:s,index:k,items:h},...o}),[s,o,k,h]),L=Pa(()=>h.slice(h.indexOf(n)),[h,n]),{rect:w,node:B,isOver:H,setNodeRef:W}=pa({id:n,data:m,disabled:v.droppable,resizeObserverConfig:{updateMeasurementsFor:L,...l}}),{active:S,activatorEvent:N,activeNodeRect:V,attributes:A,setNodeRef:z,listeners:G,isDragging:O,over:U,setActivatorNodeRef:vt,transform:mt}=ga({id:n,data:m,attributes:{...ih,...e},disabled:v.draggable}),Lt=Ri(W,z),tt=!!S,Ht=tt&&!p&&za(u)&&za(x),It=!y&&O,hr=It&&Ht?mt:null,Mt=d!=null?d:M,qe=Ht?hr!=null?hr:Mt({rects:g,activeNodeRect:V,activeIndex:u,overIndex:x,index:k}):null,Jt=za(u)&&za(x)?i({id:n,items:h,activeIndex:u,overIndex:x}):k,Zt=S==null?void 0:S.id,_=$o({activeId:Zt,items:h,newIndex:Jt,containerId:s}),le=h!==_.current.items,Pt=r({active:S,containerId:s,isDragging:O,isSorting:tt,id:n,index:k,items:h,newIndex:_.current.newIndex,previousItems:_.current.items,previousContainerId:_.current.containerId,transition:c,wasDragging:_.current.activeId!=null}),wr=nh({disabled:!Pt,index:k,node:B,rect:w});return Oa(()=>{tt&&_.current.newIndex!==Jt&&(_.current.newIndex=Jt),s!==_.current.containerId&&(_.current.containerId=s),h!==_.current.items&&(_.current.items=h)},[tt,Jt,s,h]),Oa(()=>{if(Zt===_.current.activeId)return;if(Zt!=null&&_.current.activeId==null){_.current.activeId=Zt;return}let Cr=setTimeout(()=>{_.current.activeId=Zt},50);return()=>clearTimeout(Cr)},[Zt]),{active:S,activeIndex:u,attributes:A,data:m,rect:w,index:k,newIndex:Jt,items:h,isOver:H,isSorting:tt,isDragging:O,listeners:G,node:B,overIndex:x,over:U,setNodeRef:Lt,setActivatorNodeRef:vt,setDroppableNodeRef:W,setDraggableNodeRef:z,transform:wr!=null?wr:qe,transition:qt()};function qt(){if(wr||le&&_.current.newIndex===k)return oh;if(!(It&&!Er(N)||!c)&&(tt||Pt))return kt.Transition.toString({...c,property:Dd})}}function dh(t,r){var e,a;return typeof t=="boolean"?{draggable:t,droppable:!1}:{draggable:(e=t==null?void 0:t.draggable)!=null?e:r.draggable,droppable:(a=t==null?void 0:t.droppable)!=null?a:r.droppable}}var pg=[I.Down,I.Right,I.Up,I.Left];import kh,{useContext as xh,useMemo as vh}from"react";import{useEffect as lh,useRef as Td,useState as ch}from"react";import{jsx as De,jsxs as Rd}from"react/jsx-runtime";function Uo({id:t,html:r,isDropTarget:e}){let{state:a,select:o,removeNode:i,startEditing:n,stopEditing:d,updateAttrs:l}=$(),{config:c}=E(),h=a.selectedId===t,s=a.editingId===t,[u,f]=ch(!1),p=(h||u)&&!s,{setNodeRef:g,attributes:x,listeners:y,transform:M,transition:v,isDragging:k,setActivatorNodeRef:m}=te({id:t,disabled:s}),L={transform:kt.Transform.toString(M),transition:v,opacity:k?.3:1,outline:h?"2px solid #0073e6":u?"1px solid rgba(0,115,230,.45)":"2px solid transparent",cursor:s?"text":"pointer"},w=Td(null),B=Td(null);lh(()=>{!w.current||s||B.current!==r&&(w.current.innerHTML=r,B.current=r)},[r,s]);let H=A=>{if(A.button!==0)return;let z=A.target.closest("[data-emb-editable]");z&&(s||(o(t),n(t),z.setAttribute("contenteditable","true"),z.dataset.embEditingActive="1"))},W=A=>{A.stopPropagation(),A.target.closest("a")&&A.preventDefault(),A.target.closest("[data-emb-editable]")||o(t)},S=A=>{let z=A.target.closest&&A.target.closest("[data-emb-editable]");if(!z||z.dataset.embEditingActive!=="1")return;let G=z.getAttribute("data-emb-editable"),O=z.getAttribute("data-emb-field")||"text",U=G==="richtext"?z.innerHTML:z.textContent;z.removeAttribute("contenteditable"),delete z.dataset.embEditingActive,d(),l(t,{[O]:U}),B.current=null},N=A=>{let z=A.target.closest&&A.target.closest("[data-emb-editable]");if(!z||z.dataset.embEditingActive!=="1")return;let G=z.getAttribute("data-emb-editable"),O=z.getAttribute("data-emb-field")||"text",U=G==="richtext"?z.innerHTML:z.textContent;l(t,{[O]:U})},V=A=>A.stopPropagation();return Rd("div",{ref:g,className:"relative outline-offset-[-1px]",style:L,"data-emb-id":t,onMouseDown:H,onClick:W,onBlur:S,onInput:N,onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),children:[e&&De("div",{className:"absolute -top-0.5 left-0 right-0 h-[3px] bg-[#0073e6] rounded-[2px] pointer-events-none z-[2]"}),Rd("div",{className:"emb-v2-block-toolbar absolute -top-3.5 right-0 gap-1 z-[3]",style:{display:p?"flex":"none"},onMouseDown:V,children:[De("span",{ref:m,...y,...x,onClick:V,title:c.drag_to_reorder,className:"inline-flex items-center justify-center w-[22px] h-[22px] rounded bg-[#0073e6] text-white text-[11px] font-bold border-0 cursor-pointer select-none",children:"\u22EE\u22EE"}),De("button",{type:"button",onClick:A=>{A.stopPropagation(),i(t)},title:c.delete_block,className:"inline-flex items-center justify-center w-[22px] h-[22px] rounded bg-[#ef4444] text-white text-[11px] font-bold border-0 cursor-pointer select-none",children:"\u2715"})]}),s&&De("div",{className:"absolute top-[-22px] left-0 bg-[#0073e6] text-white text-[10px] font-semibold px-1.5 py-0.5 rounded-[3px] z-[3] tracking-[.04em] uppercase",children:c.editing}),De("div",{ref:w})]})}import{useState as hh}from"react";import{jsx as Mr,jsxs as Ed}from"react/jsx-runtime";function Zo({node:t,isDropTarget:r,dropTargetId:e}){let{state:a,select:o,removeNode:i}=$(),{config:n}=E(),d=a.selectedId===t.id,l=a.editingId===t.id,[c,h]=hh(!1),s=(d||c)&&!l,{setNodeRef:u,attributes:f,listeners:p,transform:g,transition:x,isDragging:y,setActivatorNodeRef:M}=te({id:t.id,data:{kind:"section"},disabled:l}),v={transform:kt.Transform.toString(g),transition:x,opacity:y?.3:1,outline:d?"2px solid #0073e6":c?"1px solid rgba(0,115,230,.45)":"2px solid transparent"},k=m=>m.stopPropagation();return Ed("div",{ref:u,className:"relative outline-offset-[-1px] cursor-pointer",style:v,"data-emb-id":t.id,onClick:m=>{m.stopPropagation(),o(t.id)},onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),children:[r&&Mr("div",{className:"absolute -top-0.5 left-0 right-0 h-[3px] bg-[#0073e6] rounded-[2px] pointer-events-none z-[2]"}),Ed("div",{className:"emb-v2-section-toolbar absolute -top-3.5 right-0 gap-1 z-[3]",style:{display:s?"flex":"none"},onMouseDown:k,children:[Mr("span",{ref:M,...p,...f,onClick:k,title:n.drag_section,className:"inline-flex items-center justify-center w-[22px] h-[22px] rounded bg-[#0073e6] text-white text-[11px] font-bold border-0 cursor-pointer select-none",children:"\u22EE\u22EE"}),Mr("span",{className:"inline-flex items-center px-2 py-0 h-[22px] rounded bg-[#0073e6] text-white text-[10px] font-bold tracking-wider uppercase",children:n.section}),Mr("button",{type:"button",onClick:m=>{m.stopPropagation(),i(t.id)},title:n.delete_section,className:"inline-flex items-center justify-center w-[22px] h-[22px] rounded bg-[#ef4444] text-white text-[11px] font-bold border-0 cursor-pointer select-none",children:"\u2715"})]}),Mr("div",{style:{margin:sh(Da(t),"margin")},children:Mr("div",{style:Fd(Va(t)),onClick:k,children:Mr(Xt,{containerId:t.id,items:t.children||[],dropTargetId:e,emptyMessage:"Drag blocks into this section.",addInside:s})})})]})}function Fd(t){let r={};return t&&t.split(";").forEach(e=>{let a=e.indexOf(":");if(a<0)return;let o=e.slice(0,a).trim(),i=e.slice(a+1).trim();if(!o)return;let n=o.replace(/-([a-z])/g,(d,l)=>l.toUpperCase());r[n]=i}),r}function sh(t,r){return Fd(t)[r]}import{useState as uh}from"react";import{jsx as Yt,jsxs as zd}from"react/jsx-runtime";function qo({node:t,isDropTarget:r,dropTargetId:e}){var N;let{state:a,select:o,removeNode:i}=$(),{config:n}=E(),d=a.selectedId===t.id,[l,c]=uh(!1),h=d||l,{setNodeRef:s,attributes:u,listeners:f,transform:p,transition:g,isDragging:x,setActivatorNodeRef:y}=te({id:t.id,data:{kind:"columns"}}),M=t.attributes||{},v=(t.children||[]).filter(V=>V.type==="column"),k=Math.max(1,v.length),m=Ta(k),L=parseInt((N=M.gap)!=null?N:16,10)||0,w=M.backgroundColor&&M.backgroundColor!=="transparent"?M.backgroundColor:void 0,B=Array.isArray(M.padding)?M.padding:[0,0,0,0],H=Array.isArray(M.margin)?M.margin:[0,0,0,0],W={transform:kt.Transform.toString(p),transition:g,opacity:x?.3:1,outline:d?"2px solid #0073e6":l?"1px solid rgba(0,115,230,.45)":"2px solid transparent"},S=V=>V.stopPropagation();return zd("div",{ref:s,className:"relative outline-offset-[-1px] cursor-pointer",style:W,"data-emb-id":t.id,onClick:V=>{V.stopPropagation(),o(t.id)},onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),children:[r&&Yt("div",{className:"absolute -top-0.5 left-0 right-0 h-[3px] bg-[#0073e6] rounded-[2px] pointer-events-none z-[2]"}),zd("div",{className:"emb-v2-section-toolbar absolute -top-3.5 right-0 gap-1 z-[3]",style:{display:h?"flex":"none"},onMouseDown:S,children:[Yt("span",{ref:y,...f,...u,onClick:S,title:n.drag_columns,className:"inline-flex items-center justify-center w-[22px] h-[22px] rounded bg-[#0073e6] text-white text-[11px] font-bold border-0 cursor-pointer select-none",children:"\u22EE\u22EE"}),Yt("span",{className:"inline-flex items-center px-2 py-0 h-[22px] rounded bg-[#0073e6] text-white text-[10px] font-bold tracking-wider uppercase",children:n.columns}),Yt("button",{type:"button",onClick:V=>{V.stopPropagation(),i(t.id)},title:n.delete_columns,className:"inline-flex items-center justify-center w-[22px] h-[22px] rounded bg-[#ef4444] text-white text-[11px] font-bold border-0 cursor-pointer select-none",children:"\u2715"})]}),Yt("div",{style:{margin:Nd(H)},children:Yt("div",{className:"box-border",style:{padding:Nd(B),background:w},onClick:S,children:Yt("div",{className:"flex w-full",style:{alignItems:gh(M.valign)},children:v.map((V,A)=>Yt("div",{className:"box-border",style:{flexBasis:`${m}%`,maxWidth:`${m}%`,paddingLeft:Math.max(A>0?L/2:0,3),paddingRight:Math.max(A<k-1?L/2:0,3)},children:Yt(Xt,{containerId:V.id,items:V.children||[],dropTargetId:e,emptyMessage:"Drop here",compact:!0})},V.id))})})})]})}var Nd=t=>(Array.isArray(t)?t:[0,0,0,0]).map(r=>`${parseInt(r,10)||0}px`).join(" "),gh=t=>t==="middle"?"center":t==="bottom"?"flex-end":"flex-start";import{createContext as ph,useContext as fh}from"react";var Go=ph({blockRenderers:Ra}),Id=()=>fh(Go);import{jsx as Ko}from"react/jsx-runtime";function Xo({node:t,isDropTarget:r,dropTargetId:e}){let a=xh(Te),{blockRenderers:o}=Id();if(t.type==="columns")return Ko(qo,{node:t,isDropTarget:r,dropTargetId:e});if(Ea.has(t.type))return Ko(Zo,{node:t,isDropTarget:r,dropTargetId:e});let i=vh(()=>{let n=o[t.type];return n?n(t,a):""},[t,a,o]);return Ko(Uo,{id:t.id,html:i,isDropTarget:r})}var Te=kh.createContext({fontFamily:"Arial, sans-serif",contentWidth:600});import{useEffect as Od,useMemo as Mh,useRef as _d,useState as $d}from"react";import{createContext as Lh,useContext as mh}from"react";var Re=Lh({}),Pd=()=>mh(Re);import{jsx as Wt,jsxs as re}from"react/jsx-runtime";q();var Yo="text";function lr({blocks:t,containerId:r="root",compact:e=!1,variant:a,wrapStyle:o,suffix:i}){let{addChild:n}=$(),{config:d}=E(),l=Pd(),c=t||l,[h,s]=$d(!1),[u,f]=$d(""),p=_d(null),g=_d(null);Od(()=>{if(!h)return;let k=m=>{p.current&&!p.current.contains(m.target)&&s(!1)};return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[h]),Od(()=>{if(!h)return;f("");let k=window.setTimeout(()=>{var m;return(m=g.current)==null?void 0:m.focus()},0);return()=>window.clearTimeout(k)},[h]);let x=k=>{let m=c==null?void 0:c[k];m&&(n(r,Hr(k,m),-1),s(!1))},y=Mh(()=>Object.entries(c||{}).filter(([,k])=>!k.root&&!k.hidden).sort(([k],[m])=>k===Yo?-1:m===Yo?1:0),[c]),M=u.trim().toLowerCase(),v=M?y.filter(([k,m])=>(m.name||k).toLowerCase().includes(M)||k.toLowerCase().includes(M)):y;return re("div",{ref:p,className:`${T("emb-quick-add",i)} ${e?"is-compact":""} ${a?`is-${a}`:""}`,style:o,onClick:k=>k.stopPropagation(),children:[e?Wt("button",{type:"button",onClick:()=>s(k=>!k),className:"emb-plus-btn",title:d.insert_block,children:Wt(Vo,{size:16})}):re("div",{className:"emb-split-btn",children:[re("button",{type:"button",onClick:()=>x(Yo),className:"emb-split-main",title:d.add_a_text_block,children:[Wt(Vo,{size:14}),Wt("span",{children:d.add_block})]}),Wt("button",{type:"button",onClick:()=>s(k=>!k),className:"emb-split-caret",title:d.choose_a_block,children:Wt(Ca,{size:14})})]}),h&&re("div",{className:`${T("emb-quick-add-menu",i)} ${e?"is-compact":""}`,children:[re("div",{className:"emb-search",children:[Wt(va,{size:14}),Wt("input",{ref:g,type:"text",className:"emb-search-input",value:u,onChange:k=>f(k.target.value),onKeyDown:k=>{k.key==="Escape"&&s(!1),k.key==="Enter"&&v[0]&&x(v[0][0])},placeholder:d.search_blocks})]}),Wt("div",{className:"emb-menu-list",children:v.length===0?Wt("div",{className:"emb-lib-empty",children:d.no_blocks_found}):v.map(([k,m])=>{var H;let L=ja[k],w=m.name||k,B=(H=d["block_"+k])!=null?H:w;return re("button",{type:"button",onClick:()=>x(k),className:"emb-menu-item",children:[Wt("span",{className:"emb-menu-icon",children:L?Wt(L,{size:15}):B[0].toUpperCase()}),Wt("span",{children:B})]},k)})})]})]})}import{Fragment as wh,jsx as cr,jsxs as Ud}from"react/jsx-runtime";q();function Xt({containerId:t,items:r,dropTargetId:e,emptyMessage:a,compact:o=!1,addInside:i=!1,suffix:n}){let d=r.map(s=>s.id),l=`drop-end-${t}`,{setNodeRef:c,isOver:h}=pa({id:l,data:{source:"drop-end",containerId:t}});return cr(Vd,{id:`ctx-${t}`,items:d,strategy:Sd,children:d.length===0?Ud("div",{ref:c,className:`${T("emb-empty-drop",n)} ${o?"is-compact":""} ${h?"is-over":""}`,children:[cr(lr,{containerId:t,compact:o,variant:"centered",suffix:n}),!o&&a&&cr("div",{children:a})]}):Ud(wh,{children:[r.map(s=>cr(Xo,{node:s,isDropTarget:e===s.id,dropTargetId:e},s.id)),cr(yh,{ref:c,isOver:h,showLine:e===l}),i&&cr(lr,{containerId:t,compact:!0,variant:"append",suffix:n})]})})}var yh=bh.forwardRef(({isOver:t,showLine:r},e)=>cr("div",{ref:e,className:"relative h-3 my-0.5",children:(r||t)&&cr("div",{className:"absolute top-[5px] left-0 right-0 h-[3px] bg-[#0073e6] rounded-[2px]"})}));import{jsx as Ee,jsxs as jh}from"react/jsx-runtime";q();var Bh=t=>String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),Wh=t=>{let r={};return Object.entries(t||{}).forEach(([e,a])=>{r[e.replace(/-([a-z])/g,(o,i)=>i.toUpperCase())]=a}),r};function Jo({dropTargetId:t,blocks:r,suffix:e}){var p;let{state:a,select:o,addChild:i}=$(),{config:n}=E();Ch(()=>{let g=x=>{if(a.editingId)return;let y=x.target;if(y&&y.closest&&y.closest('input, textarea, select, [contenteditable="true"]'))return;let M=x.clipboardData;if(!M)return;let v=M.getData("text/html"),k=M.getData("text/plain"),m=[];v&&v.trim()?m=Yr(v,r):k&&k.trim()&&(m=k.split(/\n{2,}/).map(L=>L.trim()).filter(Boolean).map(L=>Yr(`<p>${Bh(L).replace(/\n/g,"<br>")}</p>`,r)[0]).filter(Boolean)),m.length&&(x.preventDefault(),m.forEach(L=>i("root",L,-1)))};return document.addEventListener("paste",g),()=>document.removeEventListener("paste",g)},[a.editingId,r,i]);let d=Zd(()=>yd(a.tree),[a.tree]),l=Zd(()=>({fontFamily:d.fontFamily,contentWidth:d.contentWidth}),[d.fontFamily,d.contentWidth]),c=Array.isArray(d.padding)?d.padding:[40,20,40,20],h=c.length===4&&c[0]===40&&c[1]===20&&c[2]===40&&c[3]===20,s={...X(d.contentBorder||{}),...xt(d.contentBoxShadow||{})},u=d.rootType==="certificate",f=(()=>{if(!u)return null;let g=Ve(a.tree.root);return{maxWidth:1040,width:"100%",aspectRatio:`${g.wMm} / ${g.hMm}`,padding:c.map(x=>`${x}px`).join(" "),fontFamily:d.fontFamily||"Poppins",overflow:"visible",...Wh(Oo(a.tree.root))}})();return Ee("div",{className:T("emb-canvas",e),style:!u&&d.bgColor&&String(d.bgColor).toUpperCase()!=="#F1F5F9"?{background:d.bgColor}:void 0,onClick:()=>o("root"),children:Ee("div",{className:`emb-canvas-page${u?" emb-canvas-page--certificate":""}`,style:u?f:{...d.contentWidth!==600?{maxWidth:d.contentWidth}:null,...d.contentBg&&String(d.contentBg).toUpperCase()!=="#FFFFFF"?{background:d.contentBg}:null,...d.fontFamily&&d.fontFamily!=="Arial, sans-serif"?{fontFamily:d.fontFamily}:null,...h?null:{padding:c.map(g=>`${g}px`).join(" ")},boxShadow:s["box-shadow"]||void 0,borderRadius:s["border-radius"]||void 0,border:s.border||void 0},onClick:g=>g.stopPropagation(),children:Ee(Re.Provider,{value:r||{},children:jh(Te.Provider,{value:l,children:[Ee(Xt,{containerId:"root",items:a.tree.root.children||[],dropTargetId:t,emptyMessage:n.drag_blocks_here,suffix:e}),((p=a.tree.root.children)==null?void 0:p.length)>0&&Ee(lr,{containerId:"root",suffix:e})]})})})})}import{useEffect as Rh,useLayoutEffect as Eh,useRef as e2,useState as Qo}from"react";var Q=(t,r=null)=>document.execCommand(t,!1,r),qd=(t,r)=>{document.execCommand("styleWithCSS",!1,!0),document.execCommand(t,!1,r),document.execCommand("styleWithCSS",!1,!1)},Gd=t=>Q("formatBlock",t),Kd=t=>typeof t=="string"&&/^(https?:\/\/|mailto:)\S+$/i.test(t.trim()),_a=t=>Q("insertHTML",t),Sh=(t,r)=>{let e=String(t).replace(/"/g,"%22"),a=(r==null?t:r).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");return`<a href="${e}">${a}</a>`},$a=(t=window.prompt)=>{let r=window.getSelection(),e=!r||r.rangeCount===0||r.getRangeAt(0).collapsed,a=Sa(t("Link URL:","https://"));!a||a==="https://"||(e?_a(Sh(a)):Q("createLink",a))},Xd=()=>{let t=window.getSelection();if(!t||t.rangeCount===0)return!1;let r=t.getRangeAt(0);if(!r.collapsed)return!1;let e=r.startContainer;if(e.nodeType!==3)return!1;let a=r.startOffset,i=e.textContent.slice(0,a).match(/(^|\s)((?:https?:\/\/|mailto:)[^\s]+)$/);if(!i)return!1;let n=i[2],d=a-n.length,l=document.createRange();return l.setStart(e,d),l.setEnd(e,a),t.removeAllRanges(),t.addRange(l),Q("createLink",n),t.collapseToEnd(),!0},Ua=()=>Q("unlink"),Za=t=>Q("insertText",t),Yd=(t,r)=>{let e=window.getSelection();if(!e||e.rangeCount===0)return;let a=e.getRangeAt(0),o=a.startContainer;if(o.nodeType===3&&t>0){let i=a.startOffset,n=Math.max(0,i-t),d=document.createRange();d.setStart(o,n),d.setEnd(o,i),e.removeAllRanges(),e.addRange(d)}Q("insertText",r)},Jd=t=>{if(!t)return;let r=String(t).replace(/"/g,"%22");_a(`<img src="${r}" alt="" style="max-width: 100%; height: auto;" />`)},Qd=()=>Q("removeFormat"),qa=()=>{let t=window.getSelection();return t&&t.rangeCount?t.getRangeAt(0).cloneRange():null},Ga=t=>{if(!t)return;let r=window.getSelection();r.removeAllRanges(),r.addRange(t)},Hh=new Set(["address","article","aside","blockquote","details","dialog","dd","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","li","main","nav","ol","p","section","table","thead","tbody","tfoot","tr","td","th","ul","video"]),Ah=new Set(["pre","textarea","script","style"]),Vh=" ",Dh=t=>!!t&&t.nodeType===1&&Hh.has(t.tagName.toLowerCase()),Th=t=>{let r=t.cloneNode(!1).outerHTML;return r.slice(0,r.indexOf(">")+1)},t2=(t,r)=>{let e=Vh.repeat(r);if(t.nodeType===3){let n=t.textContent.replace(/\s+/g," ").trim();return n?e+n:""}if(t.nodeType===8)return e+"<!--"+t.textContent+"-->";if(t.nodeType!==1)return"";let a=t.tagName.toLowerCase();if(Ah.has(a))return e+t.outerHTML;let o=Array.from(t.childNodes);if(!o.some(Dh))return e+t.outerHTML;let i=o.map(n=>t2(n,r+1)).filter(Boolean).join(`
136
- `);return e+Th(t)+`
134
+ .kzeditor-canvas-page--certificate{max-width:1040px;border-radius:4px;box-shadow:0 8px 30px rgba(0,0,0,.22)}
135
+ `,Vo=!1;function q(){if(Vo||typeof document=="undefined")return;if(document.getElementById(od)){Vo=!0;return}let t=document.createElement("style");t.id=od,t.textContent=Wc+(ad||""),document.head.appendChild(t),Vo=!0}import{jsx as _t,jsxs as Wa}from"react/jsx-runtime";q();var nd={heading:Un,text:jn,html:ba,button:Nn,divider:Pn,spacer:td,section:Zn,columns:qn,image:$r,video:wn,list:La,social:Hn,address:On,signature:Fn,date:Jn,timer:zn,qr:Rn},ja=nd;function zc({type:t,spec:r,suffix:e}){var s;let{attributes:a,listeners:o,setNodeRef:i,isDragging:n}=ga({id:`lib-${t}`,data:{source:"library",type:t}}),{config:d}=E(),l=nd[t],c=r.name||t,h=(s=d["block_"+t])!=null?s:c;return Wa("button",{ref:i,...o,...a,type:"button",className:`${D("kzeditor-v2-lib-item",e)} ${n?"is-dragging":""}`,children:[_t("span",{className:"inline-flex items-center justify-center text-inherit",children:l?_t(l,{size:20}):_t("span",{className:"font-bold text-base",children:h[0].toUpperCase()})}),_t("span",{className:"leading-[1.2]",children:h})]})}var Sc={fields:"Fields",structure:"Structure",content:"Content",media:"Media",other:"Other"},id=["fields","structure","content","media","other"];function Hc(t){let r={};return Object.entries(t||{}).forEach(([e,a])=>{if(a.root||a.hidden)return;let o=a.category||"other";r[o]||(r[o]=[]),r[o].push([e,a])}),r}function Do({blocks:t,suffix:r}){let{config:e}=E(),[a,o]=jc(""),i=a.trim().toLowerCase(),n=i?Object.fromEntries(Object.entries(t||{}).filter(([c,h])=>(h.name||c).toLowerCase().includes(i)||c.toLowerCase().includes(i))):t,d=Hc(n),l=id.some(c=>{var h;return(h=d[c])==null?void 0:h.length});return Wa("div",{className:D("kzeditor-block-library",r),children:[Wa("div",{className:D("kzeditor-search",r),children:[_t(va,{size:14}),_t("input",{type:"text",className:"kzeditor-search-input",value:a,onChange:c=>o(c.target.value),placeholder:e.search_blocks})]}),l?id.map(c=>{var u;let h=d[c];if(!h||h.length===0)return null;let s=Sc[c]||c;return Wa("div",{className:"mb-[18px]",children:[_t("div",{className:"kzeditor-category-label",children:(u=e["category_"+c])!=null?u:s}),_t("div",{className:"kzeditor-lib-grid",children:h.map(([k,p])=>_t(zc,{type:k,spec:p,suffix:r},k))})]},c)}):_t("div",{className:"kzeditor-lib-empty",children:e.no_blocks_found})]})}import{useState as pd}from"react";import{createContext as l1,useContext as c1}from"react";import{useEffect as Dc,useRef as To,useState as Tc}from"react";var Ac=/^[a-z][a-z0-9+.-]*:/i,Vc=/^[\w-]+(\.[\w-]+)+$/,za=t=>{let r=String(t!=null?t:"").trim();if(r===""||r.startsWith("#")||r.startsWith("{{")||Ac.test(r))return r;if(r.startsWith("//"))return`https:${r}`;if(r.startsWith("/"))return r;let e=r.split(/[/?#]/,1)[0];return Vc.test(e)?`https://${r}`:r};import{Fragment as cd,jsx as C,jsxs as P}from"react/jsx-runtime";var Ec="block text-[11px] font-semibold text-[#475569] uppercase tracking-[.04em] mb-1.5",dd="block text-[10px] text-[#64748b] mb-1",K="kzeditor-field-input",ld=({inputRef:t,value:r,onChange:e})=>{let a=ir(),{config:o}=E(),[i,n]=Tc(!1),d=To(null);if(Dc(()=>{if(!i)return;let c=h=>{d.current&&!d.current.contains(h.target)&&n(!1)};return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[i]),!a.length)return null;let l=c=>{let h=t.current,s=r!=null?r:"",u=h&&h.selectionStart!=null?h.selectionStart:s.length,k=h&&h.selectionEnd!=null?h.selectionEnd:u;e(s.slice(0,u)+c+s.slice(k)),n(!1),requestAnimationFrame(()=>{if(!h)return;h.focus();let p=u+c.length;try{h.setSelectionRange(p,p)}catch{}})};return P("div",{ref:d,className:"absolute top-[3px] right-[3px]",style:{position:"absolute",top:3,right:3},children:[C("button",{type:"button",title:o.insert_shortcode,onMouseDown:c=>{c.preventDefault(),n(h=>!h)},className:"kzeditor-merge-tag-trigger",children:C(Pr,{size:12})}),i&&C("div",{className:"kzeditor-merge-tag-menu",style:{position:"absolute",top:"100%",right:0,marginTop:4,zIndex:1002},children:a.map(c=>P("button",{type:"button",onMouseDown:h=>{h.preventDefault(),l(c.tag)},className:"kzeditor-merge-tag-item",children:[C("span",{className:"font-semibold",children:c.label||c.tag}),C("span",{style:{opacity:.55,marginLeft:"auto",paddingLeft:12,fontSize:11},children:c.tag})]},c.tag))})]})},ht=({label:t,children:r})=>P("label",{className:"block",children:[C("span",{className:Ec,children:t}),r]}),ot=({label:t,children:r,style:e})=>P("label",{className:"block",style:e,children:[C("span",{className:dd,children:t}),r]}),Rc=({label:t,value:r,onChange:e})=>{let a=To(null);return C(ht,{label:t,children:P("div",{className:"relative",children:[C("input",{ref:a,type:"text",className:"kzeditor-field-input",style:{paddingRight:30},value:r!=null?r:"",onChange:o=>e(o.target.value)}),C(ld,{inputRef:a,value:r,onChange:e})]})})},Fc=({label:t,value:r,onChange:e})=>{let a=To(null);return C(ht,{label:t,children:P("div",{className:"relative",children:[C("textarea",{ref:a,className:"kzeditor-field-input",style:{minHeight:70,paddingRight:30,resize:"vertical"},value:r!=null?r:"",onChange:o=>e(o.target.value)}),C(ld,{inputRef:a,value:r,onChange:e})]})})},Nc=({label:t,value:r,onChange:e})=>C(ht,{label:t,children:C("textarea",{className:"kzeditor-field-input",style:{minHeight:180,fontFamily:"monospace",fontSize:12,resize:"vertical",whiteSpace:"pre"},value:r!=null?r:"",onChange:a=>e(a.target.value),spellCheck:!1})}),Ic=({label:t,spec:r,value:e,onChange:a})=>{var o;return C(ht,{label:t,children:C("input",{type:"number",className:K,value:(o=e!=null?e:r.default)!=null?o:0,min:r.min,max:r.max,onChange:i=>{let n=Number(i.target.value);a(Number.isFinite(n)?n:0)}})})},Pc=({label:t,value:r,onChange:e})=>C(ht,{label:t,children:C(Sa,{value:r,onChange:e})}),Sa=({value:t,onChange:r})=>P("div",{className:"flex gap-2 items-center",children:[C("input",{type:"color",value:Oc(t),onChange:e=>r(e.target.value.toUpperCase()),className:"kzeditor-field-input shrink-0",style:{width:36,height:32,padding:0,flexShrink:0}}),C("input",{type:"text",className:`${K} flex-1`,value:t!=null?t:"",onChange:e=>r(e.target.value)})]}),Oc=t=>typeof t!="string"?"#000000":/^#[0-9a-fA-F]{6}$/.test(t)?t:/^#[0-9a-fA-F]{3}$/.test(t)?"#"+t.slice(1).split("").map(r=>r+r).join(""):"#000000",_c=({label:t,spec:r,value:e,onChange:a})=>{let o=fe(),{config:i}=E(),n=!!(r!=null&&r.media),d=async()=>{try{let l=await o({allowedTypes:["image"]});l&&l.url&&a(l.url)}catch{}};return C(ht,{label:t,children:P("div",{className:"flex gap-2 items-center",children:[C("input",{type:"url",className:`${K} flex-1`,value:e!=null?e:"",onChange:l=>a(l.target.value),onBlur:l=>{let c=za(l.target.value);c!==l.target.value&&a(c)},placeholder:"https://"}),n&&C("button",{type:"button",onClick:d,title:i.choose_from_media_library,className:"shrink-0 w-[34px] h-[34px] inline-flex items-center justify-center bg-white border border-solid border-[#cbd5e1] rounded text-[#475569] cursor-pointer",children:C(Cn,{size:14})})]})})},$c=t=>!t||/via\.placeholder\.com|placehold\.co/i.test(String(t)),Uc=({label:t,spec:r,value:e,onChange:a,node:o,updateAttrs:i})=>{var p,g;let n=fe(),{config:d}=E(),l=!$c(e),c=[{label:d.small,px:150},{label:d.medium,px:300},{label:d.large,px:450},{label:d.full,px:600}],h=async()=>{var x;try{let b=await n({allowedTypes:["image"]});if(b&&b.url){a(b.url);let m=(x=o==null?void 0:o.attributes)==null?void 0:x.alt;b.alt&&(!m||m==="Image")&&(i==null||i(o.id,{alt:b.alt}))}}catch{}},s=()=>a((r==null?void 0:r.default)||""),u=parseInt((g=(p=o==null?void 0:o.attributes)==null?void 0:p.width)!=null?g:600,10)||600,k=x=>{let b=Math.max(10,Math.min(1e3,parseInt(x,10)||0));i==null||i(o.id,{width:b})};return C(ht,{label:t,children:l?P(cd,{children:[P("div",{className:"border border-solid border-[#e2e8f0] rounded-md overflow-hidden bg-white",children:[C("img",{src:e,alt:"",className:"block w-full max-h-[160px] object-contain bg-[#f1f5f9]"}),P("div",{className:"flex border-0 border-t border-solid border-[#e2e8f0]",children:[P("button",{type:"button",onClick:h,title:d.replace_image,className:"flex-1 inline-flex items-center justify-center gap-1.5 py-2 px-1.5 bg-white border-none cursor-pointer text-xs font-semibold text-[#475569]",children:[C(Vn,{size:14}),C("span",{children:d.replace})]}),P("button",{type:"button",onClick:s,title:d.remove_image,className:"flex-1 inline-flex items-center justify-center gap-1.5 py-2 px-1.5 bg-white border-none cursor-pointer text-xs font-semibold text-[#b91c1c]",children:[C(Ir,{size:14}),C("span",{children:d.remove})]})]})]}),P("div",{className:"mt-3",children:[C("span",{className:dd,children:d.image_size}),C("div",{className:"grid grid-cols-4 gap-1.5",children:c.map(x=>{let b=u===x.px;return C("button",{type:"button",onClick:()=>k(x.px),className:b?"py-1.5 px-1 rounded text-xs font-semibold cursor-pointer bg-[#0073e6] border border-solid border-[#0073e6] text-white":"py-1.5 px-1 rounded text-xs font-semibold cursor-pointer bg-white border border-solid border-[#cbd5e1] text-[#475569]",children:x.label},x.px)})}),P("div",{className:"flex items-center gap-2 mt-2",children:[C("input",{type:"number",min:10,max:1e3,value:u,onChange:x=>k(x.target.value),className:"py-1.5 pl-2 pr-2 border border-solid border-[#cbd5e1] rounded text-[13px] bg-white box-border w-[90px]"}),C("span",{className:"text-xs text-[#64748b]",children:d.px_max_width})]})]})]}):P("button",{type:"button",onClick:h,className:"w-full flex flex-col items-center justify-center gap-1.5 py-[22px] px-3 bg-[#f8fafc] border border-dashed border-[#cbd5e1] rounded-md text-[#475569] cursor-pointer text-center",children:[C($r,{size:22}),C("span",{className:"text-[13px] font-semibold",children:d.upload_image}),C("span",{className:"text-[11px] text-[#94a3b8]",children:d.choose_from_the_media_library})]})})},Zc=({label:t,value:r,onChange:e})=>P("label",{className:"flex items-center gap-2 text-[13px] cursor-pointer",children:[C("input",{type:"checkbox",checked:!!r,onChange:a=>e(a.target.checked)}),C("span",{children:t})]}),qc=({label:t,spec:r,value:e,onChange:a})=>{var o;return C(ht,{label:t,children:C("select",{className:K,value:(o=e!=null?e:r.default)!=null?o:"",onChange:i=>a(i.target.value),children:(r.options||[]).map(i=>C("option",{value:i,children:i},i))})})},Gc=({label:t,value:r,onChange:e})=>{let a=Array.isArray(r)?[...r]:[0,0,0,0];for(;a.length<4;)a.push(0);return C(ht,{label:t,children:C("div",{className:"grid grid-cols-2 gap-1.5",children:["Top","Right","Bottom","Left"].map((i,n)=>C(ot,{label:i,children:C("input",{type:"number",className:K,value:a[n],onChange:d=>{let l=[...a];l[n]=Number(d.target.value)||0,e(l)}})},i))})})},Kc=[{value:"left",Icon:qr,title:"Left"},{value:"center",Icon:Gr,title:"Center"},{value:"right",Icon:Zr,title:"Right"},{value:"justify",Icon:rd,title:"Justify"}],Xc=({label:t,spec:r,value:e,onChange:a})=>{let o=r.options||["left","center","right"],i=Kc.filter(n=>o.includes(n.value));return C(ht,{label:t,children:C("div",{className:"kzeditor-toggle-group",children:i.map(({value:n,Icon:d,title:l})=>C("button",{type:"button",title:l,onClick:()=>a(n),className:`kzeditor-toggle-btn ${e===n?"is-active":""}`,children:C(d,{size:16})},n))})})},Yc=[{value:"inherit",label:"Inherit (page default)"},{value:"Arial, sans-serif",label:"Arial"},{value:"Helvetica, Arial, sans-serif",label:"Helvetica"},{value:"Georgia, serif",label:"Georgia"},{value:'"Times New Roman", Times, serif',label:"Times New Roman"},{value:"Verdana, Geneva, sans-serif",label:"Verdana"},{value:"Tahoma, Geneva, sans-serif",label:"Tahoma"},{value:'"Trebuchet MS", sans-serif',label:"Trebuchet MS"},{value:'"Courier New", Courier, monospace',label:"Courier New"}],Jc=["100","200","300","400","500","600","700","800","900"],Qc=({label:t,value:r,onChange:e})=>{var l,c,h,s,u,k;let a=r||{},{config:o}=E(),i=(p,g)=>e({...a,[p]:g}),n=p=>`kzeditor-style-btn ${p?"is-active":""}`.trim(),d={width:32,height:30};return C(ht,{label:t,children:P("div",{className:"flex flex-col gap-2",children:[C(ot,{label:"Font family",children:C("select",{className:K,value:(l=a.fontFamily)!=null?l:"inherit",onChange:p=>i("fontFamily",p.target.value),children:Yc.map(p=>C("option",{value:p.value,children:p.label},p.value))})}),P("div",{className:"grid grid-cols-2 gap-1.5",children:[C(ot,{label:"Size (px)",children:C("input",{type:"number",min:6,max:96,className:K,value:(c=a.fontSize)!=null?c:14,onChange:p=>i("fontSize",Number(p.target.value)||0)})}),C(ot,{label:"Line height",children:C("input",{type:"number",min:.5,max:5,step:.1,className:K,value:(h=a.lineHeight)!=null?h:1.5,onChange:p=>i("lineHeight",Number(p.target.value)||0)})})]}),C(ot,{label:"Color",children:C(Sa,{value:(s=a.color)!=null?s:"#000000",onChange:p=>i("color",p)})}),C(ot,{label:"Weight",children:P("div",{className:"flex items-center gap-1.5",children:[C("select",{className:`${K} flex-1`,value:(u=a.fontWeight)!=null?u:"400",onChange:p=>i("fontWeight",p.target.value),children:Jc.map(p=>C("option",{value:p,children:p},p))}),C("button",{type:"button",title:o.bold_700,className:n(a.fontWeight==="700"),style:d,onClick:()=>i("fontWeight",a.fontWeight==="700"?"400":"700"),children:C(Ur,{size:13})}),C("button",{type:"button",title:o.italic,className:n(a.fontStyle==="italic"),style:d,onClick:()=>i("fontStyle",a.fontStyle==="italic"?"normal":"italic"),children:C(_r,{size:13})})]})}),C(ot,{label:"Decoration",children:P("div",{className:"flex gap-1.5",children:[C("button",{type:"button",title:o.underline,className:`${n(a.textDecoration==="underline")} flex-1`,style:{height:30},onClick:()=>i("textDecoration",a.textDecoration==="underline"?"none":"underline"),children:C(Nr,{size:13})}),C("button",{type:"button",title:o.line_through,className:`${n(a.textDecoration==="line-through")} flex-1`,style:{height:30},onClick:()=>i("textDecoration",a.textDecoration==="line-through"?"none":"line-through"),children:C(Or,{size:13})})]})}),C(ot,{label:"Transform",children:P("div",{className:"flex gap-1.5",children:[C("button",{type:"button",title:o.none,className:`${n(!a.textTransform||a.textTransform==="none")} flex-1`,style:{height:30},onClick:()=>i("textTransform","none"),children:C(Xn,{size:13})}),C("button",{type:"button",title:o.uppercase,className:`${n(a.textTransform==="uppercase")} flex-1`,style:{height:30},onClick:()=>i("textTransform","uppercase"),children:C(Kn,{size:13})}),C("button",{type:"button",title:o.lowercase,className:`${n(a.textTransform==="lowercase")} flex-1`,style:{height:30},onClick:()=>i("textTransform","lowercase"),children:C(Yn,{size:13})}),C("button",{type:"button",title:o.capitalize,className:`${n(a.textTransform==="capitalize")} flex-1`,style:{height:30,fontSize:11,fontWeight:600},onClick:()=>i("textTransform","capitalize"),children:"Aa"})]})}),C(ot,{label:"Letter spacing (px)",children:C("input",{type:"number",min:-10,max:20,step:.5,className:K,value:(k=a.letterSpacing)!=null?k:0,onChange:p=>i("letterSpacing",Number(p.target.value)||0)})})]})})},t1=["solid","dashed","dotted","double","none"],r1=({label:t,value:r,onChange:e})=>{var i,n,d,l;let a=r||{},o=(c,h)=>e({...a,[c]:h});return C(ht,{label:t,children:P("div",{className:"flex flex-col gap-2",children:[P("div",{className:"grid grid-cols-2 gap-1.5",children:[C(ot,{label:"Width (px)",children:C("input",{type:"number",min:0,max:20,className:K,value:(i=a.width)!=null?i:0,onChange:c=>o("width",Number(c.target.value)||0)})}),C(ot,{label:"Style",children:C("select",{className:K,value:(n=a.style)!=null?n:"solid",onChange:c=>o("style",c.target.value),children:t1.map(c=>C("option",{value:c,children:c},c))})})]}),C(ot,{label:"Color",children:C(Sa,{value:(d=a.color)!=null?d:"#000000",onChange:c=>o("color",c)})}),C(ot,{label:"Radius (px)",children:C("input",{type:"number",min:0,max:999,className:K,value:(l=a.radius)!=null?l:0,onChange:c=>o("radius",Number(c.target.value)||0)})})]})})},e1=({label:t,value:r,onChange:e})=>{var d,l,c,h,s;let a=r||{},{config:o}=E(),i=(u,k)=>e({...a,[u]:k}),n=!!a.enabled;return C(ht,{label:t,children:P("div",{className:"flex flex-col gap-2",children:[P("label",{className:"flex items-center gap-2 text-xs cursor-pointer",children:[C("input",{type:"checkbox",checked:n,onChange:u=>i("enabled",u.target.checked)}),C("span",{children:o.enable_shadow})]}),n&&P(cd,{children:[P("div",{className:"grid grid-cols-2 gap-1.5",children:[C(ot,{label:"X (px)",children:C("input",{type:"number",min:-50,max:50,className:K,value:(d=a.x)!=null?d:0,onChange:u=>i("x",Number(u.target.value)||0)})}),C(ot,{label:"Y (px)",children:C("input",{type:"number",min:-50,max:50,className:K,value:(l=a.y)!=null?l:2,onChange:u=>i("y",Number(u.target.value)||0)})}),C(ot,{label:"Blur (px)",children:C("input",{type:"number",min:0,max:100,className:K,value:(c=a.blur)!=null?c:4,onChange:u=>i("blur",Number(u.target.value)||0)})}),C(ot,{label:"Spread (px)",children:C("input",{type:"number",min:-50,max:50,className:K,value:(h=a.spread)!=null?h:0,onChange:u=>i("spread",Number(u.target.value)||0)})})]}),C(ot,{label:"Color",children:C(Sa,{value:(s=a.color)!=null?s:"rgba(0,0,0,.15)",onChange:u=>i("color",u)})}),P("label",{className:"flex items-center gap-2 text-xs cursor-pointer",children:[C("input",{type:"checkbox",checked:!!a.inset,onChange:u=>i("inset",u.target.checked)}),C("span",{children:o.inset})]})]})]})})},a1=t=>String(t!=null?t:"").toLowerCase().replace(/[^a-z0-9_]+/g,"_").replace(/^_+|_+$/g,""),o1=({label:t,value:r,onChange:e})=>C(ht,{label:t,children:C("input",{type:"text",className:K,value:r!=null?r:"",onChange:a=>e(a1(a.target.value)),placeholder:"field_name",spellCheck:!1})}),i1=({label:t,value:r,onChange:e})=>{let{config:a}=E(),o=Array.isArray(r)?r:[],i=c=>e(c),n=(c,h,s)=>i(o.map((u,k)=>k===c?{...u,[h]:s}:u)),d=()=>i([...o,{label:`Option ${o.length+1}`,value:`option-${o.length+1}`}]),l=c=>i(o.filter((h,s)=>s!==c));return C(ht,{label:t,children:P("div",{className:"flex flex-col gap-1.5",children:[o.map((c,h)=>{var s,u;return P("div",{className:"flex gap-1 items-center",children:[C("input",{className:`${K} flex-1`,placeholder:a.label,value:(s=c.label)!=null?s:"",onChange:k=>n(h,"label",k.target.value)}),C("input",{className:`${K} flex-1`,placeholder:a.value,value:(u=c.value)!=null?u:"",onChange:k=>n(h,"value",k.target.value)}),C("button",{type:"button",onClick:()=>l(h),title:a.remove_option,className:"shrink-0 w-7 h-[30px] border border-solid border-[#cbd5e1] bg-white rounded text-[#ef4444] cursor-pointer",children:"\u2715"})]},h)}),P("button",{type:"button",onClick:d,className:"py-1.5 px-2.5 border border-dashed border-[#cbd5e1] bg-white rounded text-[#0073e6] text-xs font-semibold cursor-pointer",children:["+ ",a.add_option]})]})})},n1=t=>{if(!t)return"";let r=new Date(String(t).trim().replace(" ","T"));if(Number.isNaN(r.getTime()))return"";let e=a=>String(a).padStart(2,"0");return`${r.getFullYear()}-${e(r.getMonth()+1)}-${e(r.getDate())}T${e(r.getHours())}:${e(r.getMinutes())}`},d1=({label:t,value:r,onChange:e})=>C(ht,{label:t,children:C("input",{type:"datetime-local",className:K,value:n1(r),onChange:a=>e(a.target.value?`${a.target.value}:00`:"")})}),Xr={string:Rc,datetime:d1,richtext:Fc,html:Nc,number:Ic,color:Pc,url:_c,image:Uc,boolean:Zc,select:qc,spacing:Gc,alignment:Xc,typography:Qc,border:r1,boxShadow:e1,fieldName:o1,options:i1};var Eo=l1(Xr),hd=()=>c1(Eo);var sd={H1:"h1",H2:"h2",H3:"h3",H4:"h4",H5:"h4",H6:"h4"},h1=new Set(["P","DIV","SECTION","ARTICLE","H1","H2","H3","H4","H5","H6","UL","OL","HR","IMG","FIGURE","BLOCKQUOTE","TABLE","PRE"]),s1=new Set(["SPAN","STRONG","EM","B","I","U","A","FONT","SMALL","MARK","CODE","SUB","SUP","BR"]),Et=(t,r,e)=>{let a=t==null?void 0:t[r];if(!a)return null;let o=Sr(r,a);return o.attributes={...o.attributes,...e},o},ud=(t,r)=>{let e=String(r||"").trim();return e?Et(t,"html",{html:e}):null},Ha=(t,r)=>{let e=t.getAttribute("src")||"";if(!e)return null;let a={src:e,alt:t.getAttribute("alt")||""},o=parseInt(t.getAttribute("width")||"",10);Number.isFinite(o)&&o>0&&(a.width=o);let i=t.closest("a");return i&&i.getAttribute("href")&&(a.href=i.getAttribute("href")),Et(r,"image",a)},u1=(t,r)=>{let e=Array.from(t.children).filter(a=>a.tagName==="LI").map(a=>a.textContent.trim()).filter(Boolean);return e.length?Et(r,"list",{type:t.tagName==="OL"?"ordered":"unordered",items:e.join(`
136
+ `)}):null},g1=(t,r,e)=>{let a=t.tagName;if(sd[a]){let o=t.innerHTML.trim();o&&t.textContent.trim()&&e.push(Et(r,"heading",{text:o,tag:sd[a]}));return}if(a==="IMG"){e.push(Ha(t,r));return}if(a==="FIGURE"){let o=t.querySelector("img");e.push(o?Ha(o,r):ud(r,t.outerHTML));return}if(a==="UL"||a==="OL"){e.push(u1(t,r));return}if(a==="HR"){e.push(Et(r,"divider",{}));return}if(a==="P"){let o=t.querySelector("img");if(o&&!t.textContent.trim()){e.push(Ha(o,r));return}if(!t.textContent.trim())return;e.push(Et(r,"text",{text:t.innerHTML.trim()}));return}if(a==="BLOCKQUOTE"){let o=t.innerHTML.trim();o&&e.push(Et(r,"text",{text:o}));return}if(a==="A"){let o=t.querySelector("img");if(o&&!t.textContent.trim()){e.push(Ha(o,r));return}t.textContent.trim()&&e.push(Et(r,"text",{text:t.outerHTML.trim()}));return}if(a==="DIV"||a==="SECTION"||a==="ARTICLE"||a==="BODY"){if(Array.from(t.children).some(i=>h1.has(i.tagName))){gd(t,r,e);return}t.textContent.trim()&&e.push(Et(r,"text",{text:t.innerHTML.trim()}));return}if(s1.has(a)){(t.textContent.trim()||t.querySelector("img"))&&e.push(Et(r,"text",{text:t.outerHTML.trim()}));return}e.push(ud(r,t.outerHTML))};function gd(t,r,e){t.childNodes.forEach(a=>{if(a.nodeType===3){let o=a.textContent.trim();o&&e.push(Et(r,"text",{text:o}));return}a.nodeType===1&&g1(a,r,e)})}function Yr(t,r){if(!t||typeof t!="string"||!r)return[];let e;try{e=new DOMParser().parseFromString(t,"text/html")}catch{return[]}e.querySelectorAll("style, meta, title, link, script").forEach(n=>n.remove());let a=e.body,o=a.querySelector('b[id^="docs-internal-guid"]');o&&(a=o);let i=[];return gd(a,r,i),i.filter(Boolean)}import{jsx as st,jsxs as Jr}from"react/jsx-runtime";var p1=new Set(["advanced"]);function Fo({blocks:t,suffix:r}){var L,w;let{updateAttrs:e,removeNode:a,replaceNode:o}=$(),i=Ye(),{config:n}=E(),d=[{key:"content",label:n.content,groups:["content"]},{key:"style",label:n.style,groups:["style","border","effects"]},{key:"advanced",label:n.advanced,groups:["spacing","advanced"]}],l={content:n.content,style:n.style,spacing:n.spacing_layout,border:n.border,effects:n.effects,advanced:n.advanced},c=()=>{var S;let B=Yr(((S=i==null?void 0:i.attributes)==null?void 0:S.html)||"",t);if(!B.length){alert(n.nothing_to_convert);return}o(i.id,B)},h=hd(),[s,u]=pd(null);if(!i)return st("div",{className:Ro,children:n.select_block_hint});let k=t[i.type];if(!k)return Jr("div",{className:Ro,children:[n.unknown_block,": ",i.type]});let p=i.id==="root",g=k1(k.attributes||{}),x=d.filter(B=>B.groups.some(S=>g[S]&&g[S].length)),b=s&&x.some(B=>B.key===s)?s:(w=(L=x[0])==null?void 0:L.key)!=null?w:"content",m=B=>st("div",{className:"flex flex-col gap-3.5",children:B.map(({key:S,spec:W})=>{var F,A,H;let z=h[W.type]||h.string;return st(z,{label:W.label&&((F=n[W.label])!=null?F:W.label)||x1(S),spec:W,value:(H=(A=i.attributes)==null?void 0:A[S])!=null?H:W.default,onChange:N=>e(i.id,{[S]:N}),node:i,updateAttrs:e},S)})}),v=x.find(B=>B.key===b)||x[0]||d[0],f=v.groups.filter(B=>g[B]&&g[B].length),M=f.length===1;return Jr("div",{children:[st("div",{className:D("kzeditor-inspector-tabs",r),role:"tablist",children:x.map(B=>st("button",{type:"button",role:"tab",onClick:()=>u(B.key),className:`${D("kzeditor-inspector-tab",r)} ${B.key===v.key?"is-active":""}`,children:B.label},B.key))}),Jr("div",{className:"py-2",children:[f.length===0&&st("div",{className:Ro,children:n.no_options_in_this_tab}),f.map(B=>M?st("div",{className:"pt-2 px-4 pb-3",children:m(g[B])},B):st(f1,{title:l[B]||B,defaultOpen:!p1.has(B),children:m(g[B])},B)),i.type==="html"&&Jr("div",{className:"pt-3 px-4",children:[st("button",{type:"button",onClick:c,className:"kzeditor-inspector-btn-primary",children:n.convert_to_blocks}),st("p",{className:"mt-2 mx-0.5 mb-0 text-[11px] leading-[1.5] text-[#94a3b8]",children:n.parse_html_help_text})]}),!p&&st("div",{className:"pt-3 px-4 pb-5",children:st("button",{type:"button",onClick:()=>{confirm(n.delete_this_block)&&a(i.id)},className:"kzeditor-inspector-btn-danger",children:n.delete_block})})]})]})}var Ro="p-6 text-[13px] text-[#94a3b8] text-center";function k1(t){let r={};return Object.entries(t).forEach(([e,a])=>{if(a.hidden)return;let o=a.group||"content";r[o]||(r[o]=[]),r[o].push({key:e,spec:a})}),r}function f1({title:t,defaultOpen:r,children:e}){let[a,o]=pd(r);return Jr("div",{className:"border-0 border-b border-solid border-[#f1f5f9]",children:[Jr("button",{type:"button",onClick:()=>o(i=>!i),className:"w-full flex items-center gap-1.5 py-2.5 px-4 bg-transparent border-none cursor-pointer text-[11px] font-bold tracking-[.05em] text-[#475569] uppercase",children:[a?st(Ca,{size:12}):st(wa,{size:12}),st("span",{children:t})]}),a&&st("div",{className:"pt-1 px-4 pb-4",children:e})]})}function x1(t){return t.replace(/([A-Z])/g," $1").replace(/^./,r=>r.toUpperCase())}import{Fragment as kd,jsx as Rt,jsxs as Qr}from"react/jsx-runtime";q();function ze({blocks:t,width:r,navOpen:e=!1,onToggleNav:a,suffix:o}){var v,f,M,L;let{state:i,select:n}=$(),d=Ye(),{config:l}=E(),[c,h]=L1("blocks");v1(()=>{i.selectedId&&i.selectedId!=="root"&&h("settings")},[i.selectedId]);let s=d&&t[d.type],u=(s==null?void 0:s.name)||(d==null?void 0:d.type),k=u?(v=l["block_"+d.type])!=null?v:u:l.settings,p=(M=(f=i.tree)==null?void 0:f.root)==null?void 0:M.type,g=t[p],x=g!=null&&g.name?`${(L=l["block_"+p])!=null?L:g.name} ${l.settings}`:l.email_settings,b=Rt("button",{type:"button",title:x,onClick:()=>{n("root"),h("settings")},className:`kzeditor-icon-btn ${c==="settings"&&i.selectedId==="root"?"is-active":""}`,children:Rt(An,{size:15})}),m=a?Rt("button",{type:"button",onClick:a,className:`kzeditor-icon-btn ${e?"is-active":""}`,title:l.toggle_navigator,children:Rt(_n,{size:15})}):null;return Qr("aside",{className:D("kzeditor-left-panel",o),style:r!=null?{width:r}:void 0,children:[Rt("header",{className:D("kzeditor-panel-header",o),children:c==="settings"?Qr(kd,{children:[Qr("button",{type:"button",onClick:()=>h("blocks"),className:"kzeditor-back-btn",title:l.back_to_blocks,children:[Rt(Gn,{size:16}),Rt("span",{className:"kzeditor-panel-title",children:k})]}),Qr("div",{className:"flex gap-1.5",children:[m,b]})]}):Qr(kd,{children:[Rt("span",{className:"kzeditor-panel-title",children:l.blocks}),Qr("div",{className:"flex gap-1.5",children:[m,b]})]})}),Rt("div",{className:"kzeditor-panel-scroll",children:c==="settings"?Rt(Fo,{blocks:t,suffix:o}):Rt(Do,{blocks:t,suffix:o})})]})}import"react";import{useState as No}from"react";import{jsx as Ft,jsxs as fd}from"react/jsx-runtime";var m1=new Set(["section","columns","column"]);function Io({blocks:t}){let{state:r,select:e,moveNode:a,removeNode:o}=$(),{config:i}=E(),[n,d]=No(null),[l,c]=No(null),[h,s]=No(null),u=()=>{d(null),c(null),s(null)},k=(m,v)=>{if(!m||m===v)return!1;let f=Kt(r.tree.root,m);return!!(f&&Kt(f,v))},p=m=>{if(n&&n!==m&&!k(n,m)){let v=or(r.tree.root,m);if(v){let f=v.container===r.tree.root?"root":v.container.id;a(n,f,v.index)}}u()},g=m=>{n&&n!==m&&!k(n,m)&&a(n,m,-1),u()},x=(m,v)=>m.map(f=>{var A;let M=t[f.type]||{},L=ja[f.type],w=m1.has(f.type),B=f.type==="column",S=r.selectedId===f.id,W=M.name||f.type,z=(A=i["block_"+f.type])!=null?A:W,F=f.children||[];return fd("div",{children:[fd("div",{draggable:!B,onDragStart:H=>{H.stopPropagation(),d(f.id)},onDragEnd:u,onDragOver:H=>{H.preventDefault(),H.stopPropagation(),B||c(f.id)},onDrop:H=>{H.preventDefault(),H.stopPropagation(),B?g(f.id):p(f.id)},onClick:H=>{H.stopPropagation(),e(f.id)},style:M1(v,S,l===f.id,B),title:z,children:[w?Ft(wa,{size:12,className:"shrink-0 opacity-50"}):Ft("span",{className:"w-3 shrink-0"}),Ft("span",{className:"inline-flex shrink-0",children:L?Ft(L,{size:13}):null}),Ft("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap",children:z}),!B&&Ft("button",{type:"button",onClick:H=>{H.stopPropagation(),o(f.id)},className:"shrink-0 inline-flex items-center justify-center w-5 h-5 border-0 bg-transparent text-inherit opacity-60 cursor-pointer rounded-[3px]",title:i.delete,children:Ft(Ir,{size:12})})]}),w&&Ft("div",{onDragOver:H=>{H.preventDefault(),H.stopPropagation(),s(f.id)},onDrop:H=>{H.preventDefault(),H.stopPropagation(),g(f.id)},children:F.length>0?x(F,v+1):Ft("div",{style:y1(v+1,h===f.id),children:i.empty_drop_here})})]},f.id)}),b=r.tree.root.children||[];return Ft("div",{className:"py-2 px-1.5",onDragEnd:u,children:b.length===0?Ft("div",{className:"p-6 text-center text-xs text-[var(--kzeditor-text-muted,#94a3b8)]",children:i.no_blocks_yet}):x(b,0)})}var M1=(t,r,e,a)=>({display:"flex",alignItems:"center",gap:6,padding:"5px 6px",paddingLeft:6+t*14,marginBottom:2,borderRadius:4,cursor:a?"default":"grab",fontSize:12,color:r?"#fff":"var(--kzeditor-text-secondary, #334155)",background:r?"#0073e6":e?"#e0efff":"transparent",borderTop:e?"2px solid #0073e6":"2px solid transparent",userSelect:"none"}),y1=(t,r)=>({margin:"2px 6px 4px",marginLeft:6+t*14,padding:"6px 8px",fontSize:11,color:r?"#0073e6":"var(--kzeditor-text-muted, #94a3b8)",border:`1px dashed ${r?"#0073e6":"var(--kzeditor-border-strong, #cbd5e1)"}`,borderRadius:4,background:r?"#eff6ff":"transparent"});import{jsx as Se,jsxs as xd}from"react/jsx-runtime";q();function He({blocks:t,onClose:r,width:e,suffix:a}){let{config:o}=E();return xd("aside",{className:D("kzeditor-navigator-panel",a),style:e!=null?{width:e}:void 0,children:[xd("header",{className:D("kzeditor-panel-header",a),children:[Se("span",{className:"kzeditor-panel-title",children:o.navigator}),Se("button",{type:"button",onClick:r,className:"kzeditor-icon-btn",title:o.close_navigator,children:Se(Fr,{size:15})})]}),Se("div",{className:"kzeditor-panel-scroll",children:Se(Io,{blocks:t})})]})}import{useEffect as zh,useMemo as Gd}from"react";var j=t=>Object.entries(t).filter(([,r])=>r!=null&&r!=="").map(([r,e])=>`${r}:${e}`).join(";"),T=t=>{if(!Array.isArray(t))return"0";let r=t.slice(0,4).map(e=>parseInt(e,10)||0);for(;r.length<4;)r.push(0);return r.map(e=>`${e}px`).join(" ")},Lr=t=>`${parseInt(t,10)||0}px`,b1=t=>{let r=Number(t)||0;return`${(Math.round(r*1e3)/1e3).toString()}px`},w1=t=>(typeof t=="number"||typeof t=="string"&&/^-?\d/.test(t),String(t)),dr=(t={},r=null)=>{var o;let e={},a=(o=t.fontFamily)!=null?o:"inherit";return a&&a!=="inherit"?e["font-family"]=a:r&&(e["font-family"]=r),t.fontSize&&(e["font-size"]=Lr(t.fontSize)),t.fontWeight&&(e["font-weight"]=String(t.fontWeight)),t.fontStyle&&t.fontStyle!=="normal"&&(e["font-style"]=t.fontStyle),t.lineHeight!=null&&(e["line-height"]=w1(t.lineHeight)),t.letterSpacing&&(e["letter-spacing"]=b1(t.letterSpacing)),t.textTransform&&t.textTransform!=="none"&&(e["text-transform"]=t.textTransform),t.textDecoration&&t.textDecoration!=="none"&&(e["text-decoration"]=t.textDecoration),t.color&&(e.color=t.color),e},X=(t={})=>{var i,n,d,l;let r={},e=parseInt((i=t.width)!=null?i:0,10),a=(n=t.style)!=null?n:"solid";e>0&&a!=="none"&&(r.border=`${Lr(e)} ${a} ${(d=t.color)!=null?d:"#000"}`);let o=parseInt((l=t.radius)!=null?l:0,10);return o>0&&(r["border-radius"]=Lr(o)),r},vt=(t={})=>{var e,a,o,i,n;return t.enabled?{"box-shadow":`${t.inset?"inset ":""}${Lr((e=t.x)!=null?e:0)} ${Lr((a=t.y)!=null?a:2)} ${Lr((o=t.blur)!=null?o:4)} ${Lr((i=t.spread)!=null?i:0)} ${(n=t.color)!=null?n:"rgba(0,0,0,.15)"}`}:{}},y=t=>String(t!=null?t:"").replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),Z=t=>String(t!=null?t:"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");var C1=["h1","h2","h3","h4"],B1=(t,r)=>{var p,g,x,b,m,v,f;let e=t.attributes||{},a=C1.includes(e.tag)?e.tag:"h2",o=(p=e.text)!=null?p:"",i=(g=e.alignment)!=null?g:"left",n=(x=e.padding)!=null?x:[0,0,0,0],d=(b=e.margin)!=null?b:[0,0,0,0],l=(m=e.typography)!=null?m:{},c=(v=e.border)!=null?v:{},h=(f=r.fontFamily)!=null?f:"Arial, sans-serif",s=j({margin:T(d)}),u=j({padding:T(n),"text-align":i,...X(c)}),k=j({margin:"0","text-align":i,...dr(l,h)});return`<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="${y(s)}"><tr><td align="${y(i)}" style="${y(u)}"><${a} data-kzeditor-editable="richtext" data-kzeditor-merge-tags="off" data-kzeditor-field="text" style="${y(k)}">`+o+`</${a}></td></tr></table>`},W1=(t,r)=>{var u,k,p,g,x,b,m;let e=t.attributes||{},a=(u=e.text)!=null?u:"",o=(k=e.alignment)!=null?k:"left",i=(p=e.padding)!=null?p:[0,0,0,0],n=(g=e.margin)!=null?g:[0,0,0,0],d=(x=e.typography)!=null?x:{},l=(b=e.border)!=null?b:{},c=(m=r.fontFamily)!=null?m:"Arial, sans-serif",h=j({margin:T(n)}),s=j({padding:T(i),"text-align":o,...dr(d,c),...X(l)});return`<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="${y(h)}"><tr><td align="${y(o)}" style="${y(s)}"><div data-kzeditor-editable="richtext" data-kzeditor-field="text">`+a+"</div></td></tr></table>"},j1=t=>{var d,l,c;let r=t.attributes||{},e=(d=r.html)!=null?d:"",a=(l=r.padding)!=null?l:[0,0,0,0],o=(c=r.margin)!=null?c:[0,0,0,0],i=j({margin:T(o)}),n=j({padding:T(a)});return`<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="${y(i)}"><tr><td style="${y(n)}">`+e+"</td></tr></table>"},z1=(t,r)=>{var L,w,B,S,W,z,F,A,H,N,G,O;let e=t.attributes||{},a=(L=e.text)!=null?L:"Click here",o=(w=e.href)!=null?w:"",i=(B=e.bg)!=null?B:"#0073e6",n=(S=e.padding)!=null?S:[12,24,12,24],d=(W=e.margin)!=null?W:[0,0,0,0],l=(z=e.alignment)!=null?z:"left",c=!!((F=e.openInNewTab)==null||F),h=!!((A=e.noFollow)!=null&&A),s=(H=e.typography)!=null?H:{},u=(N=e.border)!=null?N:{},k=(G=e.boxShadow)!=null?G:{},p=(O=r.fontFamily)!=null?O:"Arial, sans-serif",g=!!o&&o!=="#",x=j({width:"100%",margin:T(d)}),b=j({padding:"0","text-align":l}),m=j({background:i,padding:T(n),"mso-padding-alt":T(n),"text-align":"center",...X(u),...vt(k)}),v=j({display:"inline-block","text-decoration":"none",...dr(s,p)}),f=[];h&&f.push("nofollow"),f.push("noopener"),c&&f.push("noreferrer");let M=g?`<a href="${y(o)}" style="${y(v)}" rel="${y(f.join(" "))}" data-kzeditor-editable="text" data-kzeditor-field="text"${c?' target="_blank"':""}>${Z(a)}</a>`:`<span style="${y(v)}" data-kzeditor-editable="text" data-kzeditor-field="text">${Z(a)}</span>`;return`<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="${y(x)}"><tr><td align="${y(l)}" style="${y(b)}"><table role="presentation" align="${y(l)}" cellpadding="0" cellspacing="0" border="0" style="display:inline-block;border-collapse:separate;line-height:100%"><tr><td align="center" bgcolor="${y(i)}" style="${y(m)}">${M}</td></tr></table></td></tr></table>`},S1=t=>{var k,p,g,x,b,m;let r=t.attributes||{},e=(k=r.color)!=null?k:"#E2E8F0",a=parseInt((p=r.thickness)!=null?p:1,10),o=(g=r.style)!=null?g:"solid",i=parseInt((x=r.width)!=null?x:100,10),n=(b=r.alignment)!=null?b:"left",d=(m=r.padding)!=null?m:[16,0,16,0],l=j({height:`${a}px`,background:o==="solid"?e:"transparent",...o!=="solid"?{"border-top":`${a}px ${o} ${e}`}:{}}),c=`<div data-kzeditor-divider="1" data-kzeditor-divider-color="${y(e)}" data-kzeditor-divider-thickness="${a}" data-kzeditor-divider-style="${y(o)}" style="${y(l)}"></div>`,h=d[0]||0,s=d[2]||0,u=v=>v>0?`<tr><td height="${v}" style="height:${v}px;line-height:${v}px;font-size:0">&nbsp;</td></tr>`:"";return'<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0">'+u(h)+`<tr><td>${c}</td></tr>`+u(s)+"</table>"},H1=t=>{var o;let r=t.attributes||{},e=parseInt((o=r.height)!=null?o:24,10),a=j({height:`${e}px`,"line-height":`${e}px`,"font-size":"0"});return`<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td height="${e}" style="${y(a)}">&nbsp;</td></tr></table>`},A1=t=>{var x,b,m,v,f,M,L,w,B;let r=t.attributes||{},e=(x=r.src)!=null?x:"",a=(b=r.alt)!=null?b:"",o=(m=r.href)!=null?m:"",i=!!((v=r.openInNewTab)==null||v),n=parseInt((f=r.width)!=null?f:600,10),d=(M=r.alignment)!=null?M:"left",l=(L=r.padding)!=null?L:[0,0,0,0],c=(w=r.margin)!=null?w:[0,0,0,0],h=(B=r.border)!=null?B:{},s=d==="center"?"0 auto":d==="right"?"0 0 0 auto":"0 auto 0 0",u=!e||/via\.placeholder\.com|placehold\.co/i.test(String(e)),k=j({margin:T(c)}),p=j({padding:T(l),"text-align":d}),g;if(u){let S=j({display:"block",width:"100%","max-width":`${n}px`,margin:s,"box-sizing":"border-box",padding:"34px 16px",background:"#f1f5f9",border:"2px dashed #cbd5e1","border-radius":"6px",color:"#94a3b8","font-family":"Arial, sans-serif","font-size":"13px","font-weight":"600","text-align":"center"});g=`<div style="${y(S)}">`+'<svg xmlns="http://www.w3.org/2000/svg" width="34" height="34" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" style="display:block;margin:0 auto 8px;"><rect width="18" height="18" x="3" y="3" rx="2" ry="2"/><circle cx="9" cy="9" r="2"/><path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"/></svg>'+"Add an image</div>"}else{let S=j({display:"block",width:"100%","max-width":`${n}px`,margin:s,height:"auto",border:"0",outline:"none","text-decoration":"none",...X(h)});if(g=`<img src="${y(e)}" alt="${y(a)}" width="${n}" style="${y(S)}">`,o){let W=i?' target="_blank"':"";g=`<a href="${y(o)}"${W} rel="noopener noreferrer">${g}</a>`}}return`<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="${y(k)}"><tr><td align="${y(d)}" style="${y(p)}">`+g+"</td></tr></table>"},V1=/(?:youtu\.be\/|youtube\.com\/(?:watch\?v=|embed\/|shorts\/|v\/))([\w-]{11})/,D1=t=>{let r=String(t||"").match(V1);return r?`https://img.youtube.com/vi/${r[1]}/hqdefault.jpg`:""},T1=(t,r)=>(!t||/via\.placeholder\.com|placehold\.co/.test(String(t)))&&D1(r)||t,E1=t=>{var k,p,g,x,b,m,v;let r=t.attributes||{},e=(k=r.videoUrl)!=null?k:"",a=T1((p=r.thumbnail)!=null?p:"",e),o=(g=r.alt)!=null?g:"Watch video",i=(x=r.caption)!=null?x:"",n=parseInt((b=r.width)!=null?b:600,10),d=(m=r.alignment)!=null?m:"left",l=(v=r.padding)!=null?v:[0,0,0,0],c=j({padding:T(l),"text-align":d}),h=j({display:"block",width:"100%","max-width":`${n}px`,height:"auto",border:"0"}),s=`<img src="${y(a)}" alt="${y(o)}" width="${n}" style="${y(h)}">`;e&&(s=`<a href="${y(e)}" target="_blank" rel="noopener noreferrer">${s}</a>`);let u="";if(i){let f=j({display:"block","margin-top":"8px","font-size":"13px",color:"#64748B","text-align":d}),M=e?`<a href="${y(e)}" target="_blank" rel="noopener noreferrer" style="color:inherit;text-decoration:none;">${Z(i)}</a>`:Z(i);u=`<div style="${y(f)}">${M}</div>`}return`<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td align="${y(d)}" style="${y(c)}">${s}${u}</td></tr></table>`},md=t=>String(t!=null?t:"").split(/(?:\r?\n|<br\s*\/?>)/i).map(r=>r.trim()).filter(r=>r!==""),R1=[[1e3,"M"],[900,"CM"],[500,"D"],[400,"CD"],[100,"C"],[90,"XC"],[50,"L"],[40,"XL"],[10,"X"],[9,"IX"],[5,"V"],[4,"IV"],[1,"I"]],vd=t=>{let r=t,e="";for(let[a,o]of R1)for(;r>=a;)e+=o,r-=a;return e},Ld=t=>{let r=t,e="";for(;r>0;){let a=(r-1)%26;e=String.fromCharCode(97+a)+e,r=Math.floor((r-1)/26)}return e},F1=(t,r)=>{let e=r+1;switch(t){case"decimal":return`${e}.`;case"decimal-leading-zero":return`${e<10?"0"+e:e}.`;case"lower-alpha":case"lower-latin":return`${Ld(e)}.`;case"upper-alpha":case"upper-latin":return`${Ld(e).toUpperCase()}.`;case"lower-roman":return`${vd(e).toLowerCase()}.`;case"upper-roman":return`${vd(e)}.`;case"circle":return"\u25E6";case"square":return"\u25AA";case"none":return"";default:return"\u2022"}},N1=(t,r)=>{var B,S,W,z,F,A,H,N,G,O,U,Lt,mt;let e=t.attributes||{},a=(B=e.type)!=null?B:"unordered",o=(S=e.items)!=null?S:"",i=(W=e.alignment)!=null?W:"left",n=(z=e.markerStyle)!=null?z:"default",d=(F=e.markerColor)!=null?F:"",l=parseInt((A=e.itemSpacing)!=null?A:6,10),c=parseInt((H=e.indent)!=null?H:20,10),h=(N=e.bg)!=null?N:"",s=(G=e.border)!=null?G:{},u=(O=e.padding)!=null?O:[0,0,0,0],k=(U=e.margin)!=null?U:[0,0,0,0],p=(Lt=e.typography)!=null?Lt:{},g=(mt=r.fontFamily)!=null?mt:"Arial, sans-serif",x=n==="default"?a==="ordered"?"decimal":"disc":n,b=p.color,m=h&&h!=="transparent",v=j({margin:T(k)}),f=j({padding:T(u),"text-align":i,...m?{background:h}:{},...X(s),...dr(p,g)}),M=md(o),L=M.map((Mt,tt)=>{let St=tt===M.length-1,Ut=j({padding:`0 6px ${St?0:l}px 0`,"white-space":"nowrap","text-align":"right","vertical-align":"top",...d||b?{color:d||b}:{}}),hr=j({padding:`0 0 ${St?0:l}px 0`,"text-align":"left","vertical-align":"top"}),ft=F1(x,tt);return`<tr><td style="${y(Ut)}">${Z(ft)}</td><td style="${y(hr)}">${Mt}</td></tr>`}).join(""),w=i==="center"?"width:auto;margin:0 auto":i==="right"?"width:auto;margin-left:auto;margin-right:0":`margin-left:${c}px;margin-right:auto`;return`<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="${y(v)}"><tr><td align="${y(i)}" style="${y(f)}"><table role="presentation" align="${y(i)}" cellpadding="0" cellspacing="0" border="0" style="${y(w)}"><tbody>${L}</tbody></table></td></tr></table>`},I1={facebook:{bg:"#1877F2",label:"f"},twitter:{bg:"#000000",label:"X"},instagram:{bg:"#E4405F",label:"ig"},linkedin:{bg:"#0A66C2",label:"in"},youtube:{bg:"#FF0000",label:"yt"},github:{bg:"#181717",label:"g"}},P1=t=>{var k,p,g,x,b;let r=t.attributes||{},e=parseInt((k=r.iconSize)!=null?k:36,10),a=parseInt((p=r.gap)!=null?p:8,10),o=(g=r.shape)!=null?g:"circle",i=(x=r.alignment)!=null?x:"left",n=(b=r.padding)!=null?b:[0,0,0,0],d=o==="circle"?e/2:o==="rounded"?Math.max(4,Math.floor(e/4)):0,l=Math.max(11,Math.floor(e/2)),c=Object.entries(I1).map(([m,v])=>{let f=r[m];if(!f)return null;let M=`<svg width="${e}" height="${e}" viewBox="0 0 ${e} ${e}" xmlns="http://www.w3.org/2000/svg" style="display:block"><rect width="${e}" height="${e}" rx="${d}" ry="${d}" fill="${y(v.bg)}"/><text x="${e/2}" y="${e/2+l*.35}" text-anchor="middle" fill="#FFFFFF" font-family="Arial, sans-serif" font-size="${l}" font-weight="700">${Z(v.label)}</text></svg>`;return`<td align="center">${`<a href="${y(f)}" target="_blank" rel="noopener noreferrer" style="display:block;text-decoration:none" title="${y(m.charAt(0).toUpperCase()+m.slice(1))}">${M}</a>`}</td>`}).filter(Boolean),h=`<td style="width:${a}px;line-height:1px;font-size:0">&nbsp;</td>`,s=c.join(h),u=j({padding:T(n),"text-align":i});return`<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td align="${y(i)}" style="${y(u)}"><table role="presentation" align="${y(i)}" cellpadding="0" cellspacing="0" border="0" style="display:inline-block;width:auto;border-collapse:separate"><tr>${s}</tr></table></td></tr></table>`},O1=(t,r)=>{var u,k,p,g,x,b;let e=t.attributes||{},a=(u=e.lines)!=null?u:"",o=(k=e.alignment)!=null?k:"left",i=(p=e.padding)!=null?p:[0,0,0,0],n=(g=e.margin)!=null?g:[0,0,0,0],d=(x=e.typography)!=null?x:{},l=(b=r.fontFamily)!=null?b:"Arial, sans-serif",c=md(a).map(m=>`<div>${m}</div>`).join(""),h=j({margin:T(n)}),s=j({padding:T(i),"text-align":o,...dr(d,l)});return`<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="${y(h)}"><tr><td align="${y(o)}" style="${y(s)}">${c}</td></tr></table>`},_1=(t,r)=>{var g,x,b,m,v,f,M,L,w;let e=t.attributes||{},a=(g=e.greeting)!=null?g:"",o=(x=e.name)!=null?x:"",i=(b=e.title)!=null?b:"",n=(m=e.company)!=null?m:"",d=(v=e.alignment)!=null?v:"left",l=(f=e.padding)!=null?f:[0,0,0,0],c=(M=e.margin)!=null?M:[0,0,0,0],h=(L=e.typography)!=null?L:{},s=(w=r.fontFamily)!=null?w:"Arial, sans-serif",u="";a&&(u+=`<div style="margin-bottom:8px;">${Z(a)}</div>`),o&&(u+=`<div style="font-weight:700;">${Z(o)}</div>`),i&&(u+=`<div>${Z(i)}</div>`),n&&(u+=`<div style="opacity:.7;">${Z(n)}</div>`);let k=j({margin:T(c)}),p=j({padding:T(l),"text-align":d,...dr(h,s)});return`<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="${y(k)}"><tr><td align="${y(d)}" style="${y(p)}">${u}</td></tr></table>`},$1=(t,r)=>{var s,u,k,p,g,x;let e=t.attributes||{},a=(s=e.text)!=null?s:"",o=(u=e.alignment)!=null?u:"left",i=(k=e.padding)!=null?k:[0,0,0,0],n=(p=e.margin)!=null?p:[0,0,0,0],d=(g=e.typography)!=null?g:{},l=(x=r.fontFamily)!=null?x:"Arial, sans-serif",c=j({margin:T(n)}),h=j({padding:T(i),"text-align":o,...dr(d,l)});return`<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="${y(c)}"><tr><td align="${y(o)}" style="${y(h)}">${Z(a)}</td></tr></table>`},Md=t=>{if(!t)return NaN;let r=new Date(t).getTime();if(Number.isFinite(r))return r;let e=String(t).trim().replace(" ","T");return new Date(e).getTime()},U1=t=>{let r=Md(t);if(!Number.isFinite(r))return{days:0,hours:0,minutes:0,seconds:0};let e=Math.max(0,Math.floor((r-Date.now())/1e3));return{days:Math.floor(e/86400),hours:Math.floor(e%86400/3600),minutes:Math.floor(e%3600/60),seconds:e%60}},Z1=t=>{let r=Md(t);return Number.isFinite(r)?new Date(r).toLocaleString(void 0,{month:"long",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"}):t},q1=t=>String(t).padStart(2,"0"),G1=t=>{var s,u,k,p,g,x,b,m,v,f,M,L,w,B,S;let r=t.attributes||{},e=(s=r.mode)!=null?s:"boxes",a=(u=r.endDate)!=null?u:"",o=(k=r.linkUrl)!=null?k:"",i=(p=r.alignment)!=null?p:"left",n=(g=r.padding)!=null?g:[0,0,0,0],d=(x=r.margin)!=null?x:[0,0,0,0],l=j({margin:T(d)}),c=j({padding:T(n),"text-align":i}),h="";if(e==="image"){let W=(b=r.imageUrl)!=null?b:"",z=(m=r.labelPrefix)!=null?m:"Countdown";h=W?`<img src="${y(W)}" alt="${y(z)}" style="display:block;max-width:100%;border:0;outline:none;text-decoration:none;">`:'<span style="color:#94A3B8;font-size:12px;">[ Set a countdown image URL ]</span>'}else if(e==="text"){let W=(v=r.labelPrefix)!=null?v:"Offer ends in",z=Z1(a);h=`<span style="font-family:Arial,sans-serif;font-size:14px;color:#0F172A;">${Z(W)}${W?" ":""}<strong>${Z(z)}</strong></span>`}else{let W=U1(a),z=(f=r.boxBg)!=null?f:"#0F172A",F=(M=r.boxColor)!=null?M:"#FFFFFF",A=parseInt((L=r.boxSize)!=null?L:64,10),H=parseInt((w=r.boxRadius)!=null?w:6,10),N=(B=r.labelColor)!=null?B:"#64748B",G=String((S=r.labels)!=null?S:"DAYS,HOURS,MINUTES,SECONDS").split(",").map(Mt=>Mt.trim());for(;G.length<4;)G.push("");let O=j({display:"inline-block",width:`${A}px`,height:`${A}px`,"line-height":`${A}px`,background:z,color:F,"border-radius":`${H}px`,"font-family":"Arial, sans-serif","font-size":`${Math.max(18,Math.floor(A/2.2))}px`,"font-weight":"700","text-align":"center"}),U=j({display:"block","margin-top":"6px","font-family":"Arial, sans-serif","font-size":"11px","font-weight":"600","letter-spacing":"1px",color:N}),mt=[W.days,W.hours,W.minutes,W.seconds].map(q1).map((Mt,tt)=>`<td align="center" style="padding:0 8px;"><div style="${y(O)}">${Z(Mt)}</div><span style="${y(U)}">${Z(G[tt])}</span></td>`).join("");h=`<table role="presentation" align="${y(i)}" cellpadding="0" cellspacing="0" border="0"><tr>${mt}</tr></table>`}return o&&(e==="image"||e==="boxes")&&(h=`<a href="${y(o)}" target="_blank" rel="noopener noreferrer" style="text-decoration:none;color:inherit;">${h}</a>`),`<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="${y(l)}"><tr><td align="${y(i)}" style="${y(c)}">${h}</td></tr></table>`},Aa=t=>{var o,i,n,d,l,c,h;let r=t.attributes||{},e=parseInt((o=r.maxWidth)!=null?o:0,10)||0,a=parseInt((i=r.minHeight)!=null?i:0,10)||0;return j({background:(n=r.backgroundColor)!=null?n:"#FFFFFF",padding:T((d=r.padding)!=null?d:[24,24,24,24]),"text-align":(l=r.alignment)!=null?l:"left",...e>0?{"max-width":`${e}px`,"margin-left":"auto","margin-right":"auto"}:{},...a>0?{"min-height":`${a}px`}:{},...X((c=r.border)!=null?c:{}),...vt((h=r.boxShadow)!=null?h:{})})},Va=t=>{var e;let r=t.attributes||{};return j({width:"100%",margin:T((e=r.margin)!=null?e:[0,0,0,0])})},yd=t=>{var e;let r=t.attributes||{};return j({width:"100%",margin:T((e=r.margin)!=null?e:[0,0,0,0])})},bd=t=>{var a,o;let r=t.attributes||{},e=(a=r.backgroundColor)!=null?a:"transparent";return j({padding:T((o=r.padding)!=null?o:[0,0,0,0]),...e&&e!=="transparent"?{background:e}:{}})};var Da=t=>{let r=Math.max(1,t);return Math.round(100/r*1e4)/1e4},wd=(t,r,e)=>{var n,d;let a=t.attributes||{},o=parseInt((n=a.gap)!=null?n:16,10)||0,i=(d=a.valign)!=null?d:"top";return j({"vertical-align":i,"padding-left":`${r>0?Math.round(o/2):0}px`,"padding-right":`${r<e-1?Math.round(o/2):0}px`})},K1=t=>{var k,p,g,x,b,m,v;let r=t.attributes||{},e=(k=r.value)!=null?k:"",a=parseInt((p=r.size)!=null?p:120,10)||120,o=(g=r.fg)!=null?g:"#000000",i=(x=r.bg)!=null?x:"#FFFFFF",n=(b=r.alignment)!=null?b:"center",d=(m=r.padding)!=null?m:[8,0,8,0],l=(v=r.margin)!=null?v:[0,0,0,0],c=j({margin:T(l)}),h=j({padding:T(d),"text-align":n}),s=j({width:`${a}px`,height:`${a}px`,background:i,padding:`${Math.round(a*.06)}px`,"box-sizing":"border-box"}),u=n==="center"?"width:auto;margin:0 auto":n==="right"?"width:auto;margin-left:auto;margin-right:0":"margin-left:0;margin-right:auto";return`<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="${y(c)}"><tr><td align="${y(n)}" style="${y(h)}"><table role="presentation" align="${y(n)}" cellpadding="0" cellspacing="0" border="0" style="${y(u)}"><tr><td><div data-kzeditor-qr="${y(e)}" data-kzeditor-qr-fg="${y(o)}" data-kzeditor-qr-bg="${y(i)}" style="${y(s)}">${X1(o,i)}</div></td></tr></table></td></tr></table>`},X1=(t,r)=>{let e=(o,i)=>`<rect x="${o}" y="${i}" width="7" height="7" fill="none" stroke="${y(t)}" stroke-width="1.4"/><rect x="${o+2}" y="${i+2}" width="3" height="3" fill="${y(t)}"/>`,a=[[13,1],[15,1],[17,3],[13,5],[19,5],[1,13],[3,13],[5,15],[7,13],[1,17],[13,13],[15,15],[17,13],[19,17],[13,19],[17,19],[15,11],[11,15]].map(([o,i])=>`<rect x="${o}" y="${i}" width="1.6" height="1.6" fill="${y(t)}"/>`).join("");return`<svg viewBox="0 0 22 22" width="100%" height="100%" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg"><rect width="22" height="22" fill="${y(r)}"/>`+e(0,0)+e(15,0)+e(0,15)+a+"</svg>"},Ta={heading:B1,text:W1,html:j1,button:z1,divider:S1,spacer:H1,image:A1,video:E1,list:N1,social:P1,address:O1,signature:_1,date:$1,timer:G1,qr:K1},Ea=new Set(["section"]);var Cd=t=>{var e,a,o,i,n,d,l,c,h,s,u,k,p,g;let r=(a=(e=t==null?void 0:t.root)==null?void 0:e.attributes)!=null?a:{};return{bgColor:(o=r.bgColor)!=null?o:"#F1F5F9",contentBg:(i=r.contentBg)!=null?i:"#FFFFFF",contentWidth:parseInt((n=r.contentWidth)!=null?n:600,10),padding:Array.isArray(r.padding)?r.padding:[40,20,40,20],fontFamily:(d=r.fontFamily)!=null?d:"Arial, sans-serif",contentBorder:(l=r.contentBorder)!=null?l:null,contentBoxShadow:(c=r.contentBoxShadow)!=null?c:null,rootType:(s=(h=t==null?void 0:t.root)==null?void 0:h.type)!=null?s:"email",pageSize:(u=r.pageSize)!=null?u:null,orientation:(k=r.orientation)!=null?k:null,bgImage:(p=r.bgImage)!=null?p:null,bgSize:(g=r.bgSize)!=null?g:"cover"}};var mr=(t,r)=>{if(!t||typeof t!="object")return"";let e=t.type||"",a=Array.isArray(t.children)?t.children:[];if(e==="columns")return Y1(t,r);if(e==="section"||Ea.has(e)){let i=a.map(l=>mr(l,r)).join(""),n=Va(t),d=Aa(t);return`<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="${y(n)}"><tr><td style="${y(d)}">${i}</td></tr></table>`}let o=Ta[e];return o?o(t,r):a.map(i=>mr(i,r)).join("")},Y1=(t,r)=>{let e=(t.children||[]).filter(d=>d.type==="column"),a=Math.max(1,e.length),o=Da(a),i=t.attributes&&t.attributes.valign||"top",n=e.map((d,l)=>{let c=(d.children||[]).map(h=>mr(h,r)).join("");return`<td width="${o}%" valign="${y(i)}" style="width:${o}%;${wd(t,l,a)}">`+c+"</td>"}).join("");return`<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="${y(yd(t))}"><tr><td style="${y(bd(t))}"><table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="width:100%"><tr>${n}</tr></table></td></tr></table>`},Ra=t=>{var v,f,M,L,w,B;let r=t&&t.root;if(!r||typeof r!="object")return"";let e=r.attributes||{},a=(v=e.bgColor)!=null?v:"#F1F5F9",o=(f=e.contentBg)!=null?f:"#FFFFFF",i=parseInt((M=e.contentWidth)!=null?M:600,10),n=Array.isArray(e.padding)?e.padding:[40,20,40,20],d=(L=e.fontFamily)!=null?L:"Arial, sans-serif",l=(w=e.contentBorder)!=null?w:{},c=(B=e.contentBoxShadow)!=null?B:{},h={fontFamily:d,contentWidth:i},s=(r.children||[]).map(S=>mr(S,h)).join(""),u=j({margin:"0",padding:"0",background:a,"font-family":d}),k=j({background:a}),p=j({width:"100%","max-width":`${i}px`,background:o,"font-family":d,...X(l),...vt(c)}),g=j({padding:T(n)}),x=`<!--[if mso | IE]><table role="presentation" align="center" border="0" cellpadding="0" cellspacing="0" width="${i}"><tr><td><![endif]-->`,b="<!--[if mso | IE]></td></tr></table><![endif]-->",m=typeof document!="undefined"&&document.documentElement&&document.documentElement.lang||"en";return`<!doctype html><html lang="${y(m)}" xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><meta name="x-apple-disable-message-reformatting"><title></title></head><body style="${y(u)}"><table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="${y(k)}"><tr><td align="center" style="padding:0">`+x+`<table role="presentation" align="center" width="100%" cellpadding="0" cellspacing="0" border="0" style="${y(p)}"><tr><td style="${y(g)}">`+s+"</td></tr></table>"+b+"</td></tr></table></body></html>"},Po=t=>{var g,x,b,m,v;let r=t&&t.root;if(!r||typeof r!="object")return"";let e=r.attributes||{},a=(g=e.contentBg)!=null?g:"#FFFFFF",o=parseInt((x=e.contentWidth)!=null?x:600,10),i=Array.isArray(e.padding)?e.padding:[40,20,40,20],n=(b=e.fontFamily)!=null?b:"Arial, sans-serif",d=(m=e.contentBorder)!=null?m:{},l=(v=e.contentBoxShadow)!=null?v:{},c={fontFamily:n,contentWidth:o},h=(r.children||[]).map(f=>mr(f,c)).join(""),s=j({width:"100%","max-width":`${o}px`,background:a,"font-family":n,margin:"0 auto",...X(d),...vt(l)}),u=j({padding:T(i)});return`<!--[if mso | IE]><table role="presentation" align="center" border="0" cellpadding="0" cellspacing="0" width="${o}"><tr><td><![endif]-->`+`<table role="presentation" align="center" width="100%" cellpadding="0" cellspacing="0" border="0" style="${y(s)}"><tr><td style="${y(u)}">`+h+"</td></tr></table>"+"<!--[if mso | IE]></td></tr></table><![endif]-->"};var Bd={A4:[297,210],Letter:[279.4,215.9]},Wd=25.4/96,Ae=t=>{var d;let r=t&&t.attributes||{},[e,a]=Bd[r.pageSize]||Bd.A4,o=((d=r.orientation)!=null?d:"landscape")!=="portrait",i=o?e:a,n=o?a:e;return{wMm:i,hMm:n,wPx:Math.round(i/Wd),hPx:Math.round(n/Wd),ratio:i/n}},Oo=t=>{var a;let r=t&&t.attributes||{},e={background:(a=r.bgColor)!=null?a:"#FFFFFF"};if(r.bgImage){let o=r.bgSize==="contain"?"contain":r.bgSize==="stretch"?"100% 100%":"cover";e["background-image"]=`url("${String(r.bgImage).replace(/"/g,"&quot;")}")`,e["background-size"]=o,e["background-position"]="center center",e["background-repeat"]="no-repeat"}return e},J1=t=>{let r=t&&t.attributes||{},e=Array.isArray(r.padding)?r.padding:[48,56,48,56],a=Ae(t).wPx;return{fontFamily:r.fontFamily||"Poppins",contentWidth:a,innerWidth:Math.max(1,a-(e[1]||0)-(e[3]||0))}},Fa=t=>{let r=t&&t.root;if(!r||typeof r!="object")return"";let e=r.attributes||{},a=J1(r),o=Array.isArray(e.padding)?e.padding:[48,56,48,56],i=e.contentBg&&e.contentBg!=="transparent"?e.contentBg:null,n=(r.children||[]).map(c=>mr(c,a)).join(""),d=j({width:"100%","font-family":a.fontFamily,...i?{background:i}:{}}),l=j({padding:T(o),"vertical-align":"top"});return`<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="${y(d)}"><tr><td style="${y(l)}">${n}</td></tr></table>`},_o=t=>{let r=t&&t.root;if(!r||typeof r!="object")return"";let{wMm:e,hMm:a,wPx:o}=Ae(r),i=j({position:"relative",width:`${e}mm`,height:`${a}mm`,margin:"0 auto",overflow:"hidden",...Oo(r)}),n=j({margin:"0",padding:"24px",background:"#64748b","text-align":"center"});return`<!doctype html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><style>.kzeditor-cert-page{box-shadow:0 8px 30px rgba(0,0,0,.35);transform-origin:top center}.kzeditor-cert-page table{border-collapse:collapse}</style></head><body style="${y(n)}"><div id="kzeditor-cert-scale" style="display:inline-block"><div class="kzeditor-cert-page" style="${y(i)}">${Fa(t)}</div></div><script>(function(){var p=document.querySelector('.kzeditor-cert-page');if(!p)return;function fit(){var s=Math.min(1,(window.innerWidth-48)/${o});p.style.transform='scale('+s+')';document.getElementById('kzeditor-cert-scale').style.height=(p.offsetHeight*s)+'px';}window.addEventListener('resize',fit);fit();})();<\/script></body></html>`};import Bh from"react";import jd,{useMemo as Pa,useRef as $o,useEffect as Oa,useState as Q1,useContext as th}from"react";function zd(t,r,e){let a=t.slice();return a.splice(e<0?a.length+e:e,0,a.splice(r,1)[0]),a}function rh(t,r){return t.reduce((e,a,o)=>{let i=r.get(a);return i&&(e[o]=i),e},Array(t.length))}function Na(t){return t!==null&&t>=0}function eh(t,r){if(t===r)return!0;if(t.length!==r.length)return!1;for(let e=0;e<t.length;e++)if(t[e]!==r[e])return!1;return!0}function ah(t){return typeof t=="boolean"?{draggable:t,droppable:t}:t}var Sd=t=>{let{rects:r,activeIndex:e,overIndex:a,index:o}=t,i=zd(r,a,e),n=r[o],d=i[o];return!d||!n?null:{x:d.left-n.left,y:d.top-n.top,scaleX:d.width/n.width,scaleY:d.height/n.height}};var Ia={scaleX:1,scaleY:1},Hd=t=>{var r;let{activeIndex:e,activeNodeRect:a,index:o,rects:i,overIndex:n}=t,d=(r=i[e])!=null?r:a;if(!d)return null;if(o===e){let c=i[n];return c?{x:0,y:e<n?c.top+c.height-(d.top+d.height):c.top-d.top,...Ia}:null}let l=oh(i,o,e);return o>e&&o<=n?{x:0,y:-d.height-l,...Ia}:o<e&&o>=n?{x:0,y:d.height+l,...Ia}:{x:0,y:0,...Ia}};function oh(t,r,e){let a=t[r],o=t[r-1],i=t[r+1];return a?e<r?o?a.top-(o.top+o.height):i?i.top-(a.top+a.height):0:i?i.top-(a.top+a.height):o?a.top-(o.top+o.height):0:0}var Ad="Sortable",Vd=jd.createContext({activeIndex:-1,containerId:Ad,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Sd,disabled:{draggable:!1,droppable:!1}});function Dd(t){let{children:r,id:e,items:a,strategy:o=Sd,disabled:i=!1}=t,{active:n,dragOverlay:d,droppableRects:l,over:c,measureDroppableContainers:h}=zo(),s=gr(Ad,e),u=d.rect!==null,k=Pa(()=>a.map(L=>typeof L=="object"&&"id"in L?L.id:L),[a]),p=n!=null,g=n?k.indexOf(n.id):-1,x=c?k.indexOf(c.id):-1,b=$o(k),m=!eh(k,b.current),v=x!==-1&&g===-1||m,f=ah(i);Ct(()=>{m&&p&&h(k)},[m,k,p,h]),Oa(()=>{b.current=k},[k]);let M=Pa(()=>({activeIndex:g,containerId:s,disabled:f,disableTransforms:v,items:k,overIndex:x,useDragOverlay:u,sortedRects:rh(k,l),strategy:o}),[g,s,f.draggable,f.droppable,v,k,x,l,u,o]);return jd.createElement(Vd.Provider,{value:M},r)}var ih=t=>{let{id:r,items:e,activeIndex:a,overIndex:o}=t;return zd(e,a,o).indexOf(r)},nh=t=>{let{containerId:r,isSorting:e,wasDragging:a,index:o,items:i,newIndex:n,previousItems:d,previousContainerId:l,transition:c}=t;return!c||!a||d!==i&&o===n?!1:e?!0:n!==o&&r===l},dh={duration:200,easing:"ease"},Td="transform",lh=xt.Transition.toString({property:Td,duration:0,easing:"linear"}),ch={roleDescription:"sortable"};function hh(t){let{disabled:r,index:e,node:a,rect:o}=t,[i,n]=Q1(null),d=$o(e);return Ct(()=>{if(!r&&e!==d.current&&a.current){let l=o.current;if(l){let c=vr(a.current,{ignoreTransform:!0}),h={x:l.left-c.left,y:l.top-c.top,scaleX:l.width/c.width,scaleY:l.height/c.height};(h.x||h.y)&&n(h)}}e!==d.current&&(d.current=e)},[r,e,a,o]),Oa(()=>{i&&n(null)},[i]),i}function te(t){let{animateLayoutChanges:r=nh,attributes:e,disabled:a,data:o,getNewIndex:i=ih,id:n,strategy:d,resizeObserverConfig:l,transition:c=dh}=t,{items:h,containerId:s,activeIndex:u,disabled:k,disableTransforms:p,sortedRects:g,overIndex:x,useDragOverlay:b,strategy:m}=th(Vd),v=sh(a,k),f=h.indexOf(n),M=Pa(()=>({sortable:{containerId:s,index:f,items:h},...o}),[s,o,f,h]),L=Pa(()=>h.slice(h.indexOf(n)),[h,n]),{rect:w,node:B,isOver:S,setNodeRef:W}=pa({id:n,data:M,disabled:v.droppable,resizeObserverConfig:{updateMeasurementsFor:L,...l}}),{active:z,activatorEvent:F,activeNodeRect:A,attributes:H,setNodeRef:N,listeners:G,isDragging:O,over:U,setActivatorNodeRef:Lt,transform:mt}=ga({id:n,data:M,attributes:{...ch,...e},disabled:v.draggable}),Mt=Ti(W,N),tt=!!z,St=tt&&!p&&Na(u)&&Na(x),Ut=!b&&O,hr=Ut&&St?mt:null,ft=d!=null?d:m,qe=St?hr!=null?hr:ft({rects:g,activeNodeRect:A,activeIndex:u,overIndex:x,index:f}):null,Jt=Na(u)&&Na(x)?i({id:n,items:h,activeIndex:u,overIndex:x}):f,Zt=z==null?void 0:z.id,_=$o({activeId:Zt,items:h,newIndex:Jt,containerId:s}),le=h!==_.current.items,It=r({active:z,containerId:s,isDragging:O,isSorting:tt,id:n,index:f,items:h,newIndex:_.current.newIndex,previousItems:_.current.items,previousContainerId:_.current.containerId,transition:c,wasDragging:_.current.activeId!=null}),wr=hh({disabled:!It,index:f,node:B,rect:w});return Oa(()=>{tt&&_.current.newIndex!==Jt&&(_.current.newIndex=Jt),s!==_.current.containerId&&(_.current.containerId=s),h!==_.current.items&&(_.current.items=h)},[tt,Jt,s,h]),Oa(()=>{if(Zt===_.current.activeId)return;if(Zt!=null&&_.current.activeId==null){_.current.activeId=Zt;return}let Cr=setTimeout(()=>{_.current.activeId=Zt},50);return()=>clearTimeout(Cr)},[Zt]),{active:z,activeIndex:u,attributes:H,data:M,rect:w,index:f,newIndex:Jt,items:h,isOver:S,isSorting:tt,isDragging:O,listeners:G,node:B,overIndex:x,over:U,setNodeRef:Mt,setActivatorNodeRef:Lt,setDroppableNodeRef:W,setDraggableNodeRef:N,transform:wr!=null?wr:qe,transition:qt()};function qt(){if(wr||le&&_.current.newIndex===f)return lh;if(!(Ut&&!Er(F)||!c)&&(tt||It))return xt.Transition.toString({...c,property:Td})}}function sh(t,r){var e,a;return typeof t=="boolean"?{draggable:t,droppable:!1}:{draggable:(e=t==null?void 0:t.draggable)!=null?e:r.draggable,droppable:(a=t==null?void 0:t.droppable)!=null?a:r.droppable}}var vg=[I.Down,I.Right,I.Up,I.Left];import mh,{useContext as Mh,useMemo as yh}from"react";import{useEffect as uh,useRef as Ed,useState as gh}from"react";import{jsx as Ve,jsxs as Rd}from"react/jsx-runtime";function Uo({id:t,html:r,isDropTarget:e}){let{state:a,select:o,removeNode:i,startEditing:n,stopEditing:d,updateAttrs:l}=$(),{config:c}=E(),h=a.selectedId===t,s=a.editingId===t,[u,k]=gh(!1),p=(h||u)&&!s,{setNodeRef:g,attributes:x,listeners:b,transform:m,transition:v,isDragging:f,setActivatorNodeRef:M}=te({id:t,disabled:s}),L={transform:xt.Transform.toString(m),transition:v,opacity:f?.3:1,outline:h?"2px solid #0073e6":u?"1px solid rgba(0,115,230,.45)":"2px solid transparent",cursor:s?"text":"pointer"},w=Ed(null),B=Ed(null);uh(()=>{!w.current||s||B.current!==r&&(w.current.innerHTML=r,B.current=r)},[r,s]);let S=H=>{if(H.button!==0)return;let N=H.target.closest("[data-kzeditor-editable]");N&&(s||(o(t),n(t),N.setAttribute("contenteditable","true"),N.dataset.embEditingActive="1"))},W=H=>{H.stopPropagation(),H.target.closest("a")&&H.preventDefault(),H.target.closest("[data-kzeditor-editable]")||o(t)},z=H=>{let N=H.target.closest&&H.target.closest("[data-kzeditor-editable]");if(!N||N.dataset.embEditingActive!=="1")return;let G=N.getAttribute("data-kzeditor-editable"),O=N.getAttribute("data-kzeditor-field")||"text",U=G==="richtext"?N.innerHTML:N.textContent;N.removeAttribute("contenteditable"),delete N.dataset.embEditingActive,d(),l(t,{[O]:U}),B.current=null},F=H=>{let N=H.target.closest&&H.target.closest("[data-kzeditor-editable]");if(!N||N.dataset.embEditingActive!=="1")return;let G=N.getAttribute("data-kzeditor-editable"),O=N.getAttribute("data-kzeditor-field")||"text",U=G==="richtext"?N.innerHTML:N.textContent;l(t,{[O]:U})},A=H=>H.stopPropagation();return Rd("div",{ref:g,className:"relative outline-offset-[-1px]",style:L,"data-kzeditor-id":t,onMouseDown:S,onClick:W,onBlur:z,onInput:F,onMouseEnter:()=>k(!0),onMouseLeave:()=>k(!1),children:[e&&Ve("div",{className:"absolute -top-0.5 left-0 right-0 h-[3px] bg-[#0073e6] rounded-[2px] pointer-events-none z-[2]"}),Rd("div",{className:"kzeditor-v2-block-toolbar absolute -top-3.5 right-0 gap-1 z-[3]",style:{display:p?"flex":"none"},onMouseDown:A,children:[Ve("span",{ref:M,...b,...x,onClick:A,title:c.drag_to_reorder,className:"inline-flex items-center justify-center w-[22px] h-[22px] rounded bg-[#0073e6] text-white text-[11px] font-bold border-0 cursor-pointer select-none",children:"\u22EE\u22EE"}),Ve("button",{type:"button",onClick:H=>{H.stopPropagation(),i(t)},title:c.delete_block,className:"inline-flex items-center justify-center w-[22px] h-[22px] rounded bg-[#ef4444] text-white text-[11px] font-bold border-0 cursor-pointer select-none",children:"\u2715"})]}),s&&Ve("div",{className:"absolute top-[-22px] left-0 bg-[#0073e6] text-white text-[10px] font-semibold px-1.5 py-0.5 rounded-[3px] z-[3] tracking-[.04em] uppercase",children:c.editing}),Ve("div",{ref:w})]})}import{useState as ph}from"react";import{jsx as Mr,jsxs as Fd}from"react/jsx-runtime";function Zo({node:t,isDropTarget:r,dropTargetId:e}){let{state:a,select:o,removeNode:i}=$(),{config:n}=E(),d=a.selectedId===t.id,l=a.editingId===t.id,[c,h]=ph(!1),s=(d||c)&&!l,{setNodeRef:u,attributes:k,listeners:p,transform:g,transition:x,isDragging:b,setActivatorNodeRef:m}=te({id:t.id,data:{kind:"section"},disabled:l}),v={transform:xt.Transform.toString(g),transition:x,opacity:b?.3:1,outline:d?"2px solid #0073e6":c?"1px solid rgba(0,115,230,.45)":"2px solid transparent"},f=M=>M.stopPropagation();return Fd("div",{ref:u,className:"relative outline-offset-[-1px] cursor-pointer",style:v,"data-kzeditor-id":t.id,onClick:M=>{M.stopPropagation(),o(t.id)},onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),children:[r&&Mr("div",{className:"absolute -top-0.5 left-0 right-0 h-[3px] bg-[#0073e6] rounded-[2px] pointer-events-none z-[2]"}),Fd("div",{className:"kzeditor-v2-section-toolbar absolute -top-3.5 right-0 gap-1 z-[3]",style:{display:s?"flex":"none"},onMouseDown:f,children:[Mr("span",{ref:m,...p,...k,onClick:f,title:n.drag_section,className:"inline-flex items-center justify-center w-[22px] h-[22px] rounded bg-[#0073e6] text-white text-[11px] font-bold border-0 cursor-pointer select-none",children:"\u22EE\u22EE"}),Mr("span",{className:"inline-flex items-center px-2 py-0 h-[22px] rounded bg-[#0073e6] text-white text-[10px] font-bold tracking-wider uppercase",children:n.section}),Mr("button",{type:"button",onClick:M=>{M.stopPropagation(),i(t.id)},title:n.delete_section,className:"inline-flex items-center justify-center w-[22px] h-[22px] rounded bg-[#ef4444] text-white text-[11px] font-bold border-0 cursor-pointer select-none",children:"\u2715"})]}),Mr("div",{style:{margin:kh(Va(t),"margin")},children:Mr("div",{style:Nd(Aa(t)),onClick:f,children:Mr(Xt,{containerId:t.id,items:t.children||[],dropTargetId:e,emptyMessage:"Drag blocks into this section.",addInside:s})})})]})}function Nd(t){let r={};return t&&t.split(";").forEach(e=>{let a=e.indexOf(":");if(a<0)return;let o=e.slice(0,a).trim(),i=e.slice(a+1).trim();if(!o)return;let n=o.replace(/-([a-z])/g,(d,l)=>l.toUpperCase());r[n]=i}),r}function kh(t,r){return Nd(t)[r]}import{useState as fh}from"react";import{jsx as Yt,jsxs as Pd}from"react/jsx-runtime";function qo({node:t,isDropTarget:r,dropTargetId:e}){var F;let{state:a,select:o,removeNode:i}=$(),{config:n}=E(),d=a.selectedId===t.id,[l,c]=fh(!1),h=d||l,{setNodeRef:s,attributes:u,listeners:k,transform:p,transition:g,isDragging:x,setActivatorNodeRef:b}=te({id:t.id,data:{kind:"columns"}}),m=t.attributes||{},v=(t.children||[]).filter(A=>A.type==="column"),f=Math.max(1,v.length),M=Da(f),L=parseInt((F=m.gap)!=null?F:16,10)||0,w=m.backgroundColor&&m.backgroundColor!=="transparent"?m.backgroundColor:void 0,B=Array.isArray(m.padding)?m.padding:[0,0,0,0],S=Array.isArray(m.margin)?m.margin:[0,0,0,0],W={transform:xt.Transform.toString(p),transition:g,opacity:x?.3:1,outline:d?"2px solid #0073e6":l?"1px solid rgba(0,115,230,.45)":"2px solid transparent"},z=A=>A.stopPropagation();return Pd("div",{ref:s,className:"relative outline-offset-[-1px] cursor-pointer",style:W,"data-kzeditor-id":t.id,onClick:A=>{A.stopPropagation(),o(t.id)},onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),children:[r&&Yt("div",{className:"absolute -top-0.5 left-0 right-0 h-[3px] bg-[#0073e6] rounded-[2px] pointer-events-none z-[2]"}),Pd("div",{className:"kzeditor-v2-section-toolbar absolute -top-3.5 right-0 gap-1 z-[3]",style:{display:h?"flex":"none"},onMouseDown:z,children:[Yt("span",{ref:b,...k,...u,onClick:z,title:n.drag_columns,className:"inline-flex items-center justify-center w-[22px] h-[22px] rounded bg-[#0073e6] text-white text-[11px] font-bold border-0 cursor-pointer select-none",children:"\u22EE\u22EE"}),Yt("span",{className:"inline-flex items-center px-2 py-0 h-[22px] rounded bg-[#0073e6] text-white text-[10px] font-bold tracking-wider uppercase",children:n.columns}),Yt("button",{type:"button",onClick:A=>{A.stopPropagation(),i(t.id)},title:n.delete_columns,className:"inline-flex items-center justify-center w-[22px] h-[22px] rounded bg-[#ef4444] text-white text-[11px] font-bold border-0 cursor-pointer select-none",children:"\u2715"})]}),Yt("div",{style:{margin:Id(S)},children:Yt("div",{className:"box-border",style:{padding:Id(B),background:w},onClick:z,children:Yt("div",{className:"flex w-full",style:{alignItems:xh(m.valign)},children:v.map((A,H)=>Yt("div",{className:"box-border",style:{flexBasis:`${M}%`,maxWidth:`${M}%`,paddingLeft:Math.max(H>0?L/2:0,3),paddingRight:Math.max(H<f-1?L/2:0,3)},children:Yt(Xt,{containerId:A.id,items:A.children||[],dropTargetId:e,emptyMessage:"Drop here",compact:!0})},A.id))})})})]})}var Id=t=>(Array.isArray(t)?t:[0,0,0,0]).map(r=>`${parseInt(r,10)||0}px`).join(" "),xh=t=>t==="middle"?"center":t==="bottom"?"flex-end":"flex-start";import{createContext as vh,useContext as Lh}from"react";var Go=vh({blockRenderers:Ta}),Od=()=>Lh(Go);import{jsx as Ko}from"react/jsx-runtime";function Xo({node:t,isDropTarget:r,dropTargetId:e}){let a=Mh(De),{blockRenderers:o}=Od();if(t.type==="columns")return Ko(qo,{node:t,isDropTarget:r,dropTargetId:e});if(Ea.has(t.type))return Ko(Zo,{node:t,isDropTarget:r,dropTargetId:e});let i=yh(()=>{let n=o[t.type];return n?n(t,a):""},[t,a,o]);return Ko(Uo,{id:t.id,html:i,isDropTarget:r})}var De=mh.createContext({fontFamily:"Arial, sans-serif",contentWidth:600});import{useEffect as $d,useMemo as Ch,useRef as Ud,useState as Zd}from"react";import{createContext as bh,useContext as wh}from"react";var Te=bh({}),_d=()=>wh(Te);import{jsx as Wt,jsxs as re}from"react/jsx-runtime";q();var Yo="text";function lr({blocks:t,containerId:r="root",compact:e=!1,variant:a,wrapStyle:o,suffix:i}){let{addChild:n}=$(),{config:d}=E(),l=_d(),c=t||l,[h,s]=Zd(!1),[u,k]=Zd(""),p=Ud(null),g=Ud(null);$d(()=>{if(!h)return;let f=M=>{p.current&&!p.current.contains(M.target)&&s(!1)};return document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[h]),$d(()=>{if(!h)return;k("");let f=window.setTimeout(()=>{var M;return(M=g.current)==null?void 0:M.focus()},0);return()=>window.clearTimeout(f)},[h]);let x=f=>{let M=c==null?void 0:c[f];M&&(n(r,Sr(f,M),-1),s(!1))},b=Ch(()=>Object.entries(c||{}).filter(([,f])=>!f.root&&!f.hidden).sort(([f],[M])=>f===Yo?-1:M===Yo?1:0),[c]),m=u.trim().toLowerCase(),v=m?b.filter(([f,M])=>(M.name||f).toLowerCase().includes(m)||f.toLowerCase().includes(m)):b;return re("div",{ref:p,className:`${D("kzeditor-quick-add",i)} ${e?"is-compact":""} ${a?`is-${a}`:""}`,style:o,onClick:f=>f.stopPropagation(),children:[e?Wt("button",{type:"button",onClick:()=>s(f=>!f),className:"kzeditor-plus-btn",title:d.insert_block,children:Wt(Ao,{size:16})}):re("div",{className:"kzeditor-split-btn",children:[re("button",{type:"button",onClick:()=>x(Yo),className:"kzeditor-split-main",title:d.add_a_text_block,children:[Wt(Ao,{size:14}),Wt("span",{children:d.add_block})]}),Wt("button",{type:"button",onClick:()=>s(f=>!f),className:"kzeditor-split-caret",title:d.choose_a_block,children:Wt(Ca,{size:14})})]}),h&&re("div",{className:`${D("kzeditor-quick-add-menu",i)} ${e?"is-compact":""}`,children:[re("div",{className:"kzeditor-search",children:[Wt(va,{size:14}),Wt("input",{ref:g,type:"text",className:"kzeditor-search-input",value:u,onChange:f=>k(f.target.value),onKeyDown:f=>{f.key==="Escape"&&s(!1),f.key==="Enter"&&v[0]&&x(v[0][0])},placeholder:d.search_blocks})]}),Wt("div",{className:"kzeditor-menu-list",children:v.length===0?Wt("div",{className:"kzeditor-lib-empty",children:d.no_blocks_found}):v.map(([f,M])=>{var S;let L=ja[f],w=M.name||f,B=(S=d["block_"+f])!=null?S:w;return re("button",{type:"button",onClick:()=>x(f),className:"kzeditor-menu-item",children:[Wt("span",{className:"kzeditor-menu-icon",children:L?Wt(L,{size:15}):B[0].toUpperCase()}),Wt("span",{children:B})]},f)})})]})]})}import{Fragment as jh,jsx as cr,jsxs as qd}from"react/jsx-runtime";q();function Xt({containerId:t,items:r,dropTargetId:e,emptyMessage:a,compact:o=!1,addInside:i=!1,suffix:n}){let d=r.map(s=>s.id),l=`drop-end-${t}`,{setNodeRef:c,isOver:h}=pa({id:l,data:{source:"drop-end",containerId:t}});return cr(Dd,{id:`ctx-${t}`,items:d,strategy:Hd,children:d.length===0?qd("div",{ref:c,className:`${D("kzeditor-empty-drop",n)} ${o?"is-compact":""} ${h?"is-over":""}`,children:[cr(lr,{containerId:t,compact:o,variant:"centered",suffix:n}),!o&&a&&cr("div",{children:a})]}):qd(jh,{children:[r.map(s=>cr(Xo,{node:s,isDropTarget:e===s.id,dropTargetId:e},s.id)),cr(Wh,{ref:c,isOver:h,showLine:e===l}),i&&cr(lr,{containerId:t,compact:!0,variant:"append",suffix:n})]})})}var Wh=Bh.forwardRef(({isOver:t,showLine:r},e)=>cr("div",{ref:e,className:"relative h-3 my-0.5",children:(r||t)&&cr("div",{className:"absolute top-[5px] left-0 right-0 h-[3px] bg-[#0073e6] rounded-[2px]"})}));import{jsx as Ee,jsxs as Ah}from"react/jsx-runtime";q();var Sh=t=>String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),Hh=t=>{let r={};return Object.entries(t||{}).forEach(([e,a])=>{r[e.replace(/-([a-z])/g,(o,i)=>i.toUpperCase())]=a}),r};function Jo({dropTargetId:t,blocks:r,suffix:e}){var p;let{state:a,select:o,addChild:i}=$(),{config:n}=E();zh(()=>{let g=x=>{if(a.editingId)return;let b=x.target;if(b&&b.closest&&b.closest('input, textarea, select, [contenteditable="true"]'))return;let m=x.clipboardData;if(!m)return;let v=m.getData("text/html"),f=m.getData("text/plain"),M=[];v&&v.trim()?M=Yr(v,r):f&&f.trim()&&(M=f.split(/\n{2,}/).map(L=>L.trim()).filter(Boolean).map(L=>Yr(`<p>${Sh(L).replace(/\n/g,"<br>")}</p>`,r)[0]).filter(Boolean)),M.length&&(x.preventDefault(),M.forEach(L=>i("root",L,-1)))};return document.addEventListener("paste",g),()=>document.removeEventListener("paste",g)},[a.editingId,r,i]);let d=Gd(()=>Cd(a.tree),[a.tree]),l=Gd(()=>({fontFamily:d.fontFamily,contentWidth:d.contentWidth}),[d.fontFamily,d.contentWidth]),c=Array.isArray(d.padding)?d.padding:[40,20,40,20],h=c.length===4&&c[0]===40&&c[1]===20&&c[2]===40&&c[3]===20,s={...X(d.contentBorder||{}),...vt(d.contentBoxShadow||{})},u=d.rootType==="certificate",k=(()=>{if(!u)return null;let g=Ae(a.tree.root);return{maxWidth:1040,width:"100%",aspectRatio:`${g.wMm} / ${g.hMm}`,padding:c.map(x=>`${x}px`).join(" "),fontFamily:d.fontFamily||"Poppins",overflow:"visible",...Hh(Oo(a.tree.root))}})();return Ee("div",{className:D("kzeditor-canvas",e),style:!u&&d.bgColor&&String(d.bgColor).toUpperCase()!=="#F1F5F9"?{background:d.bgColor}:void 0,onClick:()=>o("root"),children:Ee("div",{className:`kzeditor-canvas-page${u?" kzeditor-canvas-page--certificate":""}`,style:u?k:{...d.contentWidth!==600?{maxWidth:d.contentWidth}:null,...d.contentBg&&String(d.contentBg).toUpperCase()!=="#FFFFFF"?{background:d.contentBg}:null,...d.fontFamily&&d.fontFamily!=="Arial, sans-serif"?{fontFamily:d.fontFamily}:null,...h?null:{padding:c.map(g=>`${g}px`).join(" ")},boxShadow:s["box-shadow"]||void 0,borderRadius:s["border-radius"]||void 0,border:s.border||void 0},onClick:g=>g.stopPropagation(),children:Ee(Te.Provider,{value:r||{},children:Ah(De.Provider,{value:l,children:[Ee(Xt,{containerId:"root",items:a.tree.root.children||[],dropTargetId:t,emptyMessage:n.drag_blocks_here,suffix:e}),((p=a.tree.root.children)==null?void 0:p.length)>0&&Ee(lr,{containerId:"root",suffix:e})]})})})})}import{useEffect as Nh,useLayoutEffect as Ih,useRef as o2,useState as Qo}from"react";var Q=(t,r=null)=>document.execCommand(t,!1,r),Kd=(t,r)=>{document.execCommand("styleWithCSS",!1,!0),document.execCommand(t,!1,r),document.execCommand("styleWithCSS",!1,!1)},Xd=t=>Q("formatBlock",t),Yd=t=>typeof t=="string"&&/^(https?:\/\/|mailto:)\S+$/i.test(t.trim()),_a=t=>Q("insertHTML",t),Vh=(t,r)=>{let e=String(t).replace(/"/g,"%22"),a=(r==null?t:r).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");return`<a href="${e}">${a}</a>`},$a=(t=window.prompt)=>{let r=window.getSelection(),e=!r||r.rangeCount===0||r.getRangeAt(0).collapsed,a=za(t("Link URL:","https://"));!a||a==="https://"||(e?_a(Vh(a)):Q("createLink",a))},Jd=()=>{let t=window.getSelection();if(!t||t.rangeCount===0)return!1;let r=t.getRangeAt(0);if(!r.collapsed)return!1;let e=r.startContainer;if(e.nodeType!==3)return!1;let a=r.startOffset,i=e.textContent.slice(0,a).match(/(^|\s)((?:https?:\/\/|mailto:)[^\s]+)$/);if(!i)return!1;let n=i[2],d=a-n.length,l=document.createRange();return l.setStart(e,d),l.setEnd(e,a),t.removeAllRanges(),t.addRange(l),Q("createLink",n),t.collapseToEnd(),!0},Ua=()=>Q("unlink"),Za=t=>Q("insertText",t),Qd=(t,r)=>{let e=window.getSelection();if(!e||e.rangeCount===0)return;let a=e.getRangeAt(0),o=a.startContainer;if(o.nodeType===3&&t>0){let i=a.startOffset,n=Math.max(0,i-t),d=document.createRange();d.setStart(o,n),d.setEnd(o,i),e.removeAllRanges(),e.addRange(d)}Q("insertText",r)},t2=t=>{if(!t)return;let r=String(t).replace(/"/g,"%22");_a(`<img src="${r}" alt="" style="max-width: 100%; height: auto;" />`)},r2=()=>Q("removeFormat"),qa=()=>{let t=window.getSelection();return t&&t.rangeCount?t.getRangeAt(0).cloneRange():null},Ga=t=>{if(!t)return;let r=window.getSelection();r.removeAllRanges(),r.addRange(t)},Dh=new Set(["address","article","aside","blockquote","details","dialog","dd","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","li","main","nav","ol","p","section","table","thead","tbody","tfoot","tr","td","th","ul","video"]),Th=new Set(["pre","textarea","script","style"]),Eh=" ",Rh=t=>!!t&&t.nodeType===1&&Dh.has(t.tagName.toLowerCase()),Fh=t=>{let r=t.cloneNode(!1).outerHTML;return r.slice(0,r.indexOf(">")+1)},e2=(t,r)=>{let e=Eh.repeat(r);if(t.nodeType===3){let n=t.textContent.replace(/\s+/g," ").trim();return n?e+n:""}if(t.nodeType===8)return e+"<!--"+t.textContent+"-->";if(t.nodeType!==1)return"";let a=t.tagName.toLowerCase();if(Th.has(a))return e+t.outerHTML;let o=Array.from(t.childNodes);if(!o.some(Rh))return e+t.outerHTML;let i=o.map(n=>e2(n,r+1)).filter(Boolean).join(`
137
+ `);return e+Fh(t)+`
137
138
  `+i+`
138
- `+e+"</"+a+">"},r2=t=>{if(!t)return"";let r=document.createElement("div");return r.innerHTML=t,Array.from(r.childNodes).map(e=>t2(e,0)).filter(Boolean).join(`
139
- `)};import{Fragment as Oh,jsx as it,jsxs as Dt}from"react/jsx-runtime";function Fe(){let{config:t}=E(),[r,e]=Qo(null),[a,o]=Qo(!1),[i,n]=Qo(""),d=e2(null),l=e2({editable:null,range:null}),c=ir(),h=c.length>0;if(Rh(()=>{let v=()=>{let k=Ph(h);e(k),k||o(!1)};return document.addEventListener("selectionchange",v),window.addEventListener("scroll",v,!0),window.addEventListener("resize",v),()=>{document.removeEventListener("selectionchange",v),window.removeEventListener("scroll",v,!0),window.removeEventListener("resize",v)}},[h]),Eh(()=>{if(!r||!d.current)return;let v=d.current,k=v.getBoundingClientRect(),m=8,{top:L,left:w}=r;L<m&&(L=r.belowTop),w<m&&(w=m),w+k.width>window.innerWidth-m&&(w=window.innerWidth-k.width-m),v.style.top=`${L}px`,v.style.left=`${w}px`},[r]),!r)return null;let s=(v,k)=>m=>{m.preventDefault(),Q(v,k)},u=v=>{v.preventDefault(),$a()},f=v=>{v.preventDefault(),Ua()},p=v=>{if(v.preventDefault(),!a){let k=window.getSelection(),m=null;if(k&&k.rangeCount){let L=k.getRangeAt(0).commonAncestorContainer,w=L.nodeType===1?L:L.parentElement;m=w?w.closest('[data-emb-editable="richtext"]'):null}l.current={editable:m,range:qa()},n("")}o(k=>!k)},g=v=>{if(!v)return;let{editable:k,range:m}=l.current;k&&k.focus(),m&&Ga(m),Za(v),o(!1),n("")},x=v=>k=>{k.preventDefault(),g(v)},y=i.trim().toLowerCase(),M=y?c.filter(v=>(v.label||"").toLowerCase().includes(y)||(v.tag||"").toLowerCase().includes(y)):c;return Dt("div",{ref:d,className:"emb-rt-toolbar",style:{top:r.top,left:r.left},onMouseDown:v=>v.preventDefault(),children:[Dt(br,{title:t.bold,onMouseDown:s("bold"),children:[" ",it(Ur,{size:13})]}),Dt(br,{title:t.italic,onMouseDown:s("italic"),children:[" ",it(_r,{size:13})]}),Dt(br,{title:t.underline,onMouseDown:s("underline"),children:[" ",it(zr,{size:13})]}),Dt(br,{title:t.strikethrough,onMouseDown:s("strikeThrough"),children:[" ",it(Or,{size:13})]}),it(a2,{}),Dt(br,{title:t.insert_link,onMouseDown:u,children:[" ",it(ma,{size:13})]}),Dt(br,{title:t.remove_link,onMouseDown:f,children:[" ",it("span",{className:"text-[10px]",children:"\u2310"})]}),c.length>0&&!r.tagsDisabled&&Dt(Oh,{children:[it(a2,{}),Dt("div",{className:"relative",children:[it(br,{title:t.insert_merge_tag,onMouseDown:p,children:it(Pr,{size:13})}),a&&Dt("div",{className:Fh,style:{position:"absolute",top:"100%",left:0,marginTop:4,zIndex:1001},children:[Dt("div",{className:"flex gap-1 p-1",children:[it("input",{type:"text",autoFocus:!0,value:i,placeholder:t.search_or_type_a_tag,onChange:v=>n(v.target.value),onMouseDown:v=>v.stopPropagation(),onKeyDown:v=>{var k;v.key==="Enter"&&(v.preventDefault(),g(((k=M[0])==null?void 0:k.tag)||i.trim()))},className:zh}),it("button",{type:"button",title:t.insert,onMouseDown:v=>{var k;v.preventDefault(),g(((k=M[0])==null?void 0:k.tag)||i.trim())},className:Ih,children:t.insert})]}),it("div",{className:"max-h-[200px] overflow-y-auto",children:M.length===0?it("div",{className:"emb-merge-tag-empty",children:t.no_matching_tags}):M.map(v=>Dt("button",{type:"button",onMouseDown:x(v.tag),className:Nh,children:[it("span",{className:"font-semibold",children:v.label||v.tag}),it("span",{className:"opacity-[.55] ml-auto pl-3 text-[11px]",children:v.tag})]},v.tag))})]})]})]})]})}var br=({title:t,onMouseDown:r,children:e})=>it("button",{type:"button",title:t,onMouseDown:r,className:"emb-rt-toolbar-btn",children:e}),a2=()=>it("span",{className:"emb-rt-sep"}),Fh="emb-merge-tag-menu",Nh="emb-merge-tag-item",zh="emb-merge-tag-search",Ih="emb-merge-tag-insert";function Ph(t=!1){let r=window.getSelection();if(!r||r.rangeCount===0||r.isCollapsed&&!t)return null;let e=r.getRangeAt(0),a=e.commonAncestorContainer,o=a.nodeType===1?a:a.parentElement;if(!o)return null;let i=o.closest('[data-emb-editable="richtext"]');if(!i||i.getAttribute("contenteditable")!=="true")return null;let n=i.getAttribute("data-emb-merge-tags")==="off";if(r.isCollapsed&&n)return null;let d=e.getBoundingClientRect();if(!d||d.width===0&&d.height===0)return null;let c=d.top-34-8,h=d.bottom+8,s=d.left+d.width/2-100;return{top:c,left:s,belowTop:h,tagsDisabled:n}}import{useEffect as o2,useRef as _h,useState as i2}from"react";import{jsx as ti,jsxs as Zh}from"react/jsx-runtime";var $h=/(^|\s)@([\p{L}\d_.]*)$/u;function Ne(){let t=ir(),[r,e]=i2(null),[a,o]=i2(0),i=_h(null);o2(()=>{if(!t.length)return;let d=()=>{let l=Uh(t);e(l),o(0)};return document.addEventListener("selectionchange",d),document.addEventListener("input",d,!0),window.addEventListener("scroll",d,!0),()=>{document.removeEventListener("selectionchange",d),document.removeEventListener("input",d,!0),window.removeEventListener("scroll",d,!0)}},[t]),o2(()=>{if(!r)return;let d=l=>{let c=r.items.length;c&&(l.key==="ArrowDown"?(l.preventDefault(),o(h=>(h+1)%c)):l.key==="ArrowUp"?(l.preventDefault(),o(h=>(h-1+c)%c)):l.key==="Enter"||l.key==="Tab"?(l.preventDefault(),n(r.items[a])):l.key==="Escape"&&(l.preventDefault(),e(null)))};return document.addEventListener("keydown",d,!0),()=>document.removeEventListener("keydown",d,!0)},[r,a]);let n=d=>{var l;d&&(Yd((((l=r==null?void 0:r.query)==null?void 0:l.length)||0)+1,d.tag),e(null))};return!r||!r.items.length?null:ti("div",{ref:i,style:{position:"fixed",top:r.top,left:r.left,background:"#fff",color:"#0f172a",borderRadius:6,boxShadow:"0 8px 24px rgba(0,0,0,.2)",border:"1px solid #e2e8f0",minWidth:220,maxHeight:260,overflowY:"auto",padding:4,zIndex:1002},onMouseDown:d=>d.preventDefault(),children:r.items.map((d,l)=>Zh("button",{type:"button",onMouseDown:c=>{c.preventDefault(),n(d)},onMouseEnter:()=>o(l),style:{display:"flex",alignItems:"center",width:"100%",textAlign:"left",background:l===a?"#eff6ff":"transparent",border:"none",borderRadius:4,padding:"6px 8px",cursor:"pointer",fontSize:12},children:[ti("span",{style:{fontWeight:600},children:d.label||d.tag}),ti("span",{style:{opacity:.55,marginLeft:"auto",paddingLeft:12,fontSize:11},children:d.tag})]},d.tag))})}function Uh(t){let r=window.getSelection();if(!r||r.rangeCount===0||!r.isCollapsed)return null;let e=r.getRangeAt(0),a=e.startContainer;if(a.nodeType!==3)return null;let o=a.parentElement,i=o&&o.closest('[data-emb-editable="richtext"]');if(!i||i.getAttribute("contenteditable")!=="true"||i.getAttribute("data-emb-merge-tags")==="off")return null;let d=a.textContent.slice(0,e.startOffset).match($h);if(!d)return null;let l=(d[2]||"").toLowerCase(),c=t.filter(f=>l?(f.label||"").toLowerCase().includes(l)||(f.tag||"").toLowerCase().includes(l):!0);if(!c.length)return null;let h=e.getClientRects()[0]||e.getBoundingClientRect(),s=(h.bottom||h.top||0)+6,u=h.left||0;return{items:c,query:l,top:s,left:u}}import{useEffect as n2,useState as Ka}from"react";import{jsx as ut,jsxs as Xa}from"react/jsx-runtime";q();function ze({tree:t,onClose:r,renderFn:e,suffix:a}){let{config:o}=E(),[i,n]=Ka(""),[d,l]=Ka("desktop"),[c,h]=Ka(!0),[s,u]=Ka(null);console.log({html:i});let f=async()=>{var g,x;h(!0),u(null);try{let y=await e(t);n(y||"")}catch(y){u(((x=(g=y==null?void 0:y.response)==null?void 0:g.data)==null?void 0:x.message)||y.message||"Render failed")}finally{h(!1)}};n2(()=>{f()},[]),n2(()=>{let g=x=>{x.key==="Escape"&&r()};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[r]);let p=d==="mobile"?375:760;return ut("div",{onClick:r,className:T("emb-preview-backdrop",a),children:Xa("div",{onClick:g=>g.stopPropagation(),className:T("emb-preview-dialog",a),children:[ut(qh,{device:d,setDevice:l,onReload:f,onClose:r,suffix:a}),ut("div",{className:T("emb-preview-body",a),children:c?ut("div",{className:T("emb-preview-loading",a),children:o.rendering}):s?ut("div",{className:`${T("emb-preview-loading",a)} is-error`,children:s}):ut("iframe",{title:"email-preview",srcDoc:i,className:T("emb-preview-frame",a),style:{width:p}})})]})})}function qh({device:t,setDevice:r,onReload:e,onClose:a,suffix:o}){let{config:i}=E();return Xa("div",{className:T("emb-preview-header",o),children:[ut("div",{className:T("emb-preview-title",o),children:i.email_preview}),Xa(d2,{active:t==="desktop",onClick:()=>r("desktop"),suffix:o,children:[ut(In,{size:14}),ut("span",{children:i.desktop})]}),Xa(d2,{active:t==="mobile",onClick:()=>r("mobile"),suffix:o,children:[ut(Hn,{size:14}),ut("span",{children:i.mobile})]}),ut("button",{type:"button",onClick:e,className:T("emb-preview-icon-btn",o),title:i.reload,children:ut(Rn,{size:14})}),ut("button",{type:"button",onClick:a,className:T("emb-preview-icon-btn",o),title:i.close_esc,children:ut(Nr,{size:16})})]})}var d2=({active:t,onClick:r,children:e,suffix:a})=>ut("button",{type:"button",onClick:r,className:`${T("emb-device-tab",a)} ${t?"is-active":""}`,children:e});import"react";import{jsx as jt,jsxs as Ya}from"react/jsx-runtime";function ri({templates:t=[],onPick:r,onClose:e}){let{config:a}=E();return jt("div",{role:"dialog","aria-modal":"true",style:{position:"fixed",inset:0,zIndex:1e5,background:"rgba(15,23,42,.55)",display:"flex",alignItems:"center",justifyContent:"center",padding:24},onClick:e,children:Ya("div",{style:{width:"min(880px, 100%)",maxHeight:"86vh",display:"flex",flexDirection:"column",background:"#fff",borderRadius:10,overflow:"hidden",boxShadow:"0 24px 60px rgba(0,0,0,.30)"},onClick:o=>o.stopPropagation(),children:[Ya("header",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"14px 18px",borderBottom:"1px solid #e2e8f0"},children:[jt("strong",{style:{fontSize:15,color:"#0f172a"},children:a.choose_a_template}),jt("button",{type:"button",onClick:e,"aria-label":a.close,style:{border:"none",background:"transparent",cursor:"pointer",color:"#64748b",display:"inline-flex"},children:jt(Nr,{size:18})})]}),jt("div",{style:{padding:18,overflowY:"auto"},children:t.length===0?jt("div",{style:{padding:32,textAlign:"center",color:"#94a3b8",fontSize:13},children:a.no_templates_available}):jt("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill,minmax(220px,1fr))",gap:16},children:t.map(o=>jt(Gh,{template:o,onPick:()=>r(o)},o.id))})})]})})}function Gh({template:t,onPick:r}){return Ya("button",{type:"button",onClick:r,style:{display:"flex",flexDirection:"column",textAlign:"left",padding:0,background:"#fff",border:"1px solid #e2e8f0",borderRadius:8,cursor:"pointer",overflow:"hidden",transition:"border-color .15s, box-shadow .15s"},onMouseEnter:e=>{e.currentTarget.style.borderColor="#0073e6",e.currentTarget.style.boxShadow="0 6px 16px rgba(0,115,230,.12)"},onMouseLeave:e=>{e.currentTarget.style.borderColor="#e2e8f0",e.currentTarget.style.boxShadow="none"},children:[jt("div",{style:{height:120,background:"#f1f5f9",display:"flex",alignItems:"center",justifyContent:"center",color:"#94a3b8",overflow:"hidden"},children:t.thumbnail?jt("img",{src:t.thumbnail,alt:"",style:{width:"100%",height:"100%",objectFit:"cover"}}):jt(Ma,{size:30})}),Ya("div",{style:{padding:"10px 12px"},children:[jt("div",{style:{fontSize:13,fontWeight:600,color:"#0f172a"},children:t.label||t.id}),t.description&&jt("div",{style:{fontSize:12,color:"#64748b",marginTop:2,lineHeight:1.4},children:t.description})]})]})}import{useEffect as Kh}from"react";import{jsx as Ja,jsxs as Xh}from"react/jsx-runtime";q();var l2=t=>{if(!t)return!1;let r=t.tagName;return r==="INPUT"||r==="TEXTAREA"||r==="SELECT"||t.isContentEditable};function Qa(){let{undo:t,redo:r}=$();Kh(()=>{let e=a=>{if(!(a.metaKey||a.ctrlKey))return;let o=(a.key||"").toLowerCase();o!=="z"&&o!=="y"||l2(a.target)||l2(document.activeElement)||(o==="y"||o==="z"&&a.shiftKey?(a.preventDefault(),r()):(a.preventDefault(),t()))};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[t,r])}function to({suffix:t}){let{undo:r,redo:e,canUndo:a,canRedo:o}=$(),{config:i}=E();return Xh("div",{className:T("emb-undo-redo",t),children:[Ja("button",{type:"button",onClick:r,disabled:!a,title:i.undo_shortcut,children:Ja(Wn,{size:15})}),Ja("button",{type:"button",onClick:e,disabled:!o,title:i.redo_shortcut,children:Ja(En,{size:15})})]})}import{jsx as gt,jsxs as ee}from"react/jsx-runtime";q();var Qh=(t,r)=>r==="fragment"?Po(t):Fa(t);function ro({blocks:t,templates:r=[],onTemplatesClick:e,header:a=!1,height:o,renderMode:i="document",onChange:n,exposeApi:d,suffix:l,renderHtmlFn:c,previewRenderFn:h}){var z,G,O;let{state:s,markClean:u,setTree:f}=$(),{config:p}=E();Qa();let{sensors:g,activeDrag:x,overId:y,handlers:M}=Ba({blocks:t}),v=U=>c?c(U):Qh(U,i),k=h||Fa,[m,L]=ai(!1),[w,B]=ai(!1),[H,W]=ai(!1),S=U=>{var mt,Lt;!U||!U.tree||(((Lt=(mt=s.tree)==null?void 0:mt.root)==null?void 0:Lt.children)||[]).length>0&&!window.confirm(p.replace_content_confirm)||(f(JSON.parse(JSON.stringify(U.tree))),B(!1))},N=Jh(s.tree);N.current=s.tree;let V=Yh(()=>Kr(U=>{n&&n({tree:U,html:v(U)}),u()},600),[n,u,i,c]);ei(()=>{s.dirty&&V(s.tree)},[s.tree,s.dirty,V]),ei(()=>()=>V.cancel&&V.cancel(),[V]),ei(()=>{d&&d({getTree:()=>N.current,getHtml:()=>v(N.current),setTree:U=>f(U)})},[d,f,i,c]);let A=a!==!1;return gt("div",{className:T("emb-embed-root",l),style:o!=null?{height:o}:void 0,children:ee(ua,{sensors:g,collisionDetection:la,onDragStart:M.onDragStart,onDragOver:M.onDragOver,onDragEnd:M.onDragEnd,children:[A&&gt(t0,{suffix:l,config:p,onPreview:()=>L(!0),onTemplates:e||(r.length?()=>B(!0):null)}),ee("div",{className:T("emb-shell-body",l),children:[gt(Se,{blocks:t,navOpen:H,onToggleNav:()=>W(U=>!U),suffix:l}),H&&gt(Ae,{blocks:t,onClose:()=>W(!1),suffix:l}),gt(Jo,{dropTargetId:y,blocks:t,suffix:l})]}),gt(fa,{children:((G=(z=x==null?void 0:x.data)==null?void 0:z.current)==null?void 0:G.source)==="library"&&gt("div",{className:T("emb-drag-chip",l),children:((O=t[x.data.current.type])==null?void 0:O.name)||x.data.current.type})}),gt(Fe,{}),gt(Ne,{}),m&&gt(ze,{tree:s.tree,renderFn:k,onClose:()=>L(!1),suffix:l}),w&&gt(ri,{templates:r,onPick:S,onClose:()=>B(!1)})]})})}function t0({onPreview:t,onTemplates:r,suffix:e,config:a}){return ee("header",{className:T("emb-shell-header",e),children:[gt(to,{suffix:e}),ee("div",{style:{display:"inline-flex",alignItems:"center",gap:8},children:[r&&ee("button",{type:"button",onClick:r,className:T("emb-templates-btn",e),children:[gt(Ma,{size:14}),gt("span",{children:a.templates})]}),ee("button",{type:"button",onClick:t,className:T("emb-preview-btn",e),children:[gt(ba,{size:14}),gt("span",{children:a.preview})]})]})]})}import{useEffect as di,useMemo as m0,useRef as M0,useState as g2}from"react";import{useMemo as h2}from"react";var r0={fontFamily:"system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif",labelColor:"#334155",inputBg:"#FFFFFF",inputText:"#0F172A",inputBorder:"#CBD5E1",radius:6,accent:"#0073E6"},yr=(t,r)=>t&&t[r]!=null?t[r]:r0[r],oi=t=>j({width:"100%",padding:"9px 11px",border:`1px solid ${yr(t,"inputBorder")}`,"border-radius":`${yr(t,"radius")}px`,background:yr(t,"inputBg"),color:yr(t,"inputText"),"font-size":"14px","font-family":"inherit","line-height":"1.4","box-sizing":"border-box",outline:"none"}),eo=(t,r)=>{let e=t.attributes||{};if(e.showLabel===!1||!e.label)return"";let a=e.required?'<span aria-hidden="true" style="color:#dc2626;margin-left:2px">*</span>':"",o=j({display:"block","margin-bottom":"5px","font-size":"13px","font-weight":"600",color:yr(r,"labelColor")});return`<label for="${b(Pe(t))}" style="${b(o)}">${Z(e.label)}${a}</label>`},ao=(t,r)=>{let e=t.attributes||{};if(!e.helpText)return"";let a=j({display:"block","margin-top":"4px","font-size":"12px",color:"#94A3B8"});return`<small style="${b(a)}">${Z(e.helpText)}</small>`},Pe=t=>`f_${t.id||t.attributes&&t.attributes.name||"field"}`,Ie=t=>String(t.attributes&&t.attributes.name||"field"),oo=(t,r)=>{var o;let e=t.attributes||{},a=j({padding:R((o=e.padding)!=null?o:[0,0,12,0])});return`<div class="emb-form-field" style="${b(a)}">${r}</div>`},io=t=>t.attributes&&t.attributes.required?" required":"",e0=(t,r)=>{let e=t.attributes||{},a=["text","email","number","tel","url","date","password"].includes(e.inputType)?e.inputType:"text",o=`<input type="${b(a)}" id="${b(Pe(t))}" name="${b(Ie(t))}" placeholder="${b(e.placeholder||"")}"`+(e.defaultValue?` value="${b(e.defaultValue)}"`:"")+` style="${b(oi(r))}"${io(t)} />`;return oo(t,eo(t,r)+o+ao(t,r))},a0=(t,r)=>{var i;let e=t.attributes||{},a=parseInt((i=e.rows)!=null?i:4,10)||4,o=`<textarea id="${b(Pe(t))}" name="${b(Ie(t))}" rows="${a}" placeholder="${b(e.placeholder||"")}" style="${b(j({...u0(oi(r)),resize:"vertical"}))}"${io(t)}>`+Z(e.defaultValue||"")+"</textarea>";return oo(t,eo(t,r)+o+ao(t,r))},o0=(t,r)=>{let e=t.attributes||{},a=ae(e.options),o=e.placeholder?`<option value="" disabled selected>${Z(e.placeholder)}</option>`:"",i=a.map(d=>`<option value="${b(d.value)}">${Z(d.label)}</option>`).join(""),n=`<select id="${b(Pe(t))}" name="${b(Ie(t))}" style="${b(oi(r))}"${io(t)}>${o}${i}</select>`;return oo(t,eo(t,r)+n+ao(t,r))},i0=(t,r)=>c2(t,r,"radio"),n0=(t,r)=>c2(t,r,"checkbox"),c2=(t,r,e)=>{let a=t.attributes||{},o=ae(a.options),i=e==="checkbox"?`${Ie(t)}[]`:Ie(t),n=j({display:a.inline?"inline-flex":"flex","align-items":"center",gap:"6px","margin-right":a.inline?"16px":"0","margin-bottom":"6px","font-size":"14px",color:yr(r,"inputText")}),d=o.map((c,h)=>{let s=`${Pe(t)}_${h}`;return`<label for="${b(s)}" style="${b(n)}"><input type="${e}" id="${b(s)}" name="${b(i)}" value="${b(c.value)}"${h===0?io(t):""} /><span>${Z(c.label)}</span></label>`}).join(""),l=j({display:a.inline?"block":"flex","flex-direction":a.inline?null:"column"});return oo(t,eo(t,r)+`<div role="group" style="${b(l)}">${d}</div>`+ao(t,r))},d0=(t,r)=>{var n,d,l,c,h;let e=t.attributes||{},a=(n=e.alignment)!=null?n:"left",o=j({display:e.fullWidth?"block":"inline-block",width:e.fullWidth?"100%":null,background:(d=e.bg)!=null?d:yr(r,"accent"),color:(l=e.color)!=null?l:"#FFFFFF",padding:R((c=e.padding)!=null?c:[12,24,12,24]),"font-size":"14px","font-weight":"600","font-family":"inherit",cursor:"pointer","text-align":"center",...X((h=e.border)!=null?h:{})}),i=j({"text-align":a,padding:R((e.padding,[0,0,0,0]))});return`<div class="emb-form-field" style="${b(j({"text-align":a,padding:"4px 0"}))}"><button type="submit" style="${b(o)}">${Z(e.text||"Submit")}</button></div>`},l0=t=>{var o,i,n;let r=t.attributes||{},e=["h1","h2","h3","h4"].includes(r.tag)?r.tag:"h3",a=j({margin:"0",padding:R((o=r.padding)!=null?o:[0,0,8,0]),"text-align":(i=r.alignment)!=null?i:"left",color:(n=r.color)!=null?n:"#0F172A","font-family":"inherit"});return`<${e} style="${b(a)}">${Z(r.text||"")}</${e}>`},c0=t=>{var a,o,i,n;let r=t.attributes||{},e=j({margin:"0",padding:R((a=r.padding)!=null?a:[0,0,8,0]),"text-align":(o=r.alignment)!=null?o:"left",color:(i=r.color)!=null?i:"#475569","font-size":"14px","line-height":"1.6","font-family":"inherit"});return`<div data-emb-editable="richtext" data-emb-field="text" style="${b(e)}">${(n=r.text)!=null?n:""}</div>`},h0=t=>{var o,i,n;let r=t.attributes||{},e=j({padding:R((o=r.padding)!=null?o:[8,0,8,0])}),a=j({"border-top":`${parseInt((i=r.thickness)!=null?i:1,10)||1}px solid ${(n=r.color)!=null?n:"#E2E8F0"}`,height:"0","line-height":"0","font-size":"0"});return`<div style="${b(e)}"><div style="${b(a)}"></div></div>`},s0=t=>{var a;let r=t.attributes||{};return`<div style="height:${parseInt((a=r.height)!=null?a:16,10)||16}px" aria-hidden="true"></div>`},ae=t=>Array.isArray(t)?t.map(r=>{var e,a,o,i;return typeof r=="string"?{label:r,value:r}:{label:(a=(e=r.label)!=null?e:r.value)!=null?a:"",value:(i=(o=r.value)!=null?o:r.label)!=null?i:""}}).filter(r=>r.label!==""||r.value!==""):[],u0=t=>{let r={};return String(t||"").split(";").forEach(e=>{let a=e.indexOf(":");if(a<0)return;let o=e.slice(0,a).trim();o&&(r[o]=e.slice(a+1).trim())}),r},Ut={field:e0,textarea:a0,select:o0,radio:i0,checkbox:n0,submit:d0,heading:l0,text:c0,divider:h0,spacer:s0};import{jsx as oe,jsxs as p0}from"react/jsx-runtime";q();var g0="system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif";function ii({dropTargetId:t,blocks:r,renderers:e,suffix:a}){var p;let{state:o,select:i}=$(),{config:n}=E(),d=o.tree.root||{},l=d.attributes||{},c=h2(()=>({blockRenderers:e||Ut}),[e]),h=h2(()=>{var g,x,y,M,v,k,m;return{fontFamily:(g=l.fontFamily)!=null?g:g0,contentWidth:(x=l.contentWidth)!=null?x:560,labelColor:(y=l.labelColor)!=null?y:"#334155",inputBg:(M=l.inputBg)!=null?M:"#FFFFFF",inputText:(v=l.inputText)!=null?v:"#0F172A",inputBorder:(k=l.inputBorder)!=null?k:"#CBD5E1",radius:(m=l.radius)!=null?m:6,accent:"#0073E6"}},[l.fontFamily,l.contentWidth,l.labelColor,l.inputBg,l.inputText,l.inputBorder,l.radius]),s=Array.isArray(l.padding)?l.padding:[24,24,24,24],u=s.length===4&&s.every(g=>g===24),f={...X(l.formBorder||{}),...xt(l.formBoxShadow||{})};return oe("div",{className:`${T("emb-canvas",a)} emb-canvas--form`,onClick:()=>i("root"),children:oe("div",{className:"emb-canvas-page emb-canvas-page--form",style:{...l.contentWidth!=null&&l.contentWidth!==560?{maxWidth:l.contentWidth}:null,...l.bgColor&&String(l.bgColor).toUpperCase()!=="#FFFFFF"?{background:l.bgColor}:null,...l.fontFamily?{fontFamily:h.fontFamily}:null,...u?null:{padding:s.map(g=>`${g}px`).join(" ")},borderRadius:f["border-radius"]||void 0,boxShadow:f["box-shadow"]||void 0,border:f.border||void 0},onClick:g=>g.stopPropagation(),children:oe(Re.Provider,{value:r||{},children:oe(Go.Provider,{value:c,children:p0(Te.Provider,{value:h,children:[oe(Xt,{containerId:"root",items:d.children||[],dropTargetId:t,emptyMessage:n.drag_form_fields_here,suffix:a}),((p=d.children)==null?void 0:p.length)>0&&oe(lr,{containerId:"root",suffix:a})]})})})})})}var f0={top:"start",middle:"center",bottom:"end"},s2=t=>{var e,a,o,i,n,d,l;let r=t&&t.attributes||{};return{fontFamily:(e=r.fontFamily)!=null?e:"system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif",labelColor:(a=r.labelColor)!=null?a:"#334155",inputBg:(o=r.inputBg)!=null?o:"#FFFFFF",inputText:(i=r.inputText)!=null?i:"#0F172A",inputBorder:(n=r.inputBorder)!=null?n:"#CBD5E1",radius:(d=r.radius)!=null?d:6,accent:(l=r.accent)!=null?l:"#0073E6"}},k0=(t,r,e)=>{var h,s,u;let a=(t.children||[]).filter(f=>f.type==="column"),o=Math.max(1,a.length),i=t.attributes||{},n=parseInt((h=i.gap)!=null?h:16,10)||0,d=a.map(f=>`<div style="min-width:0">${(f.children||[]).map(g=>Oe(g,r,e)).join("")}</div>`).join(""),l=j({display:"grid","grid-template-columns":`repeat(${o}, minmax(0, 1fr))`,gap:`${n}px`,"align-items":f0[i.valign]||"start"}),c=j({margin:R((s=i.margin)!=null?s:[0,0,0,0]),padding:R((u=i.padding)!=null?u:[0,0,0,0]),...i.backgroundColor&&i.backgroundColor!=="transparent"?{background:i.backgroundColor}:{}});return`<div style="${b(c)}"><div class="emb-cols" style="${b(l)}">${d}</div></div>`},x0=(t,r,e)=>{var c,h,s,u,f,p,g;let a=t.attributes||{},o=parseInt((c=a.maxWidth)!=null?c:0,10)||0,i=parseInt((h=a.minHeight)!=null?h:0,10)||0,n=(t.children||[]).map(x=>Oe(x,r,e)).join(""),d=j({margin:R((s=a.margin)!=null?s:[0,0,0,0])}),l=j({...a.backgroundColor&&a.backgroundColor!=="transparent"?{background:a.backgroundColor}:{},padding:R((u=a.padding)!=null?u:[0,0,0,0]),"text-align":(f=a.alignment)!=null?f:"left",...o>0?{"max-width":`${o}px`,"margin-left":"auto","margin-right":"auto"}:{},...i>0?{"min-height":`${i}px`}:{},...X((p=a.border)!=null?p:{}),...xt((g=a.boxShadow)!=null?g:{})});return`<div style="${b(d)}"><div style="${b(l)}">${n}</div></div>`},Oe=(t,r,e=Ut)=>{if(!t||typeof t!="object")return"";let a=t.type||"";if(a==="columns")return k0(t,r,e);if(a==="section")return x0(t,r,e);let o=e[a];return o?o(t,r):(t.children||[]).map(i=>Oe(i,r,e)).join("")},u2=(t,r)=>`<style>#${t} .emb-cols{}@media (max-width:${r}px){#${t} .emb-cols{grid-template-columns:1fr !important}}</style>`,ni=(t,r={})=>{var l;let e=t&&t.root;if(!e||typeof e!="object")return"";let a=r.renderers||Ut,o=s2(e),i=r.formId||"emb-form",n=parseInt((l=(e.attributes||{}).stackBelow)!=null?l:600,10)||600,d=(e.children||[]).map(c=>Oe(c,o,a)).join("");return u2(i,n)+`<div id="${b(i)}" class="emb-form-fields">${d}</div>`},no=(t,r={})=>{var h,s,u,f,p,g;let e=t&&t.root;if(!e||typeof e!="object")return"";let a=e.attributes||{},o=r.renderers||Ut,i=r.formId||"emb-form",n=parseInt((h=a.stackBelow)!=null?h:600,10)||600,d=s2(e),l=(e.children||[]).map(x=>Oe(x,d,o)).join(""),c=j({"max-width":`${parseInt((s=a.contentWidth)!=null?s:560,10)||560}px`,margin:"0 auto",padding:R((u=a.padding)!=null?u:[24,24,24,24]),background:(f=a.bgColor)!=null?f:"#FFFFFF","font-family":d.fontFamily,"box-sizing":"border-box",...X((p=a.formBorder)!=null?p:{}),...xt((g=a.formBoxShadow)!=null?g:{})});return u2(i,n)+`<form id="${b(i)}" class="emb-form" method="${b(r.method||"post")}"`+(r.action?` action="${b(r.action)}"`:"")+` style="${b(c)}" novalidate>`+l+"</form>"},v0=new Set(["field","textarea","select","radio","checkbox"]),L0=t=>{let r=t.attributes||{};return{name:String(r.name||""),type:t.type==="field"?r.inputType||"text":t.type,label:r.label||"",required:!!r.required,...r.options?{options:ae(r.options).map(e=>e.value)}:{}}},lo=(t,r={})=>{let e=r.schemaExtractors||{},a=[],o=i=>{if(!(!i||typeof i!="object")){if(e[i.type]){let n=e[i.type](i);n&&a.push(n)}else v0.has(i.type)&&a.push(L0(i));(i.children||[]).forEach(o)}};return o(t&&t.root),a};import{jsx as St,jsxs as co}from"react/jsx-runtime";q();var p2=(t,r,e)=>r==="fragment"?ni(t,{renderers:e}):no(t,{renderers:e});function li({blocks:t,renderers:r,controls:e=Xr,schemaExtractors:a,header:o=!1,height:i,renderMode:n="fragment",onChange:d,exposeApi:l,suffix:c}){var B,H,W;let{state:h,markClean:s,setTree:u}=$();Qa();let{sensors:f,activeDrag:p,overId:g,handlers:x}=Ba({blocks:t}),[y,M]=g2(!1),[v,k]=g2(!1),m=M0(h.tree);m.current=h.tree;let L=m0(()=>Kr(S=>{d&&d({tree:S,html:p2(S,n,r),schema:lo(S,{schemaExtractors:a})}),s()},600),[d,s,n,r,a]);di(()=>{h.dirty&&L(h.tree)},[h.tree,h.dirty,L]),di(()=>()=>L.cancel&&L.cancel(),[L]),di(()=>{l&&l({getTree:()=>m.current,getHtml:()=>p2(m.current,n,r),getSchema:()=>lo(m.current,{schemaExtractors:a}),setTree:S=>u(S)})},[l,u,n,r,a]);let w=o!==!1;return St(Eo.Provider,{value:e,children:St("div",{className:T("emb-embed-root",c),style:i!=null?{height:i}:void 0,children:co(ua,{sensors:f,collisionDetection:la,onDragStart:x.onDragStart,onDragOver:x.onDragOver,onDragEnd:x.onDragEnd,children:[w&&St(b0,{onPreview:()=>M(!0),suffix:c}),co("div",{className:T("emb-shell-body",c),children:[St(Se,{blocks:t,navOpen:v,onToggleNav:()=>k(S=>!S),suffix:c}),v&&St(Ae,{blocks:t,onClose:()=>k(!1),suffix:c}),St(ii,{dropTargetId:g,blocks:t,renderers:r,suffix:c})]}),St(fa,{children:((H=(B=p==null?void 0:p.data)==null?void 0:B.current)==null?void 0:H.source)==="library"&&St("div",{className:T("emb-drag-chip",c),children:((W=t[p.data.current.type])==null?void 0:W.name)||p.data.current.type})}),St(Fe,{}),y&&St(ze,{tree:h.tree,renderFn:S=>no(S,{renderers:r}),onClose:()=>M(!1),suffix:c})]})})})}function b0({onPreview:t,suffix:r}){let{config:e}=E();return co("header",{className:T("emb-shell-header",r),children:[St(to,{suffix:r}),co("button",{type:"button",onClick:t,className:T("emb-preview-btn",r),children:[St(ba,{size:14}),St("span",{children:e.preview})]})]})}import{useEffect as ho,useMemo as F0,useRef as pi,useState as fi}from"react";var _e=t=>({version:2,root:{id:"root",type:"email",attributes:{},children:[{id:`n_${Math.random().toString(36).slice(2,10)}`,type:"html",attributes:{html:String(t!=null?t:""),padding:[0,0,0,0],margin:[0,0,0,0]},children:[]}]}});import{useRef as y0,useState as w0}from"react";import{Fragment as S0,jsx as F,jsxs as ne}from"react/jsx-runtime";function ci({run:t,mergeTags:r=[],mediaUpload:e,sourceMode:a=!1,onToggleSource:o,activeFormats:i={}}){let{config:n}=E(),d=[{label:n.paragraph,tag:"P"},{label:n.heading_1,tag:"H1"},{label:n.heading_2,tag:"H2"},{label:n.heading_3,tag:"H3"},{label:n.heading_4,tag:"H4"},{label:n.heading_5,tag:"H5"},{label:n.heading_6,tag:"H6"}],[l,c]=w0(!1),h=y0(null),s=p=>!!i[p],u=p=>g=>{g.preventDefault(),t(p)},f=async p=>{if(p.preventDefault(),!!e)try{let g=await e({allowedTypes:["image"]});g&&g.url&&t(()=>Jd(g.url))}catch{}};return ne("div",{style:C0,children:[ne("select",{title:n.paragraph_format,defaultValue:"",onChange:p=>{let g=p.target.value;g&&t(()=>Gd(g)),p.target.selectedIndex=0},style:B0,children:[F("option",{value:"",disabled:!0,children:n.format}),d.map(p=>F("option",{value:p.tag,children:p.label},p.tag))]}),F(ie,{}),F(pt,{title:n.bold,active:s("bold"),onMouseDown:u(()=>Q("bold")),children:F(Ur,{size:15})}),F(pt,{title:n.italic,active:s("italic"),onMouseDown:u(()=>Q("italic")),children:F(_r,{size:15})}),F(pt,{title:n.underline,active:s("underline"),onMouseDown:u(()=>Q("underline")),children:F(zr,{size:15})}),F(pt,{title:n.strikethrough,active:s("strikeThrough"),onMouseDown:u(()=>Q("strikeThrough")),children:F(Or,{size:15})}),F(ie,{}),F(pt,{title:n.bulleted_list,active:s("insertUnorderedList"),onMouseDown:u(()=>Q("insertUnorderedList")),children:F(La,{size:15})}),F(pt,{title:n.numbered_list,active:s("insertOrderedList"),onMouseDown:u(()=>Q("insertOrderedList")),children:F($n,{size:15})}),F(ie,{}),F(pt,{title:n.align_left,active:s("justifyLeft"),onMouseDown:u(()=>Q("justifyLeft")),children:F(qr,{size:15})}),F(pt,{title:n.align_center,active:s("justifyCenter"),onMouseDown:u(()=>Q("justifyCenter")),children:F(Gr,{size:15})}),F(pt,{title:n.align_right,active:s("justifyRight"),onMouseDown:u(()=>Q("justifyRight")),children:F(Zr,{size:15})}),F(ie,{}),ne("span",{style:{position:"relative",display:"inline-flex"},children:[F(pt,{title:n.text_color,onMouseDown:p=>{p.preventDefault(),h.current&&h.current.click()},children:F(Qn,{size:15})}),F("input",{ref:h,type:"color",tabIndex:-1,"aria-hidden":"true",onChange:p=>t(()=>qd("foreColor",p.target.value)),style:{position:"absolute",bottom:0,left:0,width:1,height:1,opacity:0,pointerEvents:"none"}})]}),F(pt,{title:n.insert_link,onMouseDown:u(()=>$a()),children:F(ma,{size:15})}),F(pt,{title:n.remove_link,onMouseDown:u(()=>Ua()),children:F(Bn,{size:15})}),e&&F(pt,{title:n.insert_image,onMouseDown:f,children:F($r,{size:15})}),r.length>0&&ne("div",{style:{position:"relative"},children:[F(pt,{title:n.insert_merge_tag,onMouseDown:p=>{p.preventDefault(),c(g=>!g)},children:F(Pr,{size:15})}),l&&F("div",{style:W0,children:r.map(p=>ne("button",{type:"button",style:j0,onMouseDown:g=>{g.preventDefault(),t(()=>Za(p.tag)),c(!1)},onMouseEnter:g=>g.currentTarget.style.background="#f1f5f9",onMouseLeave:g=>g.currentTarget.style.background="transparent",children:[F("span",{style:{fontWeight:600},children:p.label||p.tag}),F("span",{style:{opacity:.55,marginLeft:"auto",paddingLeft:12,fontSize:11},children:p.tag})]},p.tag))})]}),F(ie,{}),F(pt,{title:n.clear_formatting,onMouseDown:u(()=>Qd()),children:F(Tn,{size:15})}),o&&ne(S0,{children:[F(ie,{}),F(pt,{title:a?n.back_to_visual_editor:n.edit_html_source,active:a,onMouseDown:p=>{p.preventDefault(),o()},children:F(ya,{size:15})})]})]})}var C0={display:"flex",alignItems:"center",flexWrap:"wrap",gap:2,padding:"6px 8px",background:"#f8fafc",borderBottom:"1px solid #e2e8f0",flexShrink:0},B0={height:28,border:"1px solid #e2e8f0",borderRadius:4,background:"#fff",fontSize:12,color:"#0f172a",cursor:"pointer",padding:"0 4px"},pt=({title:t,onMouseDown:r,active:e=!1,children:a})=>F("button",{type:"button",title:t,onMouseDown:r,style:{background:e?"#e2e8f0":"transparent",border:"none",color:e?"#0f172a":"#475569",width:28,height:28,display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:4,cursor:"pointer"},onMouseEnter:o=>o.currentTarget.style.background="#e2e8f0",onMouseLeave:o=>o.currentTarget.style.background=e?"#e2e8f0":"transparent",children:a}),ie=()=>F("span",{style:{width:1,height:18,background:"#e2e8f0",margin:"0 3px"}}),W0={position:"absolute",top:"100%",left:0,marginTop:4,background:"#fff",color:"#0f172a",borderRadius:6,boxShadow:"0 8px 24px rgba(0,0,0,.2)",minWidth:200,maxHeight:260,overflowY:"auto",padding:4,zIndex:1001},j0={display:"flex",alignItems:"center",width:"100%",textAlign:"left",background:"transparent",border:"none",borderRadius:4,padding:"6px 8px",cursor:"pointer",fontSize:12,color:"#0f172a"};import{useEffect as f2,useRef as H0,useState as hi}from"react";import{Fragment as E0,jsx as ft,jsxs as Ue}from"react/jsx-runtime";var A0=t=>{let r=t&&t.style&&t.style.width,e=/^(\d+(?:\.\d+)?)%$/.exec(r||"");return e?Math.round(parseFloat(e[1])):""},V0=t=>{if(!t||!t.style)return"";let{marginLeft:r,marginRight:e,display:a}=t.style;return a!=="block"?"":r==="auto"&&e==="auto"?"center":r==="auto"?"right":e==="auto"?"left":""};function gi({surfaceRef:t,onCommit:r}){let{config:e}=E(),a=[{label:"S",pct:25,title:e.small_25},{label:"M",pct:50,title:e.medium_50},{label:"L",pct:75,title:e.large_75},{label:e.full,pct:100,title:e.full_width_100}],[o,i]=hi(null),[n,d]=hi(null),[,l]=hi(0),c=H0(null),h=r||(()=>{});if(f2(()=>{let L=t.current;if(!L)return;let w=B=>{let H=B.target;H&&H.tagName==="IMG"&&L.contains(H)&&(i(H),d(H.getBoundingClientRect()))};return L.addEventListener("click",w),()=>L.removeEventListener("click",w)},[t]),f2(()=>{if(!o)return;let L=B=>{B.target!==o&&(c.current&&c.current.contains(B.target)||i(null))},w=()=>{if(!o.isConnected){i(null);return}d(o.getBoundingClientRect())};return document.addEventListener("mousedown",L,!0),window.addEventListener("scroll",w,!0),window.addEventListener("resize",w),()=>{document.removeEventListener("mousedown",L,!0),window.removeEventListener("scroll",w,!0),window.removeEventListener("resize",w)}},[o]),!o||!n)return null;let s=L=>{L(o),d(o.getBoundingClientRect()),l(w=>w+1),h()},u=L=>s(w=>{w.style.maxWidth="100%",w.style.height="auto",w.style.width=L?`${L}%`:"",w.removeAttribute("width"),w.removeAttribute("height")}),f=L=>s(w=>{let B=parseInt(L,10);w.style.maxWidth="100%",w.style.height="auto",w.style.width=Number.isFinite(B)&&B>0?`${B}px`:"",w.removeAttribute("width"),w.removeAttribute("height")}),p=L=>s(w=>{w.style.display="block",L==="center"?(w.style.marginLeft="auto",w.style.marginRight="auto"):L==="right"?(w.style.marginLeft="auto",w.style.marginRight="0"):(w.style.marginLeft="0",w.style.marginRight="auto")}),g=L=>s(w=>w.setAttribute("alt",L||"")),x=()=>{o.remove(),i(null),h()},y=A0(o),M=V0(o),v=Math.max(8,Math.min(n.left,window.innerWidth-320)),m=n.top>140?{bottom:window.innerHeight-n.top+8}:{top:n.bottom+8};return Ue(E0,{children:[ft("div",{style:{position:"fixed",left:n.left-2,top:n.top-2,width:n.width+4,height:n.height+4,border:"2px solid #2563eb",borderRadius:4,pointerEvents:"none",zIndex:1e3}}),Ue("div",{ref:c,style:{...D0,left:v,...m},children:[Ue("div",{style:si,children:[ft("span",{style:ui,children:e.size}),a.map(L=>ft("button",{type:"button",title:L.title,onMouseDown:w=>{w.preventDefault(),u(L.pct)},style:$e(y===L.pct),children:L.label},L.pct)),ft("input",{type:"number",min:"1",placeholder:"px",title:e.custom_width_in_pixels,onMouseDown:L=>L.stopPropagation(),onChange:L=>f(L.target.value),style:T0})]}),Ue("div",{style:si,children:[ft("span",{style:ui,children:e.align}),ft("button",{type:"button",title:e.align_left,onMouseDown:L=>{L.preventDefault(),p("left")},style:$e(M==="left"),children:ft(qr,{size:14})}),ft("button",{type:"button",title:e.align_center,onMouseDown:L=>{L.preventDefault(),p("center")},style:$e(M==="center"),children:ft(Gr,{size:14})}),ft("button",{type:"button",title:e.align_right,onMouseDown:L=>{L.preventDefault(),p("right")},style:$e(M==="right"),children:ft(Zr,{size:14})}),ft("span",{style:{flex:1}}),ft("button",{type:"button",title:e.remove_image,onMouseDown:L=>{L.preventDefault(),x()},style:{...$e(!1),color:"#dc2626"},children:ft(Ir,{size:14})})]}),Ue("div",{style:si,children:[ft("span",{style:ui,children:e.alt}),ft("input",{type:"text",placeholder:e.alt_text_accessibility,defaultValue:o.getAttribute("alt")||"",onMouseDown:L=>L.stopPropagation(),onChange:L=>g(L.target.value),style:R0})]})]})]})}var D0={position:"fixed",zIndex:1001,background:"#fff",border:"1px solid #e2e8f0",borderRadius:8,boxShadow:"0 8px 24px rgba(0,0,0,.18)",padding:8,width:300,display:"flex",flexDirection:"column",gap:6},si={display:"flex",alignItems:"center",gap:4},ui={fontSize:11,fontWeight:600,color:"#64748b",width:38,flexShrink:0},$e=t=>({minWidth:28,height:26,padding:"0 6px",display:"inline-flex",alignItems:"center",justifyContent:"center",border:"1px solid "+(t?"#2563eb":"#e2e8f0"),background:t?"#eff6ff":"#fff",color:t?"#2563eb":"#475569",borderRadius:4,fontSize:12,fontWeight:600,cursor:"pointer"}),T0={width:52,height:26,marginLeft:"auto",border:"1px solid #e2e8f0",borderRadius:4,padding:"0 6px",fontSize:12,color:"#0f172a",boxSizing:"border-box"},R0={flex:1,height:26,border:"1px solid #e2e8f0",borderRadius:4,padding:"0 8px",fontSize:12,color:"#0f172a",boxSizing:"border-box"};import{jsx as de,jsxs as z0}from"react/jsx-runtime";q();var N0=`
140
- [data-emb-editable="richtext"] ul { list-style: disc outside; padding-left: 1.5em; margin: 0 0 1em; }
141
- [data-emb-editable="richtext"] ol { list-style: decimal outside; padding-left: 1.5em; margin: 0 0 1em; }
142
- [data-emb-editable="richtext"] li { display: list-item; }
143
- [data-emb-editable="richtext"] img { max-width: 100%; height: auto; }
144
- [data-emb-editable="richtext"] a { color: #2563eb; text-decoration: underline; }
145
- `;function ki({value:t="",height:r,onChange:e,exposeApi:a,suffix:o}){let i=pi(null),n=pi(null),d=ir(),l=ke(),[c,h]=fi(!1),[s,u]=fi(""),f=pi(null),p=()=>i.current?i.current.innerHTML:"",g=W=>{i.current&&(i.current.innerHTML=W||"")},x=F0(()=>Kr(()=>{if(!e)return;let W=p();e({html:W,tree:_e(W)})},600),[e]),y=()=>{if(x.cancel&&x.cancel(),!e)return;let W=p();e({html:W,tree:_e(W)})};ho(()=>()=>x.cancel&&x.cancel(),[x]),ho(()=>{let W=i.current;if(!W||f.current!=null||document.activeElement===W)return;let S=t||"";S!==W.innerHTML&&(W.innerHTML=S)},[t]),ho(()=>{if(c||f.current==null)return;let W=i.current;W&&(W.innerHTML=f.current,f.current=null,y())},[c]),ho(()=>{a&&a({getHtml:p,setHtml:g,getTree:()=>_e(p())})},[a]);let[M,v]=fi({}),k=()=>{let W=i.current;if(!W)return;let S=window.getSelection();if(!(S&&S.rangeCount&&W.contains(S.getRangeAt(0).commonAncestorContainer)))return;let V=A=>{try{return document.queryCommandState(A)}catch{return!1}};v({bold:V("bold"),italic:V("italic"),underline:V("underline"),strikeThrough:V("strikeThrough"),insertUnorderedList:V("insertUnorderedList"),insertOrderedList:V("insertOrderedList"),justifyLeft:V("justifyLeft"),justifyCenter:V("justifyCenter"),justifyRight:V("justifyRight")})},m=()=>{let W=i.current,S=qa();S&&W&&W.contains(S.commonAncestorContainer)&&(n.current=S),k()},L=W=>{let S=i.current;if(!S)return;S.focus();let N=window.getSelection();!(N&&N.rangeCount&&S.contains(N.getRangeAt(0).commonAncestorContainer))&&n.current&&Ga(n.current),W(),m(),x()},w=()=>{c?(f.current=s,h(!1)):(u(r2(p())),h(!0))},B=W=>{let S=W.clipboardData&&W.clipboardData.getData("text/html"),N=W.clipboardData&&W.clipboardData.getData("text/plain");if(!S&&Kd(N)){W.preventDefault();let V=N.trim();_a(`<a href="${V.replace(/"/g,"%22")}">${V.replace(/&/g,"&amp;").replace(/</g,"&lt;")}</a>`),m(),x()}},H=W=>{(W.key===" "||W.key==="Enter")&&Xd()&&(m(),x())};return z0("div",{className:`${T("emb-embed-root",o)} emb-embed-root--richtext`,style:r!=null?{height:r}:void 0,children:[de("style",{children:N0}),de(ci,{run:L,mergeTags:d,mediaUpload:l,sourceMode:c,onToggleSource:w,activeFormats:M}),c?de("textarea",{value:s,onChange:W=>u(W.target.value),spellCheck:!1,style:{flex:1,width:"100%",boxSizing:"border-box",overflowY:"auto",padding:"14px 16px",outline:"none",border:"none",resize:"none",fontSize:13,lineHeight:1.6,fontFamily:"ui-monospace, SFMono-Regular, Menlo, Consolas, monospace",color:"#0f172a",background:"#f8fafc"}}):de("div",{ref:i,"data-emb-editable":"richtext",contentEditable:"true",suppressContentEditableWarning:!0,onInput:()=>{m(),x()},onKeyDown:H,onKeyUp:m,onMouseUp:m,onPaste:B,onBlur:()=>{m(),y()},style:{flex:1,overflowY:"auto",padding:"14px 16px",outline:"none",fontSize:14,lineHeight:1.6,color:"#111"}}),!c&&de(gi,{surfaceRef:i,onCommit:y}),de(Ne,{})]})}var k2={slug:"blank-email",name:"Blank email",category:"custom",tree:{version:2,root:{id:"root",type:"email",attributes:{},children:[]}}};var xi=k2.tree;var vi={version:2,root:{id:"root",type:"certificate",attributes:{pageSize:"A4",orientation:"landscape",fontFamily:"Poppins",bgColor:"#FFFFFF",bgImage:"",bgSize:"cover",contentBg:"transparent",padding:[48,56,48,56]},children:[]}};var P0=["Poppins","Roboto","Lora","DM Sans","Libre Baskerville","Cinzel","Great Vibes","Alex Brush","Allura","Abhaya Libre","Arial, sans-serif"],O0={name:"Certificate",root:!0,category:"structure",attributes:{pageSize:{type:"select",default:"A4",options:["A4","Letter"],group:"style",label:"Page size"},orientation:{type:"select",default:"landscape",options:["landscape","portrait"],group:"style",label:"Orientation"},fontFamily:{type:"select",default:"Poppins",options:P0,group:"style",label:"Default font"},bgColor:{type:"color",default:"#FFFFFF",group:"style",label:"Page background"},bgImage:{type:"image",default:"",group:"style",label:"Background image"},bgSize:{type:"select",default:"cover",options:["cover","contain","stretch"],group:"style",label:"Background fit"},contentBg:{type:"color",default:"transparent",group:"style",label:"Content overlay"},padding:{type:"spacing",default:[48,56,48,56],group:"spacing",label:"Content padding"}}},_0={name:"QR code",category:"content",attributes:{value:{type:"string",default:"{{verification_url}}",group:"content",label:"Encoded value"},size:{type:"number",default:120,min:48,max:400,group:"content",label:"Size (px)"},fg:{type:"color",default:"#000000",group:"style",label:"Foreground"},bg:{type:"color",default:"#FFFFFF",group:"style",label:"Background"},alignment:{type:"alignment",default:"center",group:"style",label:"Alignment",options:["left","center","right"]},padding:{type:"spacing",default:[8,0,8,0],group:"spacing",label:"Padding"},margin:{type:"spacing",default:[0,0,0,0],group:"spacing",label:"Margin"}}};function x2(t,r=["video","timer"]){let{email:e,...a}=t,o={certificate:O0,...a,qr:_0};return r.forEach(i=>{o[i]&&(o[i]={...o[i],hidden:!0})}),o}var v2={renderers:Ut,optionList:ae,inline:j,spacing:R,border:X,boxShadow:xt,escAttr:b,escHtml:Z};function L2(t=[],{baseBlocks:r={},baseRenderers:e={},baseControls:a={},hideBlocks:o=[],helpers:i={}}={}){let n={...r},d={...e},l={...a},c={};return(o||[]).forEach(h=>{n[h]&&(n[h]={...n[h],hidden:!0})}),(t||[]).forEach(h=>{if(!h||!h.type)return;let{type:s,spec:u,render:f,controls:p,schema:g}=h;u&&(n[s]=u),typeof f=="function"&&(d[s]=(x,y)=>f(x,y,i)),p&&Object.assign(l,p),typeof g=="function"&&(c[s]=g)}),{blocks:n,renderers:d,controls:l,schemaExtractors:c}}import{jsx as zt}from"react/jsx-runtime";var q0={version:2,root:{id:"root",type:"form",attributes:{},children:[]}},G0=$0(function({mode:r="builder",initialTree:e,value:a,mergeTags:o=[],mediaUpload:i,onChange:n,header:d=!1,height:l,renderMode:c="document",blocks:h,blockPlugins:s=[],hideBlocks:u=[],templates:f=[],onTemplatesClick:p,suffix:g,config:x},y){let M=Z0(null);if(U0(y,()=>({getTree:()=>{var m,L;return(L=(m=M.current)==null?void 0:m.getTree)==null?void 0:L.call(m)},getHtml:()=>{var m,L;return(L=(m=M.current)==null?void 0:m.getHtml)==null?void 0:L.call(m)},getSchema:()=>{var m,L;return(L=(m=M.current)==null?void 0:m.getSchema)==null?void 0:L.call(m)},setTree:m=>{var L,w;return(w=(L=M.current)==null?void 0:L.setTree)==null?void 0:w.call(L,m)},setHtml:m=>{var L,w;return(w=(L=M.current)==null?void 0:L.setHtml)==null?void 0:w.call(L,m)}}),[]),r==="form"){let{blocks:m,renderers:L,controls:w,schemaExtractors:B}=L2(s,{baseBlocks:h||Wi.blocks,baseRenderers:Ut,baseControls:Xr,hideBlocks:u,helpers:v2}),H=e&&e.root?e:JSON.parse(JSON.stringify(q0));return zt(fe,{value:{mergeTags:o,mediaUpload:i,config:x},children:zt(Xe,{tree:H,children:zt(li,{blocks:m,renderers:L,controls:w,schemaExtractors:B,header:d,height:l,renderMode:c==="document"?"fragment":c,onChange:n,exposeApi:W=>{M.current=W},suffix:g})})})}if(r==="richtext")return zt(fe,{value:{mergeTags:o,mediaUpload:i,config:x},children:zt(ki,{value:a,height:l,onChange:n,exposeApi:m=>{M.current=m},suffix:g})});if(r==="certificate"){let m=h||x2(po.blocks,u&&u.length?u:void 0),L=e&&e.root?e:JSON.parse(JSON.stringify(vi));return zt(fe,{value:{mergeTags:o,mediaUpload:i,config:x},children:zt(Xe,{tree:L,children:zt(ro,{blocks:m,templates:f,onTemplatesClick:p,header:!0,height:l,onChange:n,exposeApi:w=>{M.current=w},suffix:g,renderHtmlFn:Na,previewRenderFn:_o})})})}let v=h||po.blocks,k=e&&e.root?e:JSON.parse(JSON.stringify(xi));return zt(fe,{value:{mergeTags:o,mediaUpload:i,config:x},children:zt(Xe,{tree:k,children:zt(ro,{blocks:v,templates:f,onTemplatesClick:p,header:d,height:l,renderMode:c,onChange:n,exposeApi:m=>{M.current=m},suffix:g})})})}),Ze=G0;import{forwardRef as K0}from"react";import{jsx as J0}from"react/jsx-runtime";var X0=K0(function(r,e){return J0(Ze,{...r,ref:e,mode:"richtext"})}),Y0=X0;import{forwardRef as Q0}from"react";import{jsx as es}from"react/jsx-runtime";var ts=Q0(function(r,e){return es(Ze,{...r,ref:e,mode:"form"})}),rs=ts;export{vi as BLANK_CERT_TREE,xi as BLANK_TREE,Ze as EmailEditor,rs as FormEditor,Y0 as RichTextEditor,pe as defaultMediaUpload,lo as extractSchema,Yr as htmlToBlocks,Ve as pageDims,Na as renderCertificateContent,_o as renderCertificateDocument,Po as renderContent,Fa as renderDocument,ni as renderFormContent,no as renderFormDocument,_e as treeFromHtml};
139
+ `+e+"</"+a+">"},a2=t=>{if(!t)return"";let r=document.createElement("div");return r.innerHTML=t,Array.from(r.childNodes).map(e=>e2(e,0)).filter(Boolean).join(`
140
+ `)};import{Fragment as Zh,jsx as it,jsxs as Vt}from"react/jsx-runtime";function Re(){let{config:t}=E(),[r,e]=Qo(null),[a,o]=Qo(!1),[i,n]=Qo(""),d=o2(null),l=o2({editable:null,range:null}),c=ir(),h=c.length>0;if(Nh(()=>{let v=()=>{let f=Uh(h);e(f),f||o(!1)};return document.addEventListener("selectionchange",v),window.addEventListener("scroll",v,!0),window.addEventListener("resize",v),()=>{document.removeEventListener("selectionchange",v),window.removeEventListener("scroll",v,!0),window.removeEventListener("resize",v)}},[h]),Ih(()=>{if(!r||!d.current)return;let v=d.current,f=v.getBoundingClientRect(),M=8,{top:L,left:w}=r;L<M&&(L=r.belowTop),w<M&&(w=M),w+f.width>window.innerWidth-M&&(w=window.innerWidth-f.width-M),v.style.top=`${L}px`,v.style.left=`${w}px`},[r]),!r)return null;let s=(v,f)=>M=>{M.preventDefault(),Q(v,f)},u=v=>{v.preventDefault(),$a()},k=v=>{v.preventDefault(),Ua()},p=v=>{if(v.preventDefault(),!a){let f=window.getSelection(),M=null;if(f&&f.rangeCount){let L=f.getRangeAt(0).commonAncestorContainer,w=L.nodeType===1?L:L.parentElement;M=w?w.closest('[data-kzeditor-editable="richtext"]'):null}l.current={editable:M,range:qa()},n("")}o(f=>!f)},g=v=>{if(!v)return;let{editable:f,range:M}=l.current;f&&f.focus(),M&&Ga(M),Za(v),o(!1),n("")},x=v=>f=>{f.preventDefault(),g(v)},b=i.trim().toLowerCase(),m=b?c.filter(v=>(v.label||"").toLowerCase().includes(b)||(v.tag||"").toLowerCase().includes(b)):c;return Vt("div",{ref:d,className:"kzeditor-rt-toolbar",style:{top:r.top,left:r.left},onMouseDown:v=>v.preventDefault(),children:[Vt(yr,{title:t.bold,onMouseDown:s("bold"),children:[" ",it(Ur,{size:13})]}),Vt(yr,{title:t.italic,onMouseDown:s("italic"),children:[" ",it(_r,{size:13})]}),Vt(yr,{title:t.underline,onMouseDown:s("underline"),children:[" ",it(Nr,{size:13})]}),Vt(yr,{title:t.strikethrough,onMouseDown:s("strikeThrough"),children:[" ",it(Or,{size:13})]}),it(i2,{}),Vt(yr,{title:t.insert_link,onMouseDown:u,children:[" ",it(ma,{size:13})]}),Vt(yr,{title:t.remove_link,onMouseDown:k,children:[" ",it("span",{className:"text-[10px]",children:"\u2310"})]}),c.length>0&&!r.tagsDisabled&&Vt(Zh,{children:[it(i2,{}),Vt("div",{className:"relative",children:[it(yr,{title:t.insert_merge_tag,onMouseDown:p,children:it(Pr,{size:13})}),a&&Vt("div",{className:Ph,style:{position:"absolute",top:"100%",left:0,marginTop:4,zIndex:1001},children:[Vt("div",{className:"flex gap-1 p-1",children:[it("input",{type:"text",autoFocus:!0,value:i,placeholder:t.search_or_type_a_tag,onChange:v=>n(v.target.value),onMouseDown:v=>v.stopPropagation(),onKeyDown:v=>{var f;v.key==="Enter"&&(v.preventDefault(),g(((f=m[0])==null?void 0:f.tag)||i.trim()))},className:_h}),it("button",{type:"button",title:t.insert,onMouseDown:v=>{var f;v.preventDefault(),g(((f=m[0])==null?void 0:f.tag)||i.trim())},className:$h,children:t.insert})]}),it("div",{className:"max-h-[200px] overflow-y-auto",children:m.length===0?it("div",{className:"kzeditor-merge-tag-empty",children:t.no_matching_tags}):m.map(v=>Vt("button",{type:"button",onMouseDown:x(v.tag),className:Oh,children:[it("span",{className:"font-semibold",children:v.label||v.tag}),it("span",{className:"opacity-[.55] ml-auto pl-3 text-[11px]",children:v.tag})]},v.tag))})]})]})]})]})}var yr=({title:t,onMouseDown:r,children:e})=>it("button",{type:"button",title:t,onMouseDown:r,className:"kzeditor-rt-toolbar-btn",children:e}),i2=()=>it("span",{className:"kzeditor-rt-sep"}),Ph="kzeditor-merge-tag-menu",Oh="kzeditor-merge-tag-item",_h="kzeditor-merge-tag-search",$h="kzeditor-merge-tag-insert";function Uh(t=!1){let r=window.getSelection();if(!r||r.rangeCount===0||r.isCollapsed&&!t)return null;let e=r.getRangeAt(0),a=e.commonAncestorContainer,o=a.nodeType===1?a:a.parentElement;if(!o)return null;let i=o.closest('[data-kzeditor-editable="richtext"]');if(!i||i.getAttribute("contenteditable")!=="true")return null;let n=i.getAttribute("data-kzeditor-merge-tags")==="off";if(r.isCollapsed&&n)return null;let d=e.getBoundingClientRect();if(!d||d.width===0&&d.height===0)return null;let c=d.top-34-8,h=d.bottom+8,s=d.left+d.width/2-100;return{top:c,left:s,belowTop:h,tagsDisabled:n}}import{useEffect as n2,useRef as qh,useState as d2}from"react";import{jsx as ti,jsxs as Xh}from"react/jsx-runtime";var Gh=/(^|\s)@([\p{L}\d_.]*)$/u;function Fe(){let t=ir(),[r,e]=d2(null),[a,o]=d2(0),i=qh(null);n2(()=>{if(!t.length)return;let d=()=>{let l=Kh(t);e(l),o(0)};return document.addEventListener("selectionchange",d),document.addEventListener("input",d,!0),window.addEventListener("scroll",d,!0),()=>{document.removeEventListener("selectionchange",d),document.removeEventListener("input",d,!0),window.removeEventListener("scroll",d,!0)}},[t]),n2(()=>{if(!r)return;let d=l=>{let c=r.items.length;c&&(l.key==="ArrowDown"?(l.preventDefault(),o(h=>(h+1)%c)):l.key==="ArrowUp"?(l.preventDefault(),o(h=>(h-1+c)%c)):l.key==="Enter"||l.key==="Tab"?(l.preventDefault(),n(r.items[a])):l.key==="Escape"&&(l.preventDefault(),e(null)))};return document.addEventListener("keydown",d,!0),()=>document.removeEventListener("keydown",d,!0)},[r,a]);let n=d=>{var l;d&&(Qd((((l=r==null?void 0:r.query)==null?void 0:l.length)||0)+1,d.tag),e(null))};return!r||!r.items.length?null:ti("div",{ref:i,style:{position:"fixed",top:r.top,left:r.left,background:"#fff",color:"#0f172a",borderRadius:6,boxShadow:"0 8px 24px rgba(0,0,0,.2)",border:"1px solid #e2e8f0",minWidth:220,maxHeight:260,overflowY:"auto",padding:4,zIndex:1002},onMouseDown:d=>d.preventDefault(),children:r.items.map((d,l)=>Xh("button",{type:"button",onMouseDown:c=>{c.preventDefault(),n(d)},onMouseEnter:()=>o(l),style:{display:"flex",alignItems:"center",width:"100%",textAlign:"left",background:l===a?"#eff6ff":"transparent",border:"none",borderRadius:4,padding:"6px 8px",cursor:"pointer",fontSize:12},children:[ti("span",{style:{fontWeight:600},children:d.label||d.tag}),ti("span",{style:{opacity:.55,marginLeft:"auto",paddingLeft:12,fontSize:11},children:d.tag})]},d.tag))})}function Kh(t){let r=window.getSelection();if(!r||r.rangeCount===0||!r.isCollapsed)return null;let e=r.getRangeAt(0),a=e.startContainer;if(a.nodeType!==3)return null;let o=a.parentElement,i=o&&o.closest('[data-kzeditor-editable="richtext"]');if(!i||i.getAttribute("contenteditable")!=="true"||i.getAttribute("data-kzeditor-merge-tags")==="off")return null;let d=a.textContent.slice(0,e.startOffset).match(Gh);if(!d)return null;let l=(d[2]||"").toLowerCase(),c=t.filter(k=>l?(k.label||"").toLowerCase().includes(l)||(k.tag||"").toLowerCase().includes(l):!0);if(!c.length)return null;let h=e.getClientRects()[0]||e.getBoundingClientRect(),s=(h.bottom||h.top||0)+6,u=h.left||0;return{items:c,query:l,top:s,left:u}}import{useEffect as l2,useState as Ka}from"react";import{jsx as ut,jsxs as Xa}from"react/jsx-runtime";q();function Ne({tree:t,onClose:r,renderFn:e,suffix:a}){let{config:o}=E(),[i,n]=Ka(""),[d,l]=Ka("desktop"),[c,h]=Ka(!0),[s,u]=Ka(null);console.log({html:i});let k=async()=>{var g,x;h(!0),u(null);try{let b=await e(t);n(b||"")}catch(b){u(((x=(g=b==null?void 0:b.response)==null?void 0:g.data)==null?void 0:x.message)||b.message||"Render failed")}finally{h(!1)}};l2(()=>{k()},[]),l2(()=>{let g=x=>{x.key==="Escape"&&r()};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[r]);let p=d==="mobile"?375:760;return ut("div",{onClick:r,className:D("kzeditor-preview-backdrop",a),children:Xa("div",{onClick:g=>g.stopPropagation(),className:D("kzeditor-preview-dialog",a),children:[ut(Yh,{device:d,setDevice:l,onReload:k,onClose:r,suffix:a}),ut("div",{className:D("kzeditor-preview-body",a),children:c?ut("div",{className:D("kzeditor-preview-loading",a),children:o.rendering}):s?ut("div",{className:`${D("kzeditor-preview-loading",a)} is-error`,children:s}):ut("iframe",{title:"email-preview",srcDoc:i,className:D("kzeditor-preview-frame",a),style:{width:p}})})]})})}function Yh({device:t,setDevice:r,onReload:e,onClose:a,suffix:o}){let{config:i}=E();return Xa("div",{className:D("kzeditor-preview-header",o),children:[ut("div",{className:D("kzeditor-preview-title",o),children:i.email_preview}),Xa(c2,{active:t==="desktop",onClick:()=>r("desktop"),suffix:o,children:[ut(In,{size:14}),ut("span",{children:i.desktop})]}),Xa(c2,{active:t==="mobile",onClick:()=>r("mobile"),suffix:o,children:[ut(Sn,{size:14}),ut("span",{children:i.mobile})]}),ut("button",{type:"button",onClick:e,className:D("kzeditor-preview-icon-btn",o),title:i.reload,children:ut(Tn,{size:14})}),ut("button",{type:"button",onClick:a,className:D("kzeditor-preview-icon-btn",o),title:i.close_esc,children:ut(Fr,{size:16})})]})}var c2=({active:t,onClick:r,children:e,suffix:a})=>ut("button",{type:"button",onClick:r,className:`${D("kzeditor-device-tab",a)} ${t?"is-active":""}`,children:e});import"react";import{jsx as jt,jsxs as Ya}from"react/jsx-runtime";function ri({templates:t=[],onPick:r,onClose:e}){let{config:a}=E();return jt("div",{role:"dialog","aria-modal":"true",style:{position:"fixed",inset:0,zIndex:1e5,background:"rgba(15,23,42,.55)",display:"flex",alignItems:"center",justifyContent:"center",padding:24},onClick:e,children:Ya("div",{style:{width:"min(880px, 100%)",maxHeight:"86vh",display:"flex",flexDirection:"column",background:"#fff",borderRadius:10,overflow:"hidden",boxShadow:"0 24px 60px rgba(0,0,0,.30)"},onClick:o=>o.stopPropagation(),children:[Ya("header",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"14px 18px",borderBottom:"1px solid #e2e8f0"},children:[jt("strong",{style:{fontSize:15,color:"#0f172a"},children:a.choose_a_template}),jt("button",{type:"button",onClick:e,"aria-label":a.close,style:{border:"none",background:"transparent",cursor:"pointer",color:"#64748b",display:"inline-flex"},children:jt(Fr,{size:18})})]}),jt("div",{style:{padding:18,overflowY:"auto"},children:t.length===0?jt("div",{style:{padding:32,textAlign:"center",color:"#94a3b8",fontSize:13},children:a.no_templates_available}):jt("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill,minmax(220px,1fr))",gap:16},children:t.map(o=>jt(Jh,{template:o,onPick:()=>r(o)},o.id))})})]})})}function Jh({template:t,onPick:r}){return Ya("button",{type:"button",onClick:r,style:{display:"flex",flexDirection:"column",textAlign:"left",padding:0,background:"#fff",border:"1px solid #e2e8f0",borderRadius:8,cursor:"pointer",overflow:"hidden",transition:"border-color .15s, box-shadow .15s"},onMouseEnter:e=>{e.currentTarget.style.borderColor="#0073e6",e.currentTarget.style.boxShadow="0 6px 16px rgba(0,115,230,.12)"},onMouseLeave:e=>{e.currentTarget.style.borderColor="#e2e8f0",e.currentTarget.style.boxShadow="none"},children:[jt("div",{style:{height:120,background:"#f1f5f9",display:"flex",alignItems:"center",justifyContent:"center",color:"#94a3b8",overflow:"hidden"},children:t.thumbnail?jt("img",{src:t.thumbnail,alt:"",style:{width:"100%",height:"100%",objectFit:"cover"}}):jt(Ma,{size:30})}),Ya("div",{style:{padding:"10px 12px"},children:[jt("div",{style:{fontSize:13,fontWeight:600,color:"#0f172a"},children:t.label||t.id}),t.description&&jt("div",{style:{fontSize:12,color:"#64748b",marginTop:2,lineHeight:1.4},children:t.description})]})]})}import{useEffect as Qh}from"react";import{jsx as Ja,jsxs as t0}from"react/jsx-runtime";q();var h2=t=>{if(!t)return!1;let r=t.tagName;return r==="INPUT"||r==="TEXTAREA"||r==="SELECT"||t.isContentEditable};function Qa(){let{undo:t,redo:r}=$();Qh(()=>{let e=a=>{if(!(a.metaKey||a.ctrlKey))return;let o=(a.key||"").toLowerCase();o!=="z"&&o!=="y"||h2(a.target)||h2(document.activeElement)||(o==="y"||o==="z"&&a.shiftKey?(a.preventDefault(),r()):(a.preventDefault(),t()))};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[t,r])}function to({suffix:t}){let{undo:r,redo:e,canUndo:a,canRedo:o}=$(),{config:i}=E();return t0("div",{className:D("kzeditor-undo-redo",t),children:[Ja("button",{type:"button",onClick:r,disabled:!a,title:i.undo_shortcut,children:Ja(Wn,{size:15})}),Ja("button",{type:"button",onClick:e,disabled:!o,title:i.redo_shortcut,children:Ja(En,{size:15})})]})}import{jsx as gt,jsxs as ee}from"react/jsx-runtime";q();var a0=(t,r)=>r==="fragment"?Po(t):Ra(t);function ro({blocks:t,templates:r=[],onTemplatesClick:e,header:a=!1,height:o,renderMode:i="document",onChange:n,exposeApi:d,suffix:l,renderHtmlFn:c,previewRenderFn:h}){var N,G,O;let{state:s,markClean:u,setTree:k}=$(),{config:p}=E();Qa();let{sensors:g,activeDrag:x,overId:b,handlers:m}=Ba({blocks:t}),v=U=>c?c(U):a0(U,i),f=h||Ra,[M,L]=ai(!1),[w,B]=ai(!1),[S,W]=ai(!1),z=U=>{var mt,Mt;!U||!U.tree||(((Mt=(mt=s.tree)==null?void 0:mt.root)==null?void 0:Mt.children)||[]).length>0&&!window.confirm(p.replace_content_confirm)||(k(JSON.parse(JSON.stringify(U.tree))),B(!1))},F=e0(s.tree);F.current=s.tree;let A=r0(()=>Kr(U=>{n&&n({tree:U,html:v(U)}),u()},600),[n,u,i,c]);ei(()=>{s.dirty&&A(s.tree)},[s.tree,s.dirty,A]),ei(()=>()=>A.cancel&&A.cancel(),[A]),ei(()=>{d&&d({getTree:()=>F.current,getHtml:()=>v(F.current),setTree:U=>k(U)})},[d,k,i,c]);let H=a!==!1;return gt("div",{className:D("kzeditor-embed-root",l),style:o!=null?{height:o}:void 0,children:ee(ua,{sensors:g,collisionDetection:la,onDragStart:m.onDragStart,onDragOver:m.onDragOver,onDragEnd:m.onDragEnd,children:[H&&gt(o0,{suffix:l,config:p,onPreview:()=>L(!0),onTemplates:e||(r.length?()=>B(!0):null)}),ee("div",{className:D("kzeditor-shell-body",l),children:[gt(ze,{blocks:t,navOpen:S,onToggleNav:()=>W(U=>!U),suffix:l}),S&&gt(He,{blocks:t,onClose:()=>W(!1),suffix:l}),gt(Jo,{dropTargetId:b,blocks:t,suffix:l})]}),gt(ka,{children:((G=(N=x==null?void 0:x.data)==null?void 0:N.current)==null?void 0:G.source)==="library"&&gt("div",{className:D("kzeditor-drag-chip",l),children:((O=t[x.data.current.type])==null?void 0:O.name)||x.data.current.type})}),gt(Re,{}),gt(Fe,{}),M&&gt(Ne,{tree:s.tree,renderFn:f,onClose:()=>L(!1),suffix:l}),w&&gt(ri,{templates:r,onPick:z,onClose:()=>B(!1)})]})})}function o0({onPreview:t,onTemplates:r,suffix:e,config:a}){return ee("header",{className:D("kzeditor-shell-header",e),children:[gt(to,{suffix:e}),ee("div",{style:{display:"inline-flex",alignItems:"center",gap:8},children:[r&&ee("button",{type:"button",onClick:r,className:D("kzeditor-templates-btn",e),children:[gt(Ma,{size:14}),gt("span",{children:a.templates})]}),ee("button",{type:"button",onClick:t,className:D("kzeditor-preview-btn",e),children:[gt(ya,{size:14}),gt("span",{children:a.preview})]})]})]})}import{useEffect as di,useMemo as w0,useRef as C0,useState as k2}from"react";import{useMemo as u2}from"react";var i0={fontFamily:"system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif",labelColor:"#334155",inputBg:"#FFFFFF",inputText:"#0F172A",inputBorder:"#CBD5E1",radius:6,accent:"#0073E6"},br=(t,r)=>t&&t[r]!=null?t[r]:i0[r],oi=t=>j({width:"100%",padding:"9px 11px",border:`1px solid ${br(t,"inputBorder")}`,"border-radius":`${br(t,"radius")}px`,background:br(t,"inputBg"),color:br(t,"inputText"),"font-size":"14px","font-family":"inherit","line-height":"1.4","box-sizing":"border-box",outline:"none"}),eo=(t,r)=>{let e=t.attributes||{};if(e.showLabel===!1||!e.label)return"";let a=e.required?'<span aria-hidden="true" style="color:#dc2626;margin-left:2px">*</span>':"",o=j({display:"block","margin-bottom":"5px","font-size":"13px","font-weight":"600",color:br(r,"labelColor")});return`<label for="${y(Pe(t))}" style="${y(o)}">${Z(e.label)}${a}</label>`},ao=(t,r)=>{let e=t.attributes||{};if(!e.helpText)return"";let a=j({display:"block","margin-top":"4px","font-size":"12px",color:"#94A3B8"});return`<small style="${y(a)}">${Z(e.helpText)}</small>`},Pe=t=>`f_${t.id||t.attributes&&t.attributes.name||"field"}`,Ie=t=>String(t.attributes&&t.attributes.name||"field"),oo=(t,r)=>{var o;let e=t.attributes||{},a=j({padding:T((o=e.padding)!=null?o:[0,0,12,0])});return`<div class="kzeditor-form-field" style="${y(a)}">${r}</div>`},io=t=>t.attributes&&t.attributes.required?" required":"",n0=(t,r)=>{let e=t.attributes||{},a=["text","email","number","tel","url","date","password"].includes(e.inputType)?e.inputType:"text",o=`<input type="${y(a)}" id="${y(Pe(t))}" name="${y(Ie(t))}" placeholder="${y(e.placeholder||"")}"`+(e.defaultValue?` value="${y(e.defaultValue)}"`:"")+` style="${y(oi(r))}"${io(t)} />`;return oo(t,eo(t,r)+o+ao(t,r))},d0=(t,r)=>{var i;let e=t.attributes||{},a=parseInt((i=e.rows)!=null?i:4,10)||4,o=`<textarea id="${y(Pe(t))}" name="${y(Ie(t))}" rows="${a}" placeholder="${y(e.placeholder||"")}" style="${y(j({...f0(oi(r)),resize:"vertical"}))}"${io(t)}>`+Z(e.defaultValue||"")+"</textarea>";return oo(t,eo(t,r)+o+ao(t,r))},l0=(t,r)=>{let e=t.attributes||{},a=ae(e.options),o=e.placeholder?`<option value="" disabled selected>${Z(e.placeholder)}</option>`:"",i=a.map(d=>`<option value="${y(d.value)}">${Z(d.label)}</option>`).join(""),n=`<select id="${y(Pe(t))}" name="${y(Ie(t))}" style="${y(oi(r))}"${io(t)}>${o}${i}</select>`;return oo(t,eo(t,r)+n+ao(t,r))},c0=(t,r)=>s2(t,r,"radio"),h0=(t,r)=>s2(t,r,"checkbox"),s2=(t,r,e)=>{let a=t.attributes||{},o=ae(a.options),i=e==="checkbox"?`${Ie(t)}[]`:Ie(t),n=j({display:a.inline?"inline-flex":"flex","align-items":"center",gap:"6px","margin-right":a.inline?"16px":"0","margin-bottom":"6px","font-size":"14px",color:br(r,"inputText")}),d=o.map((c,h)=>{let s=`${Pe(t)}_${h}`;return`<label for="${y(s)}" style="${y(n)}"><input type="${e}" id="${y(s)}" name="${y(i)}" value="${y(c.value)}"${h===0?io(t):""} /><span>${Z(c.label)}</span></label>`}).join(""),l=j({display:a.inline?"block":"flex","flex-direction":a.inline?null:"column"});return oo(t,eo(t,r)+`<div role="group" style="${y(l)}">${d}</div>`+ao(t,r))},s0=(t,r)=>{var n,d,l,c,h;let e=t.attributes||{},a=(n=e.alignment)!=null?n:"left",o=j({display:e.fullWidth?"block":"inline-block",width:e.fullWidth?"100%":null,background:(d=e.bg)!=null?d:br(r,"accent"),color:(l=e.color)!=null?l:"#FFFFFF",padding:T((c=e.padding)!=null?c:[12,24,12,24]),"font-size":"14px","font-weight":"600","font-family":"inherit",cursor:"pointer","text-align":"center",...X((h=e.border)!=null?h:{})}),i=j({"text-align":a,padding:T((e.padding,[0,0,0,0]))});return`<div class="kzeditor-form-field" style="${y(j({"text-align":a,padding:"4px 0"}))}"><button type="submit" style="${y(o)}">${Z(e.text||"Submit")}</button></div>`},u0=t=>{var o,i,n;let r=t.attributes||{},e=["h1","h2","h3","h4"].includes(r.tag)?r.tag:"h3",a=j({margin:"0",padding:T((o=r.padding)!=null?o:[0,0,8,0]),"text-align":(i=r.alignment)!=null?i:"left",color:(n=r.color)!=null?n:"#0F172A","font-family":"inherit"});return`<${e} style="${y(a)}">${Z(r.text||"")}</${e}>`},g0=t=>{var a,o,i,n;let r=t.attributes||{},e=j({margin:"0",padding:T((a=r.padding)!=null?a:[0,0,8,0]),"text-align":(o=r.alignment)!=null?o:"left",color:(i=r.color)!=null?i:"#475569","font-size":"14px","line-height":"1.6","font-family":"inherit"});return`<div data-kzeditor-editable="richtext" data-kzeditor-field="text" style="${y(e)}">${(n=r.text)!=null?n:""}</div>`},p0=t=>{var o,i,n;let r=t.attributes||{},e=j({padding:T((o=r.padding)!=null?o:[8,0,8,0])}),a=j({"border-top":`${parseInt((i=r.thickness)!=null?i:1,10)||1}px solid ${(n=r.color)!=null?n:"#E2E8F0"}`,height:"0","line-height":"0","font-size":"0"});return`<div style="${y(e)}"><div style="${y(a)}"></div></div>`},k0=t=>{var a;let r=t.attributes||{};return`<div style="height:${parseInt((a=r.height)!=null?a:16,10)||16}px" aria-hidden="true"></div>`},ae=t=>Array.isArray(t)?t.map(r=>{var e,a,o,i;return typeof r=="string"?{label:r,value:r}:{label:(a=(e=r.label)!=null?e:r.value)!=null?a:"",value:(i=(o=r.value)!=null?o:r.label)!=null?i:""}}).filter(r=>r.label!==""||r.value!==""):[],f0=t=>{let r={};return String(t||"").split(";").forEach(e=>{let a=e.indexOf(":");if(a<0)return;let o=e.slice(0,a).trim();o&&(r[o]=e.slice(a+1).trim())}),r},$t={field:n0,textarea:d0,select:l0,radio:c0,checkbox:h0,submit:s0,heading:u0,text:g0,divider:p0,spacer:k0};import{jsx as oe,jsxs as v0}from"react/jsx-runtime";q();var x0="system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif";function ii({dropTargetId:t,blocks:r,renderers:e,suffix:a}){var p;let{state:o,select:i}=$(),{config:n}=E(),d=o.tree.root||{},l=d.attributes||{},c=u2(()=>({blockRenderers:e||$t}),[e]),h=u2(()=>{var g,x,b,m,v,f,M;return{fontFamily:(g=l.fontFamily)!=null?g:x0,contentWidth:(x=l.contentWidth)!=null?x:560,labelColor:(b=l.labelColor)!=null?b:"#334155",inputBg:(m=l.inputBg)!=null?m:"#FFFFFF",inputText:(v=l.inputText)!=null?v:"#0F172A",inputBorder:(f=l.inputBorder)!=null?f:"#CBD5E1",radius:(M=l.radius)!=null?M:6,accent:"#0073E6"}},[l.fontFamily,l.contentWidth,l.labelColor,l.inputBg,l.inputText,l.inputBorder,l.radius]),s=Array.isArray(l.padding)?l.padding:[24,24,24,24],u=s.length===4&&s.every(g=>g===24),k={...X(l.formBorder||{}),...vt(l.formBoxShadow||{})};return oe("div",{className:`${D("kzeditor-canvas",a)} kzeditor-canvas--form`,onClick:()=>i("root"),children:oe("div",{className:"kzeditor-canvas-page kzeditor-canvas-page--form",style:{...l.contentWidth!=null&&l.contentWidth!==560?{maxWidth:l.contentWidth}:null,...l.bgColor&&String(l.bgColor).toUpperCase()!=="#FFFFFF"?{background:l.bgColor}:null,...l.fontFamily?{fontFamily:h.fontFamily}:null,...u?null:{padding:s.map(g=>`${g}px`).join(" ")},borderRadius:k["border-radius"]||void 0,boxShadow:k["box-shadow"]||void 0,border:k.border||void 0},onClick:g=>g.stopPropagation(),children:oe(Te.Provider,{value:r||{},children:oe(Go.Provider,{value:c,children:v0(De.Provider,{value:h,children:[oe(Xt,{containerId:"root",items:d.children||[],dropTargetId:t,emptyMessage:n.drag_form_fields_here,suffix:a}),((p=d.children)==null?void 0:p.length)>0&&oe(lr,{containerId:"root",suffix:a})]})})})})})}var L0={top:"start",middle:"center",bottom:"end"},g2=t=>{var e,a,o,i,n,d,l;let r=t&&t.attributes||{};return{fontFamily:(e=r.fontFamily)!=null?e:"system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif",labelColor:(a=r.labelColor)!=null?a:"#334155",inputBg:(o=r.inputBg)!=null?o:"#FFFFFF",inputText:(i=r.inputText)!=null?i:"#0F172A",inputBorder:(n=r.inputBorder)!=null?n:"#CBD5E1",radius:(d=r.radius)!=null?d:6,accent:(l=r.accent)!=null?l:"#0073E6"}},m0=(t,r,e)=>{var h,s,u;let a=(t.children||[]).filter(k=>k.type==="column"),o=Math.max(1,a.length),i=t.attributes||{},n=parseInt((h=i.gap)!=null?h:16,10)||0,d=a.map(k=>`<div style="min-width:0">${(k.children||[]).map(g=>Oe(g,r,e)).join("")}</div>`).join(""),l=j({display:"grid","grid-template-columns":`repeat(${o}, minmax(0, 1fr))`,gap:`${n}px`,"align-items":L0[i.valign]||"start"}),c=j({margin:T((s=i.margin)!=null?s:[0,0,0,0]),padding:T((u=i.padding)!=null?u:[0,0,0,0]),...i.backgroundColor&&i.backgroundColor!=="transparent"?{background:i.backgroundColor}:{}});return`<div style="${y(c)}"><div class="kzeditor-cols" style="${y(l)}">${d}</div></div>`},M0=(t,r,e)=>{var c,h,s,u,k,p,g;let a=t.attributes||{},o=parseInt((c=a.maxWidth)!=null?c:0,10)||0,i=parseInt((h=a.minHeight)!=null?h:0,10)||0,n=(t.children||[]).map(x=>Oe(x,r,e)).join(""),d=j({margin:T((s=a.margin)!=null?s:[0,0,0,0])}),l=j({...a.backgroundColor&&a.backgroundColor!=="transparent"?{background:a.backgroundColor}:{},padding:T((u=a.padding)!=null?u:[0,0,0,0]),"text-align":(k=a.alignment)!=null?k:"left",...o>0?{"max-width":`${o}px`,"margin-left":"auto","margin-right":"auto"}:{},...i>0?{"min-height":`${i}px`}:{},...X((p=a.border)!=null?p:{}),...vt((g=a.boxShadow)!=null?g:{})});return`<div style="${y(d)}"><div style="${y(l)}">${n}</div></div>`},Oe=(t,r,e=$t)=>{if(!t||typeof t!="object")return"";let a=t.type||"";if(a==="columns")return m0(t,r,e);if(a==="section")return M0(t,r,e);let o=e[a];return o?o(t,r):(t.children||[]).map(i=>Oe(i,r,e)).join("")},p2=(t,r)=>`<style>#${t} .kzeditor-cols{}@media (max-width:${r}px){#${t} .kzeditor-cols{grid-template-columns:1fr !important}}</style>`,ni=(t,r={})=>{var l;let e=t&&t.root;if(!e||typeof e!="object")return"";let a=r.renderers||$t,o=g2(e),i=r.formId||"kzeditor-form",n=parseInt((l=(e.attributes||{}).stackBelow)!=null?l:600,10)||600,d=(e.children||[]).map(c=>Oe(c,o,a)).join("");return p2(i,n)+`<div id="${y(i)}" class="kzeditor-form-fields">${d}</div>`},no=(t,r={})=>{var h,s,u,k,p,g;let e=t&&t.root;if(!e||typeof e!="object")return"";let a=e.attributes||{},o=r.renderers||$t,i=r.formId||"kzeditor-form",n=parseInt((h=a.stackBelow)!=null?h:600,10)||600,d=g2(e),l=(e.children||[]).map(x=>Oe(x,d,o)).join(""),c=j({"max-width":`${parseInt((s=a.contentWidth)!=null?s:560,10)||560}px`,margin:"0 auto",padding:T((u=a.padding)!=null?u:[24,24,24,24]),background:(k=a.bgColor)!=null?k:"#FFFFFF","font-family":d.fontFamily,"box-sizing":"border-box",...X((p=a.formBorder)!=null?p:{}),...vt((g=a.formBoxShadow)!=null?g:{})});return p2(i,n)+`<form id="${y(i)}" class="kzeditor-form" method="${y(r.method||"post")}"`+(r.action?` action="${y(r.action)}"`:"")+` style="${y(c)}" novalidate>`+l+"</form>"},y0=new Set(["field","textarea","select","radio","checkbox"]),b0=t=>{let r=t.attributes||{};return{name:String(r.name||""),type:t.type==="field"?r.inputType||"text":t.type,label:r.label||"",required:!!r.required,...r.options?{options:ae(r.options).map(e=>e.value)}:{}}},lo=(t,r={})=>{let e=r.schemaExtractors||{},a=[],o=i=>{if(!(!i||typeof i!="object")){if(e[i.type]){let n=e[i.type](i);n&&a.push(n)}else y0.has(i.type)&&a.push(b0(i));(i.children||[]).forEach(o)}};return o(t&&t.root),a};import{jsx as zt,jsxs as co}from"react/jsx-runtime";q();var f2=(t,r,e)=>r==="fragment"?ni(t,{renderers:e}):no(t,{renderers:e});function li({blocks:t,renderers:r,controls:e=Xr,schemaExtractors:a,header:o=!1,height:i,renderMode:n="fragment",onChange:d,exposeApi:l,suffix:c}){var B,S,W;let{state:h,markClean:s,setTree:u}=$();Qa();let{sensors:k,activeDrag:p,overId:g,handlers:x}=Ba({blocks:t}),[b,m]=k2(!1),[v,f]=k2(!1),M=C0(h.tree);M.current=h.tree;let L=w0(()=>Kr(z=>{d&&d({tree:z,html:f2(z,n,r),schema:lo(z,{schemaExtractors:a})}),s()},600),[d,s,n,r,a]);di(()=>{h.dirty&&L(h.tree)},[h.tree,h.dirty,L]),di(()=>()=>L.cancel&&L.cancel(),[L]),di(()=>{l&&l({getTree:()=>M.current,getHtml:()=>f2(M.current,n,r),getSchema:()=>lo(M.current,{schemaExtractors:a}),setTree:z=>u(z)})},[l,u,n,r,a]);let w=o!==!1;return zt(Eo.Provider,{value:e,children:zt("div",{className:D("kzeditor-embed-root",c),style:i!=null?{height:i}:void 0,children:co(ua,{sensors:k,collisionDetection:la,onDragStart:x.onDragStart,onDragOver:x.onDragOver,onDragEnd:x.onDragEnd,children:[w&&zt(B0,{onPreview:()=>m(!0),suffix:c}),co("div",{className:D("kzeditor-shell-body",c),children:[zt(ze,{blocks:t,navOpen:v,onToggleNav:()=>f(z=>!z),suffix:c}),v&&zt(He,{blocks:t,onClose:()=>f(!1),suffix:c}),zt(ii,{dropTargetId:g,blocks:t,renderers:r,suffix:c})]}),zt(ka,{children:((S=(B=p==null?void 0:p.data)==null?void 0:B.current)==null?void 0:S.source)==="library"&&zt("div",{className:D("kzeditor-drag-chip",c),children:((W=t[p.data.current.type])==null?void 0:W.name)||p.data.current.type})}),zt(Re,{}),b&&zt(Ne,{tree:h.tree,renderFn:z=>no(z,{renderers:r}),onClose:()=>m(!1),suffix:c})]})})})}function B0({onPreview:t,suffix:r}){let{config:e}=E();return co("header",{className:D("kzeditor-shell-header",r),children:[zt(to,{suffix:r}),co("button",{type:"button",onClick:t,className:D("kzeditor-preview-btn",r),children:[zt(ya,{size:14}),zt("span",{children:e.preview})]})]})}import{useEffect as ho,useMemo as P0,useRef as pi,useState as ki}from"react";var _e=t=>({version:2,root:{id:"root",type:"email",attributes:{},children:[{id:`n_${Math.random().toString(36).slice(2,10)}`,type:"html",attributes:{html:String(t!=null?t:""),padding:[0,0,0,0],margin:[0,0,0,0]},children:[]}]}});import{useRef as W0,useState as j0}from"react";import{Fragment as V0,jsx as R,jsxs as ne}from"react/jsx-runtime";function ci({run:t,mergeTags:r=[],mediaUpload:e,sourceMode:a=!1,onToggleSource:o,activeFormats:i={}}){let{config:n}=E(),d=[{label:n.paragraph,tag:"P"},{label:n.heading_1,tag:"H1"},{label:n.heading_2,tag:"H2"},{label:n.heading_3,tag:"H3"},{label:n.heading_4,tag:"H4"},{label:n.heading_5,tag:"H5"},{label:n.heading_6,tag:"H6"}],[l,c]=j0(!1),h=W0(null),s=p=>!!i[p],u=p=>g=>{g.preventDefault(),t(p)},k=async p=>{if(p.preventDefault(),!!e)try{let g=await e({allowedTypes:["image"]});g&&g.url&&t(()=>t2(g.url))}catch{}};return ne("div",{style:z0,children:[ne("select",{title:n.paragraph_format,defaultValue:"",onChange:p=>{let g=p.target.value;g&&t(()=>Xd(g)),p.target.selectedIndex=0},style:S0,children:[R("option",{value:"",disabled:!0,children:n.format}),d.map(p=>R("option",{value:p.tag,children:p.label},p.tag))]}),R(ie,{}),R(pt,{title:n.bold,active:s("bold"),onMouseDown:u(()=>Q("bold")),children:R(Ur,{size:15})}),R(pt,{title:n.italic,active:s("italic"),onMouseDown:u(()=>Q("italic")),children:R(_r,{size:15})}),R(pt,{title:n.underline,active:s("underline"),onMouseDown:u(()=>Q("underline")),children:R(Nr,{size:15})}),R(pt,{title:n.strikethrough,active:s("strikeThrough"),onMouseDown:u(()=>Q("strikeThrough")),children:R(Or,{size:15})}),R(ie,{}),R(pt,{title:n.bulleted_list,active:s("insertUnorderedList"),onMouseDown:u(()=>Q("insertUnorderedList")),children:R(La,{size:15})}),R(pt,{title:n.numbered_list,active:s("insertOrderedList"),onMouseDown:u(()=>Q("insertOrderedList")),children:R($n,{size:15})}),R(ie,{}),R(pt,{title:n.align_left,active:s("justifyLeft"),onMouseDown:u(()=>Q("justifyLeft")),children:R(qr,{size:15})}),R(pt,{title:n.align_center,active:s("justifyCenter"),onMouseDown:u(()=>Q("justifyCenter")),children:R(Gr,{size:15})}),R(pt,{title:n.align_right,active:s("justifyRight"),onMouseDown:u(()=>Q("justifyRight")),children:R(Zr,{size:15})}),R(ie,{}),ne("span",{style:{position:"relative",display:"inline-flex"},children:[R(pt,{title:n.text_color,onMouseDown:p=>{p.preventDefault(),h.current&&h.current.click()},children:R(Qn,{size:15})}),R("input",{ref:h,type:"color",tabIndex:-1,"aria-hidden":"true",onChange:p=>t(()=>Kd("foreColor",p.target.value)),style:{position:"absolute",bottom:0,left:0,width:1,height:1,opacity:0,pointerEvents:"none"}})]}),R(pt,{title:n.insert_link,onMouseDown:u(()=>$a()),children:R(ma,{size:15})}),R(pt,{title:n.remove_link,onMouseDown:u(()=>Ua()),children:R(Bn,{size:15})}),e&&R(pt,{title:n.insert_image,onMouseDown:k,children:R($r,{size:15})}),r.length>0&&ne("div",{style:{position:"relative"},children:[R(pt,{title:n.insert_merge_tag,onMouseDown:p=>{p.preventDefault(),c(g=>!g)},children:R(Pr,{size:15})}),l&&R("div",{style:H0,children:r.map(p=>ne("button",{type:"button",style:A0,onMouseDown:g=>{g.preventDefault(),t(()=>Za(p.tag)),c(!1)},onMouseEnter:g=>g.currentTarget.style.background="#f1f5f9",onMouseLeave:g=>g.currentTarget.style.background="transparent",children:[R("span",{style:{fontWeight:600},children:p.label||p.tag}),R("span",{style:{opacity:.55,marginLeft:"auto",paddingLeft:12,fontSize:11},children:p.tag})]},p.tag))})]}),R(ie,{}),R(pt,{title:n.clear_formatting,onMouseDown:u(()=>r2()),children:R(Dn,{size:15})}),o&&ne(V0,{children:[R(ie,{}),R(pt,{title:a?n.back_to_visual_editor:n.edit_html_source,active:a,onMouseDown:p=>{p.preventDefault(),o()},children:R(ba,{size:15})})]})]})}var z0={display:"flex",alignItems:"center",flexWrap:"wrap",gap:2,padding:"6px 8px",background:"#f8fafc",borderBottom:"1px solid #e2e8f0",flexShrink:0},S0={height:28,border:"1px solid #e2e8f0",borderRadius:4,background:"#fff",fontSize:12,color:"#0f172a",cursor:"pointer",padding:"0 4px"},pt=({title:t,onMouseDown:r,active:e=!1,children:a})=>R("button",{type:"button",title:t,onMouseDown:r,style:{background:e?"#e2e8f0":"transparent",border:"none",color:e?"#0f172a":"#475569",width:28,height:28,display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:4,cursor:"pointer"},onMouseEnter:o=>o.currentTarget.style.background="#e2e8f0",onMouseLeave:o=>o.currentTarget.style.background=e?"#e2e8f0":"transparent",children:a}),ie=()=>R("span",{style:{width:1,height:18,background:"#e2e8f0",margin:"0 3px"}}),H0={position:"absolute",top:"100%",left:0,marginTop:4,background:"#fff",color:"#0f172a",borderRadius:6,boxShadow:"0 8px 24px rgba(0,0,0,.2)",minWidth:200,maxHeight:260,overflowY:"auto",padding:4,zIndex:1001},A0={display:"flex",alignItems:"center",width:"100%",textAlign:"left",background:"transparent",border:"none",borderRadius:4,padding:"6px 8px",cursor:"pointer",fontSize:12,color:"#0f172a"};import{useEffect as x2,useRef as D0,useState as hi}from"react";import{Fragment as I0,jsx as kt,jsxs as Ue}from"react/jsx-runtime";var T0=t=>{let r=t&&t.style&&t.style.width,e=/^(\d+(?:\.\d+)?)%$/.exec(r||"");return e?Math.round(parseFloat(e[1])):""},E0=t=>{if(!t||!t.style)return"";let{marginLeft:r,marginRight:e,display:a}=t.style;return a!=="block"?"":r==="auto"&&e==="auto"?"center":r==="auto"?"right":e==="auto"?"left":""};function gi({surfaceRef:t,onCommit:r}){let{config:e}=E(),a=[{label:"S",pct:25,title:e.small_25},{label:"M",pct:50,title:e.medium_50},{label:"L",pct:75,title:e.large_75},{label:e.full,pct:100,title:e.full_width_100}],[o,i]=hi(null),[n,d]=hi(null),[,l]=hi(0),c=D0(null),h=r||(()=>{});if(x2(()=>{let L=t.current;if(!L)return;let w=B=>{let S=B.target;S&&S.tagName==="IMG"&&L.contains(S)&&(i(S),d(S.getBoundingClientRect()))};return L.addEventListener("click",w),()=>L.removeEventListener("click",w)},[t]),x2(()=>{if(!o)return;let L=B=>{B.target!==o&&(c.current&&c.current.contains(B.target)||i(null))},w=()=>{if(!o.isConnected){i(null);return}d(o.getBoundingClientRect())};return document.addEventListener("mousedown",L,!0),window.addEventListener("scroll",w,!0),window.addEventListener("resize",w),()=>{document.removeEventListener("mousedown",L,!0),window.removeEventListener("scroll",w,!0),window.removeEventListener("resize",w)}},[o]),!o||!n)return null;let s=L=>{L(o),d(o.getBoundingClientRect()),l(w=>w+1),h()},u=L=>s(w=>{w.style.maxWidth="100%",w.style.height="auto",w.style.width=L?`${L}%`:"",w.removeAttribute("width"),w.removeAttribute("height")}),k=L=>s(w=>{let B=parseInt(L,10);w.style.maxWidth="100%",w.style.height="auto",w.style.width=Number.isFinite(B)&&B>0?`${B}px`:"",w.removeAttribute("width"),w.removeAttribute("height")}),p=L=>s(w=>{w.style.display="block",L==="center"?(w.style.marginLeft="auto",w.style.marginRight="auto"):L==="right"?(w.style.marginLeft="auto",w.style.marginRight="0"):(w.style.marginLeft="0",w.style.marginRight="auto")}),g=L=>s(w=>w.setAttribute("alt",L||"")),x=()=>{o.remove(),i(null),h()},b=T0(o),m=E0(o),v=Math.max(8,Math.min(n.left,window.innerWidth-320)),M=n.top>140?{bottom:window.innerHeight-n.top+8}:{top:n.bottom+8};return Ue(I0,{children:[kt("div",{style:{position:"fixed",left:n.left-2,top:n.top-2,width:n.width+4,height:n.height+4,border:"2px solid #2563eb",borderRadius:4,pointerEvents:"none",zIndex:1e3}}),Ue("div",{ref:c,style:{...R0,left:v,...M},children:[Ue("div",{style:si,children:[kt("span",{style:ui,children:e.size}),a.map(L=>kt("button",{type:"button",title:L.title,onMouseDown:w=>{w.preventDefault(),u(L.pct)},style:$e(b===L.pct),children:L.label},L.pct)),kt("input",{type:"number",min:"1",placeholder:"px",title:e.custom_width_in_pixels,onMouseDown:L=>L.stopPropagation(),onChange:L=>k(L.target.value),style:F0})]}),Ue("div",{style:si,children:[kt("span",{style:ui,children:e.align}),kt("button",{type:"button",title:e.align_left,onMouseDown:L=>{L.preventDefault(),p("left")},style:$e(m==="left"),children:kt(qr,{size:14})}),kt("button",{type:"button",title:e.align_center,onMouseDown:L=>{L.preventDefault(),p("center")},style:$e(m==="center"),children:kt(Gr,{size:14})}),kt("button",{type:"button",title:e.align_right,onMouseDown:L=>{L.preventDefault(),p("right")},style:$e(m==="right"),children:kt(Zr,{size:14})}),kt("span",{style:{flex:1}}),kt("button",{type:"button",title:e.remove_image,onMouseDown:L=>{L.preventDefault(),x()},style:{...$e(!1),color:"#dc2626"},children:kt(Ir,{size:14})})]}),Ue("div",{style:si,children:[kt("span",{style:ui,children:e.alt}),kt("input",{type:"text",placeholder:e.alt_text_accessibility,defaultValue:o.getAttribute("alt")||"",onMouseDown:L=>L.stopPropagation(),onChange:L=>g(L.target.value),style:N0})]})]})]})}var R0={position:"fixed",zIndex:1001,background:"#fff",border:"1px solid #e2e8f0",borderRadius:8,boxShadow:"0 8px 24px rgba(0,0,0,.18)",padding:8,width:300,display:"flex",flexDirection:"column",gap:6},si={display:"flex",alignItems:"center",gap:4},ui={fontSize:11,fontWeight:600,color:"#64748b",width:38,flexShrink:0},$e=t=>({minWidth:28,height:26,padding:"0 6px",display:"inline-flex",alignItems:"center",justifyContent:"center",border:"1px solid "+(t?"#2563eb":"#e2e8f0"),background:t?"#eff6ff":"#fff",color:t?"#2563eb":"#475569",borderRadius:4,fontSize:12,fontWeight:600,cursor:"pointer"}),F0={width:52,height:26,marginLeft:"auto",border:"1px solid #e2e8f0",borderRadius:4,padding:"0 6px",fontSize:12,color:"#0f172a",boxSizing:"border-box"},N0={flex:1,height:26,border:"1px solid #e2e8f0",borderRadius:4,padding:"0 8px",fontSize:12,color:"#0f172a",boxSizing:"border-box"};import{jsx as de,jsxs as _0}from"react/jsx-runtime";q();var O0=`
141
+ [data-kzeditor-editable="richtext"] ul { list-style: disc outside; padding-left: 1.5em; margin: 0 0 1em; }
142
+ [data-kzeditor-editable="richtext"] ol { list-style: decimal outside; padding-left: 1.5em; margin: 0 0 1em; }
143
+ [data-kzeditor-editable="richtext"] li { display: list-item; }
144
+ [data-kzeditor-editable="richtext"] img { max-width: 100%; height: auto; }
145
+ [data-kzeditor-editable="richtext"] a { color: #2563eb; text-decoration: underline; }
146
+ `;function fi({value:t="",height:r,onChange:e,exposeApi:a,suffix:o}){let i=pi(null),n=pi(null),d=ir(),l=fe(),[c,h]=ki(!1),[s,u]=ki(""),k=pi(null),p=()=>i.current?i.current.innerHTML:"",g=W=>{i.current&&(i.current.innerHTML=W||"")},x=P0(()=>Kr(()=>{if(!e)return;let W=p();e({html:W,tree:_e(W)})},600),[e]),b=()=>{if(x.cancel&&x.cancel(),!e)return;let W=p();e({html:W,tree:_e(W)})};ho(()=>()=>x.cancel&&x.cancel(),[x]),ho(()=>{let W=i.current;if(!W||k.current!=null||document.activeElement===W)return;let z=t||"";z!==W.innerHTML&&(W.innerHTML=z)},[t]),ho(()=>{if(c||k.current==null)return;let W=i.current;W&&(W.innerHTML=k.current,k.current=null,b())},[c]),ho(()=>{a&&a({getHtml:p,setHtml:g,getTree:()=>_e(p())})},[a]);let[m,v]=ki({}),f=()=>{let W=i.current;if(!W)return;let z=window.getSelection();if(!(z&&z.rangeCount&&W.contains(z.getRangeAt(0).commonAncestorContainer)))return;let A=H=>{try{return document.queryCommandState(H)}catch{return!1}};v({bold:A("bold"),italic:A("italic"),underline:A("underline"),strikeThrough:A("strikeThrough"),insertUnorderedList:A("insertUnorderedList"),insertOrderedList:A("insertOrderedList"),justifyLeft:A("justifyLeft"),justifyCenter:A("justifyCenter"),justifyRight:A("justifyRight")})},M=()=>{let W=i.current,z=qa();z&&W&&W.contains(z.commonAncestorContainer)&&(n.current=z),f()},L=W=>{let z=i.current;if(!z)return;z.focus();let F=window.getSelection();!(F&&F.rangeCount&&z.contains(F.getRangeAt(0).commonAncestorContainer))&&n.current&&Ga(n.current),W(),M(),x()},w=()=>{c?(k.current=s,h(!1)):(u(a2(p())),h(!0))},B=W=>{let z=W.clipboardData&&W.clipboardData.getData("text/html"),F=W.clipboardData&&W.clipboardData.getData("text/plain");if(!z&&Yd(F)){W.preventDefault();let A=F.trim();_a(`<a href="${A.replace(/"/g,"%22")}">${A.replace(/&/g,"&amp;").replace(/</g,"&lt;")}</a>`),M(),x()}},S=W=>{(W.key===" "||W.key==="Enter")&&Jd()&&(M(),x())};return _0("div",{className:`${D("kzeditor-embed-root",o)} kzeditor-embed-root--richtext`,style:r!=null?{height:r}:void 0,children:[de("style",{children:O0}),de(ci,{run:L,mergeTags:d,mediaUpload:l,sourceMode:c,onToggleSource:w,activeFormats:m}),c?de("textarea",{value:s,onChange:W=>u(W.target.value),spellCheck:!1,style:{flex:1,width:"100%",boxSizing:"border-box",overflowY:"auto",padding:"14px 16px",outline:"none",border:"none",resize:"none",fontSize:13,lineHeight:1.6,fontFamily:"ui-monospace, SFMono-Regular, Menlo, Consolas, monospace",color:"#0f172a",background:"#f8fafc"}}):de("div",{ref:i,"data-kzeditor-editable":"richtext",contentEditable:"true",suppressContentEditableWarning:!0,onInput:()=>{M(),x()},onKeyDown:S,onKeyUp:M,onMouseUp:M,onPaste:B,onBlur:()=>{M(),b()},style:{flex:1,overflowY:"auto",padding:"14px 16px",outline:"none",fontSize:14,lineHeight:1.6,color:"#111"}}),!c&&de(gi,{surfaceRef:i,onCommit:b}),de(Fe,{})]})}var v2={slug:"blank-email",name:"Blank email",category:"custom",tree:{version:2,root:{id:"root",type:"email",attributes:{},children:[]}}};var xi=v2.tree;var vi={version:2,root:{id:"root",type:"certificate",attributes:{pageSize:"A4",orientation:"landscape",fontFamily:"Poppins",bgColor:"#FFFFFF",bgImage:"",bgSize:"cover",contentBg:"transparent",padding:[48,56,48,56]},children:[]}};var U0=["Poppins","Roboto","Lora","DM Sans","Libre Baskerville","Cinzel","Great Vibes","Alex Brush","Allura","Abhaya Libre","Arial, sans-serif"],Z0={name:"Certificate",root:!0,category:"structure",attributes:{pageSize:{type:"select",default:"A4",options:["A4","Letter"],group:"style",label:"Page size"},orientation:{type:"select",default:"landscape",options:["landscape","portrait"],group:"style",label:"Orientation"},fontFamily:{type:"select",default:"Poppins",options:U0,group:"style",label:"Default font"},bgColor:{type:"color",default:"#FFFFFF",group:"style",label:"Page background"},bgImage:{type:"image",default:"",group:"style",label:"Background image"},bgSize:{type:"select",default:"cover",options:["cover","contain","stretch"],group:"style",label:"Background fit"},contentBg:{type:"color",default:"transparent",group:"style",label:"Content overlay"},padding:{type:"spacing",default:[48,56,48,56],group:"spacing",label:"Content padding"}}},q0={name:"QR code",category:"content",attributes:{value:{type:"string",default:"{{verification_url}}",group:"content",label:"Encoded value"},size:{type:"number",default:120,min:48,max:400,group:"content",label:"Size (px)"},fg:{type:"color",default:"#000000",group:"style",label:"Foreground"},bg:{type:"color",default:"#FFFFFF",group:"style",label:"Background"},alignment:{type:"alignment",default:"center",group:"style",label:"Alignment",options:["left","center","right"]},padding:{type:"spacing",default:[8,0,8,0],group:"spacing",label:"Padding"},margin:{type:"spacing",default:[0,0,0,0],group:"spacing",label:"Margin"}}};function L2(t,r=["video","timer"]){let{email:e,...a}=t,o={certificate:Z0,...a,qr:q0};return r.forEach(i=>{o[i]&&(o[i]={...o[i],hidden:!0})}),o}var m2={renderers:$t,optionList:ae,inline:j,spacing:T,border:X,boxShadow:vt,escAttr:y,escHtml:Z};function M2(t=[],{baseBlocks:r={},baseRenderers:e={},baseControls:a={},hideBlocks:o=[],helpers:i={}}={}){let n={...r},d={...e},l={...a},c={};return(o||[]).forEach(h=>{n[h]&&(n[h]={...n[h],hidden:!0})}),(t||[]).forEach(h=>{if(!h||!h.type)return;let{type:s,spec:u,render:k,controls:p,schema:g}=h;u&&(n[s]=u),typeof k=="function"&&(d[s]=(x,b)=>k(x,b,i)),p&&Object.assign(l,p),typeof g=="function"&&(c[s]=g)}),{blocks:n,renderers:d,controls:l,schemaExtractors:c}}import{jsx as Nt}from"react/jsx-runtime";var Y0={version:2,root:{id:"root",type:"form",attributes:{},children:[]}},J0=G0(function({mode:r="builder",initialTree:e,value:a,mergeTags:o=[],mediaUpload:i,onChange:n,header:d=!1,height:l,renderMode:c="document",blocks:h,blockPlugins:s=[],hideBlocks:u=[],templates:k=[],onTemplatesClick:p,suffix:g,config:x},b){let m=X0(null);if(K0(b,()=>({getTree:()=>{var M,L;return(L=(M=m.current)==null?void 0:M.getTree)==null?void 0:L.call(M)},getHtml:()=>{var M,L;return(L=(M=m.current)==null?void 0:M.getHtml)==null?void 0:L.call(M)},getSchema:()=>{var M,L;return(L=(M=m.current)==null?void 0:M.getSchema)==null?void 0:L.call(M)},setTree:M=>{var L,w;return(w=(L=m.current)==null?void 0:L.setTree)==null?void 0:w.call(L,M)},setHtml:M=>{var L,w;return(w=(L=m.current)==null?void 0:L.setHtml)==null?void 0:w.call(L,M)}}),[]),r==="form"){let{blocks:M,renderers:L,controls:w,schemaExtractors:B}=M2(s,{baseBlocks:h||Wi.blocks,baseRenderers:$t,baseControls:Xr,hideBlocks:u,helpers:m2}),S=e&&e.root?e:JSON.parse(JSON.stringify(Y0));return Nt(ke,{value:{mergeTags:o,mediaUpload:i,config:x},children:Nt(Xe,{tree:S,children:Nt(li,{blocks:M,renderers:L,controls:w,schemaExtractors:B,header:d,height:l,renderMode:c==="document"?"fragment":c,onChange:n,exposeApi:W=>{m.current=W},suffix:g})})})}if(r==="richtext")return Nt(ke,{value:{mergeTags:o,mediaUpload:i,config:x},children:Nt(fi,{value:a,height:l,onChange:n,exposeApi:M=>{m.current=M},suffix:g})});if(r==="certificate"){let M=h||L2(po.blocks,u&&u.length?u:void 0),L=e&&e.root?e:JSON.parse(JSON.stringify(vi));return Nt(ke,{value:{mergeTags:o,mediaUpload:i,config:x},children:Nt(Xe,{tree:L,children:Nt(ro,{blocks:M,templates:k,onTemplatesClick:p,header:!0,height:l,onChange:n,exposeApi:w=>{m.current=w},suffix:g,renderHtmlFn:Fa,previewRenderFn:_o})})})}let v=h||po.blocks,f=e&&e.root?e:JSON.parse(JSON.stringify(xi));return Nt(ke,{value:{mergeTags:o,mediaUpload:i,config:x},children:Nt(Xe,{tree:f,children:Nt(ro,{blocks:v,templates:k,onTemplatesClick:p,header:d,height:l,renderMode:c,onChange:n,exposeApi:M=>{m.current=M},suffix:g})})})}),Ze=J0;import{forwardRef as Q0}from"react";import{jsx as es}from"react/jsx-runtime";var ts=Q0(function(r,e){return es(Ze,{...r,ref:e,mode:"richtext"})}),rs=ts;import{forwardRef as as}from"react";import{jsx as ns}from"react/jsx-runtime";var os=as(function(r,e){return ns(Ze,{...r,ref:e,mode:"form"})}),is=os;export{vi as BLANK_CERT_TREE,xi as BLANK_TREE,Ze as EmailEditor,is as FormEditor,rs as RichTextEditor,pe as defaultMediaUpload,lo as extractSchema,Yr as htmlToBlocks,Ae as pageDims,Fa as renderCertificateContent,_o as renderCertificateDocument,Po as renderContent,Ra as renderDocument,ni as renderFormContent,no as renderFormDocument,_e as treeFromHtml};