@kaushalparajuli/react-crud-ui 1.0.21 → 1.0.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +74 -63
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +23413 -8244
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +4 -1
package/dist/index.cjs
CHANGED
|
@@ -1,228 +1,228 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),oe=require("react"),ma=require("react-dom"),Te=require("react-router-dom");function ha(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const l=ha(oe),Ar=ha(ma);function gi(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function we(...e){return t=>{let r=!1;const n=e.map(o=>{const s=gi(o,t);return!r&&typeof s=="function"&&(r=!0),s});if(r)return()=>{for(let o=0;o<n.length;o++){const s=n[o];typeof s=="function"?s():gi(e[o],null)}}}}function ie(...e){return l.useCallback(we(...e),e)}var Tf=Symbol.for("react.lazy"),en=l[" use ".trim().toString()];function Mf(e){return typeof e=="object"&&e!==null&&"then"in e}function ga(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Tf&&"_payload"in e&&Mf(e._payload)}function xa(e){const t=Df(e),r=l.forwardRef((n,o)=>{let{children:s,...i}=n;ga(s)&&typeof en=="function"&&(s=en(s._payload));const a=l.Children.toArray(s),u=a.find(Of);if(u){const d=u.props.children,p=a.map(f=>f===u?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return c.jsx(t,{...i,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return c.jsx(t,{...i,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}var kf=xa("Slot");function Df(e){const t=l.forwardRef((r,n)=>{let{children:o,...s}=r;if(ga(o)&&typeof en=="function"&&(o=en(o._payload)),l.isValidElement(o)){const i=Lf(o),a=$f(s,o.props);return o.type!==l.Fragment&&(a.ref=n?we(n,i):i),l.cloneElement(o,a)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var If=Symbol("radix.slottable");function Of(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===If}function $f(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...a)=>{const u=s(...a);return o(...a),u}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function Lf(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function va(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=va(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function ya(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=va(e))&&(n&&(n+=" "),n+=t);return n}const xi=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,vi=ya,hn=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return vi(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:o,defaultVariants:s}=t,i=Object.keys(o).map(d=>{const p=r==null?void 0:r[d],f=s==null?void 0:s[d];if(p===null)return null;const m=xi(p)||xi(f);return o[d][m]}),a=r&&Object.entries(r).reduce((d,p)=>{let[f,m]=p;return m===void 0||(d[f]=m),d},{}),u=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((d,p)=>{let{class:f,className:m,...g}=p;return Object.entries(g).every(x=>{let[h,y]=x;return Array.isArray(y)?y.includes({...s,...a}[h]):{...s,...a}[h]===y})?[...d,f,m]:d},[]);return vi(e,i,u,r==null?void 0:r.class,r==null?void 0:r.className)},$o="-",Ff=e=>{const t=Bf(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:i=>{const a=i.split($o);return a[0]===""&&a.length!==1&&a.shift(),ba(a,t)||Vf(i)},getConflictingClassGroupIds:(i,a)=>{const u=r[i]||[];return a&&n[i]?[...u,...n[i]]:u}}},ba=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),o=n?ba(e.slice(1),n):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join($o);return(i=t.validators.find(({validator:a})=>a(s)))==null?void 0:i.classGroupId},yi=/^\[(.+)\]$/,Vf=e=>{if(yi.test(e)){const t=yi.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},Bf=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return Hf(Object.entries(e.classGroups),r).forEach(([s,i])=>{go(i,n,s,t)}),n},go=(e,t,r,n)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:bi(t,o);s.classGroupId=r;return}if(typeof o=="function"){if(Wf(o)){go(o(n),t,r,n);return}t.validators.push({validator:o,classGroupId:r});return}Object.entries(o).forEach(([s,i])=>{go(i,bi(t,s),r,n)})})},bi=(e,t)=>{let r=e;return t.split($o).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},Wf=e=>e.isThemeGetter,Hf=(e,t)=>t?e.map(([r,n])=>{const o=n.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([i,a])=>[t+i,a])):s);return[r,o]}):e,Uf=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const o=(s,i)=>{r.set(s,i),t++,t>e&&(t=0,n=r,r=new Map)};return{get(s){let i=r.get(s);if(i!==void 0)return i;if((i=n.get(s))!==void 0)return o(s,i),i},set(s,i){r.has(s)?r.set(s,i):o(s,i)}}},wa="!",zf=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,o=t[0],s=t.length,i=a=>{const u=[];let d=0,p=0,f;for(let y=0;y<a.length;y++){let v=a[y];if(d===0){if(v===o&&(n||a.slice(y,y+s)===t)){u.push(a.slice(p,y)),p=y+s;continue}if(v==="/"){f=y;continue}}v==="["?d++:v==="]"&&d--}const m=u.length===0?a:a.substring(p),g=m.startsWith(wa),x=g?m.substring(1):m,h=f&&f>p?f-p:void 0;return{modifiers:u,hasImportantModifier:g,baseClassName:x,maybePostfixModifierPosition:h}};return r?a=>r({className:a,parseClassName:i}):i},Gf=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n)}),t.push(...r.sort()),t},Kf=e=>({cache:Uf(e.cacheSize),parseClassName:zf(e),...Ff(e)}),Yf=/\s+/,qf=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o}=t,s=[],i=e.trim().split(Yf);let a="";for(let u=i.length-1;u>=0;u-=1){const d=i[u],{modifiers:p,hasImportantModifier:f,baseClassName:m,maybePostfixModifierPosition:g}=r(d);let x=!!g,h=n(x?m.substring(0,g):m);if(!h){if(!x){a=d+(a.length>0?" "+a:a);continue}if(h=n(m),!h){a=d+(a.length>0?" "+a:a);continue}x=!1}const y=Gf(p).join(":"),v=f?y+wa:y,b=v+h;if(s.includes(b))continue;s.push(b);const S=o(h,x);for(let C=0;C<S.length;++C){const N=S[C];s.push(v+N)}a=d+(a.length>0?" "+a:a)}return a};function Xf(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=Sa(t))&&(n&&(n+=" "),n+=r);return n}const Sa=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=Sa(e[n]))&&(r&&(r+=" "),r+=t);return r};function Qf(e,...t){let r,n,o,s=i;function i(u){const d=t.reduce((p,f)=>f(p),e());return r=Kf(d),n=r.cache.get,o=r.cache.set,s=a,a(u)}function a(u){const d=n(u);if(d)return d;const p=qf(u,r);return o(u,p),p}return function(){return s(Xf.apply(null,arguments))}}const ve=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},Ca=/^\[(?:([a-z-]+):)?(.+)\]$/i,Zf=/^\d+\/\d+$/,Jf=new Set(["px","full","screen"]),ep=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,tp=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,rp=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,np=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,op=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,pt=e=>Gt(e)||Jf.has(e)||Zf.test(e),yt=e=>sr(e,"length",fp),Gt=e=>!!e&&!Number.isNaN(Number(e)),to=e=>sr(e,"number",Gt),fr=e=>!!e&&Number.isInteger(Number(e)),sp=e=>e.endsWith("%")&&Gt(e.slice(0,-1)),se=e=>Ca.test(e),bt=e=>ep.test(e),ip=new Set(["length","size","percentage"]),ap=e=>sr(e,ip,Na),lp=e=>sr(e,"position",Na),cp=new Set(["image","url"]),up=e=>sr(e,cp,mp),dp=e=>sr(e,"",pp),pr=()=>!0,sr=(e,t,r)=>{const n=Ca.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},fp=e=>tp.test(e)&&!rp.test(e),Na=()=>!1,pp=e=>np.test(e),mp=e=>op.test(e),hp=()=>{const e=ve("colors"),t=ve("spacing"),r=ve("blur"),n=ve("brightness"),o=ve("borderColor"),s=ve("borderRadius"),i=ve("borderSpacing"),a=ve("borderWidth"),u=ve("contrast"),d=ve("grayscale"),p=ve("hueRotate"),f=ve("invert"),m=ve("gap"),g=ve("gradientColorStops"),x=ve("gradientColorStopPositions"),h=ve("inset"),y=ve("margin"),v=ve("opacity"),b=ve("padding"),S=ve("saturate"),C=ve("scale"),N=ve("sepia"),_=ve("skew"),j=ve("space"),$=ve("translate"),D=()=>["auto","contain","none"],O=()=>["auto","hidden","clip","visible","scroll"],P=()=>["auto",se,t],A=()=>[se,t],M=()=>["",pt,yt],z=()=>["auto",Gt,se],q=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],H=()=>["solid","dashed","dotted","double","none"],k=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],W=()=>["start","end","center","between","around","evenly","stretch"],L=()=>["","0",se],re=()=>["auto","avoid","all","avoid-page","page","left","right","column"],F=()=>[Gt,se];return{cacheSize:500,separator:":",theme:{colors:[pr],spacing:[pt,yt],blur:["none","",bt,se],brightness:F(),borderColor:[e],borderRadius:["none","","full",bt,se],borderSpacing:A(),borderWidth:M(),contrast:F(),grayscale:L(),hueRotate:F(),invert:L(),gap:A(),gradientColorStops:[e],gradientColorStopPositions:[sp,yt],inset:P(),margin:P(),opacity:F(),padding:A(),saturate:F(),scale:F(),sepia:L(),skew:F(),space:A(),translate:A()},classGroups:{aspect:[{aspect:["auto","square","video",se]}],container:["container"],columns:[{columns:[bt]}],"break-after":[{"break-after":re()}],"break-before":[{"break-before":re()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...q(),se]}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:D()}],"overscroll-x":[{"overscroll-x":D()}],"overscroll-y":[{"overscroll-y":D()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[h]}],"inset-x":[{"inset-x":[h]}],"inset-y":[{"inset-y":[h]}],start:[{start:[h]}],end:[{end:[h]}],top:[{top:[h]}],right:[{right:[h]}],bottom:[{bottom:[h]}],left:[{left:[h]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",fr,se]}],basis:[{basis:P()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",se]}],grow:[{grow:L()}],shrink:[{shrink:L()}],order:[{order:["first","last","none",fr,se]}],"grid-cols":[{"grid-cols":[pr]}],"col-start-end":[{col:["auto",{span:["full",fr,se]},se]}],"col-start":[{"col-start":z()}],"col-end":[{"col-end":z()}],"grid-rows":[{"grid-rows":[pr]}],"row-start-end":[{row:["auto",{span:[fr,se]},se]}],"row-start":[{"row-start":z()}],"row-end":[{"row-end":z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",se]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",se]}],gap:[{gap:[m]}],"gap-x":[{"gap-x":[m]}],"gap-y":[{"gap-y":[m]}],"justify-content":[{justify:["normal",...W()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...W(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...W(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[b]}],px:[{px:[b]}],py:[{py:[b]}],ps:[{ps:[b]}],pe:[{pe:[b]}],pt:[{pt:[b]}],pr:[{pr:[b]}],pb:[{pb:[b]}],pl:[{pl:[b]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[j]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[j]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",se,t]}],"min-w":[{"min-w":[se,t,"min","max","fit"]}],"max-w":[{"max-w":[se,t,"none","full","min","max","fit","prose",{screen:[bt]},bt]}],h:[{h:[se,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[se,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[se,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[se,t,"auto","min","max","fit"]}],"font-size":[{text:["base",bt,yt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",to]}],"font-family":[{font:[pr]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",se]}],"line-clamp":[{"line-clamp":["none",Gt,to]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",pt,se]}],"list-image":[{"list-image":["none",se]}],"list-style-type":[{list:["none","disc","decimal",se]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...H(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",pt,yt]}],"underline-offset":[{"underline-offset":["auto",pt,se]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",se]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",se]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...q(),lp]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",ap]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},up]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[x]}],"gradient-via-pos":[{via:[x]}],"gradient-to-pos":[{to:[x]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:[...H(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:H()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...H()]}],"outline-offset":[{"outline-offset":[pt,se]}],"outline-w":[{outline:[pt,yt]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:M()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[pt,yt]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",bt,dp]}],"shadow-color":[{shadow:[pr]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...k(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":k()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",bt,se]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[p]}],invert:[{invert:[f]}],saturate:[{saturate:[S]}],sepia:[{sepia:[N]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[p]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[S]}],"backdrop-sepia":[{"backdrop-sepia":[N]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",se]}],duration:[{duration:F()}],ease:[{ease:["linear","in","out","in-out",se]}],delay:[{delay:F()}],animate:[{animate:["none","spin","ping","pulse","bounce",se]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[C]}],"scale-x":[{"scale-x":[C]}],"scale-y":[{"scale-y":[C]}],rotate:[{rotate:[fr,se]}],"translate-x":[{"translate-x":[$]}],"translate-y":[{"translate-y":[$]}],"skew-x":[{"skew-x":[_]}],"skew-y":[{"skew-y":[_]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",se]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",se]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",se]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[pt,yt,to]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},gp=Qf(hp);function T(...e){return gp(ya(e))}function xp(e,t="NPR"){return new Intl.NumberFormat("en-NP",{style:"currency",currency:t,minimumFractionDigits:2}).format(e)}function Lo(e,t={}){const r={year:"numeric",month:"long",day:"numeric"};return new Date(e).toLocaleDateString("en-US",{...r,...t})}function Xr(e){return new Date(e).toLocaleString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function vp(e){const t=new Date,r=new Date(e),n=Math.floor((t-r)/1e3);return n<60?"just now":n<3600?`${Math.floor(n/60)} minutes ago`:n<86400?`${Math.floor(n/3600)} hours ago`:n<604800?`${Math.floor(n/86400)} days ago`:Lo(e)}function yp(e,t=100){return e?e.length<=t?e:e.slice(0,t)+"...":""}function bp(e){return e?e.charAt(0).toUpperCase()+e.slice(1):""}function wp(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function Ea(e,t=300){let r;return function(...o){const s=()=>{clearTimeout(r),e(...o)};clearTimeout(r),r=setTimeout(s,t)}}function Sp(e){return JSON.parse(JSON.stringify(e))}function Cp(e){return e?Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1:!0}function Np(e){return e?e.split(" ").map(t=>t[0]).join("").toUpperCase().slice(0,2):""}function Ep(){return Math.random().toString(36).substring(2,9)}function jp(e){const t=new URLSearchParams(e),r={};for(const[n,o]of t)r[n]=o;return r}function Rp(e){const t=new URLSearchParams;return Object.entries(e).forEach(([r,n])=>{n!=null&&n!==""&&t.append(r,n)}),t.toString()}/**
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("react/jsx-runtime"),K=require("react"),Ja=require("react-dom"),Je=require("react-router-dom");function ec(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const m=ec(K),wi=ec(Ja);function zl(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function je(...e){return t=>{let n=!1;const i=e.map(s=>{const o=zl(s,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let s=0;s<i.length;s++){const o=i[s];typeof o=="function"?o():zl(e[s],null)}}}}function ye(...e){return m.useCallback(je(...e),e)}var up=Symbol.for("react.lazy"),is=m[" use ".trim().toString()];function dp(e){return typeof e=="object"&&e!==null&&"then"in e}function tc(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===up&&"_payload"in e&&dp(e._payload)}function nc(e){const t=hp(e),n=m.forwardRef((i,s)=>{let{children:o,...l}=i;tc(o)&&typeof is=="function"&&(o=is(o._payload));const a=m.Children.toArray(o),r=a.find(mp);if(r){const f=r.props.children,d=a.map(h=>h===r?m.Children.count(f)>1?m.Children.only(null):m.isValidElement(f)?f.props.children:null:h);return g.jsx(t,{...l,ref:s,children:m.isValidElement(f)?m.cloneElement(f,void 0,d):null})}return g.jsx(t,{...l,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}var fp=nc("Slot");function hp(e){const t=m.forwardRef((n,i)=>{let{children:s,...o}=n;if(tc(s)&&typeof is=="function"&&(s=is(s._payload)),m.isValidElement(s)){const l=vp(s),a=gp(o,s.props);return s.type!==m.Fragment&&(a.ref=i?je(i,l):l),m.cloneElement(s,a)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var pp=Symbol("radix.slottable");function mp(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===pp}function gp(e,t){const n={...t};for(const i in t){const s=e[i],o=t[i];/^on[A-Z]/.test(i)?s&&o?n[i]=(...a)=>{const r=o(...a);return s(...a),r}:s&&(n[i]=s):i==="style"?n[i]={...s,...o}:i==="className"&&(n[i]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function vp(e){var i,s;let t=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function ic(e){var t,n,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=ic(e[t]))&&(i&&(i+=" "),i+=n)}else for(n in e)e[n]&&(i&&(i+=" "),i+=n);return i}function sc(){for(var e,t,n=0,i="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=ic(e))&&(i&&(i+=" "),i+=t);return i}const Hl=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Vl=sc,bs=(e,t)=>n=>{var i;if((t==null?void 0:t.variants)==null)return Vl(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:o}=t,l=Object.keys(s).map(f=>{const d=n==null?void 0:n[f],h=o==null?void 0:o[f];if(d===null)return null;const b=Hl(d)||Hl(h);return s[f][b]}),a=n&&Object.entries(n).reduce((f,d)=>{let[h,b]=d;return b===void 0||(f[h]=b),f},{}),r=t==null||(i=t.compoundVariants)===null||i===void 0?void 0:i.reduce((f,d)=>{let{class:h,className:b,..._}=d;return Object.entries(_).every(C=>{let[S,c]=C;return Array.isArray(c)?c.includes({...o,...a}[S]):{...o,...a}[S]===c})?[...f,h,b]:f},[]);return Vl(e,l,r,n==null?void 0:n.class,n==null?void 0:n.className)},Qr="-",bp=e=>{const t=xp(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:i}=e;return{getClassGroupId:l=>{const a=l.split(Qr);return a[0]===""&&a.length!==1&&a.shift(),rc(a,t)||yp(l)},getConflictingClassGroupIds:(l,a)=>{const r=n[l]||[];return a&&i[l]?[...r,...i[l]]:r}}},rc=(e,t)=>{var l;if(e.length===0)return t.classGroupId;const n=e[0],i=t.nextPart.get(n),s=i?rc(e.slice(1),i):void 0;if(s)return s;if(t.validators.length===0)return;const o=e.join(Qr);return(l=t.validators.find(({validator:a})=>a(o)))==null?void 0:l.classGroupId},Wl=/^\[(.+)\]$/,yp=e=>{if(Wl.test(e)){const t=Wl.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},xp=e=>{const{theme:t,prefix:n}=e,i={nextPart:new Map,validators:[]};return _p(Object.entries(e.classGroups),n).forEach(([o,l])=>{Tr(l,i,o,t)}),i},Tr=(e,t,n,i)=>{e.forEach(s=>{if(typeof s=="string"){const o=s===""?t:$l(t,s);o.classGroupId=n;return}if(typeof s=="function"){if(wp(s)){Tr(s(i),t,n,i);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([o,l])=>{Tr(l,$l(t,o),n,i)})})},$l=(e,t)=>{let n=e;return t.split(Qr).forEach(i=>{n.nextPart.has(i)||n.nextPart.set(i,{nextPart:new Map,validators:[]}),n=n.nextPart.get(i)}),n},wp=e=>e.isThemeGetter,_p=(e,t)=>t?e.map(([n,i])=>{const s=i.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([l,a])=>[t+l,a])):o);return[n,s]}):e,Cp=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,i=new Map;const s=(o,l)=>{n.set(o,l),t++,t>e&&(t=0,i=n,n=new Map)};return{get(o){let l=n.get(o);if(l!==void 0)return l;if((l=i.get(o))!==void 0)return s(o,l),l},set(o,l){n.has(o)?n.set(o,l):s(o,l)}}},oc="!",Sp=e=>{const{separator:t,experimentalParseClassName:n}=e,i=t.length===1,s=t[0],o=t.length,l=a=>{const r=[];let f=0,d=0,h;for(let c=0;c<a.length;c++){let u=a[c];if(f===0){if(u===s&&(i||a.slice(c,c+o)===t)){r.push(a.slice(d,c)),d=c+o;continue}if(u==="/"){h=c;continue}}u==="["?f++:u==="]"&&f--}const b=r.length===0?a:a.substring(d),_=b.startsWith(oc),C=_?b.substring(1):b,S=h&&h>d?h-d:void 0;return{modifiers:r,hasImportantModifier:_,baseClassName:C,maybePostfixModifierPosition:S}};return n?a=>n({className:a,parseClassName:l}):l},Ep=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(i=>{i[0]==="["?(t.push(...n.sort(),i),n=[]):n.push(i)}),t.push(...n.sort()),t},Np=e=>({cache:Cp(e.cacheSize),parseClassName:Sp(e),...bp(e)}),kp=/\s+/,Tp=(e,t)=>{const{parseClassName:n,getClassGroupId:i,getConflictingClassGroupIds:s}=t,o=[],l=e.trim().split(kp);let a="";for(let r=l.length-1;r>=0;r-=1){const f=l[r],{modifiers:d,hasImportantModifier:h,baseClassName:b,maybePostfixModifierPosition:_}=n(f);let C=!!_,S=i(C?b.substring(0,_):b);if(!S){if(!C){a=f+(a.length>0?" "+a:a);continue}if(S=i(b),!S){a=f+(a.length>0?" "+a:a);continue}C=!1}const c=Ep(d).join(":"),u=h?c+oc:c,p=u+S;if(o.includes(p))continue;o.push(p);const v=s(S,C);for(let y=0;y<v.length;++y){const w=v[y];o.push(u+w)}a=f+(a.length>0?" "+a:a)}return a};function Mp(){let e=0,t,n,i="";for(;e<arguments.length;)(t=arguments[e++])&&(n=lc(t))&&(i&&(i+=" "),i+=n);return i}const lc=e=>{if(typeof e=="string")return e;let t,n="";for(let i=0;i<e.length;i++)e[i]&&(t=lc(e[i]))&&(n&&(n+=" "),n+=t);return n};function Ap(e,...t){let n,i,s,o=l;function l(r){const f=t.reduce((d,h)=>h(d),e());return n=Np(f),i=n.cache.get,s=n.cache.set,o=a,a(r)}function a(r){const f=i(r);if(f)return f;const d=Tp(r,n);return s(r,d),d}return function(){return o(Mp.apply(null,arguments))}}const Pe=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},ac=/^\[(?:([a-z-]+):)?(.+)\]$/i,Rp=/^\d+\/\d+$/,Dp=new Set(["px","full","screen"]),Lp=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Op=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Pp=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Ip=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Bp=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,It=e=>Nn(e)||Dp.has(e)||Rp.test(e),Ut=e=>Hn(e,"length",Up),Nn=e=>!!e&&!Number.isNaN(Number(e)),ar=e=>Hn(e,"number",Nn),Qn=e=>!!e&&Number.isInteger(Number(e)),Fp=e=>e.endsWith("%")&&Nn(e.slice(0,-1)),be=e=>ac.test(e),Yt=e=>Lp.test(e),jp=new Set(["length","size","percentage"]),zp=e=>Hn(e,jp,cc),Hp=e=>Hn(e,"position",cc),Vp=new Set(["image","url"]),Wp=e=>Hn(e,Vp,Zp),$p=e=>Hn(e,"",Yp),Jn=()=>!0,Hn=(e,t,n)=>{const i=ac.exec(e);return i?i[1]?typeof t=="string"?i[1]===t:t.has(i[1]):n(i[2]):!1},Up=e=>Op.test(e)&&!Pp.test(e),cc=()=>!1,Yp=e=>Ip.test(e),Zp=e=>Bp.test(e),qp=()=>{const e=Pe("colors"),t=Pe("spacing"),n=Pe("blur"),i=Pe("brightness"),s=Pe("borderColor"),o=Pe("borderRadius"),l=Pe("borderSpacing"),a=Pe("borderWidth"),r=Pe("contrast"),f=Pe("grayscale"),d=Pe("hueRotate"),h=Pe("invert"),b=Pe("gap"),_=Pe("gradientColorStops"),C=Pe("gradientColorStopPositions"),S=Pe("inset"),c=Pe("margin"),u=Pe("opacity"),p=Pe("padding"),v=Pe("saturate"),y=Pe("scale"),w=Pe("sepia"),x=Pe("skew"),E=Pe("space"),k=Pe("translate"),N=()=>["auto","contain","none"],T=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto",be,t],M=()=>[be,t],A=()=>["",It,Ut],D=()=>["auto",Nn,be],$=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],H=()=>["solid","dashed","dotted","double","none"],j=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],F=()=>["start","end","center","between","around","evenly","stretch"],z=()=>["","0",be],O=()=>["auto","avoid","all","avoid-page","page","left","right","column"],B=()=>[Nn,be];return{cacheSize:500,separator:":",theme:{colors:[Jn],spacing:[It,Ut],blur:["none","",Yt,be],brightness:B(),borderColor:[e],borderRadius:["none","","full",Yt,be],borderSpacing:M(),borderWidth:A(),contrast:B(),grayscale:z(),hueRotate:B(),invert:z(),gap:M(),gradientColorStops:[e],gradientColorStopPositions:[Fp,Ut],inset:R(),margin:R(),opacity:B(),padding:M(),saturate:B(),scale:B(),sepia:z(),skew:B(),space:M(),translate:M()},classGroups:{aspect:[{aspect:["auto","square","video",be]}],container:["container"],columns:[{columns:[Yt]}],"break-after":[{"break-after":O()}],"break-before":[{"break-before":O()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...$(),be]}],overflow:[{overflow:T()}],"overflow-x":[{"overflow-x":T()}],"overflow-y":[{"overflow-y":T()}],overscroll:[{overscroll:N()}],"overscroll-x":[{"overscroll-x":N()}],"overscroll-y":[{"overscroll-y":N()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[S]}],"inset-x":[{"inset-x":[S]}],"inset-y":[{"inset-y":[S]}],start:[{start:[S]}],end:[{end:[S]}],top:[{top:[S]}],right:[{right:[S]}],bottom:[{bottom:[S]}],left:[{left:[S]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Qn,be]}],basis:[{basis:R()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",be]}],grow:[{grow:z()}],shrink:[{shrink:z()}],order:[{order:["first","last","none",Qn,be]}],"grid-cols":[{"grid-cols":[Jn]}],"col-start-end":[{col:["auto",{span:["full",Qn,be]},be]}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":[Jn]}],"row-start-end":[{row:["auto",{span:[Qn,be]},be]}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",be]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",be]}],gap:[{gap:[b]}],"gap-x":[{"gap-x":[b]}],"gap-y":[{"gap-y":[b]}],"justify-content":[{justify:["normal",...F()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...F(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...F(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[p]}],px:[{px:[p]}],py:[{py:[p]}],ps:[{ps:[p]}],pe:[{pe:[p]}],pt:[{pt:[p]}],pr:[{pr:[p]}],pb:[{pb:[p]}],pl:[{pl:[p]}],m:[{m:[c]}],mx:[{mx:[c]}],my:[{my:[c]}],ms:[{ms:[c]}],me:[{me:[c]}],mt:[{mt:[c]}],mr:[{mr:[c]}],mb:[{mb:[c]}],ml:[{ml:[c]}],"space-x":[{"space-x":[E]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[E]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",be,t]}],"min-w":[{"min-w":[be,t,"min","max","fit"]}],"max-w":[{"max-w":[be,t,"none","full","min","max","fit","prose",{screen:[Yt]},Yt]}],h:[{h:[be,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[be,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[be,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[be,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Yt,Ut]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ar]}],"font-family":[{font:[Jn]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",be]}],"line-clamp":[{"line-clamp":["none",Nn,ar]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",It,be]}],"list-image":[{"list-image":["none",be]}],"list-style-type":[{list:["none","disc","decimal",be]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[u]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[u]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...H(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",It,Ut]}],"underline-offset":[{"underline-offset":["auto",It,be]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",be]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",be]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[u]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...$(),Hp]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",zp]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Wp]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[C]}],"gradient-via-pos":[{via:[C]}],"gradient-to-pos":[{to:[C]}],"gradient-from":[{from:[_]}],"gradient-via":[{via:[_]}],"gradient-to":[{to:[_]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[u]}],"border-style":[{border:[...H(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[u]}],"divide-style":[{divide:H()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...H()]}],"outline-offset":[{"outline-offset":[It,be]}],"outline-w":[{outline:[It,Ut]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:A()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[u]}],"ring-offset-w":[{"ring-offset":[It,Ut]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Yt,$p]}],"shadow-color":[{shadow:[Jn]}],opacity:[{opacity:[u]}],"mix-blend":[{"mix-blend":[...j(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":j()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[i]}],contrast:[{contrast:[r]}],"drop-shadow":[{"drop-shadow":["","none",Yt,be]}],grayscale:[{grayscale:[f]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[h]}],saturate:[{saturate:[v]}],sepia:[{sepia:[w]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[i]}],"backdrop-contrast":[{"backdrop-contrast":[r]}],"backdrop-grayscale":[{"backdrop-grayscale":[f]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[h]}],"backdrop-opacity":[{"backdrop-opacity":[u]}],"backdrop-saturate":[{"backdrop-saturate":[v]}],"backdrop-sepia":[{"backdrop-sepia":[w]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[l]}],"border-spacing-x":[{"border-spacing-x":[l]}],"border-spacing-y":[{"border-spacing-y":[l]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",be]}],duration:[{duration:B()}],ease:[{ease:["linear","in","out","in-out",be]}],delay:[{delay:B()}],animate:[{animate:["none","spin","ping","pulse","bounce",be]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[y]}],"scale-x":[{"scale-x":[y]}],"scale-y":[{"scale-y":[y]}],rotate:[{rotate:[Qn,be]}],"translate-x":[{"translate-x":[k]}],"translate-y":[{"translate-y":[k]}],"skew-x":[{"skew-x":[x]}],"skew-y":[{"skew-y":[x]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",be]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",be]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",be]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[It,Ut,ar]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},Gp=Ap(qp);function ne(...e){return Gp(sc(e))}function Kp(e,t="NPR"){return new Intl.NumberFormat("en-NP",{style:"currency",currency:t,minimumFractionDigits:2}).format(e)}function Jr(e,t={}){const n={year:"numeric",month:"long",day:"numeric"};return new Date(e).toLocaleDateString("en-US",{...n,...t})}function Ji(e){return new Date(e).toLocaleString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Xp(e){const t=new Date,n=new Date(e),i=Math.floor((t-n)/1e3);return i<60?"just now":i<3600?`${Math.floor(i/60)} minutes ago`:i<86400?`${Math.floor(i/3600)} hours ago`:i<604800?`${Math.floor(i/86400)} days ago`:Jr(e)}function Qp(e,t=100){return e?e.length<=t?e:e.slice(0,t)+"...":""}function Jp(e){return e?e.charAt(0).toUpperCase()+e.slice(1):""}function em(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function uc(e,t=300){let n;return function(...s){const o=()=>{clearTimeout(n),e(...s)};clearTimeout(n),n=setTimeout(o,t)}}function tm(e){return JSON.parse(JSON.stringify(e))}function nm(e){return e?Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1:!0}function im(e){return e?e.split(" ").map(t=>t[0]).join("").toUpperCase().slice(0,2):""}function sm(){return Math.random().toString(36).substring(2,9)}function rm(e){const t=new URLSearchParams(e),n={};for(const[i,s]of t)n[i]=s;return n}function om(e){const t=new URLSearchParams;return Object.entries(e).forEach(([n,i])=>{i!=null&&i!==""&&t.append(n,i)}),t.toString()}/**
|
|
2
2
|
* @license lucide-react v0.460.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const
|
|
6
|
+
*/const lm=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),dc=(...e)=>e.filter((t,n,i)=>!!t&&t.trim()!==""&&i.indexOf(t)===n).join(" ").trim();/**
|
|
7
7
|
* @license lucide-react v0.460.0 - ISC
|
|
8
8
|
*
|
|
9
9
|
* This source code is licensed under the ISC license.
|
|
10
10
|
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/var
|
|
11
|
+
*/var am={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
12
12
|
* @license lucide-react v0.460.0 - ISC
|
|
13
13
|
*
|
|
14
14
|
* This source code is licensed under the ISC license.
|
|
15
15
|
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/const
|
|
16
|
+
*/const cm=K.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:i,className:s="",children:o,iconNode:l,...a},r)=>K.createElement("svg",{ref:r,...am,width:t,height:t,stroke:e,strokeWidth:i?Number(n)*24/Number(t):n,className:dc("lucide",s),...a},[...l.map(([f,d])=>K.createElement(f,d)),...Array.isArray(o)?o:[o]]));/**
|
|
17
17
|
* @license lucide-react v0.460.0 - ISC
|
|
18
18
|
*
|
|
19
19
|
* This source code is licensed under the ISC license.
|
|
20
20
|
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
-
*/const
|
|
21
|
+
*/const Me=(e,t)=>{const n=K.forwardRef(({className:i,...s},o)=>K.createElement(cm,{ref:o,iconNode:t,className:dc(`lucide-${lm(e)}`,i),...s}));return n.displayName=`${e}`,n};/**
|
|
22
22
|
* @license lucide-react v0.460.0 - ISC
|
|
23
23
|
*
|
|
24
24
|
* This source code is licensed under the ISC license.
|
|
25
25
|
* See the LICENSE file in the root directory of this source tree.
|
|
26
|
-
*/const
|
|
26
|
+
*/const um=Me("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
|
|
27
27
|
* @license lucide-react v0.460.0 - ISC
|
|
28
28
|
*
|
|
29
29
|
* This source code is licensed under the ISC license.
|
|
30
30
|
* See the LICENSE file in the root directory of this source tree.
|
|
31
|
-
*/const
|
|
31
|
+
*/const Ft=Me("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
|
|
32
32
|
* @license lucide-react v0.460.0 - ISC
|
|
33
33
|
*
|
|
34
34
|
* This source code is licensed under the ISC license.
|
|
35
35
|
* See the LICENSE file in the root directory of this source tree.
|
|
36
|
-
*/const
|
|
36
|
+
*/const dm=Me("ArrowUpDown",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]);/**
|
|
37
37
|
* @license lucide-react v0.460.0 - ISC
|
|
38
38
|
*
|
|
39
39
|
* This source code is licensed under the ISC license.
|
|
40
40
|
* See the LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/const
|
|
41
|
+
*/const fm=Me("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
|
|
42
42
|
* @license lucide-react v0.460.0 - ISC
|
|
43
43
|
*
|
|
44
44
|
* This source code is licensed under the ISC license.
|
|
45
45
|
* See the LICENSE file in the root directory of this source tree.
|
|
46
|
-
*/const
|
|
46
|
+
*/const ss=Me("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
|
|
47
47
|
* @license lucide-react v0.460.0 - ISC
|
|
48
48
|
*
|
|
49
49
|
* This source code is licensed under the ISC license.
|
|
50
50
|
* See the LICENSE file in the root directory of this source tree.
|
|
51
|
-
*/const
|
|
51
|
+
*/const ui=Me("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
52
52
|
* @license lucide-react v0.460.0 - ISC
|
|
53
53
|
*
|
|
54
54
|
* This source code is licensed under the ISC license.
|
|
55
55
|
* See the LICENSE file in the root directory of this source tree.
|
|
56
|
-
*/const
|
|
56
|
+
*/const ys=Me("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
57
57
|
* @license lucide-react v0.460.0 - ISC
|
|
58
58
|
*
|
|
59
59
|
* This source code is licensed under the ISC license.
|
|
60
60
|
* See the LICENSE file in the root directory of this source tree.
|
|
61
|
-
*/const
|
|
61
|
+
*/const eo=Me("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
62
62
|
* @license lucide-react v0.460.0 - ISC
|
|
63
63
|
*
|
|
64
64
|
* This source code is licensed under the ISC license.
|
|
65
65
|
* See the LICENSE file in the root directory of this source tree.
|
|
66
|
-
*/const
|
|
66
|
+
*/const _i=Me("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
67
67
|
* @license lucide-react v0.460.0 - ISC
|
|
68
68
|
*
|
|
69
69
|
* This source code is licensed under the ISC license.
|
|
70
70
|
* See the LICENSE file in the root directory of this source tree.
|
|
71
|
-
*/const
|
|
71
|
+
*/const hm=Me("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
72
72
|
* @license lucide-react v0.460.0 - ISC
|
|
73
73
|
*
|
|
74
74
|
* This source code is licensed under the ISC license.
|
|
75
75
|
* See the LICENSE file in the root directory of this source tree.
|
|
76
|
-
*/const
|
|
76
|
+
*/const pm=Me("ChevronsLeft",[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]]);/**
|
|
77
77
|
* @license lucide-react v0.460.0 - ISC
|
|
78
78
|
*
|
|
79
79
|
* This source code is licensed under the ISC license.
|
|
80
80
|
* See the LICENSE file in the root directory of this source tree.
|
|
81
|
-
*/const
|
|
81
|
+
*/const mm=Me("ChevronsRight",[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]);/**
|
|
82
82
|
* @license lucide-react v0.460.0 - ISC
|
|
83
83
|
*
|
|
84
84
|
* This source code is licensed under the ISC license.
|
|
85
85
|
* See the LICENSE file in the root directory of this source tree.
|
|
86
|
-
*/const
|
|
86
|
+
*/const gm=Me("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
|
|
87
87
|
* @license lucide-react v0.460.0 - ISC
|
|
88
88
|
*
|
|
89
89
|
* This source code is licensed under the ISC license.
|
|
90
90
|
* See the LICENSE file in the root directory of this source tree.
|
|
91
|
-
*/const
|
|
91
|
+
*/const vm=Me("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
92
92
|
* @license lucide-react v0.460.0 - ISC
|
|
93
93
|
*
|
|
94
94
|
* This source code is licensed under the ISC license.
|
|
95
95
|
* See the LICENSE file in the root directory of this source tree.
|
|
96
|
-
*/const
|
|
96
|
+
*/const fc=Me("CirclePlus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]);/**
|
|
97
97
|
* @license lucide-react v0.460.0 - ISC
|
|
98
98
|
*
|
|
99
99
|
* This source code is licensed under the ISC license.
|
|
100
100
|
* See the LICENSE file in the root directory of this source tree.
|
|
101
|
-
*/const
|
|
101
|
+
*/const bm=Me("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
|
|
102
102
|
* @license lucide-react v0.460.0 - ISC
|
|
103
103
|
*
|
|
104
104
|
* This source code is licensed under the ISC license.
|
|
105
105
|
* See the LICENSE file in the root directory of this source tree.
|
|
106
|
-
*/const
|
|
106
|
+
*/const ym=Me("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
|
107
107
|
* @license lucide-react v0.460.0 - ISC
|
|
108
108
|
*
|
|
109
109
|
* This source code is licensed under the ISC license.
|
|
110
110
|
* See the LICENSE file in the root directory of this source tree.
|
|
111
|
-
*/const
|
|
111
|
+
*/const xm=Me("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
|
|
112
112
|
* @license lucide-react v0.460.0 - ISC
|
|
113
113
|
*
|
|
114
114
|
* This source code is licensed under the ISC license.
|
|
115
115
|
* See the LICENSE file in the root directory of this source tree.
|
|
116
|
-
*/const
|
|
116
|
+
*/const wm=Me("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/**
|
|
117
117
|
* @license lucide-react v0.460.0 - ISC
|
|
118
118
|
*
|
|
119
119
|
* This source code is licensed under the ISC license.
|
|
120
120
|
* See the LICENSE file in the root directory of this source tree.
|
|
121
|
-
*/const
|
|
121
|
+
*/const _m=Me("Eye",[["path",{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",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
122
122
|
* @license lucide-react v0.460.0 - ISC
|
|
123
123
|
*
|
|
124
124
|
* This source code is licensed under the ISC license.
|
|
125
125
|
* See the LICENSE file in the root directory of this source tree.
|
|
126
|
-
*/const
|
|
126
|
+
*/const Ul=Me("FileQuestion",[["path",{d:"M12 17h.01",key:"p32p05"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}],["path",{d:"M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3",key:"mhlwft"}]]);/**
|
|
127
127
|
* @license lucide-react v0.460.0 - ISC
|
|
128
128
|
*
|
|
129
129
|
* This source code is licensed under the ISC license.
|
|
130
130
|
* See the LICENSE file in the root directory of this source tree.
|
|
131
|
-
*/const
|
|
131
|
+
*/const Cm=Me("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);/**
|
|
132
132
|
* @license lucide-react v0.460.0 - ISC
|
|
133
133
|
*
|
|
134
134
|
* This source code is licensed under the ISC license.
|
|
135
135
|
* See the LICENSE file in the root directory of this source tree.
|
|
136
|
-
*/const
|
|
136
|
+
*/const Yl=Me("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
137
137
|
* @license lucide-react v0.460.0 - ISC
|
|
138
138
|
*
|
|
139
139
|
* This source code is licensed under the ISC license.
|
|
140
140
|
* See the LICENSE file in the root directory of this source tree.
|
|
141
|
-
*/const
|
|
141
|
+
*/const un=Me("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
142
142
|
* @license lucide-react v0.460.0 - ISC
|
|
143
143
|
*
|
|
144
144
|
* This source code is licensed under the ISC license.
|
|
145
145
|
* See the LICENSE file in the root directory of this source tree.
|
|
146
|
-
*/const
|
|
146
|
+
*/const Sm=Me("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
|
|
147
147
|
* @license lucide-react v0.460.0 - ISC
|
|
148
148
|
*
|
|
149
149
|
* This source code is licensed under the ISC license.
|
|
150
150
|
* See the LICENSE file in the root directory of this source tree.
|
|
151
|
-
*/const
|
|
151
|
+
*/const Mr=Me("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
|
|
152
152
|
* @license lucide-react v0.460.0 - ISC
|
|
153
153
|
*
|
|
154
154
|
* This source code is licensed under the ISC license.
|
|
155
155
|
* See the LICENSE file in the root directory of this source tree.
|
|
156
|
-
*/const
|
|
156
|
+
*/const Em=Me("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
157
157
|
* @license lucide-react v0.460.0 - ISC
|
|
158
158
|
*
|
|
159
159
|
* This source code is licensed under the ISC license.
|
|
160
160
|
* See the LICENSE file in the root directory of this source tree.
|
|
161
|
-
*/const
|
|
161
|
+
*/const hc=Me("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
|
|
162
162
|
* @license lucide-react v0.460.0 - ISC
|
|
163
163
|
*
|
|
164
164
|
* This source code is licensed under the ISC license.
|
|
165
165
|
* See the LICENSE file in the root directory of this source tree.
|
|
166
|
-
*/const
|
|
166
|
+
*/const Zl=Me("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
|
|
167
167
|
* @license lucide-react v0.460.0 - ISC
|
|
168
168
|
*
|
|
169
169
|
* This source code is licensed under the ISC license.
|
|
170
170
|
* See the LICENSE file in the root directory of this source tree.
|
|
171
|
-
*/const
|
|
171
|
+
*/const to=Me("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
172
172
|
* @license lucide-react v0.460.0 - ISC
|
|
173
173
|
*
|
|
174
174
|
* This source code is licensed under the ISC license.
|
|
175
175
|
* See the LICENSE file in the root directory of this source tree.
|
|
176
|
-
*/const
|
|
176
|
+
*/const Ar=Me("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
|
|
177
177
|
* @license lucide-react v0.460.0 - ISC
|
|
178
178
|
*
|
|
179
179
|
* This source code is licensed under the ISC license.
|
|
180
180
|
* See the LICENSE file in the root directory of this source tree.
|
|
181
|
-
*/const qt=fe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Aa=hn("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),ae=l.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,loading:o=!1,children:s,disabled:i,...a},u)=>{const d=n?kf:"button";return c.jsxs(d,{className:T(Aa({variant:t,size:r,className:e})),ref:u,disabled:i||o,...a,children:[o&&c.jsx(kt,{className:"mr-2 h-4 w-4 animate-spin"}),s]})});ae.displayName="Button";const Ke=l.forwardRef(({className:e,...t},r)=>c.jsx("div",{ref:r,className:T("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));Ke.displayName="Card";const Xt=l.forwardRef(({className:e,...t},r)=>c.jsx("div",{ref:r,className:T("flex flex-col space-y-1.5 p-6",e),...t}));Xt.displayName="CardHeader";const Qt=l.forwardRef(({className:e,...t},r)=>c.jsx("h3",{ref:r,className:T("text-2xl font-semibold leading-none tracking-tight",e),...t}));Qt.displayName="CardTitle";const Zt=l.forwardRef(({className:e,...t},r)=>c.jsx("p",{ref:r,className:T("text-sm text-muted-foreground",e),...t}));Zt.displayName="CardDescription";const Ye=l.forwardRef(({className:e,...t},r)=>c.jsx("div",{ref:r,className:T("p-6 pt-0",e),...t}));Ye.displayName="CardContent";const Ta=l.forwardRef(({className:e,...t},r)=>c.jsx("div",{ref:r,className:T("flex items-center p-6 pt-0",e),...t}));Ta.displayName="CardFooter";const Ma=hn("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground",success:"border-transparent bg-green-500 text-white hover:bg-green-600",warning:"border-transparent bg-yellow-500 text-white hover:bg-yellow-600",info:"border-transparent bg-blue-500 text-white hover:bg-blue-600"}},defaultVariants:{variant:"default"}});function hr({className:e,variant:t,...r}){return c.jsx("div",{className:T(Ma({variant:t}),e),...r})}const Jt=l.forwardRef(({className:e,type:t,...r},n)=>c.jsx("input",{type:t,className:T("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...r}));Jt.displayName="Input";var Kp=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Tr=Kp.reduce((e,t)=>{const r=xa(`Primitive.${t}`),n=l.forwardRef((o,s)=>{const{asChild:i,...a}=o,u=i?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(u,{...a,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Yp="Label",ka=l.forwardRef((e,t)=>c.jsx(Tr.label,{...e,ref:t,onMouseDown:r=>{var o;r.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));ka.displayName=Yp;var Da=ka;const qp=hn("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Ct=l.forwardRef(({className:e,...t},r)=>c.jsx(Da,{ref:r,className:T(qp(),e),...t}));Ct.displayName=Da.displayName;const Vo=l.forwardRef(({className:e,...t},r)=>c.jsx("textarea",{className:T("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...t}));Vo.displayName="Textarea";function Xp(e,t=[]){let r=[];function n(s,i){const a=l.createContext(i),u=r.length;r=[...r,i];const d=f=>{var v;const{scope:m,children:g,...x}=f,h=((v=m==null?void 0:m[e])==null?void 0:v[u])||a,y=l.useMemo(()=>x,Object.values(x));return c.jsx(h.Provider,{value:y,children:g})};d.displayName=s+"Provider";function p(f,m){var h;const g=((h=m==null?void 0:m[e])==null?void 0:h[u])||a,x=l.useContext(g);if(x)return x;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[d,p]}const o=()=>{const s=r.map(i=>l.createContext(i));return function(a){const u=(a==null?void 0:a[e])||s;return l.useMemo(()=>({[`__scope${e}`]:{...a,[e]:u}}),[a,u])}};return o.scopeName=e,[n,Qp(o,...t)]}function Qp(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=n.reduce((a,{useScope:u,scopeName:d})=>{const f=u(s)[`__scope${d}`];return{...a,...f}},{});return l.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}function G(e,t,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e==null||e(o),r===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}var Ne=globalThis!=null&&globalThis.document?l.useLayoutEffect:()=>{},Zp=l[" useInsertionEffect ".trim().toString()]||Ne;function ct({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[o,s,i]=Jp({defaultProp:t,onChange:r}),a=e!==void 0,u=a?e:o;{const p=l.useRef(e!==void 0);l.useEffect(()=>{const f=p.current;f!==a&&console.warn(`${n} is changing from ${f?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),p.current=a},[a,n])}const d=l.useCallback(p=>{var f;if(a){const m=em(p)?p(e):p;m!==e&&((f=i.current)==null||f.call(i,m))}else s(p)},[a,e,s,i]);return[u,d]}function Jp({defaultProp:e,onChange:t}){const[r,n]=l.useState(e),o=l.useRef(r),s=l.useRef(t);return Zp(()=>{s.current=t},[t]),l.useEffect(()=>{var i;o.current!==r&&((i=s.current)==null||i.call(s,r),o.current=r)},[r,o]),[r,n,s]}function em(e){return typeof e=="function"}function Bo(e){const t=l.useRef({value:e,previous:e});return l.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function Wo(e){const[t,r]=l.useState(void 0);return Ne(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,a;if("borderBoxSize"in s){const u=s.borderBoxSize,d=Array.isArray(u)?u[0]:u;i=d.inlineSize,a=d.blockSize}else i=e.offsetWidth,a=e.offsetHeight;r({width:i,height:a})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}function tm(e,t){return l.useReducer((r,n)=>t[r][n]??r,e)}var $e=e=>{const{present:t,children:r}=e,n=rm(t),o=typeof r=="function"?r({present:n.isPresent}):l.Children.only(r),s=ie(n.ref,nm(o));return typeof r=="function"||n.isPresent?l.cloneElement(o,{ref:s}):null};$e.displayName="Presence";function rm(e){const[t,r]=l.useState(),n=l.useRef(null),o=l.useRef(e),s=l.useRef("none"),i=e?"mounted":"unmounted",[a,u]=tm(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return l.useEffect(()=>{const d=Ur(n.current);s.current=a==="mounted"?d:"none"},[a]),Ne(()=>{const d=n.current,p=o.current;if(p!==e){const m=s.current,g=Ur(d);e?u("MOUNT"):g==="none"||(d==null?void 0:d.display)==="none"?u("UNMOUNT"):u(p&&m!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),Ne(()=>{if(t){let d;const p=t.ownerDocument.defaultView??window,f=g=>{const h=Ur(n.current).includes(CSS.escape(g.animationName));if(g.target===t&&h&&(u("ANIMATION_END"),!o.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",d=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},m=g=>{g.target===t&&(s.current=Ur(n.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{p.clearTimeout(d),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:l.useCallback(d=>{n.current=d?getComputedStyle(d):null,r(d)},[])}}function Ur(e){return(e==null?void 0:e.animationName)||"none"}function nm(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function om(e){const t=sm(e),r=l.forwardRef((n,o)=>{const{children:s,...i}=n,a=l.Children.toArray(s),u=a.find(am);if(u){const d=u.props.children,p=a.map(f=>f===u?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return c.jsx(t,{...i,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return c.jsx(t,{...i,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}function sm(e){const t=l.forwardRef((r,n)=>{const{children:o,...s}=r;if(l.isValidElement(o)){const i=cm(o),a=lm(s,o.props);return o.type!==l.Fragment&&(a.ref=n?we(n,i):i),l.cloneElement(o,a)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var im=Symbol("radix.slottable");function am(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===im}function lm(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...a)=>{const u=s(...a);return o(...a),u}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function cm(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var um=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ho=um.reduce((e,t)=>{const r=om(`Primitive.${t}`),n=l.forwardRef((o,s)=>{const{asChild:i,...a}=o,u=i?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(u,{...a,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),vn="Checkbox",[dm]=Xp(vn),[fm,Uo]=dm(vn);function pm(e){const{__scopeCheckbox:t,checked:r,children:n,defaultChecked:o,disabled:s,form:i,name:a,onCheckedChange:u,required:d,value:p="on",internal_do_not_use_render:f}=e,[m,g]=ct({prop:r,defaultProp:o??!1,onChange:u,caller:vn}),[x,h]=l.useState(null),[y,v]=l.useState(null),b=l.useRef(!1),S=x?!!i||!!x.closest("form"):!0,C={checked:m,disabled:s,setChecked:g,control:x,setControl:h,name:a,form:i,value:p,hasConsumerStoppedPropagationRef:b,required:d,defaultChecked:Nt(o)?!1:o,isFormControl:S,bubbleInput:y,setBubbleInput:v};return c.jsx(fm,{scope:t,...C,children:mm(f)?f(C):n})}var Ia="CheckboxTrigger",Oa=l.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:r,...n},o)=>{const{control:s,value:i,disabled:a,checked:u,required:d,setControl:p,setChecked:f,hasConsumerStoppedPropagationRef:m,isFormControl:g,bubbleInput:x}=Uo(Ia,e),h=ie(o,p),y=l.useRef(u);return l.useEffect(()=>{const v=s==null?void 0:s.form;if(v){const b=()=>f(y.current);return v.addEventListener("reset",b),()=>v.removeEventListener("reset",b)}},[s,f]),c.jsx(Ho.button,{type:"button",role:"checkbox","aria-checked":Nt(u)?"mixed":u,"aria-required":d,"data-state":Ba(u),"data-disabled":a?"":void 0,disabled:a,value:i,...n,ref:h,onKeyDown:G(t,v=>{v.key==="Enter"&&v.preventDefault()}),onClick:G(r,v=>{f(b=>Nt(b)?!0:!b),x&&g&&(m.current=v.isPropagationStopped(),m.current||v.stopPropagation())})})});Oa.displayName=Ia;var zo=l.forwardRef((e,t)=>{const{__scopeCheckbox:r,name:n,checked:o,defaultChecked:s,required:i,disabled:a,value:u,onCheckedChange:d,form:p,...f}=e;return c.jsx(pm,{__scopeCheckbox:r,checked:o,defaultChecked:s,disabled:a,required:i,onCheckedChange:d,name:n,form:p,value:u,internal_do_not_use_render:({isFormControl:m})=>c.jsxs(c.Fragment,{children:[c.jsx(Oa,{...f,ref:t,__scopeCheckbox:r}),m&&c.jsx(Va,{__scopeCheckbox:r})]})})});zo.displayName=vn;var $a="CheckboxIndicator",La=l.forwardRef((e,t)=>{const{__scopeCheckbox:r,forceMount:n,...o}=e,s=Uo($a,r);return c.jsx($e,{present:n||Nt(s.checked)||s.checked===!0,children:c.jsx(Ho.span,{"data-state":Ba(s.checked),"data-disabled":s.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});La.displayName=$a;var Fa="CheckboxBubbleInput",Va=l.forwardRef(({__scopeCheckbox:e,...t},r)=>{const{control:n,hasConsumerStoppedPropagationRef:o,checked:s,defaultChecked:i,required:a,disabled:u,name:d,value:p,form:f,bubbleInput:m,setBubbleInput:g}=Uo(Fa,e),x=ie(r,g),h=Bo(s),y=Wo(n);l.useEffect(()=>{const b=m;if(!b)return;const S=window.HTMLInputElement.prototype,N=Object.getOwnPropertyDescriptor(S,"checked").set,_=!o.current;if(h!==s&&N){const j=new Event("click",{bubbles:_});b.indeterminate=Nt(s),N.call(b,Nt(s)?!1:s),b.dispatchEvent(j)}},[m,h,s,o]);const v=l.useRef(Nt(s)?!1:s);return c.jsx(Ho.input,{type:"checkbox","aria-hidden":!0,defaultChecked:i??v.current,required:a,disabled:u,name:d,value:p,form:f,...t,tabIndex:-1,ref:x,style:{...t.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Va.displayName=Fa;function mm(e){return typeof e=="function"}function Nt(e){return e==="indeterminate"}function Ba(e){return Nt(e)?"indeterminate":e?"checked":"unchecked"}const er=l.forwardRef(({className:e,...t},r)=>c.jsx(zo,{ref:r,className:T("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:c.jsx(La,{className:T("flex items-center justify-center text-current"),children:c.jsx(wr,{className:"h-4 w-4"})})}));er.displayName=zo.displayName;function hm(e,t=[]){let r=[];function n(s,i){const a=l.createContext(i),u=r.length;r=[...r,i];const d=f=>{var v;const{scope:m,children:g,...x}=f,h=((v=m==null?void 0:m[e])==null?void 0:v[u])||a,y=l.useMemo(()=>x,Object.values(x));return c.jsx(h.Provider,{value:y,children:g})};d.displayName=s+"Provider";function p(f,m){var h;const g=((h=m==null?void 0:m[e])==null?void 0:h[u])||a,x=l.useContext(g);if(x)return x;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[d,p]}const o=()=>{const s=r.map(i=>l.createContext(i));return function(a){const u=(a==null?void 0:a[e])||s;return l.useMemo(()=>({[`__scope${e}`]:{...a,[e]:u}}),[a,u])}};return o.scopeName=e,[n,gm(o,...t)]}function gm(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=n.reduce((a,{useScope:u,scopeName:d})=>{const f=u(s)[`__scope${d}`];return{...a,...f}},{});return l.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}function xm(e){const t=vm(e),r=l.forwardRef((n,o)=>{const{children:s,...i}=n,a=l.Children.toArray(s),u=a.find(bm);if(u){const d=u.props.children,p=a.map(f=>f===u?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return c.jsx(t,{...i,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return c.jsx(t,{...i,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}function vm(e){const t=l.forwardRef((r,n)=>{const{children:o,...s}=r;if(l.isValidElement(o)){const i=Sm(o),a=wm(s,o.props);return o.type!==l.Fragment&&(a.ref=n?we(n,i):i),l.cloneElement(o,a)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ym=Symbol("radix.slottable");function bm(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ym}function wm(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...a)=>{const u=s(...a);return o(...a),u}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function Sm(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Cm=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Wa=Cm.reduce((e,t)=>{const r=xm(`Primitive.${t}`),n=l.forwardRef((o,s)=>{const{asChild:i,...a}=o,u=i?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(u,{...a,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),yn="Switch",[Nm]=hm(yn),[Em,jm]=Nm(yn),Ha=l.forwardRef((e,t)=>{const{__scopeSwitch:r,name:n,checked:o,defaultChecked:s,required:i,disabled:a,value:u="on",onCheckedChange:d,form:p,...f}=e,[m,g]=l.useState(null),x=ie(t,S=>g(S)),h=l.useRef(!1),y=m?p||!!m.closest("form"):!0,[v,b]=ct({prop:o,defaultProp:s??!1,onChange:d,caller:yn});return c.jsxs(Em,{scope:r,checked:v,disabled:a,children:[c.jsx(Wa.button,{type:"button",role:"switch","aria-checked":v,"aria-required":i,"data-state":Ka(v),"data-disabled":a?"":void 0,disabled:a,value:u,...f,ref:x,onClick:G(e.onClick,S=>{b(C=>!C),y&&(h.current=S.isPropagationStopped(),h.current||S.stopPropagation())})}),y&&c.jsx(Ga,{control:m,bubbles:!h.current,name:n,value:u,checked:v,required:i,disabled:a,form:p,style:{transform:"translateX(-100%)"}})]})});Ha.displayName=yn;var Ua="SwitchThumb",za=l.forwardRef((e,t)=>{const{__scopeSwitch:r,...n}=e,o=jm(Ua,r);return c.jsx(Wa.span,{"data-state":Ka(o.checked),"data-disabled":o.disabled?"":void 0,...n,ref:t})});za.displayName=Ua;var Rm="SwitchBubbleInput",Ga=l.forwardRef(({__scopeSwitch:e,control:t,checked:r,bubbles:n=!0,...o},s)=>{const i=l.useRef(null),a=ie(i,s),u=Bo(r),d=Wo(t);return l.useEffect(()=>{const p=i.current;if(!p)return;const f=window.HTMLInputElement.prototype,g=Object.getOwnPropertyDescriptor(f,"checked").set;if(u!==r&&g){const x=new Event("click",{bubbles:n});g.call(p,r),p.dispatchEvent(x)}},[u,r,n]),c.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...o,tabIndex:-1,ref:a,style:{...o.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Ga.displayName=Rm;function Ka(e){return e?"checked":"unchecked"}var Ya=Ha,_m=za;const Go=l.forwardRef(({className:e,...t},r)=>c.jsx(Ya,{className:T("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:r,children:c.jsx(_m,{className:T("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));Go.displayName=Ya.displayName;function Pm({className:e,...t}){return c.jsx("div",{className:T("animate-pulse rounded-md bg-muted",e),...t})}var Am="Separator",Ei="horizontal",Tm=["horizontal","vertical"],qa=l.forwardRef((e,t)=>{const{decorative:r,orientation:n=Ei,...o}=e,s=Mm(n)?n:Ei,a=r?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return c.jsx(Tr.div,{"data-orientation":s,...a,...o,ref:t})});qa.displayName=Am;function Mm(e){return Tm.includes(e)}var Xa=qa;const Mr=l.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...n},o)=>c.jsx(Xa,{ref:o,decorative:r,orientation:t,className:T("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...n}));Mr.displayName=Xa.displayName;function yo(e,[t,r]){return Math.min(r,Math.max(t,e))}function km(e,t=[]){let r=[];function n(s,i){const a=l.createContext(i),u=r.length;r=[...r,i];const d=f=>{var v;const{scope:m,children:g,...x}=f,h=((v=m==null?void 0:m[e])==null?void 0:v[u])||a,y=l.useMemo(()=>x,Object.values(x));return c.jsx(h.Provider,{value:y,children:g})};d.displayName=s+"Provider";function p(f,m){var h;const g=((h=m==null?void 0:m[e])==null?void 0:h[u])||a,x=l.useContext(g);if(x)return x;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[d,p]}const o=()=>{const s=r.map(i=>l.createContext(i));return function(a){const u=(a==null?void 0:a[e])||s;return l.useMemo(()=>({[`__scope${e}`]:{...a,[e]:u}}),[a,u])}};return o.scopeName=e,[n,Dm(o,...t)]}function Dm(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=n.reduce((a,{useScope:u,scopeName:d})=>{const f=u(s)[`__scope${d}`];return{...a,...f}},{});return l.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}function ji(e){const t=Im(e),r=l.forwardRef((n,o)=>{const{children:s,...i}=n,a=l.Children.toArray(s),u=a.find($m);if(u){const d=u.props.children,p=a.map(f=>f===u?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return c.jsx(t,{...i,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return c.jsx(t,{...i,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}function Im(e){const t=l.forwardRef((r,n)=>{const{children:o,...s}=r;if(l.isValidElement(o)){const i=Fm(o),a=Lm(s,o.props);return o.type!==l.Fragment&&(a.ref=n?we(n,i):i),l.cloneElement(o,a)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Om=Symbol("radix.slottable");function $m(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Om}function Lm(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...a)=>{const u=s(...a);return o(...a),u}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function Fm(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function Ko(e){const t=e+"CollectionProvider",[r,n]=km(t),[o,s]=r(t,{collectionRef:{current:null},itemMap:new Map}),i=h=>{const{scope:y,children:v}=h,b=oe.useRef(null),S=oe.useRef(new Map).current;return c.jsx(o,{scope:y,itemMap:S,collectionRef:b,children:v})};i.displayName=t;const a=e+"CollectionSlot",u=ji(a),d=oe.forwardRef((h,y)=>{const{scope:v,children:b}=h,S=s(a,v),C=ie(y,S.collectionRef);return c.jsx(u,{ref:C,children:b})});d.displayName=a;const p=e+"CollectionItemSlot",f="data-radix-collection-item",m=ji(p),g=oe.forwardRef((h,y)=>{const{scope:v,children:b,...S}=h,C=oe.useRef(null),N=ie(y,C),_=s(p,v);return oe.useEffect(()=>(_.itemMap.set(C,{ref:C,...S}),()=>void _.itemMap.delete(C))),c.jsx(m,{[f]:"",ref:N,children:b})});g.displayName=p;function x(h){const y=s(e+"CollectionConsumer",h);return oe.useCallback(()=>{const b=y.collectionRef.current;if(!b)return[];const S=Array.from(b.querySelectorAll(`[${f}]`));return Array.from(y.itemMap.values()).sort((_,j)=>S.indexOf(_.ref.current)-S.indexOf(j.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:i,Slot:d,ItemSlot:g},x,n]}function Vm(e,t=[]){let r=[];function n(s,i){const a=l.createContext(i),u=r.length;r=[...r,i];const d=f=>{var v;const{scope:m,children:g,...x}=f,h=((v=m==null?void 0:m[e])==null?void 0:v[u])||a,y=l.useMemo(()=>x,Object.values(x));return c.jsx(h.Provider,{value:y,children:g})};d.displayName=s+"Provider";function p(f,m){var h;const g=((h=m==null?void 0:m[e])==null?void 0:h[u])||a,x=l.useContext(g);if(x)return x;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[d,p]}const o=()=>{const s=r.map(i=>l.createContext(i));return function(a){const u=(a==null?void 0:a[e])||s;return l.useMemo(()=>({[`__scope${e}`]:{...a,[e]:u}}),[a,u])}};return o.scopeName=e,[n,Bm(o,...t)]}function Bm(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=n.reduce((a,{useScope:u,scopeName:d})=>{const f=u(s)[`__scope${d}`];return{...a,...f}},{});return l.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}var Wm=l.createContext(void 0);function kr(e){const t=l.useContext(Wm);return e||t||"ltr"}function Hm(e){const t=Um(e),r=l.forwardRef((n,o)=>{const{children:s,...i}=n,a=l.Children.toArray(s),u=a.find(Gm);if(u){const d=u.props.children,p=a.map(f=>f===u?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return c.jsx(t,{...i,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return c.jsx(t,{...i,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}function Um(e){const t=l.forwardRef((r,n)=>{const{children:o,...s}=r;if(l.isValidElement(o)){const i=Ym(o),a=Km(s,o.props);return o.type!==l.Fragment&&(a.ref=n?we(n,i):i),l.cloneElement(o,a)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var zm=Symbol("radix.slottable");function Gm(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===zm}function Km(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...a)=>{const u=s(...a);return o(...a),u}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function Ym(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var qm=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Qa=qm.reduce((e,t)=>{const r=Hm(`Primitive.${t}`),n=l.forwardRef((o,s)=>{const{asChild:i,...a}=o,u=i?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(u,{...a,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Xm(e,t){e&&Ar.flushSync(()=>e.dispatchEvent(t))}function je(e){const t=l.useRef(e);return l.useEffect(()=>{t.current=e}),l.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function Qm(e,t=globalThis==null?void 0:globalThis.document){const r=je(e);l.useEffect(()=>{const n=o=>{o.key==="Escape"&&r(o)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var Zm="DismissableLayer",bo="dismissableLayer.update",Jm="dismissableLayer.pointerDownOutside",eh="dismissableLayer.focusOutside",Ri,Za=l.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Dr=l.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...u}=e,d=l.useContext(Za),[p,f]=l.useState(null),m=(p==null?void 0:p.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=l.useState({}),x=ie(t,j=>f(j)),h=Array.from(d.layers),[y]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),v=h.indexOf(y),b=p?h.indexOf(p):-1,S=d.layersWithOutsidePointerEventsDisabled.size>0,C=b>=v,N=nh(j=>{const $=j.target,D=[...d.branches].some(O=>O.contains($));!C||D||(o==null||o(j),i==null||i(j),j.defaultPrevented||a==null||a())},m),_=oh(j=>{const $=j.target;[...d.branches].some(O=>O.contains($))||(s==null||s(j),i==null||i(j),j.defaultPrevented||a==null||a())},m);return Qm(j=>{b===d.layers.size-1&&(n==null||n(j),!j.defaultPrevented&&a&&(j.preventDefault(),a()))},m),l.useEffect(()=>{if(p)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(Ri=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(p)),d.layers.add(p),_i(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=Ri)}},[p,m,r,d]),l.useEffect(()=>()=>{p&&(d.layers.delete(p),d.layersWithOutsidePointerEventsDisabled.delete(p),_i())},[p,d]),l.useEffect(()=>{const j=()=>g({});return document.addEventListener(bo,j),()=>document.removeEventListener(bo,j)},[]),c.jsx(Qa.div,{...u,ref:x,style:{pointerEvents:S?C?"auto":"none":void 0,...e.style},onFocusCapture:G(e.onFocusCapture,_.onFocusCapture),onBlurCapture:G(e.onBlurCapture,_.onBlurCapture),onPointerDownCapture:G(e.onPointerDownCapture,N.onPointerDownCapture)})});Dr.displayName=Zm;var th="DismissableLayerBranch",rh=l.forwardRef((e,t)=>{const r=l.useContext(Za),n=l.useRef(null),o=ie(t,n);return l.useEffect(()=>{const s=n.current;if(s)return r.branches.add(s),()=>{r.branches.delete(s)}},[r.branches]),c.jsx(Qa.div,{...e,ref:o})});rh.displayName=th;function nh(e,t=globalThis==null?void 0:globalThis.document){const r=je(e),n=l.useRef(!1),o=l.useRef(()=>{});return l.useEffect(()=>{const s=a=>{if(a.target&&!n.current){let u=function(){Ja(Jm,r,d,{discrete:!0})};const d={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=u,t.addEventListener("click",o.current,{once:!0})):u()}else t.removeEventListener("click",o.current);n.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function oh(e,t=globalThis==null?void 0:globalThis.document){const r=je(e),n=l.useRef(!1);return l.useEffect(()=>{const o=s=>{s.target&&!n.current&&Ja(eh,r,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function _i(){const e=new CustomEvent(bo);document.dispatchEvent(e)}function Ja(e,t,r,{discrete:n}){const o=r.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?Xm(o,s):o.dispatchEvent(s)}var ro=0;function Yo(){l.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Pi()),document.body.insertAdjacentElement("beforeend",e[1]??Pi()),ro++,()=>{ro===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),ro--}},[])}function Pi(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}function sh(e){const t=ih(e),r=l.forwardRef((n,o)=>{const{children:s,...i}=n,a=l.Children.toArray(s),u=a.find(lh);if(u){const d=u.props.children,p=a.map(f=>f===u?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return c.jsx(t,{...i,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return c.jsx(t,{...i,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}function ih(e){const t=l.forwardRef((r,n)=>{const{children:o,...s}=r;if(l.isValidElement(o)){const i=uh(o),a=ch(s,o.props);return o.type!==l.Fragment&&(a.ref=n?we(n,i):i),l.cloneElement(o,a)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ah=Symbol("radix.slottable");function lh(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ah}function ch(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...a)=>{const u=s(...a);return o(...a),u}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function uh(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var dh=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],fh=dh.reduce((e,t)=>{const r=sh(`Primitive.${t}`),n=l.forwardRef((o,s)=>{const{asChild:i,...a}=o,u=i?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(u,{...a,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),no="focusScope.autoFocusOnMount",oo="focusScope.autoFocusOnUnmount",Ai={bubbles:!1,cancelable:!0},ph="FocusScope",bn=l.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[a,u]=l.useState(null),d=je(o),p=je(s),f=l.useRef(null),m=ie(t,h=>u(h)),g=l.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;l.useEffect(()=>{if(n){let h=function(S){if(g.paused||!a)return;const C=S.target;a.contains(C)?f.current=C:wt(f.current,{select:!0})},y=function(S){if(g.paused||!a)return;const C=S.relatedTarget;C!==null&&(a.contains(C)||wt(f.current,{select:!0}))},v=function(S){if(document.activeElement===document.body)for(const N of S)N.removedNodes.length>0&&wt(a)};document.addEventListener("focusin",h),document.addEventListener("focusout",y);const b=new MutationObserver(v);return a&&b.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",h),document.removeEventListener("focusout",y),b.disconnect()}}},[n,a,g.paused]),l.useEffect(()=>{if(a){Mi.add(g);const h=document.activeElement;if(!a.contains(h)){const v=new CustomEvent(no,Ai);a.addEventListener(no,d),a.dispatchEvent(v),v.defaultPrevented||(mh(yh(el(a)),{select:!0}),document.activeElement===h&&wt(a))}return()=>{a.removeEventListener(no,d),setTimeout(()=>{const v=new CustomEvent(oo,Ai);a.addEventListener(oo,p),a.dispatchEvent(v),v.defaultPrevented||wt(h??document.body,{select:!0}),a.removeEventListener(oo,p),Mi.remove(g)},0)}}},[a,d,p,g]);const x=l.useCallback(h=>{if(!r&&!n||g.paused)return;const y=h.key==="Tab"&&!h.altKey&&!h.ctrlKey&&!h.metaKey,v=document.activeElement;if(y&&v){const b=h.currentTarget,[S,C]=hh(b);S&&C?!h.shiftKey&&v===C?(h.preventDefault(),r&&wt(S,{select:!0})):h.shiftKey&&v===S&&(h.preventDefault(),r&&wt(C,{select:!0})):v===b&&h.preventDefault()}},[r,n,g.paused]);return c.jsx(fh.div,{tabIndex:-1,...i,ref:m,onKeyDown:x})});bn.displayName=ph;function mh(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(wt(n,{select:t}),document.activeElement!==r)return}function hh(e){const t=el(e),r=Ti(t,e),n=Ti(t.reverse(),e);return[r,n]}function el(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const o=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||o?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Ti(e,t){for(const r of e)if(!gh(r,{upTo:t}))return r}function gh(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function xh(e){return e instanceof HTMLInputElement&&"select"in e}function wt(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&xh(e)&&t&&e.select()}}var Mi=vh();function vh(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=ki(e,t),e.unshift(t)},remove(t){var r;e=ki(e,t),(r=e[0])==null||r.resume()}}}function ki(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function yh(e){return e.filter(t=>t.tagName!=="A")}var bh=l[" useId ".trim().toString()]||(()=>{}),wh=0;function Ue(e){const[t,r]=l.useState(bh());return Ne(()=>{r(n=>n??String(wh++))},[e]),e||(t?`radix-${t}`:"")}const Sh=["top","right","bottom","left"],Et=Math.min,We=Math.max,tn=Math.round,zr=Math.floor,lt=e=>({x:e,y:e}),Ch={left:"right",right:"left",bottom:"top",top:"bottom"},Nh={start:"end",end:"start"};function wo(e,t,r){return We(e,Et(t,r))}function gt(e,t){return typeof e=="function"?e(t):e}function xt(e){return e.split("-")[0]}function ir(e){return e.split("-")[1]}function qo(e){return e==="x"?"y":"x"}function Xo(e){return e==="y"?"height":"width"}const Eh=new Set(["top","bottom"]);function at(e){return Eh.has(xt(e))?"y":"x"}function Qo(e){return qo(at(e))}function jh(e,t,r){r===void 0&&(r=!1);const n=ir(e),o=Qo(e),s=Xo(o);let i=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=rn(i)),[i,rn(i)]}function Rh(e){const t=rn(e);return[So(e),t,So(t)]}function So(e){return e.replace(/start|end/g,t=>Nh[t])}const Di=["left","right"],Ii=["right","left"],_h=["top","bottom"],Ph=["bottom","top"];function Ah(e,t,r){switch(e){case"top":case"bottom":return r?t?Ii:Di:t?Di:Ii;case"left":case"right":return t?_h:Ph;default:return[]}}function Th(e,t,r,n){const o=ir(e);let s=Ah(xt(e),r==="start",n);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(So)))),s}function rn(e){return e.replace(/left|right|bottom|top/g,t=>Ch[t])}function Mh(e){return{top:0,right:0,bottom:0,left:0,...e}}function tl(e){return typeof e!="number"?Mh(e):{top:e,right:e,bottom:e,left:e}}function nn(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function Oi(e,t,r){let{reference:n,floating:o}=e;const s=at(t),i=Qo(t),a=Xo(i),u=xt(t),d=s==="y",p=n.x+n.width/2-o.width/2,f=n.y+n.height/2-o.height/2,m=n[a]/2-o[a]/2;let g;switch(u){case"top":g={x:p,y:n.y-o.height};break;case"bottom":g={x:p,y:n.y+n.height};break;case"right":g={x:n.x+n.width,y:f};break;case"left":g={x:n.x-o.width,y:f};break;default:g={x:n.x,y:n.y}}switch(ir(t)){case"start":g[i]-=m*(r&&d?-1:1);break;case"end":g[i]+=m*(r&&d?-1:1);break}return g}const kh=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:s=[],platform:i}=r,a=s.filter(Boolean),u=await(i.isRTL==null?void 0:i.isRTL(t));let d=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:p,y:f}=Oi(d,n,u),m=n,g={},x=0;for(let h=0;h<a.length;h++){const{name:y,fn:v}=a[h],{x:b,y:S,data:C,reset:N}=await v({x:p,y:f,initialPlacement:n,placement:m,strategy:o,middlewareData:g,rects:d,platform:i,elements:{reference:e,floating:t}});p=b??p,f=S??f,g={...g,[y]:{...g[y],...C}},N&&x<=50&&(x++,typeof N=="object"&&(N.placement&&(m=N.placement),N.rects&&(d=N.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):N.rects),{x:p,y:f}=Oi(d,m,u)),h=-1)}return{x:p,y:f,placement:m,strategy:o,middlewareData:g}};async function Sr(e,t){var r;t===void 0&&(t={});const{x:n,y:o,platform:s,rects:i,elements:a,strategy:u}=e,{boundary:d="clippingAncestors",rootBoundary:p="viewport",elementContext:f="floating",altBoundary:m=!1,padding:g=0}=gt(t,e),x=tl(g),y=a[m?f==="floating"?"reference":"floating":f],v=nn(await s.getClippingRect({element:(r=await(s.isElement==null?void 0:s.isElement(y)))==null||r?y:y.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:d,rootBoundary:p,strategy:u})),b=f==="floating"?{x:n,y:o,width:i.floating.width,height:i.floating.height}:i.reference,S=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),C=await(s.isElement==null?void 0:s.isElement(S))?await(s.getScale==null?void 0:s.getScale(S))||{x:1,y:1}:{x:1,y:1},N=nn(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:S,strategy:u}):b);return{top:(v.top-N.top+x.top)/C.y,bottom:(N.bottom-v.bottom+x.bottom)/C.y,left:(v.left-N.left+x.left)/C.x,right:(N.right-v.right+x.right)/C.x}}const Dh=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:s,platform:i,elements:a,middlewareData:u}=t,{element:d,padding:p=0}=gt(e,t)||{};if(d==null)return{};const f=tl(p),m={x:r,y:n},g=Qo(o),x=Xo(g),h=await i.getDimensions(d),y=g==="y",v=y?"top":"left",b=y?"bottom":"right",S=y?"clientHeight":"clientWidth",C=s.reference[x]+s.reference[g]-m[g]-s.floating[x],N=m[g]-s.reference[g],_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(d));let j=_?_[S]:0;(!j||!await(i.isElement==null?void 0:i.isElement(_)))&&(j=a.floating[S]||s.floating[x]);const $=C/2-N/2,D=j/2-h[x]/2-1,O=Et(f[v],D),P=Et(f[b],D),A=O,M=j-h[x]-P,z=j/2-h[x]/2+$,q=wo(A,z,M),H=!u.arrow&&ir(o)!=null&&z!==q&&s.reference[x]/2-(z<A?O:P)-h[x]/2<0,k=H?z<A?z-A:z-M:0;return{[g]:m[g]+k,data:{[g]:q,centerOffset:z-q-k,...H&&{alignmentOffset:k}},reset:H}}}),Ih=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:u,elements:d}=t,{mainAxis:p=!0,crossAxis:f=!0,fallbackPlacements:m,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:h=!0,...y}=gt(e,t);if((r=s.arrow)!=null&&r.alignmentOffset)return{};const v=xt(o),b=at(a),S=xt(a)===a,C=await(u.isRTL==null?void 0:u.isRTL(d.floating)),N=m||(S||!h?[rn(a)]:Rh(a)),_=x!=="none";!m&&_&&N.push(...Th(a,h,x,C));const j=[a,...N],$=await Sr(t,y),D=[];let O=((n=s.flip)==null?void 0:n.overflows)||[];if(p&&D.push($[v]),f){const z=jh(o,i,C);D.push($[z[0]],$[z[1]])}if(O=[...O,{placement:o,overflows:D}],!D.every(z=>z<=0)){var P,A;const z=(((P=s.flip)==null?void 0:P.index)||0)+1,q=j[z];if(q&&(!(f==="alignment"?b!==at(q):!1)||O.every(W=>at(W.placement)===b?W.overflows[0]>0:!0)))return{data:{index:z,overflows:O},reset:{placement:q}};let H=(A=O.filter(k=>k.overflows[0]<=0).sort((k,W)=>k.overflows[1]-W.overflows[1])[0])==null?void 0:A.placement;if(!H)switch(g){case"bestFit":{var M;const k=(M=O.filter(W=>{if(_){const L=at(W.placement);return L===b||L==="y"}return!0}).map(W=>[W.placement,W.overflows.filter(L=>L>0).reduce((L,re)=>L+re,0)]).sort((W,L)=>W[1]-L[1])[0])==null?void 0:M[0];k&&(H=k);break}case"initialPlacement":H=a;break}if(o!==H)return{reset:{placement:H}}}return{}}}};function $i(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Li(e){return Sh.some(t=>e[t]>=0)}const Oh=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...o}=gt(e,t);switch(n){case"referenceHidden":{const s=await Sr(t,{...o,elementContext:"reference"}),i=$i(s,r.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:Li(i)}}}case"escaped":{const s=await Sr(t,{...o,altBoundary:!0}),i=$i(s,r.floating);return{data:{escapedOffsets:i,escaped:Li(i)}}}default:return{}}}}},rl=new Set(["left","top"]);async function $h(e,t){const{placement:r,platform:n,elements:o}=e,s=await(n.isRTL==null?void 0:n.isRTL(o.floating)),i=xt(r),a=ir(r),u=at(r)==="y",d=rl.has(i)?-1:1,p=s&&u?-1:1,f=gt(t,e);let{mainAxis:m,crossAxis:g,alignmentAxis:x}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof x=="number"&&(g=a==="end"?x*-1:x),u?{x:g*p,y:m*d}:{x:m*d,y:g*p}}const Lh=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:s,placement:i,middlewareData:a}=t,u=await $h(t,e);return i===((r=a.offset)==null?void 0:r.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:o+u.x,y:s+u.y,data:{...u,placement:i}}}}},Fh=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:a={fn:y=>{let{x:v,y:b}=y;return{x:v,y:b}}},...u}=gt(e,t),d={x:r,y:n},p=await Sr(t,u),f=at(xt(o)),m=qo(f);let g=d[m],x=d[f];if(s){const y=m==="y"?"top":"left",v=m==="y"?"bottom":"right",b=g+p[y],S=g-p[v];g=wo(b,g,S)}if(i){const y=f==="y"?"top":"left",v=f==="y"?"bottom":"right",b=x+p[y],S=x-p[v];x=wo(b,x,S)}const h=a.fn({...t,[m]:g,[f]:x});return{...h,data:{x:h.x-r,y:h.y-n,enabled:{[m]:s,[f]:i}}}}}},Vh=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:u=!0,crossAxis:d=!0}=gt(e,t),p={x:r,y:n},f=at(o),m=qo(f);let g=p[m],x=p[f];const h=gt(a,t),y=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(u){const S=m==="y"?"height":"width",C=s.reference[m]-s.floating[S]+y.mainAxis,N=s.reference[m]+s.reference[S]-y.mainAxis;g<C?g=C:g>N&&(g=N)}if(d){var v,b;const S=m==="y"?"width":"height",C=rl.has(xt(o)),N=s.reference[f]-s.floating[S]+(C&&((v=i.offset)==null?void 0:v[f])||0)+(C?0:y.crossAxis),_=s.reference[f]+s.reference[S]+(C?0:((b=i.offset)==null?void 0:b[f])||0)-(C?y.crossAxis:0);x<N?x=N:x>_&&(x=_)}return{[m]:g,[f]:x}}}},Bh=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:s,platform:i,elements:a}=t,{apply:u=()=>{},...d}=gt(e,t),p=await Sr(t,d),f=xt(o),m=ir(o),g=at(o)==="y",{width:x,height:h}=s.floating;let y,v;f==="top"||f==="bottom"?(y=f,v=m===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(v=f,y=m==="end"?"top":"bottom");const b=h-p.top-p.bottom,S=x-p.left-p.right,C=Et(h-p[y],b),N=Et(x-p[v],S),_=!t.middlewareData.shift;let j=C,$=N;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&($=S),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(j=b),_&&!m){const O=We(p.left,0),P=We(p.right,0),A=We(p.top,0),M=We(p.bottom,0);g?$=x-2*(O!==0||P!==0?O+P:We(p.left,p.right)):j=h-2*(A!==0||M!==0?A+M:We(p.top,p.bottom))}await u({...t,availableWidth:$,availableHeight:j});const D=await i.getDimensions(a.floating);return x!==D.width||h!==D.height?{reset:{rects:!0}}:{}}}};function wn(){return typeof window<"u"}function ar(e){return nl(e)?(e.nodeName||"").toLowerCase():"#document"}function ze(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function dt(e){var t;return(t=(nl(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function nl(e){return wn()?e instanceof Node||e instanceof ze(e).Node:!1}function tt(e){return wn()?e instanceof Element||e instanceof ze(e).Element:!1}function ut(e){return wn()?e instanceof HTMLElement||e instanceof ze(e).HTMLElement:!1}function Fi(e){return!wn()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ze(e).ShadowRoot}const Wh=new Set(["inline","contents"]);function Ir(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=rt(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!Wh.has(o)}const Hh=new Set(["table","td","th"]);function Uh(e){return Hh.has(ar(e))}const zh=[":popover-open",":modal"];function Sn(e){return zh.some(t=>{try{return e.matches(t)}catch{return!1}})}const Gh=["transform","translate","scale","rotate","perspective"],Kh=["transform","translate","scale","rotate","perspective","filter"],Yh=["paint","layout","strict","content"];function Zo(e){const t=Jo(),r=tt(e)?rt(e):e;return Gh.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||Kh.some(n=>(r.willChange||"").includes(n))||Yh.some(n=>(r.contain||"").includes(n))}function qh(e){let t=jt(e);for(;ut(t)&&!tr(t);){if(Zo(t))return t;if(Sn(t))return null;t=jt(t)}return null}function Jo(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Xh=new Set(["html","body","#document"]);function tr(e){return Xh.has(ar(e))}function rt(e){return ze(e).getComputedStyle(e)}function Cn(e){return tt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function jt(e){if(ar(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Fi(e)&&e.host||dt(e);return Fi(t)?t.host:t}function ol(e){const t=jt(e);return tr(t)?e.ownerDocument?e.ownerDocument.body:e.body:ut(t)&&Ir(t)?t:ol(t)}function Cr(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=ol(e),s=o===((n=e.ownerDocument)==null?void 0:n.body),i=ze(o);if(s){const a=Co(i);return t.concat(i,i.visualViewport||[],Ir(o)?o:[],a&&r?Cr(a):[])}return t.concat(o,Cr(o,[],r))}function Co(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function sl(e){const t=rt(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=ut(e),s=o?e.offsetWidth:r,i=o?e.offsetHeight:n,a=tn(r)!==s||tn(n)!==i;return a&&(r=s,n=i),{width:r,height:n,$:a}}function es(e){return tt(e)?e:e.contextElement}function Kt(e){const t=es(e);if(!ut(t))return lt(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:s}=sl(t);let i=(s?tn(r.width):r.width)/n,a=(s?tn(r.height):r.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const Qh=lt(0);function il(e){const t=ze(e);return!Jo()||!t.visualViewport?Qh:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Zh(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==ze(e)?!1:t}function Dt(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),s=es(e);let i=lt(1);t&&(n?tt(n)&&(i=Kt(n)):i=Kt(e));const a=Zh(s,r,n)?il(s):lt(0);let u=(o.left+a.x)/i.x,d=(o.top+a.y)/i.y,p=o.width/i.x,f=o.height/i.y;if(s){const m=ze(s),g=n&&tt(n)?ze(n):n;let x=m,h=Co(x);for(;h&&n&&g!==x;){const y=Kt(h),v=h.getBoundingClientRect(),b=rt(h),S=v.left+(h.clientLeft+parseFloat(b.paddingLeft))*y.x,C=v.top+(h.clientTop+parseFloat(b.paddingTop))*y.y;u*=y.x,d*=y.y,p*=y.x,f*=y.y,u+=S,d+=C,x=ze(h),h=Co(x)}}return nn({width:p,height:f,x:u,y:d})}function Nn(e,t){const r=Cn(e).scrollLeft;return t?t.left+r:Dt(dt(e)).left+r}function al(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-Nn(e,r),o=r.top+t.scrollTop;return{x:n,y:o}}function Jh(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const s=o==="fixed",i=dt(n),a=t?Sn(t.floating):!1;if(n===i||a&&s)return r;let u={scrollLeft:0,scrollTop:0},d=lt(1);const p=lt(0),f=ut(n);if((f||!f&&!s)&&((ar(n)!=="body"||Ir(i))&&(u=Cn(n)),ut(n))){const g=Dt(n);d=Kt(n),p.x=g.x+n.clientLeft,p.y=g.y+n.clientTop}const m=i&&!f&&!s?al(i,u):lt(0);return{width:r.width*d.x,height:r.height*d.y,x:r.x*d.x-u.scrollLeft*d.x+p.x+m.x,y:r.y*d.y-u.scrollTop*d.y+p.y+m.y}}function eg(e){return Array.from(e.getClientRects())}function tg(e){const t=dt(e),r=Cn(e),n=e.ownerDocument.body,o=We(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=We(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-r.scrollLeft+Nn(e);const a=-r.scrollTop;return rt(n).direction==="rtl"&&(i+=We(t.clientWidth,n.clientWidth)-o),{width:o,height:s,x:i,y:a}}const Vi=25;function rg(e,t){const r=ze(e),n=dt(e),o=r.visualViewport;let s=n.clientWidth,i=n.clientHeight,a=0,u=0;if(o){s=o.width,i=o.height;const p=Jo();(!p||p&&t==="fixed")&&(a=o.offsetLeft,u=o.offsetTop)}const d=Nn(n);if(d<=0){const p=n.ownerDocument,f=p.body,m=getComputedStyle(f),g=p.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,x=Math.abs(n.clientWidth-f.clientWidth-g);x<=Vi&&(s-=x)}else d<=Vi&&(s+=d);return{width:s,height:i,x:a,y:u}}const ng=new Set(["absolute","fixed"]);function og(e,t){const r=Dt(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,s=ut(e)?Kt(e):lt(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,u=o*s.x,d=n*s.y;return{width:i,height:a,x:u,y:d}}function Bi(e,t,r){let n;if(t==="viewport")n=rg(e,r);else if(t==="document")n=tg(dt(e));else if(tt(t))n=og(t,r);else{const o=il(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return nn(n)}function ll(e,t){const r=jt(e);return r===t||!tt(r)||tr(r)?!1:rt(r).position==="fixed"||ll(r,t)}function sg(e,t){const r=t.get(e);if(r)return r;let n=Cr(e,[],!1).filter(a=>tt(a)&&ar(a)!=="body"),o=null;const s=rt(e).position==="fixed";let i=s?jt(e):e;for(;tt(i)&&!tr(i);){const a=rt(i),u=Zo(i);!u&&a.position==="fixed"&&(o=null),(s?!u&&!o:!u&&a.position==="static"&&!!o&&ng.has(o.position)||Ir(i)&&!u&&ll(e,i))?n=n.filter(p=>p!==i):o=a,i=jt(i)}return t.set(e,n),n}function ig(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const i=[...r==="clippingAncestors"?Sn(t)?[]:sg(t,this._c):[].concat(r),n],a=i[0],u=i.reduce((d,p)=>{const f=Bi(t,p,o);return d.top=We(f.top,d.top),d.right=Et(f.right,d.right),d.bottom=Et(f.bottom,d.bottom),d.left=We(f.left,d.left),d},Bi(t,a,o));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function ag(e){const{width:t,height:r}=sl(e);return{width:t,height:r}}function lg(e,t,r){const n=ut(t),o=dt(t),s=r==="fixed",i=Dt(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const u=lt(0);function d(){u.x=Nn(o)}if(n||!n&&!s)if((ar(t)!=="body"||Ir(o))&&(a=Cn(t)),n){const g=Dt(t,!0,s,t);u.x=g.x+t.clientLeft,u.y=g.y+t.clientTop}else o&&d();s&&!n&&o&&d();const p=o&&!n&&!s?al(o,a):lt(0),f=i.left+a.scrollLeft-u.x-p.x,m=i.top+a.scrollTop-u.y-p.y;return{x:f,y:m,width:i.width,height:i.height}}function so(e){return rt(e).position==="static"}function Wi(e,t){if(!ut(e)||rt(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return dt(e)===r&&(r=r.ownerDocument.body),r}function cl(e,t){const r=ze(e);if(Sn(e))return r;if(!ut(e)){let o=jt(e);for(;o&&!tr(o);){if(tt(o)&&!so(o))return o;o=jt(o)}return r}let n=Wi(e,t);for(;n&&Uh(n)&&so(n);)n=Wi(n,t);return n&&tr(n)&&so(n)&&!Zo(n)?r:n||qh(e)||r}const cg=async function(e){const t=this.getOffsetParent||cl,r=this.getDimensions,n=await r(e.floating);return{reference:lg(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function ug(e){return rt(e).direction==="rtl"}const dg={convertOffsetParentRelativeRectToViewportRelativeRect:Jh,getDocumentElement:dt,getClippingRect:ig,getOffsetParent:cl,getElementRects:cg,getClientRects:eg,getDimensions:ag,getScale:Kt,isElement:tt,isRTL:ug};function ul(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function fg(e,t){let r=null,n;const o=dt(e);function s(){var a;clearTimeout(n),(a=r)==null||a.disconnect(),r=null}function i(a,u){a===void 0&&(a=!1),u===void 0&&(u=1),s();const d=e.getBoundingClientRect(),{left:p,top:f,width:m,height:g}=d;if(a||t(),!m||!g)return;const x=zr(f),h=zr(o.clientWidth-(p+m)),y=zr(o.clientHeight-(f+g)),v=zr(p),S={rootMargin:-x+"px "+-h+"px "+-y+"px "+-v+"px",threshold:We(0,Et(1,u))||1};let C=!0;function N(_){const j=_[0].intersectionRatio;if(j!==u){if(!C)return i();j?i(!1,j):n=setTimeout(()=>{i(!1,1e-7)},1e3)}j===1&&!ul(d,e.getBoundingClientRect())&&i(),C=!1}try{r=new IntersectionObserver(N,{...S,root:o.ownerDocument})}catch{r=new IntersectionObserver(N,S)}r.observe(e)}return i(!0),s}function pg(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:u=!1}=n,d=es(e),p=o||s?[...d?Cr(d):[],...Cr(t)]:[];p.forEach(v=>{o&&v.addEventListener("scroll",r,{passive:!0}),s&&v.addEventListener("resize",r)});const f=d&&a?fg(d,r):null;let m=-1,g=null;i&&(g=new ResizeObserver(v=>{let[b]=v;b&&b.target===d&&g&&(g.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var S;(S=g)==null||S.observe(t)})),r()}),d&&!u&&g.observe(d),g.observe(t));let x,h=u?Dt(e):null;u&&y();function y(){const v=Dt(e);h&&!ul(h,v)&&r(),h=v,x=requestAnimationFrame(y)}return r(),()=>{var v;p.forEach(b=>{o&&b.removeEventListener("scroll",r),s&&b.removeEventListener("resize",r)}),f==null||f(),(v=g)==null||v.disconnect(),g=null,u&&cancelAnimationFrame(x)}}const mg=Lh,hg=Fh,gg=Ih,xg=Bh,vg=Oh,Hi=Dh,yg=Vh,bg=(e,t,r)=>{const n=new Map,o={platform:dg,...r},s={...o.platform,_c:n};return kh(e,t,{...o,platform:s})};var wg=typeof document<"u",Sg=function(){},Qr=wg?oe.useLayoutEffect:Sg;function on(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!on(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;n--!==0;){const s=o[n];if(!(s==="_owner"&&e.$$typeof)&&!on(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function dl(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ui(e,t){const r=dl(e);return Math.round(t*r)/r}function io(e){const t=l.useRef(e);return Qr(()=>{t.current=e}),t}function Cg(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:u,open:d}=e,[p,f]=l.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[m,g]=l.useState(n);on(m,n)||g(n);const[x,h]=l.useState(null),[y,v]=l.useState(null),b=l.useCallback(W=>{W!==_.current&&(_.current=W,h(W))},[]),S=l.useCallback(W=>{W!==j.current&&(j.current=W,v(W))},[]),C=s||x,N=i||y,_=l.useRef(null),j=l.useRef(null),$=l.useRef(p),D=u!=null,O=io(u),P=io(o),A=io(d),M=l.useCallback(()=>{if(!_.current||!j.current)return;const W={placement:t,strategy:r,middleware:m};P.current&&(W.platform=P.current),bg(_.current,j.current,W).then(L=>{const re={...L,isPositioned:A.current!==!1};z.current&&!on($.current,re)&&($.current=re,Ar.flushSync(()=>{f(re)}))})},[m,t,r,P,A]);Qr(()=>{d===!1&&$.current.isPositioned&&($.current.isPositioned=!1,f(W=>({...W,isPositioned:!1})))},[d]);const z=l.useRef(!1);Qr(()=>(z.current=!0,()=>{z.current=!1}),[]),Qr(()=>{if(C&&(_.current=C),N&&(j.current=N),C&&N){if(O.current)return O.current(C,N,M);M()}},[C,N,M,O,D]);const q=l.useMemo(()=>({reference:_,floating:j,setReference:b,setFloating:S}),[b,S]),H=l.useMemo(()=>({reference:C,floating:N}),[C,N]),k=l.useMemo(()=>{const W={position:r,left:0,top:0};if(!H.floating)return W;const L=Ui(H.floating,p.x),re=Ui(H.floating,p.y);return a?{...W,transform:"translate("+L+"px, "+re+"px)",...dl(H.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:L,top:re}},[r,a,H.floating,p.x,p.y]);return l.useMemo(()=>({...p,update:M,refs:q,elements:H,floatingStyles:k}),[p,M,q,H,k])}const Ng=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:o}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?Hi({element:n.current,padding:o}).fn(r):{}:n?Hi({element:n,padding:o}).fn(r):{}}}},Eg=(e,t)=>({...mg(e),options:[e,t]}),jg=(e,t)=>({...hg(e),options:[e,t]}),Rg=(e,t)=>({...yg(e),options:[e,t]}),_g=(e,t)=>({...gg(e),options:[e,t]}),Pg=(e,t)=>({...xg(e),options:[e,t]}),Ag=(e,t)=>({...vg(e),options:[e,t]}),Tg=(e,t)=>({...Ng(e),options:[e,t]});function Mg(e){const t=kg(e),r=l.forwardRef((n,o)=>{const{children:s,...i}=n,a=l.Children.toArray(s),u=a.find(Ig);if(u){const d=u.props.children,p=a.map(f=>f===u?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return c.jsx(t,{...i,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return c.jsx(t,{...i,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}function kg(e){const t=l.forwardRef((r,n)=>{const{children:o,...s}=r;if(l.isValidElement(o)){const i=$g(o),a=Og(s,o.props);return o.type!==l.Fragment&&(a.ref=n?we(n,i):i),l.cloneElement(o,a)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Dg=Symbol("radix.slottable");function Ig(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Dg}function Og(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...a)=>{const u=s(...a);return o(...a),u}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function $g(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Lg=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Fg=Lg.reduce((e,t)=>{const r=Mg(`Primitive.${t}`),n=l.forwardRef((o,s)=>{const{asChild:i,...a}=o,u=i?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(u,{...a,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Vg="Arrow",fl=l.forwardRef((e,t)=>{const{children:r,width:n=10,height:o=5,...s}=e;return c.jsx(Fg.svg,{...s,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:c.jsx("polygon",{points:"0,0 30,0 15,10"})})});fl.displayName=Vg;var Bg=fl;function Wg(e,t=[]){let r=[];function n(s,i){const a=l.createContext(i),u=r.length;r=[...r,i];const d=f=>{var v;const{scope:m,children:g,...x}=f,h=((v=m==null?void 0:m[e])==null?void 0:v[u])||a,y=l.useMemo(()=>x,Object.values(x));return c.jsx(h.Provider,{value:y,children:g})};d.displayName=s+"Provider";function p(f,m){var h;const g=((h=m==null?void 0:m[e])==null?void 0:h[u])||a,x=l.useContext(g);if(x)return x;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[d,p]}const o=()=>{const s=r.map(i=>l.createContext(i));return function(a){const u=(a==null?void 0:a[e])||s;return l.useMemo(()=>({[`__scope${e}`]:{...a,[e]:u}}),[a,u])}};return o.scopeName=e,[n,Hg(o,...t)]}function Hg(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=n.reduce((a,{useScope:u,scopeName:d})=>{const f=u(s)[`__scope${d}`];return{...a,...f}},{});return l.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}function Ug(e){const t=zg(e),r=l.forwardRef((n,o)=>{const{children:s,...i}=n,a=l.Children.toArray(s),u=a.find(Kg);if(u){const d=u.props.children,p=a.map(f=>f===u?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return c.jsx(t,{...i,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return c.jsx(t,{...i,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}function zg(e){const t=l.forwardRef((r,n)=>{const{children:o,...s}=r;if(l.isValidElement(o)){const i=qg(o),a=Yg(s,o.props);return o.type!==l.Fragment&&(a.ref=n?we(n,i):i),l.cloneElement(o,a)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Gg=Symbol("radix.slottable");function Kg(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Gg}function Yg(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...a)=>{const u=s(...a);return o(...a),u}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function qg(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Xg=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],pl=Xg.reduce((e,t)=>{const r=Ug(`Primitive.${t}`),n=l.forwardRef((o,s)=>{const{asChild:i,...a}=o,u=i?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(u,{...a,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),ts="Popper",[ml,lr]=Wg(ts),[Qg,hl]=ml(ts),gl=e=>{const{__scopePopper:t,children:r}=e,[n,o]=l.useState(null);return c.jsx(Qg,{scope:t,anchor:n,onAnchorChange:o,children:r})};gl.displayName=ts;var xl="PopperAnchor",vl=l.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...o}=e,s=hl(xl,r),i=l.useRef(null),a=ie(t,i),u=l.useRef(null);return l.useEffect(()=>{const d=u.current;u.current=(n==null?void 0:n.current)||i.current,d!==u.current&&s.onAnchorChange(u.current)}),n?null:c.jsx(pl.div,{...o,ref:a})});vl.displayName=xl;var rs="PopperContent",[Zg,Jg]=ml(rs),yl=l.forwardRef((e,t)=>{var I,Z,X,ne,J,U;const{__scopePopper:r,side:n="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:p=0,sticky:f="partial",hideWhenDetached:m=!1,updatePositionStrategy:g="optimized",onPlaced:x,...h}=e,y=hl(rs,r),[v,b]=l.useState(null),S=ie(t,ee=>b(ee)),[C,N]=l.useState(null),_=Wo(C),j=(_==null?void 0:_.width)??0,$=(_==null?void 0:_.height)??0,D=n+(s!=="center"?"-"+s:""),O=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},P=Array.isArray(d)?d:[d],A=P.length>0,M={padding:O,boundary:P.filter(tx),altBoundary:A},{refs:z,floatingStyles:q,placement:H,isPositioned:k,middlewareData:W}=Cg({strategy:"fixed",placement:D,whileElementsMounted:(...ee)=>pg(...ee,{animationFrame:g==="always"}),elements:{reference:y.anchor},middleware:[Eg({mainAxis:o+$,alignmentAxis:i}),u&&jg({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?Rg():void 0,...M}),u&&_g({...M}),Pg({...M,apply:({elements:ee,rects:ye,availableWidth:xe,availableHeight:ke})=>{const{width:De,height:Le}=ye.reference,Be=ee.floating.style;Be.setProperty("--radix-popper-available-width",`${xe}px`),Be.setProperty("--radix-popper-available-height",`${ke}px`),Be.setProperty("--radix-popper-anchor-width",`${De}px`),Be.setProperty("--radix-popper-anchor-height",`${Le}px`)}}),C&&Tg({element:C,padding:a}),rx({arrowWidth:j,arrowHeight:$}),m&&Ag({strategy:"referenceHidden",...M})]}),[L,re]=Sl(H),F=je(x);Ne(()=>{k&&(F==null||F())},[k,F]);const te=(I=W.arrow)==null?void 0:I.x,ce=(Z=W.arrow)==null?void 0:Z.y,de=((X=W.arrow)==null?void 0:X.centerOffset)!==0,[ge,me]=l.useState();return Ne(()=>{v&&me(window.getComputedStyle(v).zIndex)},[v]),c.jsx("div",{ref:z.setFloating,"data-radix-popper-content-wrapper":"",style:{...q,transform:k?q.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ge,"--radix-popper-transform-origin":[(ne=W.transformOrigin)==null?void 0:ne.x,(J=W.transformOrigin)==null?void 0:J.y].join(" "),...((U=W.hide)==null?void 0:U.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:c.jsx(Zg,{scope:r,placedSide:L,onArrowChange:N,arrowX:te,arrowY:ce,shouldHideArrow:de,children:c.jsx(pl.div,{"data-side":L,"data-align":re,...h,ref:S,style:{...h.style,animation:k?void 0:"none"}})})})});yl.displayName=rs;var bl="PopperArrow",ex={top:"bottom",right:"left",bottom:"top",left:"right"},wl=l.forwardRef(function(t,r){const{__scopePopper:n,...o}=t,s=Jg(bl,n),i=ex[s.placedSide];return c.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:c.jsx(Bg,{...o,ref:r,style:{...o.style,display:"block"}})})});wl.displayName=bl;function tx(e){return e!==null}var rx=e=>({name:"transformOrigin",options:e,fn(t){var y,v,b;const{placement:r,rects:n,middlewareData:o}=t,i=((y=o.arrow)==null?void 0:y.centerOffset)!==0,a=i?0:e.arrowWidth,u=i?0:e.arrowHeight,[d,p]=Sl(r),f={start:"0%",center:"50%",end:"100%"}[p],m=(((v=o.arrow)==null?void 0:v.x)??0)+a/2,g=(((b=o.arrow)==null?void 0:b.y)??0)+u/2;let x="",h="";return d==="bottom"?(x=i?f:`${m}px`,h=`${-u}px`):d==="top"?(x=i?f:`${m}px`,h=`${n.floating.height+u}px`):d==="right"?(x=`${-u}px`,h=i?f:`${g}px`):d==="left"&&(x=`${n.floating.width+u}px`,h=i?f:`${g}px`),{data:{x,y:h}}}});function Sl(e){const[t,r="center"]=e.split("-");return[t,r]}var En=gl,ns=vl,os=yl,ss=wl;function nx(e){const t=ox(e),r=l.forwardRef((n,o)=>{const{children:s,...i}=n,a=l.Children.toArray(s),u=a.find(ix);if(u){const d=u.props.children,p=a.map(f=>f===u?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return c.jsx(t,{...i,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return c.jsx(t,{...i,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}function ox(e){const t=l.forwardRef((r,n)=>{const{children:o,...s}=r;if(l.isValidElement(o)){const i=lx(o),a=ax(s,o.props);return o.type!==l.Fragment&&(a.ref=n?we(n,i):i),l.cloneElement(o,a)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var sx=Symbol("radix.slottable");function ix(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===sx}function ax(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...a)=>{const u=s(...a);return o(...a),u}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function lx(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var cx=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ux=cx.reduce((e,t)=>{const r=nx(`Primitive.${t}`),n=l.forwardRef((o,s)=>{const{asChild:i,...a}=o,u=i?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(u,{...a,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),dx="Portal",jn=l.forwardRef((e,t)=>{var a;const{container:r,...n}=e,[o,s]=l.useState(!1);Ne(()=>s(!0),[]);const i=r||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?ma.createPortal(c.jsx(ux.div,{...n,ref:t}),i):null});jn.displayName=dx;function Cl(e){const t=fx(e),r=l.forwardRef((n,o)=>{const{children:s,...i}=n,a=l.Children.toArray(s),u=a.find(mx);if(u){const d=u.props.children,p=a.map(f=>f===u?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return c.jsx(t,{...i,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return c.jsx(t,{...i,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}function fx(e){const t=l.forwardRef((r,n)=>{const{children:o,...s}=r;if(l.isValidElement(o)){const i=gx(o),a=hx(s,o.props);return o.type!==l.Fragment&&(a.ref=n?we(n,i):i),l.cloneElement(o,a)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var px=Symbol("radix.slottable");function mx(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===px}function hx(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...a)=>{const u=s(...a);return o(...a),u}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function gx(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var xx=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ge=xx.reduce((e,t)=>{const r=Cl(`Primitive.${t}`),n=l.forwardRef((o,s)=>{const{asChild:i,...a}=o,u=i?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(u,{...a,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function vx(e){const t=yx(e),r=l.forwardRef((n,o)=>{const{children:s,...i}=n,a=l.Children.toArray(s),u=a.find(wx);if(u){const d=u.props.children,p=a.map(f=>f===u?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return c.jsx(t,{...i,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return c.jsx(t,{...i,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}function yx(e){const t=l.forwardRef((r,n)=>{const{children:o,...s}=r;if(l.isValidElement(o)){const i=Cx(o),a=Sx(s,o.props);return o.type!==l.Fragment&&(a.ref=n?we(n,i):i),l.cloneElement(o,a)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var bx=Symbol("radix.slottable");function wx(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===bx}function Sx(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...a)=>{const u=s(...a);return o(...a),u}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function Cx(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Nx=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ex=Nx.reduce((e,t)=>{const r=vx(`Primitive.${t}`),n=l.forwardRef((o,s)=>{const{asChild:i,...a}=o,u=i?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(u,{...a,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Nl=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),jx="VisuallyHidden",El=l.forwardRef((e,t)=>c.jsx(Ex.span,{...e,ref:t,style:{...Nl,...e.style}}));El.displayName=jx;var Rx=El,_x=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Vt=new WeakMap,Gr=new WeakMap,Kr={},ao=0,jl=function(e){return e&&(e.host||jl(e.parentNode))},Px=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=jl(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},Ax=function(e,t,r,n){var o=Px(t,Array.isArray(e)?e:[e]);Kr[r]||(Kr[r]=new WeakMap);var s=Kr[r],i=[],a=new Set,u=new Set(o),d=function(f){!f||a.has(f)||(a.add(f),d(f.parentNode))};o.forEach(d);var p=function(f){!f||u.has(f)||Array.prototype.forEach.call(f.children,function(m){if(a.has(m))p(m);else try{var g=m.getAttribute(n),x=g!==null&&g!=="false",h=(Vt.get(m)||0)+1,y=(s.get(m)||0)+1;Vt.set(m,h),s.set(m,y),i.push(m),h===1&&x&&Gr.set(m,!0),y===1&&m.setAttribute(r,"true"),x||m.setAttribute(n,"true")}catch(v){console.error("aria-hidden: cannot operate on ",m,v)}})};return p(t),a.clear(),ao++,function(){i.forEach(function(f){var m=Vt.get(f)-1,g=s.get(f)-1;Vt.set(f,m),s.set(f,g),m||(Gr.has(f)||f.removeAttribute(n),Gr.delete(f)),g||f.removeAttribute(r)}),ao--,ao||(Vt=new WeakMap,Vt=new WeakMap,Gr=new WeakMap,Kr={})}},is=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=_x(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live], script"))),Ax(n,o,r,"aria-hidden")):function(){return null}},it=function(){return it=Object.assign||function(t){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=r[s])}return t},it.apply(this,arguments)};function Rl(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function Tx(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,s;n<o;n++)(s||!(n in t))&&(s||(s=Array.prototype.slice.call(t,0,n)),s[n]=t[n]);return e.concat(s||Array.prototype.slice.call(t))}var Zr="right-scroll-bar-position",Jr="width-before-scroll-bar",Mx="with-scroll-bars-hidden",kx="--removed-body-scroll-bar-size";function lo(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Dx(e,t){var r=oe.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var o=r.value;o!==n&&(r.value=n,r.callback(n,o))}}}})[0];return r.callback=t,r.facade}var Ix=typeof window<"u"?l.useLayoutEffect:l.useEffect,zi=new WeakMap;function Ox(e,t){var r=Dx(null,function(n){return e.forEach(function(o){return lo(o,n)})});return Ix(function(){var n=zi.get(r);if(n){var o=new Set(n),s=new Set(e),i=r.current;o.forEach(function(a){s.has(a)||lo(a,null)}),s.forEach(function(a){o.has(a)||lo(a,i)})}zi.set(r,e)},[e]),r}function $x(e){return e}function Lx(e,t){t===void 0&&(t=$x);var r=[],n=!1,o={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(s){var i=t(s,n);return r.push(i),function(){r=r.filter(function(a){return a!==i})}},assignSyncMedium:function(s){for(n=!0;r.length;){var i=r;r=[],i.forEach(s)}r={push:function(a){return s(a)},filter:function(){return r}}},assignMedium:function(s){n=!0;var i=[];if(r.length){var a=r;r=[],a.forEach(s),i=r}var u=function(){var p=i;i=[],p.forEach(s)},d=function(){return Promise.resolve().then(u)};d(),r={push:function(p){i.push(p),d()},filter:function(p){return i=i.filter(p),r}}}};return o}function Fx(e){e===void 0&&(e={});var t=Lx(null);return t.options=it({async:!0,ssr:!1},e),t}var _l=function(e){var t=e.sideCar,r=Rl(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return l.createElement(n,it({},r))};_l.isSideCarExport=!0;function Vx(e,t){return e.useMedium(t),_l}var Pl=Fx(),co=function(){},Rn=l.forwardRef(function(e,t){var r=l.useRef(null),n=l.useState({onScrollCapture:co,onWheelCapture:co,onTouchMoveCapture:co}),o=n[0],s=n[1],i=e.forwardProps,a=e.children,u=e.className,d=e.removeScrollBar,p=e.enabled,f=e.shards,m=e.sideCar,g=e.noRelative,x=e.noIsolation,h=e.inert,y=e.allowPinchZoom,v=e.as,b=v===void 0?"div":v,S=e.gapMode,C=Rl(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),N=m,_=Ox([r,t]),j=it(it({},C),o);return l.createElement(l.Fragment,null,p&&l.createElement(N,{sideCar:Pl,removeScrollBar:d,shards:f,noRelative:g,noIsolation:x,inert:h,setCallbacks:s,allowPinchZoom:!!y,lockRef:r,gapMode:S}),i?l.cloneElement(l.Children.only(a),it(it({},j),{ref:_})):l.createElement(b,it({},j,{className:u,ref:_}),a))});Rn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Rn.classNames={fullWidth:Jr,zeroRight:Zr};var Bx=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Wx(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Bx();return t&&e.setAttribute("nonce",t),e}function Hx(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Ux(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var zx=function(){var e=0,t=null;return{add:function(r){e==0&&(t=Wx())&&(Hx(t,r),Ux(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Gx=function(){var e=zx();return function(t,r){l.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},Al=function(){var e=Gx(),t=function(r){var n=r.styles,o=r.dynamic;return e(n,o),null};return t},Kx={left:0,top:0,right:0,gap:0},uo=function(e){return parseInt(e||"",10)||0},Yx=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[uo(r),uo(n),uo(o)]},qx=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Kx;var t=Yx(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},Xx=Al(),Yt="data-scroll-locked",Qx=function(e,t,r,n){var o=e.left,s=e.top,i=e.right,a=e.gap;return r===void 0&&(r="margin"),`
|
|
182
|
-
.`.concat(
|
|
183
|
-
overflow: hidden `).concat(
|
|
184
|
-
padding-right: `).concat(a,"px ").concat(
|
|
181
|
+
*/const Mn=Me("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),pc=bs("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),we=m.forwardRef(({className:e,variant:t,size:n,asChild:i=!1,loading:s=!1,children:o,disabled:l,...a},r)=>{const f=i?fp:"button";return g.jsxs(f,{className:ne(pc({variant:t,size:n,className:e})),ref:r,disabled:l||s,...a,children:[s&&g.jsx(un,{className:"mr-2 h-4 w-4 animate-spin"}),o]})});we.displayName="Button";const ft=m.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:ne("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));ft.displayName="Card";const An=m.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:ne("flex flex-col space-y-1.5 p-6",e),...t}));An.displayName="CardHeader";const Rn=m.forwardRef(({className:e,...t},n)=>g.jsx("h3",{ref:n,className:ne("text-2xl font-semibold leading-none tracking-tight",e),...t}));Rn.displayName="CardTitle";const Dn=m.forwardRef(({className:e,...t},n)=>g.jsx("p",{ref:n,className:ne("text-sm text-muted-foreground",e),...t}));Dn.displayName="CardDescription";const ht=m.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:ne("p-6 pt-0",e),...t}));ht.displayName="CardContent";const mc=m.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:ne("flex items-center p-6 pt-0",e),...t}));mc.displayName="CardFooter";const gc=bs("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground",success:"border-transparent bg-green-500 text-white hover:bg-green-600",warning:"border-transparent bg-yellow-500 text-white hover:bg-yellow-600",info:"border-transparent bg-blue-500 text-white hover:bg-blue-600"}},defaultVariants:{variant:"default"}});function ii({className:e,variant:t,...n}){return g.jsx("div",{className:ne(gc({variant:t}),e),...n})}const Ln=m.forwardRef(({className:e,type:t,...n},i)=>g.jsx("input",{type:t,className:ne("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:i,...n}));Ln.displayName="Input";var Nm=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ci=Nm.reduce((e,t)=>{const n=nc(`Primitive.${t}`),i=m.forwardRef((s,o)=>{const{asChild:l,...a}=s,r=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(r,{...a,ref:o})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{}),km="Label",vc=m.forwardRef((e,t)=>g.jsx(Ci.label,{...e,ref:t,onMouseDown:n=>{var s;n.target.closest("button, input, select, textarea")||((s=e.onMouseDown)==null||s.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));vc.displayName=km;var bc=vc;const Tm=bs("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Kt=m.forwardRef(({className:e,...t},n)=>g.jsx(bc,{ref:n,className:ne(Tm(),e),...t}));Kt.displayName=bc.displayName;const no=m.forwardRef(({className:e,...t},n)=>g.jsx("textarea",{className:ne("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));no.displayName="Textarea";function Mm(e,t=[]){let n=[];function i(o,l){const a=m.createContext(l),r=n.length;n=[...n,l];const f=h=>{var u;const{scope:b,children:_,...C}=h,S=((u=b==null?void 0:b[e])==null?void 0:u[r])||a,c=m.useMemo(()=>C,Object.values(C));return g.jsx(S.Provider,{value:c,children:_})};f.displayName=o+"Provider";function d(h,b){var S;const _=((S=b==null?void 0:b[e])==null?void 0:S[r])||a,C=m.useContext(_);if(C)return C;if(l!==void 0)return l;throw new Error(`\`${h}\` must be used within \`${o}\``)}return[f,d]}const s=()=>{const o=n.map(l=>m.createContext(l));return function(a){const r=(a==null?void 0:a[e])||o;return m.useMemo(()=>({[`__scope${e}`]:{...a,[e]:r}}),[a,r])}};return s.scopeName=e,[i,Am(s,...t)]}function Am(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const i=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const l=i.reduce((a,{useScope:r,scopeName:f})=>{const h=r(o)[`__scope${f}`];return{...a,...h}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}function oe(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e==null||e(s),n===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}var $e=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},Rm=m[" useInsertionEffect ".trim().toString()]||$e;function wt({prop:e,defaultProp:t,onChange:n=()=>{},caller:i}){const[s,o,l]=Dm({defaultProp:t,onChange:n}),a=e!==void 0,r=a?e:s;{const d=m.useRef(e!==void 0);m.useEffect(()=>{const h=d.current;h!==a&&console.warn(`${i} is changing from ${h?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=a},[a,i])}const f=m.useCallback(d=>{var h;if(a){const b=Lm(d)?d(e):d;b!==e&&((h=l.current)==null||h.call(l,b))}else o(d)},[a,e,o,l]);return[r,f]}function Dm({defaultProp:e,onChange:t}){const[n,i]=m.useState(e),s=m.useRef(n),o=m.useRef(t);return Rm(()=>{o.current=t},[t]),m.useEffect(()=>{var l;s.current!==n&&((l=o.current)==null||l.call(o,n),s.current=n)},[n,s]),[n,i,o]}function Lm(e){return typeof e=="function"}function io(e){const t=m.useRef({value:e,previous:e});return m.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function so(e){const[t,n]=m.useState(void 0);return $e(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const i=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const o=s[0];let l,a;if("borderBoxSize"in o){const r=o.borderBoxSize,f=Array.isArray(r)?r[0]:r;l=f.inlineSize,a=f.blockSize}else l=e.offsetWidth,a=e.offsetHeight;n({width:l,height:a})});return i.observe(e,{box:"border-box"}),()=>i.unobserve(e)}else n(void 0)},[e]),t}function Om(e,t){return m.useReducer((n,i)=>t[n][i]??n,e)}var Ke=e=>{const{present:t,children:n}=e,i=Pm(t),s=typeof n=="function"?n({present:i.isPresent}):m.Children.only(n),o=ye(i.ref,Im(s));return typeof n=="function"||i.isPresent?m.cloneElement(s,{ref:o}):null};Ke.displayName="Presence";function Pm(e){const[t,n]=m.useState(),i=m.useRef(null),s=m.useRef(e),o=m.useRef("none"),l=e?"mounted":"unmounted",[a,r]=Om(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const f=Zi(i.current);o.current=a==="mounted"?f:"none"},[a]),$e(()=>{const f=i.current,d=s.current;if(d!==e){const b=o.current,_=Zi(f);e?r("MOUNT"):_==="none"||(f==null?void 0:f.display)==="none"?r("UNMOUNT"):r(d&&b!==_?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,r]),$e(()=>{if(t){let f;const d=t.ownerDocument.defaultView??window,h=_=>{const S=Zi(i.current).includes(CSS.escape(_.animationName));if(_.target===t&&S&&(r("ANIMATION_END"),!s.current)){const c=t.style.animationFillMode;t.style.animationFillMode="forwards",f=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=c)})}},b=_=>{_.target===t&&(o.current=Zi(i.current))};return t.addEventListener("animationstart",b),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{d.clearTimeout(f),t.removeEventListener("animationstart",b),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else r("ANIMATION_END")},[t,r]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:m.useCallback(f=>{i.current=f?getComputedStyle(f):null,n(f)},[])}}function Zi(e){return(e==null?void 0:e.animationName)||"none"}function Im(e){var i,s;let t=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Bm(e){const t=Fm(e),n=m.forwardRef((i,s)=>{const{children:o,...l}=i,a=m.Children.toArray(o),r=a.find(zm);if(r){const f=r.props.children,d=a.map(h=>h===r?m.Children.count(f)>1?m.Children.only(null):m.isValidElement(f)?f.props.children:null:h);return g.jsx(t,{...l,ref:s,children:m.isValidElement(f)?m.cloneElement(f,void 0,d):null})}return g.jsx(t,{...l,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}function Fm(e){const t=m.forwardRef((n,i)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const l=Vm(s),a=Hm(o,s.props);return s.type!==m.Fragment&&(a.ref=i?je(i,l):l),m.cloneElement(s,a)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var jm=Symbol("radix.slottable");function zm(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===jm}function Hm(e,t){const n={...t};for(const i in t){const s=e[i],o=t[i];/^on[A-Z]/.test(i)?s&&o?n[i]=(...a)=>{const r=o(...a);return s(...a),r}:s&&(n[i]=s):i==="style"?n[i]={...s,...o}:i==="className"&&(n[i]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function Vm(e){var i,s;let t=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Wm=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ro=Wm.reduce((e,t)=>{const n=Bm(`Primitive.${t}`),i=m.forwardRef((s,o)=>{const{asChild:l,...a}=s,r=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(r,{...a,ref:o})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{}),xs="Checkbox",[$m]=Mm(xs),[Um,oo]=$m(xs);function Ym(e){const{__scopeCheckbox:t,checked:n,children:i,defaultChecked:s,disabled:o,form:l,name:a,onCheckedChange:r,required:f,value:d="on",internal_do_not_use_render:h}=e,[b,_]=wt({prop:n,defaultProp:s??!1,onChange:r,caller:xs}),[C,S]=m.useState(null),[c,u]=m.useState(null),p=m.useRef(!1),v=C?!!l||!!C.closest("form"):!0,y={checked:b,disabled:o,setChecked:_,control:C,setControl:S,name:a,form:l,value:d,hasConsumerStoppedPropagationRef:p,required:f,defaultChecked:Xt(s)?!1:s,isFormControl:v,bubbleInput:c,setBubbleInput:u};return g.jsx(Um,{scope:t,...y,children:Zm(h)?h(y):i})}var yc="CheckboxTrigger",xc=m.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...i},s)=>{const{control:o,value:l,disabled:a,checked:r,required:f,setControl:d,setChecked:h,hasConsumerStoppedPropagationRef:b,isFormControl:_,bubbleInput:C}=oo(yc,e),S=ye(s,d),c=m.useRef(r);return m.useEffect(()=>{const u=o==null?void 0:o.form;if(u){const p=()=>h(c.current);return u.addEventListener("reset",p),()=>u.removeEventListener("reset",p)}},[o,h]),g.jsx(ro.button,{type:"button",role:"checkbox","aria-checked":Xt(r)?"mixed":r,"aria-required":f,"data-state":Ec(r),"data-disabled":a?"":void 0,disabled:a,value:l,...i,ref:S,onKeyDown:oe(t,u=>{u.key==="Enter"&&u.preventDefault()}),onClick:oe(n,u=>{h(p=>Xt(p)?!0:!p),C&&_&&(b.current=u.isPropagationStopped(),b.current||u.stopPropagation())})})});xc.displayName=yc;var lo=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:i,checked:s,defaultChecked:o,required:l,disabled:a,value:r,onCheckedChange:f,form:d,...h}=e;return g.jsx(Ym,{__scopeCheckbox:n,checked:s,defaultChecked:o,disabled:a,required:l,onCheckedChange:f,name:i,form:d,value:r,internal_do_not_use_render:({isFormControl:b})=>g.jsxs(g.Fragment,{children:[g.jsx(xc,{...h,ref:t,__scopeCheckbox:n}),b&&g.jsx(Sc,{__scopeCheckbox:n})]})})});lo.displayName=xs;var wc="CheckboxIndicator",_c=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:i,...s}=e,o=oo(wc,n);return g.jsx(Ke,{present:i||Xt(o.checked)||o.checked===!0,children:g.jsx(ro.span,{"data-state":Ec(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:t,style:{pointerEvents:"none",...e.style}})})});_c.displayName=wc;var Cc="CheckboxBubbleInput",Sc=m.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:i,hasConsumerStoppedPropagationRef:s,checked:o,defaultChecked:l,required:a,disabled:r,name:f,value:d,form:h,bubbleInput:b,setBubbleInput:_}=oo(Cc,e),C=ye(n,_),S=io(o),c=so(i);m.useEffect(()=>{const p=b;if(!p)return;const v=window.HTMLInputElement.prototype,w=Object.getOwnPropertyDescriptor(v,"checked").set,x=!s.current;if(S!==o&&w){const E=new Event("click",{bubbles:x});p.indeterminate=Xt(o),w.call(p,Xt(o)?!1:o),p.dispatchEvent(E)}},[b,S,o,s]);const u=m.useRef(Xt(o)?!1:o);return g.jsx(ro.input,{type:"checkbox","aria-hidden":!0,defaultChecked:l??u.current,required:a,disabled:r,name:f,value:d,form:h,...t,tabIndex:-1,ref:C,style:{...t.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Sc.displayName=Cc;function Zm(e){return typeof e=="function"}function Xt(e){return e==="indeterminate"}function Ec(e){return Xt(e)?"indeterminate":e?"checked":"unchecked"}const On=m.forwardRef(({className:e,...t},n)=>g.jsx(lo,{ref:n,className:ne("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:g.jsx(_c,{className:ne("flex items-center justify-center text-current"),children:g.jsx(ui,{className:"h-4 w-4"})})}));On.displayName=lo.displayName;function qm(e,t=[]){let n=[];function i(o,l){const a=m.createContext(l),r=n.length;n=[...n,l];const f=h=>{var u;const{scope:b,children:_,...C}=h,S=((u=b==null?void 0:b[e])==null?void 0:u[r])||a,c=m.useMemo(()=>C,Object.values(C));return g.jsx(S.Provider,{value:c,children:_})};f.displayName=o+"Provider";function d(h,b){var S;const _=((S=b==null?void 0:b[e])==null?void 0:S[r])||a,C=m.useContext(_);if(C)return C;if(l!==void 0)return l;throw new Error(`\`${h}\` must be used within \`${o}\``)}return[f,d]}const s=()=>{const o=n.map(l=>m.createContext(l));return function(a){const r=(a==null?void 0:a[e])||o;return m.useMemo(()=>({[`__scope${e}`]:{...a,[e]:r}}),[a,r])}};return s.scopeName=e,[i,Gm(s,...t)]}function Gm(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const i=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const l=i.reduce((a,{useScope:r,scopeName:f})=>{const h=r(o)[`__scope${f}`];return{...a,...h}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}function Km(e){const t=Xm(e),n=m.forwardRef((i,s)=>{const{children:o,...l}=i,a=m.Children.toArray(o),r=a.find(Jm);if(r){const f=r.props.children,d=a.map(h=>h===r?m.Children.count(f)>1?m.Children.only(null):m.isValidElement(f)?f.props.children:null:h);return g.jsx(t,{...l,ref:s,children:m.isValidElement(f)?m.cloneElement(f,void 0,d):null})}return g.jsx(t,{...l,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}function Xm(e){const t=m.forwardRef((n,i)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const l=tg(s),a=eg(o,s.props);return s.type!==m.Fragment&&(a.ref=i?je(i,l):l),m.cloneElement(s,a)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Qm=Symbol("radix.slottable");function Jm(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Qm}function eg(e,t){const n={...t};for(const i in t){const s=e[i],o=t[i];/^on[A-Z]/.test(i)?s&&o?n[i]=(...a)=>{const r=o(...a);return s(...a),r}:s&&(n[i]=s):i==="style"?n[i]={...s,...o}:i==="className"&&(n[i]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function tg(e){var i,s;let t=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ng=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Nc=ng.reduce((e,t)=>{const n=Km(`Primitive.${t}`),i=m.forwardRef((s,o)=>{const{asChild:l,...a}=s,r=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(r,{...a,ref:o})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{}),ws="Switch",[ig]=qm(ws),[sg,rg]=ig(ws),kc=m.forwardRef((e,t)=>{const{__scopeSwitch:n,name:i,checked:s,defaultChecked:o,required:l,disabled:a,value:r="on",onCheckedChange:f,form:d,...h}=e,[b,_]=m.useState(null),C=ye(t,v=>_(v)),S=m.useRef(!1),c=b?d||!!b.closest("form"):!0,[u,p]=wt({prop:s,defaultProp:o??!1,onChange:f,caller:ws});return g.jsxs(sg,{scope:n,checked:u,disabled:a,children:[g.jsx(Nc.button,{type:"button",role:"switch","aria-checked":u,"aria-required":l,"data-state":Rc(u),"data-disabled":a?"":void 0,disabled:a,value:r,...h,ref:C,onClick:oe(e.onClick,v=>{p(y=>!y),c&&(S.current=v.isPropagationStopped(),S.current||v.stopPropagation())})}),c&&g.jsx(Ac,{control:b,bubbles:!S.current,name:i,value:r,checked:u,required:l,disabled:a,form:d,style:{transform:"translateX(-100%)"}})]})});kc.displayName=ws;var Tc="SwitchThumb",Mc=m.forwardRef((e,t)=>{const{__scopeSwitch:n,...i}=e,s=rg(Tc,n);return g.jsx(Nc.span,{"data-state":Rc(s.checked),"data-disabled":s.disabled?"":void 0,...i,ref:t})});Mc.displayName=Tc;var og="SwitchBubbleInput",Ac=m.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:i=!0,...s},o)=>{const l=m.useRef(null),a=ye(l,o),r=io(n),f=so(t);return m.useEffect(()=>{const d=l.current;if(!d)return;const h=window.HTMLInputElement.prototype,_=Object.getOwnPropertyDescriptor(h,"checked").set;if(r!==n&&_){const C=new Event("click",{bubbles:i});_.call(d,n),d.dispatchEvent(C)}},[r,n,i]),g.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:a,style:{...s.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Ac.displayName=og;function Rc(e){return e?"checked":"unchecked"}var Dc=kc,lg=Mc;const ao=m.forwardRef(({className:e,...t},n)=>g.jsx(Dc,{className:ne("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:g.jsx(lg,{className:ne("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));ao.displayName=Dc.displayName;function ag({className:e,...t}){return g.jsx("div",{className:ne("animate-pulse rounded-md bg-muted",e),...t})}var cg="Separator",ql="horizontal",ug=["horizontal","vertical"],Lc=m.forwardRef((e,t)=>{const{decorative:n,orientation:i=ql,...s}=e,o=dg(i)?i:ql,a=n?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return g.jsx(Ci.div,{"data-orientation":o,...a,...s,ref:t})});Lc.displayName=cg;function dg(e){return ug.includes(e)}var Oc=Lc;const Si=m.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...i},s)=>g.jsx(Oc,{ref:s,decorative:n,orientation:t,className:ne("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...i}));Si.displayName=Oc.displayName;function Rr(e,[t,n]){return Math.min(n,Math.max(t,e))}function fg(e,t=[]){let n=[];function i(o,l){const a=m.createContext(l),r=n.length;n=[...n,l];const f=h=>{var u;const{scope:b,children:_,...C}=h,S=((u=b==null?void 0:b[e])==null?void 0:u[r])||a,c=m.useMemo(()=>C,Object.values(C));return g.jsx(S.Provider,{value:c,children:_})};f.displayName=o+"Provider";function d(h,b){var S;const _=((S=b==null?void 0:b[e])==null?void 0:S[r])||a,C=m.useContext(_);if(C)return C;if(l!==void 0)return l;throw new Error(`\`${h}\` must be used within \`${o}\``)}return[f,d]}const s=()=>{const o=n.map(l=>m.createContext(l));return function(a){const r=(a==null?void 0:a[e])||o;return m.useMemo(()=>({[`__scope${e}`]:{...a,[e]:r}}),[a,r])}};return s.scopeName=e,[i,hg(s,...t)]}function hg(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const i=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const l=i.reduce((a,{useScope:r,scopeName:f})=>{const h=r(o)[`__scope${f}`];return{...a,...h}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}function Gl(e){const t=pg(e),n=m.forwardRef((i,s)=>{const{children:o,...l}=i,a=m.Children.toArray(o),r=a.find(gg);if(r){const f=r.props.children,d=a.map(h=>h===r?m.Children.count(f)>1?m.Children.only(null):m.isValidElement(f)?f.props.children:null:h);return g.jsx(t,{...l,ref:s,children:m.isValidElement(f)?m.cloneElement(f,void 0,d):null})}return g.jsx(t,{...l,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}function pg(e){const t=m.forwardRef((n,i)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const l=bg(s),a=vg(o,s.props);return s.type!==m.Fragment&&(a.ref=i?je(i,l):l),m.cloneElement(s,a)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var mg=Symbol("radix.slottable");function gg(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===mg}function vg(e,t){const n={...t};for(const i in t){const s=e[i],o=t[i];/^on[A-Z]/.test(i)?s&&o?n[i]=(...a)=>{const r=o(...a);return s(...a),r}:s&&(n[i]=s):i==="style"?n[i]={...s,...o}:i==="className"&&(n[i]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function bg(e){var i,s;let t=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function co(e){const t=e+"CollectionProvider",[n,i]=fg(t),[s,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=S=>{const{scope:c,children:u}=S,p=K.useRef(null),v=K.useRef(new Map).current;return g.jsx(s,{scope:c,itemMap:v,collectionRef:p,children:u})};l.displayName=t;const a=e+"CollectionSlot",r=Gl(a),f=K.forwardRef((S,c)=>{const{scope:u,children:p}=S,v=o(a,u),y=ye(c,v.collectionRef);return g.jsx(r,{ref:y,children:p})});f.displayName=a;const d=e+"CollectionItemSlot",h="data-radix-collection-item",b=Gl(d),_=K.forwardRef((S,c)=>{const{scope:u,children:p,...v}=S,y=K.useRef(null),w=ye(c,y),x=o(d,u);return K.useEffect(()=>(x.itemMap.set(y,{ref:y,...v}),()=>void x.itemMap.delete(y))),g.jsx(b,{[h]:"",ref:w,children:p})});_.displayName=d;function C(S){const c=o(e+"CollectionConsumer",S);return K.useCallback(()=>{const p=c.collectionRef.current;if(!p)return[];const v=Array.from(p.querySelectorAll(`[${h}]`));return Array.from(c.itemMap.values()).sort((x,E)=>v.indexOf(x.ref.current)-v.indexOf(E.ref.current))},[c.collectionRef,c.itemMap])}return[{Provider:l,Slot:f,ItemSlot:_},C,i]}function yg(e,t=[]){let n=[];function i(o,l){const a=m.createContext(l),r=n.length;n=[...n,l];const f=h=>{var u;const{scope:b,children:_,...C}=h,S=((u=b==null?void 0:b[e])==null?void 0:u[r])||a,c=m.useMemo(()=>C,Object.values(C));return g.jsx(S.Provider,{value:c,children:_})};f.displayName=o+"Provider";function d(h,b){var S;const _=((S=b==null?void 0:b[e])==null?void 0:S[r])||a,C=m.useContext(_);if(C)return C;if(l!==void 0)return l;throw new Error(`\`${h}\` must be used within \`${o}\``)}return[f,d]}const s=()=>{const o=n.map(l=>m.createContext(l));return function(a){const r=(a==null?void 0:a[e])||o;return m.useMemo(()=>({[`__scope${e}`]:{...a,[e]:r}}),[a,r])}};return s.scopeName=e,[i,xg(s,...t)]}function xg(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const i=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const l=i.reduce((a,{useScope:r,scopeName:f})=>{const h=r(o)[`__scope${f}`];return{...a,...h}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}var wg=m.createContext(void 0);function Ei(e){const t=m.useContext(wg);return e||t||"ltr"}function _g(e){const t=Cg(e),n=m.forwardRef((i,s)=>{const{children:o,...l}=i,a=m.Children.toArray(o),r=a.find(Eg);if(r){const f=r.props.children,d=a.map(h=>h===r?m.Children.count(f)>1?m.Children.only(null):m.isValidElement(f)?f.props.children:null:h);return g.jsx(t,{...l,ref:s,children:m.isValidElement(f)?m.cloneElement(f,void 0,d):null})}return g.jsx(t,{...l,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}function Cg(e){const t=m.forwardRef((n,i)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const l=kg(s),a=Ng(o,s.props);return s.type!==m.Fragment&&(a.ref=i?je(i,l):l),m.cloneElement(s,a)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Sg=Symbol("radix.slottable");function Eg(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Sg}function Ng(e,t){const n={...t};for(const i in t){const s=e[i],o=t[i];/^on[A-Z]/.test(i)?s&&o?n[i]=(...a)=>{const r=o(...a);return s(...a),r}:s&&(n[i]=s):i==="style"?n[i]={...s,...o}:i==="className"&&(n[i]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function kg(e){var i,s;let t=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Tg=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Pc=Tg.reduce((e,t)=>{const n=_g(`Primitive.${t}`),i=m.forwardRef((s,o)=>{const{asChild:l,...a}=s,r=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(r,{...a,ref:o})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{});function Mg(e,t){e&&wi.flushSync(()=>e.dispatchEvent(t))}function Ze(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...n)=>{var i;return(i=t.current)==null?void 0:i.call(t,...n)},[])}function Ag(e,t=globalThis==null?void 0:globalThis.document){const n=Ze(e);m.useEffect(()=>{const i=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",i,{capture:!0}),()=>t.removeEventListener("keydown",i,{capture:!0})},[n,t])}var Rg="DismissableLayer",Dr="dismissableLayer.update",Dg="dismissableLayer.pointerDownOutside",Lg="dismissableLayer.focusOutside",Kl,Ic=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Vn=m.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:l,onDismiss:a,...r}=e,f=m.useContext(Ic),[d,h]=m.useState(null),b=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,_]=m.useState({}),C=ye(t,E=>h(E)),S=Array.from(f.layers),[c]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),u=S.indexOf(c),p=d?S.indexOf(d):-1,v=f.layersWithOutsidePointerEventsDisabled.size>0,y=p>=u,w=Ig(E=>{const k=E.target,N=[...f.branches].some(T=>T.contains(k));!y||N||(s==null||s(E),l==null||l(E),E.defaultPrevented||a==null||a())},b),x=Bg(E=>{const k=E.target;[...f.branches].some(T=>T.contains(k))||(o==null||o(E),l==null||l(E),E.defaultPrevented||a==null||a())},b);return Ag(E=>{p===f.layers.size-1&&(i==null||i(E),!E.defaultPrevented&&a&&(E.preventDefault(),a()))},b),m.useEffect(()=>{if(d)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(Kl=b.body.style.pointerEvents,b.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(d)),f.layers.add(d),Xl(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(b.body.style.pointerEvents=Kl)}},[d,b,n,f]),m.useEffect(()=>()=>{d&&(f.layers.delete(d),f.layersWithOutsidePointerEventsDisabled.delete(d),Xl())},[d,f]),m.useEffect(()=>{const E=()=>_({});return document.addEventListener(Dr,E),()=>document.removeEventListener(Dr,E)},[]),g.jsx(Pc.div,{...r,ref:C,style:{pointerEvents:v?y?"auto":"none":void 0,...e.style},onFocusCapture:oe(e.onFocusCapture,x.onFocusCapture),onBlurCapture:oe(e.onBlurCapture,x.onBlurCapture),onPointerDownCapture:oe(e.onPointerDownCapture,w.onPointerDownCapture)})});Vn.displayName=Rg;var Og="DismissableLayerBranch",Pg=m.forwardRef((e,t)=>{const n=m.useContext(Ic),i=m.useRef(null),s=ye(t,i);return m.useEffect(()=>{const o=i.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),g.jsx(Pc.div,{...e,ref:s})});Pg.displayName=Og;function Ig(e,t=globalThis==null?void 0:globalThis.document){const n=Ze(e),i=m.useRef(!1),s=m.useRef(()=>{});return m.useEffect(()=>{const o=a=>{if(a.target&&!i.current){let r=function(){Bc(Dg,n,f,{discrete:!0})};const f={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=r,t.addEventListener("click",s.current,{once:!0})):r()}else t.removeEventListener("click",s.current);i.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",o),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>i.current=!0}}function Bg(e,t=globalThis==null?void 0:globalThis.document){const n=Ze(e),i=m.useRef(!1);return m.useEffect(()=>{const s=o=>{o.target&&!i.current&&Bc(Lg,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>i.current=!0,onBlurCapture:()=>i.current=!1}}function Xl(){const e=new CustomEvent(Dr);document.dispatchEvent(e)}function Bc(e,t,n,{discrete:i}){const s=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),i?Mg(s,o):s.dispatchEvent(o)}var cr=0;function _s(){m.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Ql()),document.body.insertAdjacentElement("beforeend",e[1]??Ql()),cr++,()=>{cr===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),cr--}},[])}function Ql(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}function Fg(e){const t=jg(e),n=m.forwardRef((i,s)=>{const{children:o,...l}=i,a=m.Children.toArray(o),r=a.find(Hg);if(r){const f=r.props.children,d=a.map(h=>h===r?m.Children.count(f)>1?m.Children.only(null):m.isValidElement(f)?f.props.children:null:h);return g.jsx(t,{...l,ref:s,children:m.isValidElement(f)?m.cloneElement(f,void 0,d):null})}return g.jsx(t,{...l,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}function jg(e){const t=m.forwardRef((n,i)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const l=Wg(s),a=Vg(o,s.props);return s.type!==m.Fragment&&(a.ref=i?je(i,l):l),m.cloneElement(s,a)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var zg=Symbol("radix.slottable");function Hg(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===zg}function Vg(e,t){const n={...t};for(const i in t){const s=e[i],o=t[i];/^on[A-Z]/.test(i)?s&&o?n[i]=(...a)=>{const r=o(...a);return s(...a),r}:s&&(n[i]=s):i==="style"?n[i]={...s,...o}:i==="className"&&(n[i]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function Wg(e){var i,s;let t=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var $g=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ug=$g.reduce((e,t)=>{const n=Fg(`Primitive.${t}`),i=m.forwardRef((s,o)=>{const{asChild:l,...a}=s,r=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(r,{...a,ref:o})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{}),ur="focusScope.autoFocusOnMount",dr="focusScope.autoFocusOnUnmount",Jl={bubbles:!1,cancelable:!0},Yg="FocusScope",Ni=m.forwardRef((e,t)=>{const{loop:n=!1,trapped:i=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...l}=e,[a,r]=m.useState(null),f=Ze(s),d=Ze(o),h=m.useRef(null),b=ye(t,S=>r(S)),_=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(i){let S=function(v){if(_.paused||!a)return;const y=v.target;a.contains(y)?h.current=y:qt(h.current,{select:!0})},c=function(v){if(_.paused||!a)return;const y=v.relatedTarget;y!==null&&(a.contains(y)||qt(h.current,{select:!0}))},u=function(v){if(document.activeElement===document.body)for(const w of v)w.removedNodes.length>0&&qt(a)};document.addEventListener("focusin",S),document.addEventListener("focusout",c);const p=new MutationObserver(u);return a&&p.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",c),p.disconnect()}}},[i,a,_.paused]),m.useEffect(()=>{if(a){ta.add(_);const S=document.activeElement;if(!a.contains(S)){const u=new CustomEvent(ur,Jl);a.addEventListener(ur,f),a.dispatchEvent(u),u.defaultPrevented||(Zg(Qg(Fc(a)),{select:!0}),document.activeElement===S&&qt(a))}return()=>{a.removeEventListener(ur,f),setTimeout(()=>{const u=new CustomEvent(dr,Jl);a.addEventListener(dr,d),a.dispatchEvent(u),u.defaultPrevented||qt(S??document.body,{select:!0}),a.removeEventListener(dr,d),ta.remove(_)},0)}}},[a,f,d,_]);const C=m.useCallback(S=>{if(!n&&!i||_.paused)return;const c=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,u=document.activeElement;if(c&&u){const p=S.currentTarget,[v,y]=qg(p);v&&y?!S.shiftKey&&u===y?(S.preventDefault(),n&&qt(v,{select:!0})):S.shiftKey&&u===v&&(S.preventDefault(),n&&qt(y,{select:!0})):u===p&&S.preventDefault()}},[n,i,_.paused]);return g.jsx(Ug.div,{tabIndex:-1,...l,ref:b,onKeyDown:C})});Ni.displayName=Yg;function Zg(e,{select:t=!1}={}){const n=document.activeElement;for(const i of e)if(qt(i,{select:t}),document.activeElement!==n)return}function qg(e){const t=Fc(e),n=ea(t,e),i=ea(t.reverse(),e);return[n,i]}function Fc(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const s=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||s?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ea(e,t){for(const n of e)if(!Gg(n,{upTo:t}))return n}function Gg(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Kg(e){return e instanceof HTMLInputElement&&"select"in e}function qt(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Kg(e)&&t&&e.select()}}var ta=Xg();function Xg(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=na(e,t),e.unshift(t)},remove(t){var n;e=na(e,t),(n=e[0])==null||n.resume()}}}function na(e,t){const n=[...e],i=n.indexOf(t);return i!==-1&&n.splice(i,1),n}function Qg(e){return e.filter(t=>t.tagName!=="A")}var Jg=m[" useId ".trim().toString()]||(()=>{}),e1=0;function it(e){const[t,n]=m.useState(Jg());return $e(()=>{n(i=>i??String(e1++))},[e]),e||(t?`radix-${t}`:"")}const t1=["top","right","bottom","left"],Qt=Math.min,rt=Math.max,rs=Math.round,qi=Math.floor,At=e=>({x:e,y:e}),n1={left:"right",right:"left",bottom:"top",top:"bottom"},i1={start:"end",end:"start"};function Lr(e,t,n){return rt(e,Qt(t,n))}function Vt(e,t){return typeof e=="function"?e(t):e}function Wt(e){return e.split("-")[0]}function Wn(e){return e.split("-")[1]}function uo(e){return e==="x"?"y":"x"}function fo(e){return e==="y"?"height":"width"}const s1=new Set(["top","bottom"]);function Tt(e){return s1.has(Wt(e))?"y":"x"}function ho(e){return uo(Tt(e))}function r1(e,t,n){n===void 0&&(n=!1);const i=Wn(e),s=ho(e),o=fo(s);let l=s==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(l=os(l)),[l,os(l)]}function o1(e){const t=os(e);return[Or(e),t,Or(t)]}function Or(e){return e.replace(/start|end/g,t=>i1[t])}const ia=["left","right"],sa=["right","left"],l1=["top","bottom"],a1=["bottom","top"];function c1(e,t,n){switch(e){case"top":case"bottom":return n?t?sa:ia:t?ia:sa;case"left":case"right":return t?l1:a1;default:return[]}}function u1(e,t,n,i){const s=Wn(e);let o=c1(Wt(e),n==="start",i);return s&&(o=o.map(l=>l+"-"+s),t&&(o=o.concat(o.map(Or)))),o}function os(e){return e.replace(/left|right|bottom|top/g,t=>n1[t])}function d1(e){return{top:0,right:0,bottom:0,left:0,...e}}function jc(e){return typeof e!="number"?d1(e):{top:e,right:e,bottom:e,left:e}}function ls(e){const{x:t,y:n,width:i,height:s}=e;return{width:i,height:s,top:n,left:t,right:t+i,bottom:n+s,x:t,y:n}}function ra(e,t,n){let{reference:i,floating:s}=e;const o=Tt(t),l=ho(t),a=fo(l),r=Wt(t),f=o==="y",d=i.x+i.width/2-s.width/2,h=i.y+i.height/2-s.height/2,b=i[a]/2-s[a]/2;let _;switch(r){case"top":_={x:d,y:i.y-s.height};break;case"bottom":_={x:d,y:i.y+i.height};break;case"right":_={x:i.x+i.width,y:h};break;case"left":_={x:i.x-s.width,y:h};break;default:_={x:i.x,y:i.y}}switch(Wn(t)){case"start":_[l]-=b*(n&&f?-1:1);break;case"end":_[l]+=b*(n&&f?-1:1);break}return _}const f1=async(e,t,n)=>{const{placement:i="bottom",strategy:s="absolute",middleware:o=[],platform:l}=n,a=o.filter(Boolean),r=await(l.isRTL==null?void 0:l.isRTL(t));let f=await l.getElementRects({reference:e,floating:t,strategy:s}),{x:d,y:h}=ra(f,i,r),b=i,_={},C=0;for(let S=0;S<a.length;S++){const{name:c,fn:u}=a[S],{x:p,y:v,data:y,reset:w}=await u({x:d,y:h,initialPlacement:i,placement:b,strategy:s,middlewareData:_,rects:f,platform:l,elements:{reference:e,floating:t}});d=p??d,h=v??h,_={..._,[c]:{..._[c],...y}},w&&C<=50&&(C++,typeof w=="object"&&(w.placement&&(b=w.placement),w.rects&&(f=w.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:s}):w.rects),{x:d,y:h}=ra(f,b,r)),S=-1)}return{x:d,y:h,placement:b,strategy:s,middlewareData:_}};async function di(e,t){var n;t===void 0&&(t={});const{x:i,y:s,platform:o,rects:l,elements:a,strategy:r}=e,{boundary:f="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:b=!1,padding:_=0}=Vt(t,e),C=jc(_),c=a[b?h==="floating"?"reference":"floating":h],u=ls(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(c)))==null||n?c:c.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:f,rootBoundary:d,strategy:r})),p=h==="floating"?{x:i,y:s,width:l.floating.width,height:l.floating.height}:l.reference,v=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),y=await(o.isElement==null?void 0:o.isElement(v))?await(o.getScale==null?void 0:o.getScale(v))||{x:1,y:1}:{x:1,y:1},w=ls(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:p,offsetParent:v,strategy:r}):p);return{top:(u.top-w.top+C.top)/y.y,bottom:(w.bottom-u.bottom+C.bottom)/y.y,left:(u.left-w.left+C.left)/y.x,right:(w.right-u.right+C.right)/y.x}}const h1=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:i,placement:s,rects:o,platform:l,elements:a,middlewareData:r}=t,{element:f,padding:d=0}=Vt(e,t)||{};if(f==null)return{};const h=jc(d),b={x:n,y:i},_=ho(s),C=fo(_),S=await l.getDimensions(f),c=_==="y",u=c?"top":"left",p=c?"bottom":"right",v=c?"clientHeight":"clientWidth",y=o.reference[C]+o.reference[_]-b[_]-o.floating[C],w=b[_]-o.reference[_],x=await(l.getOffsetParent==null?void 0:l.getOffsetParent(f));let E=x?x[v]:0;(!E||!await(l.isElement==null?void 0:l.isElement(x)))&&(E=a.floating[v]||o.floating[C]);const k=y/2-w/2,N=E/2-S[C]/2-1,T=Qt(h[u],N),R=Qt(h[p],N),M=T,A=E-S[C]-R,D=E/2-S[C]/2+k,$=Lr(M,D,A),H=!r.arrow&&Wn(s)!=null&&D!==$&&o.reference[C]/2-(D<M?T:R)-S[C]/2<0,j=H?D<M?D-M:D-A:0;return{[_]:b[_]+j,data:{[_]:$,centerOffset:D-$-j,...H&&{alignmentOffset:j}},reset:H}}}),p1=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,i;const{placement:s,middlewareData:o,rects:l,initialPlacement:a,platform:r,elements:f}=t,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:b,fallbackStrategy:_="bestFit",fallbackAxisSideDirection:C="none",flipAlignment:S=!0,...c}=Vt(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const u=Wt(s),p=Tt(a),v=Wt(a)===a,y=await(r.isRTL==null?void 0:r.isRTL(f.floating)),w=b||(v||!S?[os(a)]:o1(a)),x=C!=="none";!b&&x&&w.push(...u1(a,S,C,y));const E=[a,...w],k=await di(t,c),N=[];let T=((i=o.flip)==null?void 0:i.overflows)||[];if(d&&N.push(k[u]),h){const D=r1(s,l,y);N.push(k[D[0]],k[D[1]])}if(T=[...T,{placement:s,overflows:N}],!N.every(D=>D<=0)){var R,M;const D=(((R=o.flip)==null?void 0:R.index)||0)+1,$=E[D];if($&&(!(h==="alignment"?p!==Tt($):!1)||T.every(F=>Tt(F.placement)===p?F.overflows[0]>0:!0)))return{data:{index:D,overflows:T},reset:{placement:$}};let H=(M=T.filter(j=>j.overflows[0]<=0).sort((j,F)=>j.overflows[1]-F.overflows[1])[0])==null?void 0:M.placement;if(!H)switch(_){case"bestFit":{var A;const j=(A=T.filter(F=>{if(x){const z=Tt(F.placement);return z===p||z==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(z=>z>0).reduce((z,O)=>z+O,0)]).sort((F,z)=>F[1]-z[1])[0])==null?void 0:A[0];j&&(H=j);break}case"initialPlacement":H=a;break}if(s!==H)return{reset:{placement:H}}}return{}}}};function oa(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function la(e){return t1.some(t=>e[t]>=0)}const m1=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:i="referenceHidden",...s}=Vt(e,t);switch(i){case"referenceHidden":{const o=await di(t,{...s,elementContext:"reference"}),l=oa(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:la(l)}}}case"escaped":{const o=await di(t,{...s,altBoundary:!0}),l=oa(o,n.floating);return{data:{escapedOffsets:l,escaped:la(l)}}}default:return{}}}}},zc=new Set(["left","top"]);async function g1(e,t){const{placement:n,platform:i,elements:s}=e,o=await(i.isRTL==null?void 0:i.isRTL(s.floating)),l=Wt(n),a=Wn(n),r=Tt(n)==="y",f=zc.has(l)?-1:1,d=o&&r?-1:1,h=Vt(t,e);let{mainAxis:b,crossAxis:_,alignmentAxis:C}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&typeof C=="number"&&(_=a==="end"?C*-1:C),r?{x:_*d,y:b*f}:{x:b*f,y:_*d}}const v1=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,i;const{x:s,y:o,placement:l,middlewareData:a}=t,r=await g1(t,e);return l===((n=a.offset)==null?void 0:n.placement)&&(i=a.arrow)!=null&&i.alignmentOffset?{}:{x:s+r.x,y:o+r.y,data:{...r,placement:l}}}}},b1=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:i,placement:s}=t,{mainAxis:o=!0,crossAxis:l=!1,limiter:a={fn:c=>{let{x:u,y:p}=c;return{x:u,y:p}}},...r}=Vt(e,t),f={x:n,y:i},d=await di(t,r),h=Tt(Wt(s)),b=uo(h);let _=f[b],C=f[h];if(o){const c=b==="y"?"top":"left",u=b==="y"?"bottom":"right",p=_+d[c],v=_-d[u];_=Lr(p,_,v)}if(l){const c=h==="y"?"top":"left",u=h==="y"?"bottom":"right",p=C+d[c],v=C-d[u];C=Lr(p,C,v)}const S=a.fn({...t,[b]:_,[h]:C});return{...S,data:{x:S.x-n,y:S.y-i,enabled:{[b]:o,[h]:l}}}}}},y1=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:i,placement:s,rects:o,middlewareData:l}=t,{offset:a=0,mainAxis:r=!0,crossAxis:f=!0}=Vt(e,t),d={x:n,y:i},h=Tt(s),b=uo(h);let _=d[b],C=d[h];const S=Vt(a,t),c=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(r){const v=b==="y"?"height":"width",y=o.reference[b]-o.floating[v]+c.mainAxis,w=o.reference[b]+o.reference[v]-c.mainAxis;_<y?_=y:_>w&&(_=w)}if(f){var u,p;const v=b==="y"?"width":"height",y=zc.has(Wt(s)),w=o.reference[h]-o.floating[v]+(y&&((u=l.offset)==null?void 0:u[h])||0)+(y?0:c.crossAxis),x=o.reference[h]+o.reference[v]+(y?0:((p=l.offset)==null?void 0:p[h])||0)-(y?c.crossAxis:0);C<w?C=w:C>x&&(C=x)}return{[b]:_,[h]:C}}}},x1=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,i;const{placement:s,rects:o,platform:l,elements:a}=t,{apply:r=()=>{},...f}=Vt(e,t),d=await di(t,f),h=Wt(s),b=Wn(s),_=Tt(s)==="y",{width:C,height:S}=o.floating;let c,u;h==="top"||h==="bottom"?(c=h,u=b===(await(l.isRTL==null?void 0:l.isRTL(a.floating))?"start":"end")?"left":"right"):(u=h,c=b==="end"?"top":"bottom");const p=S-d.top-d.bottom,v=C-d.left-d.right,y=Qt(S-d[c],p),w=Qt(C-d[u],v),x=!t.middlewareData.shift;let E=y,k=w;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(k=v),(i=t.middlewareData.shift)!=null&&i.enabled.y&&(E=p),x&&!b){const T=rt(d.left,0),R=rt(d.right,0),M=rt(d.top,0),A=rt(d.bottom,0);_?k=C-2*(T!==0||R!==0?T+R:rt(d.left,d.right)):E=S-2*(M!==0||A!==0?M+A:rt(d.top,d.bottom))}await r({...t,availableWidth:k,availableHeight:E});const N=await l.getDimensions(a.floating);return C!==N.width||S!==N.height?{reset:{rects:!0}}:{}}}};function Cs(){return typeof window<"u"}function $n(e){return Hc(e)?(e.nodeName||"").toLowerCase():"#document"}function lt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Dt(e){var t;return(t=(Hc(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Hc(e){return Cs()?e instanceof Node||e instanceof lt(e).Node:!1}function _t(e){return Cs()?e instanceof Element||e instanceof lt(e).Element:!1}function Rt(e){return Cs()?e instanceof HTMLElement||e instanceof lt(e).HTMLElement:!1}function aa(e){return!Cs()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof lt(e).ShadowRoot}const w1=new Set(["inline","contents"]);function ki(e){const{overflow:t,overflowX:n,overflowY:i,display:s}=Ct(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+n)&&!w1.has(s)}const _1=new Set(["table","td","th"]);function C1(e){return _1.has($n(e))}const S1=[":popover-open",":modal"];function Ss(e){return S1.some(t=>{try{return e.matches(t)}catch{return!1}})}const E1=["transform","translate","scale","rotate","perspective"],N1=["transform","translate","scale","rotate","perspective","filter"],k1=["paint","layout","strict","content"];function po(e){const t=mo(),n=_t(e)?Ct(e):e;return E1.some(i=>n[i]?n[i]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||N1.some(i=>(n.willChange||"").includes(i))||k1.some(i=>(n.contain||"").includes(i))}function T1(e){let t=Jt(e);for(;Rt(t)&&!Pn(t);){if(po(t))return t;if(Ss(t))return null;t=Jt(t)}return null}function mo(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const M1=new Set(["html","body","#document"]);function Pn(e){return M1.has($n(e))}function Ct(e){return lt(e).getComputedStyle(e)}function Es(e){return _t(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Jt(e){if($n(e)==="html")return e;const t=e.assignedSlot||e.parentNode||aa(e)&&e.host||Dt(e);return aa(t)?t.host:t}function Vc(e){const t=Jt(e);return Pn(t)?e.ownerDocument?e.ownerDocument.body:e.body:Rt(t)&&ki(t)?t:Vc(t)}function fi(e,t,n){var i;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=Vc(e),o=s===((i=e.ownerDocument)==null?void 0:i.body),l=lt(s);if(o){const a=Pr(l);return t.concat(l,l.visualViewport||[],ki(s)?s:[],a&&n?fi(a):[])}return t.concat(s,fi(s,[],n))}function Pr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Wc(e){const t=Ct(e);let n=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const s=Rt(e),o=s?e.offsetWidth:n,l=s?e.offsetHeight:i,a=rs(n)!==o||rs(i)!==l;return a&&(n=o,i=l),{width:n,height:i,$:a}}function go(e){return _t(e)?e:e.contextElement}function kn(e){const t=go(e);if(!Rt(t))return At(1);const n=t.getBoundingClientRect(),{width:i,height:s,$:o}=Wc(t);let l=(o?rs(n.width):n.width)/i,a=(o?rs(n.height):n.height)/s;return(!l||!Number.isFinite(l))&&(l=1),(!a||!Number.isFinite(a))&&(a=1),{x:l,y:a}}const A1=At(0);function $c(e){const t=lt(e);return!mo()||!t.visualViewport?A1:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function R1(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==lt(e)?!1:t}function dn(e,t,n,i){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),o=go(e);let l=At(1);t&&(i?_t(i)&&(l=kn(i)):l=kn(e));const a=R1(o,n,i)?$c(o):At(0);let r=(s.left+a.x)/l.x,f=(s.top+a.y)/l.y,d=s.width/l.x,h=s.height/l.y;if(o){const b=lt(o),_=i&&_t(i)?lt(i):i;let C=b,S=Pr(C);for(;S&&i&&_!==C;){const c=kn(S),u=S.getBoundingClientRect(),p=Ct(S),v=u.left+(S.clientLeft+parseFloat(p.paddingLeft))*c.x,y=u.top+(S.clientTop+parseFloat(p.paddingTop))*c.y;r*=c.x,f*=c.y,d*=c.x,h*=c.y,r+=v,f+=y,C=lt(S),S=Pr(C)}}return ls({width:d,height:h,x:r,y:f})}function Ns(e,t){const n=Es(e).scrollLeft;return t?t.left+n:dn(Dt(e)).left+n}function Uc(e,t){const n=e.getBoundingClientRect(),i=n.left+t.scrollLeft-Ns(e,n),s=n.top+t.scrollTop;return{x:i,y:s}}function D1(e){let{elements:t,rect:n,offsetParent:i,strategy:s}=e;const o=s==="fixed",l=Dt(i),a=t?Ss(t.floating):!1;if(i===l||a&&o)return n;let r={scrollLeft:0,scrollTop:0},f=At(1);const d=At(0),h=Rt(i);if((h||!h&&!o)&&(($n(i)!=="body"||ki(l))&&(r=Es(i)),Rt(i))){const _=dn(i);f=kn(i),d.x=_.x+i.clientLeft,d.y=_.y+i.clientTop}const b=l&&!h&&!o?Uc(l,r):At(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-r.scrollLeft*f.x+d.x+b.x,y:n.y*f.y-r.scrollTop*f.y+d.y+b.y}}function L1(e){return Array.from(e.getClientRects())}function O1(e){const t=Dt(e),n=Es(e),i=e.ownerDocument.body,s=rt(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),o=rt(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight);let l=-n.scrollLeft+Ns(e);const a=-n.scrollTop;return Ct(i).direction==="rtl"&&(l+=rt(t.clientWidth,i.clientWidth)-s),{width:s,height:o,x:l,y:a}}const ca=25;function P1(e,t){const n=lt(e),i=Dt(e),s=n.visualViewport;let o=i.clientWidth,l=i.clientHeight,a=0,r=0;if(s){o=s.width,l=s.height;const d=mo();(!d||d&&t==="fixed")&&(a=s.offsetLeft,r=s.offsetTop)}const f=Ns(i);if(f<=0){const d=i.ownerDocument,h=d.body,b=getComputedStyle(h),_=d.compatMode==="CSS1Compat"&&parseFloat(b.marginLeft)+parseFloat(b.marginRight)||0,C=Math.abs(i.clientWidth-h.clientWidth-_);C<=ca&&(o-=C)}else f<=ca&&(o+=f);return{width:o,height:l,x:a,y:r}}const I1=new Set(["absolute","fixed"]);function B1(e,t){const n=dn(e,!0,t==="fixed"),i=n.top+e.clientTop,s=n.left+e.clientLeft,o=Rt(e)?kn(e):At(1),l=e.clientWidth*o.x,a=e.clientHeight*o.y,r=s*o.x,f=i*o.y;return{width:l,height:a,x:r,y:f}}function ua(e,t,n){let i;if(t==="viewport")i=P1(e,n);else if(t==="document")i=O1(Dt(e));else if(_t(t))i=B1(t,n);else{const s=$c(e);i={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return ls(i)}function Yc(e,t){const n=Jt(e);return n===t||!_t(n)||Pn(n)?!1:Ct(n).position==="fixed"||Yc(n,t)}function F1(e,t){const n=t.get(e);if(n)return n;let i=fi(e,[],!1).filter(a=>_t(a)&&$n(a)!=="body"),s=null;const o=Ct(e).position==="fixed";let l=o?Jt(e):e;for(;_t(l)&&!Pn(l);){const a=Ct(l),r=po(l);!r&&a.position==="fixed"&&(s=null),(o?!r&&!s:!r&&a.position==="static"&&!!s&&I1.has(s.position)||ki(l)&&!r&&Yc(e,l))?i=i.filter(d=>d!==l):s=a,l=Jt(l)}return t.set(e,i),i}function j1(e){let{element:t,boundary:n,rootBoundary:i,strategy:s}=e;const l=[...n==="clippingAncestors"?Ss(t)?[]:F1(t,this._c):[].concat(n),i],a=l[0],r=l.reduce((f,d)=>{const h=ua(t,d,s);return f.top=rt(h.top,f.top),f.right=Qt(h.right,f.right),f.bottom=Qt(h.bottom,f.bottom),f.left=rt(h.left,f.left),f},ua(t,a,s));return{width:r.right-r.left,height:r.bottom-r.top,x:r.left,y:r.top}}function z1(e){const{width:t,height:n}=Wc(e);return{width:t,height:n}}function H1(e,t,n){const i=Rt(t),s=Dt(t),o=n==="fixed",l=dn(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const r=At(0);function f(){r.x=Ns(s)}if(i||!i&&!o)if(($n(t)!=="body"||ki(s))&&(a=Es(t)),i){const _=dn(t,!0,o,t);r.x=_.x+t.clientLeft,r.y=_.y+t.clientTop}else s&&f();o&&!i&&s&&f();const d=s&&!i&&!o?Uc(s,a):At(0),h=l.left+a.scrollLeft-r.x-d.x,b=l.top+a.scrollTop-r.y-d.y;return{x:h,y:b,width:l.width,height:l.height}}function fr(e){return Ct(e).position==="static"}function da(e,t){if(!Rt(e)||Ct(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Dt(e)===n&&(n=n.ownerDocument.body),n}function Zc(e,t){const n=lt(e);if(Ss(e))return n;if(!Rt(e)){let s=Jt(e);for(;s&&!Pn(s);){if(_t(s)&&!fr(s))return s;s=Jt(s)}return n}let i=da(e,t);for(;i&&C1(i)&&fr(i);)i=da(i,t);return i&&Pn(i)&&fr(i)&&!po(i)?n:i||T1(e)||n}const V1=async function(e){const t=this.getOffsetParent||Zc,n=this.getDimensions,i=await n(e.floating);return{reference:H1(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function W1(e){return Ct(e).direction==="rtl"}const $1={convertOffsetParentRelativeRectToViewportRelativeRect:D1,getDocumentElement:Dt,getClippingRect:j1,getOffsetParent:Zc,getElementRects:V1,getClientRects:L1,getDimensions:z1,getScale:kn,isElement:_t,isRTL:W1};function qc(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function U1(e,t){let n=null,i;const s=Dt(e);function o(){var a;clearTimeout(i),(a=n)==null||a.disconnect(),n=null}function l(a,r){a===void 0&&(a=!1),r===void 0&&(r=1),o();const f=e.getBoundingClientRect(),{left:d,top:h,width:b,height:_}=f;if(a||t(),!b||!_)return;const C=qi(h),S=qi(s.clientWidth-(d+b)),c=qi(s.clientHeight-(h+_)),u=qi(d),v={rootMargin:-C+"px "+-S+"px "+-c+"px "+-u+"px",threshold:rt(0,Qt(1,r))||1};let y=!0;function w(x){const E=x[0].intersectionRatio;if(E!==r){if(!y)return l();E?l(!1,E):i=setTimeout(()=>{l(!1,1e-7)},1e3)}E===1&&!qc(f,e.getBoundingClientRect())&&l(),y=!1}try{n=new IntersectionObserver(w,{...v,root:s.ownerDocument})}catch{n=new IntersectionObserver(w,v)}n.observe(e)}return l(!0),o}function Y1(e,t,n,i){i===void 0&&(i={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:r=!1}=i,f=go(e),d=s||o?[...f?fi(f):[],...fi(t)]:[];d.forEach(u=>{s&&u.addEventListener("scroll",n,{passive:!0}),o&&u.addEventListener("resize",n)});const h=f&&a?U1(f,n):null;let b=-1,_=null;l&&(_=new ResizeObserver(u=>{let[p]=u;p&&p.target===f&&_&&(_.unobserve(t),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var v;(v=_)==null||v.observe(t)})),n()}),f&&!r&&_.observe(f),_.observe(t));let C,S=r?dn(e):null;r&&c();function c(){const u=dn(e);S&&!qc(S,u)&&n(),S=u,C=requestAnimationFrame(c)}return n(),()=>{var u;d.forEach(p=>{s&&p.removeEventListener("scroll",n),o&&p.removeEventListener("resize",n)}),h==null||h(),(u=_)==null||u.disconnect(),_=null,r&&cancelAnimationFrame(C)}}const Z1=v1,q1=b1,G1=p1,K1=x1,X1=m1,fa=h1,Q1=y1,J1=(e,t,n)=>{const i=new Map,s={platform:$1,...n},o={...s.platform,_c:i};return f1(e,t,{...s,platform:o})};var ev=typeof document<"u",tv=function(){},es=ev?K.useLayoutEffect:tv;function as(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,i,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(i=n;i--!==0;)if(!as(e[i],t[i]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(i=n;i--!==0;)if(!{}.hasOwnProperty.call(t,s[i]))return!1;for(i=n;i--!==0;){const o=s[i];if(!(o==="_owner"&&e.$$typeof)&&!as(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function Gc(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ha(e,t){const n=Gc(e);return Math.round(t*n)/n}function hr(e){const t=m.useRef(e);return es(()=>{t.current=e}),t}function nv(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:i=[],platform:s,elements:{reference:o,floating:l}={},transform:a=!0,whileElementsMounted:r,open:f}=e,[d,h]=m.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[b,_]=m.useState(i);as(b,i)||_(i);const[C,S]=m.useState(null),[c,u]=m.useState(null),p=m.useCallback(F=>{F!==x.current&&(x.current=F,S(F))},[]),v=m.useCallback(F=>{F!==E.current&&(E.current=F,u(F))},[]),y=o||C,w=l||c,x=m.useRef(null),E=m.useRef(null),k=m.useRef(d),N=r!=null,T=hr(r),R=hr(s),M=hr(f),A=m.useCallback(()=>{if(!x.current||!E.current)return;const F={placement:t,strategy:n,middleware:b};R.current&&(F.platform=R.current),J1(x.current,E.current,F).then(z=>{const O={...z,isPositioned:M.current!==!1};D.current&&!as(k.current,O)&&(k.current=O,wi.flushSync(()=>{h(O)}))})},[b,t,n,R,M]);es(()=>{f===!1&&k.current.isPositioned&&(k.current.isPositioned=!1,h(F=>({...F,isPositioned:!1})))},[f]);const D=m.useRef(!1);es(()=>(D.current=!0,()=>{D.current=!1}),[]),es(()=>{if(y&&(x.current=y),w&&(E.current=w),y&&w){if(T.current)return T.current(y,w,A);A()}},[y,w,A,T,N]);const $=m.useMemo(()=>({reference:x,floating:E,setReference:p,setFloating:v}),[p,v]),H=m.useMemo(()=>({reference:y,floating:w}),[y,w]),j=m.useMemo(()=>{const F={position:n,left:0,top:0};if(!H.floating)return F;const z=ha(H.floating,d.x),O=ha(H.floating,d.y);return a?{...F,transform:"translate("+z+"px, "+O+"px)",...Gc(H.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:z,top:O}},[n,a,H.floating,d.x,d.y]);return m.useMemo(()=>({...d,update:A,refs:$,elements:H,floatingStyles:j}),[d,A,$,H,j])}const iv=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:i,padding:s}=typeof e=="function"?e(n):e;return i&&t(i)?i.current!=null?fa({element:i.current,padding:s}).fn(n):{}:i?fa({element:i,padding:s}).fn(n):{}}}},sv=(e,t)=>({...Z1(e),options:[e,t]}),rv=(e,t)=>({...q1(e),options:[e,t]}),ov=(e,t)=>({...Q1(e),options:[e,t]}),lv=(e,t)=>({...G1(e),options:[e,t]}),av=(e,t)=>({...K1(e),options:[e,t]}),cv=(e,t)=>({...X1(e),options:[e,t]}),uv=(e,t)=>({...iv(e),options:[e,t]});function dv(e){const t=fv(e),n=m.forwardRef((i,s)=>{const{children:o,...l}=i,a=m.Children.toArray(o),r=a.find(pv);if(r){const f=r.props.children,d=a.map(h=>h===r?m.Children.count(f)>1?m.Children.only(null):m.isValidElement(f)?f.props.children:null:h);return g.jsx(t,{...l,ref:s,children:m.isValidElement(f)?m.cloneElement(f,void 0,d):null})}return g.jsx(t,{...l,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}function fv(e){const t=m.forwardRef((n,i)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const l=gv(s),a=mv(o,s.props);return s.type!==m.Fragment&&(a.ref=i?je(i,l):l),m.cloneElement(s,a)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var hv=Symbol("radix.slottable");function pv(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===hv}function mv(e,t){const n={...t};for(const i in t){const s=e[i],o=t[i];/^on[A-Z]/.test(i)?s&&o?n[i]=(...a)=>{const r=o(...a);return s(...a),r}:s&&(n[i]=s):i==="style"?n[i]={...s,...o}:i==="className"&&(n[i]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function gv(e){var i,s;let t=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var vv=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],bv=vv.reduce((e,t)=>{const n=dv(`Primitive.${t}`),i=m.forwardRef((s,o)=>{const{asChild:l,...a}=s,r=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(r,{...a,ref:o})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{}),yv="Arrow",Kc=m.forwardRef((e,t)=>{const{children:n,width:i=10,height:s=5,...o}=e;return g.jsx(bv.svg,{...o,ref:t,width:i,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:g.jsx("polygon",{points:"0,0 30,0 15,10"})})});Kc.displayName=yv;var xv=Kc;function wv(e,t=[]){let n=[];function i(o,l){const a=m.createContext(l),r=n.length;n=[...n,l];const f=h=>{var u;const{scope:b,children:_,...C}=h,S=((u=b==null?void 0:b[e])==null?void 0:u[r])||a,c=m.useMemo(()=>C,Object.values(C));return g.jsx(S.Provider,{value:c,children:_})};f.displayName=o+"Provider";function d(h,b){var S;const _=((S=b==null?void 0:b[e])==null?void 0:S[r])||a,C=m.useContext(_);if(C)return C;if(l!==void 0)return l;throw new Error(`\`${h}\` must be used within \`${o}\``)}return[f,d]}const s=()=>{const o=n.map(l=>m.createContext(l));return function(a){const r=(a==null?void 0:a[e])||o;return m.useMemo(()=>({[`__scope${e}`]:{...a,[e]:r}}),[a,r])}};return s.scopeName=e,[i,_v(s,...t)]}function _v(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const i=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const l=i.reduce((a,{useScope:r,scopeName:f})=>{const h=r(o)[`__scope${f}`];return{...a,...h}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}function Cv(e){const t=Sv(e),n=m.forwardRef((i,s)=>{const{children:o,...l}=i,a=m.Children.toArray(o),r=a.find(Nv);if(r){const f=r.props.children,d=a.map(h=>h===r?m.Children.count(f)>1?m.Children.only(null):m.isValidElement(f)?f.props.children:null:h);return g.jsx(t,{...l,ref:s,children:m.isValidElement(f)?m.cloneElement(f,void 0,d):null})}return g.jsx(t,{...l,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}function Sv(e){const t=m.forwardRef((n,i)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const l=Tv(s),a=kv(o,s.props);return s.type!==m.Fragment&&(a.ref=i?je(i,l):l),m.cloneElement(s,a)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ev=Symbol("radix.slottable");function Nv(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ev}function kv(e,t){const n={...t};for(const i in t){const s=e[i],o=t[i];/^on[A-Z]/.test(i)?s&&o?n[i]=(...a)=>{const r=o(...a);return s(...a),r}:s&&(n[i]=s):i==="style"?n[i]={...s,...o}:i==="className"&&(n[i]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function Tv(e){var i,s;let t=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Mv=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Xc=Mv.reduce((e,t)=>{const n=Cv(`Primitive.${t}`),i=m.forwardRef((s,o)=>{const{asChild:l,...a}=s,r=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(r,{...a,ref:o})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{}),vo="Popper",[Qc,en]=wv(vo),[Av,Jc]=Qc(vo),eu=e=>{const{__scopePopper:t,children:n}=e,[i,s]=m.useState(null);return g.jsx(Av,{scope:t,anchor:i,onAnchorChange:s,children:n})};eu.displayName=vo;var tu="PopperAnchor",nu=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:i,...s}=e,o=Jc(tu,n),l=m.useRef(null),a=ye(t,l),r=m.useRef(null);return m.useEffect(()=>{const f=r.current;r.current=(i==null?void 0:i.current)||l.current,f!==r.current&&o.onAnchorChange(r.current)}),i?null:g.jsx(Xc.div,{...s,ref:a})});nu.displayName=tu;var bo="PopperContent",[Rv,Dv]=Qc(bo),iu=m.forwardRef((e,t)=>{var V,X,Z,G,J,ee;const{__scopePopper:n,side:i="bottom",sideOffset:s=0,align:o="center",alignOffset:l=0,arrowPadding:a=0,avoidCollisions:r=!0,collisionBoundary:f=[],collisionPadding:d=0,sticky:h="partial",hideWhenDetached:b=!1,updatePositionStrategy:_="optimized",onPlaced:C,...S}=e,c=Jc(bo,n),[u,p]=m.useState(null),v=ye(t,se=>p(se)),[y,w]=m.useState(null),x=so(y),E=(x==null?void 0:x.width)??0,k=(x==null?void 0:x.height)??0,N=i+(o!=="center"?"-"+o:""),T=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},R=Array.isArray(f)?f:[f],M=R.length>0,A={padding:T,boundary:R.filter(Ov),altBoundary:M},{refs:D,floatingStyles:$,placement:H,isPositioned:j,middlewareData:F}=nv({strategy:"fixed",placement:N,whileElementsMounted:(...se)=>Y1(...se,{animationFrame:_==="always"}),elements:{reference:c.anchor},middleware:[sv({mainAxis:s+k,alignmentAxis:l}),r&&rv({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?ov():void 0,...A}),r&&lv({...A}),av({...A,apply:({elements:se,rects:le,availableWidth:ue,availableHeight:Se})=>{const{width:Re,height:ge}=le.reference,ke=se.floating.style;ke.setProperty("--radix-popper-available-width",`${ue}px`),ke.setProperty("--radix-popper-available-height",`${Se}px`),ke.setProperty("--radix-popper-anchor-width",`${Re}px`),ke.setProperty("--radix-popper-anchor-height",`${ge}px`)}}),y&&uv({element:y,padding:a}),Pv({arrowWidth:E,arrowHeight:k}),b&&cv({strategy:"referenceHidden",...A})]}),[z,O]=ou(H),B=Ze(C);$e(()=>{j&&(B==null||B())},[j,B]);const L=(V=F.arrow)==null?void 0:V.x,U=(X=F.arrow)==null?void 0:X.y,P=((Z=F.arrow)==null?void 0:Z.centerOffset)!==0,[W,Q]=m.useState();return $e(()=>{u&&Q(window.getComputedStyle(u).zIndex)},[u]),g.jsx("div",{ref:D.setFloating,"data-radix-popper-content-wrapper":"",style:{...$,transform:j?$.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:W,"--radix-popper-transform-origin":[(G=F.transformOrigin)==null?void 0:G.x,(J=F.transformOrigin)==null?void 0:J.y].join(" "),...((ee=F.hide)==null?void 0:ee.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:g.jsx(Rv,{scope:n,placedSide:z,onArrowChange:w,arrowX:L,arrowY:U,shouldHideArrow:P,children:g.jsx(Xc.div,{"data-side":z,"data-align":O,...S,ref:v,style:{...S.style,animation:j?void 0:"none"}})})})});iu.displayName=bo;var su="PopperArrow",Lv={top:"bottom",right:"left",bottom:"top",left:"right"},ru=m.forwardRef(function(t,n){const{__scopePopper:i,...s}=t,o=Dv(su,i),l=Lv[o.placedSide];return g.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:g.jsx(xv,{...s,ref:n,style:{...s.style,display:"block"}})})});ru.displayName=su;function Ov(e){return e!==null}var Pv=e=>({name:"transformOrigin",options:e,fn(t){var c,u,p;const{placement:n,rects:i,middlewareData:s}=t,l=((c=s.arrow)==null?void 0:c.centerOffset)!==0,a=l?0:e.arrowWidth,r=l?0:e.arrowHeight,[f,d]=ou(n),h={start:"0%",center:"50%",end:"100%"}[d],b=(((u=s.arrow)==null?void 0:u.x)??0)+a/2,_=(((p=s.arrow)==null?void 0:p.y)??0)+r/2;let C="",S="";return f==="bottom"?(C=l?h:`${b}px`,S=`${-r}px`):f==="top"?(C=l?h:`${b}px`,S=`${i.floating.height+r}px`):f==="right"?(C=`${-r}px`,S=l?h:`${_}px`):f==="left"&&(C=`${i.floating.width+r}px`,S=l?h:`${_}px`),{data:{x:C,y:S}}}});function ou(e){const[t,n="center"]=e.split("-");return[t,n]}var Ti=eu,Mi=nu,ks=iu,Ts=ru;function Iv(e){const t=Bv(e),n=m.forwardRef((i,s)=>{const{children:o,...l}=i,a=m.Children.toArray(o),r=a.find(jv);if(r){const f=r.props.children,d=a.map(h=>h===r?m.Children.count(f)>1?m.Children.only(null):m.isValidElement(f)?f.props.children:null:h);return g.jsx(t,{...l,ref:s,children:m.isValidElement(f)?m.cloneElement(f,void 0,d):null})}return g.jsx(t,{...l,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}function Bv(e){const t=m.forwardRef((n,i)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const l=Hv(s),a=zv(o,s.props);return s.type!==m.Fragment&&(a.ref=i?je(i,l):l),m.cloneElement(s,a)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Fv=Symbol("radix.slottable");function jv(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Fv}function zv(e,t){const n={...t};for(const i in t){const s=e[i],o=t[i];/^on[A-Z]/.test(i)?s&&o?n[i]=(...a)=>{const r=o(...a);return s(...a),r}:s&&(n[i]=s):i==="style"?n[i]={...s,...o}:i==="className"&&(n[i]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function Hv(e){var i,s;let t=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Vv=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Wv=Vv.reduce((e,t)=>{const n=Iv(`Primitive.${t}`),i=m.forwardRef((s,o)=>{const{asChild:l,...a}=s,r=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(r,{...a,ref:o})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{}),$v="Portal",Ai=m.forwardRef((e,t)=>{var a;const{container:n,...i}=e,[s,o]=m.useState(!1);$e(()=>o(!0),[]);const l=n||s&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return l?Ja.createPortal(g.jsx(Wv.div,{...i,ref:t}),l):null});Ai.displayName=$v;function lu(e){const t=Uv(e),n=m.forwardRef((i,s)=>{const{children:o,...l}=i,a=m.Children.toArray(o),r=a.find(Zv);if(r){const f=r.props.children,d=a.map(h=>h===r?m.Children.count(f)>1?m.Children.only(null):m.isValidElement(f)?f.props.children:null:h);return g.jsx(t,{...l,ref:s,children:m.isValidElement(f)?m.cloneElement(f,void 0,d):null})}return g.jsx(t,{...l,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}function Uv(e){const t=m.forwardRef((n,i)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const l=Gv(s),a=qv(o,s.props);return s.type!==m.Fragment&&(a.ref=i?je(i,l):l),m.cloneElement(s,a)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Yv=Symbol("radix.slottable");function Zv(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Yv}function qv(e,t){const n={...t};for(const i in t){const s=e[i],o=t[i];/^on[A-Z]/.test(i)?s&&o?n[i]=(...a)=>{const r=o(...a);return s(...a),r}:s&&(n[i]=s):i==="style"?n[i]={...s,...o}:i==="className"&&(n[i]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function Gv(e){var i,s;let t=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Kv=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ct=Kv.reduce((e,t)=>{const n=lu(`Primitive.${t}`),i=m.forwardRef((s,o)=>{const{asChild:l,...a}=s,r=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(r,{...a,ref:o})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{});function Xv(e){const t=Qv(e),n=m.forwardRef((i,s)=>{const{children:o,...l}=i,a=m.Children.toArray(o),r=a.find(eb);if(r){const f=r.props.children,d=a.map(h=>h===r?m.Children.count(f)>1?m.Children.only(null):m.isValidElement(f)?f.props.children:null:h);return g.jsx(t,{...l,ref:s,children:m.isValidElement(f)?m.cloneElement(f,void 0,d):null})}return g.jsx(t,{...l,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}function Qv(e){const t=m.forwardRef((n,i)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const l=nb(s),a=tb(o,s.props);return s.type!==m.Fragment&&(a.ref=i?je(i,l):l),m.cloneElement(s,a)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Jv=Symbol("radix.slottable");function eb(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Jv}function tb(e,t){const n={...t};for(const i in t){const s=e[i],o=t[i];/^on[A-Z]/.test(i)?s&&o?n[i]=(...a)=>{const r=o(...a);return s(...a),r}:s&&(n[i]=s):i==="style"?n[i]={...s,...o}:i==="className"&&(n[i]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function nb(e){var i,s;let t=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ib=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],sb=ib.reduce((e,t)=>{const n=Xv(`Primitive.${t}`),i=m.forwardRef((s,o)=>{const{asChild:l,...a}=s,r=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(r,{...a,ref:o})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{}),au=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),rb="VisuallyHidden",cu=m.forwardRef((e,t)=>g.jsx(sb.span,{...e,ref:t,style:{...au,...e.style}}));cu.displayName=rb;var ob=cu,lb=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},vn=new WeakMap,Gi=new WeakMap,Ki={},pr=0,uu=function(e){return e&&(e.host||uu(e.parentNode))},ab=function(e,t){return t.map(function(n){if(e.contains(n))return n;var i=uu(n);return i&&e.contains(i)?i:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},cb=function(e,t,n,i){var s=ab(t,Array.isArray(e)?e:[e]);Ki[n]||(Ki[n]=new WeakMap);var o=Ki[n],l=[],a=new Set,r=new Set(s),f=function(h){!h||a.has(h)||(a.add(h),f(h.parentNode))};s.forEach(f);var d=function(h){!h||r.has(h)||Array.prototype.forEach.call(h.children,function(b){if(a.has(b))d(b);else try{var _=b.getAttribute(i),C=_!==null&&_!=="false",S=(vn.get(b)||0)+1,c=(o.get(b)||0)+1;vn.set(b,S),o.set(b,c),l.push(b),S===1&&C&&Gi.set(b,!0),c===1&&b.setAttribute(n,"true"),C||b.setAttribute(i,"true")}catch(u){console.error("aria-hidden: cannot operate on ",b,u)}})};return d(t),a.clear(),pr++,function(){l.forEach(function(h){var b=vn.get(h)-1,_=o.get(h)-1;vn.set(h,b),o.set(h,_),b||(Gi.has(h)||h.removeAttribute(i),Gi.delete(h)),_||h.removeAttribute(n)}),pr--,pr||(vn=new WeakMap,vn=new WeakMap,Gi=new WeakMap,Ki={})}},Ms=function(e,t,n){n===void 0&&(n="data-aria-hidden");var i=Array.from(Array.isArray(e)?e:[e]),s=lb(e);return s?(i.push.apply(i,Array.from(s.querySelectorAll("[aria-live], script"))),cb(i,s,n,"aria-hidden")):function(){return null}},kt=function(){return kt=Object.assign||function(t){for(var n,i=1,s=arguments.length;i<s;i++){n=arguments[i];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},kt.apply(this,arguments)};function du(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(e);s<i.length;s++)t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(n[i[s]]=e[i[s]]);return n}function ub(e,t,n){if(n||arguments.length===2)for(var i=0,s=t.length,o;i<s;i++)(o||!(i in t))&&(o||(o=Array.prototype.slice.call(t,0,i)),o[i]=t[i]);return e.concat(o||Array.prototype.slice.call(t))}var ts="right-scroll-bar-position",ns="width-before-scroll-bar",db="with-scroll-bars-hidden",fb="--removed-body-scroll-bar-size";function mr(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function hb(e,t){var n=K.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(i){var s=n.value;s!==i&&(n.value=i,n.callback(i,s))}}}})[0];return n.callback=t,n.facade}var pb=typeof window<"u"?m.useLayoutEffect:m.useEffect,pa=new WeakMap;function mb(e,t){var n=hb(null,function(i){return e.forEach(function(s){return mr(s,i)})});return pb(function(){var i=pa.get(n);if(i){var s=new Set(i),o=new Set(e),l=n.current;s.forEach(function(a){o.has(a)||mr(a,null)}),o.forEach(function(a){s.has(a)||mr(a,l)})}pa.set(n,e)},[e]),n}function gb(e){return e}function vb(e,t){t===void 0&&(t=gb);var n=[],i=!1,s={read:function(){if(i)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var l=t(o,i);return n.push(l),function(){n=n.filter(function(a){return a!==l})}},assignSyncMedium:function(o){for(i=!0;n.length;){var l=n;n=[],l.forEach(o)}n={push:function(a){return o(a)},filter:function(){return n}}},assignMedium:function(o){i=!0;var l=[];if(n.length){var a=n;n=[],a.forEach(o),l=n}var r=function(){var d=l;l=[],d.forEach(o)},f=function(){return Promise.resolve().then(r)};f(),n={push:function(d){l.push(d),f()},filter:function(d){return l=l.filter(d),n}}}};return s}function bb(e){e===void 0&&(e={});var t=vb(null);return t.options=kt({async:!0,ssr:!1},e),t}var fu=function(e){var t=e.sideCar,n=du(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var i=t.read();if(!i)throw new Error("Sidecar medium not found");return m.createElement(i,kt({},n))};fu.isSideCarExport=!0;function yb(e,t){return e.useMedium(t),fu}var hu=bb(),gr=function(){},As=m.forwardRef(function(e,t){var n=m.useRef(null),i=m.useState({onScrollCapture:gr,onWheelCapture:gr,onTouchMoveCapture:gr}),s=i[0],o=i[1],l=e.forwardProps,a=e.children,r=e.className,f=e.removeScrollBar,d=e.enabled,h=e.shards,b=e.sideCar,_=e.noRelative,C=e.noIsolation,S=e.inert,c=e.allowPinchZoom,u=e.as,p=u===void 0?"div":u,v=e.gapMode,y=du(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),w=b,x=mb([n,t]),E=kt(kt({},y),s);return m.createElement(m.Fragment,null,d&&m.createElement(w,{sideCar:hu,removeScrollBar:f,shards:h,noRelative:_,noIsolation:C,inert:S,setCallbacks:o,allowPinchZoom:!!c,lockRef:n,gapMode:v}),l?m.cloneElement(m.Children.only(a),kt(kt({},E),{ref:x})):m.createElement(p,kt({},E,{className:r,ref:x}),a))});As.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};As.classNames={fullWidth:ns,zeroRight:ts};var xb=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function wb(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=xb();return t&&e.setAttribute("nonce",t),e}function _b(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Cb(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Sb=function(){var e=0,t=null;return{add:function(n){e==0&&(t=wb())&&(_b(t,n),Cb(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Eb=function(){var e=Sb();return function(t,n){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},pu=function(){var e=Eb(),t=function(n){var i=n.styles,s=n.dynamic;return e(i,s),null};return t},Nb={left:0,top:0,right:0,gap:0},vr=function(e){return parseInt(e||"",10)||0},kb=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],i=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[vr(n),vr(i),vr(s)]},Tb=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Nb;var t=kb(e),n=document.documentElement.clientWidth,i=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,i-n+t[2]-t[0])}},Mb=pu(),Tn="data-scroll-locked",Ab=function(e,t,n,i){var s=e.left,o=e.top,l=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
182
|
+
.`.concat(db,` {
|
|
183
|
+
overflow: hidden `).concat(i,`;
|
|
184
|
+
padding-right: `).concat(a,"px ").concat(i,`;
|
|
185
185
|
}
|
|
186
|
-
body[`).concat(
|
|
187
|
-
overflow: hidden `).concat(
|
|
186
|
+
body[`).concat(Tn,`] {
|
|
187
|
+
overflow: hidden `).concat(i,`;
|
|
188
188
|
overscroll-behavior: contain;
|
|
189
|
-
`).concat([t&&"position: relative ".concat(
|
|
190
|
-
padding-left: `.concat(
|
|
191
|
-
padding-top: `).concat(
|
|
192
|
-
padding-right: `).concat(
|
|
189
|
+
`).concat([t&&"position: relative ".concat(i,";"),n==="margin"&&`
|
|
190
|
+
padding-left: `.concat(s,`px;
|
|
191
|
+
padding-top: `).concat(o,`px;
|
|
192
|
+
padding-right: `).concat(l,`px;
|
|
193
193
|
margin-left:0;
|
|
194
194
|
margin-top:0;
|
|
195
|
-
margin-right: `).concat(a,"px ").concat(
|
|
196
|
-
`),
|
|
195
|
+
margin-right: `).concat(a,"px ").concat(i,`;
|
|
196
|
+
`),n==="padding"&&"padding-right: ".concat(a,"px ").concat(i,";")].filter(Boolean).join(""),`
|
|
197
197
|
}
|
|
198
198
|
|
|
199
|
-
.`).concat(
|
|
200
|
-
right: `).concat(a,"px ").concat(
|
|
199
|
+
.`).concat(ts,` {
|
|
200
|
+
right: `).concat(a,"px ").concat(i,`;
|
|
201
201
|
}
|
|
202
202
|
|
|
203
|
-
.`).concat(
|
|
204
|
-
margin-right: `).concat(a,"px ").concat(
|
|
203
|
+
.`).concat(ns,` {
|
|
204
|
+
margin-right: `).concat(a,"px ").concat(i,`;
|
|
205
205
|
}
|
|
206
206
|
|
|
207
|
-
.`).concat(
|
|
208
|
-
right: 0 `).concat(
|
|
207
|
+
.`).concat(ts," .").concat(ts,` {
|
|
208
|
+
right: 0 `).concat(i,`;
|
|
209
209
|
}
|
|
210
210
|
|
|
211
|
-
.`).concat(
|
|
212
|
-
margin-right: 0 `).concat(
|
|
211
|
+
.`).concat(ns," .").concat(ns,` {
|
|
212
|
+
margin-right: 0 `).concat(i,`;
|
|
213
213
|
}
|
|
214
214
|
|
|
215
|
-
body[`).concat(
|
|
216
|
-
`).concat(
|
|
215
|
+
body[`).concat(Tn,`] {
|
|
216
|
+
`).concat(fb,": ").concat(a,`px;
|
|
217
217
|
}
|
|
218
|
-
`)},
|
|
218
|
+
`)},ma=function(){var e=parseInt(document.body.getAttribute(Tn)||"0",10);return isFinite(e)?e:0},Rb=function(){m.useEffect(function(){return document.body.setAttribute(Tn,(ma()+1).toString()),function(){var e=ma()-1;e<=0?document.body.removeAttribute(Tn):document.body.setAttribute(Tn,e.toString())}},[])},Db=function(e){var t=e.noRelative,n=e.noImportant,i=e.gapMode,s=i===void 0?"margin":i;Rb();var o=m.useMemo(function(){return Tb(s)},[s]);return m.createElement(Mb,{styles:Ab(o,!t,s,n?"":"!important")})},Ir=!1;if(typeof window<"u")try{var Xi=Object.defineProperty({},"passive",{get:function(){return Ir=!0,!0}});window.addEventListener("test",Xi,Xi),window.removeEventListener("test",Xi,Xi)}catch{Ir=!1}var bn=Ir?{passive:!1}:!1,Lb=function(e){return e.tagName==="TEXTAREA"},mu=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Lb(e)&&n[t]==="visible")},Ob=function(e){return mu(e,"overflowY")},Pb=function(e){return mu(e,"overflowX")},ga=function(e,t){var n=t.ownerDocument,i=t;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var s=gu(e,i);if(s){var o=vu(e,i),l=o[1],a=o[2];if(l>a)return!0}i=i.parentNode}while(i&&i!==n.body);return!1},Ib=function(e){var t=e.scrollTop,n=e.scrollHeight,i=e.clientHeight;return[t,n,i]},Bb=function(e){var t=e.scrollLeft,n=e.scrollWidth,i=e.clientWidth;return[t,n,i]},gu=function(e,t){return e==="v"?Ob(t):Pb(t)},vu=function(e,t){return e==="v"?Ib(t):Bb(t)},Fb=function(e,t){return e==="h"&&t==="rtl"?-1:1},jb=function(e,t,n,i,s){var o=Fb(e,window.getComputedStyle(t).direction),l=o*i,a=n.target,r=t.contains(a),f=!1,d=l>0,h=0,b=0;do{if(!a)break;var _=vu(e,a),C=_[0],S=_[1],c=_[2],u=S-c-o*C;(C||u)&&gu(e,a)&&(h+=u,b+=C);var p=a.parentNode;a=p&&p.nodeType===Node.DOCUMENT_FRAGMENT_NODE?p.host:p}while(!r&&a!==document.body||r&&(t.contains(a)||t===a));return(d&&Math.abs(h)<1||!d&&Math.abs(b)<1)&&(f=!0),f},Qi=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},va=function(e){return[e.deltaX,e.deltaY]},ba=function(e){return e&&"current"in e?e.current:e},zb=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Hb=function(e){return`
|
|
219
219
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
220
220
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
221
|
-
`)},cv=0,Wt=[];function uv(e){var t=l.useRef([]),r=l.useRef([0,0]),n=l.useRef(),o=l.useState(cv++)[0],s=l.useState(Al)[0],i=l.useRef(e);l.useEffect(function(){i.current=e},[e]),l.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var h=Tx([e.lockRef.current],(e.shards||[]).map(qi),!0).filter(Boolean);return h.forEach(function(y){return y.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),h.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=l.useCallback(function(h,y){if("touches"in h&&h.touches.length===2||h.type==="wheel"&&h.ctrlKey)return!i.current.allowPinchZoom;var v=qr(h),b=r.current,S="deltaX"in h?h.deltaX:b[0]-v[0],C="deltaY"in h?h.deltaY:b[1]-v[1],N,_=h.target,j=Math.abs(S)>Math.abs(C)?"h":"v";if("touches"in h&&j==="h"&&_.type==="range")return!1;var $=window.getSelection(),D=$&&$.anchorNode,O=D?D===_||D.contains(_):!1;if(O)return!1;var P=Ki(j,_);if(!P)return!0;if(P?N=j:(N=j==="v"?"h":"v",P=Ki(j,_)),!P)return!1;if(!n.current&&"changedTouches"in h&&(S||C)&&(n.current=N),!N)return!0;var A=n.current||N;return iv(A,y,h,A==="h"?S:C)},[]),u=l.useCallback(function(h){var y=h;if(!(!Wt.length||Wt[Wt.length-1]!==s)){var v="deltaY"in y?Yi(y):qr(y),b=t.current.filter(function(N){return N.name===y.type&&(N.target===y.target||y.target===N.shadowParent)&&av(N.delta,v)})[0];if(b&&b.should){y.cancelable&&y.preventDefault();return}if(!b){var S=(i.current.shards||[]).map(qi).filter(Boolean).filter(function(N){return N.contains(y.target)}),C=S.length>0?a(y,S[0]):!i.current.noIsolation;C&&y.cancelable&&y.preventDefault()}}},[]),d=l.useCallback(function(h,y,v,b){var S={name:h,delta:y,target:v,should:b,shadowParent:dv(v)};t.current.push(S),setTimeout(function(){t.current=t.current.filter(function(C){return C!==S})},1)},[]),p=l.useCallback(function(h){r.current=qr(h),n.current=void 0},[]),f=l.useCallback(function(h){d(h.type,Yi(h),h.target,a(h,e.lockRef.current))},[]),m=l.useCallback(function(h){d(h.type,qr(h),h.target,a(h,e.lockRef.current))},[]);l.useEffect(function(){return Wt.push(s),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:m}),document.addEventListener("wheel",u,Bt),document.addEventListener("touchmove",u,Bt),document.addEventListener("touchstart",p,Bt),function(){Wt=Wt.filter(function(h){return h!==s}),document.removeEventListener("wheel",u,Bt),document.removeEventListener("touchmove",u,Bt),document.removeEventListener("touchstart",p,Bt)}},[]);var g=e.removeScrollBar,x=e.inert;return l.createElement(l.Fragment,null,x?l.createElement(s,{styles:lv(o)}):null,g?l.createElement(Jx,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function dv(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const fv=Vx(Pl,uv);var _n=l.forwardRef(function(e,t){return l.createElement(Rn,it({},e,{ref:t,sideCar:fv}))});_n.classNames=Rn.classNames;var pv=[" ","Enter","ArrowUp","ArrowDown"],mv=[" ","Enter"],It="Select",[Pn,An,hv]=Ko(It),[cr]=Vm(It,[hv,lr]),Tn=lr(),[gv,Rt]=cr(It),[xv,vv]=cr(It),Dl=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:o,onOpenChange:s,value:i,defaultValue:a,onValueChange:u,dir:d,name:p,autoComplete:f,disabled:m,required:g,form:x}=e,h=Tn(t),[y,v]=l.useState(null),[b,S]=l.useState(null),[C,N]=l.useState(!1),_=kr(d),[j,$]=ct({prop:n,defaultProp:o??!1,onChange:s,caller:It}),[D,O]=ct({prop:i,defaultProp:a,onChange:u,caller:It}),P=l.useRef(null),A=y?x||!!y.closest("form"):!0,[M,z]=l.useState(new Set),q=Array.from(M).map(H=>H.props.value).join(";");return c.jsx(En,{...h,children:c.jsxs(gv,{required:g,scope:t,trigger:y,onTriggerChange:v,valueNode:b,onValueNodeChange:S,valueNodeHasChildren:C,onValueNodeHasChildrenChange:N,contentId:Ue(),value:D,onValueChange:O,open:j,onOpenChange:$,dir:_,triggerPointerDownPosRef:P,disabled:m,children:[c.jsx(Pn.Provider,{scope:t,children:c.jsx(xv,{scope:e.__scopeSelect,onNativeOptionAdd:l.useCallback(H=>{z(k=>new Set(k).add(H))},[]),onNativeOptionRemove:l.useCallback(H=>{z(k=>{const W=new Set(k);return W.delete(H),W})},[]),children:r})}),A?c.jsxs(sc,{"aria-hidden":!0,required:g,tabIndex:-1,name:p,autoComplete:f,value:D,onChange:H=>O(H.target.value),disabled:m,form:x,children:[D===void 0?c.jsx("option",{value:""}):null,Array.from(M)]},q):null]})})};Dl.displayName=It;var Il="SelectTrigger",Ol=l.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...o}=e,s=Tn(r),i=Rt(Il,r),a=i.disabled||n,u=ie(t,i.onTriggerChange),d=An(r),p=l.useRef("touch"),[f,m,g]=ac(h=>{const y=d().filter(S=>!S.disabled),v=y.find(S=>S.value===i.value),b=lc(y,h,v);b!==void 0&&i.onValueChange(b.value)}),x=h=>{a||(i.onOpenChange(!0),g()),h&&(i.triggerPointerDownPosRef.current={x:Math.round(h.pageX),y:Math.round(h.pageY)})};return c.jsx(ns,{asChild:!0,...s,children:c.jsx(Ge.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":ic(i.value)?"":void 0,...o,ref:u,onClick:G(o.onClick,h=>{h.currentTarget.focus(),p.current!=="mouse"&&x(h)}),onPointerDown:G(o.onPointerDown,h=>{p.current=h.pointerType;const y=h.target;y.hasPointerCapture(h.pointerId)&&y.releasePointerCapture(h.pointerId),h.button===0&&h.ctrlKey===!1&&h.pointerType==="mouse"&&(x(h),h.preventDefault())}),onKeyDown:G(o.onKeyDown,h=>{const y=f.current!=="";!(h.ctrlKey||h.altKey||h.metaKey)&&h.key.length===1&&m(h.key),!(y&&h.key===" ")&&pv.includes(h.key)&&(x(),h.preventDefault())})})})});Ol.displayName=Il;var $l="SelectValue",Ll=l.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,children:s,placeholder:i="",...a}=e,u=Rt($l,r),{onValueNodeHasChildrenChange:d}=u,p=s!==void 0,f=ie(t,u.onValueNodeChange);return Ne(()=>{d(p)},[d,p]),c.jsx(Ge.span,{...a,ref:f,style:{pointerEvents:"none"},children:ic(u.value)?c.jsx(c.Fragment,{children:i}):s})});Ll.displayName=$l;var yv="SelectIcon",Fl=l.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...o}=e;return c.jsx(Ge.span,{"aria-hidden":!0,...o,ref:t,children:n||"▼"})});Fl.displayName=yv;var bv="SelectPortal",Vl=e=>c.jsx(jn,{asChild:!0,...e});Vl.displayName=bv;var Ot="SelectContent",Bl=l.forwardRef((e,t)=>{const r=Rt(Ot,e.__scopeSelect),[n,o]=l.useState();if(Ne(()=>{o(new DocumentFragment)},[]),!r.open){const s=n;return s?Ar.createPortal(c.jsx(Wl,{scope:e.__scopeSelect,children:c.jsx(Pn.Slot,{scope:e.__scopeSelect,children:c.jsx("div",{children:e.children})})}),s):null}return c.jsx(Hl,{...e,ref:t})});Bl.displayName=Ot;var Ze=10,[Wl,_t]=cr(Ot),wv="SelectContentImpl",Sv=Cl("SelectContent.RemoveScroll"),Hl=l.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:i,side:a,sideOffset:u,align:d,alignOffset:p,arrowPadding:f,collisionBoundary:m,collisionPadding:g,sticky:x,hideWhenDetached:h,avoidCollisions:y,...v}=e,b=Rt(Ot,r),[S,C]=l.useState(null),[N,_]=l.useState(null),j=ie(t,I=>C(I)),[$,D]=l.useState(null),[O,P]=l.useState(null),A=An(r),[M,z]=l.useState(!1),q=l.useRef(!1);l.useEffect(()=>{if(S)return is(S)},[S]),Yo();const H=l.useCallback(I=>{const[Z,...X]=A().map(U=>U.ref.current),[ne]=X.slice(-1),J=document.activeElement;for(const U of I)if(U===J||(U==null||U.scrollIntoView({block:"nearest"}),U===Z&&N&&(N.scrollTop=0),U===ne&&N&&(N.scrollTop=N.scrollHeight),U==null||U.focus(),document.activeElement!==J))return},[A,N]),k=l.useCallback(()=>H([$,S]),[H,$,S]);l.useEffect(()=>{M&&k()},[M,k]);const{onOpenChange:W,triggerPointerDownPosRef:L}=b;l.useEffect(()=>{if(S){let I={x:0,y:0};const Z=ne=>{var J,U;I={x:Math.abs(Math.round(ne.pageX)-(((J=L.current)==null?void 0:J.x)??0)),y:Math.abs(Math.round(ne.pageY)-(((U=L.current)==null?void 0:U.y)??0))}},X=ne=>{I.x<=10&&I.y<=10?ne.preventDefault():S.contains(ne.target)||W(!1),document.removeEventListener("pointermove",Z),L.current=null};return L.current!==null&&(document.addEventListener("pointermove",Z),document.addEventListener("pointerup",X,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Z),document.removeEventListener("pointerup",X,{capture:!0})}}},[S,W,L]),l.useEffect(()=>{const I=()=>W(!1);return window.addEventListener("blur",I),window.addEventListener("resize",I),()=>{window.removeEventListener("blur",I),window.removeEventListener("resize",I)}},[W]);const[re,F]=ac(I=>{const Z=A().filter(J=>!J.disabled),X=Z.find(J=>J.ref.current===document.activeElement),ne=lc(Z,I,X);ne&&setTimeout(()=>ne.ref.current.focus())}),te=l.useCallback((I,Z,X)=>{const ne=!q.current&&!X;(b.value!==void 0&&b.value===Z||ne)&&(D(I),ne&&(q.current=!0))},[b.value]),ce=l.useCallback(()=>S==null?void 0:S.focus(),[S]),de=l.useCallback((I,Z,X)=>{const ne=!q.current&&!X;(b.value!==void 0&&b.value===Z||ne)&&P(I)},[b.value]),ge=n==="popper"?Eo:Ul,me=ge===Eo?{side:a,sideOffset:u,align:d,alignOffset:p,arrowPadding:f,collisionBoundary:m,collisionPadding:g,sticky:x,hideWhenDetached:h,avoidCollisions:y}:{};return c.jsx(Wl,{scope:r,content:S,viewport:N,onViewportChange:_,itemRefCallback:te,selectedItem:$,onItemLeave:ce,itemTextRefCallback:de,focusSelectedItem:k,selectedItemText:O,position:n,isPositioned:M,searchRef:re,children:c.jsx(_n,{as:Sv,allowPinchZoom:!0,children:c.jsx(bn,{asChild:!0,trapped:b.open,onMountAutoFocus:I=>{I.preventDefault()},onUnmountAutoFocus:G(o,I=>{var Z;(Z=b.trigger)==null||Z.focus({preventScroll:!0}),I.preventDefault()}),children:c.jsx(Dr,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:I=>I.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:c.jsx(ge,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:I=>I.preventDefault(),...v,...me,onPlaced:()=>z(!0),ref:j,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:G(v.onKeyDown,I=>{const Z=I.ctrlKey||I.altKey||I.metaKey;if(I.key==="Tab"&&I.preventDefault(),!Z&&I.key.length===1&&F(I.key),["ArrowUp","ArrowDown","Home","End"].includes(I.key)){let ne=A().filter(J=>!J.disabled).map(J=>J.ref.current);if(["ArrowUp","End"].includes(I.key)&&(ne=ne.slice().reverse()),["ArrowUp","ArrowDown"].includes(I.key)){const J=I.target,U=ne.indexOf(J);ne=ne.slice(U+1)}setTimeout(()=>H(ne)),I.preventDefault()}})})})})})})});Hl.displayName=wv;var Cv="SelectItemAlignedPosition",Ul=l.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...o}=e,s=Rt(Ot,r),i=_t(Ot,r),[a,u]=l.useState(null),[d,p]=l.useState(null),f=ie(t,j=>p(j)),m=An(r),g=l.useRef(!1),x=l.useRef(!0),{viewport:h,selectedItem:y,selectedItemText:v,focusSelectedItem:b}=i,S=l.useCallback(()=>{if(s.trigger&&s.valueNode&&a&&d&&h&&y&&v){const j=s.trigger.getBoundingClientRect(),$=d.getBoundingClientRect(),D=s.valueNode.getBoundingClientRect(),O=v.getBoundingClientRect();if(s.dir!=="rtl"){const J=O.left-$.left,U=D.left-J,ee=j.left-U,ye=j.width+ee,xe=Math.max(ye,$.width),ke=window.innerWidth-Ze,De=yo(U,[Ze,Math.max(Ze,ke-xe)]);a.style.minWidth=ye+"px",a.style.left=De+"px"}else{const J=$.right-O.right,U=window.innerWidth-D.right-J,ee=window.innerWidth-j.right-U,ye=j.width+ee,xe=Math.max(ye,$.width),ke=window.innerWidth-Ze,De=yo(U,[Ze,Math.max(Ze,ke-xe)]);a.style.minWidth=ye+"px",a.style.right=De+"px"}const P=m(),A=window.innerHeight-Ze*2,M=h.scrollHeight,z=window.getComputedStyle(d),q=parseInt(z.borderTopWidth,10),H=parseInt(z.paddingTop,10),k=parseInt(z.borderBottomWidth,10),W=parseInt(z.paddingBottom,10),L=q+H+M+W+k,re=Math.min(y.offsetHeight*5,L),F=window.getComputedStyle(h),te=parseInt(F.paddingTop,10),ce=parseInt(F.paddingBottom,10),de=j.top+j.height/2-Ze,ge=A-de,me=y.offsetHeight/2,I=y.offsetTop+me,Z=q+H+I,X=L-Z;if(Z<=de){const J=P.length>0&&y===P[P.length-1].ref.current;a.style.bottom="0px";const U=d.clientHeight-h.offsetTop-h.offsetHeight,ee=Math.max(ge,me+(J?ce:0)+U+k),ye=Z+ee;a.style.height=ye+"px"}else{const J=P.length>0&&y===P[0].ref.current;a.style.top="0px";const ee=Math.max(de,q+h.offsetTop+(J?te:0)+me)+X;a.style.height=ee+"px",h.scrollTop=Z-de+h.offsetTop}a.style.margin=`${Ze}px 0`,a.style.minHeight=re+"px",a.style.maxHeight=A+"px",n==null||n(),requestAnimationFrame(()=>g.current=!0)}},[m,s.trigger,s.valueNode,a,d,h,y,v,s.dir,n]);Ne(()=>S(),[S]);const[C,N]=l.useState();Ne(()=>{d&&N(window.getComputedStyle(d).zIndex)},[d]);const _=l.useCallback(j=>{j&&x.current===!0&&(S(),b==null||b(),x.current=!1)},[S,b]);return c.jsx(Ev,{scope:r,contentWrapper:a,shouldExpandOnScrollRef:g,onScrollButtonChange:_,children:c.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:c.jsx(Ge.div,{...o,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Ul.displayName=Cv;var Nv="SelectPopperPosition",Eo=l.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:o=Ze,...s}=e,i=Tn(r);return c.jsx(os,{...i,...s,ref:t,align:n,collisionPadding:o,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Eo.displayName=Nv;var[Ev,as]=cr(Ot,{}),jo="SelectViewport",zl=l.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...o}=e,s=_t(jo,r),i=as(jo,r),a=ie(t,s.onViewportChange),u=l.useRef(0);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),c.jsx(Pn.Slot,{scope:r,children:c.jsx(Ge.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:G(o.onScroll,d=>{const p=d.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:m}=i;if(m!=null&&m.current&&f){const g=Math.abs(u.current-p.scrollTop);if(g>0){const x=window.innerHeight-Ze*2,h=parseFloat(f.style.minHeight),y=parseFloat(f.style.height),v=Math.max(h,y);if(v<x){const b=v+g,S=Math.min(x,b),C=b-S;f.style.height=S+"px",f.style.bottom==="0px"&&(p.scrollTop=C>0?C:0,f.style.justifyContent="flex-end")}}}u.current=p.scrollTop})})})]})});zl.displayName=jo;var Gl="SelectGroup",[jv,Rv]=cr(Gl),Kl=l.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Ue();return c.jsx(jv,{scope:r,id:o,children:c.jsx(Ge.div,{role:"group","aria-labelledby":o,...n,ref:t})})});Kl.displayName=Gl;var Yl="SelectLabel",ql=l.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Rv(Yl,r);return c.jsx(Ge.div,{id:o.id,...n,ref:t})});ql.displayName=Yl;var sn="SelectItem",[_v,Xl]=cr(sn),Ql=l.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:o=!1,textValue:s,...i}=e,a=Rt(sn,r),u=_t(sn,r),d=a.value===n,[p,f]=l.useState(s??""),[m,g]=l.useState(!1),x=ie(t,b=>{var S;return(S=u.itemRefCallback)==null?void 0:S.call(u,b,n,o)}),h=Ue(),y=l.useRef("touch"),v=()=>{o||(a.onValueChange(n),a.onOpenChange(!1))};if(n==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return c.jsx(_v,{scope:r,value:n,disabled:o,textId:h,isSelected:d,onItemTextChange:l.useCallback(b=>{f(S=>S||((b==null?void 0:b.textContent)??"").trim())},[]),children:c.jsx(Pn.ItemSlot,{scope:r,value:n,disabled:o,textValue:p,children:c.jsx(Ge.div,{role:"option","aria-labelledby":h,"data-highlighted":m?"":void 0,"aria-selected":d&&m,"data-state":d?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...i,ref:x,onFocus:G(i.onFocus,()=>g(!0)),onBlur:G(i.onBlur,()=>g(!1)),onClick:G(i.onClick,()=>{y.current!=="mouse"&&v()}),onPointerUp:G(i.onPointerUp,()=>{y.current==="mouse"&&v()}),onPointerDown:G(i.onPointerDown,b=>{y.current=b.pointerType}),onPointerMove:G(i.onPointerMove,b=>{var S;y.current=b.pointerType,o?(S=u.onItemLeave)==null||S.call(u):y.current==="mouse"&&b.currentTarget.focus({preventScroll:!0})}),onPointerLeave:G(i.onPointerLeave,b=>{var S;b.currentTarget===document.activeElement&&((S=u.onItemLeave)==null||S.call(u))}),onKeyDown:G(i.onKeyDown,b=>{var C;((C=u.searchRef)==null?void 0:C.current)!==""&&b.key===" "||(mv.includes(b.key)&&v(),b.key===" "&&b.preventDefault())})})})})});Ql.displayName=sn;var gr="SelectItemText",Zl=l.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,...s}=e,i=Rt(gr,r),a=_t(gr,r),u=Xl(gr,r),d=vv(gr,r),[p,f]=l.useState(null),m=ie(t,v=>f(v),u.onItemTextChange,v=>{var b;return(b=a.itemTextRefCallback)==null?void 0:b.call(a,v,u.value,u.disabled)}),g=p==null?void 0:p.textContent,x=l.useMemo(()=>c.jsx("option",{value:u.value,disabled:u.disabled,children:g},u.value),[u.disabled,u.value,g]),{onNativeOptionAdd:h,onNativeOptionRemove:y}=d;return Ne(()=>(h(x),()=>y(x)),[h,y,x]),c.jsxs(c.Fragment,{children:[c.jsx(Ge.span,{id:u.textId,...s,ref:m}),u.isSelected&&i.valueNode&&!i.valueNodeHasChildren?Ar.createPortal(s.children,i.valueNode):null]})});Zl.displayName=gr;var Jl="SelectItemIndicator",ec=l.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return Xl(Jl,r).isSelected?c.jsx(Ge.span,{"aria-hidden":!0,...n,ref:t}):null});ec.displayName=Jl;var Ro="SelectScrollUpButton",tc=l.forwardRef((e,t)=>{const r=_t(Ro,e.__scopeSelect),n=as(Ro,e.__scopeSelect),[o,s]=l.useState(!1),i=ie(t,n.onScrollButtonChange);return Ne(()=>{if(r.viewport&&r.isPositioned){let a=function(){const d=u.scrollTop>0;s(d)};const u=r.viewport;return a(),u.addEventListener("scroll",a),()=>u.removeEventListener("scroll",a)}},[r.viewport,r.isPositioned]),o?c.jsx(nc,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:u}=r;a&&u&&(a.scrollTop=a.scrollTop-u.offsetHeight)}}):null});tc.displayName=Ro;var _o="SelectScrollDownButton",rc=l.forwardRef((e,t)=>{const r=_t(_o,e.__scopeSelect),n=as(_o,e.__scopeSelect),[o,s]=l.useState(!1),i=ie(t,n.onScrollButtonChange);return Ne(()=>{if(r.viewport&&r.isPositioned){let a=function(){const d=u.scrollHeight-u.clientHeight,p=Math.ceil(u.scrollTop)<d;s(p)};const u=r.viewport;return a(),u.addEventListener("scroll",a),()=>u.removeEventListener("scroll",a)}},[r.viewport,r.isPositioned]),o?c.jsx(nc,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:u}=r;a&&u&&(a.scrollTop=a.scrollTop+u.offsetHeight)}}):null});rc.displayName=_o;var nc=l.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...o}=e,s=_t("SelectScrollButton",r),i=l.useRef(null),a=An(r),u=l.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return l.useEffect(()=>()=>u(),[u]),Ne(()=>{var p;const d=a().find(f=>f.ref.current===document.activeElement);(p=d==null?void 0:d.ref.current)==null||p.scrollIntoView({block:"nearest"})},[a]),c.jsx(Ge.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:G(o.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(n,50))}),onPointerMove:G(o.onPointerMove,()=>{var d;(d=s.onItemLeave)==null||d.call(s),i.current===null&&(i.current=window.setInterval(n,50))}),onPointerLeave:G(o.onPointerLeave,()=>{u()})})}),Pv="SelectSeparator",oc=l.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return c.jsx(Ge.div,{"aria-hidden":!0,...n,ref:t})});oc.displayName=Pv;var Po="SelectArrow",Av=l.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Tn(r),s=Rt(Po,r),i=_t(Po,r);return s.open&&i.position==="popper"?c.jsx(ss,{...o,...n,ref:t}):null});Av.displayName=Po;var Tv="SelectBubbleInput",sc=l.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const o=l.useRef(null),s=ie(n,o),i=Bo(t);return l.useEffect(()=>{const a=o.current;if(!a)return;const u=window.HTMLSelectElement.prototype,p=Object.getOwnPropertyDescriptor(u,"value").set;if(i!==t&&p){const f=new Event("change",{bubbles:!0});p.call(a,t),a.dispatchEvent(f)}},[i,t]),c.jsx(Ge.select,{...r,style:{...Nl,...r.style},ref:s,defaultValue:t})});sc.displayName=Tv;function ic(e){return e===""||e===void 0}function ac(e){const t=je(e),r=l.useRef(""),n=l.useRef(0),o=l.useCallback(i=>{const a=r.current+i;t(a),function u(d){r.current=d,window.clearTimeout(n.current),d!==""&&(n.current=window.setTimeout(()=>u(""),1e3))}(a)},[t]),s=l.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return l.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,o,s]}function lc(e,t,r){const o=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,s=r?e.indexOf(r):-1;let i=Mv(e,Math.max(s,0));o.length===1&&(i=i.filter(d=>d!==r));const u=i.find(d=>d.textValue.toLowerCase().startsWith(o.toLowerCase()));return u!==r?u:void 0}function Mv(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var kv=Dl,cc=Ol,Dv=Ll,Iv=Fl,Ov=Vl,uc=Bl,$v=zl,Lv=Kl,dc=ql,fc=Ql,Fv=Zl,Vv=ec,pc=tc,mc=rc,hc=oc;const ls=kv,Bv=Lv,cs=Dv,Mn=l.forwardRef(({className:e,children:t,...r},n)=>c.jsxs(cc,{ref:n,className:T("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[t,c.jsx(Iv,{asChild:!0,children:c.jsx(gn,{className:"h-4 w-4 opacity-50"})})]}));Mn.displayName=cc.displayName;const us=l.forwardRef(({className:e,...t},r)=>c.jsx(pc,{ref:r,className:T("flex cursor-default items-center justify-center py-1",e),...t,children:c.jsx(Dp,{className:"h-4 w-4"})}));us.displayName=pc.displayName;const ds=l.forwardRef(({className:e,...t},r)=>c.jsx(mc,{ref:r,className:T("flex cursor-default items-center justify-center py-1",e),...t,children:c.jsx(gn,{className:"h-4 w-4"})}));ds.displayName=mc.displayName;const kn=l.forwardRef(({className:e,children:t,position:r="popper",...n},o)=>c.jsx(Ov,{children:c.jsxs(uc,{ref:o,className:T("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...n,children:[c.jsx(us,{}),c.jsx($v,{className:T("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),c.jsx(ds,{})]})}));kn.displayName=uc.displayName;const gc=l.forwardRef(({className:e,...t},r)=>c.jsx(dc,{ref:r,className:T("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));gc.displayName=dc.displayName;const Dn=l.forwardRef(({className:e,children:t,...r},n)=>c.jsxs(fc,{ref:n,className:T("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[c.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:c.jsx(Vv,{children:c.jsx(wr,{className:"h-4 w-4"})})}),c.jsx(Fv,{children:t})]}));Dn.displayName=fc.displayName;const xc=l.forwardRef(({className:e,...t},r)=>c.jsx(hc,{ref:r,className:T("-mx-1 my-1 h-px bg-muted",e),...t}));xc.displayName=hc.displayName;function Wv(e,t){const r=l.createContext(t),n=s=>{const{children:i,...a}=s,u=l.useMemo(()=>a,Object.values(a));return c.jsx(r.Provider,{value:u,children:i})};n.displayName=e+"Provider";function o(s){const i=l.useContext(r);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[n,o]}function Hv(e,t=[]){let r=[];function n(s,i){const a=l.createContext(i),u=r.length;r=[...r,i];const d=f=>{var v;const{scope:m,children:g,...x}=f,h=((v=m==null?void 0:m[e])==null?void 0:v[u])||a,y=l.useMemo(()=>x,Object.values(x));return c.jsx(h.Provider,{value:y,children:g})};d.displayName=s+"Provider";function p(f,m){var h;const g=((h=m==null?void 0:m[e])==null?void 0:h[u])||a,x=l.useContext(g);if(x)return x;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[d,p]}const o=()=>{const s=r.map(i=>l.createContext(i));return function(a){const u=(a==null?void 0:a[e])||s;return l.useMemo(()=>({[`__scope${e}`]:{...a,[e]:u}}),[a,u])}};return o.scopeName=e,[n,Uv(o,...t)]}function Uv(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=n.reduce((a,{useScope:u,scopeName:d})=>{const f=u(s)[`__scope${d}`];return{...a,...f}},{});return l.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}function vc(e){const t=zv(e),r=l.forwardRef((n,o)=>{const{children:s,...i}=n,a=l.Children.toArray(s),u=a.find(Kv);if(u){const d=u.props.children,p=a.map(f=>f===u?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return c.jsx(t,{...i,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return c.jsx(t,{...i,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}function zv(e){const t=l.forwardRef((r,n)=>{const{children:o,...s}=r;if(l.isValidElement(o)){const i=qv(o),a=Yv(s,o.props);return o.type!==l.Fragment&&(a.ref=n?we(n,i):i),l.cloneElement(o,a)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Gv=Symbol("radix.slottable");function Kv(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Gv}function Yv(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...a)=>{const u=s(...a);return o(...a),u}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function qv(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Xv=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Or=Xv.reduce((e,t)=>{const r=vc(`Primitive.${t}`),n=l.forwardRef((o,s)=>{const{asChild:i,...a}=o,u=i?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(u,{...a,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),In="Dialog",[yc]=Hv(In),[Qv,nt]=yc(In),bc=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:o,onOpenChange:s,modal:i=!0}=e,a=l.useRef(null),u=l.useRef(null),[d,p]=ct({prop:n,defaultProp:o??!1,onChange:s,caller:In});return c.jsx(Qv,{scope:t,triggerRef:a,contentRef:u,contentId:Ue(),titleId:Ue(),descriptionId:Ue(),open:d,onOpenChange:p,onOpenToggle:l.useCallback(()=>p(f=>!f),[p]),modal:i,children:r})};bc.displayName=In;var wc="DialogTrigger",Sc=l.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=nt(wc,r),s=ie(t,o.triggerRef);return c.jsx(Or.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":ms(o.open),...n,ref:s,onClick:G(e.onClick,o.onOpenToggle)})});Sc.displayName=wc;var fs="DialogPortal",[Zv,Cc]=yc(fs,{forceMount:void 0}),Nc=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:o}=e,s=nt(fs,t);return c.jsx(Zv,{scope:t,forceMount:r,children:l.Children.map(n,i=>c.jsx($e,{present:r||s.open,children:c.jsx(jn,{asChild:!0,container:o,children:i})}))})};Nc.displayName=fs;var an="DialogOverlay",Ec=l.forwardRef((e,t)=>{const r=Cc(an,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,s=nt(an,e.__scopeDialog);return s.modal?c.jsx($e,{present:n||s.open,children:c.jsx(ey,{...o,ref:t})}):null});Ec.displayName=an;var Jv=vc("DialogOverlay.RemoveScroll"),ey=l.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=nt(an,r);return c.jsx(_n,{as:Jv,allowPinchZoom:!0,shards:[o.contentRef],children:c.jsx(Or.div,{"data-state":ms(o.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),$t="DialogContent",jc=l.forwardRef((e,t)=>{const r=Cc($t,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,s=nt($t,e.__scopeDialog);return c.jsx($e,{present:n||s.open,children:s.modal?c.jsx(ty,{...o,ref:t}):c.jsx(ry,{...o,ref:t})})});jc.displayName=$t;var ty=l.forwardRef((e,t)=>{const r=nt($t,e.__scopeDialog),n=l.useRef(null),o=ie(t,r.contentRef,n);return l.useEffect(()=>{const s=n.current;if(s)return is(s)},[]),c.jsx(Rc,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:G(e.onCloseAutoFocus,s=>{var i;s.preventDefault(),(i=r.triggerRef.current)==null||i.focus()}),onPointerDownOutside:G(e.onPointerDownOutside,s=>{const i=s.detail.originalEvent,a=i.button===0&&i.ctrlKey===!0;(i.button===2||a)&&s.preventDefault()}),onFocusOutside:G(e.onFocusOutside,s=>s.preventDefault())})}),ry=l.forwardRef((e,t)=>{const r=nt($t,e.__scopeDialog),n=l.useRef(!1),o=l.useRef(!1);return c.jsx(Rc,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var i,a;(i=e.onCloseAutoFocus)==null||i.call(e,s),s.defaultPrevented||(n.current||(a=r.triggerRef.current)==null||a.focus(),s.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:s=>{var u,d;(u=e.onInteractOutside)==null||u.call(e,s),s.defaultPrevented||(n.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;((d=r.triggerRef.current)==null?void 0:d.contains(i))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),Rc=l.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:s,...i}=e,a=nt($t,r),u=l.useRef(null),d=ie(t,u);return Yo(),c.jsxs(c.Fragment,{children:[c.jsx(bn,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:s,children:c.jsx(Dr,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":ms(a.open),...i,ref:d,onDismiss:()=>a.onOpenChange(!1)})}),c.jsxs(c.Fragment,{children:[c.jsx(ny,{titleId:a.titleId}),c.jsx(sy,{contentRef:u,descriptionId:a.descriptionId})]})]})}),ps="DialogTitle",_c=l.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=nt(ps,r);return c.jsx(Or.h2,{id:o.titleId,...n,ref:t})});_c.displayName=ps;var Pc="DialogDescription",Ac=l.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=nt(Pc,r);return c.jsx(Or.p,{id:o.descriptionId,...n,ref:t})});Ac.displayName=Pc;var Tc="DialogClose",Mc=l.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=nt(Tc,r);return c.jsx(Or.button,{type:"button",...n,ref:t,onClick:G(e.onClick,()=>o.onOpenChange(!1))})});Mc.displayName=Tc;function ms(e){return e?"open":"closed"}var kc="DialogTitleWarning",[uC,Dc]=Wv(kc,{contentName:$t,titleName:ps,docsSlug:"dialog"}),ny=({titleId:e})=>{const t=Dc(kc),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
221
|
+
`)},Vb=0,yn=[];function Wb(e){var t=m.useRef([]),n=m.useRef([0,0]),i=m.useRef(),s=m.useState(Vb++)[0],o=m.useState(pu)[0],l=m.useRef(e);m.useEffect(function(){l.current=e},[e]),m.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var S=ub([e.lockRef.current],(e.shards||[]).map(ba),!0).filter(Boolean);return S.forEach(function(c){return c.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),S.forEach(function(c){return c.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var a=m.useCallback(function(S,c){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!l.current.allowPinchZoom;var u=Qi(S),p=n.current,v="deltaX"in S?S.deltaX:p[0]-u[0],y="deltaY"in S?S.deltaY:p[1]-u[1],w,x=S.target,E=Math.abs(v)>Math.abs(y)?"h":"v";if("touches"in S&&E==="h"&&x.type==="range")return!1;var k=window.getSelection(),N=k&&k.anchorNode,T=N?N===x||N.contains(x):!1;if(T)return!1;var R=ga(E,x);if(!R)return!0;if(R?w=E:(w=E==="v"?"h":"v",R=ga(E,x)),!R)return!1;if(!i.current&&"changedTouches"in S&&(v||y)&&(i.current=w),!w)return!0;var M=i.current||w;return jb(M,c,S,M==="h"?v:y)},[]),r=m.useCallback(function(S){var c=S;if(!(!yn.length||yn[yn.length-1]!==o)){var u="deltaY"in c?va(c):Qi(c),p=t.current.filter(function(w){return w.name===c.type&&(w.target===c.target||c.target===w.shadowParent)&&zb(w.delta,u)})[0];if(p&&p.should){c.cancelable&&c.preventDefault();return}if(!p){var v=(l.current.shards||[]).map(ba).filter(Boolean).filter(function(w){return w.contains(c.target)}),y=v.length>0?a(c,v[0]):!l.current.noIsolation;y&&c.cancelable&&c.preventDefault()}}},[]),f=m.useCallback(function(S,c,u,p){var v={name:S,delta:c,target:u,should:p,shadowParent:$b(u)};t.current.push(v),setTimeout(function(){t.current=t.current.filter(function(y){return y!==v})},1)},[]),d=m.useCallback(function(S){n.current=Qi(S),i.current=void 0},[]),h=m.useCallback(function(S){f(S.type,va(S),S.target,a(S,e.lockRef.current))},[]),b=m.useCallback(function(S){f(S.type,Qi(S),S.target,a(S,e.lockRef.current))},[]);m.useEffect(function(){return yn.push(o),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:b}),document.addEventListener("wheel",r,bn),document.addEventListener("touchmove",r,bn),document.addEventListener("touchstart",d,bn),function(){yn=yn.filter(function(S){return S!==o}),document.removeEventListener("wheel",r,bn),document.removeEventListener("touchmove",r,bn),document.removeEventListener("touchstart",d,bn)}},[]);var _=e.removeScrollBar,C=e.inert;return m.createElement(m.Fragment,null,C?m.createElement(o,{styles:Hb(s)}):null,_?m.createElement(Db,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function $b(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Ub=yb(hu,Wb);var Ri=m.forwardRef(function(e,t){return m.createElement(As,kt({},e,{ref:t,sideCar:Ub}))});Ri.classNames=As.classNames;var Yb=[" ","Enter","ArrowUp","ArrowDown"],Zb=[" ","Enter"],fn="Select",[Rs,Ds,qb]=co(fn),[Un]=yg(fn,[qb,en]),Ls=en(),[Gb,tn]=Un(fn),[Kb,Xb]=Un(fn),bu=e=>{const{__scopeSelect:t,children:n,open:i,defaultOpen:s,onOpenChange:o,value:l,defaultValue:a,onValueChange:r,dir:f,name:d,autoComplete:h,disabled:b,required:_,form:C}=e,S=Ls(t),[c,u]=m.useState(null),[p,v]=m.useState(null),[y,w]=m.useState(!1),x=Ei(f),[E,k]=wt({prop:i,defaultProp:s??!1,onChange:o,caller:fn}),[N,T]=wt({prop:l,defaultProp:a,onChange:r,caller:fn}),R=m.useRef(null),M=c?C||!!c.closest("form"):!0,[A,D]=m.useState(new Set),$=Array.from(A).map(H=>H.props.value).join(";");return g.jsx(Ti,{...S,children:g.jsxs(Gb,{required:_,scope:t,trigger:c,onTriggerChange:u,valueNode:p,onValueNodeChange:v,valueNodeHasChildren:y,onValueNodeHasChildrenChange:w,contentId:it(),value:N,onValueChange:T,open:E,onOpenChange:k,dir:x,triggerPointerDownPosRef:R,disabled:b,children:[g.jsx(Rs.Provider,{scope:t,children:g.jsx(Kb,{scope:e.__scopeSelect,onNativeOptionAdd:m.useCallback(H=>{D(j=>new Set(j).add(H))},[]),onNativeOptionRemove:m.useCallback(H=>{D(j=>{const F=new Set(j);return F.delete(H),F})},[]),children:n})}),M?g.jsxs(Wu,{"aria-hidden":!0,required:_,tabIndex:-1,name:d,autoComplete:h,value:N,onChange:H=>T(H.target.value),disabled:b,form:C,children:[N===void 0?g.jsx("option",{value:""}):null,Array.from(A)]},$):null]})})};bu.displayName=fn;var yu="SelectTrigger",xu=m.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:i=!1,...s}=e,o=Ls(n),l=tn(yu,n),a=l.disabled||i,r=ye(t,l.onTriggerChange),f=Ds(n),d=m.useRef("touch"),[h,b,_]=Uu(S=>{const c=f().filter(v=>!v.disabled),u=c.find(v=>v.value===l.value),p=Yu(c,S,u);p!==void 0&&l.onValueChange(p.value)}),C=S=>{a||(l.onOpenChange(!0),_()),S&&(l.triggerPointerDownPosRef.current={x:Math.round(S.pageX),y:Math.round(S.pageY)})};return g.jsx(Mi,{asChild:!0,...o,children:g.jsx(ct.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":$u(l.value)?"":void 0,...s,ref:r,onClick:oe(s.onClick,S=>{S.currentTarget.focus(),d.current!=="mouse"&&C(S)}),onPointerDown:oe(s.onPointerDown,S=>{d.current=S.pointerType;const c=S.target;c.hasPointerCapture(S.pointerId)&&c.releasePointerCapture(S.pointerId),S.button===0&&S.ctrlKey===!1&&S.pointerType==="mouse"&&(C(S),S.preventDefault())}),onKeyDown:oe(s.onKeyDown,S=>{const c=h.current!=="";!(S.ctrlKey||S.altKey||S.metaKey)&&S.key.length===1&&b(S.key),!(c&&S.key===" ")&&Yb.includes(S.key)&&(C(),S.preventDefault())})})})});xu.displayName=yu;var wu="SelectValue",_u=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:i,style:s,children:o,placeholder:l="",...a}=e,r=tn(wu,n),{onValueNodeHasChildrenChange:f}=r,d=o!==void 0,h=ye(t,r.onValueNodeChange);return $e(()=>{f(d)},[f,d]),g.jsx(ct.span,{...a,ref:h,style:{pointerEvents:"none"},children:$u(r.value)?g.jsx(g.Fragment,{children:l}):o})});_u.displayName=wu;var Qb="SelectIcon",Cu=m.forwardRef((e,t)=>{const{__scopeSelect:n,children:i,...s}=e;return g.jsx(ct.span,{"aria-hidden":!0,...s,ref:t,children:i||"▼"})});Cu.displayName=Qb;var Jb="SelectPortal",Su=e=>g.jsx(Ai,{asChild:!0,...e});Su.displayName=Jb;var hn="SelectContent",Eu=m.forwardRef((e,t)=>{const n=tn(hn,e.__scopeSelect),[i,s]=m.useState();if($e(()=>{s(new DocumentFragment)},[]),!n.open){const o=i;return o?wi.createPortal(g.jsx(Nu,{scope:e.__scopeSelect,children:g.jsx(Rs.Slot,{scope:e.__scopeSelect,children:g.jsx("div",{children:e.children})})}),o):null}return g.jsx(ku,{...e,ref:t})});Eu.displayName=hn;var vt=10,[Nu,nn]=Un(hn),ey="SelectContentImpl",ty=lu("SelectContent.RemoveScroll"),ku=m.forwardRef((e,t)=>{const{__scopeSelect:n,position:i="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:o,onPointerDownOutside:l,side:a,sideOffset:r,align:f,alignOffset:d,arrowPadding:h,collisionBoundary:b,collisionPadding:_,sticky:C,hideWhenDetached:S,avoidCollisions:c,...u}=e,p=tn(hn,n),[v,y]=m.useState(null),[w,x]=m.useState(null),E=ye(t,V=>y(V)),[k,N]=m.useState(null),[T,R]=m.useState(null),M=Ds(n),[A,D]=m.useState(!1),$=m.useRef(!1);m.useEffect(()=>{if(v)return Ms(v)},[v]),_s();const H=m.useCallback(V=>{const[X,...Z]=M().map(ee=>ee.ref.current),[G]=Z.slice(-1),J=document.activeElement;for(const ee of V)if(ee===J||(ee==null||ee.scrollIntoView({block:"nearest"}),ee===X&&w&&(w.scrollTop=0),ee===G&&w&&(w.scrollTop=w.scrollHeight),ee==null||ee.focus(),document.activeElement!==J))return},[M,w]),j=m.useCallback(()=>H([k,v]),[H,k,v]);m.useEffect(()=>{A&&j()},[A,j]);const{onOpenChange:F,triggerPointerDownPosRef:z}=p;m.useEffect(()=>{if(v){let V={x:0,y:0};const X=G=>{var J,ee;V={x:Math.abs(Math.round(G.pageX)-(((J=z.current)==null?void 0:J.x)??0)),y:Math.abs(Math.round(G.pageY)-(((ee=z.current)==null?void 0:ee.y)??0))}},Z=G=>{V.x<=10&&V.y<=10?G.preventDefault():v.contains(G.target)||F(!1),document.removeEventListener("pointermove",X),z.current=null};return z.current!==null&&(document.addEventListener("pointermove",X),document.addEventListener("pointerup",Z,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",X),document.removeEventListener("pointerup",Z,{capture:!0})}}},[v,F,z]),m.useEffect(()=>{const V=()=>F(!1);return window.addEventListener("blur",V),window.addEventListener("resize",V),()=>{window.removeEventListener("blur",V),window.removeEventListener("resize",V)}},[F]);const[O,B]=Uu(V=>{const X=M().filter(J=>!J.disabled),Z=X.find(J=>J.ref.current===document.activeElement),G=Yu(X,V,Z);G&&setTimeout(()=>G.ref.current.focus())}),L=m.useCallback((V,X,Z)=>{const G=!$.current&&!Z;(p.value!==void 0&&p.value===X||G)&&(N(V),G&&($.current=!0))},[p.value]),U=m.useCallback(()=>v==null?void 0:v.focus(),[v]),P=m.useCallback((V,X,Z)=>{const G=!$.current&&!Z;(p.value!==void 0&&p.value===X||G)&&R(V)},[p.value]),W=i==="popper"?Br:Tu,Q=W===Br?{side:a,sideOffset:r,align:f,alignOffset:d,arrowPadding:h,collisionBoundary:b,collisionPadding:_,sticky:C,hideWhenDetached:S,avoidCollisions:c}:{};return g.jsx(Nu,{scope:n,content:v,viewport:w,onViewportChange:x,itemRefCallback:L,selectedItem:k,onItemLeave:U,itemTextRefCallback:P,focusSelectedItem:j,selectedItemText:T,position:i,isPositioned:A,searchRef:O,children:g.jsx(Ri,{as:ty,allowPinchZoom:!0,children:g.jsx(Ni,{asChild:!0,trapped:p.open,onMountAutoFocus:V=>{V.preventDefault()},onUnmountAutoFocus:oe(s,V=>{var X;(X=p.trigger)==null||X.focus({preventScroll:!0}),V.preventDefault()}),children:g.jsx(Vn,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:V=>V.preventDefault(),onDismiss:()=>p.onOpenChange(!1),children:g.jsx(W,{role:"listbox",id:p.contentId,"data-state":p.open?"open":"closed",dir:p.dir,onContextMenu:V=>V.preventDefault(),...u,...Q,onPlaced:()=>D(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...u.style},onKeyDown:oe(u.onKeyDown,V=>{const X=V.ctrlKey||V.altKey||V.metaKey;if(V.key==="Tab"&&V.preventDefault(),!X&&V.key.length===1&&B(V.key),["ArrowUp","ArrowDown","Home","End"].includes(V.key)){let G=M().filter(J=>!J.disabled).map(J=>J.ref.current);if(["ArrowUp","End"].includes(V.key)&&(G=G.slice().reverse()),["ArrowUp","ArrowDown"].includes(V.key)){const J=V.target,ee=G.indexOf(J);G=G.slice(ee+1)}setTimeout(()=>H(G)),V.preventDefault()}})})})})})})});ku.displayName=ey;var ny="SelectItemAlignedPosition",Tu=m.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:i,...s}=e,o=tn(hn,n),l=nn(hn,n),[a,r]=m.useState(null),[f,d]=m.useState(null),h=ye(t,E=>d(E)),b=Ds(n),_=m.useRef(!1),C=m.useRef(!0),{viewport:S,selectedItem:c,selectedItemText:u,focusSelectedItem:p}=l,v=m.useCallback(()=>{if(o.trigger&&o.valueNode&&a&&f&&S&&c&&u){const E=o.trigger.getBoundingClientRect(),k=f.getBoundingClientRect(),N=o.valueNode.getBoundingClientRect(),T=u.getBoundingClientRect();if(o.dir!=="rtl"){const J=T.left-k.left,ee=N.left-J,se=E.left-ee,le=E.width+se,ue=Math.max(le,k.width),Se=window.innerWidth-vt,Re=Rr(ee,[vt,Math.max(vt,Se-ue)]);a.style.minWidth=le+"px",a.style.left=Re+"px"}else{const J=k.right-T.right,ee=window.innerWidth-N.right-J,se=window.innerWidth-E.right-ee,le=E.width+se,ue=Math.max(le,k.width),Se=window.innerWidth-vt,Re=Rr(ee,[vt,Math.max(vt,Se-ue)]);a.style.minWidth=le+"px",a.style.right=Re+"px"}const R=b(),M=window.innerHeight-vt*2,A=S.scrollHeight,D=window.getComputedStyle(f),$=parseInt(D.borderTopWidth,10),H=parseInt(D.paddingTop,10),j=parseInt(D.borderBottomWidth,10),F=parseInt(D.paddingBottom,10),z=$+H+A+F+j,O=Math.min(c.offsetHeight*5,z),B=window.getComputedStyle(S),L=parseInt(B.paddingTop,10),U=parseInt(B.paddingBottom,10),P=E.top+E.height/2-vt,W=M-P,Q=c.offsetHeight/2,V=c.offsetTop+Q,X=$+H+V,Z=z-X;if(X<=P){const J=R.length>0&&c===R[R.length-1].ref.current;a.style.bottom="0px";const ee=f.clientHeight-S.offsetTop-S.offsetHeight,se=Math.max(W,Q+(J?U:0)+ee+j),le=X+se;a.style.height=le+"px"}else{const J=R.length>0&&c===R[0].ref.current;a.style.top="0px";const se=Math.max(P,$+S.offsetTop+(J?L:0)+Q)+Z;a.style.height=se+"px",S.scrollTop=X-P+S.offsetTop}a.style.margin=`${vt}px 0`,a.style.minHeight=O+"px",a.style.maxHeight=M+"px",i==null||i(),requestAnimationFrame(()=>_.current=!0)}},[b,o.trigger,o.valueNode,a,f,S,c,u,o.dir,i]);$e(()=>v(),[v]);const[y,w]=m.useState();$e(()=>{f&&w(window.getComputedStyle(f).zIndex)},[f]);const x=m.useCallback(E=>{E&&C.current===!0&&(v(),p==null||p(),C.current=!1)},[v,p]);return g.jsx(sy,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:_,onScrollButtonChange:x,children:g.jsx("div",{ref:r,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:y},children:g.jsx(ct.div,{...s,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});Tu.displayName=ny;var iy="SelectPopperPosition",Br=m.forwardRef((e,t)=>{const{__scopeSelect:n,align:i="start",collisionPadding:s=vt,...o}=e,l=Ls(n);return g.jsx(ks,{...l,...o,ref:t,align:i,collisionPadding:s,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Br.displayName=iy;var[sy,yo]=Un(hn,{}),Fr="SelectViewport",Mu=m.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:i,...s}=e,o=nn(Fr,n),l=yo(Fr,n),a=ye(t,o.onViewportChange),r=m.useRef(0);return g.jsxs(g.Fragment,{children:[g.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),g.jsx(Rs.Slot,{scope:n,children:g.jsx(ct.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:oe(s.onScroll,f=>{const d=f.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:b}=l;if(b!=null&&b.current&&h){const _=Math.abs(r.current-d.scrollTop);if(_>0){const C=window.innerHeight-vt*2,S=parseFloat(h.style.minHeight),c=parseFloat(h.style.height),u=Math.max(S,c);if(u<C){const p=u+_,v=Math.min(C,p),y=p-v;h.style.height=v+"px",h.style.bottom==="0px"&&(d.scrollTop=y>0?y:0,h.style.justifyContent="flex-end")}}}r.current=d.scrollTop})})})]})});Mu.displayName=Fr;var Au="SelectGroup",[ry,oy]=Un(Au),Ru=m.forwardRef((e,t)=>{const{__scopeSelect:n,...i}=e,s=it();return g.jsx(ry,{scope:n,id:s,children:g.jsx(ct.div,{role:"group","aria-labelledby":s,...i,ref:t})})});Ru.displayName=Au;var Du="SelectLabel",Lu=m.forwardRef((e,t)=>{const{__scopeSelect:n,...i}=e,s=oy(Du,n);return g.jsx(ct.div,{id:s.id,...i,ref:t})});Lu.displayName=Du;var cs="SelectItem",[ly,Ou]=Un(cs),Pu=m.forwardRef((e,t)=>{const{__scopeSelect:n,value:i,disabled:s=!1,textValue:o,...l}=e,a=tn(cs,n),r=nn(cs,n),f=a.value===i,[d,h]=m.useState(o??""),[b,_]=m.useState(!1),C=ye(t,p=>{var v;return(v=r.itemRefCallback)==null?void 0:v.call(r,p,i,s)}),S=it(),c=m.useRef("touch"),u=()=>{s||(a.onValueChange(i),a.onOpenChange(!1))};if(i==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return g.jsx(ly,{scope:n,value:i,disabled:s,textId:S,isSelected:f,onItemTextChange:m.useCallback(p=>{h(v=>v||((p==null?void 0:p.textContent)??"").trim())},[]),children:g.jsx(Rs.ItemSlot,{scope:n,value:i,disabled:s,textValue:d,children:g.jsx(ct.div,{role:"option","aria-labelledby":S,"data-highlighted":b?"":void 0,"aria-selected":f&&b,"data-state":f?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...l,ref:C,onFocus:oe(l.onFocus,()=>_(!0)),onBlur:oe(l.onBlur,()=>_(!1)),onClick:oe(l.onClick,()=>{c.current!=="mouse"&&u()}),onPointerUp:oe(l.onPointerUp,()=>{c.current==="mouse"&&u()}),onPointerDown:oe(l.onPointerDown,p=>{c.current=p.pointerType}),onPointerMove:oe(l.onPointerMove,p=>{var v;c.current=p.pointerType,s?(v=r.onItemLeave)==null||v.call(r):c.current==="mouse"&&p.currentTarget.focus({preventScroll:!0})}),onPointerLeave:oe(l.onPointerLeave,p=>{var v;p.currentTarget===document.activeElement&&((v=r.onItemLeave)==null||v.call(r))}),onKeyDown:oe(l.onKeyDown,p=>{var y;((y=r.searchRef)==null?void 0:y.current)!==""&&p.key===" "||(Zb.includes(p.key)&&u(),p.key===" "&&p.preventDefault())})})})})});Pu.displayName=cs;var si="SelectItemText",Iu=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:i,style:s,...o}=e,l=tn(si,n),a=nn(si,n),r=Ou(si,n),f=Xb(si,n),[d,h]=m.useState(null),b=ye(t,u=>h(u),r.onItemTextChange,u=>{var p;return(p=a.itemTextRefCallback)==null?void 0:p.call(a,u,r.value,r.disabled)}),_=d==null?void 0:d.textContent,C=m.useMemo(()=>g.jsx("option",{value:r.value,disabled:r.disabled,children:_},r.value),[r.disabled,r.value,_]),{onNativeOptionAdd:S,onNativeOptionRemove:c}=f;return $e(()=>(S(C),()=>c(C)),[S,c,C]),g.jsxs(g.Fragment,{children:[g.jsx(ct.span,{id:r.textId,...o,ref:b}),r.isSelected&&l.valueNode&&!l.valueNodeHasChildren?wi.createPortal(o.children,l.valueNode):null]})});Iu.displayName=si;var Bu="SelectItemIndicator",Fu=m.forwardRef((e,t)=>{const{__scopeSelect:n,...i}=e;return Ou(Bu,n).isSelected?g.jsx(ct.span,{"aria-hidden":!0,...i,ref:t}):null});Fu.displayName=Bu;var jr="SelectScrollUpButton",ju=m.forwardRef((e,t)=>{const n=nn(jr,e.__scopeSelect),i=yo(jr,e.__scopeSelect),[s,o]=m.useState(!1),l=ye(t,i.onScrollButtonChange);return $e(()=>{if(n.viewport&&n.isPositioned){let a=function(){const f=r.scrollTop>0;o(f)};const r=n.viewport;return a(),r.addEventListener("scroll",a),()=>r.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),s?g.jsx(Hu,{...e,ref:l,onAutoScroll:()=>{const{viewport:a,selectedItem:r}=n;a&&r&&(a.scrollTop=a.scrollTop-r.offsetHeight)}}):null});ju.displayName=jr;var zr="SelectScrollDownButton",zu=m.forwardRef((e,t)=>{const n=nn(zr,e.__scopeSelect),i=yo(zr,e.__scopeSelect),[s,o]=m.useState(!1),l=ye(t,i.onScrollButtonChange);return $e(()=>{if(n.viewport&&n.isPositioned){let a=function(){const f=r.scrollHeight-r.clientHeight,d=Math.ceil(r.scrollTop)<f;o(d)};const r=n.viewport;return a(),r.addEventListener("scroll",a),()=>r.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),s?g.jsx(Hu,{...e,ref:l,onAutoScroll:()=>{const{viewport:a,selectedItem:r}=n;a&&r&&(a.scrollTop=a.scrollTop+r.offsetHeight)}}):null});zu.displayName=zr;var Hu=m.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:i,...s}=e,o=nn("SelectScrollButton",n),l=m.useRef(null),a=Ds(n),r=m.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return m.useEffect(()=>()=>r(),[r]),$e(()=>{var d;const f=a().find(h=>h.ref.current===document.activeElement);(d=f==null?void 0:f.ref.current)==null||d.scrollIntoView({block:"nearest"})},[a]),g.jsx(ct.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:oe(s.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(i,50))}),onPointerMove:oe(s.onPointerMove,()=>{var f;(f=o.onItemLeave)==null||f.call(o),l.current===null&&(l.current=window.setInterval(i,50))}),onPointerLeave:oe(s.onPointerLeave,()=>{r()})})}),ay="SelectSeparator",Vu=m.forwardRef((e,t)=>{const{__scopeSelect:n,...i}=e;return g.jsx(ct.div,{"aria-hidden":!0,...i,ref:t})});Vu.displayName=ay;var Hr="SelectArrow",cy=m.forwardRef((e,t)=>{const{__scopeSelect:n,...i}=e,s=Ls(n),o=tn(Hr,n),l=nn(Hr,n);return o.open&&l.position==="popper"?g.jsx(Ts,{...s,...i,ref:t}):null});cy.displayName=Hr;var uy="SelectBubbleInput",Wu=m.forwardRef(({__scopeSelect:e,value:t,...n},i)=>{const s=m.useRef(null),o=ye(i,s),l=io(t);return m.useEffect(()=>{const a=s.current;if(!a)return;const r=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(r,"value").set;if(l!==t&&d){const h=new Event("change",{bubbles:!0});d.call(a,t),a.dispatchEvent(h)}},[l,t]),g.jsx(ct.select,{...n,style:{...au,...n.style},ref:o,defaultValue:t})});Wu.displayName=uy;function $u(e){return e===""||e===void 0}function Uu(e){const t=Ze(e),n=m.useRef(""),i=m.useRef(0),s=m.useCallback(l=>{const a=n.current+l;t(a),function r(f){n.current=f,window.clearTimeout(i.current),f!==""&&(i.current=window.setTimeout(()=>r(""),1e3))}(a)},[t]),o=m.useCallback(()=>{n.current="",window.clearTimeout(i.current)},[]);return m.useEffect(()=>()=>window.clearTimeout(i.current),[]),[n,s,o]}function Yu(e,t,n){const s=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let l=dy(e,Math.max(o,0));s.length===1&&(l=l.filter(f=>f!==n));const r=l.find(f=>f.textValue.toLowerCase().startsWith(s.toLowerCase()));return r!==n?r:void 0}function dy(e,t){return e.map((n,i)=>e[(t+i)%e.length])}var fy=bu,Zu=xu,hy=_u,py=Cu,my=Su,qu=Eu,gy=Mu,vy=Ru,Gu=Lu,Ku=Pu,by=Iu,yy=Fu,Xu=ju,Qu=zu,Ju=Vu;const xo=fy,xy=vy,wo=hy,Os=m.forwardRef(({className:e,children:t,...n},i)=>g.jsxs(Zu,{ref:i,className:ne("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,g.jsx(py,{asChild:!0,children:g.jsx(ys,{className:"h-4 w-4 opacity-50"})})]}));Os.displayName=Zu.displayName;const _o=m.forwardRef(({className:e,...t},n)=>g.jsx(Xu,{ref:n,className:ne("flex cursor-default items-center justify-center py-1",e),...t,children:g.jsx(hm,{className:"h-4 w-4"})}));_o.displayName=Xu.displayName;const Co=m.forwardRef(({className:e,...t},n)=>g.jsx(Qu,{ref:n,className:ne("flex cursor-default items-center justify-center py-1",e),...t,children:g.jsx(ys,{className:"h-4 w-4"})}));Co.displayName=Qu.displayName;const Ps=m.forwardRef(({className:e,children:t,position:n="popper",...i},s)=>g.jsx(my,{children:g.jsxs(qu,{ref:s,className:ne("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...i,children:[g.jsx(_o,{}),g.jsx(gy,{className:ne("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),g.jsx(Co,{})]})}));Ps.displayName=qu.displayName;const ed=m.forwardRef(({className:e,...t},n)=>g.jsx(Gu,{ref:n,className:ne("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));ed.displayName=Gu.displayName;const Is=m.forwardRef(({className:e,children:t,...n},i)=>g.jsxs(Ku,{ref:i,className:ne("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[g.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:g.jsx(yy,{children:g.jsx(ui,{className:"h-4 w-4"})})}),g.jsx(by,{children:t})]}));Is.displayName=Ku.displayName;const td=m.forwardRef(({className:e,...t},n)=>g.jsx(Ju,{ref:n,className:ne("-mx-1 my-1 h-px bg-muted",e),...t}));td.displayName=Ju.displayName;function wy(e,t){const n=m.createContext(t),i=o=>{const{children:l,...a}=o,r=m.useMemo(()=>a,Object.values(a));return g.jsx(n.Provider,{value:r,children:l})};i.displayName=e+"Provider";function s(o){const l=m.useContext(n);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[i,s]}function _y(e,t=[]){let n=[];function i(o,l){const a=m.createContext(l),r=n.length;n=[...n,l];const f=h=>{var u;const{scope:b,children:_,...C}=h,S=((u=b==null?void 0:b[e])==null?void 0:u[r])||a,c=m.useMemo(()=>C,Object.values(C));return g.jsx(S.Provider,{value:c,children:_})};f.displayName=o+"Provider";function d(h,b){var S;const _=((S=b==null?void 0:b[e])==null?void 0:S[r])||a,C=m.useContext(_);if(C)return C;if(l!==void 0)return l;throw new Error(`\`${h}\` must be used within \`${o}\``)}return[f,d]}const s=()=>{const o=n.map(l=>m.createContext(l));return function(a){const r=(a==null?void 0:a[e])||o;return m.useMemo(()=>({[`__scope${e}`]:{...a,[e]:r}}),[a,r])}};return s.scopeName=e,[i,Cy(s,...t)]}function Cy(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const i=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const l=i.reduce((a,{useScope:r,scopeName:f})=>{const h=r(o)[`__scope${f}`];return{...a,...h}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}function nd(e){const t=Sy(e),n=m.forwardRef((i,s)=>{const{children:o,...l}=i,a=m.Children.toArray(o),r=a.find(Ny);if(r){const f=r.props.children,d=a.map(h=>h===r?m.Children.count(f)>1?m.Children.only(null):m.isValidElement(f)?f.props.children:null:h);return g.jsx(t,{...l,ref:s,children:m.isValidElement(f)?m.cloneElement(f,void 0,d):null})}return g.jsx(t,{...l,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}function Sy(e){const t=m.forwardRef((n,i)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const l=Ty(s),a=ky(o,s.props);return s.type!==m.Fragment&&(a.ref=i?je(i,l):l),m.cloneElement(s,a)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ey=Symbol("radix.slottable");function Ny(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ey}function ky(e,t){const n={...t};for(const i in t){const s=e[i],o=t[i];/^on[A-Z]/.test(i)?s&&o?n[i]=(...a)=>{const r=o(...a);return s(...a),r}:s&&(n[i]=s):i==="style"?n[i]={...s,...o}:i==="className"&&(n[i]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function Ty(e){var i,s;let t=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var My=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Di=My.reduce((e,t)=>{const n=nd(`Primitive.${t}`),i=m.forwardRef((s,o)=>{const{asChild:l,...a}=s,r=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(r,{...a,ref:o})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{}),Bs="Dialog",[id]=_y(Bs),[Ay,St]=id(Bs),sd=e=>{const{__scopeDialog:t,children:n,open:i,defaultOpen:s,onOpenChange:o,modal:l=!0}=e,a=m.useRef(null),r=m.useRef(null),[f,d]=wt({prop:i,defaultProp:s??!1,onChange:o,caller:Bs});return g.jsx(Ay,{scope:t,triggerRef:a,contentRef:r,contentId:it(),titleId:it(),descriptionId:it(),open:f,onOpenChange:d,onOpenToggle:m.useCallback(()=>d(h=>!h),[d]),modal:l,children:n})};sd.displayName=Bs;var rd="DialogTrigger",od=m.forwardRef((e,t)=>{const{__scopeDialog:n,...i}=e,s=St(rd,n),o=ye(t,s.triggerRef);return g.jsx(Di.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":No(s.open),...i,ref:o,onClick:oe(e.onClick,s.onOpenToggle)})});od.displayName=rd;var So="DialogPortal",[Ry,ld]=id(So,{forceMount:void 0}),ad=e=>{const{__scopeDialog:t,forceMount:n,children:i,container:s}=e,o=St(So,t);return g.jsx(Ry,{scope:t,forceMount:n,children:m.Children.map(i,l=>g.jsx(Ke,{present:n||o.open,children:g.jsx(Ai,{asChild:!0,container:s,children:l})}))})};ad.displayName=So;var us="DialogOverlay",cd=m.forwardRef((e,t)=>{const n=ld(us,e.__scopeDialog),{forceMount:i=n.forceMount,...s}=e,o=St(us,e.__scopeDialog);return o.modal?g.jsx(Ke,{present:i||o.open,children:g.jsx(Ly,{...s,ref:t})}):null});cd.displayName=us;var Dy=nd("DialogOverlay.RemoveScroll"),Ly=m.forwardRef((e,t)=>{const{__scopeDialog:n,...i}=e,s=St(us,n);return g.jsx(Ri,{as:Dy,allowPinchZoom:!0,shards:[s.contentRef],children:g.jsx(Di.div,{"data-state":No(s.open),...i,ref:t,style:{pointerEvents:"auto",...i.style}})})}),pn="DialogContent",ud=m.forwardRef((e,t)=>{const n=ld(pn,e.__scopeDialog),{forceMount:i=n.forceMount,...s}=e,o=St(pn,e.__scopeDialog);return g.jsx(Ke,{present:i||o.open,children:o.modal?g.jsx(Oy,{...s,ref:t}):g.jsx(Py,{...s,ref:t})})});ud.displayName=pn;var Oy=m.forwardRef((e,t)=>{const n=St(pn,e.__scopeDialog),i=m.useRef(null),s=ye(t,n.contentRef,i);return m.useEffect(()=>{const o=i.current;if(o)return Ms(o)},[]),g.jsx(dd,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:oe(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:oe(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,a=l.button===0&&l.ctrlKey===!0;(l.button===2||a)&&o.preventDefault()}),onFocusOutside:oe(e.onFocusOutside,o=>o.preventDefault())})}),Py=m.forwardRef((e,t)=>{const n=St(pn,e.__scopeDialog),i=m.useRef(!1),s=m.useRef(!1);return g.jsx(dd,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var l,a;(l=e.onCloseAutoFocus)==null||l.call(e,o),o.defaultPrevented||(i.current||(a=n.triggerRef.current)==null||a.focus(),o.preventDefault()),i.current=!1,s.current=!1},onInteractOutside:o=>{var r,f;(r=e.onInteractOutside)==null||r.call(e,o),o.defaultPrevented||(i.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const l=o.target;((f=n.triggerRef.current)==null?void 0:f.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),dd=m.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:o,...l}=e,a=St(pn,n),r=m.useRef(null),f=ye(t,r);return _s(),g.jsxs(g.Fragment,{children:[g.jsx(Ni,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:s,onUnmountAutoFocus:o,children:g.jsx(Vn,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":No(a.open),...l,ref:f,onDismiss:()=>a.onOpenChange(!1)})}),g.jsxs(g.Fragment,{children:[g.jsx(Iy,{titleId:a.titleId}),g.jsx(Fy,{contentRef:r,descriptionId:a.descriptionId})]})]})}),Eo="DialogTitle",fd=m.forwardRef((e,t)=>{const{__scopeDialog:n,...i}=e,s=St(Eo,n);return g.jsx(Di.h2,{id:s.titleId,...i,ref:t})});fd.displayName=Eo;var hd="DialogDescription",pd=m.forwardRef((e,t)=>{const{__scopeDialog:n,...i}=e,s=St(hd,n);return g.jsx(Di.p,{id:s.descriptionId,...i,ref:t})});pd.displayName=hd;var md="DialogClose",gd=m.forwardRef((e,t)=>{const{__scopeDialog:n,...i}=e,s=St(md,n);return g.jsx(Di.button,{type:"button",...i,ref:t,onClick:oe(e.onClick,()=>s.onOpenChange(!1))})});gd.displayName=md;function No(e){return e?"open":"closed"}var vd="DialogTitleWarning",[B3,bd]=wy(vd,{contentName:pn,titleName:Eo,docsSlug:"dialog"}),Iy=({titleId:e})=>{const t=bd(vd),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
222
222
|
|
|
223
223
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
224
224
|
|
|
225
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return l.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},oy="DialogDescriptionWarning",sy=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Dc(oy).contentName}}.`;return l.useEffect(()=>{var s;const o=(s=e.current)==null?void 0:s.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},iy=bc,ay=Sc,ly=Nc,Ic=Ec,Oc=jc,$c=_c,Lc=Ac,Fc=Mc;const Vc=iy,cy=ay,Bc=ly,uy=Fc,hs=l.forwardRef(({className:e,...t},r)=>c.jsx(Ic,{ref:r,className:T("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));hs.displayName=Ic.displayName;const gs=l.forwardRef(({className:e,children:t,...r},n)=>c.jsxs(Bc,{children:[c.jsx(hs,{}),c.jsxs(Oc,{ref:n,className:T("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...r,children:[t,c.jsxs(Fc,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[c.jsx(qt,{className:"h-4 w-4"}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));gs.displayName=Oc.displayName;const xs=({className:e,...t})=>c.jsx("div",{className:T("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});xs.displayName="DialogHeader";const On=({className:e,...t})=>c.jsx("div",{className:T("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});On.displayName="DialogFooter";const vs=l.forwardRef(({className:e,...t},r)=>c.jsx($c,{ref:r,className:T("text-lg font-semibold leading-none tracking-tight",e),...t}));vs.displayName=$c.displayName;const ys=l.forwardRef(({className:e,...t},r)=>c.jsx(Lc,{ref:r,className:T("text-sm text-muted-foreground",e),...t}));ys.displayName=Lc.displayName;function dy(e,t=[]){let r=[];function n(s,i){const a=l.createContext(i),u=r.length;r=[...r,i];const d=f=>{var v;const{scope:m,children:g,...x}=f,h=((v=m==null?void 0:m[e])==null?void 0:v[u])||a,y=l.useMemo(()=>x,Object.values(x));return c.jsx(h.Provider,{value:y,children:g})};d.displayName=s+"Provider";function p(f,m){var h;const g=((h=m==null?void 0:m[e])==null?void 0:h[u])||a,x=l.useContext(g);if(x)return x;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[d,p]}const o=()=>{const s=r.map(i=>l.createContext(i));return function(a){const u=(a==null?void 0:a[e])||s;return l.useMemo(()=>({[`__scope${e}`]:{...a,[e]:u}}),[a,u])}};return o.scopeName=e,[n,fy(o,...t)]}function fy(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=n.reduce((a,{useScope:u,scopeName:d})=>{const f=u(s)[`__scope${d}`];return{...a,...f}},{});return l.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}function py(e,t=[]){let r=[];function n(s,i){const a=l.createContext(i),u=r.length;r=[...r,i];const d=f=>{var v;const{scope:m,children:g,...x}=f,h=((v=m==null?void 0:m[e])==null?void 0:v[u])||a,y=l.useMemo(()=>x,Object.values(x));return c.jsx(h.Provider,{value:y,children:g})};d.displayName=s+"Provider";function p(f,m){var h;const g=((h=m==null?void 0:m[e])==null?void 0:h[u])||a,x=l.useContext(g);if(x)return x;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[d,p]}const o=()=>{const s=r.map(i=>l.createContext(i));return function(a){const u=(a==null?void 0:a[e])||s;return l.useMemo(()=>({[`__scope${e}`]:{...a,[e]:u}}),[a,u])}};return o.scopeName=e,[n,my(o,...t)]}function my(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=n.reduce((a,{useScope:u,scopeName:d})=>{const f=u(s)[`__scope${d}`];return{...a,...f}},{});return l.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}function hy(e){const t=gy(e),r=l.forwardRef((n,o)=>{const{children:s,...i}=n,a=l.Children.toArray(s),u=a.find(vy);if(u){const d=u.props.children,p=a.map(f=>f===u?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return c.jsx(t,{...i,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return c.jsx(t,{...i,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}function gy(e){const t=l.forwardRef((r,n)=>{const{children:o,...s}=r;if(l.isValidElement(o)){const i=by(o),a=yy(s,o.props);return o.type!==l.Fragment&&(a.ref=n?we(n,i):i),l.cloneElement(o,a)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var xy=Symbol("radix.slottable");function vy(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===xy}function yy(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...a)=>{const u=s(...a);return o(...a),u}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function by(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var wy=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Wc=wy.reduce((e,t)=>{const r=hy(`Primitive.${t}`),n=l.forwardRef((o,s)=>{const{asChild:i,...a}=o,u=i?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(u,{...a,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),fo="rovingFocusGroup.onEntryFocus",Sy={bubbles:!1,cancelable:!0},$r="RovingFocusGroup",[Ao,Hc,Cy]=Ko($r),[Ny,$n]=py($r,[Cy]),[Ey,jy]=Ny($r),Uc=l.forwardRef((e,t)=>c.jsx(Ao.Provider,{scope:e.__scopeRovingFocusGroup,children:c.jsx(Ao.Slot,{scope:e.__scopeRovingFocusGroup,children:c.jsx(Ry,{...e,ref:t})})}));Uc.displayName=$r;var Ry=l.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:o=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:p=!1,...f}=e,m=l.useRef(null),g=ie(t,m),x=kr(s),[h,y]=ct({prop:i,defaultProp:a??null,onChange:u,caller:$r}),[v,b]=l.useState(!1),S=je(d),C=Hc(r),N=l.useRef(!1),[_,j]=l.useState(0);return l.useEffect(()=>{const $=m.current;if($)return $.addEventListener(fo,S),()=>$.removeEventListener(fo,S)},[S]),c.jsx(Ey,{scope:r,orientation:n,dir:x,loop:o,currentTabStopId:h,onItemFocus:l.useCallback($=>y($),[y]),onItemShiftTab:l.useCallback(()=>b(!0),[]),onFocusableItemAdd:l.useCallback(()=>j($=>$+1),[]),onFocusableItemRemove:l.useCallback(()=>j($=>$-1),[]),children:c.jsx(Wc.div,{tabIndex:v||_===0?-1:0,"data-orientation":n,...f,ref:g,style:{outline:"none",...e.style},onMouseDown:G(e.onMouseDown,()=>{N.current=!0}),onFocus:G(e.onFocus,$=>{const D=!N.current;if($.target===$.currentTarget&&D&&!v){const O=new CustomEvent(fo,Sy);if($.currentTarget.dispatchEvent(O),!O.defaultPrevented){const P=C().filter(H=>H.focusable),A=P.find(H=>H.active),M=P.find(H=>H.id===h),q=[A,M,...P].filter(Boolean).map(H=>H.ref.current);Kc(q,p)}}N.current=!1}),onBlur:G(e.onBlur,()=>b(!1))})})}),zc="RovingFocusGroupItem",Gc=l.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:o=!1,tabStopId:s,children:i,...a}=e,u=Ue(),d=s||u,p=jy(zc,r),f=p.currentTabStopId===d,m=Hc(r),{onFocusableItemAdd:g,onFocusableItemRemove:x,currentTabStopId:h}=p;return l.useEffect(()=>{if(n)return g(),()=>x()},[n,g,x]),c.jsx(Ao.ItemSlot,{scope:r,id:d,focusable:n,active:o,children:c.jsx(Wc.span,{tabIndex:f?0:-1,"data-orientation":p.orientation,...a,ref:t,onMouseDown:G(e.onMouseDown,y=>{n?p.onItemFocus(d):y.preventDefault()}),onFocus:G(e.onFocus,()=>p.onItemFocus(d)),onKeyDown:G(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){p.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const v=Ay(y,p.orientation,p.dir);if(v!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let S=m().filter(C=>C.focusable).map(C=>C.ref.current);if(v==="last")S.reverse();else if(v==="prev"||v==="next"){v==="prev"&&S.reverse();const C=S.indexOf(y.currentTarget);S=p.loop?Ty(S,C+1):S.slice(C+1)}setTimeout(()=>Kc(S))}}),children:typeof i=="function"?i({isCurrentTabStop:f,hasTabStop:h!=null}):i})})});Gc.displayName=zc;var _y={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Py(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Ay(e,t,r){const n=Py(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return _y[n]}function Kc(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function Ty(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var Yc=Uc,qc=Gc;function My(e){const t=ky(e),r=l.forwardRef((n,o)=>{const{children:s,...i}=n,a=l.Children.toArray(s),u=a.find(Iy);if(u){const d=u.props.children,p=a.map(f=>f===u?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return c.jsx(t,{...i,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return c.jsx(t,{...i,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}function ky(e){const t=l.forwardRef((r,n)=>{const{children:o,...s}=r;if(l.isValidElement(o)){const i=$y(o),a=Oy(s,o.props);return o.type!==l.Fragment&&(a.ref=n?we(n,i):i),l.cloneElement(o,a)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Dy=Symbol("radix.slottable");function Iy(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Dy}function Oy(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...a)=>{const u=s(...a);return o(...a),u}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function $y(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Ly=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ln=Ly.reduce((e,t)=>{const r=My(`Primitive.${t}`),n=l.forwardRef((o,s)=>{const{asChild:i,...a}=o,u=i?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(u,{...a,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Fn="Tabs",[Fy]=dy(Fn,[$n]),Xc=$n(),[Vy,bs]=Fy(Fn),Qc=l.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,onValueChange:o,defaultValue:s,orientation:i="horizontal",dir:a,activationMode:u="automatic",...d}=e,p=kr(a),[f,m]=ct({prop:n,onChange:o,defaultProp:s??"",caller:Fn});return c.jsx(Vy,{scope:r,baseId:Ue(),value:f,onValueChange:m,orientation:i,dir:p,activationMode:u,children:c.jsx(Ln.div,{dir:p,"data-orientation":i,...d,ref:t})})});Qc.displayName=Fn;var Zc="TabsList",Jc=l.forwardRef((e,t)=>{const{__scopeTabs:r,loop:n=!0,...o}=e,s=bs(Zc,r),i=Xc(r);return c.jsx(Yc,{asChild:!0,...i,orientation:s.orientation,dir:s.dir,loop:n,children:c.jsx(Ln.div,{role:"tablist","aria-orientation":s.orientation,...o,ref:t})})});Jc.displayName=Zc;var eu="TabsTrigger",tu=l.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,disabled:o=!1,...s}=e,i=bs(eu,r),a=Xc(r),u=ou(i.baseId,n),d=su(i.baseId,n),p=n===i.value;return c.jsx(qc,{asChild:!0,...a,focusable:!o,active:p,children:c.jsx(Ln.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":d,"data-state":p?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:u,...s,ref:t,onMouseDown:G(e.onMouseDown,f=>{!o&&f.button===0&&f.ctrlKey===!1?i.onValueChange(n):f.preventDefault()}),onKeyDown:G(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&i.onValueChange(n)}),onFocus:G(e.onFocus,()=>{const f=i.activationMode!=="manual";!p&&!o&&f&&i.onValueChange(n)})})})});tu.displayName=eu;var ru="TabsContent",nu=l.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,forceMount:o,children:s,...i}=e,a=bs(ru,r),u=ou(a.baseId,n),d=su(a.baseId,n),p=n===a.value,f=l.useRef(p);return l.useEffect(()=>{const m=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(m)},[]),c.jsx($e,{present:o||p,children:({present:m})=>c.jsx(Ln.div,{"data-state":p?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":u,hidden:!m,id:d,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:m&&s})})});nu.displayName=ru;function ou(e,t){return`${e}-trigger-${t}`}function su(e,t){return`${e}-content-${t}`}var By=Qc,iu=Jc,au=tu,lu=nu;const Wy=By,cu=l.forwardRef(({className:e,...t},r)=>c.jsx(iu,{ref:r,className:T("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));cu.displayName=iu.displayName;const uu=l.forwardRef(({className:e,...t},r)=>c.jsx(au,{ref:r,className:T("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));uu.displayName=au.displayName;const du=l.forwardRef(({className:e,...t},r)=>c.jsx(lu,{ref:r,className:T("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));du.displayName=lu.displayName;const fu=({tabs:e,defaultValue:t,value:r,onChange:n,className:o,tabsListClassName:s,tabsTriggerClassName:i,tabsContentClassName:a,...u})=>{var m;const[d,p]=l.useState(r||t||((m=e[0])==null?void 0:m.value));l.useEffect(()=>{r!==void 0&&p(r)},[r]);const f=g=>{p(g),n==null||n(g)};return c.jsxs("div",{className:T("w-full",o),...u,children:[c.jsx("div",{className:T("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",s),role:"tablist",children:e.map(g=>c.jsxs("button",{role:"tab","aria-selected":d===g.value,"aria-controls":`tabpanel-${g.value}`,onClick:()=>f(g.value),disabled:g.disabled,className:T("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",d===g.value?"bg-background text-foreground shadow-sm":"hover:bg-background/50",i),children:[g.icon&&c.jsx("span",{className:"mr-2",children:g.icon}),g.label,g.badge&&c.jsx("span",{className:"ml-2 rounded-full bg-primary/10 px-2 py-0.5 text-xs text-primary",children:g.badge})]},g.value))}),e.map(g=>c.jsx("div",{id:`tabpanel-${g.value}`,role:"tabpanel","aria-labelledby":g.value,hidden:d!==g.value,className:T("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",a),children:d===g.value&&g.content},g.value))]})};fu.displayName="QTabs";function Hy(e,t=[]){let r=[];function n(s,i){const a=l.createContext(i);a.displayName=s+"Context";const u=r.length;r=[...r,i];const d=f=>{var v;const{scope:m,children:g,...x}=f,h=((v=m==null?void 0:m[e])==null?void 0:v[u])||a,y=l.useMemo(()=>x,Object.values(x));return c.jsx(h.Provider,{value:y,children:g})};d.displayName=s+"Provider";function p(f,m){var h;const g=((h=m==null?void 0:m[e])==null?void 0:h[u])||a,x=l.useContext(g);if(x)return x;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[d,p]}const o=()=>{const s=r.map(i=>l.createContext(i));return function(a){const u=(a==null?void 0:a[e])||s;return l.useMemo(()=>({[`__scope${e}`]:{...a,[e]:u}}),[a,u])}};return o.scopeName=e,[n,Uy(o,...t)]}function Uy(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=n.reduce((a,{useScope:u,scopeName:d})=>{const f=u(s)[`__scope${d}`];return{...a,...f}},{});return l.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}var To={exports:{}},po={};/**
|
|
225
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return m.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},By="DialogDescriptionWarning",Fy=({contentRef:e,descriptionId:t})=>{const i=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${bd(By).contentName}}.`;return m.useEffect(()=>{var o;const s=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(i))},[i,e,t]),null},jy=sd,zy=od,Hy=ad,yd=cd,xd=ud,wd=fd,_d=pd,Cd=gd;const Sd=jy,Vy=zy,Ed=Hy,Wy=Cd,ko=m.forwardRef(({className:e,...t},n)=>g.jsx(yd,{ref:n,className:ne("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));ko.displayName=yd.displayName;const To=m.forwardRef(({className:e,children:t,...n},i)=>g.jsxs(Ed,{children:[g.jsx(ko,{}),g.jsxs(xd,{ref:i,className:ne("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,g.jsxs(Cd,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[g.jsx(Mn,{className:"h-4 w-4"}),g.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));To.displayName=xd.displayName;const Mo=({className:e,...t})=>g.jsx("div",{className:ne("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Mo.displayName="DialogHeader";const Fs=({className:e,...t})=>g.jsx("div",{className:ne("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Fs.displayName="DialogFooter";const Ao=m.forwardRef(({className:e,...t},n)=>g.jsx(wd,{ref:n,className:ne("text-lg font-semibold leading-none tracking-tight",e),...t}));Ao.displayName=wd.displayName;const Ro=m.forwardRef(({className:e,...t},n)=>g.jsx(_d,{ref:n,className:ne("text-sm text-muted-foreground",e),...t}));Ro.displayName=_d.displayName;function $y(e,t=[]){let n=[];function i(o,l){const a=m.createContext(l),r=n.length;n=[...n,l];const f=h=>{var u;const{scope:b,children:_,...C}=h,S=((u=b==null?void 0:b[e])==null?void 0:u[r])||a,c=m.useMemo(()=>C,Object.values(C));return g.jsx(S.Provider,{value:c,children:_})};f.displayName=o+"Provider";function d(h,b){var S;const _=((S=b==null?void 0:b[e])==null?void 0:S[r])||a,C=m.useContext(_);if(C)return C;if(l!==void 0)return l;throw new Error(`\`${h}\` must be used within \`${o}\``)}return[f,d]}const s=()=>{const o=n.map(l=>m.createContext(l));return function(a){const r=(a==null?void 0:a[e])||o;return m.useMemo(()=>({[`__scope${e}`]:{...a,[e]:r}}),[a,r])}};return s.scopeName=e,[i,Uy(s,...t)]}function Uy(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const i=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const l=i.reduce((a,{useScope:r,scopeName:f})=>{const h=r(o)[`__scope${f}`];return{...a,...h}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}function Yy(e,t=[]){let n=[];function i(o,l){const a=m.createContext(l),r=n.length;n=[...n,l];const f=h=>{var u;const{scope:b,children:_,...C}=h,S=((u=b==null?void 0:b[e])==null?void 0:u[r])||a,c=m.useMemo(()=>C,Object.values(C));return g.jsx(S.Provider,{value:c,children:_})};f.displayName=o+"Provider";function d(h,b){var S;const _=((S=b==null?void 0:b[e])==null?void 0:S[r])||a,C=m.useContext(_);if(C)return C;if(l!==void 0)return l;throw new Error(`\`${h}\` must be used within \`${o}\``)}return[f,d]}const s=()=>{const o=n.map(l=>m.createContext(l));return function(a){const r=(a==null?void 0:a[e])||o;return m.useMemo(()=>({[`__scope${e}`]:{...a,[e]:r}}),[a,r])}};return s.scopeName=e,[i,Zy(s,...t)]}function Zy(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const i=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const l=i.reduce((a,{useScope:r,scopeName:f})=>{const h=r(o)[`__scope${f}`];return{...a,...h}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}function qy(e){const t=Gy(e),n=m.forwardRef((i,s)=>{const{children:o,...l}=i,a=m.Children.toArray(o),r=a.find(Xy);if(r){const f=r.props.children,d=a.map(h=>h===r?m.Children.count(f)>1?m.Children.only(null):m.isValidElement(f)?f.props.children:null:h);return g.jsx(t,{...l,ref:s,children:m.isValidElement(f)?m.cloneElement(f,void 0,d):null})}return g.jsx(t,{...l,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}function Gy(e){const t=m.forwardRef((n,i)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const l=Jy(s),a=Qy(o,s.props);return s.type!==m.Fragment&&(a.ref=i?je(i,l):l),m.cloneElement(s,a)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ky=Symbol("radix.slottable");function Xy(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ky}function Qy(e,t){const n={...t};for(const i in t){const s=e[i],o=t[i];/^on[A-Z]/.test(i)?s&&o?n[i]=(...a)=>{const r=o(...a);return s(...a),r}:s&&(n[i]=s):i==="style"?n[i]={...s,...o}:i==="className"&&(n[i]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function Jy(e){var i,s;let t=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ex=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Nd=ex.reduce((e,t)=>{const n=qy(`Primitive.${t}`),i=m.forwardRef((s,o)=>{const{asChild:l,...a}=s,r=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(r,{...a,ref:o})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{}),br="rovingFocusGroup.onEntryFocus",tx={bubbles:!1,cancelable:!0},Li="RovingFocusGroup",[Vr,kd,nx]=co(Li),[ix,js]=Yy(Li,[nx]),[sx,rx]=ix(Li),Td=m.forwardRef((e,t)=>g.jsx(Vr.Provider,{scope:e.__scopeRovingFocusGroup,children:g.jsx(Vr.Slot,{scope:e.__scopeRovingFocusGroup,children:g.jsx(ox,{...e,ref:t})})}));Td.displayName=Li;var ox=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:i,loop:s=!1,dir:o,currentTabStopId:l,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:r,onEntryFocus:f,preventScrollOnEntryFocus:d=!1,...h}=e,b=m.useRef(null),_=ye(t,b),C=Ei(o),[S,c]=wt({prop:l,defaultProp:a??null,onChange:r,caller:Li}),[u,p]=m.useState(!1),v=Ze(f),y=kd(n),w=m.useRef(!1),[x,E]=m.useState(0);return m.useEffect(()=>{const k=b.current;if(k)return k.addEventListener(br,v),()=>k.removeEventListener(br,v)},[v]),g.jsx(sx,{scope:n,orientation:i,dir:C,loop:s,currentTabStopId:S,onItemFocus:m.useCallback(k=>c(k),[c]),onItemShiftTab:m.useCallback(()=>p(!0),[]),onFocusableItemAdd:m.useCallback(()=>E(k=>k+1),[]),onFocusableItemRemove:m.useCallback(()=>E(k=>k-1),[]),children:g.jsx(Nd.div,{tabIndex:u||x===0?-1:0,"data-orientation":i,...h,ref:_,style:{outline:"none",...e.style},onMouseDown:oe(e.onMouseDown,()=>{w.current=!0}),onFocus:oe(e.onFocus,k=>{const N=!w.current;if(k.target===k.currentTarget&&N&&!u){const T=new CustomEvent(br,tx);if(k.currentTarget.dispatchEvent(T),!T.defaultPrevented){const R=y().filter(H=>H.focusable),M=R.find(H=>H.active),A=R.find(H=>H.id===S),$=[M,A,...R].filter(Boolean).map(H=>H.ref.current);Rd($,d)}}w.current=!1}),onBlur:oe(e.onBlur,()=>p(!1))})})}),Md="RovingFocusGroupItem",Ad=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:i=!0,active:s=!1,tabStopId:o,children:l,...a}=e,r=it(),f=o||r,d=rx(Md,n),h=d.currentTabStopId===f,b=kd(n),{onFocusableItemAdd:_,onFocusableItemRemove:C,currentTabStopId:S}=d;return m.useEffect(()=>{if(i)return _(),()=>C()},[i,_,C]),g.jsx(Vr.ItemSlot,{scope:n,id:f,focusable:i,active:s,children:g.jsx(Nd.span,{tabIndex:h?0:-1,"data-orientation":d.orientation,...a,ref:t,onMouseDown:oe(e.onMouseDown,c=>{i?d.onItemFocus(f):c.preventDefault()}),onFocus:oe(e.onFocus,()=>d.onItemFocus(f)),onKeyDown:oe(e.onKeyDown,c=>{if(c.key==="Tab"&&c.shiftKey){d.onItemShiftTab();return}if(c.target!==c.currentTarget)return;const u=cx(c,d.orientation,d.dir);if(u!==void 0){if(c.metaKey||c.ctrlKey||c.altKey||c.shiftKey)return;c.preventDefault();let v=b().filter(y=>y.focusable).map(y=>y.ref.current);if(u==="last")v.reverse();else if(u==="prev"||u==="next"){u==="prev"&&v.reverse();const y=v.indexOf(c.currentTarget);v=d.loop?ux(v,y+1):v.slice(y+1)}setTimeout(()=>Rd(v))}}),children:typeof l=="function"?l({isCurrentTabStop:h,hasTabStop:S!=null}):l})})});Ad.displayName=Md;var lx={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function ax(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function cx(e,t,n){const i=ax(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(i))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(i)))return lx[i]}function Rd(e,t=!1){const n=document.activeElement;for(const i of e)if(i===n||(i.focus({preventScroll:t}),document.activeElement!==n))return}function ux(e,t){return e.map((n,i)=>e[(t+i)%e.length])}var Dd=Td,Ld=Ad;function dx(e){const t=fx(e),n=m.forwardRef((i,s)=>{const{children:o,...l}=i,a=m.Children.toArray(o),r=a.find(px);if(r){const f=r.props.children,d=a.map(h=>h===r?m.Children.count(f)>1?m.Children.only(null):m.isValidElement(f)?f.props.children:null:h);return g.jsx(t,{...l,ref:s,children:m.isValidElement(f)?m.cloneElement(f,void 0,d):null})}return g.jsx(t,{...l,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}function fx(e){const t=m.forwardRef((n,i)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const l=gx(s),a=mx(o,s.props);return s.type!==m.Fragment&&(a.ref=i?je(i,l):l),m.cloneElement(s,a)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var hx=Symbol("radix.slottable");function px(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===hx}function mx(e,t){const n={...t};for(const i in t){const s=e[i],o=t[i];/^on[A-Z]/.test(i)?s&&o?n[i]=(...a)=>{const r=o(...a);return s(...a),r}:s&&(n[i]=s):i==="style"?n[i]={...s,...o}:i==="className"&&(n[i]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function gx(e){var i,s;let t=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var vx=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],zs=vx.reduce((e,t)=>{const n=dx(`Primitive.${t}`),i=m.forwardRef((s,o)=>{const{asChild:l,...a}=s,r=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(r,{...a,ref:o})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{}),Hs="Tabs",[bx]=$y(Hs,[js]),Od=js(),[yx,Do]=bx(Hs),Pd=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:i,onValueChange:s,defaultValue:o,orientation:l="horizontal",dir:a,activationMode:r="automatic",...f}=e,d=Ei(a),[h,b]=wt({prop:i,onChange:s,defaultProp:o??"",caller:Hs});return g.jsx(yx,{scope:n,baseId:it(),value:h,onValueChange:b,orientation:l,dir:d,activationMode:r,children:g.jsx(zs.div,{dir:d,"data-orientation":l,...f,ref:t})})});Pd.displayName=Hs;var Id="TabsList",Bd=m.forwardRef((e,t)=>{const{__scopeTabs:n,loop:i=!0,...s}=e,o=Do(Id,n),l=Od(n);return g.jsx(Dd,{asChild:!0,...l,orientation:o.orientation,dir:o.dir,loop:i,children:g.jsx(zs.div,{role:"tablist","aria-orientation":o.orientation,...s,ref:t})})});Bd.displayName=Id;var Fd="TabsTrigger",jd=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:i,disabled:s=!1,...o}=e,l=Do(Fd,n),a=Od(n),r=Vd(l.baseId,i),f=Wd(l.baseId,i),d=i===l.value;return g.jsx(Ld,{asChild:!0,...a,focusable:!s,active:d,children:g.jsx(zs.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":f,"data-state":d?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:r,...o,ref:t,onMouseDown:oe(e.onMouseDown,h=>{!s&&h.button===0&&h.ctrlKey===!1?l.onValueChange(i):h.preventDefault()}),onKeyDown:oe(e.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&l.onValueChange(i)}),onFocus:oe(e.onFocus,()=>{const h=l.activationMode!=="manual";!d&&!s&&h&&l.onValueChange(i)})})})});jd.displayName=Fd;var zd="TabsContent",Hd=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:i,forceMount:s,children:o,...l}=e,a=Do(zd,n),r=Vd(a.baseId,i),f=Wd(a.baseId,i),d=i===a.value,h=m.useRef(d);return m.useEffect(()=>{const b=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(b)},[]),g.jsx(Ke,{present:s||d,children:({present:b})=>g.jsx(zs.div,{"data-state":d?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":r,hidden:!b,id:f,tabIndex:0,...l,ref:t,style:{...e.style,animationDuration:h.current?"0s":void 0},children:b&&o})})});Hd.displayName=zd;function Vd(e,t){return`${e}-trigger-${t}`}function Wd(e,t){return`${e}-content-${t}`}var xx=Pd,$d=Bd,Ud=jd,Yd=Hd;const wx=xx,Zd=m.forwardRef(({className:e,...t},n)=>g.jsx($d,{ref:n,className:ne("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Zd.displayName=$d.displayName;const qd=m.forwardRef(({className:e,...t},n)=>g.jsx(Ud,{ref:n,className:ne("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));qd.displayName=Ud.displayName;const Gd=m.forwardRef(({className:e,...t},n)=>g.jsx(Yd,{ref:n,className:ne("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Gd.displayName=Yd.displayName;const Kd=({tabs:e,defaultValue:t,value:n,onChange:i,className:s,tabsListClassName:o,tabsTriggerClassName:l,tabsContentClassName:a,...r})=>{var b;const[f,d]=m.useState(n||t||((b=e[0])==null?void 0:b.value));m.useEffect(()=>{n!==void 0&&d(n)},[n]);const h=_=>{d(_),i==null||i(_)};return g.jsxs("div",{className:ne("w-full",s),...r,children:[g.jsx("div",{className:ne("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",o),role:"tablist",children:e.map(_=>g.jsxs("button",{role:"tab","aria-selected":f===_.value,"aria-controls":`tabpanel-${_.value}`,onClick:()=>h(_.value),disabled:_.disabled,className:ne("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",f===_.value?"bg-background text-foreground shadow-sm":"hover:bg-background/50",l),children:[_.icon&&g.jsx("span",{className:"mr-2",children:_.icon}),_.label,_.badge&&g.jsx("span",{className:"ml-2 rounded-full bg-primary/10 px-2 py-0.5 text-xs text-primary",children:_.badge})]},_.value))}),e.map(_=>g.jsx("div",{id:`tabpanel-${_.value}`,role:"tabpanel","aria-labelledby":_.value,hidden:f!==_.value,className:ne("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",a),children:f===_.value&&_.content},_.value))]})};Kd.displayName="QTabs";function _x(e,t=[]){let n=[];function i(o,l){const a=m.createContext(l);a.displayName=o+"Context";const r=n.length;n=[...n,l];const f=h=>{var u;const{scope:b,children:_,...C}=h,S=((u=b==null?void 0:b[e])==null?void 0:u[r])||a,c=m.useMemo(()=>C,Object.values(C));return g.jsx(S.Provider,{value:c,children:_})};f.displayName=o+"Provider";function d(h,b){var S;const _=((S=b==null?void 0:b[e])==null?void 0:S[r])||a,C=m.useContext(_);if(C)return C;if(l!==void 0)return l;throw new Error(`\`${h}\` must be used within \`${o}\``)}return[f,d]}const s=()=>{const o=n.map(l=>m.createContext(l));return function(a){const r=(a==null?void 0:a[e])||o;return m.useMemo(()=>({[`__scope${e}`]:{...a,[e]:r}}),[a,r])}};return s.scopeName=e,[i,Cx(s,...t)]}function Cx(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const i=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const l=i.reduce((a,{useScope:r,scopeName:f})=>{const h=r(o)[`__scope${f}`];return{...a,...h}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}var Yn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Zn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Wr={exports:{}},yr={};/**
|
|
226
226
|
* @license React
|
|
227
227
|
* use-sync-external-store-shim.production.js
|
|
228
228
|
*
|
|
@@ -230,7 +230,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
|
|
|
230
230
|
*
|
|
231
231
|
* This source code is licensed under the MIT license found in the
|
|
232
232
|
* LICENSE file in the root directory of this source tree.
|
|
233
|
-
*/var
|
|
233
|
+
*/var ya;function Sx(){if(ya)return yr;ya=1;var e=K;function t(h,b){return h===b&&(h!==0||1/h===1/b)||h!==h&&b!==b}var n=typeof Object.is=="function"?Object.is:t,i=e.useState,s=e.useEffect,o=e.useLayoutEffect,l=e.useDebugValue;function a(h,b){var _=b(),C=i({inst:{value:_,getSnapshot:b}}),S=C[0].inst,c=C[1];return o(function(){S.value=_,S.getSnapshot=b,r(S)&&c({inst:S})},[h,_,b]),s(function(){return r(S)&&c({inst:S}),h(function(){r(S)&&c({inst:S})})},[h]),l(_),_}function r(h){var b=h.getSnapshot;h=h.value;try{var _=b();return!n(h,_)}catch{return!0}}function f(h,b){return b()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:a;return yr.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:d,yr}var xr={};/**
|
|
234
234
|
* @license React
|
|
235
235
|
* use-sync-external-store-shim.development.js
|
|
236
236
|
*
|
|
@@ -238,5 +238,16 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
|
|
|
238
238
|
*
|
|
239
239
|
* This source code is licensed under the MIT license found in the
|
|
240
240
|
* LICENSE file in the root directory of this source tree.
|
|
241
|
-
*/var Qi;function Gy(){return Qi||(Qi=1,process.env.NODE_ENV!=="production"&&function(){function e(g,x){return g===x&&(g!==0||1/g===1/x)||g!==g&&x!==x}function t(g,x){p||o.startTransition===void 0||(p=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var h=x();if(!f){var y=x();s(h,y)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}y=i({inst:{value:h,getSnapshot:x}});var v=y[0].inst,b=y[1];return u(function(){v.value=h,v.getSnapshot=x,r(v)&&b({inst:v})},[g,h,x]),a(function(){return r(v)&&b({inst:v}),g(function(){r(v)&&b({inst:v})})},[g]),d(h),h}function r(g){var x=g.getSnapshot;g=g.value;try{var h=x();return!s(g,h)}catch{return!0}}function n(g,x){return x()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var o=oe,s=typeof Object.is=="function"?Object.is:e,i=o.useState,a=o.useEffect,u=o.useLayoutEffect,d=o.useDebugValue,p=!1,f=!1,m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?n:t;mo.useSyncExternalStore=o.useSyncExternalStore!==void 0?o.useSyncExternalStore:m,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),mo}process.env.NODE_ENV==="production"?To.exports=zy():To.exports=Gy();var Ky=To.exports;function Yy(){return Ky.useSyncExternalStore(qy,()=>!0,()=>!1)}function qy(){return()=>{}}var ws="Avatar",[Xy]=Hy(ws),[Qy,pu]=Xy(ws),mu=l.forwardRef((e,t)=>{const{__scopeAvatar:r,...n}=e,[o,s]=l.useState("idle");return c.jsx(Qy,{scope:r,imageLoadingStatus:o,onImageLoadingStatusChange:s,children:c.jsx(Tr.span,{...n,ref:t})})});mu.displayName=ws;var hu="AvatarImage",gu=l.forwardRef((e,t)=>{const{__scopeAvatar:r,src:n,onLoadingStatusChange:o=()=>{},...s}=e,i=pu(hu,r),a=Zy(n,s),u=je(d=>{o(d),i.onImageLoadingStatusChange(d)});return Ne(()=>{a!=="idle"&&u(a)},[a,u]),a==="loaded"?c.jsx(Tr.img,{...s,ref:t,src:n}):null});gu.displayName=hu;var xu="AvatarFallback",vu=l.forwardRef((e,t)=>{const{__scopeAvatar:r,delayMs:n,...o}=e,s=pu(xu,r),[i,a]=l.useState(n===void 0);return l.useEffect(()=>{if(n!==void 0){const u=window.setTimeout(()=>a(!0),n);return()=>window.clearTimeout(u)}},[n]),i&&s.imageLoadingStatus!=="loaded"?c.jsx(Tr.span,{...o,ref:t}):null});vu.displayName=xu;function Zi(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function Zy(e,{referrerPolicy:t,crossOrigin:r}){const n=Yy(),o=l.useRef(null),s=n?(o.current||(o.current=new window.Image),o.current):null,[i,a]=l.useState(()=>Zi(s,e));return Ne(()=>{a(Zi(s,e))},[s,e]),Ne(()=>{const u=f=>()=>{a(f)};if(!s)return;const d=u("loaded"),p=u("error");return s.addEventListener("load",d),s.addEventListener("error",p),t&&(s.referrerPolicy=t),typeof r=="string"&&(s.crossOrigin=r),()=>{s.removeEventListener("load",d),s.removeEventListener("error",p)}},[s,r,t]),i}var yu=mu,bu=gu,wu=vu;const Ss=l.forwardRef(({className:e,...t},r)=>c.jsx(yu,{ref:r,className:T("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));Ss.displayName=yu.displayName;const Cs=l.forwardRef(({className:e,...t},r)=>c.jsx(bu,{ref:r,className:T("aspect-square h-full w-full",e),...t}));Cs.displayName=bu.displayName;const Ns=l.forwardRef(({className:e,...t},r)=>c.jsx(wu,{ref:r,className:T("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));Ns.displayName=wu.displayName;function Jy(e,t=[]){let r=[];function n(s,i){const a=l.createContext(i),u=r.length;r=[...r,i];const d=f=>{var v;const{scope:m,children:g,...x}=f,h=((v=m==null?void 0:m[e])==null?void 0:v[u])||a,y=l.useMemo(()=>x,Object.values(x));return c.jsx(h.Provider,{value:y,children:g})};d.displayName=s+"Provider";function p(f,m){var h;const g=((h=m==null?void 0:m[e])==null?void 0:h[u])||a,x=l.useContext(g);if(x)return x;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[d,p]}const o=()=>{const s=r.map(i=>l.createContext(i));return function(a){const u=(a==null?void 0:a[e])||s;return l.useMemo(()=>({[`__scope${e}`]:{...a,[e]:u}}),[a,u])}};return o.scopeName=e,[n,eb(o,...t)]}function eb(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=n.reduce((a,{useScope:u,scopeName:d})=>{const f=u(s)[`__scope${d}`];return{...a,...f}},{});return l.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}function tb(e){const t=rb(e),r=l.forwardRef((n,o)=>{const{children:s,...i}=n,a=l.Children.toArray(s),u=a.find(ob);if(u){const d=u.props.children,p=a.map(f=>f===u?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return c.jsx(t,{...i,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return c.jsx(t,{...i,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}function rb(e){const t=l.forwardRef((r,n)=>{const{children:o,...s}=r;if(l.isValidElement(o)){const i=ib(o),a=sb(s,o.props);return o.type!==l.Fragment&&(a.ref=n?we(n,i):i),l.cloneElement(o,a)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Su=Symbol("radix.slottable");function nb(e){const t=({children:r})=>c.jsx(c.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=Su,t}function ob(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Su}function sb(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...a)=>{const u=s(...a);return o(...a),u}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function ib(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var ab=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],lb=ab.reduce((e,t)=>{const r=tb(`Primitive.${t}`),n=l.forwardRef((o,s)=>{const{asChild:i,...a}=o,u=i?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(u,{...a,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),[Vn]=Jy("Tooltip",[lr]),Bn=lr(),Cu="TooltipProvider",cb=700,Mo="tooltip.open",[ub,Es]=Vn(Cu),Nu=e=>{const{__scopeTooltip:t,delayDuration:r=cb,skipDelayDuration:n=300,disableHoverableContent:o=!1,children:s}=e,i=l.useRef(!0),a=l.useRef(!1),u=l.useRef(0);return l.useEffect(()=>{const d=u.current;return()=>window.clearTimeout(d)},[]),c.jsx(ub,{scope:t,isOpenDelayedRef:i,delayDuration:r,onOpen:l.useCallback(()=>{window.clearTimeout(u.current),i.current=!1},[]),onClose:l.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>i.current=!0,n)},[n]),isPointerInTransitRef:a,onPointerInTransitChange:l.useCallback(d=>{a.current=d},[]),disableHoverableContent:o,children:s})};Nu.displayName=Cu;var Nr="Tooltip",[db,Wn]=Vn(Nr),Eu=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:o,onOpenChange:s,disableHoverableContent:i,delayDuration:a}=e,u=Es(Nr,e.__scopeTooltip),d=Bn(t),[p,f]=l.useState(null),m=Ue(),g=l.useRef(0),x=i??u.disableHoverableContent,h=a??u.delayDuration,y=l.useRef(!1),[v,b]=ct({prop:n,defaultProp:o??!1,onChange:j=>{j?(u.onOpen(),document.dispatchEvent(new CustomEvent(Mo))):u.onClose(),s==null||s(j)},caller:Nr}),S=l.useMemo(()=>v?y.current?"delayed-open":"instant-open":"closed",[v]),C=l.useCallback(()=>{window.clearTimeout(g.current),g.current=0,y.current=!1,b(!0)},[b]),N=l.useCallback(()=>{window.clearTimeout(g.current),g.current=0,b(!1)},[b]),_=l.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{y.current=!0,b(!0),g.current=0},h)},[h,b]);return l.useEffect(()=>()=>{g.current&&(window.clearTimeout(g.current),g.current=0)},[]),c.jsx(En,{...d,children:c.jsx(db,{scope:t,contentId:m,open:v,stateAttribute:S,trigger:p,onTriggerChange:f,onTriggerEnter:l.useCallback(()=>{u.isOpenDelayedRef.current?_():C()},[u.isOpenDelayedRef,_,C]),onTriggerLeave:l.useCallback(()=>{x?N():(window.clearTimeout(g.current),g.current=0)},[N,x]),onOpen:C,onClose:N,disableHoverableContent:x,children:r})})};Eu.displayName=Nr;var ko="TooltipTrigger",ju=l.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=Wn(ko,r),s=Es(ko,r),i=Bn(r),a=l.useRef(null),u=ie(t,a,o.onTriggerChange),d=l.useRef(!1),p=l.useRef(!1),f=l.useCallback(()=>d.current=!1,[]);return l.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),c.jsx(ns,{asChild:!0,...i,children:c.jsx(lb.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...n,ref:u,onPointerMove:G(e.onPointerMove,m=>{m.pointerType!=="touch"&&!p.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),p.current=!0)}),onPointerLeave:G(e.onPointerLeave,()=>{o.onTriggerLeave(),p.current=!1}),onPointerDown:G(e.onPointerDown,()=>{o.open&&o.onClose(),d.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:G(e.onFocus,()=>{d.current||o.onOpen()}),onBlur:G(e.onBlur,o.onClose),onClick:G(e.onClick,o.onClose)})})});ju.displayName=ko;var fb="TooltipPortal",[dC,pb]=Vn(fb,{forceMount:void 0}),rr="TooltipContent",Ru=l.forwardRef((e,t)=>{const r=pb(rr,e.__scopeTooltip),{forceMount:n=r.forceMount,side:o="top",...s}=e,i=Wn(rr,e.__scopeTooltip);return c.jsx($e,{present:n||i.open,children:i.disableHoverableContent?c.jsx(_u,{side:o,...s,ref:t}):c.jsx(mb,{side:o,...s,ref:t})})}),mb=l.forwardRef((e,t)=>{const r=Wn(rr,e.__scopeTooltip),n=Es(rr,e.__scopeTooltip),o=l.useRef(null),s=ie(t,o),[i,a]=l.useState(null),{trigger:u,onClose:d}=r,p=o.current,{onPointerInTransitChange:f}=n,m=l.useCallback(()=>{a(null),f(!1)},[f]),g=l.useCallback((x,h)=>{const y=x.currentTarget,v={x:x.clientX,y:x.clientY},b=yb(v,y.getBoundingClientRect()),S=bb(v,b),C=wb(h.getBoundingClientRect()),N=Cb([...S,...C]);a(N),f(!0)},[f]);return l.useEffect(()=>()=>m(),[m]),l.useEffect(()=>{if(u&&p){const x=y=>g(y,p),h=y=>g(y,u);return u.addEventListener("pointerleave",x),p.addEventListener("pointerleave",h),()=>{u.removeEventListener("pointerleave",x),p.removeEventListener("pointerleave",h)}}},[u,p,g,m]),l.useEffect(()=>{if(i){const x=h=>{const y=h.target,v={x:h.clientX,y:h.clientY},b=(u==null?void 0:u.contains(y))||(p==null?void 0:p.contains(y)),S=!Sb(v,i);b?m():S&&(m(),d())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[u,p,i,d,m]),c.jsx(_u,{...e,ref:s})}),[hb,gb]=Vn(Nr,{isInside:!1}),xb=nb("TooltipContent"),_u=l.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:i,...a}=e,u=Wn(rr,r),d=Bn(r),{onClose:p}=u;return l.useEffect(()=>(document.addEventListener(Mo,p),()=>document.removeEventListener(Mo,p)),[p]),l.useEffect(()=>{if(u.trigger){const f=m=>{const g=m.target;g!=null&&g.contains(u.trigger)&&p()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[u.trigger,p]),c.jsx(Dr,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:f=>f.preventDefault(),onDismiss:p,children:c.jsxs(os,{"data-state":u.stateAttribute,...d,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[c.jsx(xb,{children:n}),c.jsx(hb,{scope:r,isInside:!0,children:c.jsx(Rx,{id:u.contentId,role:"tooltip",children:o||n})})]})})});Ru.displayName=rr;var Pu="TooltipArrow",vb=l.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=Bn(r);return gb(Pu,r).isInside?null:c.jsx(ss,{...o,...n,ref:t})});vb.displayName=Pu;function yb(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(r,n,o,s)){case s:return"left";case o:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function bb(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function wb(e){const{top:t,right:r,bottom:n,left:o}=e;return[{x:o,y:t},{x:r,y:t},{x:r,y:n},{x:o,y:n}]}function Sb(e,t){const{x:r,y:n}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s],u=t[i],d=a.x,p=a.y,f=u.x,m=u.y;p>n!=m>n&&r<(f-d)*(n-p)/(m-p)+d&&(o=!o)}return o}function Cb(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),Nb(t)}function Nb(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const o=e[n];for(;t.length>=2;){const s=t[t.length-1],i=t[t.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))t.pop();else break}t.push(o)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const o=e[n];for(;r.length>=2;){const s=r[r.length-1],i=r[r.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))r.pop();else break}r.push(o)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var Eb=Nu,jb=Eu,Rb=ju,Au=Ru;const _b=Eb,Pb=jb,Ab=Rb,Tu=l.forwardRef(({className:e,sideOffset:t=4,...r},n)=>c.jsx(Au,{ref:n,sideOffset:t,className:T("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r}));Tu.displayName=Au.displayName;function Tb(e,t=[]){let r=[];function n(s,i){const a=l.createContext(i),u=r.length;r=[...r,i];const d=f=>{var v;const{scope:m,children:g,...x}=f,h=((v=m==null?void 0:m[e])==null?void 0:v[u])||a,y=l.useMemo(()=>x,Object.values(x));return c.jsx(h.Provider,{value:y,children:g})};d.displayName=s+"Provider";function p(f,m){var h;const g=((h=m==null?void 0:m[e])==null?void 0:h[u])||a,x=l.useContext(g);if(x)return x;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[d,p]}const o=()=>{const s=r.map(i=>l.createContext(i));return function(a){const u=(a==null?void 0:a[e])||s;return l.useMemo(()=>({[`__scope${e}`]:{...a,[e]:u}}),[a,u])}};return o.scopeName=e,[n,Mb(o,...t)]}function Mb(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=n.reduce((a,{useScope:u,scopeName:d})=>{const f=u(s)[`__scope${d}`];return{...a,...f}},{});return l.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}function kb(e){const t=Db(e),r=l.forwardRef((n,o)=>{const{children:s,...i}=n,a=l.Children.toArray(s),u=a.find(Ob);if(u){const d=u.props.children,p=a.map(f=>f===u?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return c.jsx(t,{...i,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return c.jsx(t,{...i,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}function Db(e){const t=l.forwardRef((r,n)=>{const{children:o,...s}=r;if(l.isValidElement(o)){const i=Lb(o),a=$b(s,o.props);return o.type!==l.Fragment&&(a.ref=n?we(n,i):i),l.cloneElement(o,a)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ib=Symbol("radix.slottable");function Ob(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ib}function $b(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...a)=>{const u=s(...a);return o(...a),u}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function Lb(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Fb=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Vb=Fb.reduce((e,t)=>{const r=kb(`Primitive.${t}`),n=l.forwardRef((o,s)=>{const{asChild:i,...a}=o,u=i?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(u,{...a,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Bb(e,t=[]){let r=[];function n(s,i){const a=l.createContext(i),u=r.length;r=[...r,i];const d=f=>{var v;const{scope:m,children:g,...x}=f,h=((v=m==null?void 0:m[e])==null?void 0:v[u])||a,y=l.useMemo(()=>x,Object.values(x));return c.jsx(h.Provider,{value:y,children:g})};d.displayName=s+"Provider";function p(f,m){var h;const g=((h=m==null?void 0:m[e])==null?void 0:h[u])||a,x=l.useContext(g);if(x)return x;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[d,p]}const o=()=>{const s=r.map(i=>l.createContext(i));return function(a){const u=(a==null?void 0:a[e])||s;return l.useMemo(()=>({[`__scope${e}`]:{...a,[e]:u}}),[a,u])}};return o.scopeName=e,[n,Wb(o,...t)]}function Wb(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=n.reduce((a,{useScope:u,scopeName:d})=>{const f=u(s)[`__scope${d}`];return{...a,...f}},{});return l.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}function Mu(e){const t=Hb(e),r=l.forwardRef((n,o)=>{const{children:s,...i}=n,a=l.Children.toArray(s),u=a.find(zb);if(u){const d=u.props.children,p=a.map(f=>f===u?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return c.jsx(t,{...i,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return c.jsx(t,{...i,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}function Hb(e){const t=l.forwardRef((r,n)=>{const{children:o,...s}=r;if(l.isValidElement(o)){const i=Kb(o),a=Gb(s,o.props);return o.type!==l.Fragment&&(a.ref=n?we(n,i):i),l.cloneElement(o,a)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ub=Symbol("radix.slottable");function zb(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ub}function Gb(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...a)=>{const u=s(...a);return o(...a),u}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function Kb(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Yb=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Lr=Yb.reduce((e,t)=>{const r=Mu(`Primitive.${t}`),n=l.forwardRef((o,s)=>{const{asChild:i,...a}=o,u=i?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(u,{...a,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function qb(e,t){e&&Ar.flushSync(()=>e.dispatchEvent(t))}var Do=["Enter"," "],Xb=["ArrowDown","PageUp","Home"],ku=["ArrowUp","PageDown","End"],Qb=[...Xb,...ku],Zb={ltr:[...Do,"ArrowRight"],rtl:[...Do,"ArrowLeft"]},Jb={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Fr="Menu",[Er,ew,tw]=Ko(Fr),[Lt,Du]=Bb(Fr,[tw,lr,$n]),Vr=lr(),Iu=$n(),[Ou,Pt]=Lt(Fr),[rw,Br]=Lt(Fr),$u=e=>{const{__scopeMenu:t,open:r=!1,children:n,dir:o,onOpenChange:s,modal:i=!0}=e,a=Vr(t),[u,d]=l.useState(null),p=l.useRef(!1),f=je(s),m=kr(o);return l.useEffect(()=>{const g=()=>{p.current=!0,document.addEventListener("pointerdown",x,{capture:!0,once:!0}),document.addEventListener("pointermove",x,{capture:!0,once:!0})},x=()=>p.current=!1;return document.addEventListener("keydown",g,{capture:!0}),()=>{document.removeEventListener("keydown",g,{capture:!0}),document.removeEventListener("pointerdown",x,{capture:!0}),document.removeEventListener("pointermove",x,{capture:!0})}},[]),c.jsx(En,{...a,children:c.jsx(Ou,{scope:t,open:r,onOpenChange:f,content:u,onContentChange:d,children:c.jsx(rw,{scope:t,onClose:l.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:p,dir:m,modal:i,children:n})})})};$u.displayName=Fr;var nw="MenuAnchor",js=l.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,o=Vr(r);return c.jsx(ns,{...o,...n,ref:t})});js.displayName=nw;var Rs="MenuPortal",[ow,Lu]=Lt(Rs,{forceMount:void 0}),Fu=e=>{const{__scopeMenu:t,forceMount:r,children:n,container:o}=e,s=Pt(Rs,t);return c.jsx(ow,{scope:t,forceMount:r,children:c.jsx($e,{present:r||s.open,children:c.jsx(jn,{asChild:!0,container:o,children:n})})})};Fu.displayName=Rs;var qe="MenuContent",[sw,_s]=Lt(qe),Vu=l.forwardRef((e,t)=>{const r=Lu(qe,e.__scopeMenu),{forceMount:n=r.forceMount,...o}=e,s=Pt(qe,e.__scopeMenu),i=Br(qe,e.__scopeMenu);return c.jsx(Er.Provider,{scope:e.__scopeMenu,children:c.jsx($e,{present:n||s.open,children:c.jsx(Er.Slot,{scope:e.__scopeMenu,children:i.modal?c.jsx(iw,{...o,ref:t}):c.jsx(aw,{...o,ref:t})})})})}),iw=l.forwardRef((e,t)=>{const r=Pt(qe,e.__scopeMenu),n=l.useRef(null),o=ie(t,n);return l.useEffect(()=>{const s=n.current;if(s)return is(s)},[]),c.jsx(Ps,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:G(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),aw=l.forwardRef((e,t)=>{const r=Pt(qe,e.__scopeMenu);return c.jsx(Ps,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),lw=Mu("MenuContent.ScrollLock"),Ps=l.forwardRef((e,t)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:p,onFocusOutside:f,onInteractOutside:m,onDismiss:g,disableOutsideScroll:x,...h}=e,y=Pt(qe,r),v=Br(qe,r),b=Vr(r),S=Iu(r),C=ew(r),[N,_]=l.useState(null),j=l.useRef(null),$=ie(t,j,y.onContentChange),D=l.useRef(0),O=l.useRef(""),P=l.useRef(0),A=l.useRef(null),M=l.useRef("right"),z=l.useRef(0),q=x?_n:l.Fragment,H=x?{as:lw,allowPinchZoom:!0}:void 0,k=L=>{var I,Z;const re=O.current+L,F=C().filter(X=>!X.disabled),te=document.activeElement,ce=(I=F.find(X=>X.ref.current===te))==null?void 0:I.textValue,de=F.map(X=>X.textValue),ge=bw(de,re,ce),me=(Z=F.find(X=>X.textValue===ge))==null?void 0:Z.ref.current;(function X(ne){O.current=ne,window.clearTimeout(D.current),ne!==""&&(D.current=window.setTimeout(()=>X(""),1e3))})(re),me&&setTimeout(()=>me.focus())};l.useEffect(()=>()=>window.clearTimeout(D.current),[]),Yo();const W=l.useCallback(L=>{var F,te;return M.current===((F=A.current)==null?void 0:F.side)&&Sw(L,(te=A.current)==null?void 0:te.area)},[]);return c.jsx(sw,{scope:r,searchRef:O,onItemEnter:l.useCallback(L=>{W(L)&&L.preventDefault()},[W]),onItemLeave:l.useCallback(L=>{var re;W(L)||((re=j.current)==null||re.focus(),_(null))},[W]),onTriggerLeave:l.useCallback(L=>{W(L)&&L.preventDefault()},[W]),pointerGraceTimerRef:P,onPointerGraceIntentChange:l.useCallback(L=>{A.current=L},[]),children:c.jsx(q,{...H,children:c.jsx(bn,{asChild:!0,trapped:o,onMountAutoFocus:G(s,L=>{var re;L.preventDefault(),(re=j.current)==null||re.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:c.jsx(Dr,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:d,onPointerDownOutside:p,onFocusOutside:f,onInteractOutside:m,onDismiss:g,children:c.jsx(Yc,{asChild:!0,...S,dir:v.dir,orientation:"vertical",loop:n,currentTabStopId:N,onCurrentTabStopIdChange:_,onEntryFocus:G(u,L=>{v.isUsingKeyboardRef.current||L.preventDefault()}),preventScrollOnEntryFocus:!0,children:c.jsx(os,{role:"menu","aria-orientation":"vertical","data-state":nd(y.open),"data-radix-menu-content":"",dir:v.dir,...b,...h,ref:$,style:{outline:"none",...h.style},onKeyDown:G(h.onKeyDown,L=>{const F=L.target.closest("[data-radix-menu-content]")===L.currentTarget,te=L.ctrlKey||L.altKey||L.metaKey,ce=L.key.length===1;F&&(L.key==="Tab"&&L.preventDefault(),!te&&ce&&k(L.key));const de=j.current;if(L.target!==de||!Qb.includes(L.key))return;L.preventDefault();const me=C().filter(I=>!I.disabled).map(I=>I.ref.current);ku.includes(L.key)&&me.reverse(),vw(me)}),onBlur:G(e.onBlur,L=>{L.currentTarget.contains(L.target)||(window.clearTimeout(D.current),O.current="")}),onPointerMove:G(e.onPointerMove,jr(L=>{const re=L.target,F=z.current!==L.clientX;if(L.currentTarget.contains(re)&&F){const te=L.clientX>z.current?"right":"left";M.current=te,z.current=L.clientX}}))})})})})})})});Vu.displayName=qe;var cw="MenuGroup",As=l.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return c.jsx(Lr.div,{role:"group",...n,ref:t})});As.displayName=cw;var uw="MenuLabel",Bu=l.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return c.jsx(Lr.div,{...n,ref:t})});Bu.displayName=uw;var ln="MenuItem",Ji="menu.itemSelect",Hn=l.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:n,...o}=e,s=l.useRef(null),i=Br(ln,e.__scopeMenu),a=_s(ln,e.__scopeMenu),u=ie(t,s),d=l.useRef(!1),p=()=>{const f=s.current;if(!r&&f){const m=new CustomEvent(Ji,{bubbles:!0,cancelable:!0});f.addEventListener(Ji,g=>n==null?void 0:n(g),{once:!0}),qb(f,m),m.defaultPrevented?d.current=!1:i.onClose()}};return c.jsx(Wu,{...o,ref:u,disabled:r,onClick:G(e.onClick,p),onPointerDown:f=>{var m;(m=e.onPointerDown)==null||m.call(e,f),d.current=!0},onPointerUp:G(e.onPointerUp,f=>{var m;d.current||(m=f.currentTarget)==null||m.click()}),onKeyDown:G(e.onKeyDown,f=>{const m=a.searchRef.current!=="";r||m&&f.key===" "||Do.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});Hn.displayName=ln;var Wu=l.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:n=!1,textValue:o,...s}=e,i=_s(ln,r),a=Iu(r),u=l.useRef(null),d=ie(t,u),[p,f]=l.useState(!1),[m,g]=l.useState("");return l.useEffect(()=>{const x=u.current;x&&g((x.textContent??"").trim())},[s.children]),c.jsx(Er.ItemSlot,{scope:r,disabled:n,textValue:o??m,children:c.jsx(qc,{asChild:!0,...a,focusable:!n,children:c.jsx(Lr.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...s,ref:d,onPointerMove:G(e.onPointerMove,jr(x=>{n?i.onItemLeave(x):(i.onItemEnter(x),x.defaultPrevented||x.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:G(e.onPointerLeave,jr(x=>i.onItemLeave(x))),onFocus:G(e.onFocus,()=>f(!0)),onBlur:G(e.onBlur,()=>f(!1))})})})}),dw="MenuCheckboxItem",Hu=l.forwardRef((e,t)=>{const{checked:r=!1,onCheckedChange:n,...o}=e;return c.jsx(Yu,{scope:e.__scopeMenu,checked:r,children:c.jsx(Hn,{role:"menuitemcheckbox","aria-checked":cn(r)?"mixed":r,...o,ref:t,"data-state":ks(r),onSelect:G(o.onSelect,()=>n==null?void 0:n(cn(r)?!0:!r),{checkForDefaultPrevented:!1})})})});Hu.displayName=dw;var Uu="MenuRadioGroup",[fw,pw]=Lt(Uu,{value:void 0,onValueChange:()=>{}}),zu=l.forwardRef((e,t)=>{const{value:r,onValueChange:n,...o}=e,s=je(n);return c.jsx(fw,{scope:e.__scopeMenu,value:r,onValueChange:s,children:c.jsx(As,{...o,ref:t})})});zu.displayName=Uu;var Gu="MenuRadioItem",Ku=l.forwardRef((e,t)=>{const{value:r,...n}=e,o=pw(Gu,e.__scopeMenu),s=r===o.value;return c.jsx(Yu,{scope:e.__scopeMenu,checked:s,children:c.jsx(Hn,{role:"menuitemradio","aria-checked":s,...n,ref:t,"data-state":ks(s),onSelect:G(n.onSelect,()=>{var i;return(i=o.onValueChange)==null?void 0:i.call(o,r)},{checkForDefaultPrevented:!1})})})});Ku.displayName=Gu;var Ts="MenuItemIndicator",[Yu,mw]=Lt(Ts,{checked:!1}),qu=l.forwardRef((e,t)=>{const{__scopeMenu:r,forceMount:n,...o}=e,s=mw(Ts,r);return c.jsx($e,{present:n||cn(s.checked)||s.checked===!0,children:c.jsx(Lr.span,{...o,ref:t,"data-state":ks(s.checked)})})});qu.displayName=Ts;var hw="MenuSeparator",Xu=l.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return c.jsx(Lr.div,{role:"separator","aria-orientation":"horizontal",...n,ref:t})});Xu.displayName=hw;var gw="MenuArrow",Qu=l.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,o=Vr(r);return c.jsx(ss,{...o,...n,ref:t})});Qu.displayName=gw;var Ms="MenuSub",[xw,Zu]=Lt(Ms),Ju=e=>{const{__scopeMenu:t,children:r,open:n=!1,onOpenChange:o}=e,s=Pt(Ms,t),i=Vr(t),[a,u]=l.useState(null),[d,p]=l.useState(null),f=je(o);return l.useEffect(()=>(s.open===!1&&f(!1),()=>f(!1)),[s.open,f]),c.jsx(En,{...i,children:c.jsx(Ou,{scope:t,open:n,onOpenChange:f,content:d,onContentChange:p,children:c.jsx(xw,{scope:t,contentId:Ue(),triggerId:Ue(),trigger:a,onTriggerChange:u,children:r})})})};Ju.displayName=Ms;var xr="MenuSubTrigger",ed=l.forwardRef((e,t)=>{const r=Pt(xr,e.__scopeMenu),n=Br(xr,e.__scopeMenu),o=Zu(xr,e.__scopeMenu),s=_s(xr,e.__scopeMenu),i=l.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:u}=s,d={__scopeMenu:e.__scopeMenu},p=l.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return l.useEffect(()=>p,[p]),l.useEffect(()=>{const f=a.current;return()=>{window.clearTimeout(f),u(null)}},[a,u]),c.jsx(js,{asChild:!0,...d,children:c.jsx(Wu,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":o.contentId,"data-state":nd(r.open),...e,ref:we(t,o.onTriggerChange),onClick:f=>{var m;(m=e.onClick)==null||m.call(e,f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:G(e.onPointerMove,jr(f=>{s.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!r.open&&!i.current&&(s.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{r.onOpenChange(!0),p()},100))})),onPointerLeave:G(e.onPointerLeave,jr(f=>{var g,x;p();const m=(g=r.content)==null?void 0:g.getBoundingClientRect();if(m){const h=(x=r.content)==null?void 0:x.dataset.side,y=h==="right",v=y?-5:5,b=m[y?"left":"right"],S=m[y?"right":"left"];s.onPointerGraceIntentChange({area:[{x:f.clientX+v,y:f.clientY},{x:b,y:m.top},{x:S,y:m.top},{x:S,y:m.bottom},{x:b,y:m.bottom}],side:h}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(f),f.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:G(e.onKeyDown,f=>{var g;const m=s.searchRef.current!=="";e.disabled||m&&f.key===" "||Zb[n.dir].includes(f.key)&&(r.onOpenChange(!0),(g=r.content)==null||g.focus(),f.preventDefault())})})})});ed.displayName=xr;var td="MenuSubContent",rd=l.forwardRef((e,t)=>{const r=Lu(qe,e.__scopeMenu),{forceMount:n=r.forceMount,...o}=e,s=Pt(qe,e.__scopeMenu),i=Br(qe,e.__scopeMenu),a=Zu(td,e.__scopeMenu),u=l.useRef(null),d=ie(t,u);return c.jsx(Er.Provider,{scope:e.__scopeMenu,children:c.jsx($e,{present:n||s.open,children:c.jsx(Er.Slot,{scope:e.__scopeMenu,children:c.jsx(Ps,{id:a.contentId,"aria-labelledby":a.triggerId,...o,ref:d,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:p=>{var f;i.isUsingKeyboardRef.current&&((f=u.current)==null||f.focus()),p.preventDefault()},onCloseAutoFocus:p=>p.preventDefault(),onFocusOutside:G(e.onFocusOutside,p=>{p.target!==a.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:G(e.onEscapeKeyDown,p=>{i.onClose(),p.preventDefault()}),onKeyDown:G(e.onKeyDown,p=>{var g;const f=p.currentTarget.contains(p.target),m=Jb[i.dir].includes(p.key);f&&m&&(s.onOpenChange(!1),(g=a.trigger)==null||g.focus(),p.preventDefault())})})})})})});rd.displayName=td;function nd(e){return e?"open":"closed"}function cn(e){return e==="indeterminate"}function ks(e){return cn(e)?"indeterminate":e?"checked":"unchecked"}function vw(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function yw(e,t){return e.map((r,n)=>e[(t+n)%e.length])}function bw(e,t,r){const o=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,s=r?e.indexOf(r):-1;let i=yw(e,Math.max(s,0));o.length===1&&(i=i.filter(d=>d!==r));const u=i.find(d=>d.toLowerCase().startsWith(o.toLowerCase()));return u!==r?u:void 0}function ww(e,t){const{x:r,y:n}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s],u=t[i],d=a.x,p=a.y,f=u.x,m=u.y;p>n!=m>n&&r<(f-d)*(n-p)/(m-p)+d&&(o=!o)}return o}function Sw(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return ww(r,t)}function jr(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Cw=$u,Nw=js,Ew=Fu,jw=Vu,Rw=As,_w=Bu,Pw=Hn,Aw=Hu,Tw=zu,Mw=Ku,kw=qu,Dw=Xu,Iw=Qu,Ow=Ju,$w=ed,Lw=rd,Un="DropdownMenu",[Fw]=Tb(Un,[Du]),Me=Du(),[Vw,od]=Fw(Un),sd=e=>{const{__scopeDropdownMenu:t,children:r,dir:n,open:o,defaultOpen:s,onOpenChange:i,modal:a=!0}=e,u=Me(t),d=l.useRef(null),[p,f]=ct({prop:o,defaultProp:s??!1,onChange:i,caller:Un});return c.jsx(Vw,{scope:t,triggerId:Ue(),triggerRef:d,contentId:Ue(),open:p,onOpenChange:f,onOpenToggle:l.useCallback(()=>f(m=>!m),[f]),modal:a,children:c.jsx(Cw,{...u,open:p,onOpenChange:f,dir:n,modal:a,children:r})})};sd.displayName=Un;var id="DropdownMenuTrigger",ad=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...o}=e,s=od(id,r),i=Me(r);return c.jsx(Nw,{asChild:!0,...i,children:c.jsx(Vb.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...o,ref:we(t,s.triggerRef),onPointerDown:G(e.onPointerDown,a=>{!n&&a.button===0&&a.ctrlKey===!1&&(s.onOpenToggle(),s.open||a.preventDefault())}),onKeyDown:G(e.onKeyDown,a=>{n||(["Enter"," "].includes(a.key)&&s.onOpenToggle(),a.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});ad.displayName=id;var Bw="DropdownMenuPortal",ld=e=>{const{__scopeDropdownMenu:t,...r}=e,n=Me(t);return c.jsx(Ew,{...n,...r})};ld.displayName=Bw;var cd="DropdownMenuContent",ud=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=od(cd,r),s=Me(r),i=l.useRef(!1);return c.jsx(jw,{id:o.contentId,"aria-labelledby":o.triggerId,...s,...n,ref:t,onCloseAutoFocus:G(e.onCloseAutoFocus,a=>{var u;i.current||(u=o.triggerRef.current)==null||u.focus(),i.current=!1,a.preventDefault()}),onInteractOutside:G(e.onInteractOutside,a=>{const u=a.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,p=u.button===2||d;(!o.modal||p)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});ud.displayName=cd;var Ww="DropdownMenuGroup",dd=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=Me(r);return c.jsx(Rw,{...o,...n,ref:t})});dd.displayName=Ww;var Hw="DropdownMenuLabel",fd=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=Me(r);return c.jsx(_w,{...o,...n,ref:t})});fd.displayName=Hw;var Uw="DropdownMenuItem",pd=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=Me(r);return c.jsx(Pw,{...o,...n,ref:t})});pd.displayName=Uw;var zw="DropdownMenuCheckboxItem",md=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=Me(r);return c.jsx(Aw,{...o,...n,ref:t})});md.displayName=zw;var Gw="DropdownMenuRadioGroup",hd=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=Me(r);return c.jsx(Tw,{...o,...n,ref:t})});hd.displayName=Gw;var Kw="DropdownMenuRadioItem",gd=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=Me(r);return c.jsx(Mw,{...o,...n,ref:t})});gd.displayName=Kw;var Yw="DropdownMenuItemIndicator",xd=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=Me(r);return c.jsx(kw,{...o,...n,ref:t})});xd.displayName=Yw;var qw="DropdownMenuSeparator",vd=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=Me(r);return c.jsx(Dw,{...o,...n,ref:t})});vd.displayName=qw;var Xw="DropdownMenuArrow",Qw=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=Me(r);return c.jsx(Iw,{...o,...n,ref:t})});Qw.displayName=Xw;var Zw=e=>{const{__scopeDropdownMenu:t,children:r,open:n,onOpenChange:o,defaultOpen:s}=e,i=Me(t),[a,u]=ct({prop:n,defaultProp:s??!1,onChange:o,caller:"DropdownMenuSub"});return c.jsx(Ow,{...i,open:a,onOpenChange:u,children:r})},Jw="DropdownMenuSubTrigger",yd=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=Me(r);return c.jsx($w,{...o,...n,ref:t})});yd.displayName=Jw;var eS="DropdownMenuSubContent",bd=l.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,o=Me(r);return c.jsx(Lw,{...o,...n,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});bd.displayName=eS;var tS=sd,rS=ad,wd=ld,Sd=ud,nS=dd,Cd=fd,Nd=pd,Ed=md,oS=hd,jd=gd,Rd=xd,_d=vd,sS=Zw,Pd=yd,Ad=bd;const Ds=tS,Is=rS,iS=nS,aS=wd,lS=sS,cS=oS,Td=l.forwardRef(({className:e,inset:t,children:r,...n},o)=>c.jsxs(Pd,{ref:o,className:T("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...n,children:[r,c.jsx(xn,{className:"ml-auto h-4 w-4"})]}));Td.displayName=Pd.displayName;const Md=l.forwardRef(({className:e,...t},r)=>c.jsx(Ad,{ref:r,className:T("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));Md.displayName=Ad.displayName;const zn=l.forwardRef(({className:e,sideOffset:t=4,...r},n)=>c.jsx(wd,{children:c.jsx(Sd,{ref:n,sideOffset:t,className:T("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));zn.displayName=Sd.displayName;const Rr=l.forwardRef(({className:e,inset:t,...r},n)=>c.jsx(Nd,{ref:n,className:T("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...r}));Rr.displayName=Nd.displayName;const kd=l.forwardRef(({className:e,children:t,checked:r,...n},o)=>c.jsxs(Ed,{ref:o,className:T("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...n,children:[c.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:c.jsx(Rd,{children:c.jsx(wr,{className:"h-4 w-4"})})}),t]}));kd.displayName=Ed.displayName;const Dd=l.forwardRef(({className:e,children:t,...r},n)=>c.jsxs(jd,{ref:n,className:T("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[c.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:c.jsx(Rd,{children:c.jsx(Vp,{className:"h-2 w-2 fill-current"})})}),t]}));Dd.displayName=jd.displayName;const Gn=l.forwardRef(({className:e,inset:t,...r},n)=>c.jsx(Cd,{ref:n,className:T("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...r}));Gn.displayName=Cd.displayName;const _r=l.forwardRef(({className:e,...t},r)=>c.jsx(_d,{ref:r,className:T("-mx-1 my-1 h-px bg-muted",e),...t}));_r.displayName=_d.displayName;const Id=({className:e,...t})=>c.jsx("span",{className:T("ml-auto text-xs tracking-widest opacity-60",e),...t});Id.displayName="DropdownMenuShortcut";function uS(e){const t=dS(e),r=l.forwardRef((n,o)=>{const{children:s,...i}=n,a=l.Children.toArray(s),u=a.find(pS);if(u){const d=u.props.children,p=a.map(f=>f===u?l.Children.count(d)>1?l.Children.only(null):l.isValidElement(d)?d.props.children:null:f);return c.jsx(t,{...i,ref:o,children:l.isValidElement(d)?l.cloneElement(d,void 0,p):null})}return c.jsx(t,{...i,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}function dS(e){const t=l.forwardRef((r,n)=>{const{children:o,...s}=r;if(l.isValidElement(o)){const i=hS(o),a=mS(s,o.props);return o.type!==l.Fragment&&(a.ref=n?we(n,i):i),l.cloneElement(o,a)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var fS=Symbol("radix.slottable");function pS(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===fS}function mS(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...a)=>{const u=s(...a);return o(...a),u}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function hS(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var gS=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Wr=gS.reduce((e,t)=>{const r=uS(`Primitive.${t}`),n=l.forwardRef((o,s)=>{const{asChild:i,...a}=o,u=i?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(u,{...a,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function xS(e,t=[]){let r=[];function n(s,i){const a=l.createContext(i),u=r.length;r=[...r,i];const d=f=>{var v;const{scope:m,children:g,...x}=f,h=((v=m==null?void 0:m[e])==null?void 0:v[u])||a,y=l.useMemo(()=>x,Object.values(x));return c.jsx(h.Provider,{value:y,children:g})};d.displayName=s+"Provider";function p(f,m){var h;const g=((h=m==null?void 0:m[e])==null?void 0:h[u])||a,x=l.useContext(g);if(x)return x;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[d,p]}const o=()=>{const s=r.map(i=>l.createContext(i));return function(a){const u=(a==null?void 0:a[e])||s;return l.useMemo(()=>({[`__scope${e}`]:{...a,[e]:u}}),[a,u])}};return o.scopeName=e,[n,vS(o,...t)]}function vS(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=n.reduce((a,{useScope:u,scopeName:d})=>{const f=u(s)[`__scope${d}`];return{...a,...f}},{});return l.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}function yS(e,t){return l.useReducer((r,n)=>t[r][n]??r,e)}var Os="ScrollArea",[Od]=xS(Os),[bS,Xe]=Od(Os),$d=l.forwardRef((e,t)=>{const{__scopeScrollArea:r,type:n="hover",dir:o,scrollHideDelay:s=600,...i}=e,[a,u]=l.useState(null),[d,p]=l.useState(null),[f,m]=l.useState(null),[g,x]=l.useState(null),[h,y]=l.useState(null),[v,b]=l.useState(0),[S,C]=l.useState(0),[N,_]=l.useState(!1),[j,$]=l.useState(!1),D=ie(t,P=>u(P)),O=kr(o);return c.jsx(bS,{scope:r,type:n,dir:O,scrollHideDelay:s,scrollArea:a,viewport:d,onViewportChange:p,content:f,onContentChange:m,scrollbarX:g,onScrollbarXChange:x,scrollbarXEnabled:N,onScrollbarXEnabledChange:_,scrollbarY:h,onScrollbarYChange:y,scrollbarYEnabled:j,onScrollbarYEnabledChange:$,onCornerWidthChange:b,onCornerHeightChange:C,children:c.jsx(Wr.div,{dir:O,...i,ref:D,style:{position:"relative","--radix-scroll-area-corner-width":v+"px","--radix-scroll-area-corner-height":S+"px",...e.style}})})});$d.displayName=Os;var Ld="ScrollAreaViewport",Fd=l.forwardRef((e,t)=>{const{__scopeScrollArea:r,children:n,nonce:o,...s}=e,i=Xe(Ld,r),a=l.useRef(null),u=ie(t,a,i.onViewportChange);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),c.jsx(Wr.div,{"data-radix-scroll-area-viewport":"",...s,ref:u,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...e.style},children:c.jsx("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});Fd.displayName=Ld;var ft="ScrollAreaScrollbar",$s=l.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=Xe(ft,e.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:i}=o,a=e.orientation==="horizontal";return l.useEffect(()=>(a?s(!0):i(!0),()=>{a?s(!1):i(!1)}),[a,s,i]),o.type==="hover"?c.jsx(wS,{...n,ref:t,forceMount:r}):o.type==="scroll"?c.jsx(SS,{...n,ref:t,forceMount:r}):o.type==="auto"?c.jsx(Vd,{...n,ref:t,forceMount:r}):o.type==="always"?c.jsx(Ls,{...n,ref:t}):null});$s.displayName=ft;var wS=l.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=Xe(ft,e.__scopeScrollArea),[s,i]=l.useState(!1);return l.useEffect(()=>{const a=o.scrollArea;let u=0;if(a){const d=()=>{window.clearTimeout(u),i(!0)},p=()=>{u=window.setTimeout(()=>i(!1),o.scrollHideDelay)};return a.addEventListener("pointerenter",d),a.addEventListener("pointerleave",p),()=>{window.clearTimeout(u),a.removeEventListener("pointerenter",d),a.removeEventListener("pointerleave",p)}}},[o.scrollArea,o.scrollHideDelay]),c.jsx($e,{present:r||s,children:c.jsx(Vd,{"data-state":s?"visible":"hidden",...n,ref:t})})}),SS=l.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=Xe(ft,e.__scopeScrollArea),s=e.orientation==="horizontal",i=Yn(()=>u("SCROLL_END"),100),[a,u]=yS("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return l.useEffect(()=>{if(a==="idle"){const d=window.setTimeout(()=>u("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(d)}},[a,o.scrollHideDelay,u]),l.useEffect(()=>{const d=o.viewport,p=s?"scrollLeft":"scrollTop";if(d){let f=d[p];const m=()=>{const g=d[p];f!==g&&(u("SCROLL"),i()),f=g};return d.addEventListener("scroll",m),()=>d.removeEventListener("scroll",m)}},[o.viewport,s,u,i]),c.jsx($e,{present:r||a!=="hidden",children:c.jsx(Ls,{"data-state":a==="hidden"?"hidden":"visible",...n,ref:t,onPointerEnter:G(e.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:G(e.onPointerLeave,()=>u("POINTER_LEAVE"))})})}),Vd=l.forwardRef((e,t)=>{const r=Xe(ft,e.__scopeScrollArea),{forceMount:n,...o}=e,[s,i]=l.useState(!1),a=e.orientation==="horizontal",u=Yn(()=>{if(r.viewport){const d=r.viewport.offsetWidth<r.viewport.scrollWidth,p=r.viewport.offsetHeight<r.viewport.scrollHeight;i(a?d:p)}},10);return nr(r.viewport,u),nr(r.content,u),c.jsx($e,{present:n||s,children:c.jsx(Ls,{"data-state":s?"visible":"hidden",...o,ref:t})})}),Ls=l.forwardRef((e,t)=>{const{orientation:r="vertical",...n}=e,o=Xe(ft,e.__scopeScrollArea),s=l.useRef(null),i=l.useRef(0),[a,u]=l.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=zd(a.viewport,a.content),p={...n,sizes:a,onSizesChange:u,hasThumb:d>0&&d<1,onThumbChange:m=>s.current=m,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:m=>i.current=m};function f(m,g){return _S(m,i.current,a,g)}return r==="horizontal"?c.jsx(CS,{...p,ref:t,onThumbPositionChange:()=>{if(o.viewport&&s.current){const m=o.viewport.scrollLeft,g=ea(m,a,o.dir);s.current.style.transform=`translate3d(${g}px, 0, 0)`}},onWheelScroll:m=>{o.viewport&&(o.viewport.scrollLeft=m)},onDragScroll:m=>{o.viewport&&(o.viewport.scrollLeft=f(m,o.dir))}}):r==="vertical"?c.jsx(NS,{...p,ref:t,onThumbPositionChange:()=>{if(o.viewport&&s.current){const m=o.viewport.scrollTop,g=ea(m,a);s.current.style.transform=`translate3d(0, ${g}px, 0)`}},onWheelScroll:m=>{o.viewport&&(o.viewport.scrollTop=m)},onDragScroll:m=>{o.viewport&&(o.viewport.scrollTop=f(m))}}):null}),CS=l.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...o}=e,s=Xe(ft,e.__scopeScrollArea),[i,a]=l.useState(),u=l.useRef(null),d=ie(t,u,s.onScrollbarXChange);return l.useEffect(()=>{u.current&&a(getComputedStyle(u.current))},[u]),c.jsx(Wd,{"data-orientation":"horizontal",...o,ref:d,sizes:r,style:{bottom:0,left:s.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:s.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Kn(r)+"px",...e.style},onThumbPointerDown:p=>e.onThumbPointerDown(p.x),onDragScroll:p=>e.onDragScroll(p.x),onWheelScroll:(p,f)=>{if(s.viewport){const m=s.viewport.scrollLeft+p.deltaX;e.onWheelScroll(m),Kd(m,f)&&p.preventDefault()}},onResize:()=>{u.current&&s.viewport&&i&&n({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:dn(i.paddingLeft),paddingEnd:dn(i.paddingRight)}})}})}),NS=l.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...o}=e,s=Xe(ft,e.__scopeScrollArea),[i,a]=l.useState(),u=l.useRef(null),d=ie(t,u,s.onScrollbarYChange);return l.useEffect(()=>{u.current&&a(getComputedStyle(u.current))},[u]),c.jsx(Wd,{"data-orientation":"vertical",...o,ref:d,sizes:r,style:{top:0,right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Kn(r)+"px",...e.style},onThumbPointerDown:p=>e.onThumbPointerDown(p.y),onDragScroll:p=>e.onDragScroll(p.y),onWheelScroll:(p,f)=>{if(s.viewport){const m=s.viewport.scrollTop+p.deltaY;e.onWheelScroll(m),Kd(m,f)&&p.preventDefault()}},onResize:()=>{u.current&&s.viewport&&i&&n({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:dn(i.paddingTop),paddingEnd:dn(i.paddingBottom)}})}})}),[ES,Bd]=Od(ft),Wd=l.forwardRef((e,t)=>{const{__scopeScrollArea:r,sizes:n,hasThumb:o,onThumbChange:s,onThumbPointerUp:i,onThumbPointerDown:a,onThumbPositionChange:u,onDragScroll:d,onWheelScroll:p,onResize:f,...m}=e,g=Xe(ft,r),[x,h]=l.useState(null),y=ie(t,D=>h(D)),v=l.useRef(null),b=l.useRef(""),S=g.viewport,C=n.content-n.viewport,N=je(p),_=je(u),j=Yn(f,10);function $(D){if(v.current){const O=D.clientX-v.current.left,P=D.clientY-v.current.top;d({x:O,y:P})}}return l.useEffect(()=>{const D=O=>{const P=O.target;(x==null?void 0:x.contains(P))&&N(O,C)};return document.addEventListener("wheel",D,{passive:!1}),()=>document.removeEventListener("wheel",D,{passive:!1})},[S,x,C,N]),l.useEffect(_,[n,_]),nr(x,j),nr(g.content,j),c.jsx(ES,{scope:r,scrollbar:x,hasThumb:o,onThumbChange:je(s),onThumbPointerUp:je(i),onThumbPositionChange:_,onThumbPointerDown:je(a),children:c.jsx(Wr.div,{...m,ref:y,style:{position:"absolute",...m.style},onPointerDown:G(e.onPointerDown,D=>{D.button===0&&(D.target.setPointerCapture(D.pointerId),v.current=x.getBoundingClientRect(),b.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",g.viewport&&(g.viewport.style.scrollBehavior="auto"),$(D))}),onPointerMove:G(e.onPointerMove,$),onPointerUp:G(e.onPointerUp,D=>{const O=D.target;O.hasPointerCapture(D.pointerId)&&O.releasePointerCapture(D.pointerId),document.body.style.webkitUserSelect=b.current,g.viewport&&(g.viewport.style.scrollBehavior=""),v.current=null})})})}),un="ScrollAreaThumb",Hd=l.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=Bd(un,e.__scopeScrollArea);return c.jsx($e,{present:r||o.hasThumb,children:c.jsx(jS,{ref:t,...n})})}),jS=l.forwardRef((e,t)=>{const{__scopeScrollArea:r,style:n,...o}=e,s=Xe(un,r),i=Bd(un,r),{onThumbPositionChange:a}=i,u=ie(t,f=>i.onThumbChange(f)),d=l.useRef(void 0),p=Yn(()=>{d.current&&(d.current(),d.current=void 0)},100);return l.useEffect(()=>{const f=s.viewport;if(f){const m=()=>{if(p(),!d.current){const g=PS(f,a);d.current=g,a()}};return a(),f.addEventListener("scroll",m),()=>f.removeEventListener("scroll",m)}},[s.viewport,p,a]),c.jsx(Wr.div,{"data-state":i.hasThumb?"visible":"hidden",...o,ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:G(e.onPointerDownCapture,f=>{const g=f.target.getBoundingClientRect(),x=f.clientX-g.left,h=f.clientY-g.top;i.onThumbPointerDown({x,y:h})}),onPointerUp:G(e.onPointerUp,i.onThumbPointerUp)})});Hd.displayName=un;var Fs="ScrollAreaCorner",Ud=l.forwardRef((e,t)=>{const r=Xe(Fs,e.__scopeScrollArea),n=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&n?c.jsx(RS,{...e,ref:t}):null});Ud.displayName=Fs;var RS=l.forwardRef((e,t)=>{const{__scopeScrollArea:r,...n}=e,o=Xe(Fs,r),[s,i]=l.useState(0),[a,u]=l.useState(0),d=!!(s&&a);return nr(o.scrollbarX,()=>{var f;const p=((f=o.scrollbarX)==null?void 0:f.offsetHeight)||0;o.onCornerHeightChange(p),u(p)}),nr(o.scrollbarY,()=>{var f;const p=((f=o.scrollbarY)==null?void 0:f.offsetWidth)||0;o.onCornerWidthChange(p),i(p)}),d?c.jsx(Wr.div,{...n,ref:t,style:{width:s,height:a,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function dn(e){return e?parseInt(e,10):0}function zd(e,t){const r=e/t;return isNaN(r)?0:r}function Kn(e){const t=zd(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function _S(e,t,r,n="ltr"){const o=Kn(r),s=o/2,i=t||s,a=o-i,u=r.scrollbar.paddingStart+i,d=r.scrollbar.size-r.scrollbar.paddingEnd-a,p=r.content-r.viewport,f=n==="ltr"?[0,p]:[p*-1,0];return Gd([u,d],f)(e)}function ea(e,t,r="ltr"){const n=Kn(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-o,i=t.content-t.viewport,a=s-n,u=r==="ltr"?[0,i]:[i*-1,0],d=yo(e,u);return Gd([0,i],[0,a])(d)}function Gd(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function Kd(e,t){return e>0&&e<t}var PS=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return function o(){const s={left:e.scrollLeft,top:e.scrollTop},i=r.left!==s.left,a=r.top!==s.top;(i||a)&&t(),r=s,n=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(n)};function Yn(e,t){const r=je(e),n=l.useRef(0);return l.useEffect(()=>()=>window.clearTimeout(n.current),[]),l.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function nr(e,t){const r=je(t);Ne(()=>{let n=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(r)});return o.observe(e),()=>{window.cancelAnimationFrame(n),o.unobserve(e)}}},[e,r])}var Yd=$d,AS=Fd,TS=Ud;const qd=l.forwardRef(({className:e,children:t,...r},n)=>c.jsxs(Yd,{ref:n,className:T("relative overflow-hidden",e),...r,children:[c.jsx(AS,{className:"h-full w-full rounded-[inherit]",children:t}),c.jsx(Vs,{}),c.jsx(TS,{})]}));qd.displayName=Yd.displayName;const Vs=l.forwardRef(({className:e,orientation:t="vertical",...r},n)=>c.jsx($s,{ref:n,orientation:t,className:T("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...r,children:c.jsx(Hd,{className:"relative flex-1 rounded-full bg-border"})}));Vs.displayName=$s.displayName;const Xd=hn("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive",success:"border-green-500/50 text-green-700 dark:text-green-400 [&>svg]:text-green-500",warning:"border-yellow-500/50 text-yellow-700 dark:text-yellow-400 [&>svg]:text-yellow-500",info:"border-blue-500/50 text-blue-700 dark:text-blue-400 [&>svg]:text-blue-500"}},defaultVariants:{variant:"default"}}),Bs=l.forwardRef(({className:e,variant:t,...r},n)=>c.jsx("div",{ref:n,role:"alert",className:T(Xd({variant:t}),e),...r}));Bs.displayName="Alert";const Ws=l.forwardRef(({className:e,...t},r)=>c.jsx("h5",{ref:r,className:T("mb-1 font-medium leading-none tracking-tight",e),...t}));Ws.displayName="AlertTitle";const Hs=l.forwardRef(({className:e,...t},r)=>c.jsx("div",{ref:r,className:T("text-sm [&_p]:leading-relaxed",e),...t}));Hs.displayName="AlertDescription";const Qd=l.forwardRef(({variant:e,title:t,children:r,className:n,...o},s)=>{const i={default:Ci,destructive:Fp,success:Lp,warning:$p,info:Ci},a=i[e]||i.default;return c.jsxs(Bs,{ref:s,variant:e,className:n,...o,children:[c.jsx(a,{className:"h-4 w-4"}),t&&c.jsx(Ws,{children:t}),r&&c.jsx(Hs,{children:r})]})});Qd.displayName="AlertWithIcon";const Us=l.forwardRef(({className:e,...t},r)=>c.jsx("div",{className:"relative w-full overflow-auto",children:c.jsx("table",{ref:r,className:T("w-full caption-bottom text-sm",e),...t})}));Us.displayName="Table";const zs=l.forwardRef(({className:e,...t},r)=>c.jsx("thead",{ref:r,className:T("[&_tr]:border-b",e),...t}));zs.displayName="TableHeader";const Gs=l.forwardRef(({className:e,...t},r)=>c.jsx("tbody",{ref:r,className:T("[&_tr:last-child]:border-0",e),...t}));Gs.displayName="TableBody";const Zd=l.forwardRef(({className:e,...t},r)=>c.jsx("tfoot",{ref:r,className:T("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));Zd.displayName="TableFooter";const zt=l.forwardRef(({className:e,...t},r)=>c.jsx("tr",{ref:r,className:T("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));zt.displayName="TableRow";const vr=l.forwardRef(({className:e,...t},r)=>c.jsx("th",{ref:r,className:T("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));vr.displayName="TableHead";const Tt=l.forwardRef(({className:e,...t},r)=>c.jsx("td",{ref:r,className:T("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));Tt.displayName="TableCell";const Jd=l.forwardRef(({className:e,...t},r)=>c.jsx("caption",{ref:r,className:T("mt-4 text-sm text-muted-foreground",e),...t}));Jd.displayName="TableCaption";const Ks=l.forwardRef(({options:e=[],value:t,onChange:r,onSearch:n,placeholder:o="Select...",searchPlaceholder:s="Search...",loading:i=!1,disabled:a=!1,multiple:u=!1,clearable:d=!0,className:p,renderOption:f,renderValue:m,getOptionLabel:g=C=>(C==null?void 0:C.label)||(C==null?void 0:C.name)||String(C),getOptionValue:x=C=>(C==null?void 0:C.value)||(C==null?void 0:C.id)||C,filterOption:h,noOptionsMessage:y="No options found",loadingMessage:v="Loading...",...b},S)=>{const[C,N]=l.useState(!1),[_,j]=l.useState(""),[$,D]=l.useState(0),O=l.useRef(null),P=l.useRef(null),A=l.useMemo(()=>_?h?e.filter(F=>h(F,_)):e.filter(F=>g(F).toLowerCase().includes(_.toLowerCase())):e,[e,_,h,g]),M=l.useMemo(()=>Ea(F=>{n==null||n(F)},300),[n]),z=F=>{const te=F.target.value;j(te),D(0),M(te)},q=F=>{if(u){const te=Array.isArray(t)?t:[],ce=x(F);te.some(ge=>x(ge)===ce)?r==null||r(te.filter(ge=>x(ge)!==ce)):r==null||r([...te,F])}else r==null||r(F),N(!1),j("")},H=F=>{F.stopPropagation(),r==null||r(u?[]:null),j("")},k=F=>{if(!C){(F.key==="Enter"||F.key===" "||F.key==="ArrowDown")&&(F.preventDefault(),N(!0));return}switch(F.key){case"ArrowDown":F.preventDefault(),D(te=>Math.min(te+1,A.length-1));break;case"ArrowUp":F.preventDefault(),D(te=>Math.max(te-1,0));break;case"Enter":F.preventDefault(),A[$]&&q(A[$]);break;case"Escape":F.preventDefault(),N(!1),j("");break}};l.useEffect(()=>{const F=te=>{O.current&&!O.current.contains(te.target)&&(N(!1),j(""))};return document.addEventListener("mousedown",F),()=>document.removeEventListener("mousedown",F)},[]);const W=F=>u?(Array.isArray(t)?t:[]).some(ce=>x(ce)===x(F)):t&&x(t)===x(F),L=u?Array.isArray(t)&&t.length>0:!!t,re=()=>{if(!L)return c.jsx("span",{className:"text-muted-foreground",children:o});if(m)return m(t);if(u){const F=Array.isArray(t)?t:[];return F.length===1?g(F[0]):`${F.length} selected`}return g(t)};return c.jsxs("div",{ref:O,className:T("relative w-full",p),...b,children:[c.jsxs("button",{ref:S,type:"button",role:"combobox","aria-expanded":C,"aria-haspopup":"listbox",disabled:a,onClick:()=>N(!C),onKeyDown:k,className:T("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",C&&"ring-2 ring-ring ring-offset-2"),children:[c.jsx("span",{className:"flex-1 text-left truncate",children:re()}),c.jsxs("div",{className:"flex items-center gap-1",children:[d&&L&&!a&&c.jsx(qt,{className:"h-4 w-4 opacity-50 hover:opacity-100 cursor-pointer",onClick:H}),c.jsx(gn,{className:T("h-4 w-4 opacity-50 transition-transform",C&&"rotate-180")})]})]}),C&&c.jsxs("div",{className:"absolute z-50 mt-1 w-full rounded-md border bg-popover text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95",children:[c.jsxs("div",{className:"flex items-center border-b px-3",children:[c.jsx(Fo,{className:"h-4 w-4 shrink-0 opacity-50"}),c.jsx("input",{ref:P,type:"text",value:_,onChange:z,placeholder:s,className:"flex h-10 w-full bg-transparent py-3 pl-2 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",autoFocus:!0}),i&&c.jsx(kt,{className:"h-4 w-4 animate-spin"})]}),c.jsx("div",{className:"max-h-60 overflow-auto p-1",children:i&&A.length===0?c.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:v}):A.length===0?c.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:y}):A.map((F,te)=>c.jsxs("div",{role:"option","aria-selected":W(F),onClick:()=>q(F),onMouseEnter:()=>D(te),className:T("relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none",$===te&&"bg-accent text-accent-foreground",W(F)&&"bg-accent/50"),children:[u&&c.jsx("div",{className:T("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",W(F)&&"bg-primary text-primary-foreground"),children:W(F)&&c.jsx(wr,{className:"h-3 w-3"})}),f?f(F):c.jsx("span",{className:"flex-1",children:g(F)}),!u&&W(F)&&c.jsx(wr,{className:"ml-auto h-4 w-4"})]},x(F)))})]})]})});Ks.displayName="SearchSelect";const ur=l.forwardRef(({className:e,label:t,description:r,error:n,required:o,children:s,...i},a)=>{const u=l.useId();return c.jsxs("div",{ref:a,className:T("space-y-2",e),...i,children:[t&&c.jsxs(Ct,{htmlFor:u,className:T(n&&"text-destructive"),children:[t,o&&c.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),l.Children.map(s,d=>l.isValidElement(d)?l.cloneElement(d,{id:u,"aria-invalid":!!n}):d),r&&!n&&c.jsx("p",{className:"text-sm text-muted-foreground",children:r}),n&&c.jsx("p",{className:"text-sm text-destructive",children:n})]})});ur.displayName="FormField";const fn=l.forwardRef(({label:e,description:t,error:r,required:n,className:o,inputClassName:s,onChange:i,...a},u)=>{const d=p=>{i==null||i(p.target.value)};return c.jsx(ur,{label:e,description:t,error:r,required:n,className:o,children:c.jsx(Jt,{ref:u,className:T(r&&"border-destructive",s),onChange:d,...a})})});fn.displayName="QInput";const Ys=l.forwardRef(({label:e,description:t,error:r,required:n,className:o,textareaClassName:s,onChange:i,...a},u)=>{const d=p=>{i==null||i(p.target.value)};return c.jsx(ur,{label:e,description:t,error:r,required:n,className:o,children:c.jsx(Vo,{ref:u,className:T(r&&"border-destructive",s),onChange:d,...a})})});Ys.displayName="QTextarea";const qs=l.forwardRef(({label:e,description:t,error:r,required:n,options:o=[],placeholder:s="Select...",className:i,value:a,onChange:u,getOptionLabel:d,getOptionValue:p,optionLabel:f,optionValue:m,...g},x)=>{const h=d||(f?v=>v==null?void 0:v[f]:v=>(v==null?void 0:v.label)||(v==null?void 0:v.name)||(v==null?void 0:v.display_name)||String(v)),y=p||(m?v=>v==null?void 0:v[m]:v=>(v==null?void 0:v.value)||(v==null?void 0:v.id)||v);return c.jsx(ur,{label:e,description:t,error:r,required:n,className:i,children:c.jsxs(ls,{value:a,onValueChange:u,...g,children:[c.jsx(Mn,{ref:x,className:T(r&&"border-destructive"),children:c.jsx(cs,{placeholder:s})}),c.jsx(kn,{children:o.map(v=>c.jsx(Dn,{value:String(y(v)),children:h(v)},y(v)))})]})})});qs.displayName="QSelect";const Xs=l.forwardRef(({label:e,description:t,error:r,required:n,className:o,...s},i)=>c.jsx(ur,{label:e,description:t,error:r,required:n,className:o,children:c.jsx(Ks,{ref:i,...s})}));Xs.displayName="QSearchSelect";const Qs=l.forwardRef(({label:e,description:t,error:r,className:n,checked:o,onCheckedChange:s,onChange:i,...a},u)=>{const d=l.useId(),p=f=>{i==null||i(f),s==null||s(f)};return c.jsxs("div",{className:T("flex items-center justify-between space-x-2",n),children:[c.jsxs("div",{className:"space-y-0.5",children:[e&&c.jsx(Ct,{htmlFor:d,className:"text-base",children:e}),t&&c.jsx("p",{className:"text-sm text-muted-foreground",children:t}),r&&c.jsx("p",{className:"text-sm text-destructive",children:r})]}),c.jsx(Go,{ref:u,id:d,checked:o,onCheckedChange:p,...a})]})});Qs.displayName="QSwitch";const Zs=l.forwardRef(({label:e,description:t,error:r,className:n,checked:o,onCheckedChange:s,...i},a)=>{const u=l.useId();return c.jsxs("div",{className:T("flex items-start space-x-2",n),children:[c.jsx(er,{ref:a,id:u,checked:o,onCheckedChange:s,className:"mt-1",...i}),c.jsxs("div",{className:"space-y-1 leading-none",children:[e&&c.jsx(Ct,{htmlFor:u,children:e}),t&&c.jsx("p",{className:"text-sm text-muted-foreground",children:t}),r&&c.jsx("p",{className:"text-sm text-destructive",children:r})]})]})});Zs.displayName="QCheckbox";const ef=l.forwardRef(({onSubmit:e,className:t,children:r,...n},o)=>{const s=i=>{i.preventDefault(),e==null||e(i)};return c.jsx("form",{ref:o,onSubmit:s,className:T("space-y-4",t),...n,children:r})});ef.displayName="QForm";const Js=({currentPage:e=1,totalPages:t=1,totalItems:r=0,pageSize:n=10,pageSizeOptions:o=[10,20,50,100],onPageChange:s,onPageSizeChange:i,showPageSizeSelector:a=!0,showInfo:u=!0,className:d})=>{const p=(e-1)*n+1,f=Math.min(e*n,r),m=e>1,g=e<t,x=()=>{const h=[];if(t<=5)for(let v=1;v<=t;v++)h.push(v);else{h.push(1),e>3&&h.push("...");const v=Math.max(2,e-1),b=Math.min(t-1,e+1);for(let S=v;S<=b;S++)h.push(S);e<t-2&&h.push("..."),t>1&&h.push(t)}return h};return c.jsxs("div",{className:T("flex flex-col sm:flex-row items-center justify-between gap-4 px-2 py-4",d),children:[c.jsxs("div",{className:"flex items-center gap-4",children:[a&&c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"text-sm text-muted-foreground",children:"Rows per page"}),c.jsxs(ls,{value:String(n),onValueChange:h=>i==null?void 0:i(Number(h)),children:[c.jsx(Mn,{className:"h-8 w-[70px]",children:c.jsx(cs,{placeholder:n})}),c.jsx(kn,{side:"top",children:o.map(h=>c.jsx(Dn,{value:String(h),children:h},h))})]})]}),u&&r>0&&c.jsxs("span",{className:"text-sm text-muted-foreground",children:["Showing ",p," to ",f," of ",r," results"]})]}),c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsxs(ae,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>s==null?void 0:s(1),disabled:!m,children:[c.jsx(Ip,{className:"h-4 w-4"}),c.jsx("span",{className:"sr-only",children:"First page"})]}),c.jsxs(ae,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>s==null?void 0:s(e-1),disabled:!m,children:[c.jsx(Ra,{className:"h-4 w-4"}),c.jsx("span",{className:"sr-only",children:"Previous page"})]}),c.jsx("div",{className:"flex items-center gap-1",children:x().map((h,y)=>h==="..."?c.jsx("span",{className:"px-2 text-muted-foreground",children:"..."},`ellipsis-${y}`):c.jsx(ae,{variant:e===h?"default":"outline",size:"icon",className:"h-8 w-8",onClick:()=>s==null?void 0:s(h),children:h},h))}),c.jsxs(ae,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>s==null?void 0:s(e+1),disabled:!g,children:[c.jsx(xn,{className:"h-4 w-4"}),c.jsx("span",{className:"sr-only",children:"Next page"})]}),c.jsxs(ae,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>s==null?void 0:s(t),disabled:!g,children:[c.jsx(Op,{className:"h-4 w-4"}),c.jsx("span",{className:"sr-only",children:"Last page"})]})]})]})};Js.displayName="Pagination";const or=({variant:e="spinner",size:t="default",text:r,className:n,fullScreen:o=!1,overlay:s=!1})=>{const i={sm:"h-4 w-4",default:"h-8 w-8",lg:"h-12 w-12",xl:"h-16 w-16"},a=T("flex flex-col items-center justify-center gap-3",o&&"fixed inset-0 z-50",s&&"bg-background/80 backdrop-blur-sm",n),u=()=>{switch(e){case"spinner":return c.jsx(kt,{className:T("animate-spin text-primary",i[t])});case"dots":return c.jsx("div",{className:"flex gap-1",children:[0,1,2].map(d=>c.jsx("div",{className:T("rounded-full bg-primary animate-bounce",t==="sm"&&"h-1.5 w-1.5",t==="default"&&"h-2 w-2",t==="lg"&&"h-3 w-3",t==="xl"&&"h-4 w-4"),style:{animationDelay:`${d*.15}s`}},d))});case"pulse":return c.jsx("div",{className:T("rounded-full bg-primary animate-pulse",i[t])});case"skeleton":return c.jsxs("div",{className:"space-y-3 w-full max-w-sm",children:[c.jsx("div",{className:"h-4 bg-muted rounded animate-pulse"}),c.jsx("div",{className:"h-4 bg-muted rounded animate-pulse w-3/4"}),c.jsx("div",{className:"h-4 bg-muted rounded animate-pulse w-1/2"})]});default:return c.jsx(kt,{className:T("animate-spin text-primary",i[t])})}};return c.jsxs("div",{className:a,children:[u(),r&&c.jsx("p",{className:"text-sm text-muted-foreground animate-pulse",children:r})]})};or.displayName="Loading";const tf=({loading:e,children:t,text:r,className:n})=>c.jsxs("div",{className:T("relative",n),children:[t,e&&c.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-background/80 backdrop-blur-sm rounded-lg",children:c.jsx(or,{text:r})})]});tf.displayName="LoadingOverlay";const rf=l.forwardRef(({loading:e,loadingText:t,children:r,disabled:n,className:o,...s},i)=>c.jsx(ae,{ref:i,disabled:n||e,className:o,...s,children:e?c.jsxs(c.Fragment,{children:[c.jsx(kt,{className:"mr-2 h-4 w-4 animate-spin"}),t||"Loading..."]}):r}));rf.displayName="LoadingButton";const dr=({icon:e=Si,title:t="No data found",description:r="There are no items to display.",action:n,actionLabel:o,onAction:s,variant:i="default",className:a,children:u})=>{const d={default:{icon:Si,title:"No data found",description:"There are no items to display."},search:{icon:Fo,title:"No results found",description:"Try adjusting your search or filters to find what you're looking for."},empty:{icon:_a,title:"Get started",description:"Create your first item to get started."},error:{icon:Pa,title:"Something went wrong",description:"There was an error loading the data. Please try again."}},p=d[i]||d.default,f=e||p.icon,m=t||p.title,g=r||p.description;return c.jsxs("div",{className:T("flex flex-col items-center justify-center py-12 px-4 text-center",a),children:[c.jsx("div",{className:"rounded-full bg-muted p-4 mb-4",children:c.jsx(f,{className:"h-8 w-8 text-muted-foreground"})}),c.jsx("h3",{className:"text-lg font-semibold mb-2",children:m}),c.jsx("p",{className:"text-sm text-muted-foreground mb-6 max-w-sm",children:g}),u,(n||s)&&c.jsx(ae,{onClick:s,children:o||"Take Action"})]})};dr.displayName="EmptyState";const ei=({searchTerm:e,onClear:t,className:r})=>c.jsx(dr,{variant:"search",title:`No results for "${e}"`,description:"Try searching with different keywords or check your filters.",className:r,children:t&&c.jsx(ae,{variant:"outline",onClick:t,children:"Clear Search"})});ei.displayName="SearchEmptyState";const nf=({itemName:e="item",onCreate:t,className:r})=>c.jsx(dr,{variant:"empty",icon:_a,title:`No ${e}s yet`,description:`Create your first ${e} to get started.`,onAction:t,actionLabel:`Create ${e}`,className:r});nf.displayName="CreateEmptyState";const of=({error:e,onRetry:t,className:r})=>c.jsx(dr,{variant:"error",title:"Error loading data",description:(e==null?void 0:e.message)||"Something went wrong. Please try again.",onAction:t,actionLabel:"Try Again",className:r});of.displayName="ErrorState";const qn=({open:e,onOpenChange:t,title:r,description:n,children:o,footer:s,size:i="default",showClose:a=!0,className:u,...d})=>{const p={sm:"max-w-sm",default:"max-w-lg",lg:"max-w-2xl",xl:"max-w-4xl",full:"max-w-[95vw]"};return c.jsx(Vc,{open:e,onOpenChange:t,...d,children:c.jsxs(gs,{className:T(p[i],u),children:[(r||n)&&c.jsxs(xs,{children:[r&&c.jsx(vs,{children:r}),n&&c.jsx(ys,{children:n})]}),o,s&&c.jsx(On,{children:s})]})})};qn.displayName="Modal";const ti=({open:e,onOpenChange:t,onConfirm:r,onCancel:n,title:o="Are you sure?",description:s="This action cannot be undone.",confirmText:i="Confirm",cancelText:a="Cancel",variant:u="default",loading:d=!1,className:p})=>{const f=async()=>{await(r==null?void 0:r())},m=()=>{n==null||n(),t==null||t(!1)};return c.jsx(qn,{open:e,onOpenChange:t,title:o,description:s,size:"sm",className:p,footer:c.jsxs("div",{className:"flex gap-2 justify-end",children:[c.jsx(ae,{variant:"outline",onClick:m,disabled:d,children:a}),c.jsx(ae,{variant:u==="destructive"?"destructive":"default",onClick:f,disabled:d,children:d?"Loading...":i})]})})};ti.displayName="ConfirmModal";const Pr=({open:e,onOpenChange:t,onConfirm:r,itemName:n="item",loading:o=!1})=>c.jsx(ti,{open:e,onOpenChange:t,onConfirm:r,title:`Delete ${n}?`,description:`Are you sure you want to delete this ${n}? This action cannot be undone.`,confirmText:"Delete",variant:"destructive",loading:o});Pr.displayName="DeleteConfirmModal";const sf=({open:e,onOpenChange:t,onSubmit:r,title:n,description:o,children:s,submitText:i="Save",cancelText:a="Cancel",loading:u=!1,size:d="default",className:p})=>{const f=async m=>{m==null||m.preventDefault(),await(r==null?void 0:r())};return c.jsx(qn,{open:e,onOpenChange:t,title:n,description:o,size:d,className:p,children:c.jsxs("form",{onSubmit:f,children:[c.jsx("div",{className:"py-4",children:s}),c.jsxs(On,{children:[c.jsx(ae,{type:"button",variant:"outline",onClick:()=>t==null?void 0:t(!1),disabled:u,children:a}),c.jsx(ae,{type:"submit",disabled:u,children:u?"Saving...":i})]})]})})};sf.displayName="FormModal";const ri=({data:e=[],columns:t=[],loading:r=!1,error:n=null,pagination:o=null,currentPage:s=1,pageSize:i=10,totalItems:a=0,totalPages:u=1,onPageChange:d,onPageSizeChange:p,sortable:f=!0,sortColumn:m=null,sortDirection:g=null,onSort:x,searchable:h=!0,searchValue:y="",onSearchChange:v,searchPlaceholder:b="Search...",selectable:S=!1,selectedRows:C=[],onSelectionChange:N,actions:_=[],onRowClick:j,striped:$=!1,hover:D=!0,compact:O=!1,className:P,emptyTitle:A="No data found",emptyDescription:M="There are no items to display.",emptyAction:z,onEmptyAction:q,getRowKey:H=k=>k.id||k._id})=>{const[k,W]=l.useState(y);l.useEffect(()=>{const I=setTimeout(()=>{v&&k!==y&&v(k)},300);return()=>clearTimeout(I)},[k]);const L=I=>{if(!f||!I.sortable)return;const Z=I.sortKey||I.accessor;let X="asc";m===Z&&(X=g==="asc"?"desc":"asc"),x==null||x(Z,X)},re=I=>{I?N==null||N(e.map(H)):N==null||N([])},F=(I,Z)=>{Z?N==null||N([...C,I]):N==null||N(C.filter(X=>X!==I))},te=e.length>0&&C.length===e.length,ce=C.length>0&&C.length<e.length,de=(I,Z,X)=>{const ne=I.accessor||I.key,J=ne?typeof ne=="function"?ne(Z):Z[ne]:void 0;return I.render?I.render(J,Z,X):I.format?I.format(J,Z):J!==null&&typeof J=="object"?"-":J??"-"},ge=I=>{if(!f||!I.sortable)return null;const Z=I.sortKey||I.accessor;return m!==Z?c.jsx(Mp,{className:"ml-2 h-4 w-4 opacity-50"}):g==="asc"?c.jsx(kp,{className:"ml-2 h-4 w-4"}):c.jsx(Tp,{className:"ml-2 h-4 w-4"})},me=I=>{if(!_||_.length===0)return null;const Z=_.filter(X=>X.hidden?typeof X.hidden=="function"?!X.hidden(I):!X.hidden:!0);return Z.length===0?null:c.jsxs(Ds,{children:[c.jsx(Is,{asChild:!0,children:c.jsxs(ae,{variant:"ghost",size:"icon",className:"h-8 w-8",children:[c.jsx(Wp,{className:"h-4 w-4"}),c.jsx("span",{className:"sr-only",children:"Open menu"})]})}),c.jsxs(zn,{align:"end",children:[c.jsx(Gn,{children:"Actions"}),c.jsx(_r,{}),Z.map((X,ne)=>c.jsxs(Rr,{onClick:()=>{var J;return(J=X.onClick)==null?void 0:J.call(X,I)},className:T(X.variant==="destructive"&&"text-destructive focus:text-destructive"),disabled:X.disabled,children:[X.icon&&c.jsx(X.icon,{className:"mr-2 h-4 w-4"}),X.label]},X.label||ne))]})]})};return c.jsxs("div",{className:T("w-full",P),children:[(h||C.length>0)&&c.jsxs("div",{className:"flex items-center justify-between gap-4 mb-4",children:[h&&c.jsxs("div",{className:"relative max-w-sm",children:[c.jsx(Fo,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),c.jsx(Jt,{placeholder:b,value:k,onChange:I=>W(I.target.value),className:"pl-9 pr-9"}),k&&c.jsx("button",{onClick:()=>{W(""),v==null||v("")},className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:c.jsx(qt,{className:"h-4 w-4"})})]}),S&&C.length>0&&c.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[C.length," row(s) selected",c.jsx(ae,{variant:"ghost",size:"sm",onClick:()=>N==null?void 0:N([]),children:"Clear selection"})]})]}),c.jsx("div",{className:"rounded-md border",children:c.jsxs(Us,{children:[c.jsx(zs,{children:c.jsxs(zt,{children:[S&&c.jsx(vr,{className:"w-12",children:c.jsx(er,{checked:te,indeterminate:ce,onCheckedChange:re})}),t.map((I,Z)=>c.jsx(vr,{className:T(I.headerClassName,f&&I.sortable&&"cursor-pointer select-none"),style:{width:I.width},onClick:()=>L(I),children:c.jsxs("div",{className:"flex items-center",children:[I.header||I.label,ge(I)]})},I.accessor||Z)),_&&_.length>0&&c.jsx(vr,{className:"w-12",children:"Actions"})]})}),c.jsx(Gs,{children:r?c.jsx(zt,{children:c.jsx(Tt,{colSpan:t.length+(S?1:0)+(_!=null&&_.length?1:0),className:"h-48",children:c.jsx(or,{text:"Loading data..."})})}):e.length===0?c.jsx(zt,{children:c.jsx(Tt,{colSpan:t.length+(S?1:0)+(_!=null&&_.length?1:0),className:"h-48",children:k?c.jsx(ei,{searchTerm:k,onClear:()=>{W(""),v==null||v("")}}):c.jsx(dr,{title:A,description:M,onAction:q,actionLabel:z})})}):e.map((I,Z)=>{const X=H(I),ne=C.includes(X);return c.jsxs(zt,{"data-state":ne?"selected":void 0,className:T($&&Z%2===1&&"bg-muted/50",D&&"cursor-pointer",j&&"hover:bg-muted"),onClick:()=>j==null?void 0:j(I),children:[S&&c.jsx(Tt,{onClick:J=>J.stopPropagation(),children:c.jsx(er,{checked:ne,onCheckedChange:J=>F(X,J)})}),t.map((J,U)=>c.jsx(Tt,{className:T(O&&"py-2",J.cellClassName),children:de(J,I,Z)},J.accessor||U)),_&&_.length>0&&c.jsx(Tt,{onClick:J=>J.stopPropagation(),children:me(I)})]},X)})})]})}),!r&&e.length>0&&o!==!1&&c.jsx(Js,{currentPage:s,totalPages:u,totalItems:a,pageSize:i,onPageChange:d,onPageSizeChange:p})]})};ri.displayName="DataTable";const af=({store:e,data:t,loading:r=!1,error:n=null,columns:o=[],currentPage:s=1,pageSize:i=10,totalItems:a=0,totalPages:u=1,onPageChange:d,onPageSizeChange:p,sortColumn:f,sortDirection:m,onSort:g,searchValue:x="",onSearchChange:h,searchPlaceholder:y="Search...",selectable:v=!1,selectedRows:b=[],onSelectionChange:S,onCreate:C,onView:N,onEdit:_,onDelete:j,onRefresh:$,onExport:D,createPath:O,detailPath:P,editPath:A,additionalActions:M=[],bulkActions:z=[],title:q,description:H,createLabel:k="Create",refreshLabel:W="Refresh",exportLabel:L="Export",viewLabel:re="View",editLabel:F="Edit",deleteLabel:te="Delete",itemName:ce="item",getRowKey:de=xe=>xe.id||xe._id,showHeader:ge=!0,showToolbar:me=!0,compact:I=!1,className:Z,deleteConfirmTitle:X,deleteConfirmDescription:ne,getDeleteItemName:J,filters:U,headerActions:ee,searchable:ye=!0})=>{const xe=Te.useNavigate(),[ke,De]=l.useState(!1),[Le,Be]=l.useState(null),[w,E]=l.useState(!1),[R,K]=l.useState(""),B=l.useRef(!1),V=l.useRef(R),Q=l.useRef(null),ue=l.useRef(null),pe=(e==null?void 0:e.items)??t??[],Re=(e==null?void 0:e.loading)??r,Fe=(e==null?void 0:e.error)??n,Ae=(e==null?void 0:e.pagination)??{page:s,pageSize:i,total:a,totalPages:u},Ie=Ae.page??s,Pe=Ae.pageSize??i,vt=Ae.total??a,Qe=Ae.totalPages??u,Ee=e==null?void 0:e.fetchList,Ft=e==null?void 0:e.delete,ot=e==null?void 0:e.setPage,Zn=e==null?void 0:e.setPageSize,At=e==null?void 0:e.setFilters;l.useEffect(()=>{Ee&&!B.current&&(B.current=!0,Q.current=Ie,ue.current=Pe,Ee())},[Ee]),l.useEffect(()=>{if(!Ee||!B.current)return;const le=Q.current!==Ie,eo=ue.current!==Pe;(le||eo)&&(Q.current=Ie,ue.current=Pe,Ee())},[Ie,Pe,Ee]),l.useEffect(()=>{if(!Ee||!B.current||V.current===R)return;const le=setTimeout(()=>{ye&&(V.current=R,At==null||At({search:R}),Ie!==1?ot==null||ot(1):Ee())},300);return()=>clearTimeout(le)},[R,ye,Ie,At,ot,Ee]);const Nf=l.useCallback(le=>{ot?ot(le):d==null||d(le)},[ot,d]),Ef=l.useCallback(le=>{Zn?Zn(le):p==null||p(le)},[Zn,p]),jf=l.useCallback(le=>{At?K(le):h==null||h(le)},[At,h]),li=l.useCallback(()=>{O?xe(O):C==null||C()},[O,xe,C]),ci=l.useCallback(le=>{P?xe(`${P}/${de(le)}`):N==null||N(le)},[P,xe,de,N]),ui=l.useCallback(le=>{A?xe(`${A}/${de(le)}/edit`):_==null||_(le)},[A,xe,de,_]),Rf=l.useCallback(()=>{Ee?Ee():$==null||$()},[Ee,$]),di=l.useCallback(le=>{Be(le),De(!0)},[]),_f=async()=>{if(Le){E(!0);try{Ft?(await Ft(de(Le)),Ee==null||Ee()):j&&await j(Le),De(!1),Be(null)}catch(le){console.error("Delete error:",le)}finally{E(!1)}}},Pf=l.useMemo(()=>{const le=[];return(P||N)&&le.push({label:re,icon:Hp,onClick:ci}),(A||_)&&le.push({label:F,icon:xo,onClick:ui}),(Ft||j)&&le.push({label:te,icon:vo,variant:"destructive",onClick:di}),[...le,...M]},[P,A,N,_,Ft,j,re,F,te,ci,ui,di,M]),Jn=O||C,Af=Ee||$,fi=l.useMemo(()=>Le?J?J(Le):Le.name||Le.title||ce:ce,[Le,J,ce]),pi=()=>me?c.jsxs("div",{className:"flex items-center gap-2",children:[ee,v&&b.length>0&&z.length>0&&c.jsx(c.Fragment,{children:z.map((le,eo)=>c.jsxs(ae,{variant:le.variant||"outline",size:"sm",onClick:()=>{var hi;return(hi=le.onClick)==null?void 0:hi.call(le,b)},disabled:le.disabled,children:[le.icon&&c.jsx(le.icon,{className:"mr-2 h-4 w-4"}),le.label]},le.label||eo))}),D&&c.jsxs(ae,{variant:"outline",size:"sm",onClick:D,children:[c.jsx(Bp,{className:"mr-2 h-4 w-4"}),L]}),Af&&c.jsxs(ae,{variant:"outline",size:"sm",onClick:Rf,disabled:Re,children:[c.jsx(Pa,{className:T("mr-2 h-4 w-4",Re&&"animate-spin")}),W]}),Jn&&c.jsxs(ae,{size:"sm",onClick:li,children:[c.jsx(Gp,{className:"mr-2 h-4 w-4"}),k]})]}):null,mi=c.jsxs(c.Fragment,{children:[U&&c.jsx("div",{className:"mb-4 flex items-center gap-2",children:U}),c.jsx(ri,{data:pe,columns:o,loading:Re,error:Fe,currentPage:Ie,pageSize:Pe,totalItems:vt,totalPages:Qe,onPageChange:Nf,onPageSizeChange:Ef,sortColumn:f,sortDirection:m,onSort:g,searchable:ye,searchValue:At?R:x,onSearchChange:jf,searchPlaceholder:y,selectable:v,selectedRows:b,onSelectionChange:S,actions:Pf,getRowKey:de,compact:I,emptyTitle:`No ${ce}s found`,emptyDescription:`Create your first ${ce} to get started.`,emptyAction:Jn?`Create ${ce}`:void 0,onEmptyAction:Jn?li:void 0}),c.jsx(Pr,{open:ke,onOpenChange:De,onConfirm:_f,title:X||`Delete ${ce}`,description:ne||`Are you sure you want to delete "${fi}"? This action cannot be undone.`,itemName:fi,loading:w})]});return ge&&(q||H)?c.jsxs(Ke,{className:Z,children:[c.jsxs(Xt,{className:"flex flex-row items-center justify-between space-y-0 pb-4",children:[c.jsxs("div",{children:[q&&c.jsx(Qt,{children:q}),H&&c.jsx(Zt,{children:H})]}),pi()]}),c.jsx(Ye,{children:mi})]}):c.jsxs("div",{className:Z,children:[me&&c.jsxs("div",{className:"flex items-center justify-between mb-4",children:[c.jsx("div",{}),pi()]}),mi]})};af.displayName="CrudList";var Hr=e=>e.type==="checkbox",Mt=e=>e instanceof Date,Ve=e=>e==null;const lf=e=>typeof e=="object";var Ce=e=>!Ve(e)&&!Array.isArray(e)&&lf(e)&&!Mt(e),MS=e=>Ce(e)&&e.target?Hr(e.target)?e.target.checked:e.target.value:e,kS=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,DS=(e,t)=>e.has(kS(t)),IS=e=>{const t=e.constructor&&e.constructor.prototype;return Ce(t)&&t.hasOwnProperty("isPrototypeOf")},ni=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function _e(e){let t;const r=Array.isArray(e),n=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(!(ni&&(e instanceof Blob||n))&&(r||Ce(e)))if(t=r?[]:Object.create(Object.getPrototypeOf(e)),!r&&!IS(e))t=e;else for(const o in e)e.hasOwnProperty(o)&&(t[o]=_e(e[o]));else return e;return t}var Xn=e=>/^\w*$/.test(e),be=e=>e===void 0,oi=e=>Array.isArray(e)?e.filter(Boolean):[],si=e=>oi(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Y=(e,t,r)=>{if(!t||!Ce(e))return r;const n=(Xn(t)?[t]:si(t)).reduce((o,s)=>Ve(o)?o:o[s],e);return be(n)||n===e?be(e[t])?r:e[t]:n},st=e=>typeof e=="boolean",he=(e,t,r)=>{let n=-1;const o=Xn(t)?[t]:si(t),s=o.length,i=s-1;for(;++n<s;){const a=o[n];let u=r;if(n!==i){const d=e[a];u=Ce(d)||Array.isArray(d)?d:isNaN(+o[n+1])?{}:[]}if(a==="__proto__"||a==="constructor"||a==="prototype")return;e[a]=u,e=e[a]}};const ta={BLUR:"blur",FOCUS_OUT:"focusout"},Je={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},mt={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},OS=oe.createContext(null);OS.displayName="HookFormContext";var $S=(e,t,r,n=!0)=>{const o={defaultValues:t._defaultValues};for(const s in e)Object.defineProperty(o,s,{get:()=>{const i=s;return t._proxyFormState[i]!==Je.all&&(t._proxyFormState[i]=!n||Je.all),e[i]}});return o};const LS=typeof window<"u"?oe.useLayoutEffect:oe.useEffect;var He=e=>typeof e=="string",FS=(e,t,r,n,o)=>He(e)?(n&&t.watch.add(e),Y(r,e,o)):Array.isArray(e)?e.map(s=>(n&&t.watch.add(s),Y(r,s))):(n&&(t.watchAll=!0),r),Io=e=>Ve(e)||!lf(e);function St(e,t,r=new WeakSet){if(Io(e)||Io(t))return Object.is(e,t);if(Mt(e)&&Mt(t))return e.getTime()===t.getTime();const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;if(r.has(e)||r.has(t))return!0;r.add(e),r.add(t);for(const s of n){const i=e[s];if(!o.includes(s))return!1;if(s!=="ref"){const a=t[s];if(Mt(i)&&Mt(a)||Ce(i)&&Ce(a)||Array.isArray(i)&&Array.isArray(a)?!St(i,a,r):!Object.is(i,a))return!1}}return!0}var cf=(e,t,r,n,o)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:o||!0}}:{},yr=e=>Array.isArray(e)?e:[e],ra=()=>{let e=[];return{get observers(){return e},next:o=>{for(const s of e)s.next&&s.next(o)},subscribe:o=>(e.push(o),{unsubscribe:()=>{e=e.filter(s=>s!==o)}}),unsubscribe:()=>{e=[]}}};function uf(e,t){const r={};for(const n in e)if(e.hasOwnProperty(n)){const o=e[n],s=t[n];if(o&&Ce(o)&&s){const i=uf(o,s);Ce(i)&&(r[n]=i)}else e[n]&&(r[n]=s)}return r}var Oe=e=>Ce(e)&&!Object.keys(e).length,ii=e=>e.type==="file",et=e=>typeof e=="function",pn=e=>{if(!ni)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},df=e=>e.type==="select-multiple",ai=e=>e.type==="radio",VS=e=>ai(e)||Hr(e),ho=e=>pn(e)&&e.isConnected;function BS(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=be(e)?n++:e[t[n++]];return e}function WS(e){for(const t in e)if(e.hasOwnProperty(t)&&!be(e[t]))return!1;return!0}function Se(e,t){const r=Array.isArray(t)?t:Xn(t)?[t]:si(t),n=r.length===1?e:BS(e,r),o=r.length-1,s=r[o];return n&&delete n[s],o!==0&&(Ce(n)&&Oe(n)||Array.isArray(n)&&WS(n))&&Se(e,r.slice(0,-1)),e}var HS=e=>{for(const t in e)if(et(e[t]))return!0;return!1};function ff(e){return Array.isArray(e)||Ce(e)&&!HS(e)}function Oo(e,t={}){for(const r in e){const n=e[r];ff(n)?(t[r]=Array.isArray(n)?[]:{},Oo(n,t[r])):be(n)||(t[r]=!0)}return t}function Ut(e,t,r){r||(r=Oo(t));for(const n in e){const o=e[n];if(ff(o))be(t)||Io(r[n])?r[n]=Oo(o,Array.isArray(o)?[]:{}):Ut(o,Ve(t)?{}:t[n],r[n]);else{const s=t[n];r[n]=!St(o,s)}}return r}const na={value:!1,isValid:!1},oa={value:!0,isValid:!0};var pf=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!be(e[0].attributes.value)?be(e[0].value)||e[0].value===""?oa:{value:e[0].value,isValid:!0}:oa:na}return na},mf=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>be(e)?e:t?e===""?NaN:e&&+e:r&&He(e)?new Date(e):n?n(e):e;const sa={isValid:!1,value:null};var hf=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,sa):sa;function ia(e){const t=e.ref;return ii(t)?t.files:ai(t)?hf(e.refs).value:df(t)?[...t.selectedOptions].map(({value:r})=>r):Hr(t)?pf(e.refs).value:mf(be(t.value)?e.ref.value:t.value,e)}var US=(e,t,r,n)=>{const o={};for(const s of e){const i=Y(t,s);i&&he(o,s,i._f)}return{criteriaMode:r,names:[...e],fields:o,shouldUseNativeValidation:n}},mn=e=>e instanceof RegExp,mr=e=>be(e)?e:mn(e)?e.source:Ce(e)?mn(e.value)?e.value.source:e.value:e,aa=e=>({isOnSubmit:!e||e===Je.onSubmit,isOnBlur:e===Je.onBlur,isOnChange:e===Je.onChange,isOnAll:e===Je.all,isOnTouch:e===Je.onTouched});const la="AsyncFunction";var zS=e=>!!e&&!!e.validate&&!!(et(e.validate)&&e.validate.constructor.name===la||Ce(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===la)),GS=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),ca=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const br=(e,t,r,n)=>{for(const o of r||Object.keys(e)){const s=Y(e,o);if(s){const{_f:i,...a}=s;if(i){if(i.refs&&i.refs[0]&&t(i.refs[0],o)&&!n)return!0;if(i.ref&&t(i.ref,i.name)&&!n)return!0;if(br(a,t))break}else if(Ce(a)&&br(a,t))break}}};function ua(e,t,r){const n=Y(e,r);if(n||Xn(r))return{error:n,name:r};const o=r.split(".");for(;o.length;){const s=o.join("."),i=Y(t,s),a=Y(e,s);if(i&&!Array.isArray(i)&&r!==s)return{name:r};if(a&&a.type)return{name:s,error:a};if(a&&a.root&&a.root.type)return{name:`${s}.root`,error:a.root};o.pop()}return{name:r}}var KS=(e,t,r,n)=>{r(e);const{name:o,...s}=e;return Oe(s)||Object.keys(s).length>=Object.keys(t).length||Object.keys(s).find(i=>t[i]===(!n||Je.all))},YS=(e,t,r)=>!e||!t||e===t||yr(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n))),qS=(e,t,r,n,o)=>o.isOnAll?!1:!r&&o.isOnTouch?!(t||e):(r?n.isOnBlur:o.isOnBlur)?!e:(r?n.isOnChange:o.isOnChange)?e:!0,XS=(e,t)=>!oi(Y(e,t)).length&&Se(e,t),QS=(e,t,r)=>{const n=yr(Y(e,r));return he(n,"root",t[r]),he(e,r,n),e};function da(e,t,r="validate"){if(He(e)||Array.isArray(e)&&e.every(He)||st(e)&&!e)return{type:r,message:He(e)?e:"",ref:t}}var Ht=e=>Ce(e)&&!mn(e)?e:{value:e,message:""},fa=async(e,t,r,n,o,s)=>{const{ref:i,refs:a,required:u,maxLength:d,minLength:p,min:f,max:m,pattern:g,validate:x,name:h,valueAsNumber:y,mount:v}=e._f,b=Y(r,h);if(!v||t.has(h))return{};const S=a?a[0]:i,C=A=>{o&&S.reportValidity&&(S.setCustomValidity(st(A)?"":A||""),S.reportValidity())},N={},_=ai(i),j=Hr(i),$=_||j,D=(y||ii(i))&&be(i.value)&&be(b)||pn(i)&&i.value===""||b===""||Array.isArray(b)&&!b.length,O=cf.bind(null,h,n,N),P=(A,M,z,q=mt.maxLength,H=mt.minLength)=>{const k=A?M:z;N[h]={type:A?q:H,message:k,ref:i,...O(A?q:H,k)}};if(s?!Array.isArray(b)||!b.length:u&&(!$&&(D||Ve(b))||st(b)&&!b||j&&!pf(a).isValid||_&&!hf(a).isValid)){const{value:A,message:M}=He(u)?{value:!!u,message:u}:Ht(u);if(A&&(N[h]={type:mt.required,message:M,ref:S,...O(mt.required,M)},!n))return C(M),N}if(!D&&(!Ve(f)||!Ve(m))){let A,M;const z=Ht(m),q=Ht(f);if(!Ve(b)&&!isNaN(b)){const H=i.valueAsNumber||b&&+b;Ve(z.value)||(A=H>z.value),Ve(q.value)||(M=H<q.value)}else{const H=i.valueAsDate||new Date(b),k=re=>new Date(new Date().toDateString()+" "+re),W=i.type=="time",L=i.type=="week";He(z.value)&&b&&(A=W?k(b)>k(z.value):L?b>z.value:H>new Date(z.value)),He(q.value)&&b&&(M=W?k(b)<k(q.value):L?b<q.value:H<new Date(q.value))}if((A||M)&&(P(!!A,z.message,q.message,mt.max,mt.min),!n))return C(N[h].message),N}if((d||p)&&!D&&(He(b)||s&&Array.isArray(b))){const A=Ht(d),M=Ht(p),z=!Ve(A.value)&&b.length>+A.value,q=!Ve(M.value)&&b.length<+M.value;if((z||q)&&(P(z,A.message,M.message),!n))return C(N[h].message),N}if(g&&!D&&He(b)){const{value:A,message:M}=Ht(g);if(mn(A)&&!b.match(A)&&(N[h]={type:mt.pattern,message:M,ref:i,...O(mt.pattern,M)},!n))return C(M),N}if(x){if(et(x)){const A=await x(b,r),M=da(A,S);if(M&&(N[h]={...M,...O(mt.validate,M.message)},!n))return C(M.message),N}else if(Ce(x)){let A={};for(const M in x){if(!Oe(A)&&!n)break;const z=da(await x[M](b,r),S,M);z&&(A={...z,...O(M,z.message)},C(z.message),n&&(N[h]=A))}if(!Oe(A)&&(N[h]={ref:S,...A},!n))return N}}return C(!0),N};const ZS={mode:Je.onSubmit,reValidateMode:Je.onChange,shouldFocusError:!0};function JS(e={}){let t={...ZS,...e},r={submitCount:0,isDirty:!1,isReady:!1,isLoading:et(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},n={},o=Ce(t.defaultValues)||Ce(t.values)?_e(t.defaultValues||t.values)||{}:{},s=t.shouldUnregister?{}:_e(o),i={action:!1,mount:!1,watch:!1},a={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},u,d=0;const p={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let f={...p};const m={array:ra(),state:ra()},g=t.criteriaMode===Je.all,x=w=>E=>{clearTimeout(d),d=setTimeout(w,E)},h=async w=>{if(!t.disabled&&(p.isValid||f.isValid||w)){const E=t.resolver?Oe((await j()).errors):await D(n,!0);E!==r.isValid&&m.state.next({isValid:E})}},y=(w,E)=>{!t.disabled&&(p.isValidating||p.validatingFields||f.isValidating||f.validatingFields)&&((w||Array.from(a.mount)).forEach(R=>{R&&(E?he(r.validatingFields,R,E):Se(r.validatingFields,R))}),m.state.next({validatingFields:r.validatingFields,isValidating:!Oe(r.validatingFields)}))},v=(w,E=[],R,K,B=!0,V=!0)=>{if(K&&R&&!t.disabled){if(i.action=!0,V&&Array.isArray(Y(n,w))){const Q=R(Y(n,w),K.argA,K.argB);B&&he(n,w,Q)}if(V&&Array.isArray(Y(r.errors,w))){const Q=R(Y(r.errors,w),K.argA,K.argB);B&&he(r.errors,w,Q),XS(r.errors,w)}if((p.touchedFields||f.touchedFields)&&V&&Array.isArray(Y(r.touchedFields,w))){const Q=R(Y(r.touchedFields,w),K.argA,K.argB);B&&he(r.touchedFields,w,Q)}(p.dirtyFields||f.dirtyFields)&&(r.dirtyFields=Ut(o,s)),m.state.next({name:w,isDirty:P(w,E),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else he(s,w,E)},b=(w,E)=>{he(r.errors,w,E),m.state.next({errors:r.errors})},S=w=>{r.errors=w,m.state.next({errors:r.errors,isValid:!1})},C=(w,E,R,K)=>{const B=Y(n,w);if(B){const V=Y(s,w,be(R)?Y(o,w):R);be(V)||K&&K.defaultChecked||E?he(s,w,E?V:ia(B._f)):z(w,V),i.mount&&!i.action&&h()}},N=(w,E,R,K,B)=>{let V=!1,Q=!1;const ue={name:w};if(!t.disabled){if(!R||K){(p.isDirty||f.isDirty)&&(Q=r.isDirty,r.isDirty=ue.isDirty=P(),V=Q!==ue.isDirty);const pe=St(Y(o,w),E);Q=!!Y(r.dirtyFields,w),pe?Se(r.dirtyFields,w):he(r.dirtyFields,w,!0),ue.dirtyFields=r.dirtyFields,V=V||(p.dirtyFields||f.dirtyFields)&&Q!==!pe}if(R){const pe=Y(r.touchedFields,w);pe||(he(r.touchedFields,w,R),ue.touchedFields=r.touchedFields,V=V||(p.touchedFields||f.touchedFields)&&pe!==R)}V&&B&&m.state.next(ue)}return V?ue:{}},_=(w,E,R,K)=>{const B=Y(r.errors,w),V=(p.isValid||f.isValid)&&st(E)&&r.isValid!==E;if(t.delayError&&R?(u=x(()=>b(w,R)),u(t.delayError)):(clearTimeout(d),u=null,R?he(r.errors,w,R):Se(r.errors,w)),(R?!St(B,R):B)||!Oe(K)||V){const Q={...K,...V&&st(E)?{isValid:E}:{},errors:r.errors,name:w};r={...r,...Q},m.state.next(Q)}},j=async w=>{y(w,!0);const E=await t.resolver(s,t.context,US(w||a.mount,n,t.criteriaMode,t.shouldUseNativeValidation));return y(w),E},$=async w=>{const{errors:E}=await j(w);if(w)for(const R of w){const K=Y(E,R);K?he(r.errors,R,K):Se(r.errors,R)}else r.errors=E;return E},D=async(w,E,R={valid:!0})=>{for(const K in w){const B=w[K];if(B){const{_f:V,...Q}=B;if(V){const ue=a.array.has(V.name),pe=B._f&&zS(B._f);pe&&p.validatingFields&&y([V.name],!0);const Re=await fa(B,a.disabled,s,g,t.shouldUseNativeValidation&&!E,ue);if(pe&&p.validatingFields&&y([V.name]),Re[V.name]&&(R.valid=!1,E))break;!E&&(Y(Re,V.name)?ue?QS(r.errors,Re,V.name):he(r.errors,V.name,Re[V.name]):Se(r.errors,V.name))}!Oe(Q)&&await D(Q,E,R)}}return R.valid},O=()=>{for(const w of a.unMount){const E=Y(n,w);E&&(E._f.refs?E._f.refs.every(R=>!ho(R)):!ho(E._f.ref))&&I(w)}a.unMount=new Set},P=(w,E)=>!t.disabled&&(w&&E&&he(s,w,E),!St(re(),o)),A=(w,E,R)=>FS(w,a,{...i.mount?s:be(E)?o:He(w)?{[w]:E}:E},R,E),M=w=>oi(Y(i.mount?s:o,w,t.shouldUnregister?Y(o,w,[]):[])),z=(w,E,R={})=>{const K=Y(n,w);let B=E;if(K){const V=K._f;V&&(!V.disabled&&he(s,w,mf(E,V)),B=pn(V.ref)&&Ve(E)?"":E,df(V.ref)?[...V.ref.options].forEach(Q=>Q.selected=B.includes(Q.value)):V.refs?Hr(V.ref)?V.refs.forEach(Q=>{(!Q.defaultChecked||!Q.disabled)&&(Array.isArray(B)?Q.checked=!!B.find(ue=>ue===Q.value):Q.checked=B===Q.value||!!B)}):V.refs.forEach(Q=>Q.checked=Q.value===B):ii(V.ref)?V.ref.value="":(V.ref.value=B,V.ref.type||m.state.next({name:w,values:_e(s)})))}(R.shouldDirty||R.shouldTouch)&&N(w,B,R.shouldTouch,R.shouldDirty,!0),R.shouldValidate&&L(w)},q=(w,E,R)=>{for(const K in E){if(!E.hasOwnProperty(K))return;const B=E[K],V=w+"."+K,Q=Y(n,V);(a.array.has(w)||Ce(B)||Q&&!Q._f)&&!Mt(B)?q(V,B,R):z(V,B,R)}},H=(w,E,R={})=>{const K=Y(n,w),B=a.array.has(w),V=_e(E);he(s,w,V),B?(m.array.next({name:w,values:_e(s)}),(p.isDirty||p.dirtyFields||f.isDirty||f.dirtyFields)&&R.shouldDirty&&m.state.next({name:w,dirtyFields:Ut(o,s),isDirty:P(w,V)})):K&&!K._f&&!Ve(V)?q(w,V,R):z(w,V,R),ca(w,a)&&m.state.next({...r,name:w}),m.state.next({name:i.mount?w:void 0,values:_e(s)})},k=async w=>{i.mount=!0;const E=w.target;let R=E.name,K=!0;const B=Y(n,R),V=pe=>{K=Number.isNaN(pe)||Mt(pe)&&isNaN(pe.getTime())||St(pe,Y(s,R,pe))},Q=aa(t.mode),ue=aa(t.reValidateMode);if(B){let pe,Re;const Fe=E.type?ia(B._f):MS(w),Ae=w.type===ta.BLUR||w.type===ta.FOCUS_OUT,Ie=!GS(B._f)&&!t.resolver&&!Y(r.errors,R)&&!B._f.deps||qS(Ae,Y(r.touchedFields,R),r.isSubmitted,ue,Q),Pe=ca(R,a,Ae);he(s,R,Fe),Ae?(!E||!E.readOnly)&&(B._f.onBlur&&B._f.onBlur(w),u&&u(0)):B._f.onChange&&B._f.onChange(w);const vt=N(R,Fe,Ae),Qe=!Oe(vt)||Pe;if(!Ae&&m.state.next({name:R,type:w.type,values:_e(s)}),Ie)return(p.isValid||f.isValid)&&(t.mode==="onBlur"?Ae&&h():Ae||h()),Qe&&m.state.next({name:R,...Pe?{}:vt});if(!Ae&&Pe&&m.state.next({...r}),t.resolver){const{errors:Ee}=await j([R]);if(V(Fe),K){const Ft=ua(r.errors,n,R),ot=ua(Ee,n,Ft.name||R);pe=ot.error,R=ot.name,Re=Oe(Ee)}}else y([R],!0),pe=(await fa(B,a.disabled,s,g,t.shouldUseNativeValidation))[R],y([R]),V(Fe),K&&(pe?Re=!1:(p.isValid||f.isValid)&&(Re=await D(n,!0)));K&&(B._f.deps&&(!Array.isArray(B._f.deps)||B._f.deps.length>0)&&L(B._f.deps),_(R,Re,pe,vt))}},W=(w,E)=>{if(Y(r.errors,E)&&w.focus)return w.focus(),1},L=async(w,E={})=>{let R,K;const B=yr(w);if(t.resolver){const V=await $(be(w)?w:B);R=Oe(V),K=w?!B.some(Q=>Y(V,Q)):R}else w?(K=(await Promise.all(B.map(async V=>{const Q=Y(n,V);return await D(Q&&Q._f?{[V]:Q}:Q)}))).every(Boolean),!(!K&&!r.isValid)&&h()):K=R=await D(n);return m.state.next({...!He(w)||(p.isValid||f.isValid)&&R!==r.isValid?{}:{name:w},...t.resolver||!w?{isValid:R}:{},errors:r.errors}),E.shouldFocus&&!K&&br(n,W,w?B:a.mount),K},re=(w,E)=>{let R={...i.mount?s:o};return E&&(R=uf(E.dirtyFields?r.dirtyFields:r.touchedFields,R)),be(w)?R:He(w)?Y(R,w):w.map(K=>Y(R,K))},F=(w,E)=>({invalid:!!Y((E||r).errors,w),isDirty:!!Y((E||r).dirtyFields,w),error:Y((E||r).errors,w),isValidating:!!Y(r.validatingFields,w),isTouched:!!Y((E||r).touchedFields,w)}),te=w=>{w&&yr(w).forEach(E=>Se(r.errors,E)),m.state.next({errors:w?r.errors:{}})},ce=(w,E,R)=>{const K=(Y(n,w,{_f:{}})._f||{}).ref,B=Y(r.errors,w)||{},{ref:V,message:Q,type:ue,...pe}=B;he(r.errors,w,{...pe,...E,ref:K}),m.state.next({name:w,errors:r.errors,isValid:!1}),R&&R.shouldFocus&&K&&K.focus&&K.focus()},de=(w,E)=>et(w)?m.state.subscribe({next:R=>"values"in R&&w(A(void 0,E),R)}):A(w,E,!0),ge=w=>m.state.subscribe({next:E=>{YS(w.name,E.name,w.exact)&&KS(E,w.formState||p,De,w.reRenderRoot)&&w.callback({values:{...s},...r,...E,defaultValues:o})}}).unsubscribe,me=w=>(i.mount=!0,f={...f,...w.formState},ge({...w,formState:f})),I=(w,E={})=>{for(const R of w?yr(w):a.mount)a.mount.delete(R),a.array.delete(R),E.keepValue||(Se(n,R),Se(s,R)),!E.keepError&&Se(r.errors,R),!E.keepDirty&&Se(r.dirtyFields,R),!E.keepTouched&&Se(r.touchedFields,R),!E.keepIsValidating&&Se(r.validatingFields,R),!t.shouldUnregister&&!E.keepDefaultValue&&Se(o,R);m.state.next({values:_e(s)}),m.state.next({...r,...E.keepDirty?{isDirty:P()}:{}}),!E.keepIsValid&&h()},Z=({disabled:w,name:E})=>{(st(w)&&i.mount||w||a.disabled.has(E))&&(w?a.disabled.add(E):a.disabled.delete(E))},X=(w,E={})=>{let R=Y(n,w);const K=st(E.disabled)||st(t.disabled);return he(n,w,{...R||{},_f:{...R&&R._f?R._f:{ref:{name:w}},name:w,mount:!0,...E}}),a.mount.add(w),R?Z({disabled:st(E.disabled)?E.disabled:t.disabled,name:w}):C(w,!0,E.value),{...K?{disabled:E.disabled||t.disabled}:{},...t.progressive?{required:!!E.required,min:mr(E.min),max:mr(E.max),minLength:mr(E.minLength),maxLength:mr(E.maxLength),pattern:mr(E.pattern)}:{},name:w,onChange:k,onBlur:k,ref:B=>{if(B){X(w,E),R=Y(n,w);const V=be(B.value)&&B.querySelectorAll&&B.querySelectorAll("input,select,textarea")[0]||B,Q=VS(V),ue=R._f.refs||[];if(Q?ue.find(pe=>pe===V):V===R._f.ref)return;he(n,w,{_f:{...R._f,...Q?{refs:[...ue.filter(ho),V,...Array.isArray(Y(o,w))?[{}]:[]],ref:{type:V.type,name:w}}:{ref:V}}}),C(w,!1,void 0,V)}else R=Y(n,w,{}),R._f&&(R._f.mount=!1),(t.shouldUnregister||E.shouldUnregister)&&!(DS(a.array,w)&&i.action)&&a.unMount.add(w)}}},ne=()=>t.shouldFocusError&&br(n,W,a.mount),J=w=>{st(w)&&(m.state.next({disabled:w}),br(n,(E,R)=>{const K=Y(n,R);K&&(E.disabled=K._f.disabled||w,Array.isArray(K._f.refs)&&K._f.refs.forEach(B=>{B.disabled=K._f.disabled||w}))},0,!1))},U=(w,E)=>async R=>{let K;R&&(R.preventDefault&&R.preventDefault(),R.persist&&R.persist());let B=_e(s);if(m.state.next({isSubmitting:!0}),t.resolver){const{errors:V,values:Q}=await j();r.errors=V,B=_e(Q)}else await D(n);if(a.disabled.size)for(const V of a.disabled)Se(B,V);if(Se(r.errors,"root"),Oe(r.errors)){m.state.next({errors:{}});try{await w(B,R)}catch(V){K=V}}else E&&await E({...r.errors},R),ne(),setTimeout(ne);if(m.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Oe(r.errors)&&!K,submitCount:r.submitCount+1,errors:r.errors}),K)throw K},ee=(w,E={})=>{Y(n,w)&&(be(E.defaultValue)?H(w,_e(Y(o,w))):(H(w,E.defaultValue),he(o,w,_e(E.defaultValue))),E.keepTouched||Se(r.touchedFields,w),E.keepDirty||(Se(r.dirtyFields,w),r.isDirty=E.defaultValue?P(w,_e(Y(o,w))):P()),E.keepError||(Se(r.errors,w),p.isValid&&h()),m.state.next({...r}))},ye=(w,E={})=>{const R=w?_e(w):o,K=_e(R),B=Oe(w),V=B?o:K;if(E.keepDefaultValues||(o=R),!E.keepValues){if(E.keepDirtyValues){const Q=new Set([...a.mount,...Object.keys(Ut(o,s))]);for(const ue of Array.from(Q))Y(r.dirtyFields,ue)?he(V,ue,Y(s,ue)):H(ue,Y(V,ue))}else{if(ni&&be(w))for(const Q of a.mount){const ue=Y(n,Q);if(ue&&ue._f){const pe=Array.isArray(ue._f.refs)?ue._f.refs[0]:ue._f.ref;if(pn(pe)){const Re=pe.closest("form");if(Re){Re.reset();break}}}}if(E.keepFieldsRef)for(const Q of a.mount)H(Q,Y(V,Q));else n={}}s=t.shouldUnregister?E.keepDefaultValues?_e(o):{}:_e(V),m.array.next({values:{...V}}),m.state.next({values:{...V}})}a={mount:E.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},i.mount=!p.isValid||!!E.keepIsValid||!!E.keepDirtyValues||!t.shouldUnregister&&!Oe(V),i.watch=!!t.shouldUnregister,i.action=!1,E.keepErrors||(r.errors={}),m.state.next({submitCount:E.keepSubmitCount?r.submitCount:0,isDirty:B?!1:E.keepDirty?r.isDirty:!!(E.keepDefaultValues&&!St(w,o)),isSubmitted:E.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:B?{}:E.keepDirtyValues?E.keepDefaultValues&&s?Ut(o,s):r.dirtyFields:E.keepDefaultValues&&w?Ut(o,w):E.keepDirty?r.dirtyFields:{},touchedFields:E.keepTouched?r.touchedFields:{},errors:E.keepErrors?r.errors:{},isSubmitSuccessful:E.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:o})},xe=(w,E)=>ye(et(w)?w(s):w,E),ke=(w,E={})=>{const R=Y(n,w),K=R&&R._f;if(K){const B=K.refs?K.refs[0]:K.ref;B.focus&&(B.focus(),E.shouldSelect&&et(B.select)&&B.select())}},De=w=>{r={...r,...w}},Be={control:{register:X,unregister:I,getFieldState:F,handleSubmit:U,setError:ce,_subscribe:ge,_runSchema:j,_focusError:ne,_getWatch:A,_getDirty:P,_setValid:h,_setFieldArray:v,_setDisabledField:Z,_setErrors:S,_getFieldArray:M,_reset:ye,_resetDefaultValues:()=>et(t.defaultValues)&&t.defaultValues().then(w=>{xe(w,t.resetOptions),m.state.next({isLoading:!1})}),_removeUnmounted:O,_disableForm:J,_subjects:m,_proxyFormState:p,get _fields(){return n},get _formValues(){return s},get _state(){return i},set _state(w){i=w},get _defaultValues(){return o},get _names(){return a},set _names(w){a=w},get _formState(){return r},get _options(){return t},set _options(w){t={...t,...w}}},subscribe:me,trigger:L,register:X,handleSubmit:U,watch:de,setValue:H,getValues:re,reset:xe,resetField:ee,clearErrors:te,unregister:I,setError:ce,setFocus:ke,getFieldState:F};return{...Be,formControl:Be}}function eC(e={}){const t=oe.useRef(void 0),r=oe.useRef(void 0),[n,o]=oe.useState({isDirty:!1,isValidating:!1,isLoading:et(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:et(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:n},e.defaultValues&&!et(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:i,...a}=JS(e);t.current={...a,formState:n}}const s=t.current.control;return s._options=e,LS(()=>{const i=s._subscribe({formState:s._proxyFormState,callback:()=>o({...s._formState}),reRenderRoot:!0});return o(a=>({...a,isReady:!0})),s._formState.isReady=!0,i},[s]),oe.useEffect(()=>s._disableForm(e.disabled),[s,e.disabled]),oe.useEffect(()=>{e.mode&&(s._options.mode=e.mode),e.reValidateMode&&(s._options.reValidateMode=e.reValidateMode)},[s,e.mode,e.reValidateMode]),oe.useEffect(()=>{e.errors&&(s._setErrors(e.errors),s._focusError())},[s,e.errors]),oe.useEffect(()=>{e.shouldUnregister&&s._subjects.state.next({values:s._getWatch()})},[s,e.shouldUnregister]),oe.useEffect(()=>{if(s._proxyFormState.isDirty){const i=s._getDirty();i!==n.isDirty&&s._subjects.state.next({isDirty:i})}},[s,n.isDirty]),oe.useEffect(()=>{var i;e.values&&!St(e.values,r.current)?(s._reset(e.values,{keepFieldsRef:!0,...s._options.resetOptions}),!((i=s._options.resetOptions)===null||i===void 0)&&i.keepIsValid||s._setValid(),r.current=e.values,o(a=>({...a}))):s._resetDefaultValues()},[s,e.values]),oe.useEffect(()=>{s._state.mount||(s._setValid(),s._state.mount=!0),s._state.watch&&(s._state.watch=!1,s._subjects.state.next({...s._formState})),s._removeUnmounted()}),t.current.formState=$S(n,s),t.current}const pa=(e,t,r)=>{if(e&&"reportValidity"in e){const n=Y(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},gf=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?pa(n.ref,r,e):n.refs&&n.refs.forEach(o=>pa(o,r,e))}},tC=(e,t)=>{t.shouldUseNativeValidation&&gf(e,t);const r={};for(const n in e){const o=Y(t.fields,n),s=Object.assign(e[n]||{},{ref:o&&o.ref});if(rC(t.names||Object.keys(e),n)){const i=Object.assign({},Y(r,n));he(i,"root",s),he(r,n,i)}else he(r,n,s)}return r},rC=(e,t)=>e.some(r=>r.startsWith(t+"."));var nC=function(e,t){for(var r={};e.length;){var n=e[0],o=n.code,s=n.message,i=n.path.join(".");if(!r[i])if("unionErrors"in n){var a=n.unionErrors[0].errors[0];r[i]={message:a.message,type:a.code}}else r[i]={message:s,type:o};if("unionErrors"in n&&n.unionErrors.forEach(function(p){return p.errors.forEach(function(f){return e.push(f)})}),t){var u=r[i].types,d=u&&u[n.code];r[i]=cf(i,t,r,o,d?[].concat(d,n.message):n.message)}e.shift()}return r},oC=function(e,t,r){return r===void 0&&(r={}),function(n,o,s){try{return Promise.resolve(function(i,a){try{var u=Promise.resolve(e[r.mode==="sync"?"parse":"parseAsync"](n,t)).then(function(d){return s.shouldUseNativeValidation&&gf({},s),{errors:{},values:r.raw?n:d}})}catch(d){return a(d)}return u&&u.then?u.then(void 0,a):u}(0,function(i){if(function(a){return Array.isArray(a==null?void 0:a.errors)}(i))return{values:{},errors:tC(nC(i.errors,!s.shouldUseNativeValidation&&s.criteriaMode==="all"),s)};throw i}))}catch(i){return Promise.reject(i)}}};const xf=({useStore:e,fields:t=[],defaultValues:r={},validationSchema:n,children:o,onSubmit:s,onCancel:i,onBack:a,onBeforeSubmit:u,initialData:d=null,loading:p=!1,submitting:f=!1,title:m,description:g,submitLabel:x="Save",cancelLabel:h="Cancel",backLabel:y="Back",columns:v=1,showHeader:b=!0,showFooter:S=!0,showBack:C=!0,showCard:N=!0,listPath:_,icon:j,className:$,...D})=>{var Be;const O=Te.useNavigate(),{id:P}=Te.useParams(),A=!!P,M=e==null?void 0:e(),z=M==null?void 0:M.form,q=(M==null?void 0:M.loading)??!1,H=((Be=M==null?void 0:M.form)==null?void 0:Be.isSubmitting)??!1,k=(M==null?void 0:M.fetchAndPopulateForm)||(M==null?void 0:M.fetchById)||(M==null?void 0:M.fetchOne),W=M==null?void 0:M.create,L=M==null?void 0:M.update,re=M==null?void 0:M.resetForm,F=p||q,te=f||H;l.useEffect(()=>(A&&P&&k&&k(P),()=>{re==null||re()}),[P,A]);const ce=()=>{a?a():O(_||-1)},de=()=>{i?i():ce()},ge=async w=>{var E;(E=w==null?void 0:w.preventDefault)==null||E.call(w);try{let R=(z==null?void 0:z.values)||{};u&&(R=u(R)),A?await(L==null?void 0:L(P,R)):await(W==null?void 0:W(R)),ce()}catch(R){console.error("Form submission error:",R)}};if(e&&o){const w=A?`Edit ${m}`:`Create ${m}`,E=c.jsxs("form",{onSubmit:ge,children:[o,S&&c.jsxs("div",{className:"flex items-center justify-end gap-2 mt-6 pt-4 border-t",children:[c.jsxs(ae,{type:"button",variant:"outline",onClick:de,disabled:te,children:[c.jsx(qt,{className:"mr-2 h-4 w-4"}),h]}),c.jsx(ae,{type:"submit",disabled:te||F,children:te?c.jsxs(c.Fragment,{children:[c.jsx(kt,{className:"mr-2 h-4 w-4 animate-spin"}),"Saving..."]}):c.jsxs(c.Fragment,{children:[c.jsx(Ni,{className:"mr-2 h-4 w-4"}),x]})})]})]});return N?c.jsxs(Ke,{className:$,...D,children:[c.jsx(Xt,{children:c.jsxs("div",{className:"flex items-center gap-4",children:[C&&c.jsx(ae,{variant:"ghost",size:"icon",onClick:ce,children:c.jsx(ht,{className:"h-4 w-4"})}),j&&c.jsx("div",{className:"h-10 w-10 rounded-full bg-primary/10 flex items-center justify-center",children:c.jsx(j,{className:"h-5 w-5 text-primary"})}),c.jsxs("div",{children:[c.jsx(Qt,{children:w}),g&&c.jsx(Zt,{children:g})]})]})}),c.jsx(Ye,{children:E})]}):c.jsxs("div",{className:T("space-y-6",$),...D,children:[c.jsxs("div",{className:"flex items-center gap-4",children:[C&&c.jsx(ae,{variant:"ghost",size:"icon",onClick:ce,children:c.jsx(ht,{className:"h-4 w-4"})}),j&&c.jsx("div",{className:"h-10 w-10 rounded-full bg-primary/10 flex items-center justify-center",children:c.jsx(j,{className:"h-5 w-5 text-primary"})}),c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:w}),g&&c.jsx("p",{className:"text-muted-foreground",children:g})]})]}),E]})}const me=eC({defaultValues:d||r,resolver:n?oC(n):void 0,mode:"onBlur"}),{handleSubmit:I,formState:{errors:Z,isDirty:X,isValid:ne},reset:J,watch:U,setValue:ee,control:ye}=me;l.useEffect(()=>{d&&J(d)},[d,J]);const xe=async w=>{try{await(s==null?void 0:s(w))}catch(E){console.error("Form submission error:",E)}},ke=w=>{var vt;const{name:E,type:R="text",label:K,placeholder:B,description:V,required:Q,disabled:ue,options:pe=[],className:Re,...Fe}=w,Ae=(vt=Z[E])==null?void 0:vt.message,Ie=U(E),Pe={label:K,placeholder:B,description:V,error:Ae,required:Q,disabled:ue||F||te,className:Re};switch(R){case"text":case"email":case"password":case"number":case"url":case"tel":return c.jsx(fn,{...Pe,type:R,...me.register(E),...Fe});case"textarea":return c.jsx(Ys,{...Pe,...me.register(E),...Fe});case"select":return c.jsx(qs,{...Pe,options:pe,value:Ie,onChange:Qe=>ee(E,Qe,{shouldValidate:!0}),...Fe});case"search-select":return c.jsx(Xs,{...Pe,options:pe,value:Ie,onChange:Qe=>ee(E,Qe,{shouldValidate:!0}),...Fe});case"switch":return c.jsx(Qs,{...Pe,checked:Ie,onCheckedChange:Qe=>ee(E,Qe,{shouldValidate:!0}),...Fe});case"checkbox":return c.jsx(Zs,{...Pe,checked:Ie,onCheckedChange:Qe=>ee(E,Qe,{shouldValidate:!0}),...Fe});case"custom":return w.render?w.render({form:me,field:w,error:Ae,value:Ie}):null;default:return c.jsx(fn,{...Pe,type:"text",...me.register(E),...Fe})}},De=T("grid gap-4",v===1&&"grid-cols-1",v===2&&"grid-cols-1 md:grid-cols-2",v===3&&"grid-cols-1 md:grid-cols-2 lg:grid-cols-3",v===4&&"grid-cols-1 md:grid-cols-2 lg:grid-cols-4"),Le=c.jsxs("form",{onSubmit:I(xe),children:[c.jsx("div",{className:De,children:t.map(w=>{if(w.hidden&&(typeof w.hidden=="function"?w.hidden(U()):w.hidden))return null;const E=w.colSpan||1,R=T(E===2&&"md:col-span-2",E===3&&"md:col-span-2 lg:col-span-3",E===4&&"md:col-span-2 lg:col-span-4",E==="full"&&"col-span-full");return c.jsx("div",{className:R,children:ke(w)},w.name)})}),S&&c.jsxs("div",{className:"flex items-center justify-end gap-2 mt-6 pt-4 border-t",children:[i&&c.jsxs(ae,{type:"button",variant:"outline",onClick:i,disabled:te,children:[c.jsx(qt,{className:"mr-2 h-4 w-4"}),h]}),c.jsx(ae,{type:"submit",disabled:te||F,children:te?c.jsxs(c.Fragment,{children:[c.jsx(kt,{className:"mr-2 h-4 w-4 animate-spin"}),"Saving..."]}):c.jsxs(c.Fragment,{children:[c.jsx(Ni,{className:"mr-2 h-4 w-4"}),x]})})]})]});return b&&(m||g||C)?c.jsxs(Ke,{className:$,...D,children:[c.jsx(Xt,{children:c.jsxs("div",{className:"flex items-center gap-4",children:[C&&a&&c.jsx(ae,{variant:"ghost",size:"icon",onClick:a,children:c.jsx(ht,{className:"h-4 w-4"})}),c.jsxs("div",{children:[m&&c.jsx(Qt,{children:m}),g&&c.jsx(Zt,{children:g})]})]})}),c.jsx(Ye,{children:Le})]}):c.jsx("div",{className:$,...D,children:Le})};xf.displayName="CrudForm";const vf=({useStore:e,children:t,data:r=null,loading:n=!1,error:o=null,fields:s=[],onBack:i,onEdit:a,onDelete:u,listPath:d,editPath:p,title:f,description:m,editLabel:g="Edit",deleteLabel:x="Delete",backLabel:h="Back",itemName:y="item",getItemName:v,showHeader:b=!0,showMeta:S=!0,showCard:C=!0,columns:N=2,icon:_,className:j,...$})=>{const D=Te.useNavigate(),{id:O}=Te.useParams(),P=e==null?void 0:e(),A=P==null?void 0:P.currentItem,M=(P==null?void 0:P.loading)??!1,z=P==null?void 0:P.error,q=(P==null?void 0:P.fetchById)||(P==null?void 0:P.fetchOne),H=P==null?void 0:P.delete,k=r||A,W=n||M,L=o||z,[re,F]=l.useState(!1),[te,ce]=l.useState(!1);l.useEffect(()=>{O&&q&&q(O)},[O]);const de=()=>{i?i():D(d||-1)},ge=()=>{a?a(k):p&&O&&D(`${p}/${O}/edit`)},me=async()=>{ce(!0);try{u?await u(k):H&&O&&(await H(O),de()),F(!1)}catch(U){console.error("Delete error:",U)}finally{ce(!1)}},I=k&&v?v(k):(k==null?void 0:k.name)||(k==null?void 0:k.title)||y,Z=(U,ee)=>{if(U.render)return k?U.render(ee,k):c.jsx("span",{className:"text-muted-foreground",children:"-"});if(ee==null||ee==="")return c.jsx("span",{className:"text-muted-foreground",children:"-"});switch(U.type){case"badge":return c.jsx(hr,{variant:U.variant||"default",children:U.format?U.format(ee):String(ee)});case"status":const ye={active:"success",inactive:"secondary",pending:"warning",error:"destructive",...U.statusColors};return c.jsx(hr,{variant:ye[ee==null?void 0:ee.toLowerCase()]||"default",children:U.format?U.format(ee):String(ee)});case"boolean":const xe=!!ee;return c.jsx(hr,{variant:xe?"success":"secondary",children:xe?U.trueLabel||"Yes":U.falseLabel||"No"});case"date":return Lo(ee);case"datetime":return Xr(ee);case"currency":return new Intl.NumberFormat("en-US",{style:"currency",currency:U.currency||"USD"}).format(ee);case"number":return U.format?U.format(ee):new Intl.NumberFormat().format(ee);case"list":return Array.isArray(ee)?c.jsx("div",{className:"flex flex-wrap gap-1",children:ee.map((ke,De)=>c.jsx(hr,{variant:"outline",children:U.getItemLabel?U.getItemLabel(ke):String(ke)},De))}):String(ee);case"link":return c.jsx("a",{href:ee,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:U.linkText||ee});case"email":return c.jsx("a",{href:`mailto:${ee}`,className:"text-primary hover:underline",children:ee});case"phone":return c.jsx("a",{href:`tel:${ee}`,className:"text-primary hover:underline",children:ee});case"image":return c.jsx("img",{src:ee,alt:U.label||"Image",className:T("rounded-md object-cover",U.imageClassName||"h-20 w-20")});case"html":return c.jsx("div",{className:"prose prose-sm max-w-none",dangerouslySetInnerHTML:{__html:ee}});default:return U.format?U.format(ee):String(ee)}},X=U=>{if(k)return U.accessor?typeof U.accessor=="function"?U.accessor(k):k[U.accessor]:k[U.name]},ne=T("grid gap-6",N===1&&"grid-cols-1",N===2&&"grid-cols-1 md:grid-cols-2",N===3&&"grid-cols-1 md:grid-cols-2 lg:grid-cols-3"),J=c.jsxs(c.Fragment,{children:[c.jsx("div",{className:ne,children:s.map(U=>{if(U.hidden&&(typeof U.hidden=="function"?k&&U.hidden(k):U.hidden))return null;const ee=X(U),ye=U.colSpan||1,xe=T(ye===2&&"md:col-span-2",ye===3&&"lg:col-span-3",ye==="full"&&"col-span-full");return c.jsxs("div",{className:xe,children:[c.jsxs("dt",{className:"text-sm font-medium text-muted-foreground mb-1",children:[U.icon&&c.jsx(U.icon,{className:"inline-block mr-2 h-4 w-4"}),U.label]}),c.jsx("dd",{className:"text-sm",children:Z(U,ee)})]},U.name||U.accessor)})}),S&&k&&(k.created_at||k.updated_at||k.createdAt||k.updatedAt)&&c.jsxs(c.Fragment,{children:[c.jsx(Mr,{className:"my-6"}),c.jsxs("div",{className:"flex flex-wrap gap-6 text-sm text-muted-foreground",children:[(k.created_at||k.createdAt)&&(k.created_at||k.createdAt)!==""&&c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(wi,{className:"h-4 w-4"}),c.jsxs("span",{children:["Created: ",Xr(k.created_at||k.createdAt)]})]}),(k.updated_at||k.updatedAt)&&(k.updated_at||k.updatedAt)!==""&&c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(wi,{className:"h-4 w-4"}),c.jsxs("span",{children:["Updated: ",Xr(k.updated_at||k.updatedAt)]})]}),(k.id||k._id)&&c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Up,{className:"h-4 w-4"}),c.jsxs("span",{children:["ID: ",k.id||k._id]})]})]})]})]});return e&&t&&typeof t=="function"?W?c.jsx("div",{className:T("space-y-6",j),children:c.jsx(Ke,{children:c.jsx(Ye,{className:"py-12",children:c.jsx(or,{text:`Loading ${y}...`})})})}):L?c.jsx("div",{className:T("space-y-6",j),children:c.jsx(Ke,{children:c.jsxs(Ye,{className:"py-12 text-center",children:[c.jsx("p",{className:"text-destructive",children:(L==null?void 0:L.message)||"An error occurred"}),c.jsxs(ae,{variant:"outline",onClick:de,className:"mt-4",children:[c.jsx(ht,{className:"mr-2 h-4 w-4"}),h]})]})})}):k?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:T("space-y-6",j),...$,children:[b&&c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex items-center gap-4",children:[c.jsx(ae,{variant:"ghost",size:"icon",onClick:de,children:c.jsx(ht,{className:"h-4 w-4"})}),_&&c.jsx("div",{className:"h-10 w-10 rounded-full bg-primary/10 flex items-center justify-center",children:c.jsx(_,{className:"h-5 w-5 text-primary"})}),c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:f}),m&&c.jsx("p",{className:"text-muted-foreground",children:m})]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[(a||p)&&c.jsxs(ae,{variant:"outline",onClick:ge,children:[c.jsx(xo,{className:"mr-2 h-4 w-4"}),g]}),(u||H)&&c.jsxs(ae,{variant:"destructive",onClick:()=>F(!0),children:[c.jsx(vo,{className:"mr-2 h-4 w-4"}),x]})]})]}),t(k)]}),c.jsx(Pr,{open:re,onOpenChange:F,onConfirm:me,itemName:I,loading:te})]}):c.jsx("div",{className:T("space-y-6",j),children:c.jsx(Ke,{children:c.jsxs(Ye,{className:"py-12 text-center",children:[c.jsxs("p",{className:"text-muted-foreground",children:["No ",y," found"]}),c.jsxs(ae,{variant:"outline",onClick:de,className:"mt-4",children:[c.jsx(ht,{className:"mr-2 h-4 w-4"}),h]})]})})}):W?c.jsx(Ke,{className:j,children:c.jsx(Ye,{className:"py-12",children:c.jsx(or,{text:`Loading ${y}...`})})}):L?c.jsx(Ke,{className:j,children:c.jsxs(Ye,{className:"py-12 text-center",children:[c.jsx("p",{className:"text-destructive",children:(L==null?void 0:L.message)||"An error occurred"}),c.jsxs(ae,{variant:"outline",onClick:de,className:"mt-4",children:[c.jsx(ht,{className:"mr-2 h-4 w-4"}),h]})]})}):k?c.jsxs(c.Fragment,{children:[c.jsxs(Ke,{className:j,...$,children:[b&&c.jsxs(Xt,{className:"flex flex-row items-center justify-between space-y-0 pb-4",children:[c.jsxs("div",{className:"flex items-center gap-4",children:[c.jsx(ae,{variant:"ghost",size:"icon",onClick:de,children:c.jsx(ht,{className:"h-4 w-4"})}),c.jsxs("div",{children:[f&&c.jsx(Qt,{children:f}),m&&c.jsx(Zt,{children:m})]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[(a||p)&&c.jsxs(ae,{variant:"outline",onClick:ge,children:[c.jsx(xo,{className:"mr-2 h-4 w-4"}),g]}),(u||H)&&c.jsxs(ae,{variant:"destructive",onClick:()=>F(!0),children:[c.jsx(vo,{className:"mr-2 h-4 w-4"}),x]})]})]}),c.jsx(Ye,{children:J})]}),c.jsx(Pr,{open:re,onOpenChange:F,onConfirm:me,itemName:I,loading:te})]}):c.jsx(Ke,{className:j,children:c.jsxs(Ye,{className:"py-12 text-center",children:[c.jsxs("p",{className:"text-muted-foreground",children:["No ",y," found"]}),c.jsxs(ae,{variant:"outline",onClick:de,className:"mt-4",children:[c.jsx(ht,{className:"mr-2 h-4 w-4"}),h]})]})})};vf.displayName="CrudDetail";const yf=e=>{const{name:t="crud",apiClient:r,endpoint:n,transformResponse:o=f=>f,transformRequest:s=f=>f,initialState:i={},extraActions:a={},idField:u="id",listKey:d="results",countKey:p="count"}=e;if(!r)throw new Error("createCrudStore: apiClient is required");if(!n)throw new Error("createCrudStore: endpoint is required");return f=>f((m,g)=>({items:[],item:null,loading:!1,submitting:!1,error:null,page:1,pageSize:10,totalItems:0,totalPages:0,sortColumn:null,sortDirection:null,search:"",filters:{},selectedIds:[],...i,setPage:x=>m({page:x}),setPageSize:x=>m({pageSize:x,page:1}),setSearch:x=>m({search:x,page:1}),setFilters:x=>m({filters:x,page:1}),setSort:(x,h)=>m({sortColumn:x,sortDirection:h}),setSelectedIds:x=>m({selectedIds:x}),clearSelection:()=>m({selectedIds:[]}),clearError:()=>m({error:null}),reset:()=>m({items:[],item:null,loading:!1,submitting:!1,error:null,page:1,search:"",filters:{},selectedIds:[]}),fetchList:async(x={})=>{var y,v,b,S;const h=g();m({loading:!0,error:null});try{const C={page:h.page,page_size:h.pageSize,search:h.search||void 0,ordering:h.sortColumn?`${h.sortDirection==="desc"?"-":""}${h.sortColumn}`:void 0,...h.filters,...x};Object.keys(C).forEach(O=>{(C[O]===void 0||C[O]==="")&&delete C[O]});const _=(await r.get(n,{params:C})).data,j=_[d]||_.data||(Array.isArray(_)?_:[]),$=_[p]||_.total||j.length,D=Math.ceil($/h.pageSize);return m({items:j.map(o),totalItems:$,totalPages:D,loading:!1}),{items:j,totalItems:$,totalPages:D}}catch(C){const N=((v=(y=C.response)==null?void 0:y.data)==null?void 0:v.message)||((S=(b=C.response)==null?void 0:b.data)==null?void 0:S.detail)||C.message||"Failed to fetch items";throw m({error:{message:N,original:C},loading:!1}),C}},fetchOne:async x=>{var h,y,v,b;m({loading:!0,error:null,item:null});try{const S=await r.get(`${n}/${x}/`),C=o(S.data);return m({item:C,loading:!1}),C}catch(S){const C=((y=(h=S.response)==null?void 0:h.data)==null?void 0:y.message)||((b=(v=S.response)==null?void 0:v.data)==null?void 0:b.detail)||S.message||"Failed to fetch item";throw m({error:{message:C,original:S},loading:!1}),S}},create:async x=>{var h,y,v,b,S;m({submitting:!0,error:null});try{const C=s(x),N=await r.post(`${n}/`,C),_=o(N.data);return m(j=>({items:[_,...j.items],totalItems:j.totalItems+1,submitting:!1})),_}catch(C){const N=((y=(h=C.response)==null?void 0:h.data)==null?void 0:y.message)||((b=(v=C.response)==null?void 0:v.data)==null?void 0:b.detail)||C.message||"Failed to create item",_=((S=C.response)==null?void 0:S.data)||{};throw m({error:{message:N,fieldErrors:_,original:C},submitting:!1}),C}},update:async(x,h)=>{var y,v,b,S,C;m({submitting:!0,error:null});try{const N=s(h),_=await r.patch(`${n}/${x}/`,N),j=o(_.data);return m($=>{var D;return{items:$.items.map(O=>O[u]===x?j:O),item:((D=$.item)==null?void 0:D[u])===x?j:$.item,submitting:!1}}),j}catch(N){const _=((v=(y=N.response)==null?void 0:y.data)==null?void 0:v.message)||((S=(b=N.response)==null?void 0:b.data)==null?void 0:S.detail)||N.message||"Failed to update item",j=((C=N.response)==null?void 0:C.data)||{};throw m({error:{message:_,fieldErrors:j,original:N},submitting:!1}),N}},delete:async x=>{var h,y,v,b;m({submitting:!0,error:null});try{return await r.delete(`${n}/${x}/`),m(S=>{var C;return{items:S.items.filter(N=>N[u]!==x),totalItems:S.totalItems-1,item:((C=S.item)==null?void 0:C[u])===x?null:S.item,selectedIds:S.selectedIds.filter(N=>N!==x),submitting:!1}}),!0}catch(S){const C=((y=(h=S.response)==null?void 0:h.data)==null?void 0:y.message)||((b=(v=S.response)==null?void 0:v.data)==null?void 0:b.detail)||S.message||"Failed to delete item";throw m({error:{message:C,original:S},submitting:!1}),S}},bulkDelete:async x=>{var h,y,v,b;m({submitting:!0,error:null});try{return await Promise.all(x.map(S=>r.delete(`${n}/${S}/`))),m(S=>({items:S.items.filter(C=>!x.includes(C[u])),totalItems:S.totalItems-x.length,selectedIds:[],submitting:!1})),!0}catch(S){const C=((y=(h=S.response)==null?void 0:h.data)==null?void 0:y.message)||((b=(v=S.response)==null?void 0:v.data)==null?void 0:b.detail)||S.message||"Failed to delete items";throw m({error:{message:C,original:S},submitting:!1}),S}},replace:async(x,h)=>{var y,v,b,S,C;m({submitting:!0,error:null});try{const N=s(h),_=await r.put(`${n}/${x}/`,N),j=o(_.data);return m($=>{var D;return{items:$.items.map(O=>O[u]===x?j:O),item:((D=$.item)==null?void 0:D[u])===x?j:$.item,submitting:!1}}),j}catch(N){const _=((v=(y=N.response)==null?void 0:y.data)==null?void 0:v.message)||((S=(b=N.response)==null?void 0:b.data)==null?void 0:S.detail)||N.message||"Failed to update item",j=((C=N.response)==null?void 0:C.data)||{};throw m({error:{message:_,fieldErrors:j,original:N},submitting:!1}),N}},...a}))},sC=e=>{const{create:t}=require("zustand");return t(yf(e))};function iC({brandName:e="Your Brand",brandLogo:t,brandDescription:r="Welcome back",quote:n,quoteAuthor:o,copyright:s,leftPanelClassName:i,rightPanelClassName:a,leftPanelContent:u,rightPanelContent:d,showLeftPanel:p=!0,children:f}){const m=new Date().getFullYear(),g=s||`© ${m} ${e}. All rights reserved.`,x=c.jsxs("div",{className:"flex flex-col h-full p-8 lg:p-12 text-white",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[t||c.jsx("div",{className:"h-10 w-10 rounded-lg bg-white/20 flex items-center justify-center",children:c.jsx("span",{className:"text-white font-bold text-xl",children:e.charAt(0)})}),c.jsx("span",{className:"text-xl font-semibold",children:e})]}),c.jsxs("div",{className:"flex-1 flex items-center justify-center",children:[n&&c.jsxs("div",{className:"max-w-md",children:[c.jsxs("blockquote",{className:"text-2xl lg:text-3xl font-light leading-relaxed",children:['"',n,'"']}),o&&c.jsxs("p",{className:"mt-4 text-white/70",children:["— ",o]})]}),!n&&r&&c.jsx("div",{className:"text-center",children:c.jsx("p",{className:"text-2xl lg:text-3xl font-light",children:r})})]}),c.jsx("div",{className:"text-sm text-white/60",children:g})]});return c.jsxs("div",{className:"min-h-screen flex",children:[p&&c.jsx("div",{className:T("hidden lg:flex lg:w-1/2 bg-gray-900",i),children:u||x}),c.jsx("div",{className:T("w-full flex items-center justify-center p-8",p?"lg:w-1/2":"",a),children:c.jsx("div",{className:"w-full max-w-md",children:d||f||c.jsx(Te.Outlet,{})})})]})}function aC({onSubmit:e,isLoading:t=!1,error:r,title:n="Login",subtitle:o="Enter your email below to login to your account",emailLabel:s="Email",emailPlaceholder:i="m@example.com",passwordLabel:a="Password",rememberMeLabel:u="Remember me",forgotPasswordText:d="Forgot your password?",forgotPasswordPath:p="/forgot-password",submitButtonText:f="Login",signUpText:m="Don't have an account?",signUpLinkText:g="Sign up",signUpPath:x="/register",showRememberMe:h=!0,showForgotPassword:y=!0,showSignUp:v=!0,logo:b,className:S,children:C}){const[N,_]=oe.useState(""),[j,$]=oe.useState(""),[D,O]=oe.useState(!1),P=async A=>{A.preventDefault(),e&&await e({email:N,password:j,rememberMe:D})};return c.jsxs("div",{className:T("space-y-6",S),children:[b&&c.jsx("div",{className:"flex justify-center",children:b}),c.jsxs("div",{className:"space-y-2 text-center",children:[c.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:n}),o&&c.jsx("p",{className:"text-sm text-muted-foreground",children:o})]}),r&&c.jsx("div",{className:"p-3 text-sm text-destructive bg-destructive/10 rounded-md",children:r}),c.jsxs("form",{onSubmit:P,className:"space-y-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(Ct,{htmlFor:"email",children:s}),c.jsx(Jt,{id:"email",type:"email",placeholder:i,value:N,onChange:A=>_(A.target.value),required:!0,autoComplete:"email"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx(Ct,{htmlFor:"password",children:a}),y&&p&&c.jsx(Te.Link,{to:p,className:"text-sm text-muted-foreground hover:text-primary underline-offset-4 hover:underline",children:d})]}),c.jsx(Jt,{id:"password",type:"password",value:j,onChange:A=>$(A.target.value),required:!0,autoComplete:"current-password"})]}),h&&c.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsx(er,{id:"remember",checked:D,onCheckedChange:O}),c.jsx(Ct,{htmlFor:"remember",className:"text-sm font-normal cursor-pointer",children:u})]}),C,c.jsx(ae,{type:"submit",className:"w-full",disabled:t,children:t?"Signing in...":f})]}),v&&x&&c.jsxs("div",{className:"text-center text-sm text-muted-foreground",children:[m," ",c.jsx(Te.Link,{to:x,className:"text-primary underline-offset-4 hover:underline",children:g})]})]})}const bf=oe.createContext(null);function Qn(){const e=oe.useContext(bf);if(!e)throw new Error("useSidebarContext must be used within a SidebarProvider");return e}function wf({defaultOpen:e=!1,defaultCollapsed:t=!1,children:r}){const[n,o]=oe.useState(e),[s,i]=oe.useState(t),a=oe.useCallback(()=>{o(m=>!m)},[]),u=oe.useCallback(m=>{o(m)},[]),d=oe.useCallback(()=>{i(m=>!m)},[]),p=oe.useCallback(m=>{i(m)},[]),f={isOpen:n,isCollapsed:s,toggle:a,setOpen:u,toggleCollapse:d,setCollapsed:p};return c.jsx(bf.Provider,{value:f,children:r})}function Sf({items:e=[],brandName:t="Brand",brandLogo:r,brandPath:n="/dashboard",user:o,onLogout:s,userMenuItems:i=[],showUserProfile:a=!0,className:u,collapsedWidth:d="w-16",expandedWidth:p="w-60",renderItem:f,headerSlot:m,footerSlot:g}){var D,O;const{isOpen:x,isCollapsed:h,setOpen:y,toggleCollapse:v}=Qn(),b=Te.useLocation(),[S,C]=oe.useState([]),N=P=>{C(A=>A.includes(P)?A.filter(M=>M!==P):[...A,P])},_=(P,A=!1)=>{if(P.title)return c.jsxs("div",{className:"mt-6",children:[!h&&c.jsx("h3",{className:"px-3 text-xs font-medium text-sidebar-foreground/50 uppercase tracking-wider mb-2",children:P.title}),h&&c.jsx(Mr,{className:"my-3 bg-sidebar-border"})]},P.title);if(f)return f(P,{isCollapsed:h,isSubItem:A,location:b});const M=P.icon,z=P.children&&P.children.length>0,q=S.includes(P.label),H=P.path&&b.pathname.startsWith(P.path),k=z&&P.children.some(W=>b.pathname.startsWith(W.path));return z?c.jsxs("div",{children:[c.jsxs("button",{onClick:()=>N(P.label),className:T("w-full flex items-center gap-3 px-3 py-2 rounded-lg transition-colors text-sm",k?"bg-sidebar-accent text-sidebar-accent-foreground":"hover:bg-sidebar-accent text-sidebar-foreground hover:text-sidebar-accent-foreground",h&&"justify-center px-2"),title:h?P.label:void 0,children:[M&&c.jsx(M,{className:"h-4 w-4 flex-shrink-0"}),!h&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"flex-1 text-left",children:P.label}),c.jsx(gn,{className:T("h-4 w-4 transition-transform",q&&"rotate-180")})]})]}),!h&&q&&c.jsx("div",{className:"ml-4 mt-1 space-y-0.5",children:P.children.map(W=>_(W,!0))})]},P.label):c.jsxs(Te.Link,{to:P.path,className:T("flex items-center gap-3 px-3 py-2 rounded-lg transition-colors",H?"bg-sidebar-primary text-sidebar-primary-foreground":"hover:bg-sidebar-accent text-sidebar-foreground hover:text-sidebar-accent-foreground",h&&"justify-center px-2","text-sm"),title:h?P.label:void 0,children:[M&&c.jsx(M,{className:"h-4 w-4 flex-shrink-0"}),!h&&c.jsx("span",{children:P.label})]},P.path||P.label)},j=c.jsxs("div",{className:"flex items-center justify-between h-14 px-3 border-b border-sidebar-border",children:[!h&&c.jsxs(Te.Link,{to:n,className:"flex items-center gap-2",children:[r||c.jsx("div",{className:"h-7 w-7 rounded-md bg-sidebar-primary flex items-center justify-center",children:c.jsx("span",{className:"text-sidebar-primary-foreground font-semibold text-sm",children:t.charAt(0)})}),c.jsx("span",{className:"font-semibold text-sidebar-foreground",children:t})]}),h&&c.jsx(Te.Link,{to:n,className:"mx-auto",children:r||c.jsx("div",{className:"h-7 w-7 rounded-md bg-sidebar-primary flex items-center justify-center",children:c.jsx("span",{className:"text-sidebar-primary-foreground font-semibold text-sm",children:t.charAt(0)})})}),c.jsx("button",{onClick:()=>y(!1),className:"p-1.5 rounded-lg hover:bg-sidebar-accent lg:hidden",children:c.jsx(qt,{className:"h-4 w-4 text-sidebar-foreground"})}),c.jsx("button",{onClick:v,className:T("hidden lg:block p-1.5 rounded-lg hover:bg-sidebar-accent",h&&"mx-auto"),children:h?c.jsx(xn,{className:"h-4 w-4 text-sidebar-foreground"}):c.jsx(Ra,{className:"h-4 w-4 text-sidebar-foreground"})})]}),$=o&&a&&c.jsx("div",{className:"px-3 py-3 border-t border-sidebar-border",children:c.jsxs(Ds,{children:[c.jsx(Is,{asChild:!0,children:c.jsxs("button",{className:T("w-full flex items-center gap-3 px-2 py-2 rounded-lg transition-colors hover:bg-sidebar-accent",h&&"justify-center px-0"),children:[c.jsxs(Ss,{className:"h-8 w-8",children:[c.jsx(Cs,{src:o.avatar,alt:o.firstName||"User"}),c.jsxs(Ns,{className:"bg-sidebar-primary text-sidebar-primary-foreground text-xs",children:[((D=o.firstName)==null?void 0:D[0])||"U",((O=o.lastName)==null?void 0:O[0])||""]})]}),!h&&c.jsxs("div",{className:"flex-1 text-left",children:[c.jsxs("p",{className:"text-sm font-medium text-sidebar-foreground truncate",children:[o.firstName," ",o.lastName]}),c.jsx("p",{className:"text-xs text-sidebar-foreground/50 truncate",children:o.email})]})]})}),c.jsxs(zn,{align:"end",className:"w-56",children:[c.jsx(Gn,{children:"My Account"}),c.jsx(_r,{}),i.map((P,A)=>c.jsx(Rr,{asChild:!!P.path,onClick:P.onClick,children:P.path?c.jsx(Te.Link,{to:P.path,children:P.label}):P.label},A)),i.length>0&&c.jsx(_r,{}),s&&c.jsx(Rr,{onClick:s,className:"text-destructive",children:"Log out"})]})]})});return c.jsxs(c.Fragment,{children:[x&&c.jsx("div",{className:"fixed inset-0 bg-black/50 z-40 lg:hidden",onClick:()=>y(!1)}),c.jsxs("aside",{className:T("fixed top-0 left-0 z-50 h-full bg-sidebar border-r border-sidebar-border transition-all duration-300 ease-in-out flex flex-col",x?"translate-x-0":"-translate-x-full",h?d:p,"lg:translate-x-0",u),children:[m||j,c.jsx("nav",{className:"flex-1 overflow-y-auto px-3 py-3",children:c.jsx("div",{className:"space-y-1",children:e.map(P=>_(P))})}),g||$]})]})}function Cf({pathNames:e={},showBreadcrumbs:t=!0,showMenuButton:r=!0,className:n,leftSlot:o,rightSlot:s,breadcrumbsSlot:i,children:a}){const{toggle:u}=Qn(),d=Te.useLocation(),p={dashboard:"Dashboard",users:"Users",roles:"Roles",permissions:"Permissions",settings:"Settings",profile:"Profile",create:"Create",edit:"Edit",...e},f=()=>{const m=d.pathname.split("/").filter(Boolean);return c.jsx("nav",{className:"flex items-center gap-1 text-sm",children:m.map((g,x)=>{const h="/"+m.slice(0,x+1).join("/"),y=x===m.length-1,v=p[g]||g;return c.jsxs("div",{className:"flex items-center gap-1",children:[x>0&&c.jsx(xn,{className:"h-4 w-4 text-muted-foreground"}),y?c.jsx("span",{className:"font-medium text-foreground",children:v}):c.jsx(Te.Link,{to:h,className:"text-muted-foreground hover:text-foreground transition-colors",children:v})]},h)})})};return c.jsxs("header",{className:T("sticky top-0 z-30 bg-background",n),children:[c.jsxs("div",{className:"flex items-center h-14 px-4 md:px-6",children:[r&&c.jsx("button",{onClick:u,className:"p-2 -ml-2 rounded-lg hover:bg-muted lg:hidden",children:c.jsx(zp,{className:"h-5 w-5"})}),c.jsx("div",{className:"flex items-center gap-4 flex-1",children:o||t&&(i||c.jsx(f,{}))}),s&&c.jsx("div",{className:"flex items-center gap-2",children:s}),a]}),c.jsx(Mr,{})]})}function lC({sidebarProps:e,headerProps:t,showHeader:r=!0,showSidebar:n=!0,contentClassName:o,mainSlot:s,children:i}){const{isCollapsed:a}=Qn();return c.jsxs("div",{className:"min-h-screen bg-background",children:[n&&c.jsx(Sf,{...e}),c.jsxs("div",{className:T("transition-all duration-300 ease-in-out",n&&(a?"lg:ml-16":"lg:ml-60")),children:[r&&c.jsx(Cf,{...t}),c.jsx("main",{className:T("p-4 md:p-6",o),children:s||i||c.jsx(Te.Outlet,{})})]})]})}function cC({sidebarProps:e={},headerProps:t={},defaultOpen:r=!1,defaultCollapsed:n=!1,showHeader:o=!0,showSidebar:s=!0,contentClassName:i,mainSlot:a,children:u}){return c.jsx(wf,{defaultOpen:r,defaultCollapsed:n,children:c.jsx(lC,{sidebarProps:e,headerProps:t,showHeader:o,showSidebar:s,contentClassName:i,mainSlot:a,children:u})})}exports.Alert=Bs;exports.AlertDescription=Hs;exports.AlertTitle=Ws;exports.AlertWithIcon=Qd;exports.AuthLayout=iC;exports.Avatar=Ss;exports.AvatarFallback=Ns;exports.AvatarImage=Cs;exports.Badge=hr;exports.Button=ae;exports.Card=Ke;exports.CardContent=Ye;exports.CardDescription=Zt;exports.CardFooter=Ta;exports.CardHeader=Xt;exports.CardTitle=Qt;exports.Checkbox=er;exports.ConfirmModal=ti;exports.CreateEmptyState=nf;exports.CrudDetail=vf;exports.CrudForm=xf;exports.CrudList=af;exports.DashboardLayout=cC;exports.DataTable=ri;exports.DeleteConfirmModal=Pr;exports.Dialog=Vc;exports.DialogClose=uy;exports.DialogContent=gs;exports.DialogDescription=ys;exports.DialogFooter=On;exports.DialogHeader=xs;exports.DialogOverlay=hs;exports.DialogPortal=Bc;exports.DialogTitle=vs;exports.DialogTrigger=cy;exports.DropdownMenu=Ds;exports.DropdownMenuCheckboxItem=kd;exports.DropdownMenuContent=zn;exports.DropdownMenuGroup=iS;exports.DropdownMenuItem=Rr;exports.DropdownMenuLabel=Gn;exports.DropdownMenuPortal=aS;exports.DropdownMenuRadioGroup=cS;exports.DropdownMenuRadioItem=Dd;exports.DropdownMenuSeparator=_r;exports.DropdownMenuShortcut=Id;exports.DropdownMenuSub=lS;exports.DropdownMenuSubContent=Md;exports.DropdownMenuSubTrigger=Td;exports.DropdownMenuTrigger=Is;exports.EmptyState=dr;exports.ErrorState=of;exports.FormField=ur;exports.FormModal=sf;exports.Header=Cf;exports.Input=Jt;exports.Label=Ct;exports.Loading=or;exports.LoadingButton=rf;exports.LoadingOverlay=tf;exports.LoginPage=aC;exports.Modal=qn;exports.Pagination=Js;exports.QCheckbox=Zs;exports.QForm=ef;exports.QInput=fn;exports.QSearchSelect=Xs;exports.QSelect=qs;exports.QSwitch=Qs;exports.QTabs=fu;exports.QTextarea=Ys;exports.ScrollArea=qd;exports.ScrollBar=Vs;exports.SearchEmptyState=ei;exports.SearchSelect=Ks;exports.Select=ls;exports.SelectContent=kn;exports.SelectGroup=Bv;exports.SelectItem=Dn;exports.SelectLabel=gc;exports.SelectScrollDownButton=ds;exports.SelectScrollUpButton=us;exports.SelectSeparator=xc;exports.SelectTrigger=Mn;exports.SelectValue=cs;exports.Separator=Mr;exports.Sidebar=Sf;exports.SidebarProvider=wf;exports.Skeleton=Pm;exports.Switch=Go;exports.Table=Us;exports.TableBody=Gs;exports.TableCaption=Jd;exports.TableCell=Tt;exports.TableFooter=Zd;exports.TableHead=vr;exports.TableHeader=zs;exports.TableRow=zt;exports.Tabs=Wy;exports.TabsContent=du;exports.TabsList=cu;exports.TabsTrigger=uu;exports.Textarea=Vo;exports.Tooltip=Pb;exports.TooltipContent=Tu;exports.TooltipProvider=_b;exports.TooltipTrigger=Ab;exports.alertVariants=Xd;exports.badgeVariants=Ma;exports.buildQueryString=Rp;exports.buttonVariants=Aa;exports.capitalize=bp;exports.cn=T;exports.createCrudStore=yf;exports.createStore=sC;exports.debounce=Ea;exports.deepClone=Sp;exports.formatCurrency=xp;exports.formatDate=Lo;exports.formatDateTime=Xr;exports.formatRelativeTime=vp;exports.generateId=Ep;exports.getInitials=Np;exports.isEmpty=Cp;exports.parseQueryString=jp;exports.slugify=wp;exports.truncate=yp;exports.useSidebarContext=Qn;
|
|
241
|
+
*/var xa;function Ex(){return xa||(xa=1,process.env.NODE_ENV!=="production"&&function(){function e(_,C){return _===C&&(_!==0||1/_===1/C)||_!==_&&C!==C}function t(_,C){d||s.startTransition===void 0||(d=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var S=C();if(!h){var c=C();o(S,c)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),h=!0)}c=l({inst:{value:S,getSnapshot:C}});var u=c[0].inst,p=c[1];return r(function(){u.value=S,u.getSnapshot=C,n(u)&&p({inst:u})},[_,S,C]),a(function(){return n(u)&&p({inst:u}),_(function(){n(u)&&p({inst:u})})},[_]),f(S),S}function n(_){var C=_.getSnapshot;_=_.value;try{var S=C();return!o(_,S)}catch{return!0}}function i(_,C){return C()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var s=K,o=typeof Object.is=="function"?Object.is:e,l=s.useState,a=s.useEffect,r=s.useLayoutEffect,f=s.useDebugValue,d=!1,h=!1,b=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?i:t;xr.useSyncExternalStore=s.useSyncExternalStore!==void 0?s.useSyncExternalStore:b,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),xr}process.env.NODE_ENV==="production"?Wr.exports=Sx():Wr.exports=Ex();var Nx=Wr.exports;function kx(){return Nx.useSyncExternalStore(Tx,()=>!0,()=>!1)}function Tx(){return()=>{}}var Lo="Avatar",[Mx]=_x(Lo),[Ax,Xd]=Mx(Lo),Qd=m.forwardRef((e,t)=>{const{__scopeAvatar:n,...i}=e,[s,o]=m.useState("idle");return g.jsx(Ax,{scope:n,imageLoadingStatus:s,onImageLoadingStatusChange:o,children:g.jsx(Ci.span,{...i,ref:t})})});Qd.displayName=Lo;var Jd="AvatarImage",ef=m.forwardRef((e,t)=>{const{__scopeAvatar:n,src:i,onLoadingStatusChange:s=()=>{},...o}=e,l=Xd(Jd,n),a=Rx(i,o),r=Ze(f=>{s(f),l.onImageLoadingStatusChange(f)});return $e(()=>{a!=="idle"&&r(a)},[a,r]),a==="loaded"?g.jsx(Ci.img,{...o,ref:t,src:i}):null});ef.displayName=Jd;var tf="AvatarFallback",nf=m.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:i,...s}=e,o=Xd(tf,n),[l,a]=m.useState(i===void 0);return m.useEffect(()=>{if(i!==void 0){const r=window.setTimeout(()=>a(!0),i);return()=>window.clearTimeout(r)}},[i]),l&&o.imageLoadingStatus!=="loaded"?g.jsx(Ci.span,{...s,ref:t}):null});nf.displayName=tf;function wa(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function Rx(e,{referrerPolicy:t,crossOrigin:n}){const i=kx(),s=m.useRef(null),o=i?(s.current||(s.current=new window.Image),s.current):null,[l,a]=m.useState(()=>wa(o,e));return $e(()=>{a(wa(o,e))},[o,e]),$e(()=>{const r=h=>()=>{a(h)};if(!o)return;const f=r("loaded"),d=r("error");return o.addEventListener("load",f),o.addEventListener("error",d),t&&(o.referrerPolicy=t),typeof n=="string"&&(o.crossOrigin=n),()=>{o.removeEventListener("load",f),o.removeEventListener("error",d)}},[o,n,t]),l}var sf=Qd,rf=ef,of=nf;const Oo=m.forwardRef(({className:e,...t},n)=>g.jsx(sf,{ref:n,className:ne("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));Oo.displayName=sf.displayName;const Po=m.forwardRef(({className:e,...t},n)=>g.jsx(rf,{ref:n,className:ne("aspect-square h-full w-full",e),...t}));Po.displayName=rf.displayName;const Io=m.forwardRef(({className:e,...t},n)=>g.jsx(of,{ref:n,className:ne("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));Io.displayName=of.displayName;function Dx(e,t=[]){let n=[];function i(o,l){const a=m.createContext(l),r=n.length;n=[...n,l];const f=h=>{var u;const{scope:b,children:_,...C}=h,S=((u=b==null?void 0:b[e])==null?void 0:u[r])||a,c=m.useMemo(()=>C,Object.values(C));return g.jsx(S.Provider,{value:c,children:_})};f.displayName=o+"Provider";function d(h,b){var S;const _=((S=b==null?void 0:b[e])==null?void 0:S[r])||a,C=m.useContext(_);if(C)return C;if(l!==void 0)return l;throw new Error(`\`${h}\` must be used within \`${o}\``)}return[f,d]}const s=()=>{const o=n.map(l=>m.createContext(l));return function(a){const r=(a==null?void 0:a[e])||o;return m.useMemo(()=>({[`__scope${e}`]:{...a,[e]:r}}),[a,r])}};return s.scopeName=e,[i,Lx(s,...t)]}function Lx(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const i=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const l=i.reduce((a,{useScope:r,scopeName:f})=>{const h=r(o)[`__scope${f}`];return{...a,...h}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}function Ox(e){const t=Px(e),n=m.forwardRef((i,s)=>{const{children:o,...l}=i,a=m.Children.toArray(o),r=a.find(Bx);if(r){const f=r.props.children,d=a.map(h=>h===r?m.Children.count(f)>1?m.Children.only(null):m.isValidElement(f)?f.props.children:null:h);return g.jsx(t,{...l,ref:s,children:m.isValidElement(f)?m.cloneElement(f,void 0,d):null})}return g.jsx(t,{...l,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}function Px(e){const t=m.forwardRef((n,i)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const l=jx(s),a=Fx(o,s.props);return s.type!==m.Fragment&&(a.ref=i?je(i,l):l),m.cloneElement(s,a)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var lf=Symbol("radix.slottable");function Ix(e){const t=({children:n})=>g.jsx(g.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=lf,t}function Bx(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===lf}function Fx(e,t){const n={...t};for(const i in t){const s=e[i],o=t[i];/^on[A-Z]/.test(i)?s&&o?n[i]=(...a)=>{const r=o(...a);return s(...a),r}:s&&(n[i]=s):i==="style"?n[i]={...s,...o}:i==="className"&&(n[i]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function jx(e){var i,s;let t=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var zx=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Hx=zx.reduce((e,t)=>{const n=Ox(`Primitive.${t}`),i=m.forwardRef((s,o)=>{const{asChild:l,...a}=s,r=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(r,{...a,ref:o})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{}),[Vs]=Dx("Tooltip",[en]),Ws=en(),af="TooltipProvider",Vx=700,$r="tooltip.open",[Wx,Bo]=Vs(af),cf=e=>{const{__scopeTooltip:t,delayDuration:n=Vx,skipDelayDuration:i=300,disableHoverableContent:s=!1,children:o}=e,l=m.useRef(!0),a=m.useRef(!1),r=m.useRef(0);return m.useEffect(()=>{const f=r.current;return()=>window.clearTimeout(f)},[]),g.jsx(Wx,{scope:t,isOpenDelayedRef:l,delayDuration:n,onOpen:m.useCallback(()=>{window.clearTimeout(r.current),l.current=!1},[]),onClose:m.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(()=>l.current=!0,i)},[i]),isPointerInTransitRef:a,onPointerInTransitChange:m.useCallback(f=>{a.current=f},[]),disableHoverableContent:s,children:o})};cf.displayName=af;var hi="Tooltip",[$x,$s]=Vs(hi),uf=e=>{const{__scopeTooltip:t,children:n,open:i,defaultOpen:s,onOpenChange:o,disableHoverableContent:l,delayDuration:a}=e,r=Bo(hi,e.__scopeTooltip),f=Ws(t),[d,h]=m.useState(null),b=it(),_=m.useRef(0),C=l??r.disableHoverableContent,S=a??r.delayDuration,c=m.useRef(!1),[u,p]=wt({prop:i,defaultProp:s??!1,onChange:E=>{E?(r.onOpen(),document.dispatchEvent(new CustomEvent($r))):r.onClose(),o==null||o(E)},caller:hi}),v=m.useMemo(()=>u?c.current?"delayed-open":"instant-open":"closed",[u]),y=m.useCallback(()=>{window.clearTimeout(_.current),_.current=0,c.current=!1,p(!0)},[p]),w=m.useCallback(()=>{window.clearTimeout(_.current),_.current=0,p(!1)},[p]),x=m.useCallback(()=>{window.clearTimeout(_.current),_.current=window.setTimeout(()=>{c.current=!0,p(!0),_.current=0},S)},[S,p]);return m.useEffect(()=>()=>{_.current&&(window.clearTimeout(_.current),_.current=0)},[]),g.jsx(Ti,{...f,children:g.jsx($x,{scope:t,contentId:b,open:u,stateAttribute:v,trigger:d,onTriggerChange:h,onTriggerEnter:m.useCallback(()=>{r.isOpenDelayedRef.current?x():y()},[r.isOpenDelayedRef,x,y]),onTriggerLeave:m.useCallback(()=>{C?w():(window.clearTimeout(_.current),_.current=0)},[w,C]),onOpen:y,onClose:w,disableHoverableContent:C,children:n})})};uf.displayName=hi;var Ur="TooltipTrigger",df=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...i}=e,s=$s(Ur,n),o=Bo(Ur,n),l=Ws(n),a=m.useRef(null),r=ye(t,a,s.onTriggerChange),f=m.useRef(!1),d=m.useRef(!1),h=m.useCallback(()=>f.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),g.jsx(Mi,{asChild:!0,...l,children:g.jsx(Hx.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...i,ref:r,onPointerMove:oe(e.onPointerMove,b=>{b.pointerType!=="touch"&&!d.current&&!o.isPointerInTransitRef.current&&(s.onTriggerEnter(),d.current=!0)}),onPointerLeave:oe(e.onPointerLeave,()=>{s.onTriggerLeave(),d.current=!1}),onPointerDown:oe(e.onPointerDown,()=>{s.open&&s.onClose(),f.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:oe(e.onFocus,()=>{f.current||s.onOpen()}),onBlur:oe(e.onBlur,s.onClose),onClick:oe(e.onClick,s.onClose)})})});df.displayName=Ur;var Ux="TooltipPortal",[F3,Yx]=Vs(Ux,{forceMount:void 0}),In="TooltipContent",ff=m.forwardRef((e,t)=>{const n=Yx(In,e.__scopeTooltip),{forceMount:i=n.forceMount,side:s="top",...o}=e,l=$s(In,e.__scopeTooltip);return g.jsx(Ke,{present:i||l.open,children:l.disableHoverableContent?g.jsx(hf,{side:s,...o,ref:t}):g.jsx(Zx,{side:s,...o,ref:t})})}),Zx=m.forwardRef((e,t)=>{const n=$s(In,e.__scopeTooltip),i=Bo(In,e.__scopeTooltip),s=m.useRef(null),o=ye(t,s),[l,a]=m.useState(null),{trigger:r,onClose:f}=n,d=s.current,{onPointerInTransitChange:h}=i,b=m.useCallback(()=>{a(null),h(!1)},[h]),_=m.useCallback((C,S)=>{const c=C.currentTarget,u={x:C.clientX,y:C.clientY},p=Qx(u,c.getBoundingClientRect()),v=Jx(u,p),y=ew(S.getBoundingClientRect()),w=nw([...v,...y]);a(w),h(!0)},[h]);return m.useEffect(()=>()=>b(),[b]),m.useEffect(()=>{if(r&&d){const C=c=>_(c,d),S=c=>_(c,r);return r.addEventListener("pointerleave",C),d.addEventListener("pointerleave",S),()=>{r.removeEventListener("pointerleave",C),d.removeEventListener("pointerleave",S)}}},[r,d,_,b]),m.useEffect(()=>{if(l){const C=S=>{const c=S.target,u={x:S.clientX,y:S.clientY},p=(r==null?void 0:r.contains(c))||(d==null?void 0:d.contains(c)),v=!tw(u,l);p?b():v&&(b(),f())};return document.addEventListener("pointermove",C),()=>document.removeEventListener("pointermove",C)}},[r,d,l,f,b]),g.jsx(hf,{...e,ref:o})}),[qx,Gx]=Vs(hi,{isInside:!1}),Kx=Ix("TooltipContent"),hf=m.forwardRef((e,t)=>{const{__scopeTooltip:n,children:i,"aria-label":s,onEscapeKeyDown:o,onPointerDownOutside:l,...a}=e,r=$s(In,n),f=Ws(n),{onClose:d}=r;return m.useEffect(()=>(document.addEventListener($r,d),()=>document.removeEventListener($r,d)),[d]),m.useEffect(()=>{if(r.trigger){const h=b=>{const _=b.target;_!=null&&_.contains(r.trigger)&&d()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[r.trigger,d]),g.jsx(Vn,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:h=>h.preventDefault(),onDismiss:d,children:g.jsxs(ks,{"data-state":r.stateAttribute,...f,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[g.jsx(Kx,{children:i}),g.jsx(qx,{scope:n,isInside:!0,children:g.jsx(ob,{id:r.contentId,role:"tooltip",children:s||i})})]})})});ff.displayName=In;var pf="TooltipArrow",Xx=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...i}=e,s=Ws(n);return Gx(pf,n).isInside?null:g.jsx(Ts,{...s,...i,ref:t})});Xx.displayName=pf;function Qx(e,t){const n=Math.abs(t.top-e.y),i=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,i,s,o)){case o:return"left";case s:return"right";case n:return"top";case i:return"bottom";default:throw new Error("unreachable")}}function Jx(e,t,n=5){const i=[];switch(t){case"top":i.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":i.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":i.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":i.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return i}function ew(e){const{top:t,right:n,bottom:i,left:s}=e;return[{x:s,y:t},{x:n,y:t},{x:n,y:i},{x:s,y:i}]}function tw(e,t){const{x:n,y:i}=e;let s=!1;for(let o=0,l=t.length-1;o<t.length;l=o++){const a=t[o],r=t[l],f=a.x,d=a.y,h=r.x,b=r.y;d>i!=b>i&&n<(h-f)*(i-d)/(b-d)+f&&(s=!s)}return s}function nw(e){const t=e.slice();return t.sort((n,i)=>n.x<i.x?-1:n.x>i.x?1:n.y<i.y?-1:n.y>i.y?1:0),iw(t)}function iw(e){if(e.length<=1)return e.slice();const t=[];for(let i=0;i<e.length;i++){const s=e[i];for(;t.length>=2;){const o=t[t.length-1],l=t[t.length-2];if((o.x-l.x)*(s.y-l.y)>=(o.y-l.y)*(s.x-l.x))t.pop();else break}t.push(s)}t.pop();const n=[];for(let i=e.length-1;i>=0;i--){const s=e[i];for(;n.length>=2;){const o=n[n.length-1],l=n[n.length-2];if((o.x-l.x)*(s.y-l.y)>=(o.y-l.y)*(s.x-l.x))n.pop();else break}n.push(s)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var sw=cf,rw=uf,ow=df,mf=ff;const lw=sw,aw=rw,cw=ow,gf=m.forwardRef(({className:e,sideOffset:t=4,...n},i)=>g.jsx(mf,{ref:i,sideOffset:t,className:ne("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));gf.displayName=mf.displayName;function uw(e,t=[]){let n=[];function i(o,l){const a=m.createContext(l),r=n.length;n=[...n,l];const f=h=>{var u;const{scope:b,children:_,...C}=h,S=((u=b==null?void 0:b[e])==null?void 0:u[r])||a,c=m.useMemo(()=>C,Object.values(C));return g.jsx(S.Provider,{value:c,children:_})};f.displayName=o+"Provider";function d(h,b){var S;const _=((S=b==null?void 0:b[e])==null?void 0:S[r])||a,C=m.useContext(_);if(C)return C;if(l!==void 0)return l;throw new Error(`\`${h}\` must be used within \`${o}\``)}return[f,d]}const s=()=>{const o=n.map(l=>m.createContext(l));return function(a){const r=(a==null?void 0:a[e])||o;return m.useMemo(()=>({[`__scope${e}`]:{...a,[e]:r}}),[a,r])}};return s.scopeName=e,[i,dw(s,...t)]}function dw(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const i=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const l=i.reduce((a,{useScope:r,scopeName:f})=>{const h=r(o)[`__scope${f}`];return{...a,...h}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}function vf(e){const t=fw(e),n=m.forwardRef((i,s)=>{const{children:o,...l}=i,a=m.Children.toArray(o),r=a.find(pw);if(r){const f=r.props.children,d=a.map(h=>h===r?m.Children.count(f)>1?m.Children.only(null):m.isValidElement(f)?f.props.children:null:h);return g.jsx(t,{...l,ref:s,children:m.isValidElement(f)?m.cloneElement(f,void 0,d):null})}return g.jsx(t,{...l,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}function fw(e){const t=m.forwardRef((n,i)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const l=gw(s),a=mw(o,s.props);return s.type!==m.Fragment&&(a.ref=i?je(i,l):l),m.cloneElement(s,a)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var hw=Symbol("radix.slottable");function pw(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===hw}function mw(e,t){const n={...t};for(const i in t){const s=e[i],o=t[i];/^on[A-Z]/.test(i)?s&&o?n[i]=(...a)=>{const r=o(...a);return s(...a),r}:s&&(n[i]=s):i==="style"?n[i]={...s,...o}:i==="className"&&(n[i]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function gw(e){var i,s;let t=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var vw=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],bf=vw.reduce((e,t)=>{const n=vf(`Primitive.${t}`),i=m.forwardRef((s,o)=>{const{asChild:l,...a}=s,r=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(r,{...a,ref:o})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{}),Us="Popover",[yf]=uw(Us,[en]),Oi=en(),[bw,sn]=yf(Us),xf=e=>{const{__scopePopover:t,children:n,open:i,defaultOpen:s,onOpenChange:o,modal:l=!1}=e,a=Oi(t),r=m.useRef(null),[f,d]=m.useState(!1),[h,b]=wt({prop:i,defaultProp:s??!1,onChange:o,caller:Us});return g.jsx(Ti,{...a,children:g.jsx(bw,{scope:t,contentId:it(),triggerRef:r,open:h,onOpenChange:b,onOpenToggle:m.useCallback(()=>b(_=>!_),[b]),hasCustomAnchor:f,onCustomAnchorAdd:m.useCallback(()=>d(!0),[]),onCustomAnchorRemove:m.useCallback(()=>d(!1),[]),modal:l,children:n})})};xf.displayName=Us;var wf="PopoverAnchor",yw=m.forwardRef((e,t)=>{const{__scopePopover:n,...i}=e,s=sn(wf,n),o=Oi(n),{onCustomAnchorAdd:l,onCustomAnchorRemove:a}=s;return m.useEffect(()=>(l(),()=>a()),[l,a]),g.jsx(Mi,{...o,...i,ref:t})});yw.displayName=wf;var _f="PopoverTrigger",Cf=m.forwardRef((e,t)=>{const{__scopePopover:n,...i}=e,s=sn(_f,n),o=Oi(n),l=ye(t,s.triggerRef),a=g.jsx(bf.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Tf(s.open),...i,ref:l,onClick:oe(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?a:g.jsx(Mi,{asChild:!0,...o,children:a})});Cf.displayName=_f;var Fo="PopoverPortal",[xw,ww]=yf(Fo,{forceMount:void 0}),Sf=e=>{const{__scopePopover:t,forceMount:n,children:i,container:s}=e,o=sn(Fo,t);return g.jsx(xw,{scope:t,forceMount:n,children:g.jsx(Ke,{present:n||o.open,children:g.jsx(Ai,{asChild:!0,container:s,children:i})})})};Sf.displayName=Fo;var Bn="PopoverContent",Ef=m.forwardRef((e,t)=>{const n=ww(Bn,e.__scopePopover),{forceMount:i=n.forceMount,...s}=e,o=sn(Bn,e.__scopePopover);return g.jsx(Ke,{present:i||o.open,children:o.modal?g.jsx(Cw,{...s,ref:t}):g.jsx(Sw,{...s,ref:t})})});Ef.displayName=Bn;var _w=vf("PopoverContent.RemoveScroll"),Cw=m.forwardRef((e,t)=>{const n=sn(Bn,e.__scopePopover),i=m.useRef(null),s=ye(t,i),o=m.useRef(!1);return m.useEffect(()=>{const l=i.current;if(l)return Ms(l)},[]),g.jsx(Ri,{as:_w,allowPinchZoom:!0,children:g.jsx(Nf,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:oe(e.onCloseAutoFocus,l=>{var a;l.preventDefault(),o.current||(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:oe(e.onPointerDownOutside,l=>{const a=l.detail.originalEvent,r=a.button===0&&a.ctrlKey===!0,f=a.button===2||r;o.current=f},{checkForDefaultPrevented:!1}),onFocusOutside:oe(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1})})})}),Sw=m.forwardRef((e,t)=>{const n=sn(Bn,e.__scopePopover),i=m.useRef(!1),s=m.useRef(!1);return g.jsx(Nf,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var l,a;(l=e.onCloseAutoFocus)==null||l.call(e,o),o.defaultPrevented||(i.current||(a=n.triggerRef.current)==null||a.focus(),o.preventDefault()),i.current=!1,s.current=!1},onInteractOutside:o=>{var r,f;(r=e.onInteractOutside)==null||r.call(e,o),o.defaultPrevented||(i.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const l=o.target;((f=n.triggerRef.current)==null?void 0:f.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),Nf=m.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:o,disableOutsidePointerEvents:l,onEscapeKeyDown:a,onPointerDownOutside:r,onFocusOutside:f,onInteractOutside:d,...h}=e,b=sn(Bn,n),_=Oi(n);return _s(),g.jsx(Ni,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:s,onUnmountAutoFocus:o,children:g.jsx(Vn,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:d,onEscapeKeyDown:a,onPointerDownOutside:r,onFocusOutside:f,onDismiss:()=>b.onOpenChange(!1),children:g.jsx(ks,{"data-state":Tf(b.open),role:"dialog",id:b.contentId,..._,...h,ref:t,style:{...h.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),kf="PopoverClose",Ew=m.forwardRef((e,t)=>{const{__scopePopover:n,...i}=e,s=sn(kf,n);return g.jsx(bf.button,{type:"button",...i,ref:t,onClick:oe(e.onClick,()=>s.onOpenChange(!1))})});Ew.displayName=kf;var Nw="PopoverArrow",kw=m.forwardRef((e,t)=>{const{__scopePopover:n,...i}=e,s=Oi(n);return g.jsx(Ts,{...s,...i,ref:t})});kw.displayName=Nw;function Tf(e){return e?"open":"closed"}var Tw=xf,Mw=Cf,Aw=Sf,Mf=Ef;const jo=Tw,zo=Mw,Ys=m.forwardRef(({className:e,align:t="center",sideOffset:n=4,...i},s)=>g.jsx(Aw,{children:g.jsx(Mf,{ref:s,align:t,sideOffset:n,className:ne("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...i})}));Ys.displayName=Mf.displayName;function Rw(e,t,n="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:e,timeZoneName:n}).format(t).split(/\s/g).slice(2).join(" ")}const wr={},ri={};function an(e,t){try{const i=(wr[e]||(wr[e]=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format))(t).split("GMT")[1];return i in ri?ri[i]:_a(i,i.split(":"))}catch{if(e in ri)return ri[e];const n=e==null?void 0:e.match(Dw);return n?_a(e,n.slice(1)):NaN}}const Dw=/([+-]\d\d):?(\d\d)?/;function _a(e,t){const n=+(t[0]||0),i=+(t[1]||0),s=+(t[2]||0)/60;return ri[e]=n*60+i>0?n*60+i+s:n*60-i-s}class Mt extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(an(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),Af(this),Yr(this)):this.setTime(Date.now())}static tz(t,...n){return n.length?new Mt(...n,t):new Mt(Date.now(),t)}withTimeZone(t){return new Mt(+this,t)}getTimezoneOffset(){const t=-an(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),Yr(this),+this}[Symbol.for("constructDateFrom")](t){return new Mt(+new Date(t),this.timeZone)}}const Ca=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!Ca.test(e))return;const t=e.replace(Ca,"$1UTC");Mt.prototype[t]&&(e.startsWith("get")?Mt.prototype[e]=function(){return this.internal[t]()}:(Mt.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),Lw(this),+this},Mt.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),Yr(this),+this}))});function Yr(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-an(e.timeZone,e)*60))}function Lw(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),Af(e)}function Af(e){const t=an(e.timeZone,e),n=t>0?Math.floor(t):Math.ceil(t),i=new Date(+e);i.setUTCHours(i.getUTCHours()-1);const s=-new Date(+e).getTimezoneOffset(),o=-new Date(+i).getTimezoneOffset(),l=s-o,a=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();l&&a&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+l);const r=s-n;r&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+r);const f=new Date(+e);f.setUTCSeconds(0);const d=s>0?f.getSeconds():(f.getSeconds()-60)%60,h=Math.round(-(an(e.timeZone,e)*60))%60;(h||d)&&(e.internal.setUTCSeconds(e.internal.getUTCSeconds()+h),Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+h+d));const b=an(e.timeZone,e),_=b>0?Math.floor(b):Math.ceil(b),S=-new Date(+e).getTimezoneOffset()-_,c=_!==n,u=S-r;if(c&&u){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+u);const p=an(e.timeZone,e),v=p>0?Math.floor(p):Math.ceil(p),y=_-v;y&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+y),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+y))}}class Qe extends Mt{static tz(t,...n){return n.length?new Qe(...n,t):new Qe(Date.now(),t)}toISOString(){const[t,n,i]=this.tzComponents(),s=`${t}${n}:${i}`;return this.internal.toISOString().slice(0,-1)+s}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,n,i,s]=this.internal.toUTCString().split(" ");return`${t==null?void 0:t.slice(0,-1)} ${i} ${n} ${s}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[n,i,s]=this.tzComponents();return`${t} GMT${n}${i}${s} (${Rw(this.timeZone,this)})`}toLocaleString(t,n){return Date.prototype.toLocaleString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}toLocaleDateString(t,n){return Date.prototype.toLocaleDateString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}toLocaleTimeString(t,n){return Date.prototype.toLocaleTimeString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}tzComponents(){const t=this.getTimezoneOffset(),n=t>0?"-":"+",i=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),s=String(Math.abs(t)%60).padStart(2,"0");return[n,i,s]}withTimeZone(t){return new Qe(+this,t)}[Symbol.for("constructDateFrom")](t){return new Qe(+new Date(t),this.timeZone)}}const Rf=6048e5,Ow=864e5,Sa=Symbol.for("constructDateFrom");function Ue(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Sa in e?e[Sa](t):e instanceof Date?new e.constructor(t):new Date(t)}function Le(e,t){return Ue(t||e,e)}function Df(e,t,n){const i=Le(e,n==null?void 0:n.in);return isNaN(t)?Ue(e,NaN):(t&&i.setDate(i.getDate()+t),i)}function Lf(e,t,n){const i=Le(e,n==null?void 0:n.in);if(isNaN(t))return Ue(e,NaN);if(!t)return i;const s=i.getDate(),o=Ue(e,i.getTime());o.setMonth(i.getMonth()+t+1,0);const l=o.getDate();return s>=l?o:(i.setFullYear(o.getFullYear(),o.getMonth(),s),i)}let Pw={};function Pi(){return Pw}function Fn(e,t){var a,r,f,d;const n=Pi(),i=(t==null?void 0:t.weekStartsOn)??((r=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:r.weekStartsOn)??n.weekStartsOn??((d=(f=n.locale)==null?void 0:f.options)==null?void 0:d.weekStartsOn)??0,s=Le(e,t==null?void 0:t.in),o=s.getDay(),l=(o<i?7:0)+o-i;return s.setDate(s.getDate()-l),s.setHours(0,0,0,0),s}function pi(e,t){return Fn(e,{...t,weekStartsOn:1})}function Of(e,t){const n=Le(e,t==null?void 0:t.in),i=n.getFullYear(),s=Ue(n,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const o=pi(s),l=Ue(n,0);l.setFullYear(i,0,4),l.setHours(0,0,0,0);const a=pi(l);return n.getTime()>=o.getTime()?i+1:n.getTime()>=a.getTime()?i:i-1}function Ea(e){const t=Le(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function qn(e,...t){const n=Ue.bind(null,t.find(i=>typeof i=="object"));return t.map(n)}function mi(e,t){const n=Le(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function Ho(e,t,n){const[i,s]=qn(n==null?void 0:n.in,e,t),o=mi(i),l=mi(s),a=+o-Ea(o),r=+l-Ea(l);return Math.round((a-r)/Ow)}function Iw(e,t){const n=Of(e,t),i=Ue(e,0);return i.setFullYear(n,0,4),i.setHours(0,0,0,0),pi(i)}function Bw(e,t,n){return Df(e,t*7,n)}function Fw(e,t,n){return Lf(e,t*12,n)}function jw(e,t){let n,i=t==null?void 0:t.in;return e.forEach(s=>{!i&&typeof s=="object"&&(i=Ue.bind(null,s));const o=Le(s,i);(!n||n<o||isNaN(+o))&&(n=o)}),Ue(i,n||NaN)}function zw(e,t){let n,i=t==null?void 0:t.in;return e.forEach(s=>{!i&&typeof s=="object"&&(i=Ue.bind(null,s));const o=Le(s,i);(!n||n>o||isNaN(+o))&&(n=o)}),Ue(i,n||NaN)}function Hw(e,t,n){const[i,s]=qn(n==null?void 0:n.in,e,t);return+mi(i)==+mi(s)}function Pf(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Vw(e){return!(!Pf(e)&&typeof e!="number"||isNaN(+Le(e)))}function If(e,t,n){const[i,s]=qn(n==null?void 0:n.in,e,t),o=i.getFullYear()-s.getFullYear(),l=i.getMonth()-s.getMonth();return o*12+l}function Ww(e,t){const n=Le(e,t==null?void 0:t.in),i=n.getMonth();return n.setFullYear(n.getFullYear(),i+1,0),n.setHours(23,59,59,999),n}function Bf(e,t){const[n,i]=qn(e,t.start,t.end);return{start:n,end:i}}function $w(e,t){const{start:n,end:i}=Bf(t==null?void 0:t.in,e);let s=+n>+i;const o=s?+n:+i,l=s?i:n;l.setHours(0,0,0,0),l.setDate(1);let a=1;const r=[];for(;+l<=o;)r.push(Ue(n,l)),l.setMonth(l.getMonth()+a);return s?r.reverse():r}function Uw(e,t){const n=Le(e,t==null?void 0:t.in);return n.setDate(1),n.setHours(0,0,0,0),n}function Yw(e,t){const n=Le(e,t==null?void 0:t.in),i=n.getFullYear();return n.setFullYear(i+1,0,0),n.setHours(23,59,59,999),n}function Ff(e,t){const n=Le(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function Zw(e,t){const{start:n,end:i}=Bf(t==null?void 0:t.in,e);let s=+n>+i;const o=s?+n:+i,l=s?i:n;l.setHours(0,0,0,0),l.setMonth(0,1);let a=1;const r=[];for(;+l<=o;)r.push(Ue(n,l)),l.setFullYear(l.getFullYear()+a);return s?r.reverse():r}function jf(e,t){var a,r,f,d;const n=Pi(),i=(t==null?void 0:t.weekStartsOn)??((r=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:r.weekStartsOn)??n.weekStartsOn??((d=(f=n.locale)==null?void 0:f.options)==null?void 0:d.weekStartsOn)??0,s=Le(e,t==null?void 0:t.in),o=s.getDay(),l=(o<i?-7:0)+6-(o-i);return s.setDate(s.getDate()+l),s.setHours(23,59,59,999),s}function qw(e,t){return jf(e,{...t,weekStartsOn:1})}const Gw={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Kw=(e,t,n)=>{let i;const s=Gw[e];return typeof s=="string"?i=s:t===1?i=s.one:i=s.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i};function _r(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const Xw={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Qw={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Jw={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},e_={date:_r({formats:Xw,defaultWidth:"full"}),time:_r({formats:Qw,defaultWidth:"full"}),dateTime:_r({formats:Jw,defaultWidth:"full"})},t_={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},n_=(e,t,n,i)=>t_[e];function ei(e){return(t,n)=>{const i=n!=null&&n.context?String(n.context):"standalone";let s;if(i==="formatting"&&e.formattingValues){const l=e.defaultFormattingWidth||e.defaultWidth,a=n!=null&&n.width?String(n.width):l;s=e.formattingValues[a]||e.formattingValues[l]}else{const l=e.defaultWidth,a=n!=null&&n.width?String(n.width):e.defaultWidth;s=e.values[a]||e.values[l]}const o=e.argumentCallback?e.argumentCallback(t):t;return s[o]}}const i_={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},s_={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},r_={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},o_={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},l_={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},a_={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},c_=(e,t)=>{const n=Number(e),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},u_={ordinalNumber:c_,era:ei({values:i_,defaultWidth:"wide"}),quarter:ei({values:s_,defaultWidth:"wide",argumentCallback:e=>e-1}),month:ei({values:r_,defaultWidth:"wide"}),day:ei({values:o_,defaultWidth:"wide"}),dayPeriod:ei({values:l_,defaultWidth:"wide",formattingValues:a_,defaultFormattingWidth:"wide"})};function ti(e){return(t,n={})=>{const i=n.width,s=i&&e.matchPatterns[i]||e.matchPatterns[e.defaultMatchWidth],o=t.match(s);if(!o)return null;const l=o[0],a=i&&e.parsePatterns[i]||e.parsePatterns[e.defaultParseWidth],r=Array.isArray(a)?f_(a,h=>h.test(l)):d_(a,h=>h.test(l));let f;f=e.valueCallback?e.valueCallback(r):r,f=n.valueCallback?n.valueCallback(f):f;const d=t.slice(l.length);return{value:f,rest:d}}}function d_(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function f_(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function h_(e){return(t,n={})=>{const i=t.match(e.matchPattern);if(!i)return null;const s=i[0],o=t.match(e.parsePattern);if(!o)return null;let l=e.valueCallback?e.valueCallback(o[0]):o[0];l=n.valueCallback?n.valueCallback(l):l;const a=t.slice(s.length);return{value:l,rest:a}}}const p_=/^(\d+)(th|st|nd|rd)?/i,m_=/\d+/i,g_={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},v_={any:[/^b/i,/^(a|c)/i]},b_={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},y_={any:[/1/i,/2/i,/3/i,/4/i]},x_={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},w_={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},__={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},C_={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},S_={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},E_={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},N_={ordinalNumber:h_({matchPattern:p_,parsePattern:m_,valueCallback:e=>parseInt(e,10)}),era:ti({matchPatterns:g_,defaultMatchWidth:"wide",parsePatterns:v_,defaultParseWidth:"any"}),quarter:ti({matchPatterns:b_,defaultMatchWidth:"wide",parsePatterns:y_,defaultParseWidth:"any",valueCallback:e=>e+1}),month:ti({matchPatterns:x_,defaultMatchWidth:"wide",parsePatterns:w_,defaultParseWidth:"any"}),day:ti({matchPatterns:__,defaultMatchWidth:"wide",parsePatterns:C_,defaultParseWidth:"any"}),dayPeriod:ti({matchPatterns:S_,defaultMatchWidth:"any",parsePatterns:E_,defaultParseWidth:"any"})},Cn={code:"en-US",formatDistance:Kw,formatLong:e_,formatRelative:n_,localize:u_,match:N_,options:{weekStartsOn:0,firstWeekContainsDate:1}};function k_(e,t){const n=Le(e,t==null?void 0:t.in);return Ho(n,Ff(n))+1}function Vo(e,t){const n=Le(e,t==null?void 0:t.in),i=+pi(n)-+Iw(n);return Math.round(i/Rf)+1}function zf(e,t){var d,h,b,_;const n=Le(e,t==null?void 0:t.in),i=n.getFullYear(),s=Pi(),o=(t==null?void 0:t.firstWeekContainsDate)??((h=(d=t==null?void 0:t.locale)==null?void 0:d.options)==null?void 0:h.firstWeekContainsDate)??s.firstWeekContainsDate??((_=(b=s.locale)==null?void 0:b.options)==null?void 0:_.firstWeekContainsDate)??1,l=Ue((t==null?void 0:t.in)||e,0);l.setFullYear(i+1,0,o),l.setHours(0,0,0,0);const a=Fn(l,t),r=Ue((t==null?void 0:t.in)||e,0);r.setFullYear(i,0,o),r.setHours(0,0,0,0);const f=Fn(r,t);return+n>=+a?i+1:+n>=+f?i:i-1}function T_(e,t){var a,r,f,d;const n=Pi(),i=(t==null?void 0:t.firstWeekContainsDate)??((r=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:r.firstWeekContainsDate)??n.firstWeekContainsDate??((d=(f=n.locale)==null?void 0:f.options)==null?void 0:d.firstWeekContainsDate)??1,s=zf(e,t),o=Ue((t==null?void 0:t.in)||e,0);return o.setFullYear(s,0,i),o.setHours(0,0,0,0),Fn(o,t)}function Wo(e,t){const n=Le(e,t==null?void 0:t.in),i=+Fn(n,t)-+T_(n,t);return Math.round(i/Rf)+1}function De(e,t){const n=e<0?"-":"",i=Math.abs(e).toString().padStart(t,"0");return n+i}const Zt={y(e,t){const n=e.getFullYear(),i=n>0?n:1-n;return De(t==="yy"?i%100:i,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):De(n+1,2)},d(e,t){return De(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return De(e.getHours()%12||12,t.length)},H(e,t){return De(e.getHours(),t.length)},m(e,t){return De(e.getMinutes(),t.length)},s(e,t){return De(e.getSeconds(),t.length)},S(e,t){const n=t.length,i=e.getMilliseconds(),s=Math.trunc(i*Math.pow(10,n-3));return De(s,t.length)}},xn={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Na={G:function(e,t,n){const i=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});case"GGGG":default:return n.era(i,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const i=e.getFullYear(),s=i>0?i:1-i;return n.ordinalNumber(s,{unit:"year"})}return Zt.y(e,t)},Y:function(e,t,n,i){const s=zf(e,i),o=s>0?s:1-s;if(t==="YY"){const l=o%100;return De(l,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):De(o,t.length)},R:function(e,t){const n=Of(e);return De(n,t.length)},u:function(e,t){const n=e.getFullYear();return De(n,t.length)},Q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return De(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return De(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(e,t,n){const i=e.getMonth();switch(t){case"M":case"MM":return Zt.M(e,t);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(e,t,n){const i=e.getMonth();switch(t){case"L":return String(i+1);case"LL":return De(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(e,t,n,i){const s=Wo(e,i);return t==="wo"?n.ordinalNumber(s,{unit:"week"}):De(s,t.length)},I:function(e,t,n){const i=Vo(e);return t==="Io"?n.ordinalNumber(i,{unit:"week"}):De(i,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Zt.d(e,t)},D:function(e,t,n){const i=k_(e);return t==="Do"?n.ordinalNumber(i,{unit:"dayOfYear"}):De(i,t.length)},E:function(e,t,n){const i=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});case"EEEE":default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(e,t,n,i){const s=e.getDay(),o=(s-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return De(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(s,{width:"short",context:"formatting"});case"eeee":default:return n.day(s,{width:"wide",context:"formatting"})}},c:function(e,t,n,i){const s=e.getDay(),o=(s-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return De(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(s,{width:"narrow",context:"standalone"});case"cccccc":return n.day(s,{width:"short",context:"standalone"});case"cccc":default:return n.day(s,{width:"wide",context:"standalone"})}},i:function(e,t,n){const i=e.getDay(),s=i===0?7:i;switch(t){case"i":return String(s);case"ii":return De(s,t.length);case"io":return n.ordinalNumber(s,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});case"iiii":default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(e,t,n){const s=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(e,t,n){const i=e.getHours();let s;switch(i===12?s=xn.noon:i===0?s=xn.midnight:s=i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(e,t,n){const i=e.getHours();let s;switch(i>=17?s=xn.evening:i>=12?s=xn.afternoon:i>=4?s=xn.morning:s=xn.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let i=e.getHours()%12;return i===0&&(i=12),n.ordinalNumber(i,{unit:"hour"})}return Zt.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Zt.H(e,t)},K:function(e,t,n){const i=e.getHours()%12;return t==="Ko"?n.ordinalNumber(i,{unit:"hour"}):De(i,t.length)},k:function(e,t,n){let i=e.getHours();return i===0&&(i=24),t==="ko"?n.ordinalNumber(i,{unit:"hour"}):De(i,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Zt.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Zt.s(e,t)},S:function(e,t){return Zt.S(e,t)},X:function(e,t,n){const i=e.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Ta(i);case"XXXX":case"XX":return on(i);case"XXXXX":case"XXX":default:return on(i,":")}},x:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"x":return Ta(i);case"xxxx":case"xx":return on(i);case"xxxxx":case"xxx":default:return on(i,":")}},O:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+ka(i,":");case"OOOO":default:return"GMT"+on(i,":")}},z:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+ka(i,":");case"zzzz":default:return"GMT"+on(i,":")}},t:function(e,t,n){const i=Math.trunc(+e/1e3);return De(i,t.length)},T:function(e,t,n){return De(+e,t.length)}};function ka(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),s=Math.trunc(i/60),o=i%60;return o===0?n+String(s):n+String(s)+t+De(o,2)}function Ta(e,t){return e%60===0?(e>0?"-":"+")+De(Math.abs(e)/60,2):on(e,t)}function on(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),s=De(Math.trunc(i/60),2),o=De(i%60,2);return n+s+t+o}const Ma=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Hf=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},M_=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],i=n[1],s=n[2];if(!s)return Ma(e,t);let o;switch(i){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",Ma(i,t)).replace("{{time}}",Hf(s,t))},A_={p:Hf,P:M_},R_=/^D+$/,D_=/^Y+$/,L_=["D","DD","YY","YYYY"];function O_(e){return R_.test(e)}function P_(e){return D_.test(e)}function I_(e,t,n){const i=B_(e,t,n);if(console.warn(i),L_.includes(e))throw new RangeError(i)}function B_(e,t,n){const i=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${i} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const F_=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,j_=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,z_=/^'([^]*?)'?$/,H_=/''/g,V_=/[a-zA-Z]/;function jt(e,t,n){var d,h,b,_,C,S,c,u;const i=Pi(),s=(n==null?void 0:n.locale)??i.locale??Cn,o=(n==null?void 0:n.firstWeekContainsDate)??((h=(d=n==null?void 0:n.locale)==null?void 0:d.options)==null?void 0:h.firstWeekContainsDate)??i.firstWeekContainsDate??((_=(b=i.locale)==null?void 0:b.options)==null?void 0:_.firstWeekContainsDate)??1,l=(n==null?void 0:n.weekStartsOn)??((S=(C=n==null?void 0:n.locale)==null?void 0:C.options)==null?void 0:S.weekStartsOn)??i.weekStartsOn??((u=(c=i.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,a=Le(e,n==null?void 0:n.in);if(!Vw(a))throw new RangeError("Invalid time value");let r=t.match(j_).map(p=>{const v=p[0];if(v==="p"||v==="P"){const y=A_[v];return y(p,s.formatLong)}return p}).join("").match(F_).map(p=>{if(p==="''")return{isToken:!1,value:"'"};const v=p[0];if(v==="'")return{isToken:!1,value:W_(p)};if(Na[v])return{isToken:!0,value:p};if(v.match(V_))throw new RangeError("Format string contains an unescaped latin alphabet character `"+v+"`");return{isToken:!1,value:p}});s.localize.preprocessor&&(r=s.localize.preprocessor(a,r));const f={firstWeekContainsDate:o,weekStartsOn:l,locale:s};return r.map(p=>{if(!p.isToken)return p.value;const v=p.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&P_(v)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&O_(v))&&I_(v,t,String(e));const y=Na[v[0]];return y(a,v,s.localize,f)}).join("")}function W_(e){const t=e.match(z_);return t?t[1].replace(H_,"'"):e}function $_(e,t){const n=Le(e,t==null?void 0:t.in),i=n.getFullYear(),s=n.getMonth(),o=Ue(n,0);return o.setFullYear(i,s+1,0),o.setHours(0,0,0,0),o.getDate()}function U_(e,t){return Le(e,t==null?void 0:t.in).getMonth()}function Y_(e,t){return Le(e,t==null?void 0:t.in).getFullYear()}function Z_(e,t){return+Le(e)>+Le(t)}function q_(e,t){return+Le(e)<+Le(t)}function G_(e,t,n){const[i,s]=qn(n==null?void 0:n.in,e,t);return i.getFullYear()===s.getFullYear()&&i.getMonth()===s.getMonth()}function K_(e,t,n){const[i,s]=qn(n==null?void 0:n.in,e,t);return i.getFullYear()===s.getFullYear()}function X_(e,t,n){const i=Le(e,n==null?void 0:n.in),s=i.getFullYear(),o=i.getDate(),l=Ue(e,0);l.setFullYear(s,t,15),l.setHours(0,0,0,0);const a=$_(l);return i.setMonth(t,Math.min(o,a)),i}function Q_(e,t,n){const i=Le(e,n==null?void 0:n.in);return isNaN(+i)?Ue(e,NaN):(i.setFullYear(t),i)}const Aa=5,J_=4;function e2(e,t){const n=t.startOfMonth(e),i=n.getDay()>0?n.getDay():7,s=t.addDays(e,-i+1),o=t.addDays(s,Aa*7-1);return t.getMonth(e)===t.getMonth(o)?Aa:J_}function Vf(e,t){const n=t.startOfMonth(e),i=n.getDay();return i===1?n:i===0?t.addDays(n,-1*6):t.addDays(n,-1*(i-1))}function t2(e,t){const n=Vf(e,t),i=e2(e,t);return t.addDays(n,i*7-1)}const Wf={...Cn,labels:{labelDayButton:(e,t,n,i)=>{let s;i&&typeof i.format=="function"?s=i.format.bind(i):s=(l,a)=>jt(l,a,{locale:Cn,...n});let o=s(e,"PPPP");return t.today&&(o=`Today, ${o}`),t.selected&&(o=`${o}, selected`),o},labelMonthDropdown:"Choose the Month",labelNext:"Go to the Next Month",labelPrevious:"Go to the Previous Month",labelWeekNumber:e=>`Week ${e}`,labelYearDropdown:"Choose the Year",labelGrid:(e,t,n)=>{let i;return n&&typeof n.format=="function"?i=n.format.bind(n):i=(s,o)=>jt(s,o,{locale:Cn,...t}),i(e,"LLLL yyyy")},labelGridcell:(e,t,n,i)=>{let s;i&&typeof i.format=="function"?s=i.format.bind(i):s=(l,a)=>jt(l,a,{locale:Cn,...n});let o=s(e,"PPPP");return t!=null&&t.today&&(o=`Today, ${o}`),o},labelNav:"Navigation bar",labelWeekNumberHeader:"Week Number",labelWeekday:(e,t,n)=>{let i;return n&&typeof n.format=="function"?i=n.format.bind(n):i=(s,o)=>jt(s,o,{locale:Cn,...t}),i(e,"cccc")}}};class at{constructor(t,n){this.Date=Date,this.today=()=>{var i;return(i=this.overrides)!=null&&i.today?this.overrides.today():this.options.timeZone?Qe.tz(this.options.timeZone):new this.Date},this.newDate=(i,s,o)=>{var l;return(l=this.overrides)!=null&&l.newDate?this.overrides.newDate(i,s,o):this.options.timeZone?new Qe(i,s,o,this.options.timeZone):new Date(i,s,o)},this.addDays=(i,s)=>{var o;return(o=this.overrides)!=null&&o.addDays?this.overrides.addDays(i,s):Df(i,s)},this.addMonths=(i,s)=>{var o;return(o=this.overrides)!=null&&o.addMonths?this.overrides.addMonths(i,s):Lf(i,s)},this.addWeeks=(i,s)=>{var o;return(o=this.overrides)!=null&&o.addWeeks?this.overrides.addWeeks(i,s):Bw(i,s)},this.addYears=(i,s)=>{var o;return(o=this.overrides)!=null&&o.addYears?this.overrides.addYears(i,s):Fw(i,s)},this.differenceInCalendarDays=(i,s)=>{var o;return(o=this.overrides)!=null&&o.differenceInCalendarDays?this.overrides.differenceInCalendarDays(i,s):Ho(i,s)},this.differenceInCalendarMonths=(i,s)=>{var o;return(o=this.overrides)!=null&&o.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(i,s):If(i,s)},this.eachMonthOfInterval=i=>{var s;return(s=this.overrides)!=null&&s.eachMonthOfInterval?this.overrides.eachMonthOfInterval(i):$w(i)},this.eachYearOfInterval=i=>{var a;const s=(a=this.overrides)!=null&&a.eachYearOfInterval?this.overrides.eachYearOfInterval(i):Zw(i),o=new Set(s.map(r=>this.getYear(r)));if(o.size===s.length)return s;const l=[];return o.forEach(r=>{l.push(new Date(r,0,1))}),l},this.endOfBroadcastWeek=i=>{var s;return(s=this.overrides)!=null&&s.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(i):t2(i,this)},this.endOfISOWeek=i=>{var s;return(s=this.overrides)!=null&&s.endOfISOWeek?this.overrides.endOfISOWeek(i):qw(i)},this.endOfMonth=i=>{var s;return(s=this.overrides)!=null&&s.endOfMonth?this.overrides.endOfMonth(i):Ww(i)},this.endOfWeek=(i,s)=>{var o;return(o=this.overrides)!=null&&o.endOfWeek?this.overrides.endOfWeek(i,s):jf(i,this.options)},this.endOfYear=i=>{var s;return(s=this.overrides)!=null&&s.endOfYear?this.overrides.endOfYear(i):Yw(i)},this.format=(i,s,o)=>{var a;const l=(a=this.overrides)!=null&&a.format?this.overrides.format(i,s,this.options):jt(i,s,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(l):l},this.getISOWeek=i=>{var s;return(s=this.overrides)!=null&&s.getISOWeek?this.overrides.getISOWeek(i):Vo(i)},this.getMonth=(i,s)=>{var o;return(o=this.overrides)!=null&&o.getMonth?this.overrides.getMonth(i,this.options):U_(i,this.options)},this.getYear=(i,s)=>{var o;return(o=this.overrides)!=null&&o.getYear?this.overrides.getYear(i,this.options):Y_(i,this.options)},this.getWeek=(i,s)=>{var o;return(o=this.overrides)!=null&&o.getWeek?this.overrides.getWeek(i,this.options):Wo(i,this.options)},this.isAfter=(i,s)=>{var o;return(o=this.overrides)!=null&&o.isAfter?this.overrides.isAfter(i,s):Z_(i,s)},this.isBefore=(i,s)=>{var o;return(o=this.overrides)!=null&&o.isBefore?this.overrides.isBefore(i,s):q_(i,s)},this.isDate=i=>{var s;return(s=this.overrides)!=null&&s.isDate?this.overrides.isDate(i):Pf(i)},this.isSameDay=(i,s)=>{var o;return(o=this.overrides)!=null&&o.isSameDay?this.overrides.isSameDay(i,s):Hw(i,s)},this.isSameMonth=(i,s)=>{var o;return(o=this.overrides)!=null&&o.isSameMonth?this.overrides.isSameMonth(i,s):G_(i,s)},this.isSameYear=(i,s)=>{var o;return(o=this.overrides)!=null&&o.isSameYear?this.overrides.isSameYear(i,s):K_(i,s)},this.max=i=>{var s;return(s=this.overrides)!=null&&s.max?this.overrides.max(i):jw(i)},this.min=i=>{var s;return(s=this.overrides)!=null&&s.min?this.overrides.min(i):zw(i)},this.setMonth=(i,s)=>{var o;return(o=this.overrides)!=null&&o.setMonth?this.overrides.setMonth(i,s):X_(i,s)},this.setYear=(i,s)=>{var o;return(o=this.overrides)!=null&&o.setYear?this.overrides.setYear(i,s):Q_(i,s)},this.startOfBroadcastWeek=(i,s)=>{var o;return(o=this.overrides)!=null&&o.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(i,this):Vf(i,this)},this.startOfDay=i=>{var s;return(s=this.overrides)!=null&&s.startOfDay?this.overrides.startOfDay(i):mi(i)},this.startOfISOWeek=i=>{var s;return(s=this.overrides)!=null&&s.startOfISOWeek?this.overrides.startOfISOWeek(i):pi(i)},this.startOfMonth=i=>{var s;return(s=this.overrides)!=null&&s.startOfMonth?this.overrides.startOfMonth(i):Uw(i)},this.startOfWeek=(i,s)=>{var o;return(o=this.overrides)!=null&&o.startOfWeek?this.overrides.startOfWeek(i,this.options):Fn(i,this.options)},this.startOfYear=i=>{var s;return(s=this.overrides)!=null&&s.startOfYear?this.overrides.startOfYear(i):Ff(i)},this.options={locale:Wf,...t},this.overrides=n}getDigitMap(){const{numerals:t="latn"}=this.options,n=new Intl.NumberFormat("en-US",{numberingSystem:t}),i={};for(let s=0;s<10;s++)i[s.toString()]=n.format(s);return i}replaceDigits(t){const n=this.getDigitMap();return t.replace(/\d/g,i=>n[i]||i)}formatNumber(t){return this.replaceDigits(t.toString())}getMonthYearOrder(){var n;const t=(n=this.options.locale)==null?void 0:n.code;return t&&at.yearFirstLocales.has(t)?"year-first":"month-first"}formatMonthYear(t){const{locale:n,timeZone:i,numerals:s}=this.options,o=n==null?void 0:n.code;if(o&&at.yearFirstLocales.has(o))try{return new Intl.DateTimeFormat(o,{month:"long",year:"numeric",timeZone:i,numberingSystem:s}).format(t)}catch{}const l=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(t,l)}}at.yearFirstLocales=new Set(["eu","hu","ja","ja-Hira","ja-JP","ko","ko-KR","lt","lt-LT","lv","lv-LV","mn","mn-MN","zh","zh-CN","zh-HK","zh-TW"]);const Lt=new at;class $f{constructor(t,n,i=Lt){this.date=t,this.displayMonth=n,this.outside=!!(n&&!i.isSameMonth(t,n)),this.dateLib=i,this.isoDate=i.format(t,"yyyy-MM-dd"),this.displayMonthId=i.format(n,"yyyy-MM"),this.dateMonthId=i.format(t,"yyyy-MM")}isEqualTo(t){return this.dateLib.isSameDay(t.date,this.date)&&this.dateLib.isSameMonth(t.displayMonth,this.displayMonth)}}class n2{constructor(t,n){this.date=t,this.weeks=n}}class i2{constructor(t,n){this.days=n,this.weekNumber=t}}function s2(e){return K.createElement("button",{...e})}function r2(e){return K.createElement("span",{...e})}function o2(e){const{size:t=24,orientation:n="left",className:i}=e;return K.createElement("svg",{className:i,width:t,height:t,viewBox:"0 0 24 24"},n==="up"&&K.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),n==="down"&&K.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),n==="left"&&K.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),n==="right"&&K.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function l2(e){const{day:t,modifiers:n,...i}=e;return K.createElement("td",{...i})}function a2(e){const{day:t,modifiers:n,...i}=e,s=K.useRef(null);return K.useEffect(()=>{var o;n.focused&&((o=s.current)==null||o.focus())},[n.focused]),K.createElement("button",{ref:s,...i})}var de;(function(e){e.Root="root",e.Chevron="chevron",e.Day="day",e.DayButton="day_button",e.CaptionLabel="caption_label",e.Dropdowns="dropdowns",e.Dropdown="dropdown",e.DropdownRoot="dropdown_root",e.Footer="footer",e.MonthGrid="month_grid",e.MonthCaption="month_caption",e.MonthsDropdown="months_dropdown",e.Month="month",e.Months="months",e.Nav="nav",e.NextMonthButton="button_next",e.PreviousMonthButton="button_previous",e.Week="week",e.Weeks="weeks",e.Weekday="weekday",e.Weekdays="weekdays",e.WeekNumber="week_number",e.WeekNumberHeader="week_number_header",e.YearsDropdown="years_dropdown"})(de||(de={}));var Be;(function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"})(Be||(Be={}));var xt;(function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"})(xt||(xt={}));var st;(function(e){e.weeks_before_enter="weeks_before_enter",e.weeks_before_exit="weeks_before_exit",e.weeks_after_enter="weeks_after_enter",e.weeks_after_exit="weeks_after_exit",e.caption_after_enter="caption_after_enter",e.caption_after_exit="caption_after_exit",e.caption_before_enter="caption_before_enter",e.caption_before_exit="caption_before_exit"})(st||(st={}));function c2(e){const{options:t,className:n,components:i,classNames:s,...o}=e,l=[s[de.Dropdown],n].join(" "),a=t==null?void 0:t.find(({value:r})=>r===o.value);return K.createElement("span",{"data-disabled":o.disabled,className:s[de.DropdownRoot]},K.createElement(i.Select,{className:l,...o},t==null?void 0:t.map(({value:r,label:f,disabled:d})=>K.createElement(i.Option,{key:r,value:r,disabled:d},f))),K.createElement("span",{className:s[de.CaptionLabel],"aria-hidden":!0},a==null?void 0:a.label,K.createElement(i.Chevron,{orientation:"down",size:18,className:s[de.Chevron]})))}function u2(e){return K.createElement("div",{...e})}function d2(e){return K.createElement("div",{...e})}function f2(e){const{calendarMonth:t,displayIndex:n,...i}=e;return K.createElement("div",{...i},e.children)}function h2(e){const{calendarMonth:t,displayIndex:n,...i}=e;return K.createElement("div",{...i})}function p2(e){return K.createElement("table",{...e})}function m2(e){return K.createElement("div",{...e})}const Uf=K.createContext(void 0);function Ii(){const e=K.useContext(Uf);if(e===void 0)throw new Error("useDayPicker() must be used within a custom component.");return e}function g2(e){const{components:t}=Ii();return K.createElement(t.Dropdown,{...e})}function v2(e){const{onPreviousClick:t,onNextClick:n,previousMonth:i,nextMonth:s,...o}=e,{components:l,classNames:a,labels:{labelPrevious:r,labelNext:f}}=Ii(),d=K.useCallback(b=>{s&&(n==null||n(b))},[s,n]),h=K.useCallback(b=>{i&&(t==null||t(b))},[i,t]);return K.createElement("nav",{...o},K.createElement(l.PreviousMonthButton,{type:"button",className:a[de.PreviousMonthButton],tabIndex:i?void 0:-1,"aria-disabled":i?void 0:!0,"aria-label":r(i),onClick:h},K.createElement(l.Chevron,{disabled:i?void 0:!0,className:a[de.Chevron],orientation:"left"})),K.createElement(l.NextMonthButton,{type:"button",className:a[de.NextMonthButton],tabIndex:s?void 0:-1,"aria-disabled":s?void 0:!0,"aria-label":f(s),onClick:d},K.createElement(l.Chevron,{disabled:s?void 0:!0,orientation:"right",className:a[de.Chevron]})))}function b2(e){const{components:t}=Ii();return K.createElement(t.Button,{...e})}function y2(e){return K.createElement("option",{...e})}function x2(e){const{components:t}=Ii();return K.createElement(t.Button,{...e})}function w2(e){const{rootRef:t,...n}=e;return K.createElement("div",{...n,ref:t})}function _2(e){return K.createElement("select",{...e})}function C2(e){const{week:t,...n}=e;return K.createElement("tr",{...n})}function S2(e){return K.createElement("th",{...e})}function E2(e){return K.createElement("thead",{"aria-hidden":!0},K.createElement("tr",{...e}))}function N2(e){const{week:t,...n}=e;return K.createElement("th",{...n})}function k2(e){return K.createElement("th",{...e})}function T2(e){return K.createElement("tbody",{...e})}function M2(e){const{components:t}=Ii();return K.createElement(t.Dropdown,{...e})}const A2=Object.freeze(Object.defineProperty({__proto__:null,Button:s2,CaptionLabel:r2,Chevron:o2,Day:l2,DayButton:a2,Dropdown:c2,DropdownNav:u2,Footer:d2,Month:f2,MonthCaption:h2,MonthGrid:p2,Months:m2,MonthsDropdown:g2,Nav:v2,NextMonthButton:b2,Option:y2,PreviousMonthButton:x2,Root:w2,Select:_2,Week:C2,WeekNumber:N2,WeekNumberHeader:k2,Weekday:S2,Weekdays:E2,Weeks:T2,YearsDropdown:M2},Symbol.toStringTag,{value:"Module"}));function zt(e,t,n=!1,i=Lt){let{from:s,to:o}=e;const{differenceInCalendarDays:l,isSameDay:a}=i;return s&&o?(l(o,s)<0&&([s,o]=[o,s]),l(t,s)>=(n?1:0)&&l(o,t)>=(n?1:0)):!n&&o?a(o,t):!n&&s?a(s,t):!1}function $o(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function Zs(e){return!!(e&&typeof e=="object"&&"from"in e)}function Uo(e){return!!(e&&typeof e=="object"&&"after"in e)}function Yo(e){return!!(e&&typeof e=="object"&&"before"in e)}function Yf(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function Zf(e,t){return Array.isArray(e)&&e.every(t.isDate)}function Ht(e,t,n=Lt){const i=Array.isArray(t)?t:[t],{isSameDay:s,differenceInCalendarDays:o,isAfter:l}=n;return i.some(a=>{if(typeof a=="boolean")return a;if(n.isDate(a))return s(e,a);if(Zf(a,n))return a.some(r=>s(e,r));if(Zs(a))return zt(a,e,!1,n);if(Yf(a))return Array.isArray(a.dayOfWeek)?a.dayOfWeek.includes(e.getDay()):a.dayOfWeek===e.getDay();if($o(a)){const r=o(a.before,e),f=o(a.after,e),d=r>0,h=f<0;return l(a.before,a.after)?h&&d:d||h}return Uo(a)?o(e,a.after)>0:Yo(a)?o(a.before,e)>0:typeof a=="function"?a(e):!1})}function R2(e,t,n,i,s){const{disabled:o,hidden:l,modifiers:a,showOutsideDays:r,broadcastCalendar:f,today:d=s.today()}=t,{isSameDay:h,isSameMonth:b,startOfMonth:_,isBefore:C,endOfMonth:S,isAfter:c}=s,u=n&&_(n),p=i&&S(i),v={[Be.focused]:[],[Be.outside]:[],[Be.disabled]:[],[Be.hidden]:[],[Be.today]:[]},y={};for(const w of e){const{date:x,displayMonth:E}=w,k=!!(E&&!b(x,E)),N=!!(u&&C(x,u)),T=!!(p&&c(x,p)),R=!!(o&&Ht(x,o,s)),M=!!(l&&Ht(x,l,s))||N||T||!f&&!r&&k||f&&r===!1&&k,A=h(x,d);k&&v.outside.push(w),R&&v.disabled.push(w),M&&v.hidden.push(w),A&&v.today.push(w),a&&Object.keys(a).forEach(D=>{const $=a==null?void 0:a[D];$&&Ht(x,$,s)&&(y[D]?y[D].push(w):y[D]=[w])})}return w=>{const x={[Be.focused]:!1,[Be.disabled]:!1,[Be.hidden]:!1,[Be.outside]:!1,[Be.today]:!1},E={};for(const k in v){const N=v[k];x[k]=N.some(T=>T===w)}for(const k in y)E[k]=y[k].some(N=>N===w);return{...x,...E}}}function D2(e,t,n={}){return Object.entries(e).filter(([,s])=>s===!0).reduce((s,[o])=>(n[o]?s.push(n[o]):t[Be[o]]?s.push(t[Be[o]]):t[xt[o]]&&s.push(t[xt[o]]),s),[t[de.Day]])}function L2(e){return{...A2,...e}}function O2(e){const t={"data-mode":e.mode??void 0,"data-required":"required"in e?e.required:void 0,"data-multiple-months":e.numberOfMonths&&e.numberOfMonths>1||void 0,"data-week-numbers":e.showWeekNumber||void 0,"data-broadcast-calendar":e.broadcastCalendar||void 0,"data-nav-layout":e.navLayout||void 0};return Object.entries(e).forEach(([n,i])=>{n.startsWith("data-")&&(t[n]=i)}),t}function P2(){const e={};for(const t in de)e[de[t]]=`rdp-${de[t]}`;for(const t in Be)e[Be[t]]=`rdp-${Be[t]}`;for(const t in xt)e[xt[t]]=`rdp-${xt[t]}`;for(const t in st)e[st[t]]=`rdp-${st[t]}`;return e}function qf(e,t,n){return(n??new at(t)).formatMonthYear(e)}const I2=qf;function B2(e,t,n){return(n??new at(t)).format(e,"d")}function F2(e,t=Lt){return t.format(e,"LLLL")}function j2(e,t,n){return(n??new at(t)).format(e,"cccccc")}function z2(e,t=Lt){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)}function H2(){return""}function Gf(e,t=Lt){return t.format(e,"yyyy")}const V2=Gf,W2=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:qf,formatDay:B2,formatMonthCaption:I2,formatMonthDropdown:F2,formatWeekNumber:z2,formatWeekNumberHeader:H2,formatWeekdayName:j2,formatYearCaption:V2,formatYearDropdown:Gf},Symbol.toStringTag,{value:"Module"}));function $2(e){return e!=null&&e.formatMonthCaption&&!e.formatCaption&&(e.formatCaption=e.formatMonthCaption),e!=null&&e.formatYearCaption&&!e.formatYearDropdown&&(e.formatYearDropdown=e.formatYearCaption),{...W2,...e}}function Zo(e,t,n,i){let s=(i??new at(n)).format(e,"PPPP");return t.today&&(s=`Today, ${s}`),t.selected&&(s=`${s}, selected`),s}const U2=Zo;function qo(e,t,n){return(n??new at(t)).formatMonthYear(e)}const Y2=qo;function Kf(e,t,n,i){let s=(i??new at(n)).format(e,"PPPP");return t!=null&&t.today&&(s=`Today, ${s}`),s}function Xf(e){return"Choose the Month"}function Qf(){return""}const Z2="Go to the Next Month";function Jf(e,t){return Z2}function eh(e){return"Go to the Previous Month"}function th(e,t,n){return(n??new at(t)).format(e,"cccc")}function nh(e,t){return`Week ${e}`}function ih(e){return"Week Number"}function sh(e){return"Choose the Year"}const q2=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:Y2,labelDay:U2,labelDayButton:Zo,labelGrid:qo,labelGridcell:Kf,labelMonthDropdown:Xf,labelNav:Qf,labelNext:Jf,labelPrevious:eh,labelWeekNumber:nh,labelWeekNumberHeader:ih,labelWeekday:th,labelYearDropdown:sh},Symbol.toStringTag,{value:"Module"})),gt=(e,t,n)=>t||(n?typeof n=="function"?n:(...i)=>n:e);function G2(e,t){var i;const n=((i=t.locale)==null?void 0:i.labels)??{};return{...q2,...e??{},labelDayButton:gt(Zo,e==null?void 0:e.labelDayButton,n.labelDayButton),labelMonthDropdown:gt(Xf,e==null?void 0:e.labelMonthDropdown,n.labelMonthDropdown),labelNext:gt(Jf,e==null?void 0:e.labelNext,n.labelNext),labelPrevious:gt(eh,e==null?void 0:e.labelPrevious,n.labelPrevious),labelWeekNumber:gt(nh,e==null?void 0:e.labelWeekNumber,n.labelWeekNumber),labelYearDropdown:gt(sh,e==null?void 0:e.labelYearDropdown,n.labelYearDropdown),labelGrid:gt(qo,e==null?void 0:e.labelGrid,n.labelGrid),labelGridcell:gt(Kf,e==null?void 0:e.labelGridcell,n.labelGridcell),labelNav:gt(Qf,e==null?void 0:e.labelNav,n.labelNav),labelWeekNumberHeader:gt(ih,e==null?void 0:e.labelWeekNumberHeader,n.labelWeekNumberHeader),labelWeekday:gt(th,e==null?void 0:e.labelWeekday,n.labelWeekday)}}function K2(e,t,n,i,s){const{startOfMonth:o,startOfYear:l,endOfYear:a,eachMonthOfInterval:r,getMonth:f}=s;return r({start:l(e),end:a(e)}).map(b=>{const _=i.formatMonthDropdown(b,s),C=f(b),S=t&&b<o(t)||n&&b>o(n)||!1;return{value:C,label:_,disabled:S}})}function X2(e,t={},n={}){let i={...t==null?void 0:t[de.Day]};return Object.entries(e).filter(([,s])=>s===!0).forEach(([s])=>{i={...i,...n==null?void 0:n[s]}}),i}function Q2(e,t,n,i){const s=i??e.today(),o=n?e.startOfBroadcastWeek(s,e):t?e.startOfISOWeek(s):e.startOfWeek(s),l=[];for(let a=0;a<7;a++){const r=e.addDays(o,a);l.push(r)}return l}function J2(e,t,n,i,s=!1){if(!e||!t)return;const{startOfYear:o,endOfYear:l,eachYearOfInterval:a,getYear:r}=i,f=o(e),d=l(t),h=a({start:f,end:d});return s&&h.reverse(),h.map(b=>{const _=n.formatYearDropdown(b,i);return{value:r(b),label:_,disabled:!1}})}function eC(e,t={}){var a;const{weekStartsOn:n,locale:i}=t,s=n??((a=i==null?void 0:i.options)==null?void 0:a.weekStartsOn)??0,o=r=>{const f=typeof r=="number"||typeof r=="string"?new Date(r):r;return new Qe(f.getFullYear(),f.getMonth(),f.getDate(),12,0,0,e)},l=r=>{const f=o(r);return new Date(f.getFullYear(),f.getMonth(),f.getDate(),0,0,0,0)};return{today:()=>o(Qe.tz(e)),newDate:(r,f,d)=>new Qe(r,f,d,12,0,0,e),startOfDay:r=>o(r),startOfWeek:(r,f)=>{const d=o(r),h=(f==null?void 0:f.weekStartsOn)??s,b=(d.getDay()-h+7)%7;return d.setDate(d.getDate()-b),d},startOfISOWeek:r=>{const f=o(r),d=(f.getDay()-1+7)%7;return f.setDate(f.getDate()-d),f},startOfMonth:r=>{const f=o(r);return f.setDate(1),f},startOfYear:r=>{const f=o(r);return f.setMonth(0,1),f},endOfWeek:(r,f)=>{const d=o(r),_=((((f==null?void 0:f.weekStartsOn)??s)+6)%7-d.getDay()+7)%7;return d.setDate(d.getDate()+_),d},endOfISOWeek:r=>{const f=o(r),d=(7-f.getDay())%7;return f.setDate(f.getDate()+d),f},endOfMonth:r=>{const f=o(r);return f.setMonth(f.getMonth()+1,0),f},endOfYear:r=>{const f=o(r);return f.setMonth(11,31),f},eachMonthOfInterval:r=>{const f=o(r.start),d=o(r.end),h=[],b=new Qe(f.getFullYear(),f.getMonth(),1,12,0,0,e),_=d.getFullYear()*12+d.getMonth();for(;b.getFullYear()*12+b.getMonth()<=_;)h.push(new Qe(b,e)),b.setMonth(b.getMonth()+1,1);return h},addDays:(r,f)=>{const d=o(r);return d.setDate(d.getDate()+f),d},addWeeks:(r,f)=>{const d=o(r);return d.setDate(d.getDate()+f*7),d},addMonths:(r,f)=>{const d=o(r);return d.setMonth(d.getMonth()+f),d},addYears:(r,f)=>{const d=o(r);return d.setFullYear(d.getFullYear()+f),d},eachYearOfInterval:r=>{const f=o(r.start),d=o(r.end),h=[],b=new Qe(f.getFullYear(),0,1,12,0,0,e);for(;b.getFullYear()<=d.getFullYear();)h.push(new Qe(b,e)),b.setFullYear(b.getFullYear()+1,0,1);return h},getWeek:(r,f)=>{var h;const d=l(r);return Wo(d,{weekStartsOn:(f==null?void 0:f.weekStartsOn)??s,firstWeekContainsDate:(f==null?void 0:f.firstWeekContainsDate)??((h=i==null?void 0:i.options)==null?void 0:h.firstWeekContainsDate)??1})},getISOWeek:r=>{const f=l(r);return Vo(f)},differenceInCalendarDays:(r,f)=>{const d=l(r),h=l(f);return Ho(d,h)},differenceInCalendarMonths:(r,f)=>{const d=l(r),h=l(f);return If(d,h)}}}const Bi=e=>e instanceof HTMLElement?e:null,Cr=e=>[...e.querySelectorAll("[data-animated-month]")??[]],tC=e=>Bi(e.querySelector("[data-animated-month]")),Sr=e=>Bi(e.querySelector("[data-animated-caption]")),Er=e=>Bi(e.querySelector("[data-animated-weeks]")),nC=e=>Bi(e.querySelector("[data-animated-nav]")),iC=e=>Bi(e.querySelector("[data-animated-weekdays]"));function sC(e,t,{classNames:n,months:i,focused:s,dateLib:o}){const l=K.useRef(null),a=K.useRef(i),r=K.useRef(!1);K.useLayoutEffect(()=>{const f=a.current;if(a.current=i,!t||!e.current||!(e.current instanceof HTMLElement)||i.length===0||f.length===0||i.length!==f.length)return;const d=o.isSameMonth(i[0].date,f[0].date),h=o.isAfter(i[0].date,f[0].date),b=h?n[st.caption_after_enter]:n[st.caption_before_enter],_=h?n[st.weeks_after_enter]:n[st.weeks_before_enter],C=l.current,S=e.current.cloneNode(!0);if(S instanceof HTMLElement?(Cr(S).forEach(v=>{if(!(v instanceof HTMLElement))return;const y=tC(v);y&&v.contains(y)&&v.removeChild(y);const w=Sr(v);w&&w.classList.remove(b);const x=Er(v);x&&x.classList.remove(_)}),l.current=S):l.current=null,r.current||d||s)return;const c=C instanceof HTMLElement?Cr(C):[],u=Cr(e.current);if(u!=null&&u.every(p=>p instanceof HTMLElement)&&c&&c.every(p=>p instanceof HTMLElement)){r.current=!0,e.current.style.isolation="isolate";const p=nC(e.current);p&&(p.style.zIndex="1"),u.forEach((v,y)=>{const w=c[y];if(!w)return;v.style.position="relative",v.style.overflow="hidden";const x=Sr(v);x&&x.classList.add(b);const E=Er(v);E&&E.classList.add(_);const k=()=>{r.current=!1,e.current&&(e.current.style.isolation=""),p&&(p.style.zIndex=""),x&&x.classList.remove(b),E&&E.classList.remove(_),v.style.position="",v.style.overflow="",v.contains(w)&&v.removeChild(w)};w.style.pointerEvents="none",w.style.position="absolute",w.style.overflow="hidden",w.setAttribute("aria-hidden","true");const N=iC(w);N&&(N.style.opacity="0");const T=Sr(w);T&&(T.classList.add(h?n[st.caption_before_exit]:n[st.caption_after_exit]),T.addEventListener("animationend",k));const R=Er(w);R&&R.classList.add(h?n[st.weeks_before_exit]:n[st.weeks_after_exit]),v.insertBefore(w,v.firstChild)})}})}function rC(e,t,n,i){const s=e[0],o=e[e.length-1],{ISOWeek:l,fixedWeeks:a,broadcastCalendar:r}=n??{},{addDays:f,differenceInCalendarDays:d,differenceInCalendarMonths:h,endOfBroadcastWeek:b,endOfISOWeek:_,endOfMonth:C,endOfWeek:S,isAfter:c,startOfBroadcastWeek:u,startOfISOWeek:p,startOfWeek:v}=i,y=r?u(s,i):l?p(s):v(s),w=r?b(o):l?_(C(o)):S(C(o)),x=t&&(r?b(t):l?_(t):S(t)),E=x&&c(w,x)?x:w,k=d(E,y),N=h(o,s)+1,T=[];for(let A=0;A<=k;A++){const D=f(y,A);T.push(D)}const M=(r?35:42)*N;if(a&&T.length<M){const A=M-T.length;for(let D=0;D<A;D++){const $=f(T[T.length-1],1);T.push($)}}return T}function oC(e){const t=[];return e.reduce((n,i)=>{const s=i.weeks.reduce((o,l)=>o.concat(l.days.slice()),t.slice());return n.concat(s.slice())},t.slice())}function lC(e,t,n,i){const{numberOfMonths:s=1}=n,o=[];for(let l=0;l<s;l++){const a=i.addMonths(e,l);if(t&&a>t)break;o.push(a)}return o}function Ra(e,t,n,i){const{month:s,defaultMonth:o,today:l=i.today(),numberOfMonths:a=1}=e;let r=s||o||l;const{differenceInCalendarMonths:f,addMonths:d,startOfMonth:h}=i;if(n&&f(n,r)<a-1){const b=-1*(a-1);r=d(n,b)}return t&&f(r,t)<0&&(r=t),h(r)}function aC(e,t,n,i){const{addDays:s,endOfBroadcastWeek:o,endOfISOWeek:l,endOfMonth:a,endOfWeek:r,getISOWeek:f,getWeek:d,startOfBroadcastWeek:h,startOfISOWeek:b,startOfWeek:_}=i,C=e.reduce((S,c)=>{const u=n.broadcastCalendar?h(c,i):n.ISOWeek?b(c):_(c),p=n.broadcastCalendar?o(c):n.ISOWeek?l(a(c)):r(a(c)),v=t.filter(E=>E>=u&&E<=p),y=n.broadcastCalendar?35:42;if(n.fixedWeeks&&v.length<y){const E=t.filter(k=>{const N=y-v.length;return k>p&&k<=s(p,N)});v.push(...E)}const w=v.reduce((E,k)=>{const N=n.ISOWeek?f(k):d(k),T=E.find(M=>M.weekNumber===N),R=new $f(k,c,i);return T?T.days.push(R):E.push(new i2(N,[R])),E},[]),x=new n2(c,w);return S.push(x),S},[]);return n.reverseMonths?C.reverse():C}function cC(e,t){let{startMonth:n,endMonth:i}=e;const{startOfYear:s,startOfDay:o,startOfMonth:l,endOfMonth:a,addYears:r,endOfYear:f,newDate:d,today:h}=t,{fromYear:b,toYear:_,fromMonth:C,toMonth:S}=e;!n&&C&&(n=C),!n&&b&&(n=t.newDate(b,0,1)),!i&&S&&(i=S),!i&&_&&(i=d(_,11,31));const c=e.captionLayout==="dropdown"||e.captionLayout==="dropdown-years";return n?n=l(n):b?n=d(b,0,1):!n&&c&&(n=s(r(e.today??h(),-100))),i?i=a(i):_?i=d(_,11,31):!i&&c&&(i=f(e.today??h())),[n&&o(n),i&&o(i)]}function uC(e,t,n,i){if(n.disableNavigation)return;const{pagedNavigation:s,numberOfMonths:o=1}=n,{startOfMonth:l,addMonths:a,differenceInCalendarMonths:r}=i,f=s?o:1,d=l(e);if(!t)return a(d,f);if(!(r(t,e)<o))return a(d,f)}function dC(e,t,n,i){if(n.disableNavigation)return;const{pagedNavigation:s,numberOfMonths:o}=n,{startOfMonth:l,addMonths:a,differenceInCalendarMonths:r}=i,f=s?o??1:1,d=l(e);if(!t)return a(d,-f);if(!(r(d,t)<=0))return a(d,-f)}function fC(e){const t=[];return e.reduce((n,i)=>n.concat(i.weeks.slice()),t.slice())}function qs(e,t){const[n,i]=K.useState(e);return[t===void 0?n:t,i]}function hC(e,t){var y;const[n,i]=cC(e,t),{startOfMonth:s,endOfMonth:o}=t,l=Ra(e,n,i,t),[a,r]=qs(l,e.month?l:void 0);K.useEffect(()=>{const w=Ra(e,n,i,t);r(w)},[e.timeZone]);const{months:f,weeks:d,days:h,previousMonth:b,nextMonth:_}=K.useMemo(()=>{const w=lC(a,i,{numberOfMonths:e.numberOfMonths},t),x=rC(w,e.endMonth?o(e.endMonth):void 0,{ISOWeek:e.ISOWeek,fixedWeeks:e.fixedWeeks,broadcastCalendar:e.broadcastCalendar},t),E=aC(w,x,{broadcastCalendar:e.broadcastCalendar,fixedWeeks:e.fixedWeeks,ISOWeek:e.ISOWeek,reverseMonths:e.reverseMonths},t),k=fC(E),N=oC(E),T=dC(a,n,e,t),R=uC(a,i,e,t);return{months:E,weeks:k,days:N,previousMonth:T,nextMonth:R}},[t,a.getTime(),i==null?void 0:i.getTime(),n==null?void 0:n.getTime(),e.disableNavigation,e.broadcastCalendar,(y=e.endMonth)==null?void 0:y.getTime(),e.fixedWeeks,e.ISOWeek,e.numberOfMonths,e.pagedNavigation,e.reverseMonths]),{disableNavigation:C,onMonthChange:S}=e,c=w=>d.some(x=>x.days.some(E=>E.isEqualTo(w))),u=w=>{if(C)return;let x=s(w);n&&x<s(n)&&(x=s(n)),i&&x>s(i)&&(x=s(i)),r(x),S==null||S(x)};return{months:f,weeks:d,days:h,navStart:n,navEnd:i,previousMonth:b,nextMonth:_,goToMonth:u,goToDay:w=>{c(w)||u(w.date)}}}var Et;(function(e){e[e.Today=0]="Today",e[e.Selected=1]="Selected",e[e.LastFocused=2]="LastFocused",e[e.FocusedModifier=3]="FocusedModifier"})(Et||(Et={}));function Da(e){return!e[Be.disabled]&&!e[Be.hidden]&&!e[Be.outside]}function pC(e,t,n,i){let s,o=-1;for(const l of e){const a=t(l);Da(a)&&(a[Be.focused]&&o<Et.FocusedModifier?(s=l,o=Et.FocusedModifier):i!=null&&i.isEqualTo(l)&&o<Et.LastFocused?(s=l,o=Et.LastFocused):n(l.date)&&o<Et.Selected?(s=l,o=Et.Selected):a[Be.today]&&o<Et.Today&&(s=l,o=Et.Today))}return s||(s=e.find(l=>Da(t(l)))),s}function mC(e,t,n,i,s,o,l){const{ISOWeek:a,broadcastCalendar:r}=o,{addDays:f,addMonths:d,addWeeks:h,addYears:b,endOfBroadcastWeek:_,endOfISOWeek:C,endOfWeek:S,max:c,min:u,startOfBroadcastWeek:p,startOfISOWeek:v,startOfWeek:y}=l;let x={day:f,week:h,month:d,year:b,startOfWeek:E=>r?p(E,l):a?v(E):y(E),endOfWeek:E=>r?_(E):a?C(E):S(E)}[e](n,t==="after"?1:-1);return t==="before"&&i?x=c([i,x]):t==="after"&&s&&(x=u([s,x])),x}function rh(e,t,n,i,s,o,l,a=0){if(a>365)return;const r=mC(e,t,n.date,i,s,o,l),f=!!(o.disabled&&Ht(r,o.disabled,l)),d=!!(o.hidden&&Ht(r,o.hidden,l)),h=r,b=new $f(r,h,l);return!f&&!d?b:rh(e,t,b,i,s,o,l,a+1)}function gC(e,t,n,i,s){const{autoFocus:o}=e,[l,a]=K.useState(),r=pC(t.days,n,i||(()=>!1),l),[f,d]=K.useState(o?r:void 0);return{isFocusTarget:S=>!!(r!=null&&r.isEqualTo(S)),setFocused:d,focused:f,blur:()=>{a(f),d(void 0)},moveFocus:(S,c)=>{if(!f)return;const u=rh(S,c,f,t.navStart,t.navEnd,e,s);u&&(e.disableNavigation&&!t.days.some(v=>v.isEqualTo(u))||(t.goToDay(u),d(u)))}}}function vC(e,t){const{selected:n,required:i,onSelect:s}=e,[o,l]=qs(n,s?n:void 0),a=s?n:o,{isSameDay:r}=t,f=_=>(a==null?void 0:a.some(C=>r(C,_)))??!1,{min:d,max:h}=e;return{selected:a,select:(_,C,S)=>{let c=[...a??[]];if(f(_)){if((a==null?void 0:a.length)===d||i&&(a==null?void 0:a.length)===1)return;c=a==null?void 0:a.filter(u=>!r(u,_))}else(a==null?void 0:a.length)===h?c=[_]:c=[...c,_];return s||l(c),s==null||s(c,_,C,S),c},isSelected:f}}function bC(e,t,n=0,i=0,s=!1,o=Lt){const{from:l,to:a}=t||{},{isSameDay:r,isAfter:f,isBefore:d}=o;let h;if(!l&&!a)h={from:e,to:n>0?void 0:e};else if(l&&!a)r(l,e)?n===0?h={from:l,to:e}:s?h={from:l,to:void 0}:h=void 0:d(e,l)?h={from:e,to:l}:h={from:l,to:e};else if(l&&a)if(r(l,e)&&r(a,e))s?h={from:l,to:a}:h=void 0;else if(r(l,e))h={from:l,to:n>0?void 0:e};else if(r(a,e))h={from:e,to:n>0?void 0:e};else if(d(e,l))h={from:e,to:a};else if(f(e,l))h={from:l,to:e};else if(f(e,a))h={from:l,to:e};else throw new Error("Invalid range");if(h!=null&&h.from&&(h!=null&&h.to)){const b=o.differenceInCalendarDays(h.to,h.from);i>0&&b>i?h={from:e,to:void 0}:n>1&&b<n&&(h={from:e,to:void 0})}return h}function yC(e,t,n=Lt){const i=Array.isArray(t)?t:[t];let s=e.from;const o=n.differenceInCalendarDays(e.to,e.from),l=Math.min(o,6);for(let a=0;a<=l;a++){if(i.includes(s.getDay()))return!0;s=n.addDays(s,1)}return!1}function La(e,t,n=Lt){return zt(e,t.from,!1,n)||zt(e,t.to,!1,n)||zt(t,e.from,!1,n)||zt(t,e.to,!1,n)}function xC(e,t,n=Lt){const i=Array.isArray(t)?t:[t];if(i.filter(a=>typeof a!="function").some(a=>typeof a=="boolean"?a:n.isDate(a)?zt(e,a,!1,n):Zf(a,n)?a.some(r=>zt(e,r,!1,n)):Zs(a)?a.from&&a.to?La(e,{from:a.from,to:a.to},n):!1:Yf(a)?yC(e,a.dayOfWeek,n):$o(a)?n.isAfter(a.before,a.after)?La(e,{from:n.addDays(a.after,1),to:n.addDays(a.before,-1)},n):Ht(e.from,a,n)||Ht(e.to,a,n):Uo(a)||Yo(a)?Ht(e.from,a,n)||Ht(e.to,a,n):!1))return!0;const l=i.filter(a=>typeof a=="function");if(l.length){let a=e.from;const r=n.differenceInCalendarDays(e.to,e.from);for(let f=0;f<=r;f++){if(l.some(d=>d(a)))return!0;a=n.addDays(a,1)}}return!1}function wC(e,t){const{disabled:n,excludeDisabled:i,selected:s,required:o,onSelect:l}=e,[a,r]=qs(s,l?s:void 0),f=l?s:a;return{selected:f,select:(b,_,C)=>{const{min:S,max:c}=e,u=b?bC(b,f,S,c,o,t):void 0;return i&&n&&(u!=null&&u.from)&&u.to&&xC({from:u.from,to:u.to},n,t)&&(u.from=b,u.to=void 0),l||r(u),l==null||l(u,b,_,C),u},isSelected:b=>f&&zt(f,b,!1,t)}}function _C(e,t){const{selected:n,required:i,onSelect:s}=e,[o,l]=qs(n,s?n:void 0),a=s?n:o,{isSameDay:r}=t;return{selected:a,select:(h,b,_)=>{let C=h;return!i&&a&&a&&r(h,a)&&(C=void 0),s||l(C),s==null||s(C,h,b,_),C},isSelected:h=>a?r(a,h):!1}}function CC(e,t){const n=_C(e,t),i=vC(e,t),s=wC(e,t);switch(e.mode){case"single":return n;case"multiple":return i;case"range":return s;default:return}}function dt(e,t){return e instanceof Qe&&e.timeZone===t?e:new Qe(e,t)}function wn(e,t,n){return dt(e,t)}function Oa(e,t,n){return typeof e=="boolean"||typeof e=="function"?e:e instanceof Date?wn(e,t):Array.isArray(e)?e.map(i=>i instanceof Date?wn(i,t):i):Zs(e)?{...e,from:e.from?dt(e.from,t):e.from,to:e.to?dt(e.to,t):e.to}:$o(e)?{before:wn(e.before,t),after:wn(e.after,t)}:Uo(e)?{after:wn(e.after,t)}:Yo(e)?{before:wn(e.before,t)}:e}function Nr(e,t,n){return e&&(Array.isArray(e)?e.map(i=>Oa(i,t)):Oa(e,t))}function SC(e){var gn;let t=e;const n=t.timeZone;if(n&&(t={...e,timeZone:n},t.today&&(t.today=dt(t.today,n)),t.month&&(t.month=dt(t.month,n)),t.defaultMonth&&(t.defaultMonth=dt(t.defaultMonth,n)),t.startMonth&&(t.startMonth=dt(t.startMonth,n)),t.endMonth&&(t.endMonth=dt(t.endMonth,n)),t.mode==="single"&&t.selected?t.selected=dt(t.selected,n):t.mode==="multiple"&&t.selected?t.selected=(gn=t.selected)==null?void 0:gn.map(he=>dt(he,n)):t.mode==="range"&&t.selected&&(t.selected={from:t.selected.from?dt(t.selected.from,n):t.selected.from,to:t.selected.to?dt(t.selected.to,n):t.selected.to}),t.disabled!==void 0&&(t.disabled=Nr(t.disabled,n)),t.hidden!==void 0&&(t.hidden=Nr(t.hidden,n)),t.modifiers)){const he={};Object.keys(t.modifiers).forEach(Te=>{var fe;he[Te]=Nr((fe=t.modifiers)==null?void 0:fe[Te],n)}),t.modifiers=he}const{components:i,formatters:s,labels:o,dateLib:l,locale:a,classNames:r}=K.useMemo(()=>{const he={...Wf,...t.locale},Te=t.broadcastCalendar?1:t.weekStartsOn,fe=t.noonSafe&&t.timeZone?eC(t.timeZone,{weekStartsOn:Te,locale:he}):void 0,Ne=t.dateLib&&fe?{...fe,...t.dateLib}:t.dateLib??fe,Xe=new at({locale:he,weekStartsOn:Te,firstWeekContainsDate:t.firstWeekContainsDate,useAdditionalWeekYearTokens:t.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:t.useAdditionalDayOfYearTokens,timeZone:t.timeZone,numerals:t.numerals},Ne);return{dateLib:Xe,components:L2(t.components),formatters:$2(t.formatters),labels:G2(t.labels,Xe.options),locale:he,classNames:{...P2(),...t.classNames}}},[t.locale,t.broadcastCalendar,t.weekStartsOn,t.firstWeekContainsDate,t.useAdditionalWeekYearTokens,t.useAdditionalDayOfYearTokens,t.timeZone,t.numerals,t.dateLib,t.noonSafe,t.components,t.formatters,t.labels,t.classNames]);t.today||(t={...t,today:l.today()});const{captionLayout:f,mode:d,navLayout:h,numberOfMonths:b=1,onDayBlur:_,onDayClick:C,onDayFocus:S,onDayKeyDown:c,onDayMouseEnter:u,onDayMouseLeave:p,onNextClick:v,onPrevClick:y,showWeekNumber:w,styles:x}=t,{formatCaption:E,formatDay:k,formatMonthDropdown:N,formatWeekNumber:T,formatWeekNumberHeader:R,formatWeekdayName:M,formatYearDropdown:A}=s,D=hC(t,l),{days:$,months:H,navStart:j,navEnd:F,previousMonth:z,nextMonth:O,goToMonth:B}=D,L=R2($,t,j,F,l),{isSelected:U,select:P,selected:W}=CC(t,l)??{},{blur:Q,focused:V,isFocusTarget:X,moveFocus:Z,setFocused:G}=gC(t,D,L,U??(()=>!1),l),{labelDayButton:J,labelGridcell:ee,labelGrid:se,labelMonthDropdown:le,labelNav:ue,labelPrevious:Se,labelNext:Re,labelWeekday:ge,labelWeekNumber:ke,labelWeekNumberHeader:I,labelYearDropdown:Y}=o,q=K.useMemo(()=>Q2(l,t.ISOWeek,t.broadcastCalendar,t.today),[l,t.ISOWeek,t.broadcastCalendar,t.today]),re=d!==void 0||C!==void 0,ie=K.useCallback(()=>{z&&(B(z),y==null||y(z))},[z,B,y]),te=K.useCallback(()=>{O&&(B(O),v==null||v(O))},[B,O,v]),ae=K.useCallback((he,Te)=>fe=>{fe.preventDefault(),fe.stopPropagation(),G(he),!Te.disabled&&(P==null||P(he.date,Te,fe),C==null||C(he.date,Te,fe))},[P,C,G]),ve=K.useCallback((he,Te)=>fe=>{G(he),S==null||S(he.date,Te,fe)},[S,G]),me=K.useCallback((he,Te)=>fe=>{Q(),_==null||_(he.date,Te,fe)},[Q,_]),xe=K.useCallback((he,Te)=>fe=>{const Ne={ArrowLeft:[fe.shiftKey?"month":"day",t.dir==="rtl"?"after":"before"],ArrowRight:[fe.shiftKey?"month":"day",t.dir==="rtl"?"before":"after"],ArrowDown:[fe.shiftKey?"year":"week","after"],ArrowUp:[fe.shiftKey?"year":"week","before"],PageUp:[fe.shiftKey?"year":"month","before"],PageDown:[fe.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(Ne[fe.key]){fe.preventDefault(),fe.stopPropagation();const[Xe,_e]=Ne[fe.key];Z(Xe,_e)}c==null||c(he.date,Te,fe)},[Z,c,t.dir]),Ae=K.useCallback((he,Te)=>fe=>{u==null||u(he.date,Te,fe)},[u]),Ee=K.useCallback((he,Te)=>fe=>{p==null||p(he.date,Te,fe)},[p]),Fe=K.useCallback(he=>Te=>{const fe=Number(Te.target.value),Ne=l.setMonth(l.startOfMonth(he),fe);B(Ne)},[l,B]),Ie=K.useCallback(he=>Te=>{const fe=Number(Te.target.value),Ne=l.setYear(l.startOfMonth(he),fe);B(Ne)},[l,B]),{className:Ye,style:Ge}=K.useMemo(()=>({className:[r[de.Root],t.className].filter(Boolean).join(" "),style:{...x==null?void 0:x[de.Root],...t.style}}),[r,t.className,t.style,x]),ze=O2(t),Pt=K.useRef(null);sC(Pt,!!t.animate,{classNames:r,months:H,focused:V,dateLib:l});const ut={dayPickerProps:t,selected:W,select:P,isSelected:U,months:H,nextMonth:O,previousMonth:z,goToMonth:B,getModifiers:L,components:i,classNames:r,styles:x,labels:o,formatters:s};return K.createElement(Uf.Provider,{value:ut},K.createElement(i.Root,{rootRef:t.animate?Pt:void 0,className:Ye,style:Ge,dir:t.dir,id:t.id,lang:t.lang,nonce:t.nonce,title:t.title,role:t.role,"aria-label":t["aria-label"],"aria-labelledby":t["aria-labelledby"],...ze},K.createElement(i.Months,{className:r[de.Months],style:x==null?void 0:x[de.Months]},!t.hideNavigation&&!h&&K.createElement(i.Nav,{"data-animated-nav":t.animate?"true":void 0,className:r[de.Nav],style:x==null?void 0:x[de.Nav],"aria-label":ue(),onPreviousClick:ie,onNextClick:te,previousMonth:z,nextMonth:O}),H.map((he,Te)=>K.createElement(i.Month,{"data-animated-month":t.animate?"true":void 0,className:r[de.Month],style:x==null?void 0:x[de.Month],key:Te,displayIndex:Te,calendarMonth:he},h==="around"&&!t.hideNavigation&&Te===0&&K.createElement(i.PreviousMonthButton,{type:"button",className:r[de.PreviousMonthButton],tabIndex:z?void 0:-1,"aria-disabled":z?void 0:!0,"aria-label":Se(z),onClick:ie,"data-animated-button":t.animate?"true":void 0},K.createElement(i.Chevron,{disabled:z?void 0:!0,className:r[de.Chevron],orientation:t.dir==="rtl"?"right":"left"})),K.createElement(i.MonthCaption,{"data-animated-caption":t.animate?"true":void 0,className:r[de.MonthCaption],style:x==null?void 0:x[de.MonthCaption],calendarMonth:he,displayIndex:Te},f!=null&&f.startsWith("dropdown")?K.createElement(i.DropdownNav,{className:r[de.Dropdowns],style:x==null?void 0:x[de.Dropdowns]},(()=>{const fe=f==="dropdown"||f==="dropdown-months"?K.createElement(i.MonthsDropdown,{key:"month",className:r[de.MonthsDropdown],"aria-label":le(),classNames:r,components:i,disabled:!!t.disableNavigation,onChange:Fe(he.date),options:K2(he.date,j,F,s,l),style:x==null?void 0:x[de.Dropdown],value:l.getMonth(he.date)}):K.createElement("span",{key:"month"},N(he.date,l)),Ne=f==="dropdown"||f==="dropdown-years"?K.createElement(i.YearsDropdown,{key:"year",className:r[de.YearsDropdown],"aria-label":Y(l.options),classNames:r,components:i,disabled:!!t.disableNavigation,onChange:Ie(he.date),options:J2(j,F,s,l,!!t.reverseYears),style:x==null?void 0:x[de.Dropdown],value:l.getYear(he.date)}):K.createElement("span",{key:"year"},A(he.date,l));return l.getMonthYearOrder()==="year-first"?[Ne,fe]:[fe,Ne]})(),K.createElement("span",{role:"status","aria-live":"polite",style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}},E(he.date,l.options,l))):K.createElement(i.CaptionLabel,{className:r[de.CaptionLabel],role:"status","aria-live":"polite"},E(he.date,l.options,l))),h==="around"&&!t.hideNavigation&&Te===b-1&&K.createElement(i.NextMonthButton,{type:"button",className:r[de.NextMonthButton],tabIndex:O?void 0:-1,"aria-disabled":O?void 0:!0,"aria-label":Re(O),onClick:te,"data-animated-button":t.animate?"true":void 0},K.createElement(i.Chevron,{disabled:O?void 0:!0,className:r[de.Chevron],orientation:t.dir==="rtl"?"left":"right"})),Te===b-1&&h==="after"&&!t.hideNavigation&&K.createElement(i.Nav,{"data-animated-nav":t.animate?"true":void 0,className:r[de.Nav],style:x==null?void 0:x[de.Nav],"aria-label":ue(),onPreviousClick:ie,onNextClick:te,previousMonth:z,nextMonth:O}),K.createElement(i.MonthGrid,{role:"grid","aria-multiselectable":d==="multiple"||d==="range","aria-label":se(he.date,l.options,l)||void 0,className:r[de.MonthGrid],style:x==null?void 0:x[de.MonthGrid]},!t.hideWeekdays&&K.createElement(i.Weekdays,{"data-animated-weekdays":t.animate?"true":void 0,className:r[de.Weekdays],style:x==null?void 0:x[de.Weekdays]},w&&K.createElement(i.WeekNumberHeader,{"aria-label":I(l.options),className:r[de.WeekNumberHeader],style:x==null?void 0:x[de.WeekNumberHeader],scope:"col"},R()),q.map(fe=>K.createElement(i.Weekday,{"aria-label":ge(fe,l.options,l),className:r[de.Weekday],key:String(fe),style:x==null?void 0:x[de.Weekday],scope:"col"},M(fe,l.options,l)))),K.createElement(i.Weeks,{"data-animated-weeks":t.animate?"true":void 0,className:r[de.Weeks],style:x==null?void 0:x[de.Weeks]},he.weeks.map(fe=>K.createElement(i.Week,{className:r[de.Week],key:fe.weekNumber,style:x==null?void 0:x[de.Week],week:fe},w&&K.createElement(i.WeekNumber,{week:fe,style:x==null?void 0:x[de.WeekNumber],"aria-label":ke(fe.weekNumber,{locale:a}),className:r[de.WeekNumber],scope:"row",role:"rowheader"},T(fe.weekNumber,l)),fe.days.map(Ne=>{const{date:Xe}=Ne,_e=L(Ne);if(_e[Be.focused]=!_e.hidden&&!!(V!=null&&V.isEqualTo(Ne)),_e[xt.selected]=(U==null?void 0:U(Xe))||_e.selected,Zs(W)){const{from:Kn,to:Xn}=W;_e[xt.range_start]=!!(Kn&&Xn&&l.isSameDay(Xe,Kn)),_e[xt.range_end]=!!(Kn&&Xn&&l.isSameDay(Xe,Xn)),_e[xt.range_middle]=zt(W,Xe,!0,l)}const Ui=X2(_e,x,t.modifiersStyles),rr=D2(_e,r,t.modifiersClassNames),Yi=!re&&!_e.hidden?ee(Xe,_e,l.options,l):void 0;return K.createElement(i.Day,{key:`${Ne.isoDate}_${Ne.displayMonthId}`,day:Ne,modifiers:_e,className:rr.join(" "),style:Ui,role:"gridcell","aria-selected":_e.selected||void 0,"aria-label":Yi,"data-day":Ne.isoDate,"data-month":Ne.outside?Ne.dateMonthId:void 0,"data-selected":_e.selected||void 0,"data-disabled":_e.disabled||void 0,"data-hidden":_e.hidden||void 0,"data-outside":Ne.outside||void 0,"data-focused":_e.focused||void 0,"data-today":_e.today||void 0},!_e.hidden&&re?K.createElement(i.DayButton,{className:r[de.DayButton],style:x==null?void 0:x[de.DayButton],type:"button",day:Ne,modifiers:_e,disabled:!_e.focused&&_e.disabled||void 0,"aria-disabled":_e.focused&&_e.disabled||void 0,tabIndex:X(Ne)?0:-1,"aria-label":J(Xe,_e,l.options,l),onClick:ae(Ne,_e),onBlur:me(Ne,_e),onFocus:ve(Ne,_e),onKeyDown:xe(Ne,_e),onMouseEnter:Ae(Ne,_e),onMouseLeave:Ee(Ne,_e)},k(Xe,l.options,l)):!_e.hidden&&k(Ne.date,l.options,l))})))))))),t.footer&&K.createElement(i.Footer,{className:r[de.Footer],style:x==null?void 0:x[de.Footer],role:"status","aria-live":"polite"},t.footer)))}const Gs=m.forwardRef(({className:e,classNames:t,showOutsideDays:n=!0,...i},s)=>g.jsx(SC,{ref:s,showOutsideDays:n,className:ne("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:ne("h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",day:ne("h-9 w-9 p-0 font-normal aria-selected:opacity-100"),day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},components:{IconLeft:({...o})=>g.jsx(eo,{className:"h-4 w-4"}),IconRight:({...o})=>g.jsx(_i,{className:"h-4 w-4"})},...i}));Gs.displayName="Calendar";const Go=m.forwardRef(({date:e,onDateChange:t,placeholder:n="Pick a date",className:i,...s},o)=>g.jsxs(jo,{children:[g.jsx(zo,{asChild:!0,children:g.jsxs(we,{ref:o,variant:"outline",className:ne("w-[280px] justify-start text-left font-normal",!e&&"text-muted-foreground",i),...s,children:[g.jsx(ss,{className:"mr-2 h-4 w-4"}),e?jt(e,"PPP"):g.jsx("span",{children:n})]})}),g.jsx(Ys,{className:"w-auto p-0",children:g.jsx(Gs,{mode:"single",selected:e,onSelect:t,initialFocus:!0})})]}));Go.displayName="DatePicker";const Ko=m.forwardRef(({dateRange:e,onDateRangeChange:t,placeholder:n="Pick a date range",className:i,...s},o)=>g.jsx("div",{className:ne("grid gap-2",i),children:g.jsxs(jo,{children:[g.jsx(zo,{asChild:!0,children:g.jsxs(we,{ref:o,id:"date",variant:"outline",className:ne("w-[300px] justify-start text-left font-normal",!e&&"text-muted-foreground"),...s,children:[g.jsx(ss,{className:"mr-2 h-4 w-4"}),e!=null&&e.from?e.to?g.jsxs(g.Fragment,{children:[jt(e.from,"LLL dd, y")," -"," ",jt(e.to,"LLL dd, y")]}):jt(e.from,"LLL dd, y"):g.jsx("span",{children:n})]})}),g.jsx(Ys,{className:"w-auto p-0",align:"start",children:g.jsx(Gs,{initialFocus:!0,mode:"range",defaultMonth:e==null?void 0:e.from,selected:e,onSelect:t,numberOfMonths:2})})]})}));Ko.displayName="DateRangePicker";const Pa={rtl:{italic:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10.5 15.8" xml:space="preserve"><g><path d="M0.3,0.1c0.3,0,0.5,0,0.7,0c1,0.1,1.7,0.1,2.2,0.1H4L7.2,0l0.2,1.1H7c-0.5,0-1,0.1-1.5,0.3v0.4l0.3,1.9L6,4.4L6.3,6 l0.1,0.4l0.1,0.5c0.1,0.2,0.1,0.4,0.2,0.7s0.1,0.6,0.2,0.9L7,9.1l0.6,2.8l0.3,1.4c0.1,0.4,0.2,0.7,0.4,1c0.4,0.2,0.8,0.3,1.2,0.4 l0.8,0.2l0.2,0.9l-1.1,0c-0.9-0.1-1.5-0.1-1.8-0.1h-2c-0.9,0.1-1.4,0.2-1.5,0.2c-0.1,0-0.2,0-0.3,0H3.4c-0.1,0-0.2,0-0.2,0 l-0.1-0.4c0-0.2-0.1-0.4-0.1-0.6l0.7-0.1c0.4,0,0.8-0.1,1.2-0.2c0-0.1,0-0.2,0-0.3l-0.1-0.5l-0.4-2.4L4,9.6L3.4,6.4 C3.2,5.7,3,4.7,2.7,3.3c0-0.3-0.1-0.5-0.1-0.8C2.5,2.1,2.4,1.9,2.3,1.6C2,1.4,1.6,1.3,1.3,1.2C0.9,1.2,0.5,1.1,0.2,0.9L0,0.4L0,0 L0.3,0.1L0.3,0.1z"/></g></svg>',indent:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.7 12.4" xml:space="preserve"><g><g><path d="M15.5,10.1L15.5,10.1c0.1,0,0.3,0.1,0.3,0.3v1.7c0,0.1,0,0.1-0.1,0.2c-0.1,0.1-0.1,0.1-0.2,0.1l-15.2,0 c-0.1,0-0.1,0-0.2-0.1C0,12.2,0,12.2,0,12.1l0-1.7c0-0.1,0-0.1,0.1-0.2c0.1-0.1,0.1-0.1,0.2-0.1C0.3,10.1,15.5,10.1,15.5,10.1z M9.8,6.7c0.1,0,0.1,0,0.2,0.1C10.1,6.9,10.1,7,10.1,7v1.7c0,0.1,0,0.2-0.1,0.2C10,9,9.9,9,9.8,9L0.3,9C0.2,9,0.1,9,0.1,8.9 C0,8.9,0,8.8,0,8.7V7C0,7,0,6.9,0.1,6.8c0.1-0.1,0.1-0.1,0.2-0.1C0.3,6.7,9.8,6.7,9.8,6.7z M0.3,3.4h9.6h0c0.1,0,0.3,0.1,0.3,0.3 v1.7v0c0,0.1-0.1,0.3-0.3,0.3H0.3c-0.1,0-0.1,0-0.2-0.1C0,5.5,0,5.4,0,5.3V3.6c0-0.1,0-0.1,0.1-0.2C0.1,3.4,0.2,3.4,0.3,3.4 L0.3,3.4z M0.3,0l15.2,0c0.1,0,0.1,0,0.2,0.1c0.1,0.1,0.1,0.1,0.1,0.2V2c0,0.1,0,0.2-0.1,0.2c-0.1,0.1-0.1,0.1-0.2,0.1H0.3 c-0.1,0-0.1,0-0.2-0.1C0,2.1,0,2,0,2l0-1.7c0-0.1,0-0.1,0.1-0.2C0.1,0,0.2,0,0.3,0z"/></g><path d="M13.1,3.5L15.7,6c0.1,0.1,0.1,0.3,0,0.4l-2.5,2.5C13.1,9,13,9,12.9,9c-0.1,0-0.1,0-0.2-0.1c-0.1-0.1-0.1-0.1-0.1-0.2V3.7 c0-0.1,0-0.2,0.1-0.2c0.1-0.1,0.1-0.1,0.2-0.1C13,3.4,13.1,3.4,13.1,3.5z"/></g></svg>',outdent:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.7 12.4" xml:space="preserve"><g><g><path d="M15.5,10.1L15.5,10.1c0.1,0,0.3,0.1,0.3,0.3v1.7c0,0.1,0,0.1-0.1,0.2c-0.1,0.1-0.1,0.1-0.2,0.1l-15.2,0 c-0.1,0-0.1,0-0.2-0.1C0,12.2,0,12.2,0,12.1l0-1.7c0-0.1,0-0.1,0.1-0.2c0.1-0.1,0.1-0.1,0.2-0.1C0.3,10.1,15.5,10.1,15.5,10.1z M9.8,6.7c0.1,0,0.1,0,0.2,0.1C10.1,6.9,10.1,7,10.1,7v1.7c0,0.1,0,0.2-0.1,0.2C10,9,9.9,9,9.8,9L0.3,9C0.2,9,0.1,9,0.1,8.9 C0,8.9,0,8.8,0,8.7V7C0,7,0,6.9,0.1,6.8c0.1-0.1,0.1-0.1,0.2-0.1C0.3,6.7,9.8,6.7,9.8,6.7z M0.3,3.4h9.6h0c0.1,0,0.3,0.1,0.3,0.3 v1.7v0c0,0.1-0.1,0.3-0.3,0.3H0.3c-0.1,0-0.1,0-0.2-0.1C0,5.5,0,5.4,0,5.3V3.6c0-0.1,0-0.1,0.1-0.2C0.1,3.4,0.2,3.4,0.3,3.4 L0.3,3.4z M0.3,0l15.2,0c0.1,0,0.1,0,0.2,0.1c0.1,0.1,0.1,0.1,0.1,0.2V2c0,0.1,0,0.2-0.1,0.2c-0.1,0.1-0.1,0.1-0.2,0.1H0.3 c-0.1,0-0.1,0-0.2-0.1C0,2.1,0,2,0,2l0-1.7c0-0.1,0-0.1,0.1-0.2C0.1,0,0.2,0,0.3,0z"/></g><path d="M15.5,3.4c0.1,0,0.1,0,0.2,0.1c0.1,0.1,0.1,0.1,0.1,0.2v5.1c0,0.1,0,0.1-0.1,0.2C15.6,9,15.5,9,15.5,9 c-0.1,0-0.1,0-0.2-0.1l-2.5-2.5c-0.1-0.1-0.1-0.3,0-0.4l2.5-2.5C15.3,3.4,15.4,3.4,15.5,3.4z"/></g></svg>',list_bullets:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.7 12.4" xml:space="preserve"><g><path d="M12.4,10.7c0,0.9,0.8,1.7,1.7,1.7c0.9,0,1.7-0.8,1.7-1.7C15.7,9.8,15,9,14.1,9c-0.4,0-0.9,0.2-1.2,0.5 C12.5,9.8,12.4,10.2,12.4,10.7C12.4,10.7,12.4,10.7,12.4,10.7z M12.4,6.2c0,0.9,0.8,1.7,1.7,1.7c0.4,0,0.9-0.2,1.2-0.5 c0.3-0.3,0.4-0.7,0.4-1.1c0-0.9-0.7-1.7-1.6-1.7C13.1,4.6,12.4,5.3,12.4,6.2C12.4,6.2,12.4,6.2,12.4,6.2z M0,9.8v1.7 c0,0.1,0,0.1,0.1,0.2c0.1,0.1,0.1,0.1,0.2,0.1l10.7,0c0,0,0,0,0,0c0.1,0,0.3-0.1,0.3-0.3V9.8c0-0.1,0-0.1-0.1-0.2 C11.1,9.6,11,9.6,11,9.6l-10.7,0c-0.1,0-0.1,0-0.2,0.1C0,9.7,0,9.8,0,9.8L0,9.8z M12.9,2.9c0.3,0.3,0.7,0.5,1.2,0.5 c0.4,0,0.9-0.2,1.2-0.5c0.7-0.7,0.7-1.7,0-2.4C14.9,0.2,14.5,0,14.1,0c-0.4,0-0.9,0.2-1.2,0.5c-0.3,0.3-0.5,0.7-0.5,1.2 C12.4,2.1,12.5,2.6,12.9,2.9z M0,5.3V7c0,0.1,0,0.1,0.1,0.2c0.1,0.1,0.1,0.1,0.2,0.1H11c0.1,0,0.1,0,0.2-0.1 c0.1-0.1,0.1-0.1,0.1-0.2V5.3c0,0,0,0,0,0c0-0.1-0.1-0.3-0.3-0.3H0.3c-0.1,0-0.1,0-0.2,0.1C0,5.2,0,5.3,0,5.3L0,5.3z M0,0.8v1.7 c0,0.1,0,0.1,0.1,0.2c0.1,0.1,0.1,0.1,0.2,0.1h10.7c0.1,0,0.1,0,0.2-0.1c0,0,0.1-0.1,0.1-0.2V0.8c0-0.1,0-0.1-0.1-0.2 c0-0.1-0.1-0.1-0.2-0.1H0.3c-0.1,0-0.1,0-0.2,0.1C0,0.7,0,0.8,0,0.8L0,0.8z"/></g></svg>',list_number:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.7 15.7" xml:space="preserve"><g><path d="M0,11.5l0,1.7c0,0.1,0,0.1,0.1,0.2c0.1,0.1,0.1,0.1,0.2,0.1H11c0.1,0,0.2,0,0.2-0.1c0.1-0.1,0.1-0.1,0.1-0.2v-1.7 c0-0.1,0-0.1-0.1-0.2c-0.1-0.1-0.1-0.1-0.2-0.1H0.3c-0.1,0-0.2,0-0.2,0.1C0,11.4,0,11.4,0,11.5L0,11.5z M0,8.7c0,0.1,0,0.1,0.1,0.2 C0.1,8.9,0.2,9,0.3,9H11c0.1,0,0.2,0,0.2-0.1c0.1-0.1,0.1-0.1,0.1-0.2V7c0-0.1,0-0.1-0.1-0.2c-0.1-0.1-0.1-0.1-0.2-0.1l-10.7,0 c-0.1,0-0.2,0-0.2,0.1C0,6.8,0,6.9,0,7C0,7,0,8.7,0,8.7z M0,2.5v1.7c0,0.1,0,0.1,0.1,0.2c0,0,0.1,0.1,0.2,0.1l10.7,0 c0.1,0,0.2,0,0.2-0.1c0.1-0.1,0.1-0.1,0.1-0.2V2.4c0-0.1,0-0.1-0.1-0.2c-0.1,0-0.1,0-0.2,0H0.3c-0.1,0-0.1,0-0.2,0 C0,2.3,0,2.4,0,2.5L0,2.5z"/></g><path d="M15.6,14.2c0-0.3-0.1-0.6-0.3-0.8c-0.2-0.2-0.4-0.4-0.7-0.4l0.9-1v-0.8h-2.9v1.3h0.9v-0.5h0.9l0,0c-0.1,0.1-0.2,0.2-0.3,0.3 s-0.2,0.3-0.4,0.5l-0.3,0.3l0.2,0.5c0.6,0,0.9,0.1,0.9,0.5c0,0.1-0.1,0.3-0.2,0.4c-0.1,0.1-0.3,0.1-0.4,0.1c-0.3,0-0.7-0.1-0.9-0.3 l-0.5,0.8c0.4,0.4,0.9,0.6,1.5,0.6c0.4,0,0.9-0.1,1.2-0.4C15.5,15.1,15.6,14.7,15.6,14.2z"/><path d="M15.6,8.7h-0.9v0.5h-1.1c0-0.2,0.2-0.4,0.4-0.5c0.2-0.2,0.4-0.3,0.7-0.4c0.3-0.2,0.5-0.3,0.7-0.6c0.2-0.2,0.3-0.5,0.3-0.8 c0-0.4-0.2-0.8-0.5-1c-0.6-0.4-1.4-0.5-2-0.1c-0.3,0.2-0.5,0.4-0.6,0.7L13.3,7c0.1-0.3,0.4-0.5,0.7-0.5c0.1,0,0.3,0,0.3,0.1 c0.1,0.1,0.1,0.2,0.1,0.3c0,0.2-0.1,0.3-0.2,0.4c-0.2,0.1-0.3,0.3-0.5,0.4c-0.2,0.1-0.4,0.3-0.6,0.4c-0.2,0.2-0.4,0.4-0.5,0.6 c-0.1,0.2-0.2,0.5-0.2,0.8c0,0.2,0,0.3,0,0.5h3.2L15.6,8.7L15.6,8.7z"/><path d="M15.6,3.6h-1V0h-0.9l-1.2,1.1l0.6,0.7c0.2-0.1,0.3-0.3,0.4-0.5l0,0v2.2h-0.9v0.9h3L15.6,3.6L15.6,3.6z"/></svg>',link:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.7 15.7" xml:space="preserve"><g><path d="M7.4,9.9l3.1,3.1c0.3,0.3,0.8,0.5,1.3,0.5c0.5,0,0.9-0.2,1.3-0.5c0,0,0,0,0,0c0.7-0.7,0.7-1.9,0-2.6L9.9,7.3 c0-0.1,0-0.2,0-0.3C9.9,7,10,7,10.1,7l2.2-0.2c0.1,0,0.1,0,0.2,0.1l2.1,2.1c0.4,0.4,0.7,0.8,0.9,1.3c0.2,0.5,0.3,1,0.3,1.5 c0,0.5-0.1,1-0.3,1.5c-0.8,2-3.2,3-5.2,2.2c-0.5-0.2-0.9-0.5-1.3-0.9l-2.1-2.1c-0.1,0-0.1-0.1-0.1-0.2L7,10.1C7,10,7,9.9,7.1,9.9 C7.2,9.8,7.3,9.9,7.4,9.9z M1.2,1.1C1.6,0.7,2,0.4,2.5,0.3c1-0.4,2.1-0.4,3.1,0C6,0.4,6.5,0.7,6.8,1.1L9,3.2C9,3.3,9.1,3.3,9,3.4 L8.8,5.6c0,0.1-0.1,0.2-0.2,0.2c-0.1,0.1-0.2,0.1-0.3,0L5.3,2.7C5,2.3,4.5,2.1,4,2.1c-0.5,0-0.9,0.2-1.3,0.5c0,0,0,0,0,0 C2,3.4,2,4.5,2.7,5.2l3.1,3.2c0.1,0.1,0.1,0.2,0,0.3c0,0.1-0.1,0.1-0.2,0.1L3.5,9C3.4,9,3.4,9,3.3,8.9L1.2,6.8c0,0,0,0,0,0 C-0.4,5.2-0.4,2.7,1.2,1.1L1.2,1.1z M14.3,6h-2.6c0,0,0,0,0,0c-0.1,0-0.2-0.1-0.2-0.2c0-0.1,0-0.2,0.1-0.3l2.5-0.7 c0.1,0,0.1,0,0.2,0c0.1,0,0.1,0.1,0.1,0.2l0.1,0.8c0,0.1,0,0.1-0.1,0.2C14.5,6,14.4,6,14.3,6L14.3,6z M10.2,4.1 c0,0.1-0.1,0.2-0.2,0.2l0,0c0,0,0,0,0,0C9.8,4.2,9.7,4.1,9.8,4L9.7,1.4c0-0.1,0-0.1,0.1-0.2c0.1,0,0.1,0,0.2,0h0.8 c0.1,0,0.1,0,0.2,0.1c0,0.1,0,0.1,0,0.2L10.2,4.1L10.2,4.1z M1.5,9.7h1.3h1.3c0.1,0,0.2,0.1,0.2,0.2c0,0.1,0,0.2-0.1,0.3l-2.5,0.6 H1.6c0,0-0.1,0-0.1,0c-0.1,0-0.1-0.1-0.1-0.2L1.2,9.9c0-0.1,0-0.1,0.1-0.2c0-0.1,0.1-0.1,0.2-0.1L1.5,9.7z M5.6,11.6 C5.6,11.6,5.6,11.6,5.6,11.6c0-0.1,0.1-0.2,0.3-0.1c0,0,0,0,0,0c0.1,0,0.2,0.1,0.2,0.2v2.6c0,0.1,0,0.1-0.1,0.2 c0,0-0.1,0.1-0.2,0.1L5,14.5c-0.1,0-0.1,0-0.2-0.1c0-0.1,0-0.1,0-0.2L5.6,11.6L5.6,11.6z"/></g></svg>',unlink:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.7 15.7" xml:space="preserve"><g><path d="M14.6,14.6c1.6-1.6,1.6-4.1,0-5.7l0,0l-3.1-3.1l-1.2,1.6l2.9,2.9c0.4,0.4,0.6,0.9,0.6,1.5c0,1.1-0.9,2.1-2.1,2.1l0,0 c-0.6,0-1.1-0.2-1.5-0.6l-0.4-0.4l-1.7,1l0.8,0.8C10.4,16.2,13,16.2,14.6,14.6L14.6,14.6L14.6,14.6z M3.6,6C3,5.9,2.6,5.5,2.3,5 S1.9,4,2.1,3.4C2.3,2.9,2.6,2.5,3,2.2C3.5,2,4.1,1.9,4.6,2l3.3,1.4l0.5-2L5.1,0.1C4-0.1,2.9,0,2,0.5C1.1,1.1,0.4,1.9,0.2,3 C-0.1,4,0,5.1,0.6,6C1.1,6.9,1.9,7.6,3,7.8l5.4,2l0.5-2L6.2,6.9L3.6,6z"/></g></svg>'},redo:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.59 14.18"><g><path d="M11.58,18.48a6.84,6.84,0,1,1,6.85-6.85s0,.26,0,.67a8,8,0,0,1-.22,1.44l.91-.55a.51.51,0,0,1,.36,0,.45.45,0,0,1,.29.22.47.47,0,0,1,.06.36.45.45,0,0,1-.22.29L17.42,15.3l-.12,0h-.25l-.12-.06-.09-.09-.06-.07,0-.06-.87-2.12a.43.43,0,0,1,0-.37.49.49,0,0,1,.27-.26.41.41,0,0,1,.36,0,.53.53,0,0,1,.27.26l.44,1.09a6.51,6.51,0,0,0,.24-1.36,4.58,4.58,0,0,0,0-.64,5.83,5.83,0,0,0-1.73-4.17,5.88,5.88,0,0,0-8.34,0,5.9,5.9,0,0,0,4.17,10.06.51.51,0,0,1,.33.15.48.48,0,0,1,0,.68.53.53,0,0,1-.33.12Z" transform="translate(-4.48 -4.54)"/></g></svg>',undo:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.59 14.18"><g><path d="M5,14a.43.43,0,0,1-.22-.29.46.46,0,0,1,.06-.36.43.43,0,0,1,.29-.22.56.56,0,0,1,.36,0l.91.55a8.27,8.27,0,0,1-.22-1.45,5.07,5.07,0,0,1,0-.67A6.85,6.85,0,1,1,13,18.47a.44.44,0,0,1-.33-.13.48.48,0,0,1,0-.68.51.51,0,0,1,.33-.15A5.89,5.89,0,0,0,17.15,7.45a5.88,5.88,0,0,0-8.33,0,5.84,5.84,0,0,0-1.73,4.17s0,.25,0,.65a6.49,6.49,0,0,0,.24,1.37l.44-1.09a.57.57,0,0,1,.27-.26.41.41,0,0,1,.36,0,.53.53,0,0,1,.27.26.43.43,0,0,1,0,.37L7.82,15l0,.09-.09.09-.1.07-.06,0H7.28l-.13,0-1.09-.63c-.65-.36-1-.57-1.1-.63Z" transform="translate(-4.49 -4.53)"/></g></svg>',bold:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 11.76 15.75"><g><path d="M6.4,3.76V19.5h6.76a5.55,5.55,0,0,0,2-.32,4.93,4.93,0,0,0,1.52-1,4.27,4.27,0,0,0,1.48-3.34,3.87,3.87,0,0,0-.69-2.37,5.74,5.74,0,0,0-.71-.83,3.44,3.44,0,0,0-1.1-.65,3.6,3.6,0,0,0,1.58-1.36,3.66,3.66,0,0,0,.53-1.93,3.7,3.7,0,0,0-1.21-2.87,4.65,4.65,0,0,0-3.25-1.1H6.4Zm2.46,6.65V5.57h3.52a4.91,4.91,0,0,1,1.36.15,2.3,2.3,0,0,1,.85.45,2.06,2.06,0,0,1,.74,1.71,2.3,2.3,0,0,1-.78,1.92,2.54,2.54,0,0,1-.86.46,4.7,4.7,0,0,1-1.32.15H8.86Zm0,7.27V12.15H12.7a4.56,4.56,0,0,1,1.38.17,3.43,3.43,0,0,1,.95.49,2.29,2.29,0,0,1,.92,2,2.73,2.73,0,0,1-.83,2.1,2.66,2.66,0,0,1-.83.58,3.25,3.25,0,0,1-1.26.2H8.86Z" transform="translate(-6.4 -3.75)"/></g></svg>',underline:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 9.78 15.74"><g><path d="M14.64,3.76h2.52v7.72a4.51,4.51,0,0,1-.59,2.31,3.76,3.76,0,0,1-1.71,1.53,6.12,6.12,0,0,1-2.64.53,5,5,0,0,1-3.57-1.18,4.17,4.17,0,0,1-1.27-3.24V3.76H9.9v7.3a3,3,0,0,0,.55,2,2.3,2.3,0,0,0,1.83.65,2.26,2.26,0,0,0,1.8-.65,3.09,3.09,0,0,0,.55-2V3.76Zm2.52,13.31V19.5H7.39V17.08h9.77Z" transform="translate(-7.38 -3.76)"/></g></svg>',italic:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10.49 15.76"><g><path d="M17.16,3.79l.37,0-.06.38-.14.52A10,10,0,0,1,16.21,5a9.37,9.37,0,0,0-1,.32,6.68,6.68,0,0,0-.25.89c-.06.31-.11.59-.14.85-.3,1.36-.52,2.41-.68,3.14l-.61,3.18L13.1,15l-.43,2.4-.12.46a.62.62,0,0,0,0,.28c.44.1.85.17,1.23.22l.68.11a4.51,4.51,0,0,1-.08.6l-.09.42a.92.92,0,0,0-.23,0l-.43,0a1.37,1.37,0,0,1-.29,0c-.13,0-.63-.08-1.49-.16l-2,0c-.28,0-.87,0-1.78.12L7,19.5l.17-.88.8-.2A6.61,6.61,0,0,0,9.19,18,2.62,2.62,0,0,0,9.61,17l.28-1.41.58-2.75.12-.66c.05-.3.11-.58.17-.86s.12-.51.17-.69l.12-.48.12-.43.31-1.6.15-.65.31-1.91V5.14a3.86,3.86,0,0,0-1.48-.29l-.38,0,.2-1.06,3.24.14.75,0c.45,0,1.18,0,2.18-.09.23,0,.46,0,.71,0Z" transform="translate(-7.04 -3.76)"/></g></svg>',strike:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.74 14.9"><g><path d="M12.94,13a4.27,4.27,0,0,1,1.32.58,1.46,1.46,0,0,1,.55,1.2,1.87,1.87,0,0,1-.88,1.64,4.17,4.17,0,0,1-2.35.59,4.44,4.44,0,0,1-2.74-.71,2.72,2.72,0,0,1-1-2.17H5.57a4.56,4.56,0,0,0,1.55,3.7,7,7,0,0,0,4.47,1.23,6,6,0,0,0,4.07-1.3,4.24,4.24,0,0,0,1.52-3.37,4,4,0,0,0-.26-1.4h-4ZM6.37,10.24A3.27,3.27,0,0,1,6,8.68a4,4,0,0,1,1.48-3.3,5.92,5.92,0,0,1,3.88-1.21,5.58,5.58,0,0,1,3.91,1.24,4.36,4.36,0,0,1,1.45,3.17H14.44a2.12,2.12,0,0,0-.91-1.81,4.45,4.45,0,0,0-2.44-.55,3.69,3.69,0,0,0-2,.51A1.64,1.64,0,0,0,8.3,8.22a1.3,1.3,0,0,0,.48,1.11,7,7,0,0,0,2.1.78l.28.06.28.08H6.37Zm13.09.68a.73.73,0,0,1,.49.21.66.66,0,0,1,.2.48.64.64,0,0,1-.2.48.71.71,0,0,1-.49.19H5.1a.67.67,0,0,1-.49-.19.66.66,0,0,1-.2-.48.64.64,0,0,1,.2-.48.73.73,0,0,1,.49-.21H19.46Z" transform="translate(-4.41 -4.17)"/></g></svg>',subscript:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.75 14.61"><g><path d="M15.38,4.33H12.74L11.19,7c-.28.46-.51.87-.69,1.21L10.07,9h0l-.44-.8c-.22-.4-.45-.81-.71-1.23L7.34,4.33H4.68L8.26,10,4.4,16.08H7.1l1.69-2.83c.38-.63.72-1.22,1-1.78l.25-.46h0l.49.92c.24.45.48.89.74,1.32L13,16.08h2.61L11.84,10l1.77-2.84,1.77-2.85Zm4.77,13.75H17v-.15c0-.4.05-.64.16-.72a4.42,4.42,0,0,1,1.16-.31,3.3,3.3,0,0,0,1.54-.56A1.84,1.84,0,0,0,20.15,15a1.78,1.78,0,0,0-.44-1.41A2.8,2.8,0,0,0,18,13.25a2.71,2.71,0,0,0-1.69.37,1.83,1.83,0,0,0-.44,1.43v.23H17v-.23q0-.63.18-.78a1.62,1.62,0,0,1,.88-.15,1.59,1.59,0,0,1,.88.15q.18.15.18.75t-.18.75a3.58,3.58,0,0,1-1.18.33,3.33,3.33,0,0,0-1.52.51,1.57,1.57,0,0,0-.32,1.18v1.15h4.27v-.86Z" transform="translate(-4.4 -4.33)"/></g></svg>',superscript:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.75 15.42"><g><path d="M12,13.14l3.61-5.81H12.94L11.33,10c-.28.46-.51.88-.69,1.25l-.45.83h0l-.45-.85c-.22-.41-.45-.82-.71-1.24L7.4,7.33H4.68l3.66,5.81L4.4,19.33H7.14l1.74-2.87q.58-1,1-1.83l.25-.48h0l.51.94.75,1.37,1.72,2.87h2.67l-1.92-3.09c-1.12-1.8-1.76-2.83-1.92-3.1Zm4.84-4.41h0l0,.15h3.27v.86H15.77V8.58a1.66,1.66,0,0,1,.33-1.22,3.51,3.51,0,0,1,1.56-.51,3.68,3.68,0,0,0,1.21-.34c.13-.1.19-.36.19-.77S19,5.07,18.87,5A1.63,1.63,0,0,0,18,4.8a1.58,1.58,0,0,0-.91.17c-.13.11-.19.38-.19.8V6H15.78V5.76a1.87,1.87,0,0,1,.45-1.47A2.84,2.84,0,0,1,18,3.91a2.8,2.8,0,0,1,1.72.38,1.84,1.84,0,0,1,.45,1.44,1.91,1.91,0,0,1-.34,1.35,3.24,3.24,0,0,1-1.58.57A3.69,3.69,0,0,0,17,8c-.12.1-.17.35-.17.76Z" transform="translate(-4.4 -3.91)"/></g></svg>',erase:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.74 13.76"><g><path d="M13.69,17.2h6.46v1.31H8.56L4.41,14.37,14,4.75l6.06,6.06L16.89,14l-3.2,3.19Zm-4.61,0h2.77L14.09,15,9.88,10.75,6.25,14.38l1.41,1.41c.84.82,1.31,1.29,1.42,1.41Z" transform="translate(-4.41 -4.75)"/></g></svg>',indent:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.74 12.36"><g><path d="M4.68,14.45a.27.27,0,0,1-.19-.08.3.3,0,0,1-.08-.21V9.1a.27.27,0,0,1,.08-.19.28.28,0,0,1,.2-.08.25.25,0,0,1,.19.07l2.54,2.54a.29.29,0,0,1,0,.4L4.88,14.36a.24.24,0,0,1-.2.09Zm15.19,1.12a.27.27,0,0,1,.19.08.25.25,0,0,1,.08.19v1.69a.27.27,0,0,1-.08.19.25.25,0,0,1-.19.08H4.68a.27.27,0,0,1-.19-.08.25.25,0,0,1-.08-.19V15.84a.27.27,0,0,1,.27-.27H19.87Zm0-3.38a.27.27,0,0,1,.19.08.28.28,0,0,1,.08.21v1.68a.32.32,0,0,1-.08.21.25.25,0,0,1-.19.08H10.31a.27.27,0,0,1-.19-.08.3.3,0,0,1-.08-.21V12.48a.32.32,0,0,1,.08-.21.24.24,0,0,1,.19-.08h9.56Zm0-3.37a.27.27,0,0,1,.19.08.25.25,0,0,1,.08.19v1.69a.27.27,0,0,1-.08.19.25.25,0,0,1-.19.08H10.31a.27.27,0,0,1-.27-.27V9.1a.27.27,0,0,1,.27-.27h9.56Zm.2-3.29a.28.28,0,0,1,.08.2V7.41a.32.32,0,0,1-.08.21.25.25,0,0,1-.19.08H4.68a.27.27,0,0,1-.19-.08.3.3,0,0,1-.08-.21V5.73a.32.32,0,0,1,.08-.21.25.25,0,0,1,.19-.08H19.87a.28.28,0,0,1,.2.09Z" transform="translate(-4.41 -5.44)"/></g></svg>',outdent:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.74 12.36"><g><path d="M19.87,15.57a.27.27,0,0,1,.19.08.25.25,0,0,1,.08.19v1.69a.27.27,0,0,1-.08.19.25.25,0,0,1-.19.08H4.68a.27.27,0,0,1-.19-.08.25.25,0,0,1-.08-.19V15.84a.27.27,0,0,1,.27-.27H19.87ZM7.5,14.45a.25.25,0,0,1-.2-.09L4.76,11.84a.29.29,0,0,1,0-.4L7.3,8.9a.29.29,0,0,1,.4,0,.31.31,0,0,1,.07.2v5.06a.32.32,0,0,1-.08.21.26.26,0,0,1-.19.08ZM19.87,8.82a.27.27,0,0,1,.19.08.25.25,0,0,1,.08.19v1.69a.27.27,0,0,1-.08.19.25.25,0,0,1-.19.08H10.31a.27.27,0,0,1-.27-.27V9.1a.27.27,0,0,1,.27-.27h9.56Zm0,3.37a.27.27,0,0,1,.19.08.28.28,0,0,1,.08.21v1.68a.32.32,0,0,1-.08.21.25.25,0,0,1-.19.08H10.31a.27.27,0,0,1-.19-.08.3.3,0,0,1-.08-.21V12.48a.32.32,0,0,1,.08-.21.24.24,0,0,1,.19-.08h9.56Zm.2-6.66a.28.28,0,0,1,.08.2V7.41a.32.32,0,0,1-.08.21.25.25,0,0,1-.19.08H4.68a.27.27,0,0,1-.19-.08.3.3,0,0,1-.08-.21V5.73a.32.32,0,0,1,.08-.21.25.25,0,0,1,.19-.08H19.87a.28.28,0,0,1,.2.09Z" transform="translate(-4.41 -5.44)"/></g></svg>',expansion:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.74 15.74"><g><path d="M11.8,13.06l-5.1,5.1H9.51V19.5H4.41V14.4H5.75v2.81L8.3,14.66q2.25-2.23,2.55-2.55Zm8.35-9.3v5.1H18.81V6.05l-5.1,5.1-1-1,5.1-5.1H15.05V3.76Z" transform="translate(-4.41 -3.76)"/></g></svg>',reduction:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.74 15.74"><g><path d="M14.91,10h2.87v1.38H12.55V6.12h1.38V9l5.24-5.24.48.49.49.48ZM6.77,11.92H12v5.23H10.62V14.26L5.37,19.5l-1-1L9.63,13.3H6.77Z" transform="translate(-4.4 -3.76)"/></g></svg>',code_view:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.73 11.8"><g><path d="M8.09,7.94a.76.76,0,0,1,.53.22.72.72,0,0,1,.21.52.76.76,0,0,1-.22.54L6.18,11.63l2.43,2.44a.69.69,0,0,1,.2.51.66.66,0,0,1-.21.51.75.75,0,0,1-.51.22.63.63,0,0,1-.51-.21h0L4.63,12.15a.7.7,0,0,1-.22-.53.67.67,0,0,1,.25-.55L7.57,8.16a.82.82,0,0,1,.52-.22Zm12.05,3.69a.7.7,0,0,1-.23.52L17,15.1h0a.66.66,0,0,1-.51.21.73.73,0,0,1-.51-.22.75.75,0,0,1-.22-.51.63.63,0,0,1,.21-.51l2.43-2.44L15.92,9.22a.73.73,0,0,1-.22-.53A.74.74,0,0,1,17,8.18h0l2.91,2.91a.67.67,0,0,1,.27.54Zm-5.9-5.9a.73.73,0,0,1,.61.32.71.71,0,0,1,.07.68L11,17a1,1,0,0,1-.22.32.6.6,0,0,1-.35.16.75.75,0,0,1-.69-.26.69.69,0,0,1-.12-.72L13.56,6.23a.75.75,0,0,1,.26-.35.74.74,0,0,1,.42-.15Z" transform="translate(-4.41 -5.73)"/></g></svg>',preview:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.65 15.66"><g><path d="M16.19,14.43l2.49,2.49a.73.73,0,0,1,.21.52.67.67,0,0,1-.22.51.7.7,0,0,1-.52.22.69.69,0,0,1-.51-.21l-2.49-2.48a5.17,5.17,0,0,1-1.34.69,4.64,4.64,0,0,1-1.48.24,4.78,4.78,0,1,1,0-9.56,4.79,4.79,0,0,1,1.84.36,4.9,4.9,0,0,1,1.56,1,4.77,4.77,0,0,1,.46,6.18ZM10,14a3.3,3.3,0,0,0,2.34.93A3.37,3.37,0,0,0,14.7,14a3.3,3.3,0,0,0-1.08-5.41,3.47,3.47,0,0,0-2.56,0A3,3,0,0,0,10,9.28,3.31,3.31,0,0,0,10,14ZM16,4a3.86,3.86,0,0,1,2.77,1.14A3.9,3.9,0,0,1,20,7.85v4a.77.77,0,0,1-.22.53.7.7,0,0,1-.52.21.72.72,0,0,1-.74-.74v-4a2.46,2.46,0,0,0-.72-1.73A2.37,2.37,0,0,0,16,5.45H8.53A2.42,2.42,0,0,0,6.08,7.89v7.52a2.41,2.41,0,0,0,.71,1.73,2.46,2.46,0,0,0,1.74.72h4.08a.73.73,0,0,1,0,1.46H8.53a3.85,3.85,0,0,1-2.78-1.14A3.93,3.93,0,0,1,4.6,15.4V7.87A3.94,3.94,0,0,1,5.76,5.09,3.88,3.88,0,0,1,8.54,4H16Z" transform="translate(-4.45 -3.8)"/></g></svg>',print:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16.05 16.04"><g><path d="M19.76,15.84a1.29,1.29,0,0,0,.39-.92V8.35A2.05,2.05,0,0,0,19.57,7a1.93,1.93,0,0,0-1.38-.57H6.37a1.95,1.95,0,0,0-2,2v6.56a1.23,1.23,0,0,0,.38.92,1.35,1.35,0,0,0,.93.38h2V14.9l-2,0V8.35a.67.67,0,0,1,.18-.47.62.62,0,0,1,.48-.19H18.18a.6.6,0,0,1,.46.19.66.66,0,0,1,.18.47V14.9h-2v1.32h2A1.35,1.35,0,0,0,19.76,15.84ZM17.52,7.69V5.06a1.31,1.31,0,0,0-.38-.92,1.34,1.34,0,0,0-.94-.38H8.34A1.3,1.3,0,0,0,7,5.06V7.69H8.34V5.06h7.87V7.69h1.31ZM8.34,12.93h7.87l0,5.26H8.34V12.93Zm7.87,5.26v0Zm.65,1.31a.6.6,0,0,0,.46-.19.72.72,0,0,0,.2-.47V12.29a.74.74,0,0,0-.2-.47.6.6,0,0,0-.46-.19H7.68a.6.6,0,0,0-.46.19.72.72,0,0,0-.2.47v6.55a.74.74,0,0,0,.2.47.6.6,0,0,0,.46.19h9.18ZM16.67,9.28a.7.7,0,0,0-.94,0,.63.63,0,0,0-.18.46.67.67,0,0,0,.18.47.68.68,0,0,0,.94,0,.66.66,0,0,0,.18-.47A.58.58,0,0,0,16.67,9.28Z" transform="translate(-4.25 -3.61)"/></g></svg>',template:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.27 15.64"><g><path d="M18.18,19.16a1,1,0,0,0,1-1V5.73a1,1,0,0,0-1-1h-2v1h2V18.19H6.37V5.73h2v-1h-2A.94.94,0,0,0,5.68,5a1,1,0,0,0-.29.7V18.18a.94.94,0,0,0,.29.69,1,1,0,0,0,.69.29H18.18ZM9.82,10.31h4.92a.49.49,0,0,0,.35-.15.47.47,0,0,0,.15-.35.49.49,0,0,0-.15-.35.47.47,0,0,0-.35-.15H9.82a.49.49,0,0,0-.35.15.47.47,0,0,0-.15.35.49.49,0,0,0,.15.35.47.47,0,0,0,.35.15Zm5.9,4.92H8.83a.49.49,0,0,0-.35.15.47.47,0,0,0-.15.35.49.49,0,0,0,.15.35.47.47,0,0,0,.35.15h6.89a.49.49,0,0,0,.35-.15.47.47,0,0,0,.15-.35.51.51,0,0,0-.5-.5ZM7.36,12.77a.49.49,0,0,0,.15.35.47.47,0,0,0,.35.15h8.85a.49.49,0,0,0,.35-.15.47.47,0,0,0,.15-.35.49.49,0,0,0-.15-.35.47.47,0,0,0-.35-.15H7.85a.49.49,0,0,0-.35.15.52.52,0,0,0-.14.35Z" transform="translate(-5.14 -3.77)"/><path d="M14.24,6.71a1,1,0,0,0,1-1,1,1,0,0,0-1-1,1,1,0,0,0-1-1h-2a.94.94,0,0,0-.69.28,1,1,0,0,0-.29.7A.94.94,0,0,0,9.62,5a.91.91,0,0,0-.29.69,1,1,0,0,0,.29.7,1,1,0,0,0,.69.29h3.93Z" transform="translate(-5.14 -3.77)"/></g></svg>',line_height:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.76 13.56"><g><path d="M4.4,4.88V8.26a2,2,0,0,0,.5.39s.1,0,.18-.12a.62.62,0,0,0,.17-.28c.06-.19.13-.44.21-.74s.14-.52.19-.66a.58.58,0,0,1,.21-.3,2.41,2.41,0,0,1,.63-.21,3.83,3.83,0,0,1,.88-.12,9.15,9.15,0,0,1,1.31.06.16.16,0,0,1,.11,0,.26.26,0,0,1,.06.14,4,4,0,0,1,0,.49v2l.05,3.77c0,1.41,0,2.68-.05,3.81a1.79,1.79,0,0,1-.11.49,10.68,10.68,0,0,1-1.4.45,1.12,1.12,0,0,0-.69.43v.31l0,.22.61,0c.85-.08,1.54-.12,2.06-.12a19.76,19.76,0,0,1,2.09.08,15.08,15.08,0,0,0,1.64.08,1.4,1.4,0,0,0,.29,0,1.58,1.58,0,0,0,0-.26l-.05-.43a2.26,2.26,0,0,0-.43-.17l-.77-.22-.15,0a2.55,2.55,0,0,1-.78-.28,2.56,2.56,0,0,1-.11-.75l0-1.29,0-3.15V7.53a10.51,10.51,0,0,1,.06-1.2,3.83,3.83,0,0,1,.6,0l1.88,0a2.18,2.18,0,0,1,.38,0,.45.45,0,0,1,.23.17.9.9,0,0,1,.05.25c0,.16.06.35.1.58a3.33,3.33,0,0,0,.14.55A6.39,6.39,0,0,0,15,9a2.91,2.91,0,0,0,.6-.15,2.77,2.77,0,0,0,0-.46l0-.51,0-2.95-.25,0-.38,0L15,4.94a.71.71,0,0,1-.18.15.45.45,0,0,1-.25.07l-.29,0H8.75l-.15,0H7.45a17,17,0,0,1-1.86,0L5.36,5l-.25-.13ZM19.75,16.14h-.69v-9h.69A.4.4,0,0,0,20.13,7c.06-.11,0-.24-.1-.39L18.92,5.15a.52.52,0,0,0-.86,0L17,6.58c-.12.15-.16.28-.1.39s.18.16.38.16h.69v9h-.69a.4.4,0,0,0-.38.16c-.06.11,0,.24.1.39l1.11,1.43a.52.52,0,0,0,.86,0L20,16.69c.12-.15.16-.28.1-.39a.4.4,0,0,0-.38-.16Z" transform="translate(-4.4 -4.86)"/></g></svg>',paragraph_style:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 11.81 15.74"><g><path d="M18.18,3.76v2h-2V19.5h-2V5.73h-2V19.5h-2V11.63a3.94,3.94,0,0,1,0-7.87h7.87Z" transform="translate(-6.37 -3.76)"/></g></svg>',text_style:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 13.76 15.74"><g><path d="M17.68,6.71a2.22,2.22,0,0,0,1.06-.22.74.74,0,0,0,.42-.7.73.73,0,0,0-.08-.33.67.67,0,0,0-.17-.22,1,1,0,0,0-.31-.15L18.26,5l-.45-.09A15.27,15.27,0,0,0,13.26,5V4.74c0-.66-.63-1-1.92-1-.24,0-.43.15-.59.46a4,4,0,0,0-.36,1.14h0v0a26.45,26.45,0,0,1-3.5.35A2,2,0,0,0,5.77,6a.84.84,0,0,0-.37.79,2.14,2.14,0,0,0,.41,1.29,1.23,1.23,0,0,0,1.05.63,16.62,16.62,0,0,0,3.29-.45l-.34,3.35c-.16,1.61-.29,2.9-.37,3.86s-.12,1.66-.12,2.09l0,.65a5.15,5.15,0,0,0,.05.6,1.28,1.28,0,0,0,.16.54.34.34,0,0,0,.28.18,1.16,1.16,0,0,0,.79-.46,3.66,3.66,0,0,0,.68-1,22.08,22.08,0,0,0,1-4.33q.49-3.1.78-6.15a24.69,24.69,0,0,1,4.62-.84Z" transform="translate(-5.4 -3.76)"/></g></svg>',save:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.74 15.74"><g><path d="M18.53,19.5l.2-.05A1.78,1.78,0,0,0,20.13,18l0-.09V7.14a2,2,0,0,0-.28-.64A3.18,3.18,0,0,0,19.43,6c-.5-.52-1-1-1.55-1.54A2.59,2.59,0,0,0,17.37,4a1.83,1.83,0,0,0-.61-.25H6l-.21,0a1.78,1.78,0,0,0-1.4,1.49l0,.1V17.87a2.49,2.49,0,0,0,.09.37,1.79,1.79,0,0,0,1.44,1.23l.09,0Zm-6.25-.6H6.92a.61.61,0,0,1-.68-.48.78.78,0,0,1,0-.22V12.3a.62.62,0,0,1,.69-.68H17.64a.62.62,0,0,1,.69.69V18.2a.64.64,0,0,1-.71.69H12.28ZM12,9.81H8.15a.63.63,0,0,1-.72-.71v-4a.64.64,0,0,1,.72-.72h7.66a.64.64,0,0,1,.72.72v4a.65.65,0,0,1-.74.72ZM13.5,5V9.18h1.78V5Z" transform="translate(-4.41 -3.76)"/></g></svg>',blockquote:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 475.082 475.081"><g><path d="M164.45,219.27h-63.954c-7.614,0-14.087-2.664-19.417-7.994c-5.327-5.33-7.994-11.801-7.994-19.417v-9.132c0-20.177,7.139-37.401,21.416-51.678c14.276-14.272,31.503-21.411,51.678-21.411h18.271c4.948,0,9.229-1.809,12.847-5.424c3.616-3.617,5.424-7.898,5.424-12.847V54.819c0-4.948-1.809-9.233-5.424-12.85c-3.617-3.612-7.898-5.424-12.847-5.424h-18.271c-19.797,0-38.684,3.858-56.673,11.563c-17.987,7.71-33.545,18.132-46.68,31.267c-13.134,13.129-23.553,28.688-31.262,46.677C3.855,144.039,0,162.931,0,182.726v200.991c0,15.235,5.327,28.171,15.986,38.834c10.66,10.657,23.606,15.985,38.832,15.985h109.639c15.225,0,28.167-5.328,38.828-15.985c10.657-10.663,15.987-23.599,15.987-38.834V274.088c0-15.232-5.33-28.168-15.994-38.832C192.622,224.6,179.675,219.27,164.45,219.27z"/><path d="M459.103,235.256c-10.656-10.656-23.599-15.986-38.828-15.986h-63.953c-7.61,0-14.089-2.664-19.41-7.994c-5.332-5.33-7.994-11.801-7.994-19.417v-9.132c0-20.177,7.139-37.401,21.409-51.678c14.271-14.272,31.497-21.411,51.682-21.411h18.267c4.949,0,9.233-1.809,12.848-5.424c3.613-3.617,5.428-7.898,5.428-12.847V54.819c0-4.948-1.814-9.233-5.428-12.85c-3.614-3.612-7.898-5.424-12.848-5.424h-18.267c-19.808,0-38.691,3.858-56.685,11.563c-17.984,7.71-33.537,18.132-46.672,31.267c-13.135,13.129-23.559,28.688-31.265,46.677c-7.707,17.987-11.567,36.879-11.567,56.674v200.991c0,15.235,5.332,28.171,15.988,38.834c10.657,10.657,23.6,15.985,38.828,15.985h109.633c15.229,0,28.171-5.328,38.827-15.985c10.664-10.663,15.985-23.599,15.985-38.834V274.088C475.082,258.855,469.76,245.92,459.103,235.256z"/></g></svg>',arrow_down:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.73 8.67"><g><path d="M18.79,7.52a.8.8,0,0,1,.56-.23.82.82,0,0,1,.79.79.8.8,0,0,1-.23.56l-7.07,7.07a.79.79,0,0,1-.57.25.77.77,0,0,1-.57-.25h0L4.64,8.65a.8.8,0,0,1-.23-.57.82.82,0,0,1,.79-.79.8.8,0,0,1,.56.23L12.28,14l3.26-3.26,3.25-3.26Z" transform="translate(-4.41 -7.29)"/></g></svg>',align_justify:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.74 13.77"><g><path d="M4.41,4.74v2H20.15v-2H4.41Zm0,5.9H20.15v-2H4.41v2Zm0,3.94H20.15v-2H4.41v2Zm0,3.93h7.87v-2H4.41v2Z" transform="translate(-4.41 -4.74)"/></g></svg>',align_left:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.74 13.77"><g><path d="M4.41,4.74v2H20.15v-2H4.41Zm11.8,3.94H4.41v2H16.22v-2Zm-11.8,5.9H18.18v-2H4.41v2Zm0,3.93h9.84v-2H4.41v2Z" transform="translate(-4.41 -4.74)"/></g></svg>',align_right:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.74 13.77"><g><path d="M4.41,4.74v2H20.15v-2H4.41Zm3.93,5.9H20.15v-2H8.34v2Zm-2,3.94H20.14v-2H6.37v2Zm3.94,3.93h9.84v-2H10.31v2Z" transform="translate(-4.41 -4.74)"/></g></svg>',align_center:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.74 13.77"><g><path d="M4.41,4.74v2H20.15v-2H4.41Zm2,3.94v2H18.18v-2H6.37Zm-1,5.9H19.16v-2H5.39v2Zm2,3.93H17.2v-2H7.36v2Z" transform="translate(-4.41 -4.74)"/></g></svg>',font_color:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.74 14.61"><g><path d="M18.5,15.57,14.28,4.32h-3.4L6.65,15.57h3l.8-2.26h4.23l.8,2.26h3ZM14,11.07H11.14L12.54,7,13.25,9c.41,1.18.64,1.86.7,2ZM4.41,16.69v2.24H20.15V16.69H4.41Z" transform="translate(-4.41 -4.32)"/></g></svg>',highlight_color:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.66 15.74"><g><path d="M12.32,9.31,13.38,13H11.21l.52-1.83q.46-1.61.54-1.83ZM4.44,3.76H20.1V19.5H4.44V3.76ZM14.71,17.32h2.63L13.7,6H10.89L7.26,17.32H9.89l.63-2.24h3.55l.32,1.12c.18.65.29,1,.32,1.12Z" transform="translate(-4.44 -3.76)"/></g></svg>',list_bullets:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.74 12.37"><g><path d="M7.77,16.12a1.59,1.59,0,0,0-.49-1.18,1.62,1.62,0,0,0-1.19-.49,1.68,1.68,0,1,0,0,3.36,1.67,1.67,0,0,0,1.68-1.69Zm0-4.48A1.67,1.67,0,0,0,6.09,10,1.68,1.68,0,0,0,4.9,12.82a1.62,1.62,0,0,0,1.19.49,1.67,1.67,0,0,0,1.68-1.67Zm12.38,3.64a.27.27,0,0,0-.08-.19.28.28,0,0,0-.2-.09H9.19a.28.28,0,0,0-.2.08.29.29,0,0,0-.08.19V17a.27.27,0,0,0,.28.28H19.87a.27.27,0,0,0,.19-.08.24.24,0,0,0,.08-.2V15.28ZM7.77,7.13a1.63,1.63,0,0,0-.49-1.2,1.61,1.61,0,0,0-1.19-.49,1.61,1.61,0,0,0-1.19.49,1.71,1.71,0,0,0,0,2.4,1.62,1.62,0,0,0,1.19.49,1.61,1.61,0,0,0,1.19-.49,1.63,1.63,0,0,0,.49-1.2Zm12.38,3.66a.28.28,0,0,0-.08-.2.29.29,0,0,0-.19-.08H9.19a.27.27,0,0,0-.28.28v1.69a.27.27,0,0,0,.08.19.24.24,0,0,0,.2.08H19.87a.27.27,0,0,0,.19-.08.25.25,0,0,0,.08-.19V10.79Zm0-4.5a.27.27,0,0,0-.08-.19A.25.25,0,0,0,19.88,6H9.19A.28.28,0,0,0,9,6.1a.26.26,0,0,0-.08.19V8A.27.27,0,0,0,9,8.17a.24.24,0,0,0,.2.08H19.87a.27.27,0,0,0,.19-.08A.25.25,0,0,0,20.14,8V6.29Z" transform="translate(-4.41 -5.44)"/></g></svg>',list_number:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.69 15.74"><g><path d="M7.66,18a1.24,1.24,0,0,0-.26-.78,1.17,1.17,0,0,0-.72-.42l.85-1V15H4.58v1.34h.94v-.46l.85,0h0c-.11.11-.22.23-.32.35s-.23.27-.37.47L5.39,17l.23.51c.61-.05.92.11.92.49a.42.42,0,0,1-.18.37.79.79,0,0,1-.45.12A1.41,1.41,0,0,1,5,18.15l-.51.77A2.06,2.06,0,0,0,6,19.5a1.8,1.8,0,0,0,1.2-.41A1.38,1.38,0,0,0,7.66,18Zm0-5.54H6.75V13H5.63A.72.72,0,0,1,6,12.51a5.45,5.45,0,0,1,.66-.45,2.71,2.71,0,0,0,.67-.57,1.19,1.19,0,0,0,.31-.81,1.29,1.29,0,0,0-.45-1,1.86,1.86,0,0,0-2-.11,1.51,1.51,0,0,0-.62.7l.74.52A.87.87,0,0,1,6,10.28a.51.51,0,0,1,.35.12.42.42,0,0,1,.13.33.55.55,0,0,1-.21.4,3,3,0,0,1-.5.38c-.19.13-.39.27-.58.42a2,2,0,0,0-.5.6,1.63,1.63,0,0,0-.21.81,3.89,3.89,0,0,0,.05.48h3.2V12.44Zm12.45,2.82a.27.27,0,0,0-.08-.19.28.28,0,0,0-.21-.08H9.1a.32.32,0,0,0-.21.08.24.24,0,0,0-.08.2V17a.27.27,0,0,0,.08.19.3.3,0,0,0,.21.08H19.83a.32.32,0,0,0,.21-.08.25.25,0,0,0,.08-.19V15.26ZM7.69,7.32h-1V3.76H5.8L4.6,4.88l.63.68a1.85,1.85,0,0,0,.43-.48h0l0,2.24H4.74V8.2h3V7.32Zm12.43,3.42a.27.27,0,0,0-.08-.19.28.28,0,0,0-.21-.08H9.1a.32.32,0,0,0-.21.08.24.24,0,0,0-.08.2v1.71a.27.27,0,0,0,.08.19.3.3,0,0,0,.21.08H19.83a.32.32,0,0,0,.21-.08.25.25,0,0,0,.08-.19V10.74Zm0-4.52A.27.27,0,0,0,20,6,.28.28,0,0,0,19.83,6H9.1A.32.32,0,0,0,8.89,6a.24.24,0,0,0-.08.19V7.93a.27.27,0,0,0,.08.19.32.32,0,0,0,.21.08H19.83A.32.32,0,0,0,20,8.12a.26.26,0,0,0,.08-.2V6.22Z" transform="translate(-4.43 -3.76)"/></g></svg>',table:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.74 15.74"><g><path d="M4.41,8.05V3.76H8.7V8.05H4.41Zm5.71,0V3.76h4.3V8.05h-4.3Zm5.74-4.29h4.29V8.05H15.86V3.76Zm-11.45,10V9.48H8.7v4.3H4.41Zm5.71,0V9.48h4.3v4.3h-4.3Zm5.74,0V9.48h4.29v4.3H15.86ZM4.41,19.5V15.21H8.7V19.5H4.41Zm5.71,0V15.21h4.3V19.5h-4.3Zm5.74,0V15.21h4.29V19.5H15.86Z" transform="translate(-4.41 -3.76)"/></g></svg>',horizontal_rule:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.74 2.24"><g><path d="M20.15,12.75V10.51H4.41v2.24H20.15Z" transform="translate(-4.41 -10.51)"/></g></svg>',show_blocks:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.66 15.67"><g><path d="M19.72,5.58a1.64,1.64,0,0,0-1.64-1.64H6.23a1.62,1.62,0,0,0-1.16.48,1.63,1.63,0,0,0-.48,1.16V9.63a1.6,1.6,0,0,0,.48,1.16,1.62,1.62,0,0,0,1.16.47H18.09a1.67,1.67,0,0,0,1.16-.47,1.62,1.62,0,0,0,.48-1.16V5.58Zm-.94,4.05a.68.68,0,0,1-.7.7H6.23a.66.66,0,0,1-.48-.2.74.74,0,0,1-.21-.5V5.58a.66.66,0,0,1,.2-.48.71.71,0,0,1,.48-.21H18.08a.74.74,0,0,1,.5.21.66.66,0,0,1,.2.48ZM6.48,7.72a.21.21,0,0,0,.17-.07.22.22,0,0,0,.07-.17V7.06a1.27,1.27,0,0,1,.11-.52.37.37,0,0,1,.36-.23H8.77A.25.25,0,0,0,9,6.17a.19.19,0,0,0,0-.23.27.27,0,0,0-.2-.12H7.19a.88.88,0,0,0-.72.39,1.51,1.51,0,0,0-.23.85v.42a.24.24,0,0,0,.24.24Zm-.19.81a.21.21,0,0,0,.17-.07.26.26,0,0,0,.07-.17.24.24,0,0,0-.24-.24.2.2,0,0,0-.16.09.2.2,0,0,0-.07.16.22.22,0,0,0,.07.17.23.23,0,0,0,.16.06Zm8.46,5.1a1.63,1.63,0,0,0-.47-1.16A1.61,1.61,0,0,0,13.12,12H6.23a1.6,1.6,0,0,0-1.16.46,1.62,1.62,0,0,0-.48,1.16v4.05a1.64,1.64,0,0,0,1.64,1.64h6.89a1.6,1.6,0,0,0,1.16-.48,1.62,1.62,0,0,0,.47-1.16Zm-.94,4a.7.7,0,0,1-.2.49.65.65,0,0,1-.5.2H6.23a.66.66,0,0,1-.48-.2.75.75,0,0,1-.21-.49v-4a.74.74,0,0,1,.21-.5.66.66,0,0,1,.48-.2h6.89a.68.68,0,0,1,.7.7v4Zm6.15,0v-4a1.6,1.6,0,0,0-.48-1.16A1.67,1.67,0,0,0,18.32,12H17.1a1.63,1.63,0,0,0-1.16.47,1.61,1.61,0,0,0-.47,1.16v4a1.67,1.67,0,0,0,.47,1.16,1.62,1.62,0,0,0,1.16.48h1.22A1.64,1.64,0,0,0,20,17.68Zm-.94-4v4a.75.75,0,0,1-.21.49.62.62,0,0,1-.48.2H17.11a.69.69,0,0,1-.5-.2.7.7,0,0,1-.2-.49v-4a.68.68,0,0,1,.7-.7h1.22a.66.66,0,0,1,.48.2.72.72,0,0,1,.21.5Z" transform="translate(-4.44 -3.79)"/></g></svg>',cancel:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.74 15.74"><g><path d="M14.15,11.63l5.61,5.61a1.29,1.29,0,0,1,.38.93,1.27,1.27,0,0,1-.4.93,1.25,1.25,0,0,1-.92.4,1.31,1.31,0,0,1-.94-.4l-5.61-5.61L6.67,19.1a1.31,1.31,0,0,1-.94.4,1.24,1.24,0,0,1-.92-.4,1.27,1.27,0,0,1-.4-.93,1.33,1.33,0,0,1,.38-.93l5.61-5.63L4.79,6a1.26,1.26,0,0,1-.38-.93,1.22,1.22,0,0,1,.4-.92,1.28,1.28,0,0,1,.92-.39,1.38,1.38,0,0,1,.94.38l5.61,5.61,5.61-5.61a1.33,1.33,0,0,1,.94-.38,1.26,1.26,0,0,1,.92.39,1.24,1.24,0,0,1,.4.92,1.29,1.29,0,0,1-.39.93L17,8.81l-2.8,2.82Z" transform="translate(-4.41 -3.76)"/></g></svg>',image:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.75 15.77"><g><path d="M8.77,8.72a.88.88,0,0,1-.61-.27.82.82,0,0,1-.25-.61.89.89,0,0,1,.25-.62A.82.82,0,0,1,8.77,7a.81.81,0,0,1,.61.25.83.83,0,0,1,.27.62.81.81,0,0,1-.25.61.91.91,0,0,1-.63.27Zm9.62-5a1.74,1.74,0,0,1,1.76,1.76V17.76a1.74,1.74,0,0,1-1.76,1.76H6.16A1.74,1.74,0,0,1,4.4,17.76V5.51A1.74,1.74,0,0,1,6.16,3.75H18.39Zm0,1.75H6.16v8L8.53,11.8a.94.94,0,0,1,.54-.17.86.86,0,0,1,.54.2L11.09,13l3.64-4.55a.78.78,0,0,1,.34-.25.85.85,0,0,1,.42-.07.89.89,0,0,1,.39.12.78.78,0,0,1,.28.29l2.24,3.67V5.51Zm0,12.24V15.6L15.3,10.53,11.89,14.8a.89.89,0,0,1-.59.32.82.82,0,0,1-.64-.18L9,13.62,6.16,15.74v2Z" transform="translate(-4.4 -3.75)"/></g></svg>',video:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.74 14.55"><g><path d="M20.15,10.26V18.9l-3.94-1.57v1.2H4.41V10.66H16.22v1.23l2-.81,2-.82ZM14.64,17h0V12.54h0v-.31H6V17h8.67Zm3.94-.37v-4l-2.37,1v2l1.18.48,1.19.48ZM7.94,9.86A2.77,2.77,0,0,1,5.19,7.11a2.76,2.76,0,0,1,5.51,0A2.78,2.78,0,0,1,7.94,9.86Zm0-3.93a1.21,1.21,0,0,0-.83.35,1.15,1.15,0,0,0-.34.84A1.09,1.09,0,0,0,7.11,8,1.15,1.15,0,0,0,8,8.28,1.13,1.13,0,0,0,9.11,7.12,1.16,1.16,0,0,0,7.94,5.93Zm5.9,3.93a2.34,2.34,0,0,1-1.67-.68,2.3,2.3,0,0,1-.68-1.67,2.35,2.35,0,0,1,4-1.67,2.37,2.37,0,0,1,0,3.34,2.33,2.33,0,0,1-1.68.68Zm0-3.14a.75.75,0,1,0,.55.22.73.73,0,0,0-.55-.22Z" transform="translate(-4.41 -4.35)"/></g></svg>',link:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.74 15.72"><g><path d="M13.05,13.63a.24.24,0,0,1,.15.22L13.42,16a.19.19,0,0,1-.08.18l-2.12,2.14a4.08,4.08,0,0,1-1.29.85A4,4,0,0,1,4.71,17a3.92,3.92,0,0,1-.3-1.52A4,4,0,0,1,4.71,14a3.91,3.91,0,0,1,.87-1.3L7.7,10.56a.25.25,0,0,1,.2-.06l2.17.22a.21.21,0,0,1,.19.15.24.24,0,0,1,0,.25L7.12,14.23a1.81,1.81,0,0,0,0,2.58,1.78,1.78,0,0,0,1.29.52,1.74,1.74,0,0,0,1.28-.52L12.8,13.7a.24.24,0,0,1,.25-.07ZM19,4.92a4,4,0,0,1,0,5.66L16.86,12.7a.25.25,0,0,1-.17.08l-2.2-.23a.21.21,0,0,1-.19-.15.22.22,0,0,1,0-.25L17.44,9a1.81,1.81,0,0,0,0-2.58,1.78,1.78,0,0,0-1.29-.52,1.74,1.74,0,0,0-1.28.52L11.76,9.57a.21.21,0,0,1-.25,0,.24.24,0,0,1-.16-.21l-.22-2.17a.19.19,0,0,1,.08-.18l2.12-2.14a4.08,4.08,0,0,1,1.29-.85,4.05,4.05,0,0,1,3.06,0,3.85,3.85,0,0,1,1.3.85ZM5.84,9.82a.25.25,0,0,1-.18-.08.19.19,0,0,1-.07-.19l.11-.77a.2.2,0,0,1,.11-.17.24.24,0,0,1,.2,0l2.5.72a.25.25,0,0,1,.15.27.22.22,0,0,1-.23.21l-2.59,0Zm4.12-2-.73-2.5a.27.27,0,0,1,0-.2A.21.21,0,0,1,9.41,5L10.19,5a.25.25,0,0,1,.19,0,.23.23,0,0,1,.08.18l-.05,2.61a.2.2,0,0,1-.19.23h0A.22.22,0,0,1,10,7.85Zm8.76,5.58a.25.25,0,0,1,.18.08.23.23,0,0,1,.06.2l-.11.77a.25.25,0,0,1-.11.17.21.21,0,0,1-.12,0l-.08,0L16,14a.25.25,0,0,1-.15-.27.22.22,0,0,1,.22-.21l1.29,0,1.33,0Zm-4.12,2,.74,2.51a.28.28,0,0,1,0,.2.23.23,0,0,1-.18.11l-.8.11a.23.23,0,0,1-.17-.07.25.25,0,0,1-.08-.18l0-2.61a.22.22,0,0,1,.22-.22.21.21,0,0,1,.26.15Z" transform="translate(-4.41 -3.77)"/></g></svg>',math:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 11.81 15.73"><g><path d="M17.19,5.73a1,1,0,0,0,.71-.29,1,1,0,0,0,.28-.7,1,1,0,0,0-1-1H7.35a1,1,0,0,0-1,1,.77.77,0,0,0,.13.47h0l4.58,6.43L6.68,17.81a1.25,1.25,0,0,0-.29.71.94.94,0,0,0,.28.7.92.92,0,0,0,.69.28H17.2a1,1,0,0,0,.71-.28,1,1,0,0,0,0-1.39.92.92,0,0,0-.71-.29H9.26l3.87-5.43a.86.86,0,0,0,0-.95L9.26,5.73h7.93Z" transform="translate(-6.38 -3.77)"/></g></svg>',unlink:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.74 15.72"><g><path d="M19,18.32a4,4,0,0,0,0-5.68L15.85,9.5l-1.17,1.55L17.57,14a2,2,0,0,1,.61,1.47,2.08,2.08,0,0,1-2.09,2.09,2,2,0,0,1-1.47-.61l-.38-.37-1.74,1,.8.78a4,4,0,0,0,5.68,0ZM8,9.77a2,2,0,0,1-1.27-1,1.89,1.89,0,0,1-.21-1.57A2.1,2.1,0,0,1,7.45,6,2,2,0,0,1,9,5.76L12.27,7.2l.49-2L9.48,3.9a4,4,0,0,0-3.06.41A3.82,3.82,0,0,0,4.56,6.73a3.8,3.8,0,0,0,.4,3A3.78,3.78,0,0,0,7.39,11.6l5.38,2,.49-2-2.64-.94L8,9.77Z" transform="translate(-4.41 -3.76)"/></g></svg>',table_header:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.75 15.74"><g><path d="M17,19.5v-.78H15.5v.78H17Zm-3,0v-.78H12.5v.78H14Zm-3,0v-.78H9.53v.78H11Zm-3,0v-.78H6.53v.78H8Zm10.55,0a1.73,1.73,0,0,0,.85-.35,1.67,1.67,0,0,0,.56-.76l-.71-.31a1.21,1.21,0,0,1-.35.4,1.34,1.34,0,0,1-.53.23l.08.38c.06.24.09.38.1.41Zm-13.7-.63.55-.55A.77.77,0,0,1,5.25,18a1.31,1.31,0,0,1-.06-.38v-.38H4.41v.38a2,2,0,0,0,.12.68,1.6,1.6,0,0,0,.35.57Zm15.27-2.12V15.26h-.78v1.49h.78Zm-15-1V14.23H4.41v1.49h.78Zm15-2V12.26h-.78v1.49h.78Zm-15-1V11.22H4.41v1.51h.78Zm15-2V9.26h-.78v1.51h.78Zm-15-1V8.17H4.41V9.74h.78Zm15-2V6.28h-.78V7.77h.78Zm-15-1.11V5.33L4.48,5.1a.77.77,0,0,0-.07.27,2.72,2.72,0,0,0,0,.28v1h.79ZM19.21,5l.63-.4A1.62,1.62,0,0,0,19.16,4a1.94,1.94,0,0,0-.91-.22v.78a1.31,1.31,0,0,1,.56.12.88.88,0,0,1,.4.36ZM6,4.54H7.78V3.76H6a.82.82,0,0,0-.28.06l.12.35c.07.21.1.33.11.36Zm10.8,0V3.76H15.28v.78h1.49Zm-3,0V3.76H12.28v.78h1.49Zm-3,0V3.76H9.28v.78h1.51ZM6,10.84h12.6V6.91H6Z" transform="translate(-4.4 -3.76)"/></g></svg>',merge_cell:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.76 15.74"><g><path d="M18.92,13.5h1.23v4.15A1.84,1.84,0,0,1,18.3,19.5H14V18.27H18.3a.6.6,0,0,0,.44-.18.59.59,0,0,0,.18-.44V13.5ZM18.3,3.76a1.84,1.84,0,0,1,1.85,1.85V9.82H18.92V5.6a.6.6,0,0,0-.18-.44A.59.59,0,0,0,18.3,5H14V3.76H18.3Zm1.85,8.51H15.6L17.26,14l-.86.86-3.14-3.17L16.4,8.51l.86.86L15.62,11h4.54v1.24Zm-13.9,6h4.27V19.5H6.25A1.84,1.84,0,0,1,4.4,17.65V13.5H5.63v4.15a.61.61,0,0,0,.62.62Zm0-14.51h4.27V5H6.25a.6.6,0,0,0-.44.18.57.57,0,0,0-.17.43V9.81H4.41V5.6A1.83,1.83,0,0,1,6.25,3.76Zm5,7.9L8.15,14.83,7.3,14,9,12.27H4.41V11H8.94L7.3,9.38,7.73,9l.43-.43Z" transform="translate(-4.4 -3.76)"/></g></svg>',split_cell:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.75 15.74"><g><path d="M10.37,12.25H6.74L8.4,13.94l-.87.86L4.41,11.63,7.53,8.5l.87.86L6.74,11h3.62v1.23Zm9.78-.61L17,14.81,16.13,14l1.66-1.69H14.16V11h3.63L16.13,9.37l.43-.43A5.24,5.24,0,0,1,17,8.51ZM18.9,8.22V5.61a.57.57,0,0,0-.18-.43A.65.65,0,0,0,18.29,5H12.88V18.28h5.41a.7.7,0,0,0,.44-.18.57.57,0,0,0,.18-.43V15h1.23v2.64a1.84,1.84,0,0,1-1.85,1.83h-12A1.84,1.84,0,0,1,4.94,19a1.81,1.81,0,0,1-.54-1.29V15H5.63v2.64a.57.57,0,0,0,.18.43.67.67,0,0,0,.44.18h5.41V5H6.25a.7.7,0,0,0-.44.18.56.56,0,0,0-.17.43V8.22H4.41V5.61A1.8,1.8,0,0,1,5,4.31a1.91,1.91,0,0,1,1.31-.55h12a1.89,1.89,0,0,1,1.31.55,1.8,1.8,0,0,1,.54,1.3V8.23H18.9Z" transform="translate(-4.4 -3.76)"/></g></svg>',caption:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.74 13.79"><g><path d="M4.41,18.52H20.15v-2H4.41ZM20,4.73H18.07V6h.65v.65H20V4.73ZM17,6V4.73H14.55V6H17ZM13.49,6V4.73H11V6h2.47ZM10,6V4.73H7.5V6H10ZM5.79,6h.65V4.73H4.5V6.67H5.8V6ZM4.5,11.34H5.79V8.48H4.5ZM6.44,13.8H5.79v-.65H4.5v1.94H6.44ZM17,15.09V13.8H14.55v1.29H17Zm-3.52,0V13.8H11v1.29h2.47Zm-3.53,0V13.8H7.5v1.29H10ZM20,13.16H18.72v.65h-.65V15.1H20Zm-1.29-1.82H20V8.48h-1.3v2.86Z" transform="translate(-4.41 -4.73)"/></g></svg>',edit:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.74 15.73"><g><path d="M7.51,5.68h6l1.52-1.57H6.94a2.4,2.4,0,0,0-1.79.82A2.8,2.8,0,0,0,4.41,6.8V17a2.55,2.55,0,0,0,.75,1.8A2.48,2.48,0,0,0,7,19.5H17.22a2.57,2.57,0,0,0,1.83-.74,2.52,2.52,0,0,0,.77-1.8V8.83l-1.58,1.54v6a1.54,1.54,0,0,1-1.53,1.53H7.51A1.54,1.54,0,0,1,6,16.41V7.21A1.52,1.52,0,0,1,7.51,5.68Zm5.63,7.47h0L10.7,10.74l-1,3.38,1.71-.48,1.7-.49Zm.34-.34h0l5.36-5.32L16.4,5.08,11,10.4l1.23,1.21,1.21,1.2ZM19.93,6.4a.82.82,0,0,0,.22-.48A.54.54,0,0,0,20,5.47L18.45,4A.67.67,0,0,0,18,3.77a.7.7,0,0,0-.48.21l-.74.72,2.44,2.43.37-.37.35-.36Z" transform="translate(-4.41 -3.77)"/></g></svg>',delete:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.73 15.74"><g><path d="M19.16,6.71a.94.94,0,0,0,.69-.28.91.91,0,0,0,.29-.68A1,1,0,0,0,19.85,5a.93.93,0,0,0-.69-.3H14.24A.94.94,0,0,0,14,4.06a.92.92,0,0,0-.7-.3h-2a1,1,0,0,0-.7.3.93.93,0,0,0-.28.68H5.39A.92.92,0,0,0,4.7,5a1,1,0,0,0-.29.71.91.91,0,0,0,.29.68,1,1,0,0,0,.69.28H19.16Zm-12.79,1a1,1,0,0,0-.7.3.94.94,0,0,0-.28.69v8.85A1.88,1.88,0,0,0,6,18.93a1.9,1.9,0,0,0,1.39.57H17.2a1.87,1.87,0,0,0,1.39-.58,1.91,1.91,0,0,0,.58-1.39V8.68A1,1,0,0,0,18.88,8a.89.89,0,0,0-.7-.29,1,1,0,0,0-.69.29.92.92,0,0,0-.29.68v7.87a1,1,0,0,1-1,1H8.34a.94.94,0,0,1-.69-.28,1,1,0,0,1-.29-.71V8.68a1,1,0,0,0-1-1Z" transform="translate(-4.41 -3.76)"/></g></svg>',modify:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.7 15.74"><g><path d="M19.79,15.23a.66.66,0,0,1,.3.38.59.59,0,0,1-.07.48l-.8,1.38a.66.66,0,0,1-.38.3.59.59,0,0,1-.48-.07l-.68-.38a4.55,4.55,0,0,1-1.34.77v.78a.64.64,0,0,1-.18.45.61.61,0,0,1-.45.18h-1.6a.6.6,0,0,1-.44-.18.66.66,0,0,1-.19-.45v-.78a4.36,4.36,0,0,1-1.32-.77l-.69.38a.58.58,0,0,1-.48.07.66.66,0,0,1-.38-.3l-.38-.66h.83a1.77,1.77,0,0,0,1.23-.52,1.72,1.72,0,0,0,.51-1.23v-.18a3,3,0,0,0,.49-.28l.15.09a1.83,1.83,0,0,0,.88.23A1.75,1.75,0,0,0,15.84,14l.88-1.52a1.7,1.7,0,0,0,.17-1.32,1.66,1.66,0,0,0-.3-.61,1.84,1.84,0,0,0-.51-.45l-.15-.09,0-.29,0-.28.15-.09a1,1,0,0,0,.26-.18l0,.06v.78a4.34,4.34,0,0,1,1.34.77l.68-.38a.68.68,0,0,1,.48-.06.64.64,0,0,1,.38.29l.8,1.38a.58.58,0,0,1,.07.48.63.63,0,0,1-.3.38l-.68.4a3.84,3.84,0,0,1,.08.76,4.13,4.13,0,0,1-.08.78l.34.18.32.2ZM10.17,7.86a1.9,1.9,0,0,1,1.35,3.23,1.85,1.85,0,0,1-1.35.55A1.9,1.9,0,0,1,8.83,8.41a1.92,1.92,0,0,1,1.34-.55Zm1.58,7.2a.73.73,0,0,1-.21.49.66.66,0,0,1-.48.2H9.29a.68.68,0,0,1-.69-.69V14.2a4.75,4.75,0,0,1-1.48-.86l-.75.45a.73.73,0,0,1-.7,0,.63.63,0,0,1-.25-.26L4.54,12a.67.67,0,0,1-.08-.53.71.71,0,0,1,.32-.42l.75-.43a4.8,4.8,0,0,1-.08-.85,4.71,4.71,0,0,1,.08-.85l-.74-.44a.71.71,0,0,1-.32-.42.65.65,0,0,1,.07-.54L5.42,6a.66.66,0,0,1,.42-.32l.18,0a.73.73,0,0,1,.35.09l.75.43A4.68,4.68,0,0,1,8.6,5.33V4.45a.68.68,0,0,1,.69-.69h1.77a.64.64,0,0,1,.48.2.73.73,0,0,1,.21.49v.88a4.75,4.75,0,0,1,1.48.85L14,5.75a.67.67,0,0,1,.34-.09l.18,0a.71.71,0,0,1,.42.32l.89,1.54a.67.67,0,0,1,.06.52.73.73,0,0,1-.32.43l-.75.42a4.8,4.8,0,0,1,.08.85,4.71,4.71,0,0,1-.08.85l.75.43a.66.66,0,0,1,.32.42.73.73,0,0,1-.06.54l-.89,1.52a.69.69,0,0,1-.25.26.7.7,0,0,1-.35.09.64.64,0,0,1-.34-.09l-.75-.45a4.87,4.87,0,0,1-1.48.86v.87ZM7.23,9.75a3,3,0,0,0,.86,2.08,2.94,2.94,0,1,0,4.16-4.16,3,3,0,0,0-2.08-.85A2.94,2.94,0,0,0,7.23,9.75Z" transform="translate(-4.44 -3.76)"/></g></svg>',revert:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.76 14.69"><g><path d="M18.26,15V12.3l1.89-2V15a2.58,2.58,0,0,1-.24,1c-.2.58-.75.92-1.65,1H7.56v2L4.41,15.63,7.56,13v2h10.7ZM6.3,8.28V11L4.41,13V8.28a2.58,2.58,0,0,1,.24-1c.2-.58.75-.92,1.65-1H17v-2l3.15,3.34L17,10.3v-2H6.3Z" transform="translate(-4.4 -4.28)"/></g></svg>',auto_size:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.74 15.74"><g><path d="M6.71,17.19,6.89,16l1.21-.15A6,6,0,0,1,6.81,13.9a5.78,5.78,0,0,1-.45-2.27A6,6,0,0,1,8.1,7.45a5.83,5.83,0,0,1,4.17-1.73l1-1-1-1A7.89,7.89,0,0,0,5,14.64a7.73,7.73,0,0,0,1.71,2.55Zm5.57,2.31h0A7.86,7.86,0,0,0,17.85,6.07L17.67,7.3l-1.21.15a5.9,5.9,0,0,1,1.29,1.92,5.81,5.81,0,0,1,.45,2.26,5.91,5.91,0,0,1-5.9,5.9l-1,1,.49.49.47.5Z" transform="translate(-4.41 -3.76)"/></g></svg>',insert_row_below:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.8 15.8"><g><path d="M15.7,1.3c-0.1-0.1-0.1-0.2-0.2-0.2L15.3,1H0.4L0.3,1.1c0,0-0.1,0.1-0.1,0.1c0,0-0.1,0.1-0.1,0.1L0,1.4v7.7l0.1,0.1c0,0.1,0.1,0.1,0.2,0.2l0.1,0.1h2.3V9.3l0.1-0.5L3,8.5l0.1-0.2c-0.1,0-0.2,0-0.3,0H1.2v-6h13.3v6h-1.6c-0.1,0-0.2,0-0.3,0l0.1,0.2l0.2,0.4C12.9,9,13,9.2,13,9.3v0.1h2.3l0.2-0.1c0.1,0,0.1-0.1,0.2-0.2l0.1-0.1V1.4L15.7,1.3z"/><path d="M10.5,7.5C9.9,7.1,9.3,6.8,8.6,6.7c-0.2,0-0.5-0.1-0.7,0c-0.2,0-0.5,0-0.7,0C6.6,6.7,6.1,6.9,5.6,7.3C5.2,7.6,4.7,8,4.4,8.4C4.3,8.6,4.2,8.8,4.2,8.9C4.1,9.1,4,9.3,3.9,9.4C3.9,9.6,3.8,9.7,3.8,9.9c0,0.2-0.1,0.3-0.1,0.5v-0.1c-0.1,0.8,0.1,1.6,0.5,2.4c0.4,0.7,1,1.3,1.7,1.7c0.3,0.2,0.6,0.3,0.9,0.3c0.3,0.1,0.7,0.1,1,0.1c0.3,0,0.7,0,1-0.1c0.3-0.1,0.6-0.2,0.9-0.3c0.5-0.3,0.9-0.6,1.3-1c0.3-0.4,0.6-0.8,0.8-1.3c0.1-0.4,0.2-0.9,0.2-1.4c0-0.5-0.1-1-0.3-1.4C11.5,8.6,11.1,8,10.5,7.5z M10.1,11.3H8.5v1.6H8H7.9H7.3v0v-0.1v-1.4H5.7v-0.4v-0.2v-0.6h0h1.5V8.5h1.2v1.6h1.6V11.3z"/></g></svg>',insert_row_above:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.8 15.8"><g><path d="M0.1,14.5c0.1,0.1,0.1,0.2,0.2,0.2l0.1,0.1h14.9l0.1-0.1c0,0,0.1-0.1,0.1-0.1c0,0,0.1-0.1,0.1-0.1l0.1-0.1V6.7l-0.1-0.1c0-0.1-0.1-0.1-0.2-0.2l-0.1-0.1h-2.3v0.1l-0.1,0.5l-0.2,0.4l-0.1,0.2c0.1,0,0.2,0,0.3,0h1.6v6H1.3v-6h1.6c0.1,0,0.2,0,0.3,0L3.1,7.3L2.9,6.9C2.8,6.8,2.8,6.6,2.7,6.5V6.3H0.4L0.3,6.4c-0.1,0-0.1,0.1-0.2,0.2L0,6.7v7.7L0.1,14.5z"/><path d="M5.3,8.3c0.6,0.5,1.2,0.8,1.9,0.9c0.2,0,0.5,0.1,0.7,0c0.2,0,0.5,0,0.7,0c0.6-0.1,1.1-0.3,1.6-0.6c0.5-0.3,0.9-0.7,1.2-1.2c0.1-0.2,0.2-0.3,0.3-0.5c0.1-0.2,0.2-0.4,0.2-0.5c0.1-0.1,0.1-0.3,0.1-0.4C12,5.8,12,5.6,12,5.4v0.1c0.1-0.8-0.1-1.6-0.5-2.4c-0.4-0.7-1-1.3-1.7-1.7C9.5,1.3,9.2,1.2,8.9,1.1C8.5,1,8.2,1,7.9,1c-0.3,0-0.7,0-1,0.1C6.6,1.2,6.3,1.3,6,1.4C5.5,1.7,5.1,2,4.7,2.4C4.4,2.8,4.1,3.3,3.9,3.8C3.8,4.2,3.7,4.7,3.7,5.2c0,0.5,0.1,1,0.3,1.4C4.3,7.2,4.7,7.8,5.3,8.3z M5.7,4.5h1.6V2.9h0.5h0.1h0.6v0v0.1v1.4H10v0.4v0.2v0.6h0H8.5v1.6H7.3V5.7H5.7V4.5z"/></g></svg>',insert_column_left:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.8 15.8"><g><path d="M14.5,15.7c0.1-0.1,0.2-0.1,0.2-0.2l0.1-0.1V0.4l-0.1-0.1c0,0-0.1-0.1-0.1-0.1c0,0-0.1-0.1-0.1-0.1L14.4,0H6.7L6.6,0.1c-0.1,0-0.1,0.1-0.2,0.2L6.3,0.4v2.3h0.1l0.5,0.1L7.3,3l0.2,0.1c0-0.1,0-0.2,0-0.3V1.2h6v13.3h-6v-1.6c0-0.1,0-0.2,0-0.3l-0.2,0.1l-0.4,0.2C6.7,12.9,6.6,13,6.4,13H6.3v2.3l0.1,0.2c0,0.1,0.1,0.1,0.2,0.2l0.1,0.1h7.7L14.5,15.7z"/><path d="M8.3,10.5C8.7,10,9,9.3,9.1,8.6c0-0.2,0.1-0.5,0-0.7c0-0.2,0-0.5,0-0.7C9,6.7,8.8,6.1,8.5,5.7C8.2,5.2,7.8,4.8,7.3,4.5C7.2,4.4,7,4.3,6.9,4.2C6.7,4.1,6.5,4,6.4,4C6.2,3.9,6.1,3.9,5.9,3.8c-0.2,0-0.3-0.1-0.5-0.1h0.1C4.7,3.7,3.8,3.9,3.1,4.3C2.4,4.7,1.8,5.3,1.4,6C1.3,6.3,1.2,6.6,1.1,6.9C1,7.2,1,7.6,1,7.9c0,0.3,0,0.7,0.1,1c0.1,0.3,0.2,0.6,0.3,0.9c0.3,0.5,0.6,0.9,1,1.3c0.4,0.3,0.8,0.6,1.3,0.8C4.2,12,4.7,12.1,5.1,12c0.5,0,1-0.1,1.4-0.3C7.2,11.5,7.8,11.1,8.3,10.5zM4.5,10.1V8.5H2.9V8V7.9V7.3h0H3h1.4V5.7h0.4h0.2h0.6v0v1.5h1.6v1.2H5.7v1.6H4.5z"/></g></svg>',insert_column_right:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.8 15.8"><g><path d="M1.3,0.1C1.2,0.2,1.1,0.2,1.1,0.3L1,0.4v14.9l0.1,0.1c0,0,0.1,0.1,0.1,0.1c0,0,0.1,0.1,0.1,0.1l0.1,0.1h7.7l0.1-0.1c0.1,0,0.1-0.1,0.2-0.2l0.1-0.1v-2.3H9.3l-0.5-0.1l-0.4-0.2l-0.2-0.1c0,0.1,0,0.2,0,0.3v1.6h-6V1.3h6v1.6c0,0.1,0,0.2,0,0.3l0.2-0.1l0.4-0.2C9,2.9,9.2,2.8,9.3,2.8h0.1V0.5L9.4,0.3c0-0.1-0.1-0.1-0.2-0.2L9.1,0H1.4L1.3,0.1z"/><path d="M7.5,5.3C7,5.8,6.7,6.5,6.6,7.2c0,0.2-0.1,0.5,0,0.7c0,0.2,0,0.5,0,0.7c0.1,0.6,0.3,1.1,0.6,1.6c0.3,0.5,0.7,0.9,1.2,1.2c0.2,0.1,0.3,0.2,0.5,0.3c0.2,0.1,0.4,0.2,0.5,0.2c0.1,0.1,0.3,0.1,0.4,0.1c0.2,0,0.3,0.1,0.5,0.1h-0.1c0.8,0.1,1.6-0.1,2.4-0.5c0.7-0.4,1.3-1,1.7-1.7c0.2-0.3,0.3-0.6,0.3-0.9c0.1-0.3,0.1-0.7,0.1-1c0-0.3,0-0.7-0.1-1c-0.1-0.3-0.2-0.6-0.3-0.9c-0.3-0.5-0.6-0.9-1-1.3C13,4.4,12.5,4.2,12,4c-0.4-0.1-0.9-0.2-1.4-0.2c-0.5,0-1,0.1-1.4,0.2C8.5,4.3,7.9,4.7,7.5,5.3z M11.3,5.7v1.6h1.6v0.5v0.1v0.6h0h-0.1h-1.4v1.6h-0.4h-0.2h-0.6v0V8.5H8.5V7.3h1.6V5.7H11.3z"/></g></svg>',delete_row:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.75 13.83"><g><path d="M4.7,18.46l.12.08H19.73l.12-.08a.58.58,0,0,0,.22-.22l.08-.12,0-7.69-.08-.11a.77.77,0,0,0-.18-.18l-.11-.08-2.31,0-.08.28-.1.29a1.58,1.58,0,0,1-.12.29l-.14.34s0,0,.18,0H18.9v6H5.64v-6H7.35c.14,0,.2,0,.18,0l-.14-.34a2.85,2.85,0,0,1-.12-.29l-.1-.29-.07-.27-2.31,0-.11.08a.77.77,0,0,0-.18.18l-.08.11,0,7.69.08.12a.47.47,0,0,0,.09.12l.13.09ZM12.11,13a4,4,0,0,0,1.46-.21,4.51,4.51,0,0,0,1.31-.71A4,4,0,0,0,16.26,10a4.32,4.32,0,0,0-.08-2.54,4.34,4.34,0,0,0-1-1.52,4.15,4.15,0,0,0-1.54-1,4.34,4.34,0,0,0-1.35-.22A4.07,4.07,0,0,0,11,4.93,3.94,3.94,0,0,0,9.24,6.07,3.92,3.92,0,0,0,8.15,8.88a3.91,3.91,0,0,0,.12.95A4.16,4.16,0,0,0,12.11,13Zm2.35-4.14v.58H10.09V8.27h4.37v.58Z" transform="translate(-4.4 -4.71)"/></g></svg>',delete_column:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 13.81 15.74"><g><path d="M5.66,19.42l.12.08,7.69,0,.11-.08a.77.77,0,0,0,.18-.18l.08-.11,0-2.32-.15,0-.45-.15-.42-.18-.17-.07a1,1,0,0,0,0,.27v1.63h-6V5h6V6.62a.9.9,0,0,0,0,.26l.17-.07.42-.17a3.91,3.91,0,0,1,.45-.15l.15,0,0-2.32L13.75,4a.77.77,0,0,0-.18-.18l-.11-.08H5.79l-.13.07a.63.63,0,0,0-.21.22l-.08.12V19.08l.08.12a.47.47,0,0,0,.09.12.35.35,0,0,0,.12.1Zm9-3.67a4.16,4.16,0,0,0,2.36-.51,4.08,4.08,0,0,0,1.67-1.72,4,4,0,0,0,.35-.91,3.79,3.79,0,0,0,.1-1,4.71,4.71,0,0,0-.11-1,5,5,0,0,0-.3-.87,4.25,4.25,0,0,0-1-1.25,4.49,4.49,0,0,0-1.34-.81A4.26,4.26,0,0,0,15,7.48a3.88,3.88,0,0,0-1.41.25A4.32,4.32,0,0,0,11.86,9,4,4,0,0,0,11,10.94a4.4,4.4,0,0,0-.05.68,4.5,4.5,0,0,0,.05.68,3.93,3.93,0,0,0,.61,1.57,4.22,4.22,0,0,0,1.18,1.2,4.59,4.59,0,0,0,.48.27c.2.1.37.17.5.22a2.44,2.44,0,0,0,.45.12,4.61,4.61,0,0,0,.5.07Zm2.54-4.12v.58H12.87V11h4.37v.59Z" transform="translate(-5.37 -3.76)"/></g></svg>',fixed_column_width:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M6,5H18A1,1 0 0,1 19,6A1,1 0 0,1 18,7H6A1,1 0 0,1 5,6A1,1 0 0,1 6,5M21,2V4H3V2H21M15,8H17V22H15V8M7,8H9V22H7V8M11,8H13V22H11V8Z" /></svg>',rotate_left:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.8 15.8"><g><path d="M0.5,10.2c0,0.1,0,0.2,0,0.3v0.2l0,0c0.1,0.3,0.3,0.6,0.4,0.9l0,0C1,11.8,1.3,12,1.5,11.9h0.1h0.2h0.1c0.1-0.1,0.3-0.3,0.4-0.5v-0.2c0-0.1,0-0.2-0.1-0.3l0,0c-0.2-0.2-0.3-0.4-0.3-0.7l0,0C1.8,10,1.7,9.9,1.5,9.8c-0.1,0-0.2,0-0.3,0H0.9C0.7,9.9,0.6,10,0.5,10.2L0.5,10.2z"/><path d="M2.2,11.5L2.2,11.5L2.2,11.5z"/><path d="M5.9,3.6L5.9,3.6L5.9,3.6z"/><path d="M0.1,7.9c0,0.3,0,0.6,0,0.9l0,0l0,0l0,0l0,0c0,0.2,0.1,0.3,0.2,0.4l0,0c0.2,0.1,0.3,0.2,0.5,0.2l0,0l0,0c0.2,0,0.4-0.1,0.5-0.3l0,0c0-0.1,0.1-0.3,0.1-0.4V8.6l0,0c0-0.2,0-0.5,0-0.7l0,0c0-0.2-0.1-0.4-0.2-0.5C1.1,7.3,0.9,7.2,0.7,7.2S0.3,7.3,0.2,7.4C0.1,7.5,0,7.7,0.1,7.9z"/><path d="M1.9,12.7L1.9,12.7c0,0.2,0,0.4,0.2,0.5l0,0l0.2,0.3l0,0c0.2,0.1,0.3,0.2,0.5,0.4l0,0l0,0l0,0l0,0C2.9,14,3,14.1,3.2,14.1s0.4-0.1,0.5-0.2c0.1-0.2,0.2-0.3,0.2-0.5v-0.1c0-0.2-0.1-0.4-0.2-0.5l0,0l-0.4-0.4l-0.2-0.2l0,0C3,12.1,2.8,12,2.6,12l0,0c-0.2,0-0.4,0.1-0.5,0.2l0,0C2,12.3,1.9,12.5,1.9,12.7z"/><path d="M6.6,15c0,0.2,0.1,0.4,0.2,0.5c0.1,0.1,0.2,0.2,0.4,0.3l0,0c0.3,0,0.5,0,0.7,0h0.3l0,0c0.2,0,0.4-0.1,0.5-0.2c0.1-0.2,0.2-0.3,0.2-0.5l0,0l0,0c0-0.2-0.1-0.4-0.2-0.5l0,0c-0.1-0.1-0.3-0.2-0.5-0.2l0,0H7.9c-0.1,0-0.3,0-0.5,0l0,0H7.3c-0.2-0.1-0.3,0-0.5,0.1l0,0C6.7,14.6,6.6,14.8,6.6,15L6.6,15L6.6,15L6.6,15z"/><path d="M4.2,7.4C4,7.5,4,7.7,4,7.9c0,0.2,0,0.4,0.2,0.5l0,0l3.2,3.2l0,0c0.1,0.1,0.3,0.2,0.5,0.2s0.3-0.1,0.5-0.2l0,0l3.2-3.2l0,0c0.1-0.1,0.2-0.3,0.2-0.5c0-0.2-0.1-0.4-0.2-0.5l0,0C11.5,7.3,11,6.7,10,5.8l0,0L8.4,4.2l0,0C8.3,4.1,8.1,4,7.9,4S7.5,4.1,7.4,4.2L4.2,7.4L4.2,7.4z M6.8,9L5.7,7.9l2.2-2.2l2.3,2.2l-2.3,2.2C7.7,9.9,7.3,9.5,6.8,9L6.8,9z"/><path d="M4.1,14.1C4,14.2,4,14.3,4,14.4v0.2l0,0c0.1,0.1,0.2,0.3,0.4,0.4l0,0c0.3,0.1,0.6,0.2,0.9,0.4h0.1h0.1l0,0c0.2,0,0.3-0.1,0.5-0.1l0,0c0.2-0.1,0.3-0.3,0.3-0.4l0,0l0,0l0,0l0,0v-0.2c0-0.1-0.1-0.2-0.1-0.3l0,0C6.1,14.2,6,14.1,5.8,14l0,0c-0.3-0.1-0.5-0.2-0.8-0.2l0,0c-0.1-0.1-0.2-0.1-0.3-0.1H4.5C4.3,13.7,4.2,13.9,4.1,14.1z"/><path d="M9.3,14.4c0,0.1-0.1,0.3,0,0.4V15l0,0c0,0.1,0.1,0.3,0.5,0.4c0.1,0.1,0.3,0.1,0.4,0.1l0,0h0.1l0,0c0.3-0.1,0.6-0.2,0.9-0.3l0,0c0.1-0.1,0.2-0.2,0.3-0.4l0.1-0.3c0-0.1-0.1-0.2-0.1-0.3l0,0c-0.1-0.2-0.2-0.3-0.4-0.4l0,0h-0.3c-0.1,0-0.2,0-0.3,0l0,0c-0.2,0.1-0.5,0.2-0.8,0.3l0,0C9.5,14.1,9.4,14.2,9.3,14.4L9.3,14.4z"/><path d="M11.4,14.7L11.4,14.7L11.4,14.7z"/><path d="M9.5,15.3L9.5,15.3L9.5,15.3z"/><path d="M15.9,7.9c0-1-0.2-2-0.6-3l0,0c-0.4-1-1-1.9-1.7-2.6C12.8,1.6,12,1,11,0.6l0,0C10.1,0.2,9,0,8,0C7.3,0,6.5,0.1,5.8,0.3l0,0C5.2,0.5,4.6,0.8,4,1.1L3.1,0.2l0,0C2.9,0.1,2.8,0,2.6,0H2.4l0,0C2.2,0,2,0.2,1.9,0.4l0,0L0.1,4.9l0,0C0,5,0,5.1,0,5.2c0,0.2,0.1,0.4,0.2,0.5l0,0c0.2,0.1,0.3,0.2,0.5,0.2h0.1H1l0,0l4.7-1.8l0,0C5.9,4,6.1,3.8,6.1,3.6V3.4C6.1,3.2,6,3,5.9,2.9l0,0L5.1,2.1c0.4-0.2,0.8-0.4,1.3-0.5c0.5-0.1,1.1-0.2,1.7-0.2c0.9,0,1.7,0.2,2.5,0.5l0,0c0.8,0.3,1.5,0.8,2.1,1.4c0.6,0.6,1.1,1.3,1.4,2.1l0,0c0.3,0.8,0.5,1.6,0.5,2.5s-0.2,1.7-0.5,2.5l0,0c-0.3,0.8-0.8,1.5-1.4,2.1c-0.2,0.2-0.4,0.3-0.6,0.5l0,0c-0.2,0.1-0.3,0.3-0.3,0.5v0.1c0,0.1,0,0.3,0.1,0.4l0,0c0.1,0.2,0.3,0.3,0.5,0.3l0,0c0.1,0,0.3-0.1,0.4-0.2l0,0l0,0l0,0l0,0c0.2-0.2,0.5-0.4,0.7-0.6l0,0l0,0l0,0l0,0c0.7-0.8,1.3-1.6,1.7-2.6C15.6,10,15.8,9,15.9,7.9z M1.9,4C2,3.8,2.1,3.5,2.3,3.1l0,0L2.7,2l1.2,1.2L1.9,4z"/><path d="M6.8,15.5L6.8,15.5L6.8,15.5z"/></g></svg>',rotate_right:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.8 15.8"><g><path d="M9.9,15.3L9.9,15.3L9.9,15.3z"/><path d="M6.9,15.1L6.9,15.1c0,0.1,0.1,0.3,0.2,0.4l0,0c0.1,0.2,0.3,0.3,0.5,0.3l0,0h0.3c0.2,0,0.4,0,0.7,0l0,0c0.2-0.1,0.3-0.2,0.4-0.3c0.1-0.1,0.2-0.2,0.2-0.4V15c0-0.2-0.1-0.4-0.2-0.4c-0.2-0.1-0.3-0.2-0.5-0.2H8.4l0,0c-0.1,0-0.3,0-0.5,0H7.6l0,0c-0.2,0-0.4,0.1-0.5,0.2C7,14.7,6.9,14.9,6.9,15.1z"/><path d="M6.5,14.4L6.5,14.4L6.5,14.4z"/><path d="M5.8,5.8L5.8,5.8c-1,0.9-1.5,1.5-1.7,1.6l0,0C4,7.5,4,7.7,4,7.9c0,0.2,0,0.4,0.2,0.5l0,0l3.2,3.2l0,0c0.2,0.1,0.3,0.2,0.5,0.2s0.4-0.1,0.5-0.2l0,0l3.2-3.2l0,0c0.1-0.1,0.2-0.3,0.2-0.5c0-0.2-0.1-0.4-0.2-0.5l0,0L8.4,4.2C8.3,4.1,8.1,4,7.9,4C7.7,4,7.5,4.1,7.4,4.2l0,0L5.8,5.8z M5.6,7.9l2.3-2.2l2.2,2.2L9,9l0,0l0,0l0,0l0,0c-0.5,0.6-0.9,0.9-1.1,1.1L5.6,7.9z"/><path d="M9,15.5L9,15.5L9,15.5z"/><path d="M9.6,14.7v0.2l0,0l0,0l0,0l0,0c0.1,0.2,0.1,0.3,0.3,0.3c0.1,0.1,0.3,0.1,0.4,0.1l0,0h0.1h0.1c0.3-0.1,0.6-0.3,0.9-0.4l0,0c0.1-0.1,0.2-0.2,0.3-0.4l0,0v-0.2c0-0.1,0-0.2-0.1-0.3c-0.1-0.2-0.2-0.3-0.4-0.4H11c-0.1,0-0.2,0.1-0.3,0.1l0,0c-0.2,0.1-0.4,0.2-0.7,0.3l0,0l0,0c-0.1,0.1-0.3,0.2-0.4,0.4C9.6,14.5,9.6,14.6,9.6,14.7z"/><path d="M9,14.5L9,14.5L9,14.5z"/><path d="M9.6,14.4L9.6,14.4L9.6,14.4z"/><path d="M11.7,14L11.7,14L11.7,14z"/><path d="M15.6,7.4L15.6,7.4L15.6,7.4z"/><path d="M15,9.4c0.2,0,0.4,0,0.6-0.2l0,0c0.1-0.1,0.2-0.2,0.2-0.4l0,0l0,0l0,0l0,0c0-0.3,0-0.6,0-0.9c0-0.2-0.1-0.4-0.2-0.5c-0.1-0.1-0.3-0.2-0.5-0.2s-0.4,0.1-0.5,0.2c-0.1,0.1-0.2,0.3-0.2,0.5l0,0c0,0.2,0,0.4,0,0.7l0,0v0.1c0,0.1,0,0.3,0.1,0.4l0,0C14.6,9.3,14.8,9.4,15,9.4L15,9.4L15,9.4z"/><path d="M14,12h0.1h0.2h0.1c0.2,0,0.5-0.2,0.6-0.4l0,0c0.2-0.3,0.3-0.6,0.4-0.9l0,0v-0.2c0-0.1-0.1-0.2-0.1-0.3c-0.1-0.2-0.2-0.3-0.4-0.4h-0.3c-0.1,0-0.2,0-0.3,0C14.2,9.9,14,10,14,10.3l0,0c-0.1,0.2-0.2,0.5-0.3,0.7l0,0c-0.1,0.1-0.1,0.2-0.1,0.3v0.2l0,0l0,0C13.6,11.6,13.8,11.8,14,12z"/><path d="M14.6,7.4L14.6,7.4L14.6,7.4z"/><path d="M4.4,14.2c-0.1,0.1-0.1,0.2-0.1,0.3l0.1,0.2c0,0.2,0.2,0.3,0.3,0.4l0,0c0.3,0.1,0.6,0.3,1.1,0.4l0,0h0.1l0,0c0.1,0,0.2-0.1,0.4-0.2c0.1,0,0.2-0.2,0.3-0.3l0,0v-0.2c0-0.1-0.1-0.3-0.2-0.4c-0.1-0.1-0.2-0.2-0.4-0.3l0,0c-0.2-0.1-0.5-0.2-0.7-0.3l0,0c-0.1,0-0.2,0-0.3,0H4.7l0,0C4.6,13.9,4.4,14,4.4,14.2L4.4,14.2z"/><path d="M11.9,13.3c0,0.2,0.1,0.4,0.2,0.6c0.1,0.1,0.3,0.2,0.5,0.2s0.4-0.1,0.5-0.2l0,0l0,0l0,0l0,0c0.1-0.1,0.3-0.3,0.4-0.4l0,0l0.2-0.3l0,0c0.1-0.2,0.2-0.3,0.2-0.5l0,0c0-0.2-0.1-0.4-0.2-0.5l0,0c-0.1-0.1-0.3-0.2-0.5-0.2l0,0c-0.2,0-0.4,0.1-0.5,0.2l0,0l-0.2,0.2l-0.4,0.4l0,0C12,13,11.9,13.1,11.9,13.3L11.9,13.3z"/><path d="M12.1,13.8L12.1,13.8L12.1,13.8z"/><path d="M11.9,13.3L11.9,13.3L11.9,13.3z"/><path d="M15.9,5.2c0-0.1-0.1-0.2-0.1-0.3l0,0L14,0.4l0,0C13.9,0.2,13.7,0,13.5,0l0,0l0,0h-0.2c-0.2,0-0.4,0.1-0.5,0.2l0,0l-0.9,0.9c-0.5-0.3-1.1-0.6-1.8-0.8l0,0C9.4,0.1,8.7,0,7.9,0c-1,0-2,0.2-3,0.6S3,1.6,2.3,2.3C1.6,3.1,1,3.9,0.6,4.9l0,0C0.2,5.8,0,6.8,0,7.9c0,1,0.2,2,0.6,3s0.9,1.8,1.7,2.6l0,0l0,0l0,0l0,0c0.2,0.2,0.5,0.4,0.7,0.6l0,0l0,0l0,0l0,0c0.2,0.1,0.3,0.2,0.5,0.2l0,0c0.2,0,0.4-0.1,0.6-0.3l0,0c0.1-0.1,0.1-0.3,0.1-0.4v-0.1l0,0C4.1,13.3,4,13.1,3.9,13l0,0c-0.2-0.1-0.4-0.3-0.6-0.5c-0.6-0.6-1.1-1.3-1.4-2.1l0,0C1.6,9.6,1.4,8.8,1.4,7.9s0.2-1.7,0.5-2.5l0,0c0.3-0.8,0.8-1.5,1.4-2.1c0.6-0.6,1.3-1.1,2.1-1.4l0,0C6.2,1.6,7,1.4,7.9,1.4c0.6,0,1.1,0.1,1.7,0.2c0.5,0.1,0.9,0.3,1.3,0.5l-0.8,0.8l0,0C10,3.1,9.9,3.2,9.9,3.4v0.2l0,0l0,0c0,0.2,0.2,0.4,0.4,0.5l0,0l4.5,1.8l0,0H15h0.1c0.2,0,0.4-0.1,0.5-0.2l0,0C15.7,5.6,15.8,5.4,15.9,5.2z M11.8,3.2L13,2l0.4,1.1l0,0c0.2,0.4,0.3,0.7,0.4,0.9L11.8,3.2z"/></g></svg>',mirror_horizontal:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.75 15.74"><g><path d="M13.75,3.76l5.9,15.74h-5.9V3.76ZM4.9,19.5,10.8,3.76V19.5H4.9Z" transform="translate(-4.9 -3.76)"/></g></svg>',mirror_vertical:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.74 14.75"><g><path d="M20.15,13.1,4.41,19V13.1H20.15ZM4.41,4.25l15.74,5.9H4.41V4.25Z" transform="translate(-4.41 -4.25)"/></g></svg>',checked:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.75 12.1"><g><path d="M4.59,12.23l.12.18L9.43,17.5a.58.58,0,0,0,.84,0L20,7.45h0a.58.58,0,0,0,0-.84l-.85-.85a.58.58,0,0,0-.84,0H18.2l-8.12,8.41a.29.29,0,0,1-.42,0l-3.4-3.63a.58.58,0,0,0-.84,0l-.85.85a.6.6,0,0,0-.14.21.51.51,0,0,0,0,.44c.05.06.1.13.16.19Z" transform="translate(-4.38 -5.58)"/></g></svg>',line_break:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19,6a1,1,0,0,0-1,1v4a1,1,0,0,1-1,1H7.41l1.3-1.29A1,1,0,0,0,7.29,9.29l-3,3a1,1,0,0,0-.21.33,1,1,0,0,0,0,.76,1,1,0,0,0,.21.33l3,3a1,1,0,0,0,1.42,0,1,1,0,0,0,0-1.42L7.41,14H17a3,3,0,0,0,3-3V7A1,1,0,0,0,19,6Z"/></svg>',audio:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14,3.23V5.29C16.89,6.15 19,8.83 19,12C19,15.17 16.89,17.84 14,18.7V20.77C18,19.86 21,16.28 21,12C21,7.72 18,4.14 14,3.23M16.5,12C16.5,10.23 15.5,8.71 14,7.97V16C15.5,15.29 16.5,13.76 16.5,12M3,9V15H7L12,20V4L7,9H3Z" /></svg>',image_gallery:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="30 30 150 150"><g><path d="M152.775,120.548V51.651c0-12.271-9.984-22.254-22.254-22.254H43.727c-12.271,0-22.254,9.983-22.254,22.254v68.896c0,12.27,9.983,22.254,22.254,22.254h86.795C142.791,142.802,152.775,132.817,152.775,120.548z M36.394,51.651c0-4.042,3.291-7.333,7.333-7.333h86.795c4.042,0,7.332,3.291,7.332,7.333v23.917l-14.938-17.767c-1.41-1.678-3.487-2.649-5.68-2.658h-0.029c-2.184,0-4.255,0.954-5.674,2.613L76.709,98.519l-9.096-9.398c-1.427-1.474-3.392-2.291-5.448-2.273c-2.052,0.025-4.004,0.893-5.396,2.4L36.394,111.32V51.651z M41.684,127.585l20.697-22.416l9.312,9.622c1.461,1.511,3.489,2.334,5.592,2.27c2.101-0.066,4.075-1.013,5.44-2.612l34.436-40.308l20.693,24.613v21.794c0,4.042-3.29,7.332-7.332,7.332H43.727C43.018,127.88,42.334,127.775,41.684,127.585z M182.616,152.5V75.657c0-4.12-3.34-7.46-7.461-7.46c-4.119,0-7.46,3.34-7.46,7.46V152.5c0,4.112-3.347,7.46-7.461,7.46h-94c-4.119,0-7.46,3.339-7.46,7.459c0,4.123,3.341,7.462,7.46,7.462h94C172.576,174.881,182.616,164.841,182.616,152.5z"/></g></svg>',bookmark:'<svg viewBox="0 0 24 24"><path d="M17,3H7A2,2 0 0,0 5,5V21L12,18L19,21V5C19,3.89 18.1,3 17,3Z" /></svg>',download:'<svg viewBox="0 0 24 24"><path d="M2 12H4V17H20V12H22V17C22 18.11 21.11 19 20 19H4C2.9 19 2 18.11 2 17V12M12 15L17.55 9.54L16.13 8.13L13 11.25V2H11V11.25L7.88 8.13L6.46 9.55L12 15Z" /></svg>',dir_ltr:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M9 4v4c-1.1 0-2-.9-2-2s.9-2 2-2m8-2H9C6.79 2 5 3.79 5 6s1.79 4 4 4v5h2V4h2v11h2V4h2V2zm0 12v3H5v2h12v3l4-4-4-4z"/></svg>',dir_rtl:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M10 4v4c-1.1 0-2-.9-2-2s.9-2 2-2m8-2h-8C7.79 2 6 3.79 6 6s1.79 4 4 4v5h2V4h2v11h2V4h2V2zM8 14l-4 4 4 4v-3h12v-2H8v-3z"/></svg>',alert_outline:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M11,15H13V17H11V15M11,7H13V13H11V7M12,2C6.47,2 2,6.5 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20Z" /></svg>',more_text:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="10 10 180 180"><g><path d="M49.711,142.188h49.027c2.328,0.002,4.394,1.492,5.129,3.699l9.742,29.252c0.363,1.092,1.385,1.828,2.537,1.83l15.883,0.01c0.859,0,1.667-0.412,2.17-1.109s0.641-1.594,0.37-2.41l-16.625-50.045L86.503,28.953c-0.36-1.097-1.383-1.839-2.537-1.842H64.532c-1.153-0.001-2.178,0.736-2.542,1.831L13.847,173.457c-0.271,0.816-0.135,1.713,0.369,2.412c0.503,0.697,1.311,1.109,2.171,1.109h15.872c1.151,0,2.173-0.736,2.537-1.828l9.793-29.287C45.325,143.66,47.39,142.18,49.711,142.188L49.711,142.188z M53.493,119.098l15.607-46.9c0.744-2.196,2.806-3.674,5.125-3.674s4.381,1.478,5.125,3.674l15.607,46.904c0.537,1.621,0.263,3.402-0.736,4.789c-1.018,1.408-2.649,2.24-4.386,2.24H58.615c-1.736,0-3.368-0.832-4.386-2.24C53.23,122.504,52.956,120.721,53.493,119.098L53.493,119.098z M190.465,63.32c0-2.919-1.015-5.396-3.059-7.428c-2.029-2.031-4.496-3.047-7.383-3.047c-2.889,0-5.355,1.016-7.388,3.047c-2.029,2.032-3.056,4.498-3.056,7.386c0,2.889,1.026,5.354,3.056,7.385c2.032,2.032,4.499,3.059,7.388,3.059c2.887,0,5.354-1.026,7.383-3.059C189.45,68.633,190.465,66.178,190.465,63.32L190.465,63.32z M190.465,101.994c0-2.858-1.015-5.313-3.059-7.333c-2.029-2.042-4.496-3.047-7.383-3.047c-2.889,0-5.355,1.005-7.388,3.047c-2.029,2.021-3.056,4.486-3.056,7.376c0,2.887,1.026,5.352,3.056,7.395c2.032,2.021,4.499,3.047,7.388,3.047c2.887,0,5.354-1.025,7.383-3.047C189.45,107.389,190.465,104.914,190.465,101.994L190.465,101.994z M190.465,140.76c0-2.918-1.015-5.395-3.059-7.438c-2.029-2.041-4.496-3.047-7.383-3.047c-2.889,0-5.355,1.006-7.388,3.047c-2.029,2.043-3.056,4.52-3.056,7.438c0,2.922,1.026,5.398,3.056,7.439c2.032,2.021,4.499,3.047,7.388,3.047c2.887,0,5.354-1.025,7.383-3.047C189.45,146.158,190.465,143.682,190.465,140.76L190.465,140.76z"/></g></svg>',more_paragraph:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="10 10 180 180"><g><path d="M128.39,28.499H63.493c-25.558,0-46.354,20.796-46.354,46.354c0,25.559,20.796,46.353,46.354,46.353h9.271v55.625h18.542V47.04h9.271V176.83h18.543V47.04h9.271V28.499z M72.764,102.664h-9.271c-15.337,0-27.813-12.475-27.813-27.812c0-15.336,12.476-27.813,27.813-27.813h9.271V102.664z M190.465,63.32c0-2.919-1.015-5.396-3.059-7.428c-2.029-2.031-4.496-3.047-7.383-3.047c-2.889,0-5.355,1.016-7.388,3.047c-2.029,2.032-3.056,4.498-3.056,7.386c0,2.889,1.026,5.354,3.056,7.385c2.032,2.032,4.499,3.059,7.388,3.059c2.887,0,5.354-1.026,7.383-3.059C189.45,68.633,190.465,66.178,190.465,63.32L190.465,63.32z M190.465,101.994c0-2.858-1.015-5.313-3.059-7.333c-2.029-2.042-4.496-3.047-7.383-3.047c-2.889,0-5.355,1.005-7.388,3.047c-2.029,2.021-3.056,4.486-3.056,7.376c0,2.887,1.026,5.352,3.056,7.395c2.032,2.021,4.499,3.047,7.388,3.047c2.887,0,5.354-1.025,7.383-3.047C189.45,107.389,190.465,104.914,190.465,101.994L190.465,101.994z M190.465,140.76c0-2.918-1.015-5.395-3.059-7.438c-2.029-2.041-4.496-3.047-7.383-3.047c-2.889,0-5.355,1.006-7.388,3.047c-2.029,2.043-3.056,4.52-3.056,7.438c0,2.922,1.026,5.398,3.056,7.439c2.032,2.021,4.499,3.047,7.388,3.047c2.887,0,5.354-1.025,7.383-3.047C189.45,146.158,190.465,143.682,190.465,140.76L190.465,140.76z"/></g></svg>',more_plus:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="35 30 140 140"><g><path d="M137.215,102.045c0,3.498-2.835,6.332-6.333,6.332H24.549c-3.498,0-6.334-2.834-6.334-6.332l0,0c0-3.498,2.836-6.333,6.334-6.333h106.333C134.38,95.711,137.215,98.547,137.215,102.045L137.215,102.045z M77.715,161.545c-3.498,0-6.333-2.836-6.333-6.334V48.878c0-3.498,2.836-6.333,6.333-6.333l0,0c3.498,0,6.334,2.835,6.334,6.333v106.333C84.049,158.709,81.213,161.545,77.715,161.545L77.715,161.545z M190.465,63.32c0-2.919-1.015-5.396-3.059-7.428c-2.029-2.031-4.496-3.047-7.383-3.047c-2.889,0-5.355,1.016-7.388,3.047c-2.029,2.032-3.056,4.498-3.056,7.386c0,2.889,1.026,5.354,3.056,7.385c2.032,2.032,4.499,3.059,7.388,3.059c2.887,0,5.354-1.026,7.383-3.059C189.45,68.632,190.465,66.177,190.465,63.32L190.465,63.32z M190.465,101.993c0-2.858-1.015-5.313-3.059-7.333c-2.029-2.042-4.496-3.047-7.383-3.047c-2.889,0-5.355,1.005-7.388,3.047c-2.029,2.021-3.056,4.486-3.056,7.376c0,2.888,1.026,5.353,3.056,7.396c2.032,2.021,4.499,3.047,7.388,3.047c2.887,0,5.354-1.025,7.383-3.047C189.45,107.389,190.465,104.914,190.465,101.993L190.465,101.993z M190.465,140.76c0-2.918-1.015-5.395-3.059-7.438c-2.029-2.041-4.496-3.047-7.383-3.047c-2.889,0-5.355,1.006-7.388,3.047c-2.029,2.043-3.056,4.52-3.056,7.438c0,2.922,1.026,5.398,3.056,7.439c2.032,2.021,4.499,3.047,7.388,3.047c2.887,0,5.354-1.025,7.383-3.047C189.45,146.158,190.465,143.682,190.465,140.76L190.465,140.76z"/></g></svg>',more_horizontal:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.76 3.58"><g><path d="M4.64,10.73a1.84,1.84,0,0,1,.65-.65,1.76,1.76,0,0,1,1.79,0A1.79,1.79,0,0,1,8,11.63a1.84,1.84,0,0,1-.25.9,1.69,1.69,0,0,1-.65.65,1.8,1.8,0,0,1-2.69-1.55A2.08,2.08,0,0,1,4.64,10.73Zm6.09,0a1.84,1.84,0,0,1,.65-.65,1.78,1.78,0,0,1,2.67,1.55,1.73,1.73,0,0,1-.24.9,1.84,1.84,0,0,1-.65.65,1.76,1.76,0,0,1-1.79,0,1.79,1.79,0,0,1-.64-2.44Zm6.08,0a1.69,1.69,0,0,1,.65-.65,1.76,1.76,0,0,1,1.79,0,1.79,1.79,0,0,1,.9,1.54,1.73,1.73,0,0,1-.24.9,1.84,1.84,0,0,1-.65.65,1.8,1.8,0,0,1-2.69-1.55A2,2,0,0,1,16.81,10.73Z" transform="translate(-4.39 -9.84)"/></g></svg>',more_vertical:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 3.94 15.75"><g><path d="M12.28,7.69a1.92,1.92,0,0,1-1.39-.58,2,2,0,0,1-.58-1.39,1.92,1.92,0,0,1,.58-1.39,2,2,0,0,1,1.39-.58,1.92,1.92,0,0,1,1.39.58,2,2,0,0,1,.58,1.39,1.92,1.92,0,0,1-.58,1.39,2,2,0,0,1-1.39.58Zm0,2a1.92,1.92,0,0,1,1.39.58,2,2,0,0,1,.58,1.39A1.92,1.92,0,0,1,13.67,13a2,2,0,0,1-1.39.58A1.92,1.92,0,0,1,10.89,13a2,2,0,0,1-.58-1.39,2,2,0,0,1,2-2Zm0,5.9a1.92,1.92,0,0,1,1.39.58,2,2,0,0,1,.58,1.39,1.92,1.92,0,0,1-.58,1.39,2,2,0,0,1-1.39.58,1.92,1.92,0,0,1-1.39-.58,2,2,0,0,1-.58-1.39,1.92,1.92,0,0,1,.58-1.39,1.94,1.94,0,0,1,1.39-.58Z" transform="translate(-10.31 -3.75)"/></g></svg>',attachment:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 8.38 15.68"><g><path d="M15.23,6h1v9.78a3.88,3.88,0,0,1-1.31,2.45,4,4,0,0,1-6.57-2.45V7A3,3,0,0,1,9.2,4.89a3,3,0,0,1,5,2.09v8.31a1.92,1.92,0,0,1-.58,1.39,2,2,0,0,1-1.39.58,1.92,1.92,0,0,1-1.39-.58,2,2,0,0,1-.58-1.39V8h1v7.32a1,1,0,0,0,.29.69,1,1,0,0,0,.69.28A.9.9,0,0,0,13,16a1,1,0,0,0,.29-.69V7a1.92,1.92,0,0,0-.58-1.39A2,2,0,0,0,11.27,5a1.92,1.92,0,0,0-1.39.58A2,2,0,0,0,9.33,7v8.31a3,3,0,1,0,5.9,0V6Z" transform="translate(-8.08 -3.78)"/></g></svg>',map:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 11.7 15.62"><g><path d="M12.05,12.42a2.93,2.93,0,1,1,2.07-5A2.88,2.88,0,0,1,15,9.49a3,3,0,0,1-.86,2.07,2.89,2.89,0,0,1-2.07.86Zm0-5.36a2.43,2.43,0,0,0-1.72,4.16,2.48,2.48,0,0,0,1.72.72,2.44,2.44,0,0,0,0-4.88Zm0-3.3A5.84,5.84,0,0,1,17.9,9.62a9.94,9.94,0,0,1-1.73,5A33.59,33.59,0,0,1,12.84,19a1.52,1.52,0,0,1-.23.2,1,1,0,0,1-.55.2h0a1,1,0,0,1-.55-.2,1.52,1.52,0,0,1-.23-.2,33.59,33.59,0,0,1-3.33-4.32,9.93,9.93,0,0,1-1.72-5,5.84,5.84,0,0,1,5.85-5.86ZM12,18.34l.08.05.06-.06a35.58,35.58,0,0,0,3.06-3.93,9.35,9.35,0,0,0,1.74-4.77,4.88,4.88,0,0,0-4.88-4.88A4.79,4.79,0,0,0,8.6,6.17,4.84,4.84,0,0,0,7.17,9.62,9.29,9.29,0,0,0,8.91,14.4,36,36,0,0,0,12,18.34Z" transform="translate(-6.2 -3.76)"/></g></svg>',magic_stick:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.73 15.75"><g><path d="M19.86,19.21a1,1,0,0,0,.28-.68,1,1,0,0,0-.28-.7L13,10.93a1,1,0,0,0-.7-.28,1,1,0,0,0-.68,1.65l6.9,6.9a1,1,0,0,0,.69.29.93.93,0,0,0,.69-.28ZM9.19,8.55a3,3,0,0,0,1.68,0,14.12,14.12,0,0,0,1.41-.32A11.26,11.26,0,0,0,10.8,7.06c-.56-.36-.86-.56-.91-.58S10,5.91,10,5.11s0-1.26-.15-1.37a4.35,4.35,0,0,0-1.19.71c-.53.4-.81.62-.87.68a9,9,0,0,0-2-.6,6.84,6.84,0,0,0-.76-.09s0,.27.08.77a8.6,8.6,0,0,0,.61,2q-.09.09-.69.87a3.59,3.59,0,0,0-.68,1.17c.12.17.57.23,1.36.15S7,9.26,7.15,9.23s.21.36.57.91a10.49,10.49,0,0,0,1.14,1.48c0-.1.14-.57.31-1.4a3,3,0,0,0,0-1.67Z" transform="translate(-4.41 -3.74)"/></g></svg>',empty_file:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12.78 15.75"><g><path d="M14.73,3.76,18.67,7.7v9.84a2,2,0,0,1-2,2H7.84a1.89,1.89,0,0,1-1.38-.58,2,2,0,0,1-.57-1.39V5.73a1.93,1.93,0,0,1,.57-1.38,2,2,0,0,1,1.38-.58h6.62l.26,0v0Zm2.95,4.92h-2a1.93,1.93,0,0,1-1.38-.57,2,2,0,0,1-.58-1.4V6.17c0-.36,0-.84,0-1.43H7.85a1,1,0,0,0-.7.29,1,1,0,0,0-.29.7V17.54a1,1,0,0,0,.29.69,1,1,0,0,0,.69.29h8.85a1,1,0,0,0,.71-.29.92.92,0,0,0,.28-.69Zm0-1L14.73,4.74v2A1,1,0,0,0,15,7.4a1,1,0,0,0,.69.29Z" transform="translate(-5.89 -3.76)"/></g></svg>'};var oh={exports:{}};(function(e){(function(t,n){e.exports=t.document?n(t,!0):function(i){if(!i.document)throw new Error("SUNEDITOR_LANG a window with a document");return n(i)}})(typeof window<"u"?window:Yn,function(t,n){const i={code:"en",toolbar:{default:"Default",save:"Save",font:"Font",formats:"Formats",fontSize:"Size",bold:"Bold",underline:"Underline",italic:"Italic",strike:"Strike",subscript:"Subscript",superscript:"Superscript",removeFormat:"Remove Format",fontColor:"Font Color",hiliteColor:"Highlight Color",indent:"Indent",outdent:"Outdent",align:"Align",alignLeft:"Align left",alignRight:"Align right",alignCenter:"Align center",alignJustify:"Align justify",list:"List",orderList:"Ordered list",unorderList:"Unordered list",horizontalRule:"Horizontal line",hr_solid:"Solid",hr_dotted:"Dotted",hr_dashed:"Dashed",table:"Table",link:"Link",math:"Math",image:"Image",video:"Video",audio:"Audio",fullScreen:"Full screen",showBlocks:"Show blocks",codeView:"Code view",undo:"Undo",redo:"Redo",preview:"Preview",print:"print",tag_p:"Paragraph",tag_div:"Normal (DIV)",tag_h:"Header",tag_blockquote:"Quote",tag_pre:"Code",template:"Template",lineHeight:"Line height",paragraphStyle:"Paragraph style",textStyle:"Text style",imageGallery:"Image gallery",dir_ltr:"Left to right",dir_rtl:"Right to left",mention:"Mention"},dialogBox:{linkBox:{title:"Insert Link",url:"URL to link",text:"Text to display",newWindowCheck:"Open in new window",downloadLinkCheck:"Download link",bookmark:"Bookmark"},mathBox:{title:"Math",inputLabel:"Mathematical Notation",fontSizeLabel:"Font Size",previewLabel:"Preview"},imageBox:{title:"Insert image",file:"Select from files",url:"Image URL",altText:"Alternative text"},videoBox:{title:"Insert Video",file:"Select from files",url:"Media embed URL, YouTube/Vimeo"},audioBox:{title:"Insert Audio",file:"Select from files",url:"Audio URL"},browser:{tags:"Tags",search:"Search"},caption:"Insert description",close:"Close",submitButton:"Submit",revertButton:"Revert",proportion:"Constrain proportions",basic:"Basic",left:"Left",right:"Right",center:"Center",width:"Width",height:"Height",size:"Size",ratio:"Ratio"},controller:{edit:"Edit",unlink:"Unlink",remove:"Remove",insertRowAbove:"Insert row above",insertRowBelow:"Insert row below",deleteRow:"Delete row",insertColumnBefore:"Insert column before",insertColumnAfter:"Insert column after",deleteColumn:"Delete column",fixedColumnWidth:"Fixed column width",resize100:"Resize 100%",resize75:"Resize 75%",resize50:"Resize 50%",resize25:"Resize 25%",autoSize:"Auto size",mirrorHorizontal:"Mirror, Horizontal",mirrorVertical:"Mirror, Vertical",rotateLeft:"Rotate left",rotateRight:"Rotate right",maxSize:"Max size",minSize:"Min size",tableHeader:"Table header",mergeCells:"Merge cells",splitCells:"Split Cells",HorizontalSplit:"Horizontal split",VerticalSplit:"Vertical split"},menu:{spaced:"Spaced",bordered:"Bordered",neon:"Neon",translucent:"Translucent",shadow:"Shadow",code:"Code"}};return typeof n>"u"&&(t.SUNEDITOR_LANG||Object.defineProperty(t,"SUNEDITOR_LANG",{enumerable:!0,writable:!1,configurable:!1,value:{}}),Object.defineProperty(t.SUNEDITOR_LANG,"en",{enumerable:!0,writable:!0,configurable:!0,value:i})),i})})(oh);var EC=oh.exports;const NC=Zn(EC),pe={_d:null,_w:null,isIE:null,isIE_Edge:null,isOSX_IOS:null,isChromium:null,isMobile:null,isResizeObserverSupported:null,_propertiesInit:function(){this._d||(this._d=document,this._w=window,this.isIE=navigator.userAgent.indexOf("Trident")>-1,this.isIE_Edge=navigator.userAgent.indexOf("Trident")>-1||navigator.appVersion.indexOf("Edge")>-1,this.isOSX_IOS=/(Mac|iPhone|iPod|iPad)/.test(navigator.platform),this.isChromium=!!window.chrome,this.isResizeObserverSupported=typeof ResizeObserver=="function",this.isMobile=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||(navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0)&&"ontouchstart"in window)},_allowedEmptyNodeList:".se-component, pre, blockquote, hr, li, table, img, iframe, video, audio, canvas",_HTMLConvertor:function(e){const t={"&":"&"," ":" ","'":"'",'"':""","<":"<",">":">"};return e.replace(/&|\u00A0|'|"|<|>/g,function(n){return typeof t[n]=="string"?t[n]:n})},zeroWidthSpace:"",zeroWidthRegExp:new RegExp("","g"),onlyZeroWidthRegExp:new RegExp("^+$"),fontValueMap:{"xx-small":1,"x-small":2,small:3,medium:4,large:5,"x-large":6,"xx-large":7},onlyZeroWidthSpace:function(e){return e==null?!1:(typeof e!="string"&&(e=e.textContent),e===""||this.onlyZeroWidthRegExp.test(e))},getXMLHttpRequest:function(){if(this._w.ActiveXObject)try{return new ActiveXObject("Msxml2.XMLHTTP")}catch{try{return new ActiveXObject("Microsoft.XMLHTTP")}catch{return null}}else return this._w.XMLHttpRequest?new XMLHttpRequest:null},getValues:function(e){return e?this._w.Object.keys(e).map(function(t){return e[t]}):[]},camelToKebabCase:function(e){return typeof e=="string"?e.replace(/[A-Z]/g,function(t){return"-"+t.toLowerCase()}):e.map(function(t){return pe.camelToKebabCase(t)})},kebabToCamelCase:function(e){return typeof e=="string"?e.replace(/-[a-zA-Z]/g,function(t){return t.replace("-","").toUpperCase()}):e.map(function(t){return pe.camelToKebabCase(t)})},createElement:function(e){return this._d.createElement(e)},createTextNode:function(e){return this._d.createTextNode(e||"")},HTMLEncoder:function(e){const t={"<":"$lt;",">":"$gt;"};return e.replace(/<|>/g,function(n){return typeof t[n]=="string"?t[n]:n})},HTMLDecoder:function(e){const t={"$lt;":"<","$gt;":">"};return e.replace(/\$lt;|\$gt;/g,function(n){return typeof t[n]=="string"?t[n]:n})},hasOwn:function(e,t){return this._hasOwn.call(e,t)},_hasOwn:Object.prototype.hasOwnProperty,getIncludePath:function(e,t){let n="";const i=[],s=t==="js"?"script":"link",o=t==="js"?"src":"href";let l="(?:";for(let f=0,d=e.length;f<d;f++)l+=e[f]+(f<d-1?"|":")");const a=new this._w.RegExp("(^|.*[\\/])"+l+"(\\.[^\\/]+)?."+t+"(?:\\?.*|;.*)?$","i"),r=new this._w.RegExp(".+\\."+t+"(?:\\?.*|;.*)?$","i");for(let f=this._d.getElementsByTagName(s),d=0;d<f.length;d++)r.test(f[d][o])&&i.push(f[d]);for(let f=0;f<i.length;f++){let d=i[f][o].match(a);if(d){n=d[0];break}}if(n===""&&(n=i.length>0?i[0][o]:""),n.indexOf(":/")===-1&&n.slice(0,2)!=="//"&&(n=n.indexOf("/")===0?location.href.match(/^.*?:\/\/[^\/]*/)[0]+n:location.href.match(/^[^\?]*\/(?:)/)[0]+n),!n)throw"[SUNEDITOR.util.getIncludePath.fail] The SUNEDITOR installation path could not be automatically detected. (name: +"+name+", extension: "+t+")";return n},getPageStyle:function(e){let t="";const n=(e||this._d).styleSheets;for(let i=0,s=n.length,o;i<s;i++){try{o=n[i].cssRules}catch{continue}if(o)for(let l=0,a=o.length;l<a;l++)t+=o[l].cssText}return t},getIframeDocument:function(e){let t=e.contentWindow||e.contentDocument;return t.document&&(t=t.document),t},getAttributesToString:function(e,t){if(!e.attributes)return"";const n=e.attributes;let i="";for(let s=0,o=n.length;s<o;s++)t&&t.indexOf(n[s].name)>-1||(i+=n[s].name+'="'+n[s].value+'" ');return i},getByteLength:function(e){if(!e||!e.toString)return 0;e=e.toString();const t=this._w.encodeURIComponent;let n,i;return this.isIE_Edge?(i=this._w.unescape(t(e)).length,n=0,t(e).match(/(%0A|%0D)/gi)!==null&&(n=t(e).match(/(%0A|%0D)/gi).length),i+n):(i=new this._w.TextEncoder("utf-8").encode(e).length,n=0,t(e).match(/(%0A|%0D)/gi)!==null&&(n=t(e).match(/(%0A|%0D)/gi).length),i+n)},isWysiwygDiv:function(e){return e&&e.nodeType===1&&(this.hasClass(e,"se-wrapper-wysiwyg")||/^BODY$/i.test(e.nodeName))},isNonEditable:function(e){return e&&e.nodeType===1&&e.getAttribute("contenteditable")==="false"},isTextStyleElement:function(e){return e&&e.nodeType!==3&&/^(strong|span|font|b|var|i|em|u|ins|s|strike|del|sub|sup|mark|a|label|code|summary)$/i.test(e.nodeName)},isInputElement:function(e){return e&&e.nodeType===1&&/^(INPUT|TEXTAREA)$/i.test(e.nodeName)},isFormatElement:function(e){return e&&e.nodeType===1&&(/^(P|DIV|H[1-6]|PRE|LI|TH|TD|DETAILS)$/i.test(e.nodeName)||this.hasClass(e,"(\\s|^)__se__format__replace_.+(\\s|$)|(\\s|^)__se__format__free_.+(\\s|$)"))&&!this.isComponent(e)&&!this.isWysiwygDiv(e)},isRangeFormatElement:function(e){return e&&e.nodeType===1&&(/^(BLOCKQUOTE|OL|UL|FIGCAPTION|TABLE|THEAD|TBODY|TR|TH|TD|DETAILS)$/i.test(e.nodeName)||this.hasClass(e,"(\\s|^)__se__format__range_.+(\\s|$)"))},isClosureRangeFormatElement:function(e){return e&&e.nodeType===1&&(/^(TH|TD)$/i.test(e.nodeName)||this.hasClass(e,"(\\s|^)__se__format__range__closure_.+(\\s|$)"))},isFreeFormatElement:function(e){return e&&e.nodeType===1&&(/^PRE$/i.test(e.nodeName)||this.hasClass(e,"(\\s|^)__se__format__free_.+(\\s|$)"))&&!this.isComponent(e)&&!this.isWysiwygDiv(e)},isClosureFreeFormatElement:function(e){return e&&e.nodeType===1&&this.hasClass(e,"(\\s|^)__se__format__free__closure_.+(\\s|$)")},isComponent:function(e){return e&&(/se-component/.test(e.className)||/^(TABLE|HR)$/.test(e.nodeName))},isUneditableComponent:function(e){return e&&this.hasClass(e,"__se__uneditable")},isMediaComponent:function(e){return e&&/se-component/.test(e.className)},isNotCheckingNode:function(e){return e&&/katex|__se__tag/.test(e.className)},getFormatElement:function(e,t){if(!e)return null;for(t||(t=function(){return!0});e;){if(this.isWysiwygDiv(e))return null;if(this.isRangeFormatElement(e)&&e.firstElementChild,this.isFormatElement(e)&&t(e))return e;e=e.parentNode}return null},getRangeFormatElement:function(e,t){if(!e)return null;for(t||(t=function(){return!0});e;){if(this.isWysiwygDiv(e))return null;if(this.isRangeFormatElement(e)&&!/^(THEAD|TBODY|TR)$/i.test(e.nodeName)&&t(e))return e;e=e.parentNode}return null},getFreeFormatElement:function(e,t){if(!e)return null;for(t||(t=function(){return!0});e;){if(this.isWysiwygDiv(e))return null;if(this.isFreeFormatElement(e)&&t(e))return e;e=e.parentNode}return null},getClosureFreeFormatElement:function(e,t){if(!e)return null;for(t||(t=function(){return!0});e;){if(this.isWysiwygDiv(e))return null;if(this.isClosureFreeFormatElement(e)&&t(e))return e;e=e.parentNode}return null},copyTagAttributes:function(e,t,n){if(t.style.cssText){const s=t.style;for(let o=0,l=s.length;o<l;o++)e.style[s[o]]=s[s[o]]}const i=t.attributes;for(let s=0,o=i.length,l;s<o;s++)l=i[s].name.toLowerCase(),n&&n.indexOf(l)>-1||!i[s].value?e.removeAttribute(l):l!=="style"&&e.setAttribute(i[s].name,i[s].value)},copyFormatAttributes:function(e,t){t=t.cloneNode(!1),t.className=t.className.replace(/(\s|^)__se__format__[^\s]+/g,""),this.copyTagAttributes(e,t)},getArrayItem:function(e,t,n){if(!e||e.length===0)return null;t=t||function(){return!0};const i=[];for(let s=0,o=e.length,l;s<o;s++)if(l=e[s],t(l))if(n)i.push(l);else return l;return n?i:null},arrayIncludes:function(e,t){for(let n=0;n<e.length;n++)if(e[n]===t)return!0;return!1},getArrayIndex:function(e,t){let n=-1;for(let i=0,s=e.length;i<s;i++)if(e[i]===t){n=i;break}return n},nextIdx:function(e,t){let n=this.getArrayIndex(e,t);return n===-1?-1:n+1},prevIdx:function(e,t){let n=this.getArrayIndex(e,t);return n===-1?-1:n-1},getPositionIndex:function(e){let t=0;for(;e=e.previousSibling;)t+=1;return t},getNodePath:function(e,t,n){const i=[];let s=!0;return this.getParentElement(e,(function(o){if(o===t&&(s=!1),s&&!this.isWysiwygDiv(o)){if(n&&o.nodeType===3){let l=null,a=null;n.s=n.e=0;let r=o.previousSibling;for(;r&&r.nodeType===3;)a=r.textContent.replace(this.zeroWidthRegExp,""),n.s+=a.length,o.textContent=a+o.textContent,l=r,r=r.previousSibling,this.removeItem(l);let f=o.nextSibling;for(;f&&f.nodeType===3;)a=f.textContent.replace(this.zeroWidthRegExp,""),n.e+=a.length,o.textContent+=a,l=f,f=f.nextSibling,this.removeItem(l)}i.push(o)}return!1}).bind(this)),i.map(this.getPositionIndex).reverse()},getNodeFromPath:function(e,t){let n=t,i;for(let s=0,o=e.length;s<o&&(i=n.childNodes,i.length!==0);s++)i.length<=e[s]?n=i[i.length-1]:n=i[e[s]];return n},isSameAttributes:function(e,t){if(e.nodeType===3&&t.nodeType===3)return!0;if(e.nodeType===3||t.nodeType===3)return!1;const n=e.style,i=t.style;let s=0;for(let f=0,d=n.length;f<d;f++)n[n[f]]===i[n[f]]&&s++;const o=e.classList,l=t.classList,a=this._w.RegExp;let r=0;for(let f=0,d=o.length;f<d;f++)a("(s|^)"+o[f]+"(s|$)").test(l.value)&&r++;return s===i.length&&s===n.length&&r===l.length&&r===o.length},isEmptyLine:function(e){return!e||!e.parentNode||!e.querySelector("IMG, IFRAME, AUDIO, VIDEO, CANVAS, TABLE")&&e.children.length===0&&this.onlyZeroWidthSpace(e.textContent)},isSpanWithoutAttr:function(e){return!!e&&e.nodeType===1&&/^SPAN$/i.test(e.nodeName)&&!e.className&&!e.style.cssText},isList:function(e){return e&&/^(OL|UL)$/i.test(typeof e=="string"?e:e.nodeName)},isListCell:function(e){return e&&/^LI$/i.test(typeof e=="string"?e:e.nodeName)},isTable:function(e){return e&&/^(TABLE|THEAD|TBODY|TR|TH|TD)$/i.test(typeof e=="string"?e:e.nodeName)},isCell:function(e){return e&&/^(TD|TH)$/i.test(typeof e=="string"?e:e.nodeName)},isBreak:function(e){return e&&/^BR$/i.test(typeof e=="string"?e:e.nodeName)},isAnchor:function(e){return e&&/^A$/i.test(typeof e=="string"?e:e.nodeName)},isMedia:function(e){return e&&/^(IMG|IFRAME|AUDIO|VIDEO|CANVAS)$/i.test(typeof e=="string"?e:e.nodeName)},isFigures:function(e){return e&&(this.isMedia(e)||/^(FIGURE)$/i.test(typeof e=="string"?e:e.nodeName))},isNumber:function(e){return!!e&&/^-?\d+(\.\d+)?$/.test(e+"")},getNumber:function(e,t){if(!e)return 0;let n=(e+"").match(/-?\d+(\.\d+)?/);return!n||!n[0]?0:(n=n[0],t<0?n*1:t===0?this._w.Math.round(n*1):(n*1).toFixed(t)*1)},getListChildren:function(e,t){const n=[];return!e||!e.children||e.children.length===0||(t=t||function(){return!0},function i(s){if(e!==s&&t(s)&&n.push(s),s.children)for(let o=0,l=s.children.length;o<l;o++)i(s.children[o])}(e)),n},getListChildNodes:function(e,t){const n=[];return!e||e.childNodes.length===0||(t=t||function(){return!0},function i(s){e!==s&&t(s)&&n.push(s);for(let o=0,l=s.childNodes.length;o<l;o++)i(s.childNodes[o])}(e)),n},getElementDepth:function(e){if(!e||this.isWysiwygDiv(e))return-1;let t=0;for(e=e.parentNode;e&&!this.isWysiwygDiv(e);)t+=1,e=e.parentNode;return t},compareElements:function(e,t){let n=e,i=t;for(;n&&i&&n.parentNode!==i.parentNode;)n=n.parentNode,i=i.parentNode;if(!n||!i)return{ancestor:null,a:e,b:t,result:0};const s=n.parentNode.childNodes,o=this.getArrayIndex(s,n),l=this.getArrayIndex(s,i);return{ancestor:n.parentNode,a:n,b:i,result:o>l?1:o<l?-1:0}},getParentElement:function(e,t){let n;if(typeof t=="function")n=t;else{let i;/^\./.test(t)?(i="className",t=t.split(".")[1]):/^#/.test(t)?(i="id",t="^"+t.split("#")[1]+"$"):/^:/.test(t)?(i="name",t="^"+t.split(":")[1]+"$"):(i="nodeName",t="^"+t+"$");const s=new this._w.RegExp(t,"i");n=function(o){return s.test(o[i])}}for(;e&&!n(e);){if(this.isWysiwygDiv(e))return null;e=e.parentNode}return e},getPreviousDeepestNode:function(e,t){let n=e.previousSibling;if(!n){for(let i=e.parentNode;i;i=i.parentNode){if(i===t)return null;if(i.previousSibling){n=i.previousSibling;break}}if(!n)return null}for(;n.lastChild;)n=n.lastChild;return n},getNextDeepestNode:function(e,t){let n=e.nextSibling;if(!n){for(let i=e.parentNode;i;i=i.parentNode){if(i===t)return null;if(i.nextSibling){n=i.nextSibling;break}}if(!n)return null}for(;n.firstChild;)n=n.firstChild;return n},getChildElement:function(e,t,n){let i;if(typeof t=="function")i=t;else{let o;/^\./.test(t)?(o="className",t=t.split(".")[1]):/^#/.test(t)?(o="id",t="^"+t.split("#")[1]+"$"):/^:/.test(t)?(o="name",t="^"+t.split(":")[1]+"$"):(o="nodeName",t="^"+(t==="text"?"#"+t:t)+"$");const l=new this._w.RegExp(t,"i");i=function(a){return l.test(a[o])}}const s=this.getListChildNodes(e,function(o){return i(o)});return s[n?s.length-1:0]},getEdgeChildNodes:function(e,t){if(e){for(t||(t=e);e&&e.nodeType===1&&e.childNodes.length>0&&!this.isBreak(e);)e=e.firstChild;for(;t&&t.nodeType===1&&t.childNodes.length>0&&!this.isBreak(t);)t=t.lastChild;return{sc:e,ec:t||e}}},getOffset:function(e,t){let n=0,i=0,s=e.nodeType===3?e.parentElement:e;const o=this.getParentElement(e,this.isWysiwygDiv.bind(this));for(;s&&!this.hasClass(s,"se-container")&&s!==o;)n+=s.offsetLeft,i+=s.offsetTop,s=s.offsetParent;const l=t&&/iframe/i.test(t.nodeName);return{left:n+(l?t.parentElement.offsetLeft:0),top:i-(o?o.scrollTop:0)+(l?t.parentElement.offsetTop:0)}},getOverlapRangeAtIndex:function(e,t,n,i){if(e<=i?t<n:t>n)return 0;const s=(e>n?e:n)-(t<i?t:i);return(s<0?s*-1:s)+1},changeTxt:function(e,t){!e||!t||(e.textContent=t)},changeElement:function(e,t){if(typeof t=="string")if(e.outerHTML)e.outerHTML=t;else{const n=this.createElement("DIV");n.innerHTML=t,t=n.firstChild,e.parentNode.replaceChild(t,e)}else t.nodeType===1&&e.parentNode.replaceChild(t,e)},setStyle:function(e,t,n){e.style[t]=n,!n&&!e.style.cssText&&e.removeAttribute("style")},hasClass:function(e,t){if(e)return new this._w.RegExp(t).test(e.className)},addClass:function(e,t){!e||new this._w.RegExp("(\\s|^)"+t+"(\\s|$)").test(e.className)||(e.className+=(e.className.length>0?" ":"")+t)},removeClass:function(e,t){if(!e)return;const n=new this._w.RegExp("(\\s|^)"+t+"(\\s|$)");e.className=e.className.replace(n," ").trim(),e.className.trim()||e.removeAttribute("class")},toggleClass:function(e,t){if(!e)return;let n=!1;const i=new this._w.RegExp("(\\s|^)"+t+"(\\s|$)");return i.test(e.className)?e.className=e.className.replace(i," ").trim():(e.className+=" "+t,n=!0),e.className.trim()||e.removeAttribute("class"),n},isImportantDisabled:function(e){return e.hasAttribute("data-important-disabled")},setDisabledButtons:function(e,t,n){for(let i=0,s=t.length;i<s;i++){let o=t[i];(n||!this.isImportantDisabled(o))&&(o.disabled=e),n&&(e?o.setAttribute("data-important-disabled",""):o.removeAttribute("data-important-disabled"))}},removeItem:function(e){e&&(typeof e.remove=="function"?e.remove():e.parentNode&&e.parentNode.removeChild(e))},removeItemAllParents:function(e,t,n){if(!e)return null;let i=null;return t||(t=(function(s){if(s===n||this.isComponent(s))return!1;const o=s.textContent.trim();return o.length===0||/^(\n|\u200B)+$/.test(o)}).bind(this)),function s(o){if(!pe.isWysiwygDiv(o)){const l=o.parentNode;l&&t(o)&&(i={sc:o.previousElementSibling,ec:o.nextElementSibling},pe.removeItem(o),s(l))}}(e),i},detachNestedList:function(e,t){const n=this._deleteNestedList(e);let i,s;if(n){i=n.cloneNode(!1),s=n.childNodes;const l=this.getPositionIndex(e);for(;s[l];)i.appendChild(s[l])}else i=e;let o;if(t)o=this.getListChildren(i,(function(l){return this.isListCell(l)&&!l.previousElementSibling}).bind(this));else{const l=this.getElementDepth(e)+2;o=this.getListChildren(e,(function(a){return this.isListCell(a)&&!a.previousElementSibling&&this.getElementDepth(a)===l}).bind(this))}for(let l=0,a=o.length;l<a;l++)this._deleteNestedList(o[l]);return n&&(n.parentNode.insertBefore(i,n.nextSibling),s&&s.length===0&&this.removeItem(n)),i===e?i.parentNode:i},_deleteNestedList:function(e){const t=e.parentNode;let n=t,i=n.parentNode,s,o,l,a,r;for(;this.isListCell(i);){for(a=this.getPositionIndex(e),s=i.nextElementSibling,o=i.parentNode,l=n;l;){if(n=n.nextSibling,this.isList(l)){for(r=l.childNodes;r[a];)o.insertBefore(r[a],s);r.length===0&&this.removeItem(l)}else o.appendChild(l);l=n}n=o,i=o.parentNode}return t.children.length===0&&this.removeItem(t),o},splitElement:function(e,t,n){if(this.isWysiwygDiv(e))return e;if(t&&!this.isNumber(t)){const b=e.childNodes;let _=this.getPositionIndex(t);const C=e.cloneNode(!1),S=e.cloneNode(!1);for(let c=0,u=b.length;c<u;c++){if(c<_)C.appendChild(b[c]);else if(c>_)S.appendChild(b[c]);else continue;c--,u--,_--}return C.childNodes.length>0&&e.parentNode.insertBefore(C,e),S.childNodes.length>0&&e.parentNode.insertBefore(S,e.nextElementSibling),e}const i=e.parentNode;let s=0,o=1,l=!0,a,r,f;if((!n||n<0)&&(n=0),e.nodeType===3){if(s=this.getPositionIndex(e),t>=0&&e.length!==t){e.splitText(t);const b=this.getNodeFromPath([s+1],i);this.onlyZeroWidthSpace(b)&&(b.data=this.zeroWidthSpace)}}else if(e.nodeType===1){if(t===0){for(;e.firstChild;)e=e.firstChild;if(e.nodeType===3){const b=this.createTextNode(this.zeroWidthSpace);e.parentNode.insertBefore(b,e),e=b}}e.previousSibling?e=e.previousSibling:this.getElementDepth(e)===n&&(l=!1)}e.nodeType===1&&(o=0);let d=e;for(;this.getElementDepth(d)>n;)for(s=this.getPositionIndex(d)+o,d=d.parentNode,f=a,a=d.cloneNode(!1),r=d.childNodes,f&&(this.isListCell(a)&&this.isList(f)&&f.firstElementChild?(a.innerHTML=f.firstElementChild.innerHTML,pe.removeItem(f.firstElementChild),f.children.length>0&&a.appendChild(f)):a.appendChild(f));r[s];)a.appendChild(r[s]);d.childNodes.length<=1&&(!d.firstChild||d.firstChild.textContent.length===0)&&(d.innerHTML="<br>");const h=d.parentNode;return l&&(d=d.nextSibling),a?(this.mergeSameTags(a,null,!1),this.mergeNestedTags(a,(function(b){return this.isList(b)}).bind(this)),a.childNodes.length>0?h.insertBefore(a,d):a=d,this.isListCell(a)&&a.children&&this.isList(a.children[0])&&a.insertBefore(this.createElement("BR"),a.children[0]),i.childNodes.length===0&&this.removeItem(i),a):d},mergeSameTags:function(e,t,n){const i=this,s=t?t.length:0;let o=null;return s&&(o=this._w.Array.apply(null,new this._w.Array(s)).map(this._w.Number.prototype.valueOf,0)),function l(a,r,f){const d=a.childNodes;for(let h=0,b=d.length,_,C;h<b&&(_=d[h],C=d[h+1],!!_);h++)if(!(i.isBreak(_)||i.isMedia(_)||i.isInputElement(_))){if(n&&i._isIgnoreNodeChange(_)||!n&&(i.isTable(_)||i.isListCell(_)||i.isFormatElement(_)&&!i.isFreeFormatElement(_))){(i.isTable(_)||i.isListCell(_))&&l(_,r+1,h);continue}if(b===1&&a.nodeName===_.nodeName&&a.parentNode){if(s){let S,c,u,p,v;for(let y=0;y<s;y++)if(S=t[y],S&&S[r]===h){for(c=_,u=a,p=r,v=!0;p>=0;){if(i.getArrayIndex(u.childNodes,c)!==S[p]){v=!1;break}c=_.parentNode,u=c.parentNode,p--}v&&(S.splice(r,1),S[r]=h)}}i.copyTagAttributes(_,a),a.parentNode.insertBefore(_,a),i.removeItem(a)}if(!C){_.nodeType===1&&l(_,r+1,h);break}if(_.nodeName===C.nodeName&&i.isSameAttributes(_,C)&&_.href===C.href){const S=_.childNodes;let c=0;for(let y=0,w=S.length;y<w;y++)S[y].textContent.length>0&&c++;const u=_.lastChild,p=C.firstChild;let v=0;if(u&&p){const y=u.nodeType===3&&p.nodeType===3;v=u.textContent.length;let w=u.previousSibling;for(;w&&w.nodeType===3;)v+=w.textContent.length,w=w.previousSibling;if(c>0&&u.nodeType===3&&p.nodeType===3&&(u.textContent.length>0||p.textContent.length>0)&&c--,s){let x=null;for(let E=0;E<s;E++)if(x=t[E],x&&x[r]>h){if(r>0&&x[r-1]!==f)continue;x[r]-=1,x[r+1]>=0&&x[r]===h&&(x[r+1]+=c,y&&u&&u.nodeType===3&&p&&p.nodeType===3&&(o[E]+=v))}}}if(_.nodeType===3){if(v=_.textContent.length,_.textContent+=C.textContent,s){let y=null;for(let w=0;w<s;w++)if(y=t[w],y&&y[r]>h){if(r>0&&y[r-1]!==f)continue;y[r]-=1,y[r+1]>=0&&y[r]===h&&(y[r+1]+=c,o[w]+=v)}}}else _.innerHTML+=C.innerHTML;i.removeItem(C),h--}else _.nodeType===1&&l(_,r+1,h)}}(e,0,0),o},mergeNestedTags:function(e,t){typeof t=="string"?t=(function(n){return this.test(n.tagName)}).bind(new this._w.RegExp("^("+(t||".+")+")$","i")):typeof t!="function"&&(t=function(){return!0}),function n(i){let s=i.children;if(s.length===1&&s[0].nodeName===i.nodeName&&t(i)){const o=s[0];for(s=o.children;s[0];)i.appendChild(s[0]);i.removeChild(o)}for(let o=0,l=i.children.length;o<l;o++)n(i.children[o])}(e)},removeEmptyNode:function(e,t,n){const i=this;t&&(t=i.getParentElement(t,function(s){return e===s.parentElement})),function s(o){if(i._notTextNode(o)||o===t||i.isNonEditable(o))return 0;if(o!==e&&i.onlyZeroWidthSpace(o.textContent)&&(!o.firstChild||!i.isBreak(o.firstChild))&&!o.querySelector(i._allowedEmptyNodeList)){if(o.parentNode)return o.parentNode.removeChild(o),-1}else{const l=o.children;for(let a=0,r=l.length,f=0;a<r;a++)!l[a+f]||i.isComponent(l[a+f])||(f+=s(l[a+f]))}return 0}(e),e.childNodes.length===0&&(n?this.removeItem(e):e.innerHTML="<br>")},htmlRemoveWhiteSpace:function(e){return e?e.trim().replace(/<\/?(?!strong|span|font|b|var|i|em|u|ins|s|strike|del|sub|sup|mark|a|label|code|summary)[^>^<]+>\s+(?=<)/ig,function(t){return t.replace(/\n/g,"").replace(/\s+/," ")}):""},htmlCompress:function(e){return e.replace(/\n/g,"").replace(/>\s+</g,"> <")},sortByDepth:function(e,t){const n=t?1:-1,i=n*-1;e.sort((function(s,o){return!this.isListCell(s)||!this.isListCell(o)?0:(s=this.getElementDepth(s),o=this.getElementDepth(o),s>o?n:s<o?i:0)}).bind(this))},escapeStringRegexp:function(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")},_isExcludeSelectionElement:function(e){return!/FIGCAPTION/i.test(e.nodeName)&&(this.isComponent(e)||/FIGURE/i.test(e.nodeName))},_isIgnoreNodeChange:function(e){return e&&e.nodeType!==3&&(this.isNonEditable(e)||!this.isTextStyleElement(e))},_isMaintainedNode:function(e){return e&&e.nodeType!==3&&/^(a|label|code|summary)$/i.test(typeof e=="string"?e:e.nodeName)},_isSizeNode:function(e){return e&&e.nodeType!==3&&this.isTextStyleElement(e)&&!!e.style.fontSize},_notTextNode:function(e){return e&&e.nodeType!==3&&(this.isComponent(e)||/^(br|input|select|canvas|img|iframe|audio|video)$/i.test(typeof e=="string"?e:e.nodeName))},_disallowedTags:function(e){return/^(meta|script|link|style|[a-z]+\:[a-z]+)$/i.test(e.nodeName)},createTagsWhitelist:function(e){return new RegExp("<\\/?\\b(?!\\b"+(e||"").replace(/\|/g,"\\b|\\b")+"\\b)[^>]*>","gi")},createTagsBlacklist:function(e){return new RegExp("<\\/?\\b(?:\\b"+(e||"^").replace(/\|/g,"\\b|\\b")+"\\b)[^>]*>","gi")},_consistencyCheckOfHTML:function(e,t,n,i,s){const o=[],l=[],a=[],r=[],f=this.getListChildNodes(e,(function(h){if(h.nodeType!==1)return this.isList(h.parentElement)&&o.push(h),!1;if(n.test(h.nodeName)||!t.test(h.nodeName)&&h.childNodes.length===0&&this.isNotCheckingNode(h))return o.push(h),!1;const b=!this.getParentElement(h,this.isNotCheckingNode);if(!this.isTable(h)&&!this.isListCell(h)&&!this.isAnchor(h)&&(this.isFormatElement(h)||this.isRangeFormatElement(h)||this.isTextStyleElement(h))&&h.childNodes.length===0&&b)return l.push(h),!1;if(this.isList(h.parentNode)&&!this.isList(h)&&!this.isListCell(h))return a.push(h),!1;if(this.isCell(h)){const C=h.firstElementChild;if(!this.isFormatElement(C)&&!this.isRangeFormatElement(C)&&!this.isComponent(C))return r.push(h),!1}if(b&&h.className){const C=new this._w.Array(h.classList).map(i).join(" ").trim();C?h.className=C:h.removeAttribute("class")}return s&&h.parentNode!==e&&b&&(this.isListCell(h)&&!this.isList(h.parentNode)||(this.isFormatElement(h)||this.isComponent(h))&&!this.isRangeFormatElement(h.parentNode)&&!this.getParentElement(h,this.isComponent))}).bind(this));for(let h=0,b=o.length;h<b;h++)this.removeItem(o[h]);const d=[];for(let h=0,b=f.length,_,C;h<b;h++)if(_=f[h],C=_.parentNode,!(!C||!C.parentNode))if(this.getParentElement(_,this.isListCell)){const S=_.childNodes;for(let c=S.length-1;b>=0;c--)C.insertBefore(_,S[c]);d.push(_)}else C.parentNode.insertBefore(_,C),d.push(C);for(let h=0,b=d.length,_;h<b;h++)_=d[h],this.onlyZeroWidthSpace(_.textContent.trim())&&this.removeItem(_);for(let h=0,b=l.length;h<b;h++)this.removeItem(l[h]);for(let h=0,b=a.length,_,C,S,c;h<b;h++)if(_=a[h],c=_.parentNode,!!c)if(C=this.createElement("LI"),this.isFormatElement(_)){for(S=_.childNodes;S[0];)C.appendChild(S[0]);c.insertBefore(C,_),this.removeItem(_)}else _=_.nextSibling,C.appendChild(a[h]),c.insertBefore(C,_);for(let h=0,b=r.length,_,C;h<b;h++)_=r[h],C=this.createElement("DIV"),C.innerHTML=_.textContent.trim().length===0&&_.children.length===0?"<br>":_.innerHTML,_.innerHTML=C.outerHTML},_setDefaultOptionStyle:function(e,t){let n="";e.height&&(n+="height:"+e.height+";"),e.minHeight&&(n+="min-height:"+e.minHeight+";"),e.maxHeight&&(n+="max-height:"+e.maxHeight+";"),e.position&&(n+="position:"+e.position+";"),e.width&&(n+="width:"+e.width+";"),e.minWidth&&(n+="min-width:"+e.minWidth+";"),e.maxWidth&&(n+="max-width:"+e.maxWidth+";");let i="",s="",o="";t=n+t;const l=t.split(";");for(let a=0,r=l.length,f;a<r;a++)if(f=l[a].trim(),!!f){if(/^(min-|max-)?width\s*:/.test(f)||/^(z-index|position)\s*:/.test(f)){i+=f+";";continue}if(/^(min-|max-)?height\s*:/.test(f)){/^height/.test(f)&&f.split(":")[1].trim()==="auto"&&(e.height="auto"),s+=f+";";continue}o+=f+";"}return{top:i,frame:s,editor:o}},_setIframeDocument:function(e,t){e.setAttribute("scrolling","auto"),e.contentDocument.head.innerHTML='<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">'+this._setIframeCssTags(t),e.contentDocument.body.className=t._editableClass,e.contentDocument.body.setAttribute("contenteditable",!0),e.contentDocument.body.setAttribute("autocorrect","off")},_setIframeCssTags:function(e){const t=e.iframeCSSFileName,n=this._w.RegExp;let i="";for(let s=0,o=t.length,l;s<o;s++){if(l=[],/(^https?:\/\/)|(^data:text\/css,)/.test(t[s]))l.push(t[s]);else{const a=new n("(^|.*[\\/])"+t[s]+"(\\..+)?\\.css(?:\\?.*|;.*)?$","i");for(let r=document.getElementsByTagName("link"),f=0,d=r.length,h;f<d;f++)h=r[f].href.match(a),h&&l.push(h[0])}if(!l||l.length===0)throw'[SUNEDITOR.constructor.iframe.fail] The suneditor CSS files installation path could not be automatically detected. Please set the option property "iframeCSSFileName" before creating editor instances.';for(let a=0,r=l.length;a<r;a++)i+='<link href="'+l[a]+'" rel="stylesheet">'}return i+(e.height==="auto"?`<style>
|
|
242
|
+
/** Iframe height auto */
|
|
243
|
+
body{height: min-content; overflow: hidden;}
|
|
244
|
+
</style>`:"")}},Zr={init:function(e,t){typeof t!="object"&&(t={});const n=document;this._initOptions(e,t);const i=n.createElement("DIV");i.className="sun-editor"+(t.rtl?" se-rtl":""),e.id&&(i.id="suneditor_"+e.id);const s=n.createElement("DIV");s.className="se-container";const o=this._createToolBar(n,t.buttonList,t.plugins,t),l=o.element.cloneNode(!1);l.className+=" se-toolbar-shadow",o.element.style.visibility="hidden",o.pluginCallButtons.math&&this._checkKatexMath(t.katex);const a=n.createElement("DIV");a.className="se-arrow";const r=n.createElement("DIV");r.className="se-toolbar-sticky-dummy";const f=n.createElement("DIV");f.className="se-wrapper";const d=this._initElements(t,i,o.element,a),h=d.bottomBar,b=d.wysiwygFrame,_=d.placeholder;let C=d.codeView;const S=h.resizingBar,c=h.navigation,u=h.charWrapper,p=h.charCounter,v=n.createElement("DIV");v.className="se-loading-box sun-editor-common",v.innerHTML='<div class="se-loading-effect"></div>';const y=n.createElement("DIV");y.className="se-line-breaker",y.innerHTML='<button class="se-btn">'+t.icons.line_break+"</button>";const w=n.createElement("DIV");w.className+="se-line-breaker-component";const x=w.cloneNode(!0);w.innerHTML=x.innerHTML=t.icons.line_break;const E=n.createElement("DIV");E.className="se-resizing-back";const k=n.createElement("INPUT");k.tabIndex=-1,k.style.cssText="position: fixed !important; top: -10000px !important; display: block !important; width: 0 !important; height: 0 !important; margin: 0 !important; padding: 0 !important;";const N=t.toolbarContainer;N&&(N.appendChild(o.element),N.appendChild(l));const T=t.resizingBarContainer;return S&&T&&T.appendChild(S),f.appendChild(C),_&&f.appendChild(_),N||(s.appendChild(o.element),s.appendChild(l)),s.appendChild(r),s.appendChild(f),s.appendChild(E),s.appendChild(v),s.appendChild(y),s.appendChild(w),s.appendChild(x),s.appendChild(k),S&&!T&&s.appendChild(S),i.appendChild(s),C=this._checkCodeMirror(t,C),{constructed:{_top:i,_relative:s,_toolBar:o.element,_toolbarShadow:l,_menuTray:o._menuTray,_editorArea:f,_wysiwygArea:b,_codeArea:C,_placeholder:_,_resizingBar:S,_navigation:c,_charWrapper:u,_charCounter:p,_loading:v,_lineBreaker:y,_lineBreaker_t:w,_lineBreaker_b:x,_resizeBack:E,_stickyDummy:r,_arrow:a,_focusTemp:k},options:t,plugins:o.plugins,pluginCallButtons:o.pluginCallButtons,_responsiveButtons:o.responsiveButtons}},_checkCodeMirror:function(e,t){if(e.codeMirror){const n=[{mode:"htmlmixed",htmlMode:!0,lineNumbers:!0,lineWrapping:!0},e.codeMirror.options||{}].reduce(function(s,o){for(let l in o)pe.hasOwn(o,l)&&(s[l]=o[l]);return s},{});e.height==="auto"&&(n.viewportMargin=1/0,n.height="auto");const i=e.codeMirror.src.fromTextArea(t,n);i.display.wrapper.style.cssText=t.style.cssText,e.codeMirrorEditor=i,t=i.display.wrapper,t.className+=" se-wrapper-code-mirror"}return t},_checkKatexMath:function(e){if(!e)throw Error('[SUNEDITOR.create.fail] To use the math button you need to add a "katex" object to the options.');const t=[{throwOnError:!1},e.options||{}].reduce(function(n,i){for(let s in i)pe.hasOwn(i,s)&&(n[s]=i[s]);return n},{});e.options=t},_setOptions:function(e,t,n){this._initOptions(t.element.originElement,e);const i=t.element,s=i.relative,o=i.editorArea,l=e.toolbarContainer&&e.toolbarContainer!==n.toolbarContainer,a=e.lang!==n.lang||e.buttonList!==n.buttonList||e.mode!==n.mode||l,r=this._createToolBar(document,a?e.buttonList:n.buttonList,e.plugins,e);r.pluginCallButtons.math&&this._checkKatexMath(e.katex);const f=document.createElement("DIV");f.className="se-arrow",a&&(r.element.style.visibility="hidden",l?(e.toolbarContainer.appendChild(r.element),i.toolbar.parentElement.removeChild(i.toolbar)):i.toolbar.parentElement.replaceChild(r.element,i.toolbar),i.toolbar=r.element,i._menuTray=r._menuTray,i._arrow=f);const d=this._initElements(e,i.topArea,a?r.element:i.toolbar,f),h=d.bottomBar,b=d.wysiwygFrame,_=d.placeholder;let C=d.codeView;return i.resizingBar&&pe.removeItem(i.resizingBar),h.resizingBar&&(e.resizingBarContainer&&e.resizingBarContainer!==n.resizingBarContainer?e.resizingBarContainer.appendChild(h.resizingBar):s.appendChild(h.resizingBar)),o.innerHTML="",o.appendChild(C),_&&o.appendChild(_),C=this._checkCodeMirror(e,C),i.resizingBar=h.resizingBar,i.navigation=h.navigation,i.charWrapper=h.charWrapper,i.charCounter=h.charCounter,i.wysiwygFrame=b,i.code=C,i.placeholder=_,e.rtl?pe.addClass(i.topArea,"se-rtl"):pe.removeClass(i.topArea,"se-rtl"),{callButtons:r.pluginCallButtons,plugins:r.plugins,toolbar:r}},_initElements:function(e,t,n,i){t.style.cssText=e._editorStyles.top,/inline/i.test(e.mode)?(n.className+=" se-toolbar-inline",n.style.width=e.toolbarWidth):/balloon/i.test(e.mode)&&(n.className+=" se-toolbar-balloon",n.style.width=e.toolbarWidth,n.appendChild(i));const s=document.createElement(e.iframe?"IFRAME":"DIV");if(s.className="se-wrapper-inner se-wrapper-wysiwyg",e.iframe)s.allowFullscreen=!0,s.frameBorder=0,s.style.cssText=e._editorStyles.frame,s.className+=e.className;else{s.setAttribute("contenteditable",!0),s.setAttribute("autocorrect","off"),s.setAttribute("scrolling","auto");for(let h in e.iframeAttributes)s.setAttribute(h,e.iframeAttributes[h]);s.className+=" "+e._editableClass,s.style.cssText=e._editorStyles.frame+e._editorStyles.editor,s.className+=e.className}const o=document.createElement("TEXTAREA");o.className="se-wrapper-inner se-wrapper-code"+e.className,o.style.cssText=e._editorStyles.frame,o.style.display="none",e.height==="auto"&&(o.style.overflow="hidden");let l=null,a=null,r=null,f=null;if(e.resizingBar&&(l=document.createElement("DIV"),l.className="se-resizing-bar sun-editor-common",a=document.createElement("DIV"),a.className="se-navigation sun-editor-common",l.appendChild(a),e.charCounter)){if(r=document.createElement("DIV"),r.className="se-char-counter-wrapper",e.charCounterLabel){const h=document.createElement("SPAN");h.className="se-char-label",h.textContent=e.charCounterLabel,r.appendChild(h)}if(f=document.createElement("SPAN"),f.className="se-char-counter",f.textContent="0",r.appendChild(f),e.maxCharCount>0){const h=document.createElement("SPAN");h.textContent=" / "+e.maxCharCount,r.appendChild(h)}l.appendChild(r)}let d=null;return e.placeholder&&(d=document.createElement("SPAN"),d.className="se-placeholder",d.innerText=e.placeholder),{bottomBar:{resizingBar:l,navigation:a,charWrapper:r,charCounter:f},wysiwygFrame:s,codeView:o,placeholder:d}},_initOptions:function(e,t){const n={};if(t.plugins){const o=t.plugins,l=o.length?o:Object.keys(o).map(function(a){return o[a]});for(let a=0,r=l.length,f;a<r;a++)f=l[a].default||l[a],n[f.name]=f}t.plugins=n,t.strictMode=t.strictMode!==!1,t.strictHTMLValidation=t.strictHTMLValidation!==!1,t.lang=t.lang||NC,t.value=typeof t.value=="string"?t.value:null,t.allowedClassNames=new pe._w.RegExp((t.allowedClassNames&&typeof t.allowedClassNames=="string"?t.allowedClassNames+"|":"")+"^__se__|se-|katex"),t.historyStackDelayTime=typeof t.historyStackDelayTime=="number"?t.historyStackDelayTime:400,t.frameAttrbutes=t.frameAttrbutes||{},t.defaultTag=typeof t.defaultTag=="string"&&t.defaultTag.length>0?t.defaultTag:"p";const i=t.textTags=[{bold:"STRONG",underline:"U",italic:"EM",strike:"DEL",sub:"SUB",sup:"SUP"},t.textTags||{}].reduce(function(o,l){for(let a in l)o[a]=l[a];return o},{});t._textTagsMap={strong:i.bold.toLowerCase(),b:i.bold.toLowerCase(),u:i.underline.toLowerCase(),ins:i.underline.toLowerCase(),em:i.italic.toLowerCase(),i:i.italic.toLowerCase(),del:i.strike.toLowerCase(),strike:i.strike.toLowerCase(),s:i.strike.toLowerCase(),sub:i.sub.toLowerCase(),sup:i.sup.toLowerCase()},t._defaultCommand={bold:t.textTags.bold,underline:t.textTags.underline,italic:t.textTags.italic,strike:t.textTags.strike,subscript:t.textTags.sub,superscript:t.textTags.sup},t.__allowedScriptTag=t.__allowedScriptTag===!0;const s="br|p|div|pre|blockquote|h1|h2|h3|h4|h5|h6|ol|ul|li|hr|figure|figcaption|img|iframe|audio|video|source|table|thead|tbody|tr|th|td|a|b|strong|var|i|em|u|ins|s|span|strike|del|sub|sup|code|svg|path|details|summary";t.tagsBlacklist=t.tagsBlacklist||"",t._defaultTagsWhitelist=(typeof t._defaultTagsWhitelist=="string"?t._defaultTagsWhitelist:s)+(t.__allowedScriptTag?"|script":""),t._editorTagsWhitelist=t.addTagsWhitelist==="*"?"*":this._setWhitelist(t._defaultTagsWhitelist+(typeof t.addTagsWhitelist=="string"&&t.addTagsWhitelist.length>0?"|"+t.addTagsWhitelist:""),t.tagsBlacklist),t.pasteTagsBlacklist=t.tagsBlacklist+(t.tagsBlacklist&&t.pasteTagsBlacklist?"|"+t.pasteTagsBlacklist:t.pasteTagsBlacklist||""),t.pasteTagsWhitelist=t.pasteTagsWhitelist==="*"?"*":this._setWhitelist(typeof t.pasteTagsWhitelist=="string"?t.pasteTagsWhitelist:t._editorTagsWhitelist,t.pasteTagsBlacklist),t.attributesWhitelist=!t.attributesWhitelist||typeof t.attributesWhitelist!="object"?null:t.attributesWhitelist,t.attributesBlacklist=!t.attributesBlacklist||typeof t.attributesBlacklist!="object"?null:t.attributesBlacklist,t.mode=t.mode||"classic",t.rtl=!!t.rtl,t.lineAttrReset=["id"].concat(t.lineAttrReset&&typeof t.lineAttrReset=="string"?t.lineAttrReset.toLowerCase().split("|"):[]),t._editableClass="sun-editor-editable"+(t.rtl?" se-rtl":""),t._printClass=typeof t._printClass=="string"?t._printClass:null,t.toolbarWidth=t.toolbarWidth?pe.isNumber(t.toolbarWidth)?t.toolbarWidth+"px":t.toolbarWidth:"auto",t.toolbarContainer=typeof t.toolbarContainer=="string"?document.querySelector(t.toolbarContainer):t.toolbarContainer,t.stickyToolbar=/balloon/i.test(t.mode)||t.toolbarContainer?-1:t.stickyToolbar===void 0?0:/^\d+/.test(t.stickyToolbar)?pe.getNumber(t.stickyToolbar,0):-1,t.hideToolbar=!!t.hideToolbar,t.fullScreenOffset=t.fullScreenOffset===void 0?0:/^\d+/.test(t.fullScreenOffset)?pe.getNumber(t.fullScreenOffset,0):0,t.fullPage=!!t.fullPage,t.iframe=t.fullPage||!!t.iframe,t.iframeAttributes=t.iframeAttributes||{},t.iframeCSSFileName=t.iframe?typeof t.iframeCSSFileName=="string"?[t.iframeCSSFileName]:t.iframeCSSFileName||["suneditor"]:null,t.previewTemplate=typeof t.previewTemplate=="string"?t.previewTemplate:null,t.printTemplate=typeof t.printTemplate=="string"?t.printTemplate:null,t.codeMirror=t.codeMirror?t.codeMirror.src?t.codeMirror:{src:t.codeMirror}:null,t.katex=t.katex?t.katex.src?t.katex:{src:t.katex}:null,t.mathFontSize=t.mathFontSize?t.mathFontSize:[{text:"1",value:"1em"},{text:"1.5",value:"1.5em"},{text:"2",value:"2em"},{text:"2.5",value:"2.5em"}],t.position=typeof t.position=="string"?t.position:null,t.display=t.display||(e.style.display==="none"||!e.style.display?"block":e.style.display),t.popupDisplay=t.popupDisplay||"full",t.resizingBar=t.resizingBar===void 0?!/inline|balloon/i.test(t.mode):t.resizingBar,t.showPathLabel=t.resizingBar?typeof t.showPathLabel=="boolean"?t.showPathLabel:!0:!1,t.resizeEnable=t.resizeEnable===void 0?!0:!!t.resizeEnable,t.resizingBarContainer=typeof t.resizingBarContainer=="string"?document.querySelector(t.resizingBarContainer):t.resizingBarContainer,t.charCounter=t.maxCharCount>0?!0:typeof t.charCounter=="boolean"?t.charCounter:!1,t.charCounterType=typeof t.charCounterType=="string"?t.charCounterType:"char",t.charCounterLabel=typeof t.charCounterLabel=="string"?t.charCounterLabel.trim():null,t.maxCharCount=pe.isNumber(t.maxCharCount)&&t.maxCharCount>-1?t.maxCharCount*1:null,t.width=t.width?pe.isNumber(t.width)?t.width+"px":t.width:e.clientWidth?e.clientWidth+"px":"100%",t.minWidth=(pe.isNumber(t.minWidth)?t.minWidth+"px":t.minWidth)||"",t.maxWidth=(pe.isNumber(t.maxWidth)?t.maxWidth+"px":t.maxWidth)||"",t.height=t.height?pe.isNumber(t.height)?t.height+"px":t.height:e.clientHeight?e.clientHeight+"px":"auto",t.minHeight=(pe.isNumber(t.minHeight)?t.minHeight+"px":t.minHeight)||"",t.maxHeight=(pe.isNumber(t.maxHeight)?t.maxHeight+"px":t.maxHeight)||"",t.className=typeof t.className=="string"&&t.className.length>0?" "+t.className:"",t.defaultStyle=typeof t.defaultStyle=="string"?t.defaultStyle:"",t.font=t.font?t.font:["Arial","Comic Sans MS","Courier New","Impact","Georgia","tahoma","Trebuchet MS","Verdana"],t.fontSize=t.fontSize?t.fontSize:null,t.formats=t.formats?t.formats:null,t.colorList=t.colorList?t.colorList:null,t.lineHeights=t.lineHeights?t.lineHeights:null,t.paragraphStyles=t.paragraphStyles?t.paragraphStyles:null,t.textStyles=t.textStyles?t.textStyles:null,t.fontSizeUnit=typeof t.fontSizeUnit=="string"&&t.fontSizeUnit.trim().toLowerCase()||"px",t.alignItems=typeof t.alignItems=="object"?t.alignItems:t.rtl?["right","center","left","justify"]:["left","center","right","justify"],t.imageResizing=t.imageResizing===void 0?!0:t.imageResizing,t.imageHeightShow=t.imageHeightShow===void 0?!0:!!t.imageHeightShow,t.imageAlignShow=t.imageAlignShow===void 0?!0:!!t.imageAlignShow,t.imageWidth=t.imageWidth?pe.isNumber(t.imageWidth)?t.imageWidth+"px":t.imageWidth:"auto",t.imageHeight=t.imageHeight?pe.isNumber(t.imageHeight)?t.imageHeight+"px":t.imageHeight:"auto",t.imageSizeOnlyPercentage=!!t.imageSizeOnlyPercentage,t._imageSizeUnit=t.imageSizeOnlyPercentage?"%":"px",t.imageRotation=t.imageRotation!==void 0?t.imageRotation:!(t.imageSizeOnlyPercentage||!t.imageHeightShow),t.imageFileInput=t.imageFileInput===void 0?!0:t.imageFileInput,t.imageUrlInput=t.imageUrlInput===void 0||!t.imageFileInput?!0:t.imageUrlInput,t.imageUploadHeader=t.imageUploadHeader||null,t.imageUploadUrl=typeof t.imageUploadUrl=="string"?t.imageUploadUrl:null,t.imageUploadSizeLimit=/\d+/.test(t.imageUploadSizeLimit)?pe.getNumber(t.imageUploadSizeLimit,0):null,t.imageMultipleFile=!!t.imageMultipleFile,t.imageAccept=typeof t.imageAccept!="string"||t.imageAccept.trim()==="*"?"image/*":t.imageAccept.trim()||"image/*",t.imageGalleryData=t.imageGalleryData||null,t.imageGalleryUrl=typeof t.imageGalleryUrl=="string"?t.imageGalleryUrl:null,t.imageGalleryHeader=t.imageGalleryHeader||null,t.videoResizing=t.videoResizing===void 0?!0:t.videoResizing,t.videoHeightShow=t.videoHeightShow===void 0?!0:!!t.videoHeightShow,t.videoAlignShow=t.videoAlignShow===void 0?!0:!!t.videoAlignShow,t.videoRatioShow=t.videoRatioShow===void 0?!0:!!t.videoRatioShow,t.videoWidth=!t.videoWidth||!pe.getNumber(t.videoWidth,0)?"":pe.isNumber(t.videoWidth)?t.videoWidth+"px":t.videoWidth,t.videoHeight=!t.videoHeight||!pe.getNumber(t.videoHeight,0)?"":pe.isNumber(t.videoHeight)?t.videoHeight+"px":t.videoHeight,t.videoSizeOnlyPercentage=!!t.videoSizeOnlyPercentage,t._videoSizeUnit=t.videoSizeOnlyPercentage?"%":"px",t.videoRotation=t.videoRotation!==void 0?t.videoRotation:!(t.videoSizeOnlyPercentage||!t.videoHeightShow),t.videoRatio=pe.getNumber(t.videoRatio,4)||.5625,t.videoRatioList=t.videoRatioList?t.videoRatioList:null,t.youtubeQuery=(t.youtubeQuery||"").replace("?",""),t.vimeoQuery=(t.vimeoQuery||"").replace("?",""),t.videoFileInput=!!t.videoFileInput,t.videoUrlInput=t.videoUrlInput===void 0||!t.videoFileInput?!0:t.videoUrlInput,t.videoUploadHeader=t.videoUploadHeader||null,t.videoUploadUrl=typeof t.videoUploadUrl=="string"?t.videoUploadUrl:null,t.videoUploadSizeLimit=/\d+/.test(t.videoUploadSizeLimit)?pe.getNumber(t.videoUploadSizeLimit,0):null,t.videoMultipleFile=!!t.videoMultipleFile,t.videoTagAttrs=t.videoTagAttrs||null,t.videoIframeAttrs=t.videoIframeAttrs||null,t.videoAccept=typeof t.videoAccept!="string"||t.videoAccept.trim()==="*"?"video/*":t.videoAccept.trim()||"video/*",t.audioWidth=t.audioWidth?pe.isNumber(t.audioWidth)?t.audioWidth+"px":t.audioWidth:"",t.audioHeight=t.audioHeight?pe.isNumber(t.audioHeight)?t.audioHeight+"px":t.audioHeight:"",t.audioFileInput=!!t.audioFileInput,t.audioUrlInput=t.audioUrlInput===void 0||!t.audioFileInput?!0:t.audioUrlInput,t.audioUploadHeader=t.audioUploadHeader||null,t.audioUploadUrl=typeof t.audioUploadUrl=="string"?t.audioUploadUrl:null,t.audioUploadSizeLimit=/\d+/.test(t.audioUploadSizeLimit)?pe.getNumber(t.audioUploadSizeLimit,0):null,t.audioMultipleFile=!!t.audioMultipleFile,t.audioTagAttrs=t.audioTagAttrs||null,t.audioAccept=typeof t.audioAccept!="string"||t.audioAccept.trim()==="*"?"audio/*":t.audioAccept.trim()||"audio/*",t.tableCellControllerPosition=typeof t.tableCellControllerPosition=="string"?t.tableCellControllerPosition.toLowerCase():"cell",t.linkTargetNewWindow=!!t.linkTargetNewWindow,t.linkProtocol=typeof t.linkProtocol=="string"?t.linkProtocol:null,t.linkRel=Array.isArray(t.linkRel)?t.linkRel:[],t.linkRelDefault=t.linkRelDefault||{},t.tabDisable=!!t.tabDisable,t.shortcutsDisable=Array.isArray(t.shortcutsDisable)?t.shortcutsDisable:[],t.shortcutsHint=t.shortcutsHint===void 0?!0:!!t.shortcutsHint,t.callBackSave=t.callBackSave?t.callBackSave:null,t.templates=t.templates?t.templates:null,t.placeholder=typeof t.placeholder=="string"?t.placeholder:null,t.mediaAutoSelect=t.mediaAutoSelect===void 0?!0:!!t.mediaAutoSelect,t.buttonList=t.buttonList?t.buttonList:[["undo","redo"],["bold","underline","italic","strike","subscript","superscript"],["removeFormat"],["outdent","indent"],["fullScreen","showBlocks","codeView"],["preview","print"]],t.rtl&&(t.buttonList=t.buttonList.reverse()),t.icons=!t.icons||typeof t.icons!="object"?Pa:[Pa,t.icons].reduce(function(o,l){for(let a in l)pe.hasOwn(l,a)&&(o[a]=l[a]);return o},{}),t.icons=t.rtl?[t.icons,t.icons.rtl].reduce(function(o,l){for(let a in l)pe.hasOwn(l,a)&&(o[a]=l[a]);return o},{}):t.icons,t.__listCommonStyle=t.__listCommonStyle||["fontSize","color","fontFamily","fontWeight","fontStyle"],t._editorStyles=pe._setDefaultOptionStyle(t,t.defaultStyle)},_setWhitelist:function(e,t){if(typeof t!="string")return e;t=t.split("|"),e=e.split("|");for(let n=0,i=t.length,s;n<i;n++)s=e.indexOf(t[n]),s>-1&&e.splice(s,1);return e.join("|")},_defaultButtons:function(e){const t=e.icons,n=e.lang,i=pe.isOSX_IOS?"⌘":"CTRL",s=pe.isOSX_IOS?"⇧":"+SHIFT",o=e.shortcutsHint?e.shortcutsDisable:["bold","strike","underline","italic","undo","indent","save"],l=e.rtl?["[","]"]:["]","["],a=e.rtl?[t.outdent,t.indent]:[t.indent,t.outdent];return{bold:["",n.toolbar.bold+'<span class="se-shortcut">'+(o.indexOf("bold")>-1?"":i+'+<span class="se-shortcut-key">B</span>')+"</span>","bold","",t.bold],underline:["",n.toolbar.underline+'<span class="se-shortcut">'+(o.indexOf("underline")>-1?"":i+'+<span class="se-shortcut-key">U</span>')+"</span>","underline","",t.underline],italic:["",n.toolbar.italic+'<span class="se-shortcut">'+(o.indexOf("italic")>-1?"":i+'+<span class="se-shortcut-key">I</span>')+"</span>","italic","",t.italic],strike:["",n.toolbar.strike+'<span class="se-shortcut">'+(o.indexOf("strike")>-1?"":i+s+'+<span class="se-shortcut-key">S</span>')+"</span>","strike","",t.strike],subscript:["",n.toolbar.subscript,"SUB","",t.subscript],superscript:["",n.toolbar.superscript,"SUP","",t.superscript],removeFormat:["",n.toolbar.removeFormat,"removeFormat","",t.erase],indent:["",n.toolbar.indent+'<span class="se-shortcut">'+(o.indexOf("indent")>-1?"":i+'+<span class="se-shortcut-key">'+l[0]+"</span>")+"</span>","indent","",a[0]],outdent:["",n.toolbar.outdent+'<span class="se-shortcut">'+(o.indexOf("indent")>-1?"":i+'+<span class="se-shortcut-key">'+l[1]+"</span>")+"</span>","outdent","",a[1]],fullScreen:["se-code-view-enabled se-resizing-enabled",n.toolbar.fullScreen,"fullScreen","",t.expansion],showBlocks:["",n.toolbar.showBlocks,"showBlocks","",t.show_blocks],codeView:["se-code-view-enabled se-resizing-enabled",n.toolbar.codeView,"codeView","",t.code_view],undo:["",n.toolbar.undo+'<span class="se-shortcut">'+(o.indexOf("undo")>-1?"":i+'+<span class="se-shortcut-key">Z</span>')+"</span>","undo","",t.undo],redo:["",n.toolbar.redo+'<span class="se-shortcut">'+(o.indexOf("undo")>-1?"":i+'+<span class="se-shortcut-key">Y</span> / '+i+s+'+<span class="se-shortcut-key">Z</span>')+"</span>","redo","",t.redo],preview:["se-resizing-enabled",n.toolbar.preview,"preview","",t.preview],print:["se-resizing-enabled",n.toolbar.print,"print","",t.print],dir:["",n.toolbar[e.rtl?"dir_ltr":"dir_rtl"],"dir","",t[e.rtl?"dir_ltr":"dir_rtl"]],dir_ltr:["",n.toolbar.dir_ltr,"dir_ltr","",t.dir_ltr],dir_rtl:["",n.toolbar.dir_rtl,"dir_rtl","",t.dir_rtl],save:["se-resizing-enabled",n.toolbar.save+'<span class="se-shortcut">'+(o.indexOf("save")>-1?"":i+'+<span class="se-shortcut-key">S</span>')+"</span>","save","",t.save],blockquote:["",n.toolbar.tag_blockquote,"blockquote","command",t.blockquote],font:["se-btn-select se-btn-tool-font",n.toolbar.font,"font","submenu",'<span class="txt">'+n.toolbar.font+"</span>"+t.arrow_down],formatBlock:["se-btn-select se-btn-tool-format",n.toolbar.formats,"formatBlock","submenu",'<span class="txt">'+n.toolbar.formats+"</span>"+t.arrow_down],fontSize:["se-btn-select se-btn-tool-size",n.toolbar.fontSize,"fontSize","submenu",'<span class="txt">'+n.toolbar.fontSize+"</span>"+t.arrow_down],fontColor:["",n.toolbar.fontColor,"fontColor","submenu",t.font_color],hiliteColor:["",n.toolbar.hiliteColor,"hiliteColor","submenu",t.highlight_color],align:["se-btn-align",n.toolbar.align,"align","submenu",e.rtl?t.align_right:t.align_left],list:["",n.toolbar.list,"list","submenu",t.list_number],horizontalRule:["btn_line",n.toolbar.horizontalRule,"horizontalRule","submenu",t.horizontal_rule],table:["",n.toolbar.table,"table","submenu",t.table],lineHeight:["",n.toolbar.lineHeight,"lineHeight","submenu",t.line_height],template:["",n.toolbar.template,"template","submenu",t.template],paragraphStyle:["",n.toolbar.paragraphStyle,"paragraphStyle","submenu",t.paragraph_style],textStyle:["",n.toolbar.textStyle,"textStyle","submenu",t.text_style],link:["",n.toolbar.link,"link","dialog",t.link],image:["",n.toolbar.image,"image","dialog",t.image],video:["",n.toolbar.video,"video","dialog",t.video],audio:["",n.toolbar.audio,"audio","dialog",t.audio],math:["",n.toolbar.math,"math","dialog",t.math],imageGallery:["",n.toolbar.imageGallery,"imageGallery","fileBrowser",t.image_gallery]}},_createModuleGroup:function(){const e=pe.createElement("DIV");e.className="se-btn-module se-btn-module-border";const t=pe.createElement("UL");return t.className="se-menu-list",e.appendChild(t),{div:e,ul:t}},_createButton:function(e,t,n,i,s,o,l){const a=pe.createElement("LI"),r=pe.createElement("BUTTON"),f=t||n;return r.setAttribute("type","button"),r.setAttribute("class","se-btn"+(e?" "+e:"")+" se-tooltip"),r.setAttribute("data-command",n),r.setAttribute("data-display",i),r.setAttribute("aria-label",f.replace(/<span .+<\/span>/,"")),r.setAttribute("tabindex","-1"),s||(s='<span class="se-icon-text">!</span>'),/^default\./i.test(s)&&(s=l[s.replace(/^default\./i,"")]),/^text\./i.test(s)&&(s=s.replace(/^text\./i,""),r.className+=" se-btn-more-text"),s+='<span class="se-tooltip-inner"><span class="se-tooltip-text">'+f+"</span></span>",o&&r.setAttribute("disabled",!0),r.innerHTML=s,a.appendChild(r),{li:a,button:r}},_createToolBar:function(e,t,n,i){const s=e.createElement("DIV");s.className="se-toolbar-separator-vertical";const o=e.createElement("DIV");o.className="se-toolbar sun-editor-common";const l=e.createElement("DIV");l.className="se-btn-tray",o.appendChild(l),t=JSON.parse(JSON.stringify(t));const a=i.icons,r=this._defaultButtons(i),f={},d=[];let h=null,b=null,_=null,C=null,S="",c=!1;const u=pe.createElement("DIV");u.className="se-toolbar-more-layer";e:for(let y=0,w,x,E,k,N;y<t.length;y++)if(w=!1,N="",k=t[y],_=this._createModuleGroup(),typeof k=="object"){for(let T=0,R;T<k.length;T++){if(b=k[T],R=!1,/^\%\d+/.test(b)&&T===0){k[0]=b.replace(/[^\d]/g,""),d.push(k),t.splice(y--,1);continue e}if(typeof b=="object")typeof b.add=="function"?(S=b.name,h=r[S],n[S]=b):(S=b.name,h=[b.buttonClass,b.title,b.name,b.dataDisplay,b.innerHTML,b._disabled]);else{if(/^\-/.test(b)){N=b.substr(1),_.div.className+=" module-float-"+N;continue}if(/^\#/.test(b)){b.substr(1)==="fix"&&(_.ul.className+=" se-menu-dir-fix");continue}if(/^\:/.test(b)){R=!0;const M=b.match(/^\:([^\-]+)\-([^\-]+)\-([^\-]+)/);E="__se__"+M[1].trim();const A=M[2].trim(),D=M[3].trim();h=["se-btn-more",A,E,"MORE",D]}else h=r[b];if(S=b,!h){const M=n[S];if(!M)throw Error("[SUNEDITOR.create.toolbar.fail] The button name of a plugin that does not exist. ["+S+"]");h=[M.buttonClass,M.title,M.name,M.display,M.innerHTML,M._disabled]}}C=this._createButton(h[0],h[1],h[2],h[3],h[4],h[5],a),(w?x:_.ul).appendChild(C.li),n[S]&&(f[S]=C.button),R&&(w=!0,x=pe.createElement("DIV"),x.className="se-more-layer "+E,x.innerHTML='<div class="se-more-form"><ul class="se-menu-list"'+(N?' style="float: '+N+';"':"")+"></ul></div>",u.appendChild(x),x=x.firstElementChild.firstElementChild)}if(c){const T=s.cloneNode(!1);l.appendChild(T)}l.appendChild(_.div),c=!0}else if(/^\/$/.test(k)){const T=e.createElement("DIV");T.className="se-btn-module-enter",l.appendChild(T),c=!1}switch(l.children.length){case 0:l.style.display="none";break;case 1:pe.removeClass(l.firstElementChild,"se-btn-module-border");break;default:if(i.rtl){const y=s.cloneNode(!1);y.style.float=l.lastElementChild.style.float,l.appendChild(y)}}d.length>0&&d.unshift(t),u.children.length>0&&l.appendChild(u);const p=e.createElement("DIV");p.className="se-menu-tray",o.appendChild(p);const v=e.createElement("DIV");return v.className="se-toolbar-cover",o.appendChild(v),i.hideToolbar&&(o.style.display="none"),{element:o,plugins:n,pluginCallButtons:f,responsiveButtons:d,_menuTray:p,_buttonTray:l}}},qr=function(e,t,n){return{element:{originElement:e,topArea:t._top,relative:t._relative,toolbar:t._toolBar,_toolbarShadow:t._toolbarShadow,_buttonTray:t._toolBar.querySelector(".se-btn-tray"),_menuTray:t._menuTray,resizingBar:t._resizingBar,navigation:t._navigation,charWrapper:t._charWrapper,charCounter:t._charCounter,editorArea:t._editorArea,wysiwygFrame:t._wysiwygArea,wysiwyg:t._wysiwygArea,code:t._codeArea,placeholder:t._placeholder,loading:t._loading,lineBreaker:t._lineBreaker,lineBreaker_t:t._lineBreaker_t,lineBreaker_b:t._lineBreaker_b,resizeBackground:t._resizeBack,_stickyDummy:t._stickyDummy,_arrow:t._arrow,_focusTemp:t._focusTemp},tool:{cover:t._toolBar.querySelector(".se-toolbar-cover"),bold:t._toolBar.querySelector('[data-command="bold"]'),underline:t._toolBar.querySelector('[data-command="underline"]'),italic:t._toolBar.querySelector('[data-command="italic"]'),strike:t._toolBar.querySelector('[data-command="strike"]'),sub:t._toolBar.querySelector('[data-command="SUB"]'),sup:t._toolBar.querySelector('[data-command="SUP"]'),undo:t._toolBar.querySelector('[data-command="undo"]'),redo:t._toolBar.querySelector('[data-command="redo"]'),save:t._toolBar.querySelector('[data-command="save"]'),outdent:t._toolBar.querySelector('[data-command="outdent"]'),indent:t._toolBar.querySelector('[data-command="indent"]'),fullScreen:t._toolBar.querySelector('[data-command="fullScreen"]'),showBlocks:t._toolBar.querySelector('[data-command="showBlocks"]'),codeView:t._toolBar.querySelector('[data-command="codeView"]'),dir:t._toolBar.querySelector('[data-command="dir"]'),dir_ltr:t._toolBar.querySelector('[data-command="dir_ltr"]'),dir_rtl:t._toolBar.querySelector('[data-command="dir_rtl"]')},options:n,option:n}};function kC(e,t){const n=e._w,i=e.util,s=e.options.historyStackDelayTime;let o=e.context.element,l=e.context.tool.undo,a=e.context.tool.redo,r=null,f=0,d=[];function h(){const _=d[f];o.wysiwyg.innerHTML=_.contents,e.setRange(i.getNodeFromPath(_.s.path,o.wysiwyg),_.s.offset,i.getNodeFromPath(_.e.path,o.wysiwyg),_.e.offset),e.focus(),d.length<=1?(l&&l.setAttribute("disabled",!0),a&&a.setAttribute("disabled",!0)):f===0?(l&&l.setAttribute("disabled",!0),a&&a.removeAttribute("disabled")):f===d.length-1?(l&&l.removeAttribute("disabled"),a&&a.setAttribute("disabled",!0)):(l&&l.removeAttribute("disabled"),a&&a.removeAttribute("disabled")),e.controllersOff(),e._checkComponents(),e._setCharCount(),e._resourcesStateChange(),t()}function b(){e._checkComponents();const _=o.wysiwyg.innerHTML;if(!_||d[f]&&_===d[f].contents)return;f++;const C=e._variable._range;d.length>f&&(d=d.slice(0,f),a&&a.setAttribute("disabled",!0)),C?d[f]={contents:_,s:{path:i.getNodePath(C.startContainer,null,null),offset:C.startOffset},e:{path:i.getNodePath(C.endContainer,null,null),offset:C.endOffset}}:d[f]={contents:_,s:{path:[0,0],offset:[0,0]},e:{path:0,offset:0}},f===1&&l&&l.removeAttribute("disabled"),e._setCharCount(),t()}return{stack:d,push:function(_){n.setTimeout(e._resourcesStateChange.bind(e));const C=typeof _=="number"?_>0?_:0:_?s:0;if((!C||r)&&(n.clearTimeout(r),!C)){b();return}r=n.setTimeout(function(){n.clearTimeout(r),r=null,b()},C)},undo:function(){f>0&&(f--,h())},redo:function(){d.length-1>f&&(f++,h())},go:function(_){f=_<0?d.length-1:_,h()},getCurrentIndex:function(){return f},reset:function(_){l&&l.setAttribute("disabled",!0),a&&a.setAttribute("disabled",!0),e._variable.isChanged=!1,e.context.tool.save&&e.context.tool.save.setAttribute("disabled",!0),d.splice(0),f=0,d[f]={contents:e.getContents(!0),s:{path:[0,0],offset:0},e:{path:[0,0],offset:0}},_||t()},_resetCachingButton:function(){o=e.context.element,l=e.context.tool.undo,a=e.context.tool.redo,f===0?(l&&l.setAttribute("disabled",!0),a&&f===d.length-1&&a.setAttribute("disabled",!0),e._variable.isChanged=!1,e.context.tool.save&&e.context.tool.save.setAttribute("disabled",!0)):f===d.length-1&&a&&a.setAttribute("disabled",!0)},_destroy:function(){r&&n.clearTimeout(r),d=null}}}const Ia={name:"notice",add:function(e){const t=e.context;t.notice={};let n=e.util.createElement("DIV"),i=e.util.createElement("SPAN"),s=e.util.createElement("BUTTON");n.className="se-notice",s.className="close",s.setAttribute("aria-label","Close"),s.setAttribute("title",e.lang.dialogBox.close),s.innerHTML=e.icons.cancel,n.appendChild(i),n.appendChild(s),t.notice.modal=n,t.notice.message=i,s.addEventListener("click",this.onClick_cancel.bind(e)),t.element.editorArea.appendChild(n),n=null},onClick_cancel:function(e){e.preventDefault(),e.stopPropagation(),this.plugins.notice.close.call(this)},open:function(e){this.context.notice.message.textContent=e,this.context.notice.modal.style.display="block"},close:function(){this.context.notice.modal.style.display="none"}};function TC(e,t,n,i,s,o){const l=e.element.originElement.ownerDocument||document,a=l.defaultView||window,r=pe,f=s.icons,d={_d:l,_w:a,_parser:new a.DOMParser,_prevRtl:s.rtl,_editorHeight:0,_editorHeightPadding:0,_listCamel:s.__listCommonStyle,_listKebab:r.camelToKebabCase(s.__listCommonStyle),__focusTemp:e.element._focusTemp,_wd:null,_ww:null,_shadowRoot:null,_shadowRootControllerEventTarget:null,util:r,functions:null,options:null,wwComputedStyle:null,notice:Ia,icons:f,history:null,context:e,pluginCallButtons:t,plugins:n||{},initPlugins:{},_targetPlugins:{},_menuTray:{},lang:i,effectNode:null,submenu:null,container:null,_submenuName:"",_bindedSubmenuOff:null,_bindedContainerOff:null,submenuActiveButton:null,containerActiveButton:null,controllerArray:[],currentControllerName:"",currentControllerTarget:null,currentFileComponentInfo:null,codeViewDisabledButtons:[],resizingDisabledButtons:[],_moreLayerActiveButton:null,_htmlCheckWhitelistRegExp:null,_htmlCheckBlacklistRegExp:null,_disallowedTextTagsRegExp:null,editorTagsWhitelistRegExp:null,editorTagsBlacklistRegExp:null,pasteTagsWhitelistRegExp:null,pasteTagsBlacklistRegExp:null,hasFocus:!1,isDisabled:!1,isReadOnly:!1,_attributesWhitelistRegExp:null,_attributesWhitelistRegExp_all_data:null,_attributesBlacklistRegExp:null,_attributesTagsWhitelist:null,_attributesTagsBlacklist:null,_bindControllersOff:null,_isInline:null,_isBalloon:null,_isBalloonAlways:null,_inlineToolbarAttr:{top:"",width:"",isShow:!1},_notHideToolbar:!1,_sticky:!1,_antiBlur:!1,_lineBreaker:null,_lineBreakerButton:null,_componentsInfoInit:!0,_componentsInfoReset:!1,activePlugins:null,managedTagsInfo:null,_charTypeHTML:!1,_fileInfoPluginsCheck:null,_fileInfoPluginsReset:null,_fileManager:{tags:null,regExp:null,queryString:null,pluginRegExp:null,pluginMap:null},commandMap:{},_commandMapStyles:{STRONG:["font-weight"],U:["text-decoration"],EM:["font-style"],DEL:["text-decoration"]},_styleCommandMap:null,_cleanStyleRegExp:{div:new a.RegExp("\\s*[^-a-zA-Z](.+)\\s*:[^;]+(?!;)*","ig"),span:new a.RegExp("\\s*[^-a-zA-Z](font-family|font-size|color|background-color)\\s*:[^;]+(?!;)*","ig"),format:new a.RegExp("\\s*[^-a-zA-Z](text-align|margin-left|margin-right|width|height|line-height)\\s*:[^;]+(?!;)*","ig"),fontSizeUnit:new a.RegExp("\\d+"+s.fontSizeUnit+"$","i")},_variable:{isChanged:!1,isCodeView:!1,isFullScreen:!1,innerHeight_fullScreen:0,resizeClientY:0,tabSize:4,codeIndent:2,minResizingSize:r.getNumber(e.element.wysiwygFrame.style.minHeight||"65",0),currentNodes:[],currentNodesMap:[],_range:null,_selectionNode:null,_originCssText:e.element.topArea.style.cssText,_bodyOverflow:"",_editorAreaOriginCssText:"",_wysiwygOriginCssText:"",_codeOriginCssText:"",_fullScreenAttrs:{sticky:!1,balloon:!1,inline:!1},_lineBreakComp:null,_lineBreakDir:""},_formatAttrsTemp:null,_saveButtonStates:function(){this.allCommandButtons||(this.allCommandButtons={});const c=this.context.element._buttonTray.querySelectorAll(".se-menu-list button[data-display]");for(let u=0,p,v;u<c.length;u++)p=c[u],v=p.getAttribute("data-command"),this.allCommandButtons[v]=p},_recoverButtonStates:function(){if(this.allCommandButtons){const c=this.context.element._buttonTray.querySelectorAll(".se-menu-list button[data-display]");for(let u=0,p,v,y;u<c.length;u++)p=c[u],v=p.getAttribute("data-command"),y=this.allCommandButtons[v],y&&(p.parentElement.replaceChild(y,p),this.context.tool[v]&&(this.context.tool[v]=y))}},callPlugin:function(c,u,p){if(p=p||t[c],this.plugins[c])this.initPlugins[c]?typeof this._targetPlugins[c]=="object"&&p&&this.initMenuTarget(c,p,this._targetPlugins[c]):(this.plugins[c].add(this,p),this.initPlugins[c]=!0);else throw Error('[SUNEDITOR.core.callPlugin.fail] The called plugin does not exist or is in an invalid format. (pluginName:"'+c+'")');this.plugins[c].active&&!this.commandMap[c]&&p&&(this.commandMap[c]=p,this.activePlugins.push(c)),typeof u=="function"&&u()},addModule:function(c){for(let u=0,p=c.length,v;u<p;u++)v=c[u].name,this.plugins[v]||(this.plugins[v]=c[u]),this.initPlugins[v]||(this.initPlugins[v]=!0,typeof this.plugins[v].add=="function"&&this.plugins[v].add(this))},getGlobalScrollOffset:function(){let c=0,u=0,p=e.element.topArea;for(;p;)c+=p.scrollTop,u+=p.scrollLeft,p=p.parentElement;for(p=this._shadowRoot?this._shadowRoot.host:null;p;)c+=p.scrollTop,u+=p.scrollLeft,p=p.parentElement;return{top:c,left:u}},initMenuTarget:function(c,u,p){u?(e.element._menuTray.appendChild(p),this._targetPlugins[c]=!0,this._menuTray[u.getAttribute("data-command")]=p):this._targetPlugins[c]=p},submenuOn:function(c){this._bindedSubmenuOff&&this._bindedSubmenuOff(),this._bindControllersOff&&this.controllersOff();const u=this._submenuName=c.getAttribute("data-command"),p=this.submenu=this._menuTray[u];this.submenuActiveButton=c,this._setMenuPosition(c,p),this._bindedSubmenuOff=this.submenuOff.bind(this),this.addDocEvent("mousedown",this._bindedSubmenuOff,!1),this.plugins[u].on&&this.plugins[u].on.call(this),this._antiBlur=!0},submenuOff:function(){this.removeDocEvent("mousedown",this._bindedSubmenuOff),this._bindedSubmenuOff=null,this.submenu&&(this._submenuName="",this.submenu.style.display="none",this.submenu=null,r.removeClass(this.submenuActiveButton,"on"),this.submenuActiveButton=null,this._notHideToolbar=!1),this._antiBlur=!1},moreLayerOff:function(){if(this._moreLayerActiveButton){const c=e.element.toolbar.querySelector("."+this._moreLayerActiveButton.getAttribute("data-command"));c.style.display="none",r.removeClass(this._moreLayerActiveButton,"on"),this._moreLayerActiveButton=null}},containerOn:function(c){this._bindedContainerOff&&this._bindedContainerOff();const u=this._containerName=c.getAttribute("data-command"),p=this.container=this._menuTray[u];this.containerActiveButton=c,this._setMenuPosition(c,p),this._bindedContainerOff=this.containerOff.bind(this),this.addDocEvent("mousedown",this._bindedContainerOff,!1),this.plugins[u].on&&this.plugins[u].on.call(this),this._antiBlur=!0},containerOff:function(){this.removeDocEvent("mousedown",this._bindedContainerOff),this._bindedContainerOff=null,this.container&&(this._containerName="",this.container.style.display="none",this.container=null,r.removeClass(this.containerActiveButton,"on"),this.containerActiveButton=null,this._notHideToolbar=!1),this._antiBlur=!1},_setMenuPosition:function(c,u){u.style.visibility="hidden",u.style.display="block",u.style.height="",r.addClass(c,"on");const p=this.context.element.toolbar,v=p.offsetWidth,y=h._getEditorOffsets(e.element.toolbar),w=u.offsetWidth,x=c.parentElement.offsetLeft+3;if(s.rtl){const D=c.offsetWidth,$=w>D?w-D:0,H=$>0?0:D-w;u.style.left=x-$+H+"px",y.left>h._getEditorOffsets(u).left&&(u.style.left="0px")}else{const D=v<=w?0:v-(x+w);D<0?u.style.left=x+D+"px":u.style.left=x+"px"}let E=0,k=c;for(;k&&k!==p;)E+=k.offsetTop,k=k.offsetParent;const N=E;this._isBalloon?E+=p.offsetTop+c.offsetHeight:E-=c.offsetHeight;const T=y.top,R=u.offsetHeight,M=this.getGlobalScrollOffset().top,A=a.innerHeight-(T-M+N+c.parentElement.offsetHeight);if(A<R){let D=-1*(R-N+3);const $=T-M+D,H=R+($<0?$:0);H>A?(u.style.height=H+"px",D=-1*(H-N+3)):(u.style.height=A+"px",D=N+c.parentElement.offsetHeight),u.style.top=D+"px"}else u.style.top=N+c.parentElement.offsetHeight+"px";u.style.visibility=""},controllersOn:function(){this._bindControllersOff&&this._bindControllersOff(),this.controllerArray=[];for(let c=0,u;c<arguments.length;c++)if(u=arguments[c],!!u){if(typeof u=="string"){this.currentControllerName=u;continue}if(typeof u=="function"){this.controllerArray.push(u);continue}if(!r.hasClass(u,"se-controller")){this.currentControllerTarget=u,this.currentFileComponentInfo=this.getFileComponent(u);continue}u.style&&(u.style.display="block",this._shadowRoot&&this._shadowRootControllerEventTarget.indexOf(u)===-1&&(u.addEventListener("mousedown",function(p){p.preventDefault(),p.stopPropagation()}),this._shadowRootControllerEventTarget.push(u))),this.controllerArray.push(u)}this._bindControllersOff=this.controllersOff.bind(this),this.addDocEvent("mousedown",this._bindControllersOff,!1),this.addDocEvent("keydown",this._bindControllersOff,!1),this._antiBlur=!0,typeof b.showController=="function"&&b.showController(this.currentControllerName,this.controllerArray,this)},controllersOff:function(c){this._lineBreaker.style.display="none";const u=this.controllerArray.length;if(c&&c.target&&u>0){for(let p=0;p<u;p++)if(typeof this.controllerArray[p].contains=="function"&&this.controllerArray[p].contains(c.target))return}if(!(this._fileManager.pluginRegExp.test(this.currentControllerName)&&c&&c.type==="keydown"&&c.keyCode!==27)&&(e.element.lineBreaker_t.style.display=e.element.lineBreaker_b.style.display="none",this._variable._lineBreakComp=null,this.currentControllerName="",this.currentControllerTarget=null,this.currentFileComponentInfo=null,this.effectNode=null,!!this._bindControllersOff)){if(this.removeDocEvent("mousedown",this._bindControllersOff),this.removeDocEvent("keydown",this._bindControllersOff),this._bindControllersOff=null,u>0){for(let p=0;p<u;p++)typeof this.controllerArray[p]=="function"?this.controllerArray[p]():this.controllerArray[p].style.display="none";this.controllerArray=[]}this._antiBlur=!1}},setControllerPosition:function(c,u,p,v){s.rtl&&(v.left*=-1);const y=r.getOffset(u,e.element.wysiwygFrame);c.style.visibility="hidden",c.style.display="block";const w=p==="top"?-(c.offsetHeight+2):u.offsetHeight+12;c.style.top=y.top+w+v.top+"px";const x=y.left-e.element.wysiwygFrame.scrollLeft+v.left,E=c.offsetWidth,k=u.offsetWidth,N=r.hasClass(c.firstElementChild,"se-arrow")?c.firstElementChild:null;if(s.rtl){const T=E>k?E-k:0,R=T>0?0:k-E;c.style.left=x-T+R+"px",T>0&&N&&(N.style.left=(E-14<10+T?E-14:10+T)+"px");const M=e.element.wysiwygFrame.offsetLeft-c.offsetLeft;M>0&&(c.style.left="0px",N&&(N.style.left=M+"px"))}else{c.style.left=x+"px";const T=e.element.wysiwygFrame.offsetWidth-(c.offsetLeft+E);T<0?(c.style.left=c.offsetLeft+T+"px",N&&(N.style.left=20-T+"px")):N&&(N.style.left="20px")}c.style.visibility=""},execCommand:function(c,u,p){this._wd.execCommand(c,u,c==="formatBlock"?"<"+p+">":p),this.history.push(!0)},nativeFocus:function(){this.__focus(),this._editorRange()},__focus:function(){const c=r.getParentElement(this.getSelectionNode(),"figcaption");c?c.focus():e.element.wysiwyg.focus()},focus:function(){if(e.element.wysiwygFrame.style.display!=="none"){if(s.iframe)this.nativeFocus();else try{const c=this.getRange();if(c.startContainer===c.endContainer&&r.isWysiwygDiv(c.startContainer)){const u=c.commonAncestorContainer.children[c.startOffset];if(!r.isFormatElement(u)&&!r.isComponent(u)){const p=r.createElement(s.defaultTag),v=r.createElement("BR");p.appendChild(v),e.element.wysiwyg.insertBefore(p,u),this.setRange(v,0,v,0);return}}this.setRange(c.startContainer,c.startOffset,c.endContainer,c.endOffset)}catch{this.nativeFocus()}h._applyTagEffects(),this._isBalloon&&h._toggleToolbarBalloon()}},focusEdge:function(c){c||(c=e.element.wysiwyg.lastElementChild);const u=this.getFileComponent(c);u?this.selectComponent(u.target,u.pluginName):c?(c=r.getChildElement(c,function(p){return p.childNodes.length===0||p.nodeType===3},!0),c?this.setRange(c,c.textContent.length,c,c.textContent.length):this.nativeFocus()):this.focus()},blur:function(){s.iframe?e.element.wysiwygFrame.blur():e.element.wysiwyg.blur()},setRange:function(c,u,p,v){if(!c||!p)return;(r.isBreak(c)||c.nodeType===3)&&u>c.textContent.length&&(u=c.textContent.length),(r.isBreak(p)||p.nodeType===3)&&v>p.textContent.length&&(v=p.textContent.length),r.isFormatElement(c)&&(c=c.childNodes[u>0?c.childNodes.length-1:0]||c,u=u>0?c.nodeType===1&&!r.isBreak(c)?1:c.textContent?c.textContent.length:0:0),r.isFormatElement(p)&&(p=p.childNodes[v>0?p.childNodes.length-1:0]||p,v=v>0?p.nodeType===1&&!r.isBreak(p)?1:p.textContent?p.textContent.length:0:0);const y=this._wd.createRange();try{u>c.textContent.length&&(u=c.textContent.length),v>p.textContent.length&&(v=p.textContent.length),y.setStart(c,u),y.setEnd(p,v)}catch(x){console.warn("[SUNEDITOR.core.focus.error] "+x),this.nativeFocus();return}const w=this.getSelection();return w.removeAllRanges&&w.removeAllRanges(),w.addRange(y),this._rangeInfo(y,this.getSelection()),s.iframe&&this.__focus(),y},removeRange:function(){this._variable._range=null,this._variable._selectionNode=null,this.hasFocus&&this.getSelection().removeAllRanges(),this._setKeyEffect([])},getRange:function(){const c=this._variable._range||this._createDefaultRange(),u=this.getSelection();if(c.collapsed===u.isCollapsed||!e.element.wysiwyg.contains(u.focusNode))return c;if(u.rangeCount>0)return this._variable._range=u.getRangeAt(0),this._variable._range;{const p=u.anchorNode,v=u.focusNode,y=u.anchorOffset,w=u.focusOffset,x=r.compareElements(p,v),E=x.ancestor&&(x.result===0?y<=w:x.result>1);return this.setRange(E?p:v,E?y:w,E?v:p,E?w:y)}},getRange_addLine:function(c,u){if(this._selectionVoid(c)){const p=e.element.wysiwyg,v=r.createElement(s.defaultTag);v.innerHTML="<br>",p.insertBefore(v,u&&u!==p?u.nextElementSibling:p.firstElementChild),this.setRange(v.firstElementChild,0,v.firstElementChild,1),c=this._variable._range}return c},getSelection:function(){const c=this._shadowRoot&&this._shadowRoot.getSelection?this._shadowRoot.getSelection():this._ww.getSelection();return!this._variable._range&&!e.element.wysiwyg.contains(c.focusNode)&&(c.removeAllRanges(),c.addRange(this._createDefaultRange())),c},getSelectionNode:function(){if(e.element.wysiwyg.contains(this._variable._selectionNode)||this._editorRange(),!this._variable._selectionNode){const c=r.getChildElement(e.element.wysiwyg.firstChild,function(u){return u.childNodes.length===0||u.nodeType===3},!1);if(!c)this._editorRange();else return this._variable._selectionNode=c,c}return this._variable._selectionNode},_editorRange:function(){const c=this._wd.activeElement;if(r.isInputElement(c))return this._variable._selectionNode=c,c;const u=this.getSelection();if(!u)return null;let p=null;u.rangeCount>0?p=u.getRangeAt(0):p=this._createDefaultRange(),this._rangeInfo(p,u)},_rangeInfo:function(c,u){let p=null;this._variable._range=c,c.collapsed?r.isWysiwygDiv(c.commonAncestorContainer)?p=c.commonAncestorContainer.children[c.startOffset]||c.commonAncestorContainer:p=c.commonAncestorContainer:p=u.extentNode||u.anchorNode,this._variable._selectionNode=p},_createDefaultRange:function(){const c=e.element.wysiwyg,u=this._wd.createRange();let p=c.firstElementChild,v=null;return p?(v=p.firstChild,v||(v=r.createElement("BR"),p.appendChild(v))):(p=r.createElement(s.defaultTag),v=r.createElement("BR"),p.appendChild(v),c.appendChild(p)),u.setStart(v,0),u.setEnd(v,0),u},_selectionVoid:function(c){const u=c.commonAncestorContainer;return r.isWysiwygDiv(c.startContainer)&&r.isWysiwygDiv(c.endContainer)||/FIGURE/i.test(u.nodeName)||this._fileManager.regExp.test(u.nodeName)||r.isMediaComponent(u)},_resetRangeToTextNode:function(){const c=this.getRange();if(this._selectionVoid(c))return!1;const u=c.collapsed;let p=c.startContainer,v=c.startOffset,y=c.endContainer,w=c.endOffset,x,E,k;if(r.isFormatElement(p))for(p.childNodes[v]?(p=p.childNodes[v]||p,v=0):(p=p.lastChild||p,v=p.textContent.length);p&&p.nodeType===1&&p.firstChild;)p=p.firstChild||p,v=0;if(r.isFormatElement(y)){for(y=y.childNodes[w]||y.lastChild||y;y&&y.nodeType===1&&y.lastChild;)y=y.lastChild;w=u?0:y.textContent.length}if(x=r.isWysiwygDiv(p)?e.element.wysiwyg.firstChild:p,E=v,r.isBreak(x)||x.nodeType===1&&x.childNodes.length>0){const N=r.isBreak(x);if(!N){for(;x&&!r.isBreak(x)&&x.nodeType===1;)x=x.childNodes[E]||x.nextElementSibling||x.nextSibling,E=0;let T=r.getFormatElement(x,null);T===r.getRangeFormatElement(T,null)&&(T=r.createElement(r.getParentElement(x,r.isCell)?"DIV":s.defaultTag),x.parentNode.insertBefore(T,x),T.appendChild(x))}if(r.isBreak(x)){const T=r.createTextNode(r.zeroWidthSpace);x.parentNode.insertBefore(T,x),x=T,N&&p===y&&(y=x,w=1)}}if(p=x,v=E,x=r.isWysiwygDiv(y)?e.element.wysiwyg.lastChild:y,E=w,r.isBreak(x)||x.nodeType===1&&x.childNodes.length>0){const N=r.isBreak(x);if(!N){for(;x&&!r.isBreak(x)&&x.nodeType===1&&(k=x.childNodes,k.length!==0);)x=k[E>0?E-1:E]||!/FIGURE/i.test(k[0].nodeName)?k[0]:x.previousElementSibling||x.previousSibling||p,E=E>0?x.textContent.length:E;let T=r.getFormatElement(x,null);T===r.getRangeFormatElement(T,null)&&(T=r.createElement(r.isCell(T)?"DIV":s.defaultTag),x.parentNode.insertBefore(T,x),T.appendChild(x))}if(r.isBreak(x)){const T=r.createTextNode(r.zeroWidthSpace);x.parentNode.insertBefore(T,x),x=T,E=1,N&&!x.previousSibling&&r.removeItem(y)}}return y=x,w=E,this.setRange(p,v,y,w),!0},getSelectedElements:function(c){if(!this._resetRangeToTextNode())return[];let u=this.getRange();if(r.isWysiwygDiv(u.startContainer)){const D=e.element.wysiwyg.children;if(D.length===0)return[];this.setRange(D[0],0,D[D.length-1],D[D.length-1].textContent.trim().length),u=this.getRange()}const p=u.startContainer,v=u.endContainer,y=u.commonAncestorContainer,w=r.getListChildren(y,function(D){return c?c(D):r.isFormatElement(D)});if(!r.isWysiwygDiv(y)&&!r.isRangeFormatElement(y)&&w.unshift(r.getFormatElement(y,null)),p===v||w.length===1)return w;let x=r.getFormatElement(p,null),E=r.getFormatElement(v,null),k=null,N=null;const T=function(D){return r.isTable(D)?/^TABLE$/i.test(D.nodeName):!0};let R=r.getRangeFormatElement(x,T),M=r.getRangeFormatElement(E,T);r.isTable(R)&&r.isListCell(R.parentNode)&&(R=R.parentNode),r.isTable(M)&&r.isListCell(M.parentNode)&&(M=M.parentNode);const A=R===M;for(let D=0,$=w.length,H;D<$;D++){if(H=w[D],x===H||!A&&H===R){k=D;continue}if(E===H||!A&&H===M){N=D;break}}return k===null&&(k=0),N===null&&(N=w.length-1),w.slice(k,N+1)},getSelectedElementsAndComponents:function(c){const u=this.getRange().commonAncestorContainer,p=r.getParentElement(u,r.isComponent),v=r.isTable(u)?this.getSelectedElements(null):this.getSelectedElements((function(y){const w=this.getParentElement(y,this.isComponent);return this.isFormatElement(y)&&(!w||w===p)||this.isComponent(y)&&!this.getFormatElement(y)}).bind(r));if(c){for(let y=0,w=v.length;y<w;y++)for(let x=y-1;x>=0;x--)if(v[x].contains(v[y])){v.splice(y,1),y--,w--;break}}return v},isEdgePoint:function(c,u,p){return c.nodeType===1&&!c.textContent.length?!0:p!=="end"&&u===0||(!p||p!=="start")&&!c.nodeValue&&u===1||(!p||p==="end")&&!!c.nodeValue&&u===c.nodeValue.length},_isEdgeFormat:function(c,u,p){if(!this.isEdgePoint(c,u,p))return!1;const v=[];for(p=p==="start"?"previousSibling":"nextSibling";c&&!r.isFormatElement(c)&&!r.isWysiwygDiv(c);)if(!c[p]||r.isBreak(c[p])&&!c[p][p])c.nodeType===1&&v.push(c.cloneNode(!1)),c=c.parentNode;else return null;return v},showLoading:function(){e.element.loading.style.display="block"},closeLoading:function(){e.element.loading.style.display="none"},appendFormatTag:function(c,u){if(!c||!c.parentNode)return null;const p=r.getFormatElement(this.getSelectionNode(),null);let v=null;if(!r.isFormatElement(c)&&r.isFreeFormatElement(p||c.parentNode))v=r.createElement("BR");else{const y=u?typeof u=="string"?u:u.nodeName:r.isFormatElement(p)&&!r.isRangeFormatElement(p)&&!r.isFreeFormatElement(p)?p.nodeName:s.defaultTag;v=r.createElement(y),v.innerHTML="<br>",(u&&typeof u!="string"||!u&&r.isFormatElement(p))&&r.copyTagAttributes(v,u||p,["id"])}return r.isCell(c)?c.insertBefore(v,c.nextElementSibling):c.parentNode.insertBefore(v,c.nextElementSibling),v},insertComponent:function(c,u,p,v){if(this.isReadOnly||p&&!this.checkCharCount(c,null))return null;const y=this.removeNode();this.getRange_addLine(this.getRange(),y.container);let w=null,x=this.getSelectionNode(),E=r.getFormatElement(x,null);if(r.isListCell(E))this.insertNode(c,x===E?null:(x||y.container).nextSibling,!1),c.nextSibling||c.parentNode.appendChild(r.createElement("BR"));else{if(this.getRange().collapsed&&(y.container.nodeType===3||r.isBreak(y.container))){const k=r.getParentElement(y.container,(function(N){return this.isRangeFormatElement(N)}).bind(r));w=r.splitElement(y.container,y.offset,k?r.getElementDepth(k)+1:0),w&&(E=w.previousSibling)}this.insertNode(c,r.isRangeFormatElement(E)?null:E,!1),E&&r.onlyZeroWidthSpace(E)&&r.removeItem(E)}if(!v){this.setRange(c,0,c,0);const k=this.getFileComponent(c);k?this.selectComponent(k.target,k.pluginName):w&&(w=r.getEdgeChildNodes(w,null).sc||w,this.setRange(w,0,w,0))}return u||this.history.push(1),w||c},getFileComponent:function(c){if(!this._fileManager.queryString||!c)return null;let u,p;return(/^FIGURE$/i.test(c.nodeName)||/se-component/.test(c.className))&&(u=c.querySelector(this._fileManager.queryString)),!u&&c.nodeName&&this._fileManager.regExp.test(c.nodeName)&&(u=c),u&&(p=this._fileManager.pluginMap[u.nodeName.toLowerCase()],p)?{target:u,component:r.getParentElement(u,r.isComponent),pluginName:p}:null},selectComponent:function(c,u){if(r.isUneditableComponent(r.getParentElement(c,r.isComponent))||r.isUneditableComponent(c))return!1;this.hasFocus||this.focus();const p=this.plugins[u];p&&a.setTimeout((function(){typeof p.select=="function"&&this.callPlugin(u,p.select.bind(this,c),null),this._setComponentLineBreaker(c)}).bind(this))},_setComponentLineBreaker:function(c){this._lineBreaker.style.display="none";const u=r.getParentElement(c,r.isComponent);if(!u)return;const p=e.element.lineBreaker_t.style,v=e.element.lineBreaker_b.style,y=this.context.resizing.resizeContainer.style.display==="block"?this.context.resizing.resizeContainer:c,w=r.isListCell(u.parentNode);let x,E,k;(w?!u.previousSibling||r.isComponent(u.previousElementSibling):!r.isFormatElement(u.previousElementSibling))?(this._variable._lineBreakComp=u,E=e.element.wysiwyg.scrollTop,x=r.getOffset(c,e.element.wysiwygFrame).top+E,k=y.offsetWidth/2/2,p.top=x-E-12+"px",p.left=r.getOffset(y).left+k+"px",p.display="block"):p.display="none",(w?!u.nextSibling||r.isComponent(u.nextElementSibling):!r.isFormatElement(u.nextElementSibling))?(x||(this._variable._lineBreakComp=u,E=e.element.wysiwyg.scrollTop,x=r.getOffset(c,e.element.wysiwygFrame).top+E,k=y.offsetWidth/2/2),v.top=x+y.offsetHeight-E-12+"px",v.left=r.getOffset(y).left+y.offsetWidth-k-24+"px",v.display="block"):v.display="none"},_checkDuplicateNode:function(c,u){(function p(v){d._dupleCheck(v,u);const y=v.childNodes;for(let w=0,x=y.length;w<x;w++)p(y[w])})(c)},_dupleCheck:function(c,u){if(!r.isTextStyleElement(c))return;const p=(c.style.cssText.match(/[^;]+;/g)||[]).map(function(w){return w.trim()}),v=c.nodeName;if(/^span$/i.test(v)&&p.length===0)return c;let y=!1;return function w(x){if(!(r.isWysiwygDiv(x)||!r.isTextStyleElement(x))){if(x.nodeName===v){y=!0;const E=x.style.cssText.match(/[^;]+;/g)||[];for(let k=0,N=E.length,T;k<N;k++)(T=p.indexOf(E[k].trim()))>-1&&p.splice(T,1);for(let k=0,N=x.classList.length;k<N;k++)c.classList.remove(x.classList[k])}w(x.parentElement)}}(u),y&&((c.style.cssText=p.join(" "))||(c.setAttribute("style",""),c.removeAttribute("style")),c.attributes.length||c.setAttribute("data-se-duple","true")),c},insertNode:function(c,u,p){if(this.isReadOnly||p&&!this.checkCharCount(c,null))return null;let v=null,y=this.getRange(),w=r.isListCell(y.commonAncestorContainer)?y.commonAncestorContainer:r.getFormatElement(this.getSelectionNode(),null),x=r.isListCell(w)&&(r.isListCell(c)||r.isList(c)),E,k,N,T=null;const R=r.isFreeFormatElement(w),M=!R&&(r.isFormatElement(c)||r.isRangeFormatElement(c))||r.isComponent(c);if(x&&(N=u||r.isList(c)?w.lastChild:w.nextElementSibling,T=r.isList(c)?w:(N||w).parentNode),!u&&(M||r.isComponent(c)||r.isMedia(c))){const z=this.isEdgePoint(y.endContainer,y.endOffset,"end"),O=this.removeNode(),B=O.container,L=B===O.prevContainer&&y.collapsed?null:O.prevContainer;if(x&&L)if(T=L.nodeType===3?L.parentNode:L,T.contains(B)){let U=!0;for(N=B;N.parentNode&&N.parentNode!==T;)N=N.parentNode,U=!1;U&&B===L&&(N=N.nextSibling)}else N=null;else if(x&&r.isListCell(B)&&!w.parentElement)w=r.createElement("LI"),T.appendChild(w),B.appendChild(T),N=null;else if(B.nodeType===3||r.isBreak(B)||x){const U=r.getParentElement(B,(function(P){return this.isRangeFormatElement(P)||this.isListCell(P)}).bind(r));if(u=r.splitElement(B,O.offset,U?r.getElementDepth(U)+1:0),!u)r.isListCell(w)||(N=u=w);else if(x){if(w.contains(B)){const P=r.isList(w.lastElementChild);let W=null;z||(W=w.cloneNode(!1),W.appendChild(u.textContent.trim()?u:r.createTextNode(r.zeroWidthSpace))),P&&(W||(W=w.cloneNode(!1),W.appendChild(r.createTextNode(r.zeroWidthSpace))),W.appendChild(w.lastElementChild)),W&&(w.parentNode.insertBefore(W,w.nextElementSibling),N=u=W)}}else u=u.previousSibling}}y=!u&&!M?this.getRange_addLine(this.getRange(),null):this.getRange();const A=y.commonAncestorContainer,D=y.startOffset,$=y.endOffset,H=y.startContainer===A&&r.isFormatElement(A),j=H&&(A.childNodes[D]||A.childNodes[0])||y.startContainer,F=H&&(A.childNodes[$]||A.childNodes[A.childNodes.length-1])||y.endContainer;if(!x)if(u)E=u.parentNode,u=u.nextSibling,k=!0;else if(E=j,j.nodeType===3&&(E=j.parentNode),y.collapsed)if(A.nodeType===3)A.textContent.length>$?u=A.splitText($):u=A.nextSibling;else if(r.isBreak(E))u=E,E=E.parentNode;else{let z=E.childNodes[D];const O=z&&z.nodeType===3&&r.onlyZeroWidthSpace(z)&&r.isBreak(z.nextSibling)?z.nextSibling:z;O?!O.nextSibling&&r.isBreak(O)?(E.removeChild(O),u=null):u=r.isBreak(O)&&!r.isBreak(c)?O:O.nextSibling:u=null}else if(j===F){this.isEdgePoint(F,$)?u=F.nextSibling:u=F.splitText($);let O=j;this.isEdgePoint(j,D)||(O=j.splitText(D)),E.removeChild(O),E.childNodes.length===0&&M&&(E.innerHTML="<br>")}else{const O=this.removeNode(),B=O.container,L=O.prevContainer;if(B&&B.childNodes.length===0&&M&&(r.isFormatElement(B)?B.innerHTML="<br>":r.isRangeFormatElement(B)&&(B.innerHTML="<"+s.defaultTag+"><br></"+s.defaultTag+">")),r.isListCell(B)&&c.nodeType===3)E=B,u=null;else if(!M&&L)if(E=L.nodeType===3?L.parentNode:L,E.contains(B)){let U=!0;for(u=B;u.parentNode&&u.parentNode!==E;)u=u.parentNode,U=!1;U&&B===L&&(u=u.nextSibling)}else u=null;else r.isWysiwygDiv(B)&&!r.isFormatElement(c)?(E=B.appendChild(r.createElement(s.defaultTag)),u=null):(u=M?F:B===L?B.nextSibling:B,E=!u||!u.parentNode?A:u.parentNode);for(;u&&!r.isFormatElement(u)&&u.parentNode!==A;)u=u.parentNode}try{if(!x){if((r.isWysiwygDiv(u)||E===e.element.wysiwyg.parentNode)&&(E=e.element.wysiwyg,u=null),r.isFormatElement(c)||r.isRangeFormatElement(c)||!r.isListCell(E)&&r.isComponent(c)){const z=E;if(r.isList(u))E=u,u=null;else if(r.isListCell(u))E=u.previousElementSibling||u;else if(!k&&!u){const O=this.removeNode(),B=O.container.nodeType===3?r.isListCell(r.getFormatElement(O.container,null))?O.container:r.getFormatElement(O.container,null)||O.container.parentNode:O.container,L=r.isWysiwygDiv(B)||r.isRangeFormatElement(B);E=L?B:B.parentNode,u=L?null:B.nextSibling}z.childNodes.length===0&&E!==z&&r.removeItem(z)}if(M&&!R&&!r.isRangeFormatElement(E)&&!r.isListCell(E)&&!r.isWysiwygDiv(E)&&(u=E.nextElementSibling,E=E.parentNode),r.isWysiwygDiv(E)&&(c.nodeType===3||r.isBreak(c))){const z=r.createElement(s.defaultTag);z.appendChild(c),v=c,c=z}}if(x?T.parentNode?(E=T,u=N):(E=e.element.wysiwyg,u=null):u=E===u?E.lastChild:u,r.isListCell(c)&&!r.isList(E)){if(r.isListCell(E))u=E.nextElementSibling,E=E.parentNode;else{const z=r.createElement("ol");E.insertBefore(z,u),E=z,u=null}x=!0}if(this._checkDuplicateNode(c,E),E.insertBefore(c,u),x)if(r.onlyZeroWidthSpace(w.textContent.trim()))r.removeItem(w),c=c.lastChild;else{const z=r.getArrayItem(w.children,r.isList);z&&(c!==z?(c.appendChild(z),c=z.previousSibling):(E.appendChild(c),c=E),r.onlyZeroWidthSpace(w.textContent.trim())&&r.removeItem(w))}}catch(z){E.appendChild(c),console.warn("[SUNEDITOR.insertNode.warn] "+z)}finally{v&&(c=v);const z=E.querySelectorAll("[data-se-duple]");if(z.length>0)for(let O=0,B=z.length,L,U,P,W;O<B;O++){for(L=z[O],P=L.childNodes,W=L.parentNode;P[0];)U=P[0],W.insertBefore(U,L);L===c&&(c=U),r.removeItem(L)}if((r.isFormatElement(c)||r.isComponent(c))&&j===F){const O=r.getFormatElement(A,null);O&&O.nodeType===1&&r.isEmptyLine(O)&&r.removeItem(O)}if(R&&(r.isFormatElement(c)||r.isRangeFormatElement(c))&&(c=this._setIntoFreeFormat(c)),!r.isComponent(c)){let O=1;if(c.nodeType===3)O=c.textContent.length,this.setRange(c,O,c,O);else if(!r.isBreak(c)&&!r.isListCell(c)&&r.isFormatElement(E)){let B=null;(!c.previousSibling||r.isBreak(c.previousSibling))&&(B=r.createTextNode(r.zeroWidthSpace),c.parentNode.insertBefore(B,c)),(!c.nextSibling||r.isBreak(c.nextSibling))&&(B=r.createTextNode(r.zeroWidthSpace),c.parentNode.insertBefore(B,c.nextSibling)),r._isIgnoreNodeChange(c)&&(c=c.nextSibling,O=0)}this.setRange(c,O,c,O)}return c}},_setIntoFreeFormat:function(c){const u=c.parentNode;let p,v;for(;r.isFormatElement(c)||r.isRangeFormatElement(c);){for(p=c.childNodes,v=null;p[0];){if(v=p[0],r.isFormatElement(v)||r.isRangeFormatElement(v)){if(this._setIntoFreeFormat(v),!c.parentNode)break;p=c.childNodes;continue}u.insertBefore(v,c)}c.childNodes.length===0&&r.removeItem(c),c=r.createElement("BR"),u.insertBefore(c,v.nextSibling)}return c},removeNode:function(){this._resetRangeToTextNode();const c=this.getRange();if(c.startContainer===c.endContainer){const O=r.getParentElement(c.startContainer,r.isMediaComponent);if(O){const B=r.createElement("BR"),L=r.createElement(s.defaultTag);return L.appendChild(B),r.changeElement(O,L),d.setRange(L,0,L,0),this.history.push(!0),{container:L,offset:0,prevContainer:null}}}const u=c.startOffset===0,p=d.isEdgePoint(c.endContainer,c.endOffset,"end");let v=null,y=null,w=null;u&&(y=r.getFormatElement(c.startContainer),y&&(v=y.previousElementSibling,y=v)),p&&(w=r.getFormatElement(c.endContainer),w=w&&w.nextElementSibling);let x,E=0,k=c.startContainer,N=c.endContainer,T=c.startOffset,R=c.endOffset;const M=c.commonAncestorContainer.nodeType===3&&c.commonAncestorContainer.parentNode===k.parentNode?k.parentNode:c.commonAncestorContainer;if(M===k&&M===N&&(k=M.children[T],N=M.children[R],T=R=0),!k||!N)return{container:M,offset:0};if(k===N&&c.collapsed&&k.textContent&&r.onlyZeroWidthSpace(k.textContent.substr(T)))return{container:k,offset:T,prevContainer:k&&k.parentNode?k:null};let A=null,D=null;const $=r.getListChildNodes(M,null);let H=r.getArrayIndex($,k),j=r.getArrayIndex($,N);if($.length>0&&H>-1&&j>-1){for(let O=H+1,B=k;O>=0;O--)$[O]===B.parentNode&&$[O].firstChild===B&&T===0&&(H=O,B=B.parentNode);for(let O=j-1,B=N;O>H;O--)$[O]===B.parentNode&&$[O].nodeType===1&&($.splice(O,1),B=B.parentNode,--j)}else{if($.length===0){if(r.isFormatElement(M)||r.isRangeFormatElement(M)||r.isWysiwygDiv(M)||r.isBreak(M)||r.isMedia(M))return{container:M,offset:0};if(M.nodeType===3)return{container:M,offset:R};$.push(M),k=N=M}else if(k=N=$[0],r.isBreak(k)||r.onlyZeroWidthSpace(k))return{container:r.isMedia(M)?M:k,offset:0};H=j=0}for(let O=H;O<=j;O++){const B=$[O];if(B.length===0||B.nodeType===3&&B.data===void 0){this._nodeRemoveListItem(B);continue}if(B===k){if(k.nodeType===1){if(r.isComponent(k))continue;A=r.createTextNode(k.textContent)}else B===N?(A=r.createTextNode(k.substringData(0,T)+N.substringData(R,N.length-R)),E=T):A=r.createTextNode(k.substringData(0,T));if(A.length>0?k.data=A.data:this._nodeRemoveListItem(k),B===N)break;continue}if(B===N){if(N.nodeType===1){if(r.isComponent(N))continue;D=r.createTextNode(N.textContent)}else D=r.createTextNode(N.substringData(R,N.length-R));D.length>0?N.data=D.data:this._nodeRemoveListItem(N);continue}this._nodeRemoveListItem(B)}const F=r.getParentElement(N,"ul"),z=r.getParentElement(k,"li");if(F&&z&&z.contains(F)?(x=F.previousSibling,E=x.textContent.length):(x=N&&N.parentNode?N:k&&k.parentNode?k:c.endContainer||c.startContainer,E=!u&&!p?E:p?x.textContent.length:0),!r.isWysiwygDiv(x)&&x.childNodes.length===0){const O=r.removeItemAllParents(x,null,null);O&&(x=O.sc||O.ec||e.element.wysiwyg)}return!r.getFormatElement(x)&&!(k&&k.parentNode)&&(w?(x=w,E=0):y&&(x=y,E=1)),this.setRange(x,E,x,E),this.history.push(!0),{container:x,offset:E,prevContainer:v}},_nodeRemoveListItem:function(c){const u=r.getFormatElement(c,null);r.removeItem(c),r.isListCell(u)&&(r.removeItemAllParents(u,null,null),u&&r.isList(u.firstChild)&&u.insertBefore(r.createTextNode(r.zeroWidthSpace),u.firstChild))},applyRangeFormatElement:function(c){this.getRange_addLine(this.getRange(),null);const u=this.getSelectedElementsAndComponents(!1);if(!u||u.length===0)return;e:for(let R=0,M=u.length,A,D,$,H,j,F;R<M;R++)if(A=u[R],!!r.isListCell(A)&&(D=A.lastElementChild,D&&r.isListCell(A.nextElementSibling)&&u.indexOf(A.nextElementSibling)>-1&&(H=D.lastElementChild,u.indexOf(H)>-1))){let z=null;for(;z=H.lastElementChild;)if(r.isList(z))if(u.indexOf(z.lastElementChild)>-1)H=z.lastElementChild;else continue e;$=D.firstElementChild,j=u.indexOf($),F=u.indexOf(H),u.splice(j,F-j+1),M=u.length;continue}let p=u[u.length-1],v,y,w;r.isRangeFormatElement(p)||r.isFormatElement(p)?v=p:v=r.getRangeFormatElement(p,null)||r.getFormatElement(p,null),r.isCell(v)?(y=null,w=v):(y=v.nextSibling,w=v.parentNode);let x=r.getElementDepth(v),E=null;const k=[],N=function(R,M,A){let D=null;if(R!==M&&!r.isTable(M)){if(M&&r.getElementDepth(R)===r.getElementDepth(M))return A;D=r.removeItemAllParents(M,null,R)}return D?D.ec:A};for(let R=0,M=u.length,A,D,$,H,j,F,z;R<M;R++)if(A=u[R],D=A.parentNode,!(!D||c.contains(D)))if($=r.getElementDepth(A),r.isList(D)){if(E===null&&(F?(E=F,z=!0,F=null):E=D.cloneNode(!1)),k.push(A),j=u[R+1],R===M-1||j&&j.parentNode!==D){j&&A.contains(j.parentNode)&&(F=j.parentNode.cloneNode(!1));let O=D.parentNode,B;for(;r.isList(O);)B=r.createElement(O.nodeName),B.appendChild(E),E=B,O=O.parentNode;const L=this.detachRangeFormatElement(D,k,null,!0,!0);x>=$?(x=$,w=L.cc,y=N(w,D,L.ec),y&&(w=y.parentNode)):w===L.cc&&(y=L.ec),w!==L.cc&&(H=N(w,L.cc,H),H!==void 0?y=H:y=L.cc);for(let U=0,P=L.removeArray.length;U<P;U++)E.appendChild(L.removeArray[U]);z||c.appendChild(E),F&&L.removeArray[L.removeArray.length-1].appendChild(F),E=null,z=!1}}else x>=$&&(x=$,w=D,y=A.nextSibling),c.appendChild(A),w!==D&&(H=N(w,D),H!==void 0&&(y=H));if(this.effectNode=null,r.mergeSameTags(c,null,!1),r.mergeNestedTags(c,(function(R){return this.isList(R)}).bind(r)),y&&r.getElementDepth(y)>0&&(r.isList(y.parentNode)||r.isList(y.parentNode.parentNode))){const R=r.getParentElement(y,(function(A){return this.isRangeFormatElement(A)&&!this.isList(A)}).bind(r)),M=r.splitElement(y,null,R?r.getElementDepth(R)+1:0);M.parentNode.insertBefore(c,M)}else w.insertBefore(c,y),N(c,y);const T=r.getEdgeChildNodes(c.firstElementChild,c.lastElementChild);u.length>1?this.setRange(T.sc,0,T.ec,T.ec.textContent.length):this.setRange(T.ec,T.ec.textContent.length,T.ec,T.ec.textContent.length),this.history.push(!1)},detachRangeFormatElement:function(c,u,p,v,y){const w=this.getRange();let x=w.startOffset,E=w.endOffset,k=r.getListChildNodes(c,function(L){return L.parentNode===c}),N=c.parentNode,T=null,R=null,M=c.cloneNode(!1);const A=[],D=r.isList(p);let $=!1,H=!1,j=!1;function F(L,U,P,W){if(r.onlyZeroWidthSpace(U)&&(U.innerHTML=r.zeroWidthSpace,x=E=1),U.nodeType===3)return L.insertBefore(U,P),U;const Q=(j?U:W).childNodes;let V=U.cloneNode(!1),X=null,Z=null;for(;Q[0];)Z=Q[0],r._notTextNode(Z)&&!r.isBreak(Z)&&!r.isListCell(V)?(V.childNodes.length>0&&(X||(X=V),L.insertBefore(V,P),V=U.cloneNode(!1)),L.insertBefore(Z,P),X||(X=Z)):V.appendChild(Z);if(V.childNodes.length>0){if(r.isListCell(L)&&r.isListCell(V)&&r.isList(P))if(D){for(X=P;P;)V.appendChild(P),P=P.nextSibling;L.parentNode.insertBefore(V,L.nextElementSibling)}else{const G=W.nextElementSibling,J=r.detachNestedList(W,!1);if(c!==J||G!==W.nextElementSibling){const ee=V.childNodes;for(;ee[0];)W.appendChild(ee[0]);c=J,H=!0}}else L.insertBefore(V,P);X||(X=V)}return X}for(let L=0,U=k.length,P,W,Q;L<U;L++)if(P=k[L],!(P.nodeType===3&&r.isList(M)))if(j=!1,v&&L===0&&(!u||u.length===U||u[0]===P?T=c.previousSibling:T=M),u&&(W=u.indexOf(P)),u&&W===-1)M||(M=c.cloneNode(!1)),M.appendChild(P);else{if(u&&(Q=u[W+1]),M&&M.children.length>0&&(N.insertBefore(M,c),M=null),!D&&r.isListCell(P))if(Q&&r.getElementDepth(P)!==r.getElementDepth(Q)&&(r.isListCell(N)||r.getArrayItem(P.children,r.isList,!1))){const V=P.nextElementSibling,X=r.detachNestedList(P,!1);(c!==X||V!==P.nextElementSibling)&&(c=X,H=!0)}else{const V=P;P=r.createElement(v?V.nodeName:r.isList(c.parentNode)||r.isListCell(c.parentNode)?"LI":r.isCell(c.parentNode)?"DIV":s.defaultTag);const X=r.isListCell(P),Z=V.childNodes;for(;Z[0]&&!(r.isList(Z[0])&&!X);)P.appendChild(Z[0]);r.copyFormatAttributes(P,V),j=!0}else P=P.cloneNode(!1);if(!H&&(v?(A.push(P),r.removeItem(k[L])):(p?($||(N.insertBefore(p,c),$=!0),P=F(p,P,null,k[L])):P=F(N,P,c,k[L]),H||(u?(R=P,T||(T=P)):T||(T=R=P))),H)){H=j=!1,k=r.getListChildNodes(c,function(V){return V.parentNode===c}),M=c.cloneNode(!1),N=c.parentNode,L=-1,U=k.length;continue}}const z=c.parentNode;let O=c.nextSibling;M&&M.children.length>0&&z.insertBefore(M,O),p?T=p.previousSibling:T||(T=c.previousSibling),O=c.nextSibling!==M?c.nextSibling:M?M.nextSibling:null,c.children.length===0||c.textContent.length===0?r.removeItem(c):r.removeEmptyNode(c,null,!1);let B=null;if(v)B={cc:z,sc:T,so:x,ec:O,eo:E,removeArray:A};else{T||(T=R),R||(R=T);const L=r.getEdgeChildNodes(T,R.parentNode?T:R);B={cc:(L.sc||L.ec).parentNode,sc:L.sc,so:x,ec:L.ec,eo:E,removeArray:null}}if(this.effectNode=null,y)return B;!v&&B&&(u?this.setRange(B.sc,x,B.ec,E):this.setRange(B.sc,0,B.sc,0)),this.history.push(!1)},detachList:function(c,u){let p={},v=!1,y=!1,w=null,x=null;const E=(function(k){return!this.isComponent(k)}).bind(r);for(let k=0,N=c.length,T,R,M,A;k<N;k++){if(M=k===N-1,R=r.getRangeFormatElement(c[k],E),A=r.isList(R),!T&&A)T=R,p={r:T,f:[r.getParentElement(c[k],"LI")]},k===0&&(v=!0);else if(T&&A)if(T!==R){const D=this.detachRangeFormatElement(p.f[0].parentNode,p.f,null,u,!0);R=c[k].parentNode,v&&(w=D.sc,v=!1),M&&(x=D.ec),A?(T=R,p={r:T,f:[r.getParentElement(c[k],"LI")]},M&&(y=!0)):T=null}else p.f.push(r.getParentElement(c[k],"LI")),M&&(y=!0);if(M&&r.isList(T)){const D=this.detachRangeFormatElement(p.f[0].parentNode,p.f,null,u,!0);(y||N===1)&&(x=D.ec),v&&(w=D.sc||x)}}return{sc:w,ec:x}},nodeChange:function(c,u,p,v){this._resetRangeToTextNode();let y=this.getRange_addLine(this.getRange(),null);u=u&&u.length>0?u:!1,p=p&&p.length>0?p:!1;const w=!c,x=w&&!p&&!u;let E=y.startContainer,k=y.startOffset,N=y.endContainer,T=y.endOffset;if(x&&y.collapsed&&r.isFormatElement(E.parentNode)||E===N&&E.nodeType===1&&r.isNonEditable(E)){const Z=E.parentNode;if(!r.isListCell(Z)||!r.getValues(Z.style).some((function(G){return this._listKebab.indexOf(G)>-1}).bind(this)))return}if(y.collapsed&&!x&&E.nodeType===1&&!r.isBreak(E)&&!r.isComponent(E)){let Z=null;const G=E.childNodes[k];G&&(G.nextSibling?Z=r.isBreak(G)?G:G.nextSibling:Z=null);const J=r.createTextNode(r.zeroWidthSpace);E.insertBefore(J,Z),this.setRange(J,1,J,1),y=this.getRange(),E=y.startContainer,k=y.startOffset,N=y.endContainer,T=y.endOffset}r.isFormatElement(E)&&(E=E.childNodes[k]||E.firstChild,k=0),r.isFormatElement(N)&&(N=N.childNodes[T]||N.lastChild,T=N.textContent.length),w&&(c=r.createElement("DIV"));const R=a.RegExp,M=c.nodeName;if(!x&&E===N&&!p&&c){let Z=E,G=0;const J=[],ee=c.style;for(let le=0,ue=ee.length;le<ue;le++)J.push(ee[le]);const se=c.classList;for(let le=0,ue=se.length;le<ue;le++)J.push("."+se[le]);if(J.length>0){for(;!r.isFormatElement(Z)&&!r.isWysiwygDiv(Z);){for(let le=0;le<J.length;le++)if(Z.nodeType===1){const ue=J[le],Se=/^\./.test(ue)?new R("\\s*"+ue.replace(/^\./,"")+"(\\s+|$)","ig"):!1,Re=w?!!Z.style[ue]:!!Z.style[ue]&&!!c.style[ue]&&Z.style[ue]===c.style[ue],ge=Se===!1?!1:w?!!Z.className.match(Se):!!Z.className.match(Se)&&!!c.className.match(Se);(Re||ge)&&G++}Z=Z.parentNode}if(G>=J.length)return}}let A={},D={},$,H="",j="",F="";if(u){for(let Z=0,G=u.length,J;Z<G;Z++)J=u[Z],/^\./.test(J)?j+=(j?"|":"\\s*(?:")+J.replace(/^\./,""):H+=(H?"|":"(?:;|^|\\s)(?:")+J;H&&(H+=")\\s*:[^;]*\\s*(?:;|$)",H=new R(H,"ig")),j&&(j+=")(?=\\s+|$)",j=new R(j,"ig"))}if(p){F="^(?:"+p[0];for(let Z=1;Z<p.length;Z++)F+="|"+p[Z];F+=")$",F=new R(F,"i")}const z=a.Boolean,O={v:!1},B=function(Z){const G=Z.cloneNode(!1);if(G.nodeType===3||r.isBreak(G))return G;if(x)return null;const J=!F&&w||F&&F.test(G.nodeName);if(J&&!v)return O.v=!0,null;const ee=G.style.cssText;let se="";H&&ee.length>0&&(se=ee.replace(H,"").trim(),se!==ee&&(O.v=!0));const le=G.className;let ue="";return j&&le.length>0&&(ue=le.replace(j,"").trim(),ue!==le&&(O.v=!0)),w&&(j||!le)&&(H||!ee)&&!se&&!ue&&J?(O.v=!0,null):se||ue||G.nodeName!==M||z(H)!==z(ee)||z(j)!==z(le)?(H&&ee.length>0&&(G.style.cssText=se),G.style.cssText||G.removeAttribute("style"),j&&le.length>0&&(G.className=ue.trim()),G.className.trim()||G.removeAttribute("class"),!G.style.cssText&&!G.className&&(G.nodeName===M||J)?(O.v=!0,null):G):(O.v=!0,null)},L=this.getSelectedElements(null);y=this.getRange(),E=y.startContainer,k=y.startOffset,N=y.endContainer,T=y.endOffset,r.getFormatElement(E,null)||(E=r.getChildElement(L[0],function(Z){return Z.nodeType===3},!1),k=0),r.getFormatElement(N,null)||(N=r.getChildElement(L[L.length-1],function(Z){return Z.nodeType===3},!1),T=N.textContent.length);const U=r.getFormatElement(E,null)===r.getFormatElement(N,null),P=L.length-(U?0:1);$=c.cloneNode(!1);const W=x||w&&function(Z){for(let G=0,J=Z.length;G<J;G++)if(r._isMaintainedNode(Z[G])||r._isSizeNode(Z[G]))return!0;return!1}(p),Q=w||r._isSizeNode($),V=this._util_getMaintainedNode.bind(r,W,Q),X=this._util_isMaintainedNode.bind(r,W,Q);if(U){this._resetCommonListCell(L[0],u)&&(y=this.setRange(E,k,N,T));const Z=this._nodeChange_oneLine(L[0],$,B,E,k,N,T,x,w,y.collapsed,O,V,X);A.container=Z.startContainer,A.offset=Z.startOffset,D.container=Z.endContainer,D.offset=Z.endOffset,A.container===D.container&&r.onlyZeroWidthSpace(A.container)&&(A.offset=D.offset=1),this._setCommonListStyle(Z.ancestor,null)}else{let Z=!1;P>0&&this._resetCommonListCell(L[P],u)&&(Z=!0),this._resetCommonListCell(L[0],u)&&(Z=!0),Z&&this.setRange(E,k,N,T),P>0&&($=c.cloneNode(!1),D=this._nodeChange_endLine(L[P],$,B,N,T,x,w,O,V,X));for(let G=P-1,J;G>0;G--)this._resetCommonListCell(L[G],u),$=c.cloneNode(!1),J=this._nodeChange_middleLine(L[G],$,B,x,w,O,D.container),J.endContainer&&J.ancestor.contains(J.endContainer)&&(D.ancestor=null,D.container=J.endContainer),this._setCommonListStyle(J.ancestor,null);$=c.cloneNode(!1),A=this._nodeChange_startLine(L[0],$,B,E,k,x,w,O,V,X,D.container),A.endContainer&&(D.ancestor=null,D.container=A.endContainer),P<=0?D=A:D.container||(D.ancestor=null,D.container=A.container,D.offset=A.container.textContent.length),this._setCommonListStyle(A.ancestor,null),this._setCommonListStyle(D.ancestor||r.getFormatElement(D.container),null)}this.controllersOff(),this.setRange(A.container,A.offset,D.container,D.offset),this.history.push(!1)},_resetCommonListCell:function(c,u){if(!r.isListCell(c))return;u||(u=this._listKebab);const p=r.getArrayItem(c.childNodes,function(R){return!r.isBreak(R)},!0),v=c.style,y=[],w=[],x=r.getValues(v);for(let R=0,M=this._listKebab.length;R<M;R++)x.indexOf(this._listKebab[R])>-1&&u.indexOf(this._listKebab[R])>-1&&(y.push(this._listCamel[R]),w.push(this._listKebab[R]));if(!y.length)return;const E=r.createElement("SPAN");for(let R=0,M=y.length;R<M;R++)E.style[y[R]]=v[w[R]],v.removeProperty(w[R]);let k=E.cloneNode(!1),N=null,T=!1;for(let R=0,M=p.length,A,D;R<M;R++)A=p[R],!s._textTagsMap[A.nodeName.toLowerCase()]&&(D=r.getValues(A.style),D.length===0||y.some(function($){return D.indexOf($)===-1})&&D.some(function($){})?(N=A.nextSibling,k.appendChild(A)):k.childNodes.length>0&&(c.insertBefore(k,N),k=E.cloneNode(!1),N=null,T=!0));return k.childNodes.length>0&&(c.insertBefore(k,N),T=!0),v.length||c.removeAttribute("style"),T},_setCommonListStyle:function(c,u){if(!r.isListCell(c))return;const p=r.getArrayItem((u||c).childNodes,function(k){return!r.isBreak(k)},!0);if(u=p[0],!u||p.length>1||u.nodeType!==1)return;const v=u.style,y=c.style,w=u.nodeName.toLowerCase();let x=!1;s._textTagsMap[w]===s._defaultCommand.bold.toLowerCase()&&(y.fontWeight="bold"),s._textTagsMap[w]===s._defaultCommand.italic.toLowerCase()&&(y.fontStyle="italic");const E=r.getValues(v);if(E.length>0)for(let k=0,N=this._listCamel.length;k<N;k++)E.indexOf(this._listKebab[k])>-1&&(y[this._listCamel[k]]=v[this._listCamel[k]],v.removeProperty(this._listKebab[k]),x=!0);if(this._setCommonListStyle(c,u),!!x&&!v.length){const k=u.childNodes,N=u.parentNode,T=u.nextSibling;for(;k.length>0;)N.insertBefore(k[0],T);r.removeItem(u)}},_stripRemoveNode:function(c){const u=c.parentNode;if(!c||c.nodeType===3||!u)return;const p=c.childNodes;for(;p[0];)u.insertBefore(p[0],c);u.removeChild(c)},_util_getMaintainedNode:function(c,u,p){return!p||c?null:this.getParentElement(p,this._isMaintainedNode.bind(this))||(u?null:this.getParentElement(p,this._isSizeNode.bind(this)))},_util_isMaintainedNode:function(c,u,p){if(!p||c||p.nodeType!==1)return!1;const v=this._isMaintainedNode(p);return this.getParentElement(p,this._isMaintainedNode.bind(this))?v:v||(u?!1:this._isSizeNode(p))},_nodeChange_oneLine:function(c,u,p,v,y,w,x,E,k,N,T,R,M){let A=v.parentNode;for(;!A.nextSibling&&!A.previousSibling&&!r.isFormatElement(A.parentNode)&&!r.isWysiwygDiv(A.parentNode)&&A.nodeName!==u.nodeName;)A=A.parentNode;if(!k&&A===w.parentNode&&A.nodeName===u.nodeName&&r.onlyZeroWidthSpace(v.textContent.slice(0,y))&&r.onlyZeroWidthSpace(w.textContent.slice(x))){const ge=A.childNodes;let ke=!0;for(let I=0,Y=ge.length,q,re,ie,te;I<Y;I++){if(q=ge[I],te=!r.onlyZeroWidthSpace(q),q===v){re=!0;continue}if(q===w){ie=!0;continue}if(!re&&te||re&&ie&&te){ke=!1;break}}if(ke)return r.copyTagAttributes(A,u),{ancestor:c,startContainer:v,startOffset:y,endContainer:w,endOffset:x}}T.v=!1;const D=c,$=[u],H=c.cloneNode(!1),j=v===w;let F=v,z=y,O=w,B=x,L=!1,U=!1,P,W,Q,V,X;const Z=a.RegExp;function G(ge){const ke=new Z("(?:;|^|\\s)(?:"+V+"null)\\s*:[^;]*\\s*(?:;|$)","ig");let I="";return ke&&ge.style.cssText.length>0&&(I=ke.test(ge.style.cssText)),!I}if(function ge(ke,I){const Y=ke.childNodes;for(let q=0,re=Y.length,ie;q<re;q++){let te=Y[q];if(!te)continue;let ae=I,ve;if(!L&&te===F){let me=H;X=R(te);const xe=r.createTextNode(F.nodeType===1?"":F.substringData(0,z)),Ae=r.createTextNode(F.nodeType===1?"":F.substringData(z,j&&B>=z?B-z:F.data.length-z));if(X){const Ie=R(I);if(Ie&&Ie.parentNode!==me){let Ye=Ie,Ge=null;for(;Ye.parentNode!==me;){for(I=Ge=Ye.parentNode.cloneNode(!1);Ye.childNodes[0];)Ge.appendChild(Ye.childNodes[0]);Ye.appendChild(Ge),Ye=Ye.parentNode}Ye.parentNode.appendChild(Ie)}X=X.cloneNode(!1)}r.onlyZeroWidthSpace(xe)||I.appendChild(xe);const Ee=R(I);for(Ee&&(X=Ee),X&&(me=X),W=te,P=[],V="";W!==me&&W!==D&&W!==null;)ie=M(W)?null:p(W),ie&&W.nodeType===1&&G(W)&&(P.push(ie),V+=W.style.cssText.substr(0,W.style.cssText.indexOf(":"))+"|"),W=W.parentNode;const Fe=P.pop()||Ae;for(Q=W=Fe;P.length>0;)W=P.pop(),Q.appendChild(W),Q=W;if(u.appendChild(Fe),me.appendChild(u),X&&!R(O)&&(u=u.cloneNode(!1),H.appendChild(u),$.push(u)),F=Ae,z=0,L=!0,W!==Ae&&W.appendChild(F),!j)continue}if(!U&&te===O){X=R(te);const me=r.createTextNode(O.nodeType===1?"":O.substringData(B,O.length-B)),xe=r.createTextNode(j||O.nodeType===1?"":O.substringData(0,B));if(X?X=X.cloneNode(!1):M(u.parentNode)&&!X&&(u=u.cloneNode(!1),H.appendChild(u),$.push(u)),!r.onlyZeroWidthSpace(me)){W=te,V="",P=[];const Ee=[];for(;W!==H&&W!==D&&W!==null;)W.nodeType===1&&G(W)&&(M(W)?Ee.push(W.cloneNode(!1)):P.push(W.cloneNode(!1)),V+=W.style.cssText.substr(0,W.style.cssText.indexOf(":"))+"|"),W=W.parentNode;for(P=P.concat(Ee),ve=Q=W=P.pop()||me;P.length>0;)W=P.pop(),Q.appendChild(W),Q=W;H.appendChild(ve),W.textContent=me.data}if(X&&ve){const Ee=R(ve);Ee&&(X=Ee)}for(W=te,P=[],V="";W!==H&&W!==D&&W!==null;)ie=M(W)?null:p(W),ie&&W.nodeType===1&&G(W)&&(P.push(ie),V+=W.style.cssText.substr(0,W.style.cssText.indexOf(":"))+"|"),W=W.parentNode;const Ae=P.pop()||xe;for(Q=W=Ae;P.length>0;)W=P.pop(),Q.appendChild(W),Q=W;X?(u=u.cloneNode(!1),u.appendChild(Ae),X.insertBefore(u,X.firstChild),H.appendChild(X),$.push(u),X=null):u.appendChild(Ae),O=xe,B=xe.data.length,U=!0,!E&&N&&(u=xe,xe.textContent=r.zeroWidthSpace),W!==xe&&W.appendChild(O);continue}if(L){if(te.nodeType===1&&!r.isBreak(te)){r._isIgnoreNodeChange(te)?(H.appendChild(te.cloneNode(!0)),N||(u=u.cloneNode(!1),H.appendChild(u),$.push(u))):ge(te,te);continue}W=te,P=[],V="";const me=[];for(;W.parentNode!==null&&W!==D&&W!==u;)ie=U?W.cloneNode(!1):p(W),W.nodeType===1&&!r.isBreak(te)&&ie&&G(W)&&(M(W)?X||me.push(ie):P.push(ie),V+=W.style.cssText.substr(0,W.style.cssText.indexOf(":"))+"|"),W=W.parentNode;P=P.concat(me);const xe=P.pop()||te;for(Q=W=xe;P.length>0;)W=P.pop(),Q.appendChild(W),Q=W;if(M(u.parentNode)&&!M(xe)&&!r.onlyZeroWidthSpace(u)&&(u=u.cloneNode(!1),H.appendChild(u),$.push(u)),!U&&!X&&M(xe)){u=u.cloneNode(!1);const Ae=xe.childNodes;for(let Ee=0,Fe=Ae.length;Ee<Fe;Ee++)u.appendChild(Ae[Ee]);xe.appendChild(u),H.appendChild(xe),$.push(u),u.children.length>0?I=W:I=u}else xe===te?U?I=H:I=u:U?(H.appendChild(xe),I=W):(u.appendChild(xe),I=W);if(X&&te.nodeType===3)if(R(te)){const Ae=r.getParentElement(I,(function(Ee){return this._isMaintainedNode(Ee.parentNode)||Ee.parentNode===H}).bind(r));X.appendChild(Ae),u=Ae.cloneNode(!1),$.push(u),H.appendChild(u)}else X=null}ve=te.cloneNode(!1),I.appendChild(ve),te.nodeType===1&&!r.isBreak(te)&&(ae=ve),ge(te,ae)}}(c,H),k&&!E&&!T.v)return{ancestor:c,startContainer:v,startOffset:y,endContainer:w,endOffset:x};if(E=E&&k,E)for(let ge=0;ge<$.length;ge++){let ke=$[ge],I,Y,q;if(N)I=r.createTextNode(r.zeroWidthSpace),H.replaceChild(I,ke);else{const re=ke.childNodes;for(Y=re[0];re[0];)q=re[0],H.insertBefore(q,ke);r.removeItem(ke)}ge===0&&(N?F=O=I:(F=Y,O=q))}else{if(k)for(let ge=0;ge<$.length;ge++)this._stripRemoveNode($[ge]);N&&(F=O=u)}r.removeEmptyNode(H,u,!1),N&&(z=F.textContent.length,B=O.textContent.length);const J=E||O.textContent.length===0;!r.isBreak(O)&&O.textContent.length===0&&(r.removeItem(O),O=F),B=J?O.textContent.length:B;const ee={s:0,e:0},se=r.getNodePath(F,H,ee),le=!O.parentNode;le&&(O=F);const ue={s:0,e:0},Se=r.getNodePath(O,H,!le&&!J?ue:null);z+=ee.s,B=N?z:le?F.textContent.length:J?B+ee.s:B+ue.s;const Re=r.mergeSameTags(H,[se,Se],!0);return c.parentNode.replaceChild(H,c),F=r.getNodeFromPath(se,H),O=r.getNodeFromPath(Se,H),{ancestor:H,startContainer:F,startOffset:z+Re[0],endContainer:O,endOffset:B+Re[1]}},_nodeChange_startLine:function(c,u,p,v,y,w,x,E,k,N,T){let R=v.parentNode;for(;!R.nextSibling&&!R.previousSibling&&!r.isFormatElement(R.parentNode)&&!r.isWysiwygDiv(R.parentNode)&&R.nodeName!==u.nodeName;)R=R.parentNode;if(!x&&R.nodeName===u.nodeName&&!r.isFormatElement(R)&&!R.nextSibling&&r.onlyZeroWidthSpace(v.textContent.slice(0,y))){let L=!0,U=v.previousSibling;for(;U;){if(!r.onlyZeroWidthSpace(U)){L=!1;break}U=U.previousSibling}if(L)return r.copyTagAttributes(R,u),{ancestor:c,container:v,offset:y}}E.v=!1;const M=c,A=[u],D=c.cloneNode(!1);let $=v,H=y,j=!1,F,z,O,B;if(function L(U,P){const W=U.childNodes;for(let Q=0,V=W.length,X,Z;Q<V;Q++){const G=W[Q];if(!G)continue;let J=P;if(j&&!r.isBreak(G)){if(G.nodeType===1){if(r._isIgnoreNodeChange(G)){if(u=u.cloneNode(!1),Z=G.cloneNode(!0),D.appendChild(Z),D.appendChild(u),A.push(u),T&&G.contains(T)){const ue=r.getNodePath(T,G);T=r.getNodeFromPath(ue,Z)}}else L(G,G);continue}z=G,F=[];const ee=[];for(;z.parentNode!==null&&z!==M&&z!==u;)X=p(z),z.nodeType===1&&X&&(N(z)?B||ee.push(X):F.push(X)),z=z.parentNode;F=F.concat(ee);const se=F.length>0,le=F.pop()||G;for(O=z=le;F.length>0;)z=F.pop(),O.appendChild(z),O=z;if(N(u.parentNode)&&!N(le)&&(u=u.cloneNode(!1),D.appendChild(u),A.push(u)),!B&&N(le)){u=u.cloneNode(!1);const ue=le.childNodes;for(let Se=0,Re=ue.length;Se<Re;Se++)u.appendChild(ue[Se]);le.appendChild(u),D.appendChild(le),P=N(z)?u:z,A.push(u)}else se?(u.appendChild(le),P=z):P=u;if(B&&G.nodeType===3)if(k(G)){const ue=r.getParentElement(P,(function(Se){return this._isMaintainedNode(Se.parentNode)||Se.parentNode===D}).bind(r));B.appendChild(ue),u=ue.cloneNode(!1),A.push(u),D.appendChild(u)}else B=null}if(!j&&G===$){let ee=D;B=k(G);const se=r.createTextNode($.nodeType===1?"":$.substringData(0,H)),le=r.createTextNode($.nodeType===1?"":$.substringData(H,$.length-H));if(B){const Re=k(P);if(Re&&Re.parentNode!==ee){let ge=Re,ke=null;for(;ge.parentNode!==ee;){for(P=ke=ge.parentNode.cloneNode(!1);ge.childNodes[0];)ke.appendChild(ge.childNodes[0]);ge.appendChild(ke),ge=ge.parentNode}ge.parentNode.appendChild(Re)}B=B.cloneNode(!1)}r.onlyZeroWidthSpace(se)||P.appendChild(se);const ue=k(P);for(ue&&(B=ue),B&&(ee=B),z=P,F=[];z!==ee&&z!==null;)X=p(z),z.nodeType===1&&X&&F.push(X),z=z.parentNode;const Se=F.pop()||P;for(O=z=Se;F.length>0;)z=F.pop(),O.appendChild(z),O=z;Se!==P?(u.appendChild(Se),P=z):P=u,r.isBreak(G)&&u.appendChild(G.cloneNode(!1)),ee.appendChild(u),$=le,H=0,j=!0,P.appendChild($);continue}X=j?p(G):G.cloneNode(!1),X&&(P.appendChild(X),G.nodeType===1&&!r.isBreak(G)&&(J=X)),L(G,J)}}(c,D),x&&!w&&!E.v)return{ancestor:c,container:v,offset:y,endContainer:T};if(w=w&&x,w)for(let L=0;L<A.length;L++){let U=A[L];const P=U.childNodes,W=P[0];for(;P[0];)D.insertBefore(P[0],U);r.removeItem(U),L===0&&($=W)}else if(x){u=u.firstChild;for(let L=0;L<A.length;L++)this._stripRemoveNode(A[L])}if(!w&&D.childNodes.length===0)c.childNodes?$=c.childNodes[0]:($=r.createTextNode(r.zeroWidthSpace),c.appendChild($));else{r.removeEmptyNode(D,u,!1),r.onlyZeroWidthSpace(D.textContent)&&($=D.firstChild,H=0);const L={s:0,e:0},U=r.getNodePath($,D,L);H+=L.s;const P=r.mergeSameTags(D,[U],!0);c.parentNode.replaceChild(D,c),$=r.getNodeFromPath(U,D),H+=P[0]}return{ancestor:D,container:$,offset:H,endContainer:T}},_nodeChange_middleLine:function(c,u,p,v,y,w,x){if(!y){let T=null;x&&c.contains(x)&&(T=r.getNodePath(x,c));const R=c.cloneNode(!0),M=u.nodeName,A=u.style.cssText,D=u.className;let $=R.childNodes,H=0,j=$.length;for(let F;H<j&&(F=$[H],F.nodeType!==3);H++)if(F.nodeName===M)F.style.cssText+=A,r.addClass(F,D);else{if(!r.isBreak(F)&&r._isIgnoreNodeChange(F))continue;if(j===1){$=F.childNodes,j=$.length,H=-1;continue}else break}if(j>0&&H===j)return c.innerHTML=R.innerHTML,{ancestor:c,endContainer:T?r.getNodeFromPath(T,c):null}}w.v=!1;const E=c.cloneNode(!1),k=[u];let N=!0;if(function T(R,M){const A=R.childNodes;for(let D=0,$=A.length,H,j;D<$;D++){let F=A[D];if(!F)continue;let z=M;if(!r.isBreak(F)&&r._isIgnoreNodeChange(F)){if(u.childNodes.length>0&&(E.appendChild(u),u=u.cloneNode(!1)),j=F.cloneNode(!0),E.appendChild(j),E.appendChild(u),k.push(u),M=u,x&&F.contains(x)){const O=r.getNodePath(x,F);x=r.getNodeFromPath(O,j)}continue}else H=p(F),H&&(N=!1,M.appendChild(H),F.nodeType===1&&(z=H));r.isBreak(F)||T(F,z)}}(c,u),N||y&&!v&&!w.v)return{ancestor:c,endContainer:x};if(E.appendChild(u),v&&y)for(let T=0;T<k.length;T++){let R=k[T];const M=R.childNodes;for(;M[0];)E.insertBefore(M[0],R);r.removeItem(R)}else if(y){u=u.firstChild;for(let T=0;T<k.length;T++)this._stripRemoveNode(k[T])}return r.removeEmptyNode(E,u,!1),r.mergeSameTags(E,null,!0),c.parentNode.replaceChild(E,c),{ancestor:E,endContainer:x}},_nodeChange_endLine:function(c,u,p,v,y,w,x,E,k,N){let T=v.parentNode;for(;!T.nextSibling&&!T.previousSibling&&!r.isFormatElement(T.parentNode)&&!r.isWysiwygDiv(T.parentNode)&&T.nodeName!==u.nodeName;)T=T.parentNode;if(!x&&T.nodeName===u.nodeName&&!r.isFormatElement(T)&&!T.previousSibling&&r.onlyZeroWidthSpace(v.textContent.slice(y))){let B=!0,L=v.nextSibling;for(;L;){if(!r.onlyZeroWidthSpace(L)){B=!1;break}L=L.nextSibling}if(B)return r.copyTagAttributes(T,u),{ancestor:c,container:v,offset:y}}E.v=!1;const R=c,M=[u],A=c.cloneNode(!1);let D=v,$=y,H=!1,j,F,z,O;if(function B(L,U){const P=L.childNodes;for(let W=P.length-1,Q;0<=W;W--){const V=P[W];if(!V)continue;let X=U;if(H&&!r.isBreak(V)){if(V.nodeType===1){if(r._isIgnoreNodeChange(V)){u=u.cloneNode(!1);const ee=V.cloneNode(!0);A.insertBefore(ee,U),A.insertBefore(u,ee),M.push(u)}else B(V,V);continue}F=V,j=[];const Z=[];for(;F.parentNode!==null&&F!==R&&F!==u;)Q=p(F),Q&&F.nodeType===1&&(N(F)?O||Z.push(Q):j.push(Q)),F=F.parentNode;j=j.concat(Z);const G=j.length>0,J=j.pop()||V;for(z=F=J;j.length>0;)F=j.pop(),z.appendChild(F),z=F;if(N(u.parentNode)&&!N(J)&&(u=u.cloneNode(!1),A.insertBefore(u,A.firstChild),M.push(u)),!O&&N(J)){u=u.cloneNode(!1);const ee=J.childNodes;for(let se=0,le=ee.length;se<le;se++)u.appendChild(ee[se]);J.appendChild(u),A.insertBefore(J,A.firstChild),M.push(u),u.children.length>0?U=F:U=u}else G?(u.insertBefore(J,u.firstChild),U=F):U=u;if(O&&V.nodeType===3)if(k(V)){const ee=r.getParentElement(U,(function(se){return this._isMaintainedNode(se.parentNode)||se.parentNode===A}).bind(r));O.appendChild(ee),u=ee.cloneNode(!1),M.push(u),A.insertBefore(u,A.firstChild)}else O=null}if(!H&&V===D){O=k(V);const Z=r.createTextNode(D.nodeType===1?"":D.substringData($,D.length-$)),G=r.createTextNode(D.nodeType===1?"":D.substringData(0,$));if(O){O=O.cloneNode(!1);const ee=k(U);if(ee&&ee.parentNode!==A){let se=ee,le=null;for(;se.parentNode!==A;){for(U=le=se.parentNode.cloneNode(!1);se.childNodes[0];)le.appendChild(se.childNodes[0]);se.appendChild(le),se=se.parentNode}se.parentNode.insertBefore(ee,se.parentNode.firstChild)}O=O.cloneNode(!1)}else N(u.parentNode)&&!O&&(u=u.cloneNode(!1),A.appendChild(u),M.push(u));for(r.onlyZeroWidthSpace(Z)||U.insertBefore(Z,U.firstChild),F=U,j=[];F!==A&&F!==null;)Q=N(F)?null:p(F),Q&&F.nodeType===1&&j.push(Q),F=F.parentNode;const J=j.pop()||U;for(z=F=J;j.length>0;)F=j.pop(),z.appendChild(F),z=F;J!==U?(u.insertBefore(J,u.firstChild),U=F):U=u,r.isBreak(V)&&u.appendChild(V.cloneNode(!1)),O?(O.insertBefore(u,O.firstChild),A.insertBefore(O,A.firstChild),O=null):A.insertBefore(u,A.firstChild),D=G,$=G.data.length,H=!0,U.insertBefore(D,U.firstChild);continue}Q=H?p(V):V.cloneNode(!1),Q&&(U.insertBefore(Q,U.firstChild),V.nodeType===1&&!r.isBreak(V)&&(X=Q)),B(V,X)}}(c,A),x&&!w&&!E.v)return{ancestor:c,container:v,offset:y};if(w=w&&x,w)for(let B=0;B<M.length;B++){let L=M[B];const U=L.childNodes;let P=null;for(;U[0];)P=U[0],A.insertBefore(P,L);r.removeItem(L),B===M.length-1&&(D=P,$=P.textContent.length)}else if(x){u=u.firstChild;for(let B=0;B<M.length;B++)this._stripRemoveNode(M[B])}if(!w&&A.childNodes.length===0)c.childNodes?D=c.childNodes[0]:(D=r.createTextNode(r.zeroWidthSpace),c.appendChild(D));else{if(!x&&u.textContent.length===0)return r.removeEmptyNode(A,null,!1),{ancestor:null,container:null,offset:0};r.removeEmptyNode(A,u,!1),r.onlyZeroWidthSpace(A.textContent)?(D=A.firstChild,$=D.textContent.length):r.onlyZeroWidthSpace(D)&&(D=u,$=1);const B={s:0,e:0},L=r.getNodePath(D,A,B);$+=B.s;const U=r.mergeSameTags(A,[L],!0);c.parentNode.replaceChild(A,c),D=r.getNodeFromPath(L,A),$+=U[0]}return{ancestor:A,container:D,offset:D.nodeType===1&&$===1?D.childNodes.length:$}},actionCall:function(c,u,p){if(u){if(/more/i.test(u)){if(p!==this._moreLayerActiveButton){const v=e.element.toolbar.querySelector("."+c);v&&(this._moreLayerActiveButton&&this.moreLayerOff(),this._moreLayerActiveButton=p,v.style.display="block",h._showToolbarBalloon(),h._showToolbarInline()),r.addClass(p,"on")}else e.element.toolbar.querySelector("."+this._moreLayerActiveButton.getAttribute("data-command"))&&(this.moreLayerOff(),h._showToolbarBalloon(),h._showToolbarInline());return}if(/container/.test(u)&&(this._menuTray[c]===null||p!==this.containerActiveButton)){this.callPlugin(c,this.containerOn.bind(this,p),p);return}if(this.isReadOnly&&r.arrayIncludes(this.resizingDisabledButtons,p))return;if(/submenu/.test(u)&&(this._menuTray[c]===null||p!==this.submenuActiveButton)){this.callPlugin(c,this.submenuOn.bind(this,p),p);return}else if(/dialog/.test(u)){this.callPlugin(c,this.plugins[c].open.bind(this),p);return}else/command/.test(u)?this.callPlugin(c,this.plugins[c].action.bind(this),p):/fileBrowser/.test(u)&&this.callPlugin(c,this.plugins[c].open.bind(this,null),p)}else c&&this.commandHandler(p,c);/submenu/.test(u)?this.submenuOff():/command/.test(u)||(this.submenuOff(),this.containerOff())},commandHandler:function(c,u){if(!(d.isReadOnly&&!/copy|cut|selectAll|codeView|fullScreen|print|preview|showBlocks/.test(u)))switch(u){case"copy":case"cut":this.execCommand(u);break;case"paste":break;case"selectAll":this.containerOff();const p=e.element.wysiwyg;let v=r.getChildElement(p.firstChild,function(k){return k.childNodes.length===0||k.nodeType===3},!1)||p.firstChild,y=r.getChildElement(p.lastChild,function(k){return k.childNodes.length===0||k.nodeType===3},!0)||p.lastChild;if(!v||!y)return;if(r.isMedia(v)){const k=this.getFileComponent(v),N=r.createElement("BR"),T=r.createElement(s.defaultTag);T.appendChild(N),v=k?k.component:v,v.parentNode.insertBefore(T,v),v=N}if(r.isMedia(y)){const k=r.createElement("BR"),N=r.createElement(s.defaultTag);N.appendChild(k),p.appendChild(N),y=k}h._showToolbarBalloon(this.setRange(v,0,y,y.textContent.length));break;case"codeView":this.toggleCodeView();break;case"fullScreen":this.toggleFullScreen(c);break;case"indent":case"outdent":this.indent(u);break;case"undo":this.history.undo();break;case"redo":this.history.redo();break;case"removeFormat":this.removeFormat(),this.focus();break;case"print":this.print();break;case"preview":this.preview();break;case"showBlocks":this.toggleDisplayBlocks();break;case"dir":this.setDir(s.rtl?"ltr":"rtl");break;case"dir_ltr":this.setDir("ltr");break;case"dir_rtl":this.setDir("rtl");break;case"save":if(typeof s.callBackSave=="function")s.callBackSave(this.getContents(!1),this._variable.isChanged);else if(this._variable.isChanged&&typeof b.save=="function")b.save();else throw Error("[SUNEDITOR.core.commandHandler.fail] Please register call back function in creation option. (callBackSave : Function)");this._variable.isChanged=!1,e.tool.save&&e.tool.save.setAttribute("disabled",!0);break;default:u=s._defaultCommand[u.toLowerCase()]||u,this.commandMap[u]||(this.commandMap[u]=c);const w=this._variable.currentNodesMap,x=w.indexOf(u)>-1?null:r.createElement(u);let E=u;/^SUB$/i.test(u)&&w.indexOf("SUP")>-1?E="SUP":/^SUP$/i.test(u)&&w.indexOf("SUB")>-1&&(E="SUB"),this.nodeChange(x,this._commandMapStyles[u]||null,[E],!1),this.focus()}},removeFormat:function(){this.nodeChange(null,null,null,null)},indent:function(c){const u=this.getRange(),p=this.getSelectedElements(null),v=[],y=c!=="indent",w=s.rtl?"marginRight":"marginLeft";let x=u.startContainer,E=u.endContainer,k=u.startOffset,N=u.endOffset;for(let T=0,R=p.length,M,A;T<R;T++)M=p[T],!r.isListCell(M)||!this.plugins.list?(A=/\d+/.test(M.style[w])?r.getNumber(M.style[w],0):0,y?A-=25:A+=25,r.setStyle(M,w,A<=0?"":A+"px")):(y||M.previousElementSibling)&&v.push(M);v.length>0&&this.plugins.list.editInsideList.call(this,y,v),this.effectNode=null,this.setRange(x,k,E,N),this.history.push(!1)},toggleDisplayBlocks:function(){const c=e.element.wysiwyg;r.toggleClass(c,"se-show-block"),r.hasClass(c,"se-show-block")?r.addClass(this._styleCommandMap.showBlocks,"active"):r.removeClass(this._styleCommandMap.showBlocks,"active"),this._resourcesStateChange()},toggleCodeView:function(){const c=this._variable.isCodeView;this.controllersOff(),r.setDisabledButtons(!c,this.codeViewDisabledButtons),c?(r.isNonEditable(e.element.wysiwygFrame)||this._setCodeDataToEditor(),e.element.wysiwygFrame.scrollTop=0,e.element.code.style.display="none",e.element.wysiwygFrame.style.display="block",this._variable._codeOriginCssText=this._variable._codeOriginCssText.replace(/(\s?display(\s+)?:(\s+)?)[a-zA-Z]+(?=;)/,"display: none"),this._variable._wysiwygOriginCssText=this._variable._wysiwygOriginCssText.replace(/(\s?display(\s+)?:(\s+)?)[a-zA-Z]+(?=;)/,"display: block"),s.height==="auto"&&!s.codeMirrorEditor&&(e.element.code.style.height="0px"),this._variable.isCodeView=!1,this._variable.isFullScreen||(this._notHideToolbar=!1,/balloon|balloon-always/i.test(s.mode)&&(e.element._arrow.style.display="",this._isInline=!1,this._isBalloon=!0,h._hideToolbar())),this.nativeFocus(),r.removeClass(this._styleCommandMap.codeView,"active"),r.isNonEditable(e.element.wysiwygFrame)||(this.history.push(!1),this.history._resetCachingButton())):(this._setEditorDataToCodeView(),this._variable._codeOriginCssText=this._variable._codeOriginCssText.replace(/(\s?display(\s+)?:(\s+)?)[a-zA-Z]+(?=;)/,"display: block"),this._variable._wysiwygOriginCssText=this._variable._wysiwygOriginCssText.replace(/(\s?display(\s+)?:(\s+)?)[a-zA-Z]+(?=;)/,"display: none"),this._variable.isFullScreen?e.element.code.style.height="100%":s.height==="auto"&&!s.codeMirrorEditor&&(e.element.code.style.height=e.element.code.scrollHeight>0?e.element.code.scrollHeight+"px":"auto"),s.codeMirrorEditor&&s.codeMirrorEditor.refresh(),this._variable.isCodeView=!0,this._variable.isFullScreen||(this._notHideToolbar=!0,this._isBalloon&&(e.element._arrow.style.display="none",e.element.toolbar.style.left="",this._isInline=!0,this._isBalloon=!1,h._showToolbarInline())),this._variable._range=null,e.element.code.focus(),r.addClass(this._styleCommandMap.codeView,"active")),this._checkPlaceholder(),this.isReadOnly&&r.setDisabledButtons(!0,this.resizingDisabledButtons),typeof b.toggleCodeView=="function"&&b.toggleCodeView(this._variable.isCodeView,this)},_setCodeDataToEditor:function(){const c=this._getCodeView();if(s.fullPage){const u=this._parser.parseFromString(c,"text/html");if(!this.options.__allowedScriptTag){const y=u.head.children;for(let w=0,x=y.length;w<x;w++)/^script$/i.test(y[w].tagName)&&(u.head.removeChild(y[w]),w--,x--)}let p=u.head.innerHTML;(!u.head.querySelector('link[rel="stylesheet"]')||this.options.height==="auto"&&!u.head.querySelector("style"))&&(p+=r._setIframeCssTags(this.options)),this._wd.head.innerHTML=p,this._wd.body.innerHTML=this.convertContentsForEditor(u.body.innerHTML);const v=u.body.attributes;for(let y=0,w=v.length;y<w;y++)v[y].name!=="contenteditable"&&this._wd.body.setAttribute(v[y].name,v[y].value);if(!r.hasClass(this._wd.body,"sun-editor-editable")){const y=s._editableClass.split(" ");for(let w=0;w<y.length;w++)r.addClass(this._wd.body,s._editableClass[w])}}else e.element.wysiwyg.innerHTML=c.length>0?this.convertContentsForEditor(c):"<"+s.defaultTag+"><br></"+s.defaultTag+">"},_setEditorDataToCodeView:function(){const c=this.convertHTMLForCodeView(e.element.wysiwyg,!1);let u="";if(s.fullPage){const p=r.getAttributesToString(this._wd.body,null);u=`<!DOCTYPE html>
|
|
245
|
+
<html>
|
|
246
|
+
`+this._wd.head.outerHTML.replace(/>(?!\n)/g,`>
|
|
247
|
+
`)+"<body "+p+`>
|
|
248
|
+
`+c+`</body>
|
|
249
|
+
</html>`}else u=c;e.element.code.style.display="block",e.element.wysiwygFrame.style.display="none",this._setCodeView(u)},toggleFullScreen:function(c){const u=e.element.topArea,p=e.element.toolbar,v=e.element.editorArea,y=e.element.wysiwygFrame,w=e.element.code,x=this._variable;this.controllersOff();const E=p.style.display==="none"||this._isInline&&!this._inlineToolbarAttr.isShow;x.isFullScreen?(x.isFullScreen=!1,y.style.cssText=x._wysiwygOriginCssText,w.style.cssText=x._codeOriginCssText,p.style.cssText="",v.style.cssText=x._editorAreaOriginCssText,u.style.cssText=x._originCssText,l.body.style.overflow=x._bodyOverflow,s.height==="auto"&&!s.codeMirrorEditor&&h._codeViewAutoHeight(),s.toolbarContainer&&s.toolbarContainer.appendChild(p),s.stickyToolbar>-1&&r.removeClass(p,"se-toolbar-sticky"),x._fullScreenAttrs.sticky&&!s.toolbarContainer&&(x._fullScreenAttrs.sticky=!1,e.element._stickyDummy.style.display="block",r.addClass(p,"se-toolbar-sticky")),this._isInline=x._fullScreenAttrs.inline,this._isBalloon=x._fullScreenAttrs.balloon,this._isInline&&h._showToolbarInline(),s.toolbarContainer&&r.removeClass(p,"se-toolbar-balloon"),h.onScroll_window(),c&&r.changeElement(c.firstElementChild,f.expansion),e.element.topArea.style.marginTop="",r.removeClass(this._styleCommandMap.fullScreen,"active")):(x.isFullScreen=!0,x._fullScreenAttrs.inline=this._isInline,x._fullScreenAttrs.balloon=this._isBalloon,(this._isInline||this._isBalloon)&&(this._isInline=!1,this._isBalloon=!1),s.toolbarContainer&&e.element.relative.insertBefore(p,v),u.style.position="fixed",u.style.top="0",u.style.left="0",u.style.width="100%",u.style.maxWidth="100%",u.style.height="100%",u.style.zIndex="2147483647",e.element._stickyDummy.style.display!==""&&(x._fullScreenAttrs.sticky=!0,e.element._stickyDummy.style.display="none",r.removeClass(p,"se-toolbar-sticky")),x._bodyOverflow=l.body.style.overflow,l.body.style.overflow="hidden",x._editorAreaOriginCssText=v.style.cssText,x._wysiwygOriginCssText=y.style.cssText,x._codeOriginCssText=w.style.cssText,v.style.cssText=p.style.cssText="",y.style.cssText=(y.style.cssText.match(/\s?display(\s+)?:(\s+)?[a-zA-Z]+;/)||[""])[0]+s._editorStyles.editor,w.style.cssText=(w.style.cssText.match(/\s?display(\s+)?:(\s+)?[a-zA-Z]+;/)||[""])[0],p.style.width=y.style.height=w.style.height="100%",p.style.position="relative",p.style.display="block",x.innerHeight_fullScreen=a.innerHeight-p.offsetHeight,v.style.height=x.innerHeight_fullScreen-s.fullScreenOffset+"px",c&&r.changeElement(c.firstElementChild,f.reduction),s.iframe&&s.height==="auto"&&(v.style.overflow="auto",this._iframeAutoHeight()),e.element.topArea.style.marginTop=s.fullScreenOffset+"px",r.addClass(this._styleCommandMap.fullScreen,"active")),E&&b.toolbar.hide(),typeof b.toggleFullScreen=="function"&&b.toggleFullScreen(this._variable.isFullScreen,this)},print:function(){const c=r.createElement("IFRAME");c.style.display="none",l.body.appendChild(c);const u=s.printTemplate?s.printTemplate.replace(/\{\{\s*contents\s*\}\}/i,this.getContents(!0)):this.getContents(!0),p=r.getIframeDocument(c),v=this._wd;if(s.iframe){const y=s._printClass!==null?'class="'+s._printClass+'"':s.fullPage?r.getAttributesToString(v.body,["contenteditable"]):'class="'+s._editableClass+'"';p.write("<!DOCTYPE html><html><head>"+v.head.innerHTML+"</head><body "+y+">"+u+"</body></html>")}else{const y=l.head.getElementsByTagName("link"),w=l.head.getElementsByTagName("style");let x="";for(let E=0,k=y.length;E<k;E++)x+=y[E].outerHTML;for(let E=0,k=w.length;E<k;E++)x+=w[E].outerHTML;p.write("<!DOCTYPE html><html><head>"+x+'</head><body class="'+(s._printClass!==null?s._printClass:s._editableClass)+'">'+u+"</body></html>")}this.showLoading(),a.setTimeout(function(){try{if(c.focus(),r.isIE_Edge||r.isChromium||l.documentMode||a.StyleMedia)try{c.contentWindow.document.execCommand("print",!1,null)}catch{c.contentWindow.print()}else c.contentWindow.print()}catch(y){throw Error("[SUNEDITOR.core.print.fail] error: "+y)}finally{d.closeLoading(),r.removeItem(c)}},1e3)},preview:function(){d.submenuOff(),d.containerOff(),d.controllersOff();const c=s.previewTemplate?s.previewTemplate.replace(/\{\{\s*contents\s*\}\}/i,this.getContents(!0)):this.getContents(!0),u=a.open("","_blank");u.mimeType="text/html";const p=this._wd;if(s.iframe){const v=s._printClass!==null?'class="'+s._printClass+'"':s.fullPage?r.getAttributesToString(p.body,["contenteditable"]):'class="'+s._editableClass+'"';u.document.write("<!DOCTYPE html><html><head>"+p.head.innerHTML+"<style>body {overflow:auto !important; margin: 10px auto !important; height:auto !important; outline:1px dashed #ccc;}</style></head><body "+v+">"+c+"</body></html>")}else{const v=l.head.getElementsByTagName("link"),y=l.head.getElementsByTagName("style");let w="";for(let x=0,E=v.length;x<E;x++)w+=v[x].outerHTML;for(let x=0,E=y.length;x<E;x++)w+=y[x].outerHTML;u.document.write('<!DOCTYPE html><html><head><meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"><title>'+i.toolbar.preview+"</title>"+w+'</head><body class="'+(s._printClass!==null?s._printClass:s._editableClass)+'" style="margin:10px auto !important; height:auto !important; outline:1px dashed #ccc;">'+c+"</body></html>")}},setDir:function(c){const u=c==="rtl",p=this._prevRtl!==u;this._prevRtl=s.rtl=u,p&&(this.plugins.align&&this.plugins.align.exchangeDir.call(this),e.tool.indent&&r.changeElement(e.tool.indent.firstElementChild,f.indent),e.tool.outdent&&r.changeElement(e.tool.outdent.firstElementChild,f.outdent));const v=e.element;u?(r.addClass(v.topArea,"se-rtl"),r.addClass(v.wysiwygFrame,"se-rtl")):(r.removeClass(v.topArea,"se-rtl"),r.removeClass(v.wysiwygFrame,"se-rtl"));const y=r.getListChildren(v.wysiwyg,function(x){return r.isFormatElement(x)&&(x.style.marginRight||x.style.marginLeft||x.style.textAlign)});for(let x=0,E=y.length,k,N,T;x<E;x++)k=y[x],T=k.style.marginRight,N=k.style.marginLeft,(T||N)&&(k.style.marginRight=N,k.style.marginLeft=T),T=k.style.textAlign,T==="left"?k.style.textAlign="right":T==="right"&&(k.style.textAlign="left");const w=e.tool;w.dir&&(r.changeTxt(w.dir.querySelector(".se-tooltip-text"),i.toolbar[s.rtl?"dir_ltr":"dir_rtl"]),r.changeElement(w.dir.firstElementChild,f[s.rtl?"dir_ltr":"dir_rtl"])),w.dir_ltr&&(u?r.removeClass(w.dir_ltr,"active"):r.addClass(w.dir_ltr,"active")),w.dir_rtl&&(u?r.addClass(w.dir_rtl,"active"):r.removeClass(w.dir_rtl,"active"))},setContents:function(c){this.removeRange();const u=c==null?"":this.convertContentsForEditor(c,null,null);if(!this._variable.isCodeView)e.element.wysiwyg.innerHTML=u,this._resetComponents(),this.history.push(!1);else{const p=this.convertHTMLForCodeView(u,!1);this._setCodeView(p)}},setIframeContents:function(c){if(!s.iframe)return!1;c.head&&(this._wd.head.innerHTML=this.options.__allowedScriptTag?c.head:c.head.replace(this.__scriptTagRegExp,"")),c.body&&(this._wd.body.innerHTML=this.convertContentsForEditor(c.body)),this._resetComponents()},getContents:function(c){const u=this.cleanHTML(e.element.wysiwyg.innerHTML,null,null),p=r.createElement("DIV");p.innerHTML=u;const v=r.getListChildren(p,function(y){return y.hasAttribute("contenteditable")});for(let y=0,w=v.length;y<w;y++)v[y].removeAttribute("contenteditable");if(s.fullPage&&!c){const y=r.getAttributesToString(this._wd.body,["contenteditable"]);return"<!DOCTYPE html><html>"+this._wd.head.outerHTML+"<body "+y+">"+p.innerHTML+"</body></html>"}else return p.innerHTML},getFullContents:function(c){return'<div class="sun-editor-editable'+(s.rtl?" se-rtl":"")+'">'+this.getContents(c)+"</div>"},_makeLine:function(c,u){const p=s.defaultTag;if(c.nodeType===1){if(this.__disallowedTagNameRegExp.test(c.nodeName))return"";if(/__se__tag/.test(c.className))return c.outerHTML;const v=r.getListChildNodes(c,function(y){return r.isSpanWithoutAttr(y)&&!r.getParentElement(y,r.isNotCheckingNode)})||[];for(let y=v.length-1;y>=0;y--)v[y].outerHTML=v[y].innerHTML;return!u||r.isFormatElement(c)||r.isRangeFormatElement(c)||r.isComponent(c)||r.isFigures(c)||r.isAnchor(c)&&r.isMedia(c.firstElementChild)?r.isSpanWithoutAttr(c)?c.innerHTML:c.outerHTML:"<"+p+">"+(r.isSpanWithoutAttr(c)?c.innerHTML:c.outerHTML)+"</"+p+">"}if(c.nodeType===3){if(!u)return r._HTMLConvertor(c.textContent);const v=c.textContent.split(/\n/g);let y="";for(let w=0,x=v.length,E;w<x;w++)E=v[w].trim(),E.length>0&&(y+="<"+p+">"+r._HTMLConvertor(E)+"</"+p+">");return y}return c.nodeType===8&&this._allowHTMLComments?"<!--"+c.textContent.trim()+"-->":""},_tagConvertor:function(c){if(!this._disallowedTextTagsRegExp)return c;const u=s._textTagsMap;return c.replace(this._disallowedTextTagsRegExp,function(p,v,y,w){return v+(typeof u[y]=="string"?u[y]:y)+(w?" "+w:"")})},_deleteDisallowedTags:function(c){return c=c.replace(this.__disallowedTagsRegExp,"").replace(/<[a-z0-9]+\:[a-z0-9]+[^>^\/]*>[^>]*<\/[a-z0-9]+\:[a-z0-9]+>/gi,""),/\bfont\b/i.test(this.options._editorTagsWhitelist)||(c=c.replace(/(<\/?)font(\s?)/gi,"$1span$2")),c.replace(this.editorTagsWhitelistRegExp,"").replace(this.editorTagsBlacklistRegExp,"")},_convertFontSize:function(c,u){const p=this._w.Math,v=u.match(/(\d+(?:\.\d+)?)(.+)/),y=v?v[1]*1:r.fontValueMap[u],w=v?v[2]:"rem";let x=y;switch(/em/.test(w)?x=p.round(y/.0625):w==="pt"?x=p.round(y*1.333):w==="%"&&(x=y/100),c){case"em":case"rem":case"%":return(x*.0625).toFixed(2)+c;case"pt":return p.round(x/1.333)+c;default:return x+c}},_cleanStyle:function(c,u,p){let v=(c.match(/style\s*=\s*(?:"|')[^"']*(?:"|')/)||[])[0];if(/span/i.test(p)&&!v&&(c.match(/<[^\s]+\s(.+)/)||[])[1]){const y=(c.match(/\ssize="([^"]+)"/i)||[])[1],w=(c.match(/\sface="([^"]+)"/i)||[])[1],x=(c.match(/\scolor="([^"]+)"/i)||[])[1];(y||w||x)&&(v='style="'+(y?"font-size:"+this.util.getNumber(y/3.333,1)+"rem;":"")+(w?"font-family:"+w+";":"")+(x?"color:"+x+";":"")+'"')}if(v){u||(u=[]);const y=v.replace(/"/g,"").match(this._cleanStyleRegExp[p]);if(y){const w=[];for(let x=0,E=y.length,k;x<E;x++)if(k=y[x].match(/([a-zA-Z0-9-]+)(:)([^"']+)/),k&&!/inherit|initial|revert|unset/i.test(k[3])){const N=r.kebabToCamelCase(k[1].trim()),T=this.wwComputedStyle[N]?this.wwComputedStyle[N].replace(/"/g,""):"",R=k[3].trim();switch(N){case"fontFamily":if(!s.plugins.font||s.font.indexOf(R)===-1)continue;break;case"fontSize":if(!s.plugins.fontSize)continue;this._cleanStyleRegExp.fontSizeUnit.test(k[0])||(k[0]=k[0].replace((k[0].match(/:\s*([^;]+)/)||[])[1],this._convertFontSize.bind(this,s.fontSizeUnit)));break;case"color":if(!s.plugins.fontColor||/rgba\(([0-9]+\s*,\s*){3}0\)|windowtext/i.test(R))continue;break;case"backgroundColor":if(!s.plugins.hiliteColor||/rgba\(([0-9]+\s*,\s*){3}0\)|windowtext/i.test(R))continue;break}T!==R&&w.push(k[0])}w.length>0&&u.push('style="'+w.join(";")+'"')}}return u},_cleanTags:function(c,u,p){if(/^<[a-z0-9]+\:[a-z0-9]+/i.test(u))return u;let v=null;const y=p.match(/(?!<)[a-zA-Z0-9\-]+/)[0].toLowerCase(),w=this._attributesTagsBlacklist[y];u=u.replace(/\s(?:on[a-z]+)\s*=\s*(")[^"]*\1/ig,""),w?u=u.replace(w,""):u=u.replace(this._attributesBlacklistRegExp,"");const x=this._attributesTagsWhitelist[y];if(x?v=u.match(x):v=u.match(c?this._attributesWhitelistRegExp:this._attributesWhitelistRegExp_all_data),c||y==="span"||y==="li"||this._cleanStyleRegExp[y])if(y==="a"){const E=u.match(/(?:(?:id|name)\s*=\s*(?:"|')[^"']*(?:"|'))/g);E&&(v||(v=[]),v.push(E[0]))}else(!v||!/style=/i.test(v.toString()))&&((y==="span"||y==="li")&&(v=this._cleanStyle(u,v,"span")),this._cleanStyleRegExp[y]?v=this._cleanStyle(u,v,y):/^(P|DIV|H[1-6]|PRE)$/i.test(y)&&(v=this._cleanStyle(u,v,"format")));else{const E=u.match(/style\s*=\s*(?:"|')[^"']*(?:"|')/);E&&!v?v=[E[0]]:E&&!v.some(function(k){return/^style/.test(k.trim())})&&v.push(E[0])}if(r.isFigures(y)){const E=u.match(/style\s*=\s*(?:"|')[^"']*(?:"|')/);v||(v=[]),E&&v.push(E[0])}if(v)for(let E=0,k=v.length,N;E<k;E++)N=/^(?:href|src)\s*=\s*('|"|\s)*javascript\s*\:/i.test(v[E].trim())?"":v[E],p+=(/^\s/.test(N)?"":" ")+N;return p},_editFormat:function(c){let u="",p;const v=c.childNodes;for(let y=0,w=v.length,x;y<w;y++)x=v[y],x.nodeType===8?u+="<!-- "+x.textContent+" -->":!r.isFormatElement(x)&&!r.isRangeFormatElement(x)&&!r.isComponent(x)&&!/meta/i.test(x.nodeName)?(p||(p=r.createElement(s.defaultTag)),r.isTextStyleElement(x)&&x.removeAttribute("style"),p.appendChild(x),y--,w--):(p&&(u+=p.outerHTML,p=null),u+=x.outerHTML);return p&&(u+=p.outerHTML),l.createRange().createContextualFragment(u)},_convertListCell:function(c){let u="";for(let p=0,v=c.length,y;p<v;p++)y=c[p],y.nodeType===1?r.isList(y)?u+=y.innerHTML:r.isListCell(y)?u+=y.outerHTML:r.isFormatElement(y)?u+="<li>"+(y.innerHTML.trim()||"<br>")+"</li>":r.isRangeFormatElement(y)&&!r.isTable(y)?u+=this._convertListCell(y):u+="<li>"+y.outerHTML+"</li>":u+="<li>"+(y.textContent||"<br>")+"</li>";return u},_isFormatData:function(c){let u=!1;for(let p=0,v=c.length,y;p<v;p++)if(y=c[p],y.nodeType===1&&!r.isTextStyleElement(y)&&!r.isBreak(y)&&!this.__disallowedTagNameRegExp.test(y.nodeName)){u=!0;break}return u},cleanHTML:function(c,u,p){if(!s.strictMode)return r.htmlCompress(c);c=this._deleteDisallowedTags(this._parser.parseFromString(r.htmlCompress(c),"text/html").body.innerHTML).replace(/(<[a-zA-Z0-9\-]+)[^>]*(?=>)/g,this._cleanTags.bind(this,!0)).replace(/<br\/?>$/i,"");const v=l.createRange().createContextualFragment(c);try{r._consistencyCheckOfHTML(v,this._htmlCheckWhitelistRegExp,this._htmlCheckBlacklistRegExp,this._classNameFilter,s.strictHTMLValidation)}catch(E){console.warn("[SUNEDITOR.cleanHTML.consistencyCheck.fail] "+E)}if(this.managedTagsInfo&&this.managedTagsInfo.query){const E=v.querySelectorAll(this.managedTagsInfo.query);for(let k=0,N=E.length,T,R;k<N;k++){R=[].slice.call(E[k].classList);for(let M=0,A=R.length;M<A;M++)if(T=this.managedTagsInfo.map[R[M]],T){T(E[k]);break}}}let y=v.childNodes,w="";const x=this._isFormatData(y);x&&(y=this._editFormat(v).childNodes);for(let E=0,k=y.length,N;E<k;E++){if(N=y[E],this.__allowedScriptRegExp.test(N.nodeName)){w+=N.outerHTML;continue}w+=this._makeLine(N,x)}return w=r.htmlRemoveWhiteSpace(w),w?(u&&(w=w.replace(typeof u=="string"?r.createTagsWhitelist(u):u,"")),p&&(w=w.replace(typeof p=="string"?r.createTagsBlacklist(p):p,""))):w=c,this._tagConvertor(w)},convertContentsForEditor:function(c){if(!s.strictMode)return r.htmlCompress(c);c=this._deleteDisallowedTags(this._parser.parseFromString(r.htmlCompress(c),"text/html").body.innerHTML).replace(/(<[a-zA-Z0-9\-]+)[^>]*(?=>)/g,this._cleanTags.bind(this,!0));const u=l.createRange().createContextualFragment(c);try{r._consistencyCheckOfHTML(u,this._htmlCheckWhitelistRegExp,this._htmlCheckBlacklistRegExp,this._classNameFilter,s.strictHTMLValidation)}catch(w){console.warn("[SUNEDITOR.convertContentsForEditor.consistencyCheck.fail] "+w)}if(this.managedTagsInfo&&this.managedTagsInfo.query){const w=u.querySelectorAll(this.managedTagsInfo.query);for(let x=0,E=w.length,k,N;x<E;x++){N=[].slice.call(w[x].classList);for(let T=0,R=N.length;T<R;T++)if(k=this.managedTagsInfo.map[N[T]],k){k(w[x]);break}}}const p=u.childNodes;let v="",y=null;for(let w=0,x;w<p.length;w++){if(x=p[w],this.__allowedScriptRegExp.test(x.nodeName)){v+=x.outerHTML;continue}if(!r.isFormatElement(x)&&!r.isRangeFormatElement(x)&&!r.isComponent(x)&&!r.isFigures(x)&&x.nodeType!==8&&!/__se__tag/.test(x.className)){if(y||(y=r.createElement(s.defaultTag)),y.appendChild(x),w--,p[w+1]&&!r.isFormatElement(p[w+1]))continue;x=y,y=null}y&&(v+=this._makeLine(y,!0),y=null),v+=this._makeLine(x,!0)}return y&&(v+=this._makeLine(y,!0)),v.length===0?"<"+s.defaultTag+"><br></"+s.defaultTag+">":(v=r.htmlRemoveWhiteSpace(v),this._tagConvertor(v))},convertHTMLForCodeView:function(c,u){let p="";const v=a.RegExp,y=new v("^(BLOCKQUOTE|PRE|TABLE|THEAD|TBODY|TR|TH|TD|OL|UL|IMG|IFRAME|VIDEO|AUDIO|FIGURE|FIGCAPTION|HR|BR|CANVAS|SELECT)$","i"),w=typeof c=="string"?l.createRange().createContextualFragment(c):c,x=(function(N){return this.isFormatElement(N)||this.isComponent(N)}).bind(r),E=u?"":`
|
|
250
|
+
`;let k=u?0:this._variable.codeIndent*1;return k=k>0?new a.Array(k+1).join(" "):"",function N(T,R){const M=T.childNodes,A=y.test(T.nodeName),D=A?R:"";for(let $=0,H=M.length,j,F,z,O,B,L;$<H;$++){if(j=M[$],O=y.test(j.nodeName),F=O?E:"",z=x(j)&&!A&&!/^(TH|TD)$/i.test(T.nodeName)?E:"",j.nodeType===8){p+=`
|
|
251
|
+
<!-- `+j.textContent.trim()+" -->"+F;continue}if(j.nodeType===3){r.isList(j.parentElement)||(p+=r._HTMLConvertor(/^\n+$/.test(j.data)?"":j.data));continue}if(j.childNodes.length===0){p+=(/^HR$/i.test(j.nodeName)?E:"")+(/^PRE$/i.test(j.parentElement.nodeName)&&/^BR$/i.test(j.nodeName)?"":D)+j.outerHTML+F;continue}j.outerHTML?(B=j.nodeName.toLowerCase(),L=D||O?R:"",p+=(z||(A?"":F))+L+j.outerHTML.match(v("<"+B+"[^>]*>","i"))[0]+F,N(j,R+k),p+=(/\n$/.test(p)?L:"")+"</"+B+">"+(z||F||A||/^(TH|TD)$/i.test(j.nodeName)?E:"")):p+=new a.XMLSerializer().serializeToString(j)}}(w,""),p.trim()+E},addDocEvent:function(c,u,p){l.addEventListener(c,u,p),s.iframe&&this._wd.addEventListener(c,u)},removeDocEvent:function(c,u){l.removeEventListener(c,u),s.iframe&&this._wd.removeEventListener(c,u)},_charCount:function(c){const u=s.maxCharCount,p=s.charCounterType;let v=0;if(c&&(v=this.getCharLength(c,p)),this._setCharCount(),u>0){let y=!1;const w=b.getCharCount(p);if(w>u){if(y=!0,v>0){this._editorRange();const x=this.getRange(),E=x.endOffset-1,k=this.getSelectionNode().textContent,N=x.endOffset-(w-u);this.getSelectionNode().textContent=k.slice(0,N<0?0:N)+k.slice(x.endOffset,k.length),this.setRange(x.endContainer,E,x.endContainer,E)}}else w+v>u&&(y=!0);if(y&&(this._callCounterBlink(),v>0))return!1}return!0},checkCharCount:function(c,u){if(s.maxCharCount){const p=u||s.charCounterType,v=this.getCharLength(typeof c=="string"?c:this._charTypeHTML&&c.nodeType===1?c.outerHTML:c.textContent,p);if(v>0&&v+b.getCharCount(p)>s.maxCharCount)return this._callCounterBlink(),!1}return!0},getCharLength:function(c,u){return/byte/.test(u)?r.getByteLength(c):c.length},resetResponsiveToolbar:function(){d.controllersOff();const c=h._responsiveButtonSize;if(c){let u=0;(d._isBalloon||d._isInline)&&s.toolbarWidth==="auto"?u=e.element.topArea.offsetWidth:u=e.element.toolbar.offsetWidth;let p="default";for(let v=1,y=c.length;v<y;v++)if(u<c[v]){p=c[v]+"";break}h._responsiveCurrentSize!==p&&(h._responsiveCurrentSize=p,b.setToolbarButtons(h._responsiveButtons[p]))}},_setCharCount:function(){e.element.charCounter&&a.setTimeout((function(c,u){this.textContent&&c&&(this.textContent=c.getCharCount(u.charCounterType))}).bind(e.element.charCounter,b,s),0)},_callCounterBlink:function(){const c=e.element.charWrapper;c&&!r.hasClass(c,"se-blink")&&(r.addClass(c,"se-blink"),a.setTimeout(function(){r.removeClass(c,"se-blink")},600))},_checkComponents:function(){for(let c=0,u=this._fileInfoPluginsCheck.length;c<u;c++)this._fileInfoPluginsCheck[c]()},_resetComponents:function(){for(let c=0,u=this._fileInfoPluginsReset.length;c<u;c++)this._fileInfoPluginsReset[c]()},_setCodeView:function(c){s.codeMirrorEditor?s.codeMirrorEditor.getDoc().setValue(c):e.element.code.value=c},_getCodeView:function(){return s.codeMirrorEditor?s.codeMirrorEditor.getDoc().getValue():e.element.code.value},_setKeyEffect:function(c){const u=this.commandMap,p=this.activePlugins;for(let v in u)c.indexOf(v)>-1||!r.hasOwn(u,v)||(p.indexOf(v)>-1?n[v].active.call(this,null):u.OUTDENT&&/^OUTDENT$/i.test(v)?r.isImportantDisabled(u.OUTDENT)||u.OUTDENT.setAttribute("disabled",!0):u.INDENT&&/^INDENT$/i.test(v)?r.isImportantDisabled(u.INDENT)||u.INDENT.removeAttribute("disabled"):r.removeClass(u[v],"active"))},_init:function(c,u){const p=a.RegExp;this._ww=s.iframe?e.element.wysiwygFrame.contentWindow:a,this._wd=l,this._charTypeHTML=s.charCounterType==="byte-html",this.wwComputedStyle=a.getComputedStyle(e.element.wysiwyg),this._editorHeight=e.element.wysiwygFrame.offsetHeight,this._editorHeightPadding=r.getNumber(this.wwComputedStyle.getPropertyValue("padding-top"))+r.getNumber(this.wwComputedStyle.getPropertyValue("padding-bottom")),this._classNameFilter=(function(O){return this.test(O)?O:""}).bind(s.allowedClassNames);const v=s.__allowedScriptTag?"":"script|";if(this.__scriptTagRegExp=new p("<(script)[^>]*>([\\s\\S]*?)<\\/\\1>|<script[^>]*\\/?>","gi"),this.__disallowedTagsRegExp=new p("<("+v+"style)[^>]*>([\\s\\S]*?)<\\/\\1>|<("+v+"style)[^>]*\\/?>","gi"),this.__disallowedTagNameRegExp=new p("^("+v+"meta|link|style|[a-z]+:[a-z]+)$","i"),this.__allowedScriptRegExp=new p("^"+(s.__allowedScriptTag?"script":"")+"$","i"),!s.iframe&&typeof a.ShadowRoot=="function"){let O=e.element.wysiwygFrame;for(;O;){if(O.shadowRoot){this._shadowRoot=O.shadowRoot;break}else if(O instanceof a.ShadowRoot){this._shadowRoot=O;break}O=O.parentNode}this._shadowRoot&&(this._shadowRootControllerEventTarget=[])}const y=a.Object.keys(s._textTagsMap),w=s.addTagsWhitelist?s.addTagsWhitelist.split("|").filter(function(O){return/b|i|ins|s|strike/i.test(O)}):[];for(let O=0;O<w.length;O++)y.splice(y.indexOf(w[O].toLowerCase()),1);this._disallowedTextTagsRegExp=y.length===0?null:new p("(<\\/?)("+y.join("|")+")\\b\\s*([^>^<]+)?\\s*(?=>)","gi");const x=function(O,B){return O?O==="*"?"[a-z-]+":B?O+"|"+B:O:"^"},N="contenteditable|colspan|rowspan|target|href|download|rel|src|alt|class|type|origin-size"+"|controls|autoplay|loop|muted|poster|preload|playsinline"+"|allowfullscreen|sandbox|loading|allow|referrerpolicy|frameborder|scrolling",T="data-format|data-size|data-file-size|data-file-name|data-origin|data-align|data-image-link|data-rotate|data-proportion|data-percentage|data-exp|data-font-size";this._allowHTMLComments=s._editorTagsWhitelist.indexOf("//")>-1||s._editorTagsWhitelist==="*",this._htmlCheckWhitelistRegExp=new p("^("+x(s._editorTagsWhitelist.replace("|//",""),"")+")$","i"),this._htmlCheckBlacklistRegExp=new p("^("+(s.tagsBlacklist||"^")+")$","i"),this.editorTagsWhitelistRegExp=r.createTagsWhitelist(x(s._editorTagsWhitelist.replace("|//","|<!--|-->"),"")),this.editorTagsBlacklistRegExp=r.createTagsBlacklist(s.tagsBlacklist.replace("|//","|<!--|-->")),this.pasteTagsWhitelistRegExp=r.createTagsWhitelist(x(s.pasteTagsWhitelist,"")),this.pasteTagsBlacklistRegExp=r.createTagsBlacklist(s.pasteTagsBlacklist);const R='\\s*=\\s*(")[^"]*\\1',M=s.attributesWhitelist;let A={},D="";if(M)for(let O in M)!r.hasOwn(M,O)||/^on[a-z]+$/i.test(M[O])||(O==="all"?D=x(M[O],N):A[O]=new p("\\s(?:"+x(M[O],N)+")"+R,"ig"));this._attributesWhitelistRegExp=new p("\\s(?:"+(D||N+"|"+T)+")"+R,"ig"),this._attributesWhitelistRegExp_all_data=new p("\\s(?:"+((D||N)+"|data-[a-z0-9\\-]+")+")"+R,"ig"),this._attributesTagsWhitelist=A;const $=s.attributesBlacklist;if(A={},D="",$)for(let O in $)r.hasOwn($,O)&&(O==="all"?D=x($[O],""):A[O]=new p("\\s(?:"+x($[O],"")+")"+R,"ig"));this._attributesBlacklistRegExp=new p("\\s(?:"+(D||"^")+")"+R,"ig"),this._attributesTagsBlacklist=A,this._isInline=/inline/i.test(s.mode),this._isBalloon=/balloon|balloon-always/i.test(s.mode),this._isBalloonAlways=/balloon-always/i.test(s.mode),this._cachingButtons(),this._fileInfoPluginsCheck=[],this._fileInfoPluginsReset=[],this.managedTagsInfo={query:"",map:{}};const H=[];this.activePlugins=[],this._fileManager.tags=[],this._fileManager.pluginMap={};let j=[],F,z;for(let O in n)if(r.hasOwn(n,O)){if(F=n[O],z=t[O],(F.active||F.action)&&z&&this.callPlugin(O,null,z),typeof F.checkFileInfo=="function"&&typeof F.resetFileInfo=="function"&&(this.callPlugin(O,null,z),this._fileInfoPluginsCheck.push(F.checkFileInfo.bind(this)),this._fileInfoPluginsReset.push(F.resetFileInfo.bind(this))),a.Array.isArray(F.fileTags)){const B=F.fileTags;this.callPlugin(O,null,z),this._fileManager.tags=this._fileManager.tags.concat(B),j.push(O);for(let L=0,U=B.length;L<U;L++)this._fileManager.pluginMap[B[L].toLowerCase()]=O}if(F.managedTags){const B=F.managedTags();H.push("."+B.className),this.managedTagsInfo.map[B.className]=B.method.bind(this)}}this.managedTagsInfo.query=H.toString(),this._fileManager.queryString=this._fileManager.tags.join(","),this._fileManager.regExp=new p("^("+(this._fileManager.tags.join("|")||"^")+")$","i"),this._fileManager.pluginRegExp=new p("^("+(j.length===0?"^":j.join("|"))+")$","i"),this._variable._originCssText=e.element.topArea.style.cssText,this._placeholder=e.element.placeholder,this._lineBreaker=e.element.lineBreaker,this._lineBreakerButton=this._lineBreaker.querySelector("button"),this.history=kC(this,this._onChange_historyStack.bind(this)),this.addModule([Ia]),s.iframe&&(this._wd=e.element.wysiwygFrame.contentDocument,e.element.wysiwyg=this._wd.body,s._editorStyles.editor&&(e.element.wysiwyg.style.cssText=s._editorStyles.editor),s.height==="auto"&&(this._iframeAuto=this._wd.body)),this._initWysiwygArea(c,u)},_cachingButtons:function(){this.codeViewDisabledButtons=e.element._buttonTray.querySelectorAll('.se-menu-list button[data-display]:not([class~="se-code-view-enabled"]):not([data-display="MORE"])'),this.resizingDisabledButtons=e.element._buttonTray.querySelectorAll('.se-menu-list button[data-display]:not([class~="se-resizing-enabled"]):not([data-display="MORE"])');const c=e.tool,u=this.commandMap;u.INDENT=c.indent,u.OUTDENT=c.outdent,u[s.textTags.bold.toUpperCase()]=c.bold,u[s.textTags.underline.toUpperCase()]=c.underline,u[s.textTags.italic.toUpperCase()]=c.italic,u[s.textTags.strike.toUpperCase()]=c.strike,u[s.textTags.sub.toUpperCase()]=c.subscript,u[s.textTags.sup.toUpperCase()]=c.superscript,this._styleCommandMap={fullScreen:c.fullScreen,showBlocks:c.showBlocks,codeView:c.codeView},this._saveButtonStates()},_initWysiwygArea:function(c,u){e.element.wysiwyg.innerHTML=c?u:this.convertContentsForEditor((typeof u=="string"?u:/^TEXTAREA$/i.test(e.element.originElement.nodeName)?e.element.originElement.value:e.element.originElement.innerHTML)||"")},_resourcesStateChange:function(){this._iframeAutoHeight(),this._checkPlaceholder()},_onChange_historyStack:function(){this.hasFocus&&h._applyTagEffects(),this._variable.isChanged=!0,e.tool.save&&e.tool.save.removeAttribute("disabled"),b.onChange&&b.onChange(this.getContents(!0),this),e.element.toolbar.style.display==="block"&&h._showToolbarBalloon()},_iframeAutoHeight:function(){this._iframeAuto?a.setTimeout(function(){const c=d._iframeAuto.offsetHeight;e.element.wysiwygFrame.style.height=c+"px",r.isResizeObserverSupported||d.__callResizeFunction(c,null)}):r.isResizeObserverSupported||d.__callResizeFunction(e.element.wysiwygFrame.offsetHeight,null)},__callResizeFunction:function(c,u){c=c===-1?u.borderBoxSize&&u.borderBoxSize[0]?u.borderBoxSize[0].blockSize:u.contentRect.height+this._editorHeightPadding:c,this._editorHeight!==c&&(typeof b.onResizeEditor=="function"&&b.onResizeEditor(c,this._editorHeight,d,u),this._editorHeight=c)},_checkPlaceholder:function(){if(this._placeholder){if(this._variable.isCodeView){this._placeholder.style.display="none";return}const c=e.element.wysiwyg;!r.onlyZeroWidthSpace(c.textContent)||c.querySelector(r._allowedEmptyNodeList)||(c.innerText.match(/\n/g)||"").length>1?this._placeholder.style.display="none":this._placeholder.style.display="block"}},_setDefaultFormat:function(c){if(this._fileManager.pluginRegExp.test(this.currentControllerName))return;const u=this.getRange(),p=u.commonAncestorContainer,v=u.startContainer,y=r.getRangeFormatElement(p,null);let w,x,E;const k=r.getParentElement(p,r.isComponent);if(!(k&&!r.isTable(k))){if(p.nodeType===1&&p.getAttribute("data-se-embed")==="true"){let N=p.nextElementSibling;r.isFormatElement(N)||(N=this.appendFormatTag(p,s.defaultTag)),this.setRange(N.firstChild,0,N.firstChild,0);return}if(!((r.isRangeFormatElement(v)||r.isWysiwygDiv(v))&&(r.isComponent(v.children[u.startOffset])||r.isComponent(v.children[u.startOffset-1])))){if(r.getParentElement(p,r.isNotCheckingNode))return null;if(y){E=r.createElement(c||s.defaultTag),E.innerHTML=y.innerHTML,E.childNodes.length===0&&(E.innerHTML=r.zeroWidthSpace),y.innerHTML=E.outerHTML,E=y.firstChild,w=r.getEdgeChildNodes(E,null).sc,w||(w=r.createTextNode(r.zeroWidthSpace),E.insertBefore(w,E.firstChild)),x=w.textContent.length,this.setRange(w,x,w,x);return}if(r.isRangeFormatElement(p)&&p.childNodes.length<=1){let N=null;p.childNodes.length===1&&r.isBreak(p.firstChild)?N=p.firstChild:(N=r.createTextNode(r.zeroWidthSpace),p.appendChild(N)),this.setRange(N,1,N,1);return}try{if(p.nodeType===3&&(E=r.createElement(c||s.defaultTag),p.parentNode.insertBefore(E,p),E.appendChild(p)),r.isWysiwygDiv(p)){E=r.createElement(c||s.defaultTag),E.innerHTML=p.innerHTML,p.innerHTML="",p.appendChild(E),this.effectNode=null,this.setRange(E,1,E,1);return}if(E&&(r.isBreak(E.nextSibling)&&r.removeItem(E.nextSibling),r.isBreak(E.previousSibling)&&r.removeItem(E.previousSibling)),r.isBreak(w)){const N=r.createTextNode(r.zeroWidthSpace);w.parentNode.insertBefore(N,w),w=N}}catch{this.execCommand("formatBlock",!1,c||s.defaultTag),this.removeRange(),this._editorRange(),this.effectNode=null;return}if(E&&(r.isBreak(E.nextSibling)&&r.removeItem(E.nextSibling),r.isBreak(E.previousSibling)&&r.removeItem(E.previousSibling),r.isBreak(w))){const N=r.createTextNode(r.zeroWidthSpace);w.parentNode.insertBefore(N,w),w=N}this.effectNode=null,v?this.setRange(v,1,v,1):this.nativeFocus()}}},_setOptionsInit:function(c,u){this.context=e=qr(c.originElement,this._getConstructed(c),s),this._componentsInfoReset=!0,this._editorInit(!0,u)},_editorInit:function(c,u){this._init(c,u),h._addEvent(),this._setCharCount(),h._offStickyToolbar(),h.onResize_window(),e.element.toolbar.style.visibility="";const p=s.frameAttrbutes;for(let v in p)e.element.wysiwyg.setAttribute(v,p[v]);this._checkComponents(),this._componentsInfoInit=!1,this._componentsInfoReset=!1,this.history.reset(!0),a.setTimeout(function(){typeof d._resourcesStateChange=="function"&&(h._resizeObserver&&h._resizeObserver.observe(e.element.wysiwygFrame),h._toolbarObserver&&h._toolbarObserver.observe(e.element._toolbarShadow),d._resourcesStateChange(),typeof b.onload=="function"&&b.onload(d,c))})},_getConstructed:function(c){return{_top:c.topArea,_relative:c.relative,_toolBar:c.toolbar,_toolbarShadow:c._toolbarShadow,_menuTray:c._menuTray,_editorArea:c.editorArea,_wysiwygArea:c.wysiwygFrame,_codeArea:c.code,_placeholder:c.placeholder,_resizingBar:c.resizingBar,_navigation:c.navigation,_charCounter:c.charCounter,_charWrapper:c.charWrapper,_loading:c.loading,_lineBreaker:c.lineBreaker,_lineBreaker_t:c.lineBreaker_t,_lineBreaker_b:c.lineBreaker_b,_resizeBack:c.resizeBackground,_stickyDummy:c._stickyDummy,_arrow:c._arrow}}},h={_IEisComposing:!1,_lineBreakerBind:null,_responsiveCurrentSize:"default",_responsiveButtonSize:null,_responsiveButtons:null,_deleteKeyCode:new a.RegExp("^(8|46)$"),_cursorMoveKeyCode:new a.RegExp("^(8|3[2-9]|40|46)$"),_directionKeyCode:new a.RegExp("^(8|13|3[2-9]|40|46)$"),_nonTextKeyCode:new a.RegExp("^(8|13|1[6-9]|20|27|3[3-9]|40|45|46|11[2-9]|12[0-3]|144|145)$"),_historyIgnoreKeyCode:new a.RegExp("^(1[6-9]|20|27|3[3-9]|40|45|11[2-9]|12[0-3]|144|145)$"),_onButtonsCheck:new a.RegExp("^("+a.Object.keys(s._textTagsMap).join("|")+")$","i"),_frontZeroWidthReg:new a.RegExp(r.zeroWidthSpace+"+",""),_keyCodeShortcut:{65:"A",66:"B",83:"S",85:"U",73:"I",89:"Y",90:"Z",219:"[",221:"]"},_shortcutCommand:function(c,u){let p=null;const v=h._keyCodeShortcut[c];switch(v){case"A":p="selectAll";break;case"B":s.shortcutsDisable.indexOf("bold")===-1&&(p="bold");break;case"S":u&&s.shortcutsDisable.indexOf("strike")===-1?p="strike":!u&&s.shortcutsDisable.indexOf("save")===-1&&(p="save");break;case"U":s.shortcutsDisable.indexOf("underline")===-1&&(p="underline");break;case"I":s.shortcutsDisable.indexOf("italic")===-1&&(p="italic");break;case"Z":s.shortcutsDisable.indexOf("undo")===-1&&(u?p="redo":p="undo");break;case"Y":s.shortcutsDisable.indexOf("undo")===-1&&(p="redo");break;case"[":s.shortcutsDisable.indexOf("indent")===-1&&(p=s.rtl?"indent":"outdent");break;case"]":s.shortcutsDisable.indexOf("indent")===-1&&(p=s.rtl?"outdent":"indent");break}return p?(d.commandHandler(d.commandMap[p],p),!0):!!v},_applyTagEffects:function(){if(r.hasClass(e.element.wysiwyg,"se-read-only"))return!1;let c=d.getSelectionNode();if(c===d.effectNode)return;d.effectNode=c;const u=s.rtl?"marginRight":"marginLeft",p=d.commandMap,v=h._onButtonsCheck,y=[],w=[],x=d.activePlugins,E=x.length;let k="";for(;c.firstChild;)c=c.firstChild;for(let N=c;!r.isWysiwygDiv(N)&&N;N=N.parentNode)if(!(N.nodeType!==1||r.isBreak(N))){if(k=N.nodeName.toUpperCase(),w.push(k),!d.isReadOnly)for(let T=0,R;T<E;T++)R=x[T],y.indexOf(R)===-1&&n[R].active.call(d,N)&&y.push(R);if(r.isFormatElement(N)){y.indexOf("OUTDENT")===-1&&p.OUTDENT&&!r.isImportantDisabled(p.OUTDENT)&&(r.isListCell(N)||N.style[u]&&r.getNumber(N.style[u],0)>0)&&(y.push("OUTDENT"),p.OUTDENT.removeAttribute("disabled")),y.indexOf("INDENT")===-1&&p.INDENT&&!r.isImportantDisabled(p.INDENT)&&(y.push("INDENT"),r.isListCell(N)&&!N.previousElementSibling?p.INDENT.setAttribute("disabled",!0):p.INDENT.removeAttribute("disabled"));continue}v&&v.test(k)&&(y.push(k),r.addClass(p[k],"active"))}d._setKeyEffect(y),d._variable.currentNodes=w.reverse(),d._variable.currentNodesMap=y,s.showPathLabel&&(e.element.navigation.textContent=d._variable.currentNodes.join(" > "))},_buttonsEventHandler:function(c){let u=c.target;if(d._bindControllersOff&&c.stopPropagation(),/^(input|textarea|select|option)$/i.test(u.nodeName)?d._antiBlur=!1:c.preventDefault(),r.getParentElement(u,".se-submenu"))c.stopPropagation(),d._notHideToolbar=!0;else{let p=u.getAttribute("data-command"),v=u.className;for(;!p&&!/se-menu-list/.test(v)&&!/sun-editor-common/.test(v);)u=u.parentNode,p=u.getAttribute("data-command"),v=u.className;(p===d._submenuName||p===d._containerName)&&c.stopPropagation()}},addGlobalEvent:function(c,u,p){return s.iframe&&d._ww.addEventListener(c,u,p),d._w.addEventListener(c,u,p),{type:c,listener:u,useCapture:p}},removeGlobalEvent:function(c,u,p){c&&(typeof c=="object"&&(u=c.listener,p=c.useCapture,c=c.type),s.iframe&&d._ww.removeEventListener(c,u,p),d._w.removeEventListener(c,u,p))},onClick_toolbar:function(c){let u=c.target,p=u.getAttribute("data-display"),v=u.getAttribute("data-command"),y=u.className;for(d.controllersOff();u.parentNode&&!v&&!/se-menu-list/.test(y)&&!/se-toolbar/.test(y);)u=u.parentNode,v=u.getAttribute("data-command"),p=u.getAttribute("data-display"),y=u.className;!v&&!p||u.disabled||d.actionCall(v,p,u)},__selectionSyncEvent:null,onMouseDown_wysiwyg:function(c){if(d.isReadOnly||r.isNonEditable(e.element.wysiwyg))return;if(r._isExcludeSelectionElement(c.target)){c.preventDefault();return}if(h.removeGlobalEvent(h.__selectionSyncEvent),h.__selectionSyncEvent=h.addGlobalEvent("mouseup",function(){d&&d._editorRange(),h.removeGlobalEvent(h.__selectionSyncEvent)}),typeof b.onMouseDown=="function"&&b.onMouseDown(c,d)===!1)return;const u=r.getParentElement(c.target,r.isCell);if(u){const p=d.plugins.table;p&&u!==p._fixedCell&&!p._shift&&d.callPlugin("table",function(){p.onTableCellMultiSelect.call(d,u,!1)},null)}d._isBalloon&&h._hideToolbar()},onClick_wysiwyg:function(c){const u=c.target;if(d.isReadOnly)return c.preventDefault(),r.isAnchor(u)&&a.open(u.href,u.target),!1;if(r.isNonEditable(e.element.wysiwyg)||typeof b.onClick=="function"&&b.onClick(c,d)===!1)return;const p=d.getFileComponent(u);if(p){c.preventDefault(),d.selectComponent(p.target,p.pluginName);return}const v=r.getParentElement(u,"FIGCAPTION");if(v&&r.isNonEditable(v)&&(c.preventDefault(),v.focus(),d._isInline&&!d._inlineToolbarAttr.isShow)){h._showToolbarInline();const N=function(){h._hideToolbar(),v.removeEventListener("blur",N)};v.addEventListener("blur",N)}if(d._editorRange(),c.detail===3){let N=d.getRange();r.isFormatElement(N.endContainer)&&N.endOffset===0&&(N=d.setRange(N.startContainer,N.startOffset,N.startContainer,N.startContainer.length),d._rangeInfo(N,d.getSelection()))}const y=d.getSelectionNode(),w=r.getFormatElement(y,null),x=r.getRangeFormatElement(y,null);let E=y;for(;E&&E.firstChild;)E=E.firstChild;const k=d.getFileComponent(E);if(k){const N=d.getRange();!x&&N.startContainer===N.endContainer&&d.selectComponent(k.target,k.pluginName)}else d.currentFileComponentInfo&&d.controllersOff();if(!w&&!r.isNonEditable(u)&&!r.isList(x)){const N=d.getRange();if(r.getFormatElement(N.startContainer)===r.getFormatElement(N.endContainer))if(r.isList(x)){c.preventDefault();const T=r.createElement("LI"),R=y.nextElementSibling;T.appendChild(y),x.insertBefore(T,R),d.focus()}else!r.isWysiwygDiv(y)&&!r.isComponent(y)&&(!r.isTable(y)||r.isCell(y))&&d._setDefaultFormat(r.isRangeFormatElement(x)?"DIV":s.defaultTag)!==null?(c.preventDefault(),d.focus()):h._applyTagEffects()}else h._applyTagEffects();d._isBalloon&&a.setTimeout(h._toggleToolbarBalloon)},_balloonDelay:null,_showToolbarBalloonDelay:function(){h._balloonDelay&&a.clearTimeout(h._balloonDelay),h._balloonDelay=a.setTimeout((function(){a.clearTimeout(this._balloonDelay),this._balloonDelay=null,this._showToolbarBalloon()}).bind(h),350)},_toggleToolbarBalloon:function(){if(d){d._editorRange();const c=d.getRange();d._bindControllersOff||!d._isBalloonAlways&&c.collapsed?h._hideToolbar():h._showToolbarBalloon(c)}},_showToolbarBalloon:function(c){if(!d._isBalloon)return;const u=c||d.getRange(),p=e.element.toolbar,v=e.element.topArea,y=d.getSelection();let w;if(d._isBalloonAlways&&u.collapsed)w=!0;else if(y.focusNode===y.anchorNode)w=y.focusOffset<y.anchorOffset;else{const F=r.getListChildNodes(u.commonAncestorContainer,null);w=r.getArrayIndex(F,y.focusNode)<r.getArrayIndex(F,y.anchorNode)}let x=u.getClientRects();x=x[w?0:x.length-1];const E=d.getGlobalScrollOffset();let k=E.left,N=E.top;const T=v.offsetWidth,R=h._getEditorOffsets(null),M=R.top,A=R.left;if(p.style.top="-10000px",p.style.visibility="hidden",p.style.display="block",!x){const F=d.getSelectionNode();if(r.isFormatElement(F)){const z=r.createTextNode(r.zeroWidthSpace);d.insertNode(z,null,!1),d.setRange(z,1,z,1),d._editorRange(),x=d.getRange().getClientRects(),x=x[w?0:x.length-1]}if(!x){const z=r.getOffset(F,e.element.wysiwygFrame);x={left:z.left,top:z.top,right:z.left,bottom:z.top+F.offsetHeight,noText:!0},k=0,N=0}w=!0}const D=a.Math.round(e.element._arrow.offsetWidth/2),$=p.offsetWidth,H=p.offsetHeight,j=/iframe/i.test(e.element.wysiwygFrame.nodeName)?e.element.wysiwygFrame.getClientRects()[0]:null;if(j&&(x={left:x.left+j.left,top:x.top+j.top,right:x.right+j.right-j.width,bottom:x.bottom+j.bottom-j.height}),h._setToolbarOffset(w,x,p,A,T,k,N,M,D),($!==p.offsetWidth||H!==p.offsetHeight)&&h._setToolbarOffset(w,x,p,A,T,k,N,M,D),s.toolbarContainer){const F=v.parentElement;let z=s.toolbarContainer,O=z.offsetLeft,B=z.offsetTop;for(;!z.parentElement.contains(F)||!/^(BODY|HTML)$/i.test(z.parentElement.nodeName);)z=z.offsetParent,O+=z.offsetLeft,B+=z.offsetTop;p.style.left=p.offsetLeft-O+v.offsetLeft+"px",p.style.top=p.offsetTop-B+v.offsetTop+"px"}p.style.visibility=""},_setToolbarOffset:function(c,u,p,v,y,w,x,E,k){const T=p.offsetWidth,R=u.noText&&!c?0:p.offsetHeight,M=(c?u.left:u.right)-v-T/2+w,A=M+T-y;let D=(c?u.top-R-k:u.bottom+k)-(u.noText?0:E)+x,$=M<0?1:A<0?M:M-A-1-1,H=!1;const j=D+(c?h._getEditorOffsets(null).top:p.offsetHeight-e.element.wysiwyg.offsetHeight);!c&&j>0&&h._getPageBottomSpace()<j?(c=!0,H=!0):c&&l.documentElement.offsetTop>j&&(c=!1,H=!0),H&&(D=(c?u.top-R-k:u.bottom+k)-(u.noText?0:E)+x),p.style.left=a.Math.floor($)+"px",p.style.top=a.Math.floor(D)+"px",c?(r.removeClass(e.element._arrow,"se-arrow-up"),r.addClass(e.element._arrow,"se-arrow-down"),e.element._arrow.style.top=R+"px"):(r.removeClass(e.element._arrow,"se-arrow-down"),r.addClass(e.element._arrow,"se-arrow-up"),e.element._arrow.style.top=-k+"px");const F=a.Math.floor(T/2+(M-$));e.element._arrow.style.left=(F+k>p.offsetWidth?p.offsetWidth-k:F<k?k:F)+"px"},_showToolbarInline:function(){if(!d._isInline)return;const c=e.element.toolbar;s.toolbarContainer?c.style.position="relative":c.style.position="absolute",c.style.visibility="hidden",c.style.display="block",d._inlineToolbarAttr.width=c.style.width=s.toolbarWidth,d._inlineToolbarAttr.top=c.style.top=(s.toolbarContainer?0:-1-c.offsetHeight)+"px",typeof b.showInline=="function"&&b.showInline(c,e,d),h.onScroll_window(),d._inlineToolbarAttr.isShow=!0,c.style.visibility=""},_hideToolbar:function(){!d._notHideToolbar&&!d._variable.isFullScreen&&(e.element.toolbar.style.display="none",d._inlineToolbarAttr.isShow=!1)},onInput_wysiwyg:function(c){if(/AUDIO/.test(c.target.nodeName))return!1;if(d.isReadOnly||d.isDisabled)return c.preventDefault(),c.stopPropagation(),d.history.go(d.history.getCurrentIndex()),!1;const u=d.getRange(),p=d.getSelectionNode(),v=r.getFormatElement(p,null);if(!v&&u.collapsed&&!r.isComponent(p)&&!r.isList(p)){const w=r.getRangeFormatElement(v,null);d._setDefaultFormat(r.isRangeFormatElement(w)?"DIV":s.defaultTag)}d._editorRange();const y=(c.data===null?"":c.data===void 0?" ":c.data)||"";if(!d._charCount(y))return c.preventDefault(),c.stopPropagation(),!1;typeof b.onInput=="function"&&b.onInput(c,d)===!1||d.history.push(!0)},_isUneditableNode:function(c,u){const p=u?c.startContainer:c.endContainer,v=u?c.startOffset:c.endOffset,y=u?"previousSibling":"nextSibling",w=p.nodeType===1;let x;return w?(x=h._isUneditableNode_getSibling(p.childNodes[v],y,p),x&&x.nodeType===1&&x.getAttribute("contenteditable")==="false"):(x=h._isUneditableNode_getSibling(p,y,p),d.isEdgePoint(p,v,u?"start":"end")&&x&&x.nodeType===1&&x.getAttribute("contenteditable")==="false")},_isUneditableNode_getSibling:function(c,u,p){if(!c)return null;let v=c[u];if(!v)if(v=r.getFormatElement(p),v=v?v[u]:null,v&&!r.isComponent(v))v=u==="previousSibling"?v.firstChild:v.lastChild;else return null;return v},_onShortcutKey:!1,onKeyDown_wysiwyg:function(c){let u=d.getSelectionNode();if(r.isInputElement(u))return;const p=c.keyCode,v=c.shiftKey,y=c.ctrlKey||c.metaKey||p===91||p===92||p===224,w=c.altKey;if(h._IEisComposing=p===229,!y&&d.isReadOnly&&!h._cursorMoveKeyCode.test(p))return c.preventDefault(),!1;if(d.submenuOff(),d._isBalloon&&h._hideToolbar(),typeof b.onKeyDown=="function"&&b.onKeyDown(c,d)===!1)return;if(y&&h._shortcutCommand(p,v))return h._onShortcutKey=!0,c.preventDefault(),c.stopPropagation(),!1;h._onShortcutKey&&(h._onShortcutKey=!1),p===13&&r.isFormatElement(d.getRange().startContainer)&&(d._resetRangeToTextNode(),u=d.getSelectionNode());const x=d.getRange(),E=!x.collapsed||x.startContainer!==x.endContainer,k=d._fileManager.pluginRegExp.test(d.currentControllerName)?d.currentControllerName:"";let N=r.getFormatElement(u,null)||u,T=r.getRangeFormatElement(N,null);if(!(/37|38|39|40/.test(c.keyCode)&&h._onKeyDown_wysiwyg_arrowKey(c)===!1)){switch(p){case 8:if(!E&&k){c.preventDefault(),c.stopPropagation(),d.plugins[k].destroy.call(d);break}if(E&&h._hardDelete()){c.preventDefault(),c.stopPropagation();break}if(!r.isFormatElement(N)&&!e.element.wysiwyg.firstElementChild&&!r.isComponent(u)&&d._setDefaultFormat(s.defaultTag)!==null)return c.preventDefault(),c.stopPropagation(),!1;if(!E&&!N.previousElementSibling&&x.startOffset===0&&!u.previousSibling&&!r.isListCell(N)&&r.isFormatElement(N)&&(!r.isFreeFormatElement(N)||r.isClosureFreeFormatElement(N))){if(r.isClosureRangeFormatElement(N.parentNode))return c.preventDefault(),c.stopPropagation(),!1;if(r.isWysiwygDiv(N.parentNode)&&N.childNodes.length<=1&&(!N.firstChild||r.onlyZeroWidthSpace(N.textContent))){if(c.preventDefault(),c.stopPropagation(),N.nodeName.toUpperCase()===s.defaultTag.toUpperCase()){N.innerHTML="<br>";const L=N.attributes;for(;L[0];)N.removeAttribute(L[0].name)}else{const L=r.createElement(s.defaultTag);L.innerHTML="<br>",N.parentElement.replaceChild(L,N)}return d.nativeFocus(),!1}}const M=x.startContainer;if(N&&!N.previousElementSibling&&x.startOffset===0&&M.nodeType===3&&!r.isFormatElement(M.parentNode)){let L=M.parentNode.previousSibling;const U=M.parentNode.nextSibling;L||(U?L=U:(L=r.createElement("BR"),N.appendChild(L)));let P=M;for(;N.contains(P)&&!P.previousSibling;)P=P.parentNode;if(!N.contains(P)){M.textContent="",r.removeItemAllParents(M,null,N);break}}if(h._isUneditableNode(x,!0)){c.preventDefault(),c.stopPropagation();break}!E&&d._isEdgeFormat(x.startContainer,x.startOffset,"start")&&r.isFormatElement(N.previousElementSibling)&&(d._formatAttrsTemp=N.previousElementSibling.attributes);const A=x.commonAncestorContainer;if(N=r.getFormatElement(x.startContainer,null),T=r.getRangeFormatElement(N,null),T&&N&&!r.isCell(T)&&!/^FIGCAPTION$/i.test(T.nodeName)){if(r.isListCell(N)&&r.isList(T)&&(r.isListCell(T.parentNode)||N.previousElementSibling)&&(u===N||u.nodeType===3&&(!u.previousSibling||r.isList(u.previousSibling)))&&(r.getFormatElement(x.startContainer,null)!==r.getFormatElement(x.endContainer,null)?T.contains(x.startContainer):x.startOffset===0&&x.collapsed)){if(x.startContainer!==x.endContainer)c.preventDefault(),d.removeNode(),x.startContainer.nodeType===3&&d.setRange(x.startContainer,x.startContainer.textContent.length,x.startContainer,x.startContainer.textContent.length),d.history.push(!0);else{let L=N.previousElementSibling||T.parentNode;if(r.isListCell(L)){c.preventDefault();let U=L;if(!L.contains(N)&&r.isListCell(U)&&r.isList(U.lastElementChild)){for(U=U.lastElementChild.lastElementChild;r.isListCell(U)&&r.isList(U.lastElementChild);)U=U.lastElementChild&&U.lastElementChild.lastElementChild;L=U}let P=L===T.parentNode?T.previousSibling:L.lastChild;P||(P=r.createTextNode(r.zeroWidthSpace),T.parentNode.insertBefore(P,T.parentNode.firstChild));const W=P.nodeType===3?P.textContent.length:1,Q=N.childNodes;let V=P,X=Q[0];for(;X=Q[0];)L.insertBefore(X,V.nextSibling),V=X;r.removeItem(N),T.children.length===0&&r.removeItem(T),d.setRange(P,W,P,W),d.history.push(!0)}}break}if(!E&&x.startOffset===0){let L=!0,U=A;for(;U&&U!==T&&!r.isWysiwygDiv(U);){if(U.previousSibling&&(U.previousSibling.nodeType===1||!r.onlyZeroWidthSpace(U.previousSibling.textContent.trim()))){L=!1;break}U=U.parentNode}if(L&&T.parentNode){c.preventDefault(),d.detachRangeFormatElement(T,r.isListCell(N)?[N]:null,null,!1,!1),d.history.push(!0);break}}}if(!E&&N&&(x.startOffset===0||u===N&&N.childNodes[x.startOffset])){const L=r.isListCell(N),U=u===N?N.childNodes[x.startOffset]:u,P=L?U.previousSibling:N.previousSibling,W=L||(A.nodeType===3||r.isBreak(A))&&!A.previousSibling&&x.startOffset===0;if(U&&(L||!U.previousSibling)&&(A&&r.isComponent(A.previousSibling)||W&&r.isComponent(P))){const Q=d.getFileComponent(P);Q?(c.preventDefault(),c.stopPropagation(),L?r.removeItem(U):N.textContent.length===0&&r.removeItem(N),d.selectComponent(Q.target,Q.pluginName)===!1&&d.blur()):r.isComponent(P)&&(c.preventDefault(),c.stopPropagation(),r.removeItem(P));break}if(U&&r.isNonEditable(U.previousSibling)){c.preventDefault(),c.stopPropagation(),r.removeItem(U.previousSibling);break}}break;case 46:if(k){c.preventDefault(),c.stopPropagation(),d.plugins[k].destroy.call(d);break}if(E&&h._hardDelete()){c.preventDefault(),c.stopPropagation();break}if(!E&&d._isEdgeFormat(x.endContainer,x.endOffset,"end")&&!N.nextSibling){c.preventDefault(),c.stopPropagation();return}if(h._isUneditableNode(x,!1)){c.preventDefault(),c.stopPropagation();break}if((r.isFormatElement(u)||u.nextSibling===null||r.onlyZeroWidthSpace(u.nextSibling)&&u.nextSibling.nextSibling===null)&&x.startOffset===u.textContent.length){const L=N.nextElementSibling;if(!L)break;if(r.isComponent(L)){if(c.preventDefault(),r.onlyZeroWidthSpace(N)&&(r.removeItem(N),r.isTable(L))){let P=r.getChildElement(L,r.isCell,!1);P=P.firstElementChild||P,d.setRange(P,0,P,0);break}const U=d.getFileComponent(L);U?(c.stopPropagation(),d.selectComponent(U.target,U.pluginName)===!1&&d.blur()):r.isComponent(L)&&(c.stopPropagation(),r.removeItem(L));break}}if(!E&&(d.isEdgePoint(x.endContainer,x.endOffset)||u===N&&N.childNodes[x.startOffset])){const L=u===N&&N.childNodes[x.startOffset]||u;if(L&&r.isNonEditable(L.nextSibling)){c.preventDefault(),c.stopPropagation(),r.removeItem(L.nextSibling);break}else if(r.isComponent(L)){c.preventDefault(),c.stopPropagation(),r.removeItem(L);break}}if(!E&&d._isEdgeFormat(x.endContainer,x.endOffset,"end")&&r.isFormatElement(N.nextElementSibling)&&(d._formatAttrsTemp=N.attributes),N=r.getFormatElement(x.startContainer,null),T=r.getRangeFormatElement(N,null),r.isListCell(N)&&r.isList(T)&&(u===N||u.nodeType===3&&(!u.nextSibling||r.isList(u.nextSibling))&&(r.getFormatElement(x.startContainer,null)!==r.getFormatElement(x.endContainer,null)?T.contains(x.endContainer):x.endOffset===u.textContent.length&&x.collapsed))){x.startContainer!==x.endContainer&&d.removeNode();let L=r.getArrayItem(N.children,r.isList,!1);if(L=L||N.nextElementSibling||(T.parentNode?T.parentNode.nextElementSibling:null),L&&(r.isList(L)||r.getArrayItem(L.children,r.isList,!1))){c.preventDefault();let U,P;if(r.isList(L)){const W=L.firstElementChild;for(P=W.childNodes,U=P[0];P[0];)N.insertBefore(P[0],L);r.removeItem(W)}else{for(U=L.firstChild,P=L.childNodes;P[0];)N.appendChild(P[0]);r.removeItem(L)}d.setRange(U,0,U,0),d.history.push(!0)}break}break;case 9:if(k||s.tabDisable||(c.preventDefault(),y||w||r.isWysiwygDiv(u)))break;const D=!x.collapsed||d.isEdgePoint(x.startContainer,x.startOffset),$=d.getSelectedElements(null);u=d.getSelectionNode();const H=[];let j=[],F=r.isListCell($[0]),z=r.isListCell($[$.length-1]),O={sc:x.startContainer,so:x.startOffset,ec:x.endContainer,eo:x.endOffset};for(let L=0,U=$.length,P;L<U;L++)if(P=$[L],r.isListCell(P)){if(!P.previousElementSibling&&!v)continue;H.push(P)}else j.push(P);if(H.length>0&&D&&d.plugins.list)O=d.plugins.list.editInsideList.call(d,v,H);else{const L=r.getParentElement(u,r.isCell);if(L&&D){const U=r.getParentElement(L,"table"),P=r.getListChildren(U,r.isCell);let W=v?r.prevIdx(P,L):r.nextIdx(P,L);W===P.length&&!v&&(W=0),W===-1&&v&&(W=P.length-1);let Q=P[W];if(!Q)break;Q=Q.firstElementChild||Q,d.setRange(Q,0,Q,0);break}j=j.concat(H),F=z=null}if(j.length>0)if(v){const L=j.length-1;for(let W=0,Q;W<=L;W++){Q=j[W].childNodes;for(let V=0,X=Q.length,Z;V<X&&(Z=Q[V],!!Z);V++)if(!r.onlyZeroWidthSpace(Z)){/^\s{1,4}$/.test(Z.textContent)?r.removeItem(Z):/^\s{1,4}/.test(Z.textContent)&&(Z.textContent=Z.textContent.replace(/^\s{1,4}/,""));break}}const U=r.getChildElement(j[0],"text",!1),P=r.getChildElement(j[L],"text",!0);!F&&U&&(O.sc=U,O.so=0),!z&&P&&(O.ec=P,O.eo=P.textContent.length)}else{const L=r.createTextNode(new a.Array(d._variable.tabSize+1).join(" "));if(j.length===1){if(!d.insertNode(L,null,!0))return!1;F||(O.sc=L,O.so=L.length),z||(O.ec=L,O.eo=L.length)}else{const U=j.length-1;for(let Q=0,V;Q<=U;Q++)V=j[Q].firstChild,V&&(r.isBreak(V)?j[Q].insertBefore(L.cloneNode(!1),V):V.textContent=L.textContent+V.textContent);const P=r.getChildElement(j[0],"text",!1),W=r.getChildElement(j[U],"text",!0);!F&&P&&(O.sc=P,O.so=0),!z&&W&&(O.ec=W,O.eo=W.textContent.length)}}d.setRange(O.sc,O.so,O.ec,O.eo),d.history.push(!1);break;case 13:const B=r.getFreeFormatElement(u,null);if(d._charTypeHTML){let L="";if(!v&&B||v?L="<br>":L="<"+N.nodeName+"><br></"+N.nodeName+">",!d.checkCharCount(L,"byte-html"))return c.preventDefault(),!1}if(!v&&!k){const L=d._isEdgeFormat(x.endContainer,x.endOffset,"end"),U=d._isEdgeFormat(x.startContainer,x.startOffset,"start");if(L&&(/^H[1-6]$/i.test(N.nodeName)||/^HR$/i.test(N.nodeName))){h._enterPrevent(c);let P=null;const W=d.appendFormatTag(N,s.defaultTag);if(L&&L.length>0){P=L.pop();const Q=P;for(;L.length>0;)P=P.appendChild(L.pop());W.appendChild(Q)}if(P=P?P.appendChild(W.firstChild):W.firstChild,r.isBreak(P)){const Q=r.createTextNode(r.zeroWidthSpace);P.parentNode.insertBefore(Q,P),d.setRange(Q,1,Q,1)}else d.setRange(P,0,P,0);break}else if(T&&N&&!r.isCell(T)&&!/^FIGCAPTION$/i.test(T.nodeName)){const P=d.getRange();if(d.isEdgePoint(P.endContainer,P.endOffset)&&r.isList(u.nextSibling)){h._enterPrevent(c);const W=r.createElement("LI"),Q=r.createElement("BR");W.appendChild(Q),N.parentNode.insertBefore(W,N.nextElementSibling),W.appendChild(u.nextSibling),d.setRange(Q,1,Q,1);break}if((P.commonAncestorContainer.nodeType!==3||!P.commonAncestorContainer.nextElementSibling)&&r.onlyZeroWidthSpace(N.innerText.trim())&&!r.isListCell(N.nextElementSibling)){h._enterPrevent(c);let W=null;if(r.isListCell(T.parentNode)){const Q=N.parentNode.parentNode;T=Q.parentNode;const V=r.createElement("LI");V.innerHTML="<br>",r.copyTagAttributes(V,N,s.lineAttrReset),W=V,T.insertBefore(W,Q.nextElementSibling)}else{const Q=r.isCell(T.parentNode)?"DIV":r.isList(T.parentNode)?"LI":r.isFormatElement(T.nextElementSibling)&&!r.isRangeFormatElement(T.nextElementSibling)?T.nextElementSibling.nodeName:r.isFormatElement(T.previousElementSibling)&&!r.isRangeFormatElement(T.previousElementSibling)?T.previousElementSibling.nodeName:s.defaultTag;W=r.createElement(Q),r.copyTagAttributes(W,N,s.lineAttrReset);const V=d.detachRangeFormatElement(T,[N],null,!0,!0);V.cc.insertBefore(W,V.ec)}W.innerHTML="<br>",r.removeItemAllParents(N,null,null),d.setRange(W,1,W,1);break}}if(B){h._enterPrevent(c);const P=u===B,W=d.getSelection(),Q=u.childNodes,V=W.focusOffset,X=u.previousElementSibling,Z=u.nextSibling;if(!r.isClosureFreeFormatElement(B)&&Q&&(P&&x.collapsed&&Q.length-1<=V+1&&r.isBreak(Q[V])&&(!Q[V+1]||(!Q[V+2]||r.onlyZeroWidthSpace(Q[V+2].textContent))&&Q[V+1].nodeType===3&&r.onlyZeroWidthSpace(Q[V+1].textContent))&&V>0&&r.isBreak(Q[V-1])||!P&&r.onlyZeroWidthSpace(u.textContent)&&r.isBreak(X)&&(r.isBreak(X.previousSibling)||!r.onlyZeroWidthSpace(X.previousSibling.textContent))&&(!Z||!r.isBreak(Z)&&r.onlyZeroWidthSpace(Z.textContent)))){P?r.removeItem(Q[V-1]):r.removeItem(u);const G=d.appendFormatTag(B,r.isFormatElement(B.nextElementSibling)&&!r.isRangeFormatElement(B.nextElementSibling)?B.nextElementSibling:null);r.copyFormatAttributes(G,B),d.setRange(G,1,G,1);break}if(P){b.insertHTML(x.collapsed&&r.isBreak(x.startContainer.childNodes[x.startOffset-1])?"<br>":"<br><br>",!0,!1);let G=W.focusNode;const J=W.focusOffset;B===G&&(G=G.childNodes[J-V>1?J-1:J]),d.setRange(G,1,G,1)}else{const G=W.focusNode.nextSibling,J=r.createElement("BR");d.insertNode(J,null,!1);const ee=J.previousSibling,se=J.nextSibling;!r.isBreak(G)&&!r.isBreak(ee)&&(!se||r.onlyZeroWidthSpace(se))?(J.parentNode.insertBefore(J.cloneNode(!1),J),d.setRange(J,1,J,1)):d.setRange(se,0,se,0)}h._onShortcutKey=!0;break}if(x.collapsed&&(U||L)){h._enterPrevent(c);const P=r.createElement("BR"),W=r.createElement(N.nodeName);r.copyTagAttributes(W,N,s.lineAttrReset);let Q=P;do{if(!r.isBreak(u)&&u.nodeType===1){const V=u.cloneNode(!1);V.appendChild(Q),Q=V}u=u.parentNode}while(N!==u&&N.contains(u));W.appendChild(Q),N.parentNode.insertBefore(W,U&&!L?N:N.nextElementSibling),L&&d.setRange(P,1,P,1);break}if(N){c.stopPropagation();let P,W=0;if(x.collapsed)r.onlyZeroWidthSpace(N)?P=d.appendFormatTag(N,N.cloneNode(!1)):P=r.splitElement(x.endContainer,x.endOffset,r.getElementDepth(N));else{const Q=r.getFormatElement(x.startContainer,null)!==r.getFormatElement(x.endContainer,null),V=N.cloneNode(!1);V.innerHTML="<br>";const X=x.commonAncestorContainer,Z=X===x.startContainer&&X===x.endContainer&&r.onlyZeroWidthSpace(X)?x:d.removeNode();if(P=r.getFormatElement(Z.container,null),!P){r.isWysiwygDiv(Z.container)&&(h._enterPrevent(c),e.element.wysiwyg.appendChild(V),P=V,r.copyTagAttributes(P,N,s.lineAttrReset),d.setRange(P,W,P,W));break}const G=r.getRangeFormatElement(Z.container);if(P=P.contains(G)?r.getChildElement(G,r.getFormatElement.bind(r)):P,Q){if(L&&!U)P.parentNode.insertBefore(V,!Z.prevContainer||Z.container===Z.prevContainer?P.nextElementSibling:P),P=V,W=0;else if(W=Z.offset,U){const J=P.parentNode.insertBefore(V,P);L&&(P=J,W=0)}}else L&&U?(P.parentNode.insertBefore(V,Z.prevContainer&&Z.container===Z.prevContainer?P.nextElementSibling:P),P=V,W=0):P=r.splitElement(Z.container,Z.offset,r.getElementDepth(N))}h._enterPrevent(c),r.copyTagAttributes(P,N,s.lineAttrReset),d.setRange(P,W,P,W);break}}if(E)break;if(T&&r.getParentElement(T,"FIGCAPTION")&&r.getParentElement(T,r.isList)&&(h._enterPrevent(c),N=d.appendFormatTag(N,null),d.setRange(N,0,N,0)),k){c.preventDefault(),c.stopPropagation(),d.containerOff(),d.controllersOff();const L=e[k],U=L._container,P=U.previousElementSibling||U.nextElementSibling;let W=null;r.isListCell(U.parentNode)?W=r.createElement("BR"):(W=r.createElement(r.isFormatElement(P)&&!r.isRangeFormatElement(P)?P.nodeName:s.defaultTag),W.innerHTML="<br>"),v?U.parentNode.insertBefore(W,U):U.parentNode.insertBefore(W,U.nextElementSibling),d.callPlugin(k,function(){d.selectComponent(L._element,k)===!1&&d.blur()},null)}break;case 27:if(k)return c.preventDefault(),c.stopPropagation(),d.controllersOff(),!1;break}if(d.currentFileComponentInfo&&d.controllersOff(),v&&p===16){c.preventDefault(),c.stopPropagation();const M=d.plugins.table;if(M&&!M._shift&&!M._ref){const A=r.getParentElement(N,r.isCell);if(A){M.onTableCellMultiSelect.call(d,A,!0);return}}}else if(v&&(r.isOSX_IOS?w:y)&&p===32){c.preventDefault(),c.stopPropagation();const M=d.insertNode(r.createTextNode(" "));if(M){d.setRange(M,M.length,M,M.length);return}}if(r.isIE&&!y&&!w&&!E&&!h._nonTextKeyCode.test(p)&&r.isBreak(x.commonAncestorContainer)){const M=r.createTextNode(r.zeroWidthSpace);d.insertNode(M,null,!1),d.setRange(M,1,M,1)}h._directionKeyCode.test(p)&&(a.setTimeout(d._editorRange.bind(d),0),h._applyTagEffects())}},_onKeyDown_wysiwyg_arrowKey:function(c){if(c.shiftKey)return;let u=d.getSelectionNode();const p=function(w,x){if(x||(x=0),c.preventDefault(),c.stopPropagation(),!w)return;let E=d.getFileComponent(w);E?d.selectComponent(E.target,E.pluginName):(d.setRange(w,x,w,x),d.controllersOff())},v=r.getParentElement(u,"table");if(v){const w=r.getParentElement(u,"tr"),x=r.getParentElement(u,"td");let E=x,k=x;if(x){for(;E&&E.firstChild;)E=E.firstChild;for(;k&&k.lastChild;)k=k.lastChild}let N=u;for(;N&&N.firstChild;)N=N.firstChild;const T=N===E,R=N===k;let M=null,A=0;if(c.keyCode===38&&T){const D=w&&w.previousElementSibling;for(D?M=D.children[x.cellIndex]:M=r.getPreviousDeepestNode(v,d.context.element.wysiwyg);M&&M.lastChild;)M=M.lastChild;M&&(A=M.textContent.length)}else if(c.keyCode===40&&R){const D=w&&w.nextElementSibling;for(D?M=D.children[x.cellIndex]:M=r.getNextDeepestNode(v,d.context.element.wysiwyg);M&&M.firstChild;)M=M.firstChild}if(M)return p(M,A),!1}const y=d.getFileComponent(u);if(y){const w=/37|38/.test(c.keyCode),x=/39|40/.test(c.keyCode);if(w){const E=r.getPreviousDeepestNode(y.target,d.context.element.wysiwyg);p(E,E&&E.textContent.length)}else if(x){const E=r.getNextDeepestNode(y.target,d.context.element.wysiwyg);p(E)}}},onKeyUp_wysiwyg:function(c){if(h._onShortcutKey)return;d._editorRange();const u=c.keyCode,p=c.ctrlKey||c.metaKey||u===91||u===92||u===224,v=c.altKey;if(d.isReadOnly){!p&&h._cursorMoveKeyCode.test(u)&&h._applyTagEffects();return}const y=d.getRange();let w=d.getSelectionNode();if(d._isBalloon&&(d._isBalloonAlways&&u!==27||!y.collapsed))if(d._isBalloonAlways)u!==27&&h._showToolbarBalloonDelay();else{h._showToolbarBalloon();return}let x=w;for(;x&&x.firstChild;)x=x.firstChild;const E=d.getFileComponent(x);if(!(c.keyCode===16||c.shiftKey)&&E&&d.selectComponent(E.target,E.pluginName),u===8&&r.isWysiwygDiv(w)&&w.textContent===""&&w.children.length===0){c.preventDefault(),c.stopPropagation(),w.innerHTML="";const M=r.createElement(r.isFormatElement(d._variable.currentNodes[0])?d._variable.currentNodes[0]:s.defaultTag);M.innerHTML="<br>",w.appendChild(M),d.setRange(M,0,M,0),h._applyTagEffects(),d.history.push(!1);return}const k=r.getFormatElement(w,null),N=r.getRangeFormatElement(w,null),T=d._formatAttrsTemp;if(T){for(let M=0,A=T.length;M<A;M++){if(u===13&&/^id$/i.test(T[M].name)){k.removeAttribute("id");continue}k.setAttribute(T[M].name,T[M].value)}d._formatAttrsTemp=null}if(!k&&y.collapsed&&!r.isComponent(w)&&!r.isList(w)&&d._setDefaultFormat(r.isRangeFormatElement(N)?"DIV":s.defaultTag)!==null&&(w=d.getSelectionNode()),!p&&!v&&!h._nonTextKeyCode.test(u)&&w.nodeType===3&&r.zeroWidthRegExp.test(w.textContent)&&!(c.isComposing!==void 0?c.isComposing:h._IEisComposing)){let M=y.startOffset,A=y.endOffset;const D=(w.textContent.substring(0,A).match(h._frontZeroWidthReg)||"").length;M=y.startOffset-D,A=y.endOffset-D,w.textContent=w.textContent.replace(r.zeroWidthRegExp,""),d.setRange(w,M<0?0:M,w,A<0?0:A)}h._deleteKeyCode.test(u)&&k&&r.onlyZeroWidthSpace(k.textContent)&&!k.previousElementSibling&&(k.innerHTML="<br>",d.setRange(k,0,k,0)),d._charCount(""),!(typeof b.onKeyUp=="function"&&b.onKeyUp(c,d)===!1)&&!p&&!v&&!h._historyIgnoreKeyCode.test(u)&&d.history.push(!0)},onScroll_wysiwyg:function(c){d.controllersOff(),d._isBalloon&&h._hideToolbar(),typeof b.onScroll=="function"&&b.onScroll(c,d)},onFocus_wysiwyg:function(c){d._antiBlur||(d.hasFocus=!0,a.setTimeout(h._applyTagEffects),d._isInline&&h._showToolbarInline(),typeof b.onFocus=="function"&&b.onFocus(c,d))},onBlur_wysiwyg:function(c){d._antiBlur||d._variable.isCodeView||(d.hasFocus=!1,d.effectNode=null,d.controllersOff(),(d._isInline||d._isBalloon)&&h._hideToolbar(),d._setKeyEffect([]),d._variable.currentNodes=[],d._variable.currentNodesMap=[],s.showPathLabel&&(e.element.navigation.textContent=""),typeof b.onBlur=="function"&&b.onBlur(c,d,this))},onMouseDown_resizingBar:function(c){c.stopPropagation(),d.submenuOff(),d.controllersOff(),d._variable.resizeClientY=c.clientY,e.element.resizeBackground.style.display="block";function u(){e.element.resizeBackground.style.display="none",l.removeEventListener("mousemove",h._resize_editor),l.removeEventListener("mouseup",u)}l.addEventListener("mousemove",h._resize_editor),l.addEventListener("mouseup",u)},_resize_editor:function(c){const u=e.element.editorArea.offsetHeight+(c.clientY-d._variable.resizeClientY),p=u<d._variable.minResizingSize?d._variable.minResizingSize:u;e.element.wysiwygFrame.style.height=e.element.code.style.height=p+"px",d._variable.resizeClientY=c.clientY,r.isResizeObserverSupported||d.__callResizeFunction(p,null)},onResize_window:function(){r.isResizeObserverSupported||d.resetResponsiveToolbar();const c=e.element.toolbar,u=c.style.display==="none"||d._isInline&&!d._inlineToolbarAttr.isShow;if(!(c.offsetWidth===0&&!u)){if(e.fileBrowser&&e.fileBrowser.area.style.display==="block"&&(e.fileBrowser.body.style.maxHeight=a.innerHeight-e.fileBrowser.header.offsetHeight-50+"px"),d.submenuActiveButton&&d.submenu&&d._setMenuPosition(d.submenuActiveButton,d.submenu),d._variable.isFullScreen){d._variable.innerHeight_fullScreen+=a.innerHeight-c.offsetHeight-d._variable.innerHeight_fullScreen,e.element.editorArea.style.height=d._variable.innerHeight_fullScreen+"px";return}if(d._variable.isCodeView&&d._isInline){h._showToolbarInline();return}d._iframeAutoHeight(),d._sticky&&(c.style.width=e.element.topArea.offsetWidth-2+"px",h.onScroll_window())}},onScroll_window:function(){if(d._variable.isFullScreen||e.element.toolbar.offsetWidth===0||s.stickyToolbar<0)return;const c=e.element,u=c.editorArea.offsetHeight,p=(this.scrollY||l.documentElement.scrollTop)+s.stickyToolbar,v=h._getEditorOffsets(s.toolbarContainer).top-(d._isInline?c.toolbar.offsetHeight:0),y=d._isInline&&p-v>0?p-v-e.element.toolbar.offsetHeight:0;p<v?h._offStickyToolbar():p+d._variable.minResizingSize>=u+v?(d._sticky||h._onStickyToolbar(y),c.toolbar.style.top=y+u+v+s.stickyToolbar-p-d._variable.minResizingSize+"px"):p>=v&&h._onStickyToolbar(y)},_getEditorOffsets:function(c){let u=c||e.element.topArea,p=0,v=0,y=0;for(;u;)p+=u.offsetTop,v+=u.offsetLeft,y+=u.scrollTop,u=u.offsetParent;return{top:p,left:v,scroll:y}},_getPageBottomSpace:function(){return l.documentElement.scrollHeight-(h._getEditorOffsets(null).top+e.element.topArea.offsetHeight)},_onStickyToolbar:function(c){const u=e.element;!d._isInline&&!s.toolbarContainer&&(u._stickyDummy.style.height=u.toolbar.offsetHeight+"px",u._stickyDummy.style.display="block"),u.toolbar.style.top=s.stickyToolbar+c+"px",u.toolbar.style.width=d._isInline?d._inlineToolbarAttr.width:u.toolbar.offsetWidth+"px",r.addClass(u.toolbar,"se-toolbar-sticky"),d._sticky=!0},_offStickyToolbar:function(){const c=e.element;c._stickyDummy.style.display="none",c.toolbar.style.top=d._isInline?d._inlineToolbarAttr.top:"",c.toolbar.style.width=d._isInline?d._inlineToolbarAttr.width:"",c.editorArea.style.marginTop="",r.removeClass(c.toolbar,"se-toolbar-sticky"),d._sticky=!1},_codeViewAutoHeight:function(){d._variable.isFullScreen||(e.element.code.style.height=e.element.code.scrollHeight+"px")},_hardDelete:function(){const c=d.getRange(),u=c.startContainer,p=c.endContainer,v=r.getRangeFormatElement(u),y=r.getRangeFormatElement(p),w=r.isCell(v),x=r.isCell(y),E=c.commonAncestorContainer;if((w&&!v.previousElementSibling&&!v.parentElement.previousElementSibling||x&&!y.nextElementSibling&&!y.parentElement.nextElementSibling)&&v!==y)if(!w)r.removeItem(r.getParentElement(y,function(T){return E===T.parentNode}));else if(!x)r.removeItem(r.getParentElement(v,function(T){return E===T.parentNode}));else return r.removeItem(r.getParentElement(v,function(T){return E===T.parentNode})),d.nativeFocus(),!0;const k=u.nodeType===1?r.getParentElement(u,".se-component"):null,N=p.nodeType===1?r.getParentElement(p,".se-component"):null;return k&&r.removeItem(k),N&&r.removeItem(N),!1},onPaste_wysiwyg:function(c){const u=r.isIE?a.clipboardData:c.clipboardData;return u?h._dataTransferAction("paste",c,u):!0},_setClipboardComponent:function(c,u,p){c.preventDefault(),c.stopPropagation(),p.setData("text/html",u.component.outerHTML)},onCopy_wysiwyg:function(c){const u=r.isIE?a.clipboardData:c.clipboardData;if(typeof b.onCopy=="function"&&b.onCopy(c,u,d)===!1)return c.preventDefault(),c.stopPropagation(),!1;const p=d.currentFileComponentInfo;p&&!r.isIE&&(h._setClipboardComponent(c,p,u),r.addClass(p.component,"se-component-copy"),a.setTimeout(function(){r.removeClass(p.component,"se-component-copy")},150))},onSave_wysiwyg:function(c){if(typeof b.onSave=="function"){b.onSave(c,d);return}},onCut_wysiwyg:function(c){const u=r.isIE?a.clipboardData:c.clipboardData;if(typeof b.onCut=="function"&&b.onCut(c,u,d)===!1)return c.preventDefault(),c.stopPropagation(),!1;const p=d.currentFileComponentInfo;p&&!r.isIE&&(h._setClipboardComponent(c,p,u),r.removeItem(p.component),d.controllersOff()),a.setTimeout(function(){d.history.push(!1)})},onDrop_wysiwyg:function(c){if(d.isReadOnly||r.isIE)return c.preventDefault(),c.stopPropagation(),!1;const u=c.dataTransfer;return u?(h._setDropLocationSelection(c),d.removeNode(),document.body.contains(d.currentControllerTarget)||d.controllersOff(),h._dataTransferAction("drop",c,u)):!0},_setDropLocationSelection:function(c){const u={startContainer:null,startOffset:null,endContainer:null,endOffset:null};let p=null;if(c.rangeParent?(u.startContainer=c.rangeParent,u.startOffset=c.rangeOffset,u.endContainer=c.rangeParent,u.endOffset=c.rangeOffset):d._wd.caretRangeFromPoint?p=d._wd.caretRangeFromPoint(c.clientX,c.clientY):p=d.getRange(),p&&(u.startContainer=p.startContainer,u.startOffset=p.startOffset,u.endContainer=p.endContainer,u.endOffset=p.endOffset),u.startContainer===u.endContainer){const v=r.getParentElement(u.startContainer,r.isComponent);v&&(u.startContainer=v,u.startOffset=0,u.endContainer=v,u.endOffset=0)}d.setRange(u.startContainer,u.startOffset,u.endContainer,u.endOffset)},_dataTransferAction:function(c,u,p){let v,y;if(r.isIE){v=p.getData("Text");const w=d.getRange(),x=r.createElement("DIV"),E={sc:w.startContainer,so:w.startOffset,ec:w.endContainer,eo:w.endOffset};return x.setAttribute("contenteditable",!0),x.style.cssText="position:absolute; top:0; left:0; width:1px; height:1px; overflow:hidden;",e.element.relative.appendChild(x),x.focus(),a.setTimeout(function(){y=x.innerHTML,r.removeItem(x),d.setRange(E.sc,E.so,E.ec,E.eo),h._setClipboardData(c,u,v,y,p)}),!0}else if(v=p.getData("text/plain"),y=p.getData("text/html"),h._setClipboardData(c,u,v,y,p)===!1)return u.preventDefault(),u.stopPropagation(),!1},_setClipboardData:function(c,u,p,v,y){const w=/class=["']*Mso(Normal|List)/i.test(v)||/content=["']*Word.Document/i.test(v)||/content=["']*OneNote.File/i.test(v)||/content=["']*Excel.Sheet/i.test(v);!v?v=r._HTMLConvertor(p).replace(/\n/g,"<br>"):(v=v.replace(/^<html>\r?\n?<body>\r?\n?\x3C!--StartFragment--\>|\x3C!--EndFragment-->\r?\n?<\/body\>\r?\n?<\/html>$/g,""),w&&(v=v.replace(/\n/g," "),p=p.replace(/\n/g," ")),v=d.cleanHTML(v,d.pasteTagsWhitelistRegExp,d.pasteTagsBlacklistRegExp));const E=d._charCount(d._charTypeHTML?v:p);if(c==="paste"&&typeof b.onPaste=="function"){const N=b.onPaste(u,v,E,d);if(N===!1)return!1;if(typeof N=="string"){if(!N)return!1;v=N}}if(c==="drop"&&typeof b.onDrop=="function"){const N=b.onDrop(u,v,E,d);if(N===!1)return!1;if(typeof N=="string"){if(!N)return!1;v=N}}const k=y.files;if(k.length>0&&!w)return/^image/.test(k[0].type)&&d.plugins.image&&b.insertImage(k),!1;if(!E)return!1;if(v)return b.insertHTML(v,!0,!1),!1},onMouseMove_wysiwyg:function(c){if(d.isDisabled||d.isReadOnly)return!1;const u=r.getParentElement(c.target,r.isComponent),p=d._lineBreaker.style;if(u&&!d.currentControllerName){const v=e.element;let y=0,w=v.wysiwyg;do y+=w.scrollTop,w=w.parentElement;while(w&&!/^(BODY|HTML)$/i.test(w.nodeName));const x=v.wysiwyg.scrollTop,E=h._getEditorOffsets(null),k=r.getOffset(u,v.wysiwygFrame).top+x,N=c.pageY+y+(s.iframe&&!s.toolbarContainer?v.toolbar.offsetHeight:0),T=k+(s.iframe?y:E.top),R=r.isListCell(u.parentNode);let M="",A="";if((R?!u.previousSibling:!r.isFormatElement(u.previousElementSibling))&&N<T+20)A=k,M="t";else if((R?!u.nextSibling:!r.isFormatElement(u.nextElementSibling))&&N>T+u.offsetHeight-20)A=k+u.offsetHeight,M="b";else{p.display="none";return}d._variable._lineBreakComp=u,d._variable._lineBreakDir=M,p.top=A-x+"px",d._lineBreakerButton.style.left=r.getOffset(u).left+u.offsetWidth/2-15+"px",p.display="block"}else p.display!=="none"&&(p.display="none")},_enterPrevent:function(c){c.preventDefault(),r.isMobile&&d.__focusTemp.focus()},_onMouseDown_lineBreak:function(c){c.preventDefault()},_onLineBreak:function(c){c.preventDefault();const u=d._variable._lineBreakComp,p=this?this:d._variable._lineBreakDir,v=r.isListCell(u.parentNode),y=r.createElement(v?"BR":r.isCell(u.parentNode)?"DIV":s.defaultTag);if(v||(y.innerHTML="<br>"),d._charTypeHTML&&!d.checkCharCount(y.outerHTML,"byte-html"))return;u.parentNode.insertBefore(y,p==="t"?u:u.nextSibling),d._lineBreaker.style.display="none",d._variable._lineBreakComp=null;const w=v?y:y.firstChild;d.setRange(w,1,w,1),d.history.push(!1)},_resizeObserver:null,_toolbarObserver:null,_addEvent:function(){const c=s.iframe?d._ww:e.element.wysiwyg;r.isResizeObserverSupported&&(this._resizeObserver=new a.ResizeObserver(function(u){d.__callResizeFunction(-1,u[0])})),e.element.toolbar.addEventListener("mousedown",h._buttonsEventHandler,!1),e.element._menuTray.addEventListener("mousedown",h._buttonsEventHandler,!1),e.element.toolbar.addEventListener("click",h.onClick_toolbar,!1),c.addEventListener("mousedown",h.onMouseDown_wysiwyg,!1),c.addEventListener("click",h.onClick_wysiwyg,!1),c.addEventListener(r.isIE?"textinput":"input",h.onInput_wysiwyg,!1),c.addEventListener("keydown",h.onKeyDown_wysiwyg,!1),c.addEventListener("keyup",h.onKeyUp_wysiwyg,!1),c.addEventListener("paste",h.onPaste_wysiwyg,!1),c.addEventListener("copy",h.onCopy_wysiwyg,!1),c.addEventListener("cut",h.onCut_wysiwyg,!1),c.addEventListener("drop",h.onDrop_wysiwyg,!1),c.addEventListener("scroll",h.onScroll_wysiwyg,!1),c.addEventListener("focus",h.onFocus_wysiwyg,!1),c.addEventListener("blur",h.onBlur_wysiwyg,!1),h._lineBreakerBind={a:h._onLineBreak.bind(""),t:h._onLineBreak.bind("t"),b:h._onLineBreak.bind("b")},c.addEventListener("mousemove",h.onMouseMove_wysiwyg,!1),d._lineBreakerButton.addEventListener("mousedown",h._onMouseDown_lineBreak,!1),d._lineBreakerButton.addEventListener("click",h._lineBreakerBind.a,!1),e.element.lineBreaker_t.addEventListener("mousedown",h._lineBreakerBind.t,!1),e.element.lineBreaker_b.addEventListener("mousedown",h._lineBreakerBind.b,!1),c.addEventListener("touchstart",h.onMouseDown_wysiwyg,{passive:!0,useCapture:!1}),c.addEventListener("touchend",h.onClick_wysiwyg,{passive:!0,useCapture:!1}),s.height==="auto"&&!s.codeMirrorEditor&&(e.element.code.addEventListener("keydown",h._codeViewAutoHeight,!1),e.element.code.addEventListener("keyup",h._codeViewAutoHeight,!1),e.element.code.addEventListener("paste",h._codeViewAutoHeight,!1)),e.element.resizingBar&&(/\d+/.test(s.height)&&s.resizeEnable?e.element.resizingBar.addEventListener("mousedown",h.onMouseDown_resizingBar,!1):r.addClass(e.element.resizingBar,"se-resizing-none")),h._setResponsiveToolbar(),r.isResizeObserverSupported&&(this._toolbarObserver=new a.ResizeObserver(d.resetResponsiveToolbar)),a.addEventListener("resize",h.onResize_window,!1),s.stickyToolbar>-1&&a.addEventListener("scroll",h.onScroll_window,!1)},_removeEvent:function(){const c=s.iframe?d._ww:e.element.wysiwyg;e.element.toolbar.removeEventListener("mousedown",h._buttonsEventHandler),e.element._menuTray.removeEventListener("mousedown",h._buttonsEventHandler),e.element.toolbar.removeEventListener("click",h.onClick_toolbar),c.removeEventListener("mousedown",h.onMouseDown_wysiwyg),c.removeEventListener("click",h.onClick_wysiwyg),c.removeEventListener(r.isIE?"textinput":"input",h.onInput_wysiwyg),c.removeEventListener("keydown",h.onKeyDown_wysiwyg),c.removeEventListener("keyup",h.onKeyUp_wysiwyg),c.removeEventListener("paste",h.onPaste_wysiwyg),c.removeEventListener("copy",h.onCopy_wysiwyg),c.removeEventListener("cut",h.onCut_wysiwyg),c.removeEventListener("drop",h.onDrop_wysiwyg),c.removeEventListener("scroll",h.onScroll_wysiwyg),c.removeEventListener("mousemove",h.onMouseMove_wysiwyg),d._lineBreakerButton.removeEventListener("mousedown",h._onMouseDown_lineBreak),d._lineBreakerButton.removeEventListener("click",h._lineBreakerBind.a),e.element.lineBreaker_t.removeEventListener("mousedown",h._lineBreakerBind.t),e.element.lineBreaker_b.removeEventListener("mousedown",h._lineBreakerBind.b),h._lineBreakerBind=null,c.removeEventListener("touchstart",h.onMouseDown_wysiwyg,{passive:!0,useCapture:!1}),c.removeEventListener("touchend",h.onClick_wysiwyg,{passive:!0,useCapture:!1}),c.removeEventListener("focus",h.onFocus_wysiwyg),c.removeEventListener("blur",h.onBlur_wysiwyg),e.element.code.removeEventListener("keydown",h._codeViewAutoHeight),e.element.code.removeEventListener("keyup",h._codeViewAutoHeight),e.element.code.removeEventListener("paste",h._codeViewAutoHeight),e.element.resizingBar&&e.element.resizingBar.removeEventListener("mousedown",h.onMouseDown_resizingBar),h._resizeObserver&&(h._resizeObserver.unobserve(e.element.wysiwygFrame),h._resizeObserver=null),h._toolbarObserver&&(h._toolbarObserver.unobserve(e.element._toolbarShadow),h._toolbarObserver=null),a.removeEventListener("resize",h.onResize_window),a.removeEventListener("scroll",h.onScroll_window)},_setResponsiveToolbar:function(){if(o.length===0){o=null;return}h._responsiveCurrentSize="default";const c=h._responsiveButtonSize=[],u=h._responsiveButtons={default:o[0]};for(let p=1,v=o.length,y,w;p<v;p++)w=o[p],y=w[0]*1,c.push(y),u[y]=w[1];c.sort(function(p,v){return p-v}).unshift("default")}},b={core:d,util:r,onload:null,onScroll:null,onMouseDown:null,onClick:null,onInput:null,onKeyDown:null,onKeyUp:null,onCopy:null,onCut:null,onFocus:null,onBlur:null,onChange:null,onSave:null,onDrop:null,onPaste:null,showInline:null,showController:null,toggleCodeView:null,toggleFullScreen:null,imageUploadHandler:null,videoUploadHandler:null,audioUploadHandler:null,onImageUploadBefore:null,onVideoUploadBefore:null,onAudioUploadBefore:null,onImageUpload:null,onVideoUpload:null,onAudioUpload:null,onImageUploadError:null,onVideoUploadError:null,onAudioUploadError:null,onResizeEditor:null,onSetToolbarButtons:null,setToolbarButtons:function(c){d.submenuOff(),d.containerOff(),d.moreLayerOff();const u=Zr._createToolBar(l,c,d.plugins,s);o=u.responsiveButtons,h._setResponsiveToolbar(),e.element.toolbar.replaceChild(u._buttonTray,e.element._buttonTray);const p=qr(e.element.originElement,d._getConstructed(e.element),s);e.element=p.element,e.tool=p.tool,s.iframe&&(e.element.wysiwyg=d._wd.body),d._recoverButtonStates(),d._cachingButtons(),d.history._resetCachingButton(),d.effectNode=null,d.hasFocus&&h._applyTagEffects(),d.isReadOnly&&r.setDisabledButtons(!0,d.resizingDisabledButtons),typeof b.onSetToolbarButtons=="function"&&b.onSetToolbarButtons(u._buttonTray.querySelectorAll("button"),d)},setOptions:function(c){h._removeEvent(),d._resetComponents(),r.removeClass(d._styleCommandMap.showBlocks,"active"),r.removeClass(d._styleCommandMap.codeView,"active"),d._variable.isCodeView=!1,d._iframeAuto=null,d.plugins=c.plugins||d.plugins;const u=[s,c].reduce(function(w,x){for(let E in x)if(r.hasOwn(x,E))if(E==="plugins"&&x[E]&&w[E]){let k=w[E],N=x[E];k=k.length?k:a.Object.keys(k).map(function(T){return k[T]}),N=N.length?N:a.Object.keys(N).map(function(T){return N[T]}),w[E]=N.filter(function(T){return k.indexOf(T)===-1}).concat(k)}else w[E]=x[E];return w},{}),p=e.element,v=p.wysiwyg.innerHTML,y=Zr._setOptions(u,e,s);y.callButtons&&(t=y.callButtons,d.initPlugins={}),y.plugins&&(d.plugins=n=y.plugins),p._menuTray.children.length===0&&(this._menuTray={}),o=y.toolbar.responsiveButtons,d.options=s=u,d.lang=i=s.lang,s.iframe&&p.wysiwygFrame.addEventListener("load",function(){r._setIframeDocument(this,s),d._setOptionsInit(p,v)}),p.editorArea.appendChild(p.wysiwygFrame),s.iframe||d._setOptionsInit(p,v)},setDefaultStyle:function(c){const u=s._editorStyles=r._setDefaultOptionStyle(s,c),p=e.element;p.topArea.style.cssText=u.top,p.code.style.cssText=s._editorStyles.frame,p.code.style.display="none",s.height==="auto"?p.code.style.overflow="hidden":p.code.style.overflow="",s.iframe?(p.wysiwygFrame.style.cssText=u.frame,p.wysiwyg.style.cssText=u.editor):p.wysiwygFrame.style.cssText=u.frame+u.editor},noticeOpen:function(c){d.notice.open.call(d,c)},noticeClose:function(){d.notice.close.call(d)},save:function(){const c=d.getContents(!1);e.element.originElement.value=c,h.onSave_wysiwyg(c,d)},getContext:function(){return e},getContents:function(c){return d.getContents(c)},getText:function(){return e.element.wysiwyg.textContent},getCharCount:function(c){return c=typeof c=="string"?c:s.charCounterType,d.getCharLength(d._charTypeHTML?e.element.wysiwyg.innerHTML:e.element.wysiwyg.textContent,c)},getImagesInfo:function(){return e.image?e.image._infoList:[]},getFilesInfo:function(c){return e[c]?e[c]._infoList:[]},insertImage:function(c){!d.plugins.image||!c||(d.initPlugins.image?d.plugins.image.submitAction.call(d,c):d.callPlugin("image",d.plugins.image.submitAction.bind(d,c),null),d.focus())},insertHTML:function(c,u,p,v){if(e.element.wysiwygFrame.contains(d.getSelection().focusNode)||d.focus(),typeof c=="string"){u||(c=d.cleanHTML(c,null,null));try{if(r.isListCell(r.getFormatElement(d.getSelectionNode(),null))){const A=l.createRange().createContextualFragment(c).childNodes;d._isFormatData(A)&&(c=d._convertListCell(A))}const w=l.createRange().createContextualFragment(c).childNodes;if(p){const M=d._charTypeHTML?"outerHTML":"textContent";let A="";for(let D=0,$=w.length;D<$;D++)A+=w[D][M];if(!d.checkCharCount(A,null))return}let x,E,k,N,T;for(;x=w[0];){if(N&&N.nodeType===3&&E&&E.nodeType===1&&r.isBreak(x)){N=x,r.removeItem(x);continue}k=d.insertNode(x,E,!1),E=k.container||k,T||(T=k),N=x}N.nodeType===3&&E.nodeType===1&&(E=N);const R=E.nodeType===3?k.endOffset||E.textContent.length:E.childNodes.length;v?d.setRange(T.container||T,T.startOffset||0,E,R):d.setRange(E,R,E,R)}catch(y){if(d.isDisabled||d.isReadOnly)return;console.warn("[SUNEDITOR.insertHTML.fail] "+y),d.execCommand("insertHTML",!1,c)}}else if(r.isComponent(c))d.insertComponent(c,!1,p,!1);else{let y=null;(r.isFormatElement(c)||r.isMedia(c))&&(y=r.getFormatElement(d.getSelectionNode(),null)),d.insertNode(c,y,p)}d.effectNode=null,d.focus(),d.history.push(!1)},setContents:function(c){d.setContents(c)},appendContents:function(c){const u=d.convertContentsForEditor(c);if(d._variable.isCodeView)d._setCodeView(d._getCodeView()+`
|
|
252
|
+
`+d.convertHTMLForCodeView(u,!1));else{const p=r.createElement("DIV");p.innerHTML=u;const v=e.element.wysiwyg,y=p.children;for(let w=0,x=y.length;w<x;w++)y[w]&&v.appendChild(y[w])}d.history.push(!1)},readOnly:function(c){d.isReadOnly=c,r.setDisabledButtons(!!c,d.resizingDisabledButtons),c?(d.controllersOff(),d.submenuActiveButton&&d.submenuActiveButton.disabled&&d.submenuOff(),d._moreLayerActiveButton&&d._moreLayerActiveButton.disabled&&d.moreLayerOff(),d.containerActiveButton&&d.containerActiveButton.disabled&&d.containerOff(),d.modalForm&&d.plugins.dialog.close.call(d),e.element.code.setAttribute("readOnly","true"),r.addClass(e.element.wysiwygFrame,"se-read-only")):(e.element.code.removeAttribute("readOnly"),r.removeClass(e.element.wysiwygFrame,"se-read-only")),s.codeMirrorEditor&&s.codeMirrorEditor.setOption("readOnly",!!c)},disable:function(){this.toolbar.disable(),this.wysiwyg.disable()},disabled:function(){this.disable()},enable:function(){this.toolbar.enable(),this.wysiwyg.enable()},enabled:function(){this.enable()},show:function(){const c=e.element.topArea.style;c.display==="none"&&(c.display=s.display)},hide:function(){e.element.topArea.style.display="none"},destroy:function(){d.submenuOff(),d.containerOff(),d.controllersOff(),d.notice&&d.notice.close.call(d),d.modalForm&&d.plugins.dialog.close.call(d),d.history._destroy(),h._removeEvent(),r.removeItem(e.element.toolbar),r.removeItem(e.element.topArea);for(let c in d.functions)r.hasOwn(d,c)&&delete d.functions[c];for(let c in d)r.hasOwn(d,c)&&delete d[c];for(let c in h)r.hasOwn(h,c)&&delete h[c];for(let c in e)r.hasOwn(e,c)&&delete e[c];for(let c in t)r.hasOwn(t,c)&&delete t[c];for(let c in this)r.hasOwn(this,c)&&delete this[c]},toolbar:{disable:function(){d.submenuOff(),d.moreLayerOff(),d.containerOff(),e.tool.cover.style.display="block"},disabled:function(){this.disable()},enable:function(){e.tool.cover.style.display="none"},enabled:function(){this.enable()},show:function(){d._isInline?h._showToolbarInline():(e.element.toolbar.style.display="",e.element._stickyDummy.style.display=""),h.onResize_window()},hide:function(){d._isInline?h._hideToolbar():(e.element.toolbar.style.display="none",e.element._stickyDummy.style.display="none"),h.onResize_window()}},wysiwyg:{disable:function(){d.controllersOff(),d.modalForm&&d.plugins.dialog.close.call(d),e.element.wysiwyg.setAttribute("contenteditable",!1),d.isDisabled=!0,s.codeMirrorEditor?s.codeMirrorEditor.setOption("readOnly",!0):e.element.code.setAttribute("disabled","disabled")},enable:function(){e.element.wysiwyg.setAttribute("contenteditable",!0),d.isDisabled=!1,s.codeMirrorEditor?s.codeMirrorEditor.setOption("readOnly",!1):e.element.code.removeAttribute("disabled")}}};d.functions=b,d.options=s;let _=e.element,C=_.originElement,S=_.topArea;return C.style.display="none",S.style.display="block",s.iframe&&_.wysiwygFrame.addEventListener("load",function(){r._setIframeDocument(this,s),d._editorInit(!1,s.value),s.value=null}),typeof C.nextElementSibling=="object"?C.parentNode.insertBefore(S,C.nextElementSibling):C.parentNode.appendChild(S),_.editorArea.appendChild(_.wysiwygFrame),_=C=S=null,s.iframe||(d._editorInit(!1,s.value),s.value=null),b}const MC={init:function(e){return{create:(function(t,n){return this.create(t,n,e)}).bind(this)}},create:function(e,t,n){pe._propertiesInit(),typeof t!="object"&&(t={}),n&&(t=[n,t].reduce(function(o,l){for(let a in l)if(pe.hasOwn(l,a))if(a==="plugins"&&l[a]&&o[a]){let r=o[a],f=l[a];r=r.length?r:Object.keys(r).map(function(d){return r[d]}),f=f.length?f:Object.keys(f).map(function(d){return f[d]}),o[a]=f.filter(function(d){return r.indexOf(d)===-1}).concat(r)}else o[a]=l[a];return o},{}));const i=typeof e=="string"?document.getElementById(e):e;if(!i)throw Error(typeof e=="string"?'[SUNEDITOR.create.fail] The element for that id was not found (ID:"'+e+'")':"[SUNEDITOR.create.fail] suneditor requires textarea's element or id value");const s=Zr.init(i,t);if(s.constructed._top.id&&document.getElementById(s.constructed._top.id))throw Error('[SUNEDITOR.create.fail] The ID of the suneditor you are trying to create already exists (ID:"'+s.constructed._top.id+'")');return TC(qr(i,s.constructed,s.options),s.pluginCallButtons,s.plugins,s.options.lang,t,s._responsiveButtons)}},AC={name:"blockquote",display:"command",add:function(e,t){const n=e.context;n.blockquote={targetButton:t,tag:e.util.createElement("BLOCKQUOTE")}},active:function(e){if(!e)this.util.removeClass(this.context.blockquote.targetButton,"active");else if(/blockquote/i.test(e.nodeName))return this.util.addClass(this.context.blockquote.targetButton,"active"),!0;return!1},action:function(){const e=this.util.getParentElement(this.getSelectionNode(),"blockquote");e?this.detachRangeFormatElement(e,null,null,!1,!1):this.applyRangeFormatElement(this.context.blockquote.tag.cloneNode(!1))}},RC={name:"align",display:"submenu",add:function(e,t){const n=e.icons,i=e.context;i.align={targetButton:t,_itemMenu:null,_alignList:null,currentAlign:"",defaultDir:e.options.rtl?"right":"left",icons:{justify:n.align_justify,left:n.align_left,right:n.align_right,center:n.align_center}};let s=this.setSubmenu(e),o=i.align._itemMenu=s.querySelector("ul");o.addEventListener("click",this.pickup.bind(e)),i.align._alignList=o.querySelectorAll("li button"),e.initMenuTarget(this.name,t,s),s=null,o=null},setSubmenu:function(e){const t=e.lang,n=e.icons,i=e.util.createElement("DIV"),s=e.options.alignItems;let o="";for(let l=0,a,r;l<s.length;l++)a=s[l],r=t.toolbar["align"+a.charAt(0).toUpperCase()+a.slice(1)],o+='<li><button type="button" class="se-btn-list se-btn-align" data-value="'+a+'" title="'+r+'" aria-label="'+r+'"><span class="se-list-icon">'+n["align_"+a]+"</span>"+r+"</button></li>";return i.className="se-submenu se-list-layer se-list-align",i.innerHTML='<div class="se-list-inner"><ul class="se-list-basic">'+o+"</ul></div>",i},active:function(e){const t=this.context.align,n=t.targetButton,i=n.firstElementChild;if(!e)this.util.changeElement(i,t.icons[t.defaultDir]),n.removeAttribute("data-focus");else if(this.util.isFormatElement(e)){const s=e.style.textAlign;if(s)return this.util.changeElement(i,t.icons[s]||t.icons[t.defaultDir]),n.setAttribute("data-focus",s),!0}return!1},on:function(){const e=this.context.align,t=e._alignList,n=e.targetButton.getAttribute("data-focus")||e.defaultDir;if(n!==e.currentAlign){for(let i=0,s=t.length;i<s;i++)n===t[i].getAttribute("data-value")?this.util.addClass(t[i],"active"):this.util.removeClass(t[i],"active");e.currentAlign=n}},exchangeDir:function(){const e=this.options.rtl?"right":"left";if(!this.context.align||this.context.align.defaultDir===e)return;this.context.align.defaultDir=e;let t=this.context.align._itemMenu,n=t.querySelector('[data-value="left"]'),i=t.querySelector('[data-value="right"]');if(n&&i){const s=n.parentElement,o=i.parentElement;s.appendChild(i),o.appendChild(n)}},pickup:function(e){e.preventDefault(),e.stopPropagation();let t=e.target,n=null;for(;!n&&!/UL/i.test(t.tagName);)n=t.getAttribute("data-value"),t=t.parentNode;if(!n)return;const i=this.context.align.defaultDir,s=this.getSelectedElements();for(let o=0,l=s.length;o<l;o++)this.util.setStyle(s[o],"textAlign",n===i?"":n);this.effectNode=null,this.submenuOff(),this.focus(),this.history.push(!1)}},DC={name:"font",display:"submenu",add:function(e,t){const n=e.context;n.font={targetText:t.querySelector(".txt"),targetTooltip:t.parentNode.querySelector(".se-tooltip-text"),_fontList:null,currentFont:""};let i=this.setSubmenu(e);i.querySelector(".se-list-inner").addEventListener("click",this.pickup.bind(e)),n.font._fontList=i.querySelectorAll("ul li button"),e.initMenuTarget(this.name,t,i),i=null},setSubmenu:function(e){const t=e.lang,n=e.util.createElement("DIV");n.className="se-submenu se-list-layer se-list-font-family";let i,s,o,l,a=e.options.font,r='<div class="se-list-inner"><ul class="se-list-basic"><li><button type="button" class="default_value se-btn-list" title="'+t.toolbar.default+'" aria-label="'+t.toolbar.default+'">('+t.toolbar.default+")</button></li>";for(o=0,l=a.length;o<l;o++)i=a[o],s=i.split(",")[0],r+='<li><button type="button" class="se-btn-list" data-value="'+i+'" data-txt="'+s+'" title="'+s+'" aria-label="'+s+'" style="font-family:'+i+';">'+s+"</button></li>";return r+="</ul></div>",n.innerHTML=r,n},active:function(e){const t=this.context.font.targetText,n=this.context.font.targetTooltip;if(e){if(e.style&&e.style.fontFamily.length>0){const i=e.style.fontFamily.replace(/["']/g,"");return this.util.changeTxt(t,i),this.util.changeTxt(n,this.lang.toolbar.font+" ("+i+")"),!0}}else{const i=this.hasFocus?this.wwComputedStyle.fontFamily:this.lang.toolbar.font;this.util.changeTxt(t,i),this.util.changeTxt(n,this.hasFocus?this.lang.toolbar.font+(i?" ("+i+")":""):i)}return!1},on:function(){const e=this.context.font,t=e._fontList,n=e.targetText.textContent;if(n!==e.currentFont){for(let i=0,s=t.length;i<s;i++)n===(t[i].getAttribute("data-value")||"").replace(/'|"/g,"")?this.util.addClass(t[i],"active"):this.util.removeClass(t[i],"active");e.currentFont=n}},pickup:function(e){if(!/^BUTTON$/i.test(e.target.tagName))return!1;e.preventDefault(),e.stopPropagation();let t=e.target.getAttribute("data-value");if(t){const n=this.util.createElement("SPAN");/[\s\d\W]/.test(t)&&!/^['"].*['"]$/.test(t)&&(t='"'+t+'"'),n.style.fontFamily=t,this.nodeChange(n,["font-family"],null,null)}else this.nodeChange(null,["font-family"],["span"],!0);this.submenuOff()}},LC={name:"fontSize",display:"submenu",add:function(e,t){const n=e.context;n.fontSize={targetText:t.querySelector(".txt"),_sizeList:null,currentSize:""};let i=this.setSubmenu(e),s=i.querySelector("ul");s.addEventListener("click",this.pickup.bind(e)),n.fontSize._sizeList=s.querySelectorAll("li button"),e.initMenuTarget(this.name,t,i),i=null,s=null},setSubmenu:function(e){const t=e.options,n=e.lang,i=e.util.createElement("DIV");i.className="se-submenu se-list-layer se-list-font-size";const s=t.fontSize?t.fontSize:[8,9,10,11,12,14,16,18,20,22,24,26,28,36,48,72];let o='<div class="se-list-inner"><ul class="se-list-basic"><li><button type="button" class="default_value se-btn-list" title="'+n.toolbar.default+'" aria-label="'+n.toolbar.default+'">('+n.toolbar.default+")</button></li>";for(let l=0,a=t.fontSizeUnit,r=s.length,f;l<r;l++)f=s[l],o+='<li><button type="button" class="se-btn-list" data-value="'+f+a+'" title="'+f+a+'" aria-label="'+f+a+'" style="font-size:'+f+a+';">'+f+"</button></li>";return o+="</ul></div>",i.innerHTML=o,i},active:function(e){if(!e)this.util.changeTxt(this.context.fontSize.targetText,this.hasFocus?this._convertFontSize.call(this,this.options.fontSizeUnit,this.wwComputedStyle.fontSize):this.lang.toolbar.fontSize);else if(e.style&&e.style.fontSize.length>0)return this.util.changeTxt(this.context.fontSize.targetText,this._convertFontSize.call(this,this.options.fontSizeUnit,e.style.fontSize)),!0;return!1},on:function(){const e=this.context.fontSize,t=e._sizeList,n=e.targetText.textContent;if(n!==e.currentSize){for(let i=0,s=t.length;i<s;i++)n===t[i].getAttribute("data-value")?this.util.addClass(t[i],"active"):this.util.removeClass(t[i],"active");e.currentSize=n}},pickup:function(e){if(!/^BUTTON$/i.test(e.target.tagName))return!1;e.preventDefault(),e.stopPropagation();const t=e.target.getAttribute("data-value");if(t){const n=this.util.createElement("SPAN");n.style.fontSize=t,this.nodeChange(n,["font-size"],null,null)}else this.nodeChange(null,["font-size"],["span"],!0);this.submenuOff()}},lh={name:"colorPicker",add:function(e){const t=e.context;t.colorPicker={colorListHTML:"",_colorInput:"",_defaultColor:"#000",_styleProperty:"color",_currentColor:"",_colorList:[]},t.colorPicker.colorListHTML=this.createColorList(e,this._makeColorList)},createColorList:function(e,t){const n=e.options,i=e.lang,s=!n.colorList||n.colorList.length===0?["#ff0000","#ff5e00","#ffe400","#abf200","#00d8ff","#0055ff","#6600ff","#ff00dd","#000000","#ffd8d8","#fae0d4","#faf4c0","#e4f7ba","#d4f4fa","#d9e5ff","#e8d9ff","#ffd9fa","#f1f1f1","#ffa7a7","#ffc19e","#faed7d","#cef279","#b2ebf4","#b2ccff","#d1b2ff","#ffb2f5","#bdbdbd","#f15f5f","#f29661","#e5d85c","#bce55c","#5cd1e5","#6699ff","#a366ff","#f261df","#8c8c8c","#980000","#993800","#998a00","#6b9900","#008299","#003399","#3d0099","#990085","#353535","#670000","#662500","#665c00","#476600","#005766","#002266","#290066","#660058","#222222"]:n.colorList;let o=[],l='<div class="se-list-inner">';for(let a=0,r=s.length,f;a<r;a++)f=s[a],f&&(typeof f=="string"&&(o.push(f),a<r-1)||(o.length>0&&(l+='<div class="se-selector-color">'+t(o)+"</div>",o=[]),typeof f=="object"&&(l+='<div class="se-selector-color">'+t(f)+"</div>")));return l+='<form class="se-form-group"><input type="text" maxlength="9" class="_se_color_picker_input se-color-input"/><button type="submit" class="se-btn-primary _se_color_picker_submit" title="'+i.dialogBox.submitButton+'" aria-label="'+i.dialogBox.submitButton+'">'+e.icons.checked+'</button><button type="button" class="se-btn _se_color_picker_remove" title="'+i.toolbar.removeFormat+'" aria-label="'+i.toolbar.removeFormat+'">'+e.icons.erase+"</button></form></div>",l},_makeColorList:function(e){let t="";t+='<ul class="se-color-pallet">';for(let n=0,i=e.length,s;n<i;n++)s=e[n],typeof s=="string"&&(t+='<li><button type="button" data-value="'+s+'" title="'+s+'" aria-label="'+s+'" style="background-color:'+s+';"></button></li>');return t+="</ul>",t},init:function(e,t){const n=this.plugins.colorPicker;let i=t||n.getColorInNode.call(this,e)||this.context.colorPicker._defaultColor;i=n.isHexColor(i)?i:n.rgb2hex(i)||i;const s=this.context.colorPicker._colorList;if(s)for(let o=0,l=s.length;o<l;o++)i.toLowerCase()===s[o].getAttribute("data-value").toLowerCase()?this.util.addClass(s[o],"active"):this.util.removeClass(s[o],"active");n.setInputText.call(this,n.colorName2hex.call(this,i))},setCurrentColor:function(e){this.context.colorPicker._currentColor=e,this.context.colorPicker._colorInput.style.borderColor=e},setInputText:function(e){e=/^#/.test(e)?e:"#"+e,this.context.colorPicker._colorInput.value=e,this.plugins.colorPicker.setCurrentColor.call(this,e)},getColorInNode:function(e){let t="";const n=this.context.colorPicker._styleProperty;for(;e&&!this.util.isWysiwygDiv(e)&&t.length===0;)e.nodeType===1&&e.style[n]&&(t=e.style[n]),e=e.parentNode;return t},isHexColor:function(e){return/^#[0-9a-f]{3}(?:[0-9a-f]{3})?$/i.test(e)},rgb2hex:function(e){const t=e.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i);return t&&t.length===4?"#"+("0"+parseInt(t[1],10).toString(16)).slice(-2)+("0"+parseInt(t[2],10).toString(16)).slice(-2)+("0"+parseInt(t[3],10).toString(16)).slice(-2):""},colorName2hex:function(e){if(/^#/.test(e))return e;var t=this.util.createElement("div");t.style.display="none",t.style.color=e;var n=this._w.getComputedStyle(this._d.body.appendChild(t)).color.match(/\d+/g).map(function(i){return parseInt(i,10)});return this.util.removeItem(t),n.length>=3?"#"+((1<<24)+(n[0]<<16)+(n[1]<<8)+n[2]).toString(16).substr(1):!1}},OC={name:"fontColor",display:"submenu",add:function(e,t){e.addModule([lh]);const n=e.context;n.fontColor={previewEl:null,colorInput:null,colorList:null};let i=this.setSubmenu(e);n.fontColor.colorInput=i.querySelector("._se_color_picker_input"),n.fontColor.colorInput.addEventListener("keyup",this.onChangeInput.bind(e)),i.querySelector("._se_color_picker_submit").addEventListener("click",this.submit.bind(e)),i.querySelector("._se_color_picker_remove").addEventListener("click",this.remove.bind(e)),i.addEventListener("click",this.pickup.bind(e)),n.fontColor.colorList=i.querySelectorAll("li button"),e.initMenuTarget(this.name,t,i),i=null},setSubmenu:function(e){const t=e.context.colorPicker.colorListHTML,n=e.util.createElement("DIV");return n.className="se-submenu se-list-layer",n.innerHTML=t,n},on:function(){const e=this.context.colorPicker,t=this.context.fontColor;e._colorInput=t.colorInput;const n=this.wwComputedStyle.color;e._defaultColor=n?this.plugins.colorPicker.isHexColor(n)?n:this.plugins.colorPicker.rgb2hex(n):"#333333",e._styleProperty="color",e._colorList=t.colorList,this.plugins.colorPicker.init.call(this,this.getSelectionNode(),null)},onChangeInput:function(e){this.plugins.colorPicker.setCurrentColor.call(this,e.target.value)},submit:function(){this.plugins.fontColor.applyColor.call(this,this.context.colorPicker._currentColor)},pickup:function(e){e.preventDefault(),e.stopPropagation(),this.plugins.fontColor.applyColor.call(this,e.target.getAttribute("data-value"))},remove:function(){this.nodeChange(null,["color"],["span"],!0),this.submenuOff()},applyColor:function(e){if(!e)return;const t=this.util.createElement("SPAN");t.style.color=e,this.nodeChange(t,["color"],null,null),this.submenuOff()}},PC={name:"hiliteColor",display:"submenu",add:function(e,t){e.addModule([lh]);const n=e.context;n.hiliteColor={previewEl:null,colorInput:null,colorList:null};let i=this.setSubmenu(e);n.hiliteColor.colorInput=i.querySelector("._se_color_picker_input"),n.hiliteColor.colorInput.addEventListener("keyup",this.onChangeInput.bind(e)),i.querySelector("._se_color_picker_submit").addEventListener("click",this.submit.bind(e)),i.querySelector("._se_color_picker_remove").addEventListener("click",this.remove.bind(e)),i.addEventListener("click",this.pickup.bind(e)),n.hiliteColor.colorList=i.querySelectorAll("li button"),e.initMenuTarget(this.name,t,i),i=null},setSubmenu:function(e){const t=e.context.colorPicker.colorListHTML,n=e.util.createElement("DIV");return n.className="se-submenu se-list-layer",n.innerHTML=t,n},on:function(){const e=this.context.colorPicker,t=this.context.hiliteColor;e._colorInput=t.colorInput;const n=this.wwComputedStyle.backgroundColor;e._defaultColor=n?this.plugins.colorPicker.isHexColor(n)?n:this.plugins.colorPicker.rgb2hex(n):"#ffffff",e._styleProperty="backgroundColor",e._colorList=t.colorList,this.plugins.colorPicker.init.call(this,this.getSelectionNode(),null)},onChangeInput:function(e){this.plugins.colorPicker.setCurrentColor.call(this,e.target.value)},submit:function(){this.plugins.hiliteColor.applyColor.call(this,this.context.colorPicker._currentColor)},pickup:function(e){e.preventDefault(),e.stopPropagation(),this.plugins.hiliteColor.applyColor.call(this,e.target.getAttribute("data-value"))},remove:function(){this.nodeChange(null,["background-color"],["span"],!0),this.submenuOff()},applyColor:function(e){if(!e)return;const t=this.util.createElement("SPAN");t.style.backgroundColor=e,this.nodeChange(t,["background-color"],null,null),this.submenuOff()}},IC={name:"horizontalRule",display:"submenu",add:function(e,t){e.context.horizontalRule={currentHR:null};let n=this.setSubmenu(e);n.querySelector("ul").addEventListener("click",this.horizontalRulePick.bind(e)),e.initMenuTarget(this.name,t,n),n=null},setSubmenu:function(e){const t=e.lang,n=e.util.createElement("DIV"),i=e.options.hrItems||[{name:t.toolbar.hr_solid,class:"__se__solid"},{name:t.toolbar.hr_dashed,class:"__se__dashed"},{name:t.toolbar.hr_dotted,class:"__se__dotted"}];let s="";for(let o=0,l=i.length;o<l;o++)s+='<li><button type="button" class="se-btn-list btn_line" data-command="horizontalRule" data-value="'+i[o].class+'" title="'+i[o].name+'" aria-label="'+i[o].name+'"><hr'+(i[o].class?' class="'+i[o].class+'"':"")+(i[o].style?' style="'+i[o].style+'"':"")+"/></button></li>";return n.className="se-submenu se-list-layer se-list-line",n.innerHTML='<div class="se-list-inner"><ul class="se-list-basic">'+s+"</ul></div>",n},active:function(e){if(!e)this.util.hasClass(this.context.horizontalRule.currentHR,"on")&&this.controllersOff();else if(/HR/i.test(e.nodeName))return this.context.horizontalRule.currentHR=e,this.util.hasClass(e,"on")||(this.util.addClass(e,"on"),this.controllersOn("hr",this.util.removeClass.bind(this.util,e,"on"))),!0;return!1},appendHr:function(e){return this.focus(),this.insertComponent(e.cloneNode(!1),!1,!0,!1)},horizontalRulePick:function(e){e.preventDefault(),e.stopPropagation();let t=e.target,n=t.getAttribute("data-command");for(;!n&&!/UL/i.test(t.tagName);)t=t.parentNode,n=t.getAttribute("data-command");if(!n)return;const i=this.plugins.horizontalRule.appendHr.call(this,t.firstElementChild);i&&(this.setRange(i,0,i,0),this.submenuOff())}},BC={name:"list",display:"submenu",add:function(e,t){const n=e.context;n.list={targetButton:t,_list:null,currentList:"",icons:{bullets:e.icons.list_bullets,number:e.icons.list_number}};let i=this.setSubmenu(e),s=i.querySelector("ul");s.addEventListener("click",this.pickup.bind(e)),n.list._list=s.querySelectorAll("li button"),e.initMenuTarget(this.name,t,i),i=null,s=null},setSubmenu:function(e){const t=e.lang,n=e.util.createElement("DIV");return n.className="se-submenu se-list-layer",n.innerHTML='<div class="se-list-inner"><ul class="se-list-basic"><li><button type="button" class="se-btn-list se-tooltip" data-command="OL" title="'+t.toolbar.orderList+'" aria-label="'+t.toolbar.orderList+'">'+e.icons.list_number+'</button></li><li><button type="button" class="se-btn-list se-tooltip" data-command="UL" title="'+t.toolbar.unorderList+'" aria-label="'+t.toolbar.unorderList+'">'+e.icons.list_bullets+"</button></li></ul></div>",n},active:function(e){const t=this.context.list.targetButton,n=t.firstElementChild,i=this.util;if(i.isList(e)){const s=e.nodeName;return t.setAttribute("data-focus",s),i.addClass(t,"active"),/UL/i.test(s)?i.changeElement(n,this.context.list.icons.bullets):i.changeElement(n,this.context.list.icons.number),!0}else t.removeAttribute("data-focus"),i.changeElement(n,this.context.list.icons.number),i.removeClass(t,"active");return!1},on:function(){const e=this.context.list,t=e._list,n=e.targetButton.getAttribute("data-focus")||"";if(n!==e.currentList){for(let i=0,s=t.length;i<s;i++)n===t[i].getAttribute("data-command")?this.util.addClass(t[i],"active"):this.util.removeClass(t[i],"active");e.currentList=n}},editList:function(e,t,n){let i=this.getRange(),s=t||this.getSelectedElementsAndComponents(!1);if(s.length===0&&(t||(i=this.getRange_addLine(i,null),s=this.getSelectedElementsAndComponents(!1),s.length===0)))return;const o=this.util;o.sortByDepth(s,!0);let l=s[0],a=s[s.length-1],r=(o.isListCell(l)||o.isComponent(l))&&!l.previousElementSibling?l.parentNode.previousElementSibling:l.previousElementSibling,f=(o.isListCell(a)||o.isComponent(a))&&!a.nextElementSibling?a.parentNode.nextElementSibling:a.nextElementSibling;const d=i.collapsed,h={sc:i.startContainer,so:i.startContainer===i.endContainer&&o.onlyZeroWidthSpace(i.startContainer)&&i.startOffset===0&&i.endOffset===1?i.endOffset:i.startOffset,ec:i.endContainer,eo:i.endOffset};let b=null,_=!0;for(let C=0,S=s.length;C<S;C++)if(!o.isList(o.getRangeFormatElement(s[C],(function(c){return this.getRangeFormatElement(c)&&c!==s[C]}).bind(o)))){_=!1;break}if(_&&(!r||l.tagName!==r.tagName||e!==r.tagName.toUpperCase())&&(!f||a.tagName!==f.tagName||e!==f.tagName.toUpperCase())){if(n){for(let v=0,y=s.length;v<y;v++)for(let w=v-1;w>=0;w--)if(s[w].contains(s[v])){s.splice(v,1),v--,y--;break}}const C=o.getRangeFormatElement(l),S=C&&C.tagName===e;let c,u;const p=(function(v){return!this.isComponent(v)}).bind(o);S||(u=o.createElement(e));for(let v=0,y=s.length,w,x;v<y;v++)x=o.getRangeFormatElement(s[v],p),!(!x||!o.isList(x))&&(w?w!==x?(n&&o.isListCell(x.parentNode)?this.plugins.list._detachNested.call(this,c.f):b=this.detachRangeFormatElement(c.f[0].parentNode,c.f,u,!1,!0),x=s[v].parentNode,S||(u=o.createElement(e)),w=x,c={r:w,f:[o.getParentElement(s[v],"LI")]}):c.f.push(o.getParentElement(s[v],"LI")):(w=x,c={r:w,f:[o.getParentElement(s[v],"LI")]}),v===y-1&&(n&&o.isListCell(x.parentNode)?this.plugins.list._detachNested.call(this,c.f):b=this.detachRangeFormatElement(c.f[0].parentNode,c.f,u,!1,!0)))}else{const C=r&&r.parentNode,S=f&&f.parentNode;r=C&&!o.isWysiwygDiv(C)&&C.nodeName===e?C:r,f=S&&!o.isWysiwygDiv(S)&&S.nodeName===e?S:f;const c=r&&r.tagName===e,u=f&&f.tagName===e;let p=c?r:o.createElement(e),v=null,y=null,w=null;const x=(function(E){return!this.isComponent(E)&&!this.isList(E)}).bind(o);for(let E=0,k=s.length,N,T,R,M,A,D,$,H,j;E<k;E++){if(T=s[E],T.childNodes.length===0&&!o._isIgnoreNodeChange(T)){o.removeItem(T);continue}if(M=s[E+1],A=T.parentNode,D=M?M.parentNode:null,R=o.isListCell(T),j=o.isRangeFormatElement(A)?A:null,$=R&&!o.isWysiwygDiv(A)?A.parentNode:A,H=R&&!o.isWysiwygDiv(A)?!M||o.isListCell($)?A:A.nextSibling:T.nextSibling,N=o.createElement("LI"),o.copyFormatAttributes(N,T),E===0&&h.sc===T&&(h.sc=N),E===k-1&&h.ec===T&&(h.ec=N),o.isComponent(T)){const F=/^HR$/i.test(T.nodeName);F||(N.innerHTML="<br>"),N.innerHTML+=T.outerHTML,F&&(N.innerHTML+="<br>")}else{const F=T.childNodes;for(;F[0];)N.appendChild(F[0])}p.appendChild(N),(!M||$!==D||o.isRangeFormatElement(H))&&(v||(v=p),(!c||!M||$!==D)&&!(M&&o.isList(D)&&D===A)&&p.parentNode!==$&&$.insertBefore(p,H)),o.removeItem(T),c&&y===null&&(y=p.children.length-1),M&&(o.getRangeFormatElement(D,x)!==o.getRangeFormatElement(A,x)||o.isList(D)&&o.isList(A)&&o.getElementDepth(D)!==o.getElementDepth(A))&&(p=o.createElement(e)),j&&j.children.length===0&&o.removeItem(j)}y&&(v=v.children[y]),u&&(w=p.children.length-1,p.innerHTML+=f.innerHTML,p.children[w],o.removeItem(f))}return this.effectNode=null,d&&b||h},_detachNested:function(e){const t=e[0],n=e[e.length-1],i=n.nextElementSibling,s=t.parentNode,o=s.parentNode.nextElementSibling,l=s.parentNode.parentNode;for(let r=0,f=e.length;r<f;r++)l.insertBefore(e[r],o);if(i&&s.children.length>0){const r=s.cloneNode(!1),f=s.childNodes,d=this.util.getPositionIndex(i);for(;f[d];)r.appendChild(f[d]);n.appendChild(r)}s.children.length===0&&this.util.removeItem(s),this.util.mergeSameTags(l);const a=this.util.getEdgeChildNodes(t,n);return{cc:t.parentNode,sc:a.sc,ec:a.ec}},editInsideList:function(e,t){t=t||this.getSelectedElements().filter((function(l){return this.isListCell(l)}).bind(this.util));const n=t.length;if(n===0||!e&&!this.util.isListCell(t[0].previousElementSibling)&&!this.util.isListCell(t[n-1].nextElementSibling))return{sc:t[0],so:0,ec:t[n-1],eo:1};let i=t[0].parentNode,s=t[n-1],o=null;if(e){if(i!==s.parentNode&&this.util.isList(s.parentNode.parentNode)&&s.nextElementSibling)for(s=s.nextElementSibling;s;)t.push(s),s=s.nextElementSibling;o=this.plugins.list.editList.call(this,i.nodeName.toUpperCase(),t,!0)}else{let l=this.util.createElement(i.nodeName),a=t[0].previousElementSibling,r=s.nextElementSibling;const f={s:null,e:null,sl:i,el:i};for(let b=0,_=n,C;b<_;b++)C=t[b],C.parentNode!==i&&(this.plugins.list._insiedList.call(this,i,l,a,r,f),i=C.parentNode,l=this.util.createElement(i.nodeName)),a=C.previousElementSibling,r=C.nextElementSibling,l.appendChild(C);this.plugins.list._insiedList.call(this,i,l,a,r,f);const d=this.util.getNodeFromPath(f.s,f.sl),h=this.util.getNodeFromPath(f.e,f.el);o={sc:d,so:0,ec:h,eo:h.textContent.length}}return o},_insiedList:function(e,t,n,i,s){let o=!1;if(n&&t.tagName===n.tagName){const l=t.children;for(;l[0];)n.appendChild(l[0]);t=n,o=!0}if(i&&t.tagName===i.tagName){const l=i.children;for(;l[0];)t.appendChild(l[0]);const a=i.nextElementSibling;i.parentNode.removeChild(i),i=a}if(!o){this.util.isListCell(n)&&(e=n,i=null),e.insertBefore(t,i),s.s||(s.s=this.util.getNodePath(t.firstElementChild.firstChild,e,null),s.sl=e);const l=e.contains(s.sl)?this.util.getNodePath(s.sl,e):null;s.e=this.util.getNodePath(t.lastElementChild.firstChild,e,null),s.el=e,this.util.mergeSameTags(e,[s.s,s.e,l],!1),this.util.mergeNestedTags(e),l&&(s.sl=this.util.getNodeFromPath(l,e))}return t},pickup:function(e){e.preventDefault(),e.stopPropagation();let t=e.target,n="";for(;!n&&!/^UL$/i.test(t.tagName);)n=t.getAttribute("data-command"),t=t.parentNode;if(!n)return;const i=this.plugins.list.editList.call(this,n,null,!1);i&&this.setRange(i.sc,i.so,i.ec,i.eo),this.submenuOff(),this.history.push(!1)}},FC={name:"table",display:"submenu",add:function(e,t){const n=e.context;let i=n.table={_element:null,_tdElement:null,_trElement:null,_trElements:null,_tableXY:[],_maxWidth:!0,_fixedColumn:!1,_rtl:e.options.rtl,cellControllerTop:e.options.tableCellControllerPosition==="top",resizeText:null,headerButton:null,mergeButton:null,splitButton:null,splitMenu:null,maxText:e.lang.controller.maxSize,minText:e.lang.controller.minSize,_physical_cellCnt:0,_logical_cellCnt:0,_rowCnt:0,_rowIndex:0,_physical_cellIndex:0,_logical_cellIndex:0,_current_colSpan:0,_current_rowSpan:0,icons:{expansion:e.icons.expansion,reduction:e.icons.reduction}},s=this.setSubmenu(e),o=s.querySelector(".se-controller-table-picker");i.tableHighlight=s.querySelector(".se-table-size-highlighted"),i.tableUnHighlight=s.querySelector(".se-table-size-unhighlighted"),i.tableDisplay=s.querySelector(".se-table-size-display"),e.options.rtl&&(i.tableHighlight.style.left=10*18-13+"px");let l=this.setController_table(e);i.tableController=l,i.resizeButton=l.querySelector("._se_table_resize"),i.resizeText=l.querySelector("._se_table_resize > span > span"),i.columnFixedButton=l.querySelector("._se_table_fixed_column"),i.headerButton=l.querySelector("._se_table_header");let a=this.setController_tableEditor(e,i.cellControllerTop);i.resizeDiv=a,i.splitMenu=a.querySelector(".se-btn-group-sub"),i.mergeButton=a.querySelector("._se_table_merge_button"),i.splitButton=a.querySelector("._se_table_split_button"),i.insertRowAboveButton=a.querySelector("._se_table_insert_row_a"),i.insertRowBelowButton=a.querySelector("._se_table_insert_row_b"),o.addEventListener("mousemove",this.onMouseMove_tablePicker.bind(e,i)),o.addEventListener("click",this.appendTable.bind(e)),a.addEventListener("click",this.onClick_tableController.bind(e)),l.addEventListener("click",this.onClick_tableController.bind(e)),e.initMenuTarget(this.name,t,s),n.element.relative.appendChild(a),n.element.relative.appendChild(l),s=null,o=null,a=null,l=null,i=null},setSubmenu:function(e){const t=e.util.createElement("DIV");return t.className="se-submenu se-selector-table",t.innerHTML='<div class="se-table-size"><div class="se-table-size-picker se-controller-table-picker"></div><div class="se-table-size-highlighted"></div><div class="se-table-size-unhighlighted"></div></div><div class="se-table-size-display">1 x 1</div>',t},setController_table:function(e){const t=e.lang,n=e.icons,i=e.util.createElement("DIV");return i.className="se-controller se-controller-table",i.innerHTML='<div><div class="se-btn-group"><button type="button" data-command="resize" class="se-btn se-tooltip _se_table_resize">'+n.expansion+'<span class="se-tooltip-inner"><span class="se-tooltip-text">'+t.controller.maxSize+'</span></span></button><button type="button" data-command="layout" class="se-btn se-tooltip _se_table_fixed_column">'+n.fixed_column_width+'<span class="se-tooltip-inner"><span class="se-tooltip-text">'+t.controller.fixedColumnWidth+'</span></span></button><button type="button" data-command="header" class="se-btn se-tooltip _se_table_header">'+n.table_header+'<span class="se-tooltip-inner"><span class="se-tooltip-text">'+t.controller.tableHeader+'</span></span></button><button type="button" data-command="remove" class="se-btn se-tooltip">'+n.delete+'<span class="se-tooltip-inner"><span class="se-tooltip-text">'+t.controller.remove+"</span></span></button></div></div>",i},setController_tableEditor:function(e,t){const n=e.lang,i=e.icons,s=e.util.createElement("DIV");return s.className="se-controller se-controller-table-cell",s.innerHTML=(t?"":'<div class="se-arrow se-arrow-up"></div>')+'<div class="se-btn-group"><button type="button" data-command="insert" data-value="row" data-option="up" class="se-btn se-tooltip _se_table_insert_row_a">'+i.insert_row_above+'<span class="se-tooltip-inner"><span class="se-tooltip-text">'+n.controller.insertRowAbove+'</span></span></button><button type="button" data-command="insert" data-value="row" data-option="down" class="se-btn se-tooltip _se_table_insert_row_b">'+i.insert_row_below+'<span class="se-tooltip-inner"><span class="se-tooltip-text">'+n.controller.insertRowBelow+'</span></span></button><button type="button" data-command="delete" data-value="row" class="se-btn se-tooltip">'+i.delete_row+'<span class="se-tooltip-inner"><span class="se-tooltip-text">'+n.controller.deleteRow+'</span></span></button><button type="button" data-command="merge" class="_se_table_merge_button se-btn se-tooltip" disabled>'+i.merge_cell+'<span class="se-tooltip-inner"><span class="se-tooltip-text">'+n.controller.mergeCells+'</span></span></button></div><div class="se-btn-group" style="padding-top: 0;"><button type="button" data-command="insert" data-value="cell" data-option="left" class="se-btn se-tooltip">'+i.insert_column_left+'<span class="se-tooltip-inner"><span class="se-tooltip-text">'+n.controller.insertColumnBefore+'</span></span></button><button type="button" data-command="insert" data-value="cell" data-option="right" class="se-btn se-tooltip">'+i.insert_column_right+'<span class="se-tooltip-inner"><span class="se-tooltip-text">'+n.controller.insertColumnAfter+'</span></span></button><button type="button" data-command="delete" data-value="cell" class="se-btn se-tooltip">'+i.delete_column+'<span class="se-tooltip-inner"><span class="se-tooltip-text">'+n.controller.deleteColumn+'</span></span></button><button type="button" data-command="onsplit" class="_se_table_split_button se-btn se-tooltip">'+i.split_cell+'<span class="se-tooltip-inner"><span class="se-tooltip-text">'+n.controller.splitCells+'</span></span></button><div class="se-btn-group-sub sun-editor-common se-list-layer se-table-split"><div class="se-list-inner"><ul class="se-list-basic"><li class="se-btn-list" data-command="split" data-value="vertical" style="line-height:32px;" title="'+n.controller.VerticalSplit+'" aria-label="'+n.controller.VerticalSplit+'">'+n.controller.VerticalSplit+'</li><li class="se-btn-list" data-command="split" data-value="horizontal" style="line-height:32px;" title="'+n.controller.HorizontalSplit+'" aria-label="'+n.controller.HorizontalSplit+'">'+n.controller.HorizontalSplit+"</li></ul></div></div></div>",s},appendTable:function(){const e=this.util.createElement("TABLE"),t=this.plugins.table.createCells,n=this.context.table._tableXY[0];let i=this.context.table._tableXY[1],s="<tbody>";for(;i>0;)s+="<tr>"+t.call(this,"td",n)+"</tr>",--i;if(s+="</tbody>",e.innerHTML=s,this.insertComponent(e,!1,!0,!1)){const l=e.querySelector("td div");this.setRange(l,0,l,0),this.plugins.table.reset_table_picker.call(this)}},createCells:function(e,t,n){if(e=e.toLowerCase(),n){const i=this.util.createElement(e);return i.innerHTML="<div><br></div>",i}else{let i="";for(;t>0;)i+="<"+e+"><div><br></div></"+e+">",t--;return i}},onMouseMove_tablePicker:function(e,t){t.stopPropagation();let n=this._w.Math.ceil(t.offsetX/18),i=this._w.Math.ceil(t.offsetY/18);n=n<1?1:n,i=i<1?1:i,e._rtl&&(e.tableHighlight.style.left=n*18-13+"px",n=11-n),e.tableHighlight.style.width=n+"em",e.tableHighlight.style.height=i+"em",this.util.changeTxt(e.tableDisplay,n+" x "+i),e._tableXY=[n,i]},reset_table_picker:function(){if(!this.context.table.tableHighlight)return;const e=this.context.table.tableHighlight.style,t=this.context.table.tableUnHighlight.style;e.width="1em",e.height="1em",t.width="10em",t.height="10em",this.util.changeTxt(this.context.table.tableDisplay,"1 x 1"),this.submenuOff()},init:function(){const e=this.context.table,t=this.plugins.table;if(t._removeEvents.call(this),t._selectedTable){const n=t._selectedTable.querySelectorAll(".se-table-selected-cell");for(let i=0,s=n.length;i<s;i++)this.util.removeClass(n[i],"se-table-selected-cell")}t._toggleEditor.call(this,!0),e._element=null,e._tdElement=null,e._trElement=null,e._trElements=null,e._tableXY=[],e._maxWidth=!0,e._fixedColumn=!1,e._physical_cellCnt=0,e._logical_cellCnt=0,e._rowCnt=0,e._rowIndex=0,e._physical_cellIndex=0,e._logical_cellIndex=0,e._current_colSpan=0,e._current_rowSpan=0,t._shift=!1,t._selectedCells=null,t._selectedTable=null,t._ref=null,t._fixedCell=null,t._selectedCell=null,t._fixedCellName=null},call_controller_tableEdit:function(e){const t=this.plugins.table,n=this.context.table;if(!this.getSelection().isCollapsed&&!t._selectedCell){this.controllersOff(),this.util.removeClass(e,"se-table-selected-cell");return}const i=n._element||this.plugins.table._selectedTable||this.util.getParentElement(e,"TABLE");n._maxWidth=this.util.hasClass(i,"se-table-size-100")||i.style.width==="100%"||!i.style.width&&!this.util.hasClass(i,"se-table-size-auto"),n._fixedColumn=this.util.hasClass(i,"se-table-layout-fixed")||i.style.tableLayout==="fixed",t.setTableStyle.call(this,n._maxWidth?"width|column":"width"),t.setPositionControllerTop.call(this,i),t.setPositionControllerDiv.call(this,e,t._shift),t._shift||this.controllersOn(n.resizeDiv,n.tableController,t.init.bind(this),e,"table")},setPositionControllerTop:function(e){this.setControllerPosition(this.context.table.tableController,e,"top",{left:0,top:0})},setPositionControllerDiv:function(e,t){const n=this.context.table,i=n.resizeDiv;this.plugins.table.setCellInfo.call(this,e,t),n.cellControllerTop?this.setControllerPosition(i,n._element,"top",{left:n.tableController.offsetWidth,top:0}):this.setControllerPosition(i,e,"bottom",{left:0,top:0})},setCellInfo:function(e,t){const n=this.context.table,i=n._element=this.plugins.table._selectedTable||this.util.getParentElement(e,"TABLE");if(/THEAD/i.test(i.firstElementChild.nodeName)?this.util.addClass(n.headerButton,"active"):this.util.removeClass(n.headerButton,"active"),t||n._physical_cellCnt===0){n._tdElement!==e&&(n._tdElement=e,n._trElement=e.parentNode);const s=n._trElements=i.rows,o=e.cellIndex;let l=0;for(let d=0,h=s[0].cells,b=s[0].cells.length;d<b;d++)l+=h[d].colSpan;const a=n._rowIndex=n._trElement.rowIndex;n._rowCnt=s.length,n._physical_cellCnt=n._trElement.cells.length,n._logical_cellCnt=l,n._physical_cellIndex=o,n._current_colSpan=n._tdElement.colSpan-1,n._current_rowSpan-n._trElement.cells[o].rowSpan-1;let r=[],f=[];for(let d=0,h,b;d<=a;d++){h=s[d].cells,b=0;for(let _=0,C=h.length,S,c,u,p;_<C;_++){if(S=h[_],c=S.colSpan-1,u=S.rowSpan-1,p=_+b,f.length>0)for(let v=0,y;v<f.length;v++)y=f[v],!(y.row>d)&&(p>=y.index?(b+=y.cs,p+=y.cs,y.rs-=1,y.row=d+1,y.rs<1&&(f.splice(v,1),v--)):_===C-1&&(y.rs-=1,y.row=d+1,y.rs<1&&(f.splice(v,1),v--)));if(d===a&&_===o){n._logical_cellIndex=p;break}u>0&&r.push({index:p,cs:c+1,rs:u,row:-1}),b+=c}f=f.concat(r).sort(function(_,C){return _.index-C.index}),r=[]}r=null,f=null}},editTable:function(e,t){const n=this.plugins.table,i=this.context.table,s=i._element,o=e==="row";if(o){const l=i._trElement.parentNode;if(/^THEAD$/i.test(l.nodeName)){if(t==="up")return;if(!l.nextElementSibling||!/^TBODY$/i.test(l.nextElementSibling.nodeName)){s.innerHTML+="<tbody><tr>"+n.createCells.call(this,"td",i._logical_cellCnt,!1)+"</tr></tbody>";return}}}if(n._ref){const l=i._tdElement,a=n._selectedCells;if(o)if(t)n.setCellInfo.call(this,t==="up"?a[0]:a[a.length-1],!0),n.editRow.call(this,t,l);else{let r=a[0].parentNode;const f=[a[0]];for(let d=1,h=a.length,b;d<h;d++)b=a[d],r!==b.parentNode&&(f.push(b),r=b.parentNode);for(let d=0,h=f.length;d<h;d++)n.setCellInfo.call(this,f[d],!0),n.editRow.call(this,t)}else{const r=a[0].parentNode;if(t){let f=null;for(let d=0,h=a.length-1;d<h;d++)if(r!==a[d+1].parentNode){f=a[d];break}n.setCellInfo.call(this,t==="left"?a[0]:f||a[0],!0),n.editCell.call(this,t,l)}else{const f=[a[0]];for(let d=1,h=a.length,b;d<h&&(b=a[d],r===b.parentNode);d++)f.push(b);for(let d=0,h=f.length;d<h;d++)n.setCellInfo.call(this,f[d],!0),n.editCell.call(this,t)}}t||n.init.call(this)}else n[o?"editRow":"editCell"].call(this,t);if(!t){const l=s.children;for(let a=0;a<l.length;a++)l[a].children.length===0&&(this.util.removeItem(l[a]),a--);s.children.length===0&&this.util.removeItem(s)}},editRow:function(e,t){const n=this.context.table,i=!e,s=e==="up",o=n._rowIndex,l=i||s?o:o+n._current_rowSpan+1,a=i?-1:1,r=n._trElements;let f=n._logical_cellCnt;for(let d=0,h=o+(i?-1:0),b;d<=h;d++){if(b=r[d].cells,b.length===0)return;for(let _=0,C=b.length,S,c;_<C;_++)S=b[_].rowSpan,c=b[_].colSpan,!(S<2&&c<2)&&S+d>l&&l>d&&(b[_].rowSpan=S+a,f-=c)}if(i){const d=r[o+1];if(d){const h=[];let b=r[o].cells,_=0;for(let C=0,S=b.length,c,u;C<S;C++)c=b[C],u=C+_,_+=c.colSpan-1,c.rowSpan>1&&(c.rowSpan-=1,h.push({cell:c.cloneNode(!1),index:u}));if(h.length>0){let C=h.shift();b=d.cells,_=0;for(let S=0,c=b.length,u,p;S<c&&(u=b[S],p=S+_,_+=u.colSpan-1,!(p>=C.index&&(S--,_--,_+=C.cell.colSpan-1,d.insertBefore(C.cell,u),C=h.shift(),!C)));S++);if(C){d.appendChild(C.cell);for(let S=0,c=h.length;S<c;S++)d.appendChild(h[S].cell)}}}n._element.deleteRow(l)}else{const d=n._element.insertRow(l);d.innerHTML=this.plugins.table.createCells.call(this,"td",f,!1)}i?this.controllersOff():this.plugins.table.setPositionControllerDiv.call(this,t||n._tdElement,!0)},editCell:function(e,t){const n=this.context.table,i=this.util,s=!e,o=e==="left",l=n._current_colSpan,a=s||o?n._logical_cellIndex:n._logical_cellIndex+l+1,r=n._trElements;let f=[],d=[],h=0;const b=[],_=[];for(let C=0,S=n._rowCnt,c,u,p,v,y,w;C<S;C++){c=r[C],u=a,y=!1,p=c.cells,w=0;for(let x=0,E,k=p.length,N,T,R;x<k&&(E=p[x],!!E);x++)if(N=E.rowSpan-1,T=E.colSpan-1,s){if(R=x+w,d.length>0){const M=!p[x+1];for(let A=0,D;A<d.length;A++)D=d[A],!(D.row>C)&&(R>=D.index?(w+=D.cs,R=x+w,D.rs-=1,D.row=C+1,D.rs<1&&(d.splice(A,1),A--)):M&&(D.rs-=1,D.row=C+1,D.rs<1&&(d.splice(A,1),A--)))}N>0&&f.push({rs:N,cs:T+1,index:R,row:-1}),R>=u&&R+T<=u+l?b.push(E):R<=u+l&&R+T>=u?E.colSpan-=i.getOverlapRangeAtIndex(a,a+l,R,R+T):N>0&&(R<u||R+T>u+l)&&_.push({cell:E,i:C,rs:C+N}),w+=T}else{if(x>=u)break;if(T>0){if(h<1&&T+x>=u){E.colSpan+=1,u=null,h=N+1;break}u-=T}if(!y){for(let M=0,A;M<d.length;M++)A=d[M],u-=A.cs,A.rs-=1,A.rs<1&&(d.splice(M,1),M--);y=!0}}if(d=d.concat(f).sort(function(x,E){return x.index-E.index}),f=[],!s){if(h>0){h-=1;continue}u!==null&&p.length>0&&(v=this.plugins.table.createCells.call(this,p[0].nodeName,0,!0),v=c.insertBefore(v,p[u]))}}if(s){let C,S;for(let c=0,u=b.length,p;c<u;c++)p=b[c].parentNode,i.removeItem(b[c]),p.cells.length===0&&(C||(C=i.getArrayIndex(r,p)),S=i.getArrayIndex(r,p),i.removeItem(p));for(let c=0,u=_.length,p;c<u;c++)p=_[c],p.cell.rowSpan=i.getOverlapRangeAtIndex(C,S,p.i,p.rs);this.controllersOff()}else this.plugins.table.setPositionControllerDiv.call(this,t||n._tdElement,!0)},_closeSplitMenu:null,openSplitMenu:function(){this.util.addClass(this.context.table.splitButton,"on"),this.context.table.splitMenu.style.display="inline-table",this.plugins.table._closeSplitMenu=(function(){this.util.removeClass(this.context.table.splitButton,"on"),this.context.table.splitMenu.style.display="none",this.removeDocEvent("click",this.plugins.table._closeSplitMenu),this.plugins.table._closeSplitMenu=null}).bind(this),this.addDocEvent("click",this.plugins.table._closeSplitMenu)},splitCells:function(e){const t=this.util,n=e==="vertical",i=this.context.table,s=i._tdElement,o=i._trElements,l=i._trElement,a=i._logical_cellIndex,r=i._rowIndex,f=this.plugins.table.createCells.call(this,s.nodeName,0,!0);if(n){const d=s.colSpan;if(f.rowSpan=s.rowSpan,d>1)f.colSpan=this._w.Math.floor(d/2),s.colSpan=d-f.colSpan,l.insertBefore(f,s.nextElementSibling);else{let h=[],b=[];for(let _=0,C=i._rowCnt,S,c;_<C;_++){S=o[_].cells,c=0;for(let u=0,p=S.length,v,y,w,x;u<p;u++){if(v=S[u],y=v.colSpan-1,w=v.rowSpan-1,x=u+c,b.length>0)for(let E=0,k;E<b.length;E++)k=b[E],!(k.row>_)&&(x>=k.index?(c+=k.cs,x+=k.cs,k.rs-=1,k.row=_+1,k.rs<1&&(b.splice(E,1),E--)):u===p-1&&(k.rs-=1,k.row=_+1,k.rs<1&&(b.splice(E,1),E--)));if(x<=a&&w>0&&h.push({index:x,cs:y+1,rs:w,row:-1}),v!==s&&x<=a&&x+y>=a+d-1){v.colSpan+=1;break}if(x>a)break;c+=y}b=b.concat(h).sort(function(u,p){return u.index-p.index}),h=[]}l.insertBefore(f,s.nextElementSibling)}}else{const d=s.rowSpan;if(f.colSpan=s.colSpan,d>1){f.rowSpan=this._w.Math.floor(d/2);const h=d-f.rowSpan,b=[],_=t.getArrayIndex(o,l)+h;for(let u=0,p,v;u<_;u++){p=o[u].cells,v=0;for(let y=0,w=p.length,x,E,k;y<w&&(k=y+v,!(k>=a));y++)x=p[y],E=x.rowSpan-1,E>0&&E+u>=_&&k<a&&b.push({index:k,cs:x.colSpan}),v+=x.colSpan-1}const C=o[_],S=C.cells;let c=b.shift();for(let u=0,p=S.length,v=0,y,w,x,E;u<p;u++){if(x=u+v,y=S[u],w=y.colSpan-1,E=x+w+1,c&&E>=c.index&&(v+=c.cs,E+=c.cs,c=b.shift()),E>=a||u===p-1){C.insertBefore(f,y.nextElementSibling);break}v+=w}s.rowSpan=h}else{f.rowSpan=s.rowSpan;const h=t.createElement("TR");h.appendChild(f);for(let C=0,S;C<r;C++){if(S=o[C].cells,S.length===0)return;for(let c=0,u=S.length;c<u;c++)C+S[c].rowSpan-1>=r&&(S[c].rowSpan+=1)}const b=i._physical_cellIndex,_=l.cells;for(let C=0,S=_.length;C<S;C++)C!==b&&(_[C].rowSpan+=1);l.parentNode.insertBefore(h,l.nextElementSibling)}}this.focusEdge(s),this.plugins.table.setPositionControllerDiv.call(this,s,!0)},mergeCells:function(){const e=this.plugins.table,t=this.context.table,n=this.util,i=e._ref,s=e._selectedCells,o=s[0];let l=null,a=null,r=i.ce-i.cs+1,f=i.re-i.rs+1,d="",h=null;for(let b=1,_=s.length,C,S;b<_;b++){C=s[b],h!==C.parentNode&&(h=C.parentNode),S=C.children;for(let c=0,u=S.length;c<u;c++)n.isFormatElement(S[c])&&n.onlyZeroWidthSpace(S[c].textContent)&&n.removeItem(S[c]);d+=C.innerHTML,n.removeItem(C),h.cells.length===0&&(l?a=h:l=h,f-=1)}if(l){const b=t._trElements,_=n.getArrayIndex(b,l),C=n.getArrayIndex(b,a||l),S=[];for(let c=0,u;c<=C;c++){if(u=b[c].cells,u.length===0){S.push(b[c]);continue}for(let p=0,v=u.length,y,w;p<v;p++)y=u[p],w=y.rowSpan-1,w>0&&c+w>=_&&(y.rowSpan-=n.getOverlapRangeAtIndex(_,C,c,c+w))}for(let c=0,u=S.length;c<u;c++)n.removeItem(S[c])}o.innerHTML+=d,o.colSpan=r,o.rowSpan=f,this.controllersOff(),e.setActiveButton.call(this,!0,!1),e.call_controller_tableEdit.call(this,o),n.addClass(o,"se-table-selected-cell"),this.focusEdge(o)},toggleHeader:function(){const e=this.util,t=this.context.table.headerButton,n=e.hasClass(t,"active"),i=this.context.table._element;if(n)e.removeItem(i.querySelector("thead"));else{const s=e.createElement("THEAD");s.innerHTML="<tr>"+this.plugins.table.createCells.call(this,"th",this.context.table._logical_cellCnt,!1)+"</tr>",i.insertBefore(s,i.firstElementChild)}e.toggleClass(t,"active"),/TH/i.test(this.context.table._tdElement.nodeName)?this.controllersOff():this.plugins.table.setPositionControllerDiv.call(this,this.context.table._tdElement,!1)},setTableStyle:function(e){const t=this.context.table,n=t._element;let i,s,o,l;e.indexOf("width")>-1&&(i=t.resizeButton.firstElementChild,s=t.resizeText,t._maxWidth?(o=t.icons.reduction,l=t.minText,t.columnFixedButton.style.display="block",this.util.removeClass(n,"se-table-size-auto"),this.util.addClass(n,"se-table-size-100")):(o=t.icons.expansion,l=t.maxText,t.columnFixedButton.style.display="none",this.util.removeClass(n,"se-table-size-100"),this.util.addClass(n,"se-table-size-auto")),this.util.changeElement(i,o),this.util.changeTxt(s,l)),e.indexOf("column")>-1&&(t._fixedColumn?(this.util.removeClass(n,"se-table-layout-auto"),this.util.addClass(n,"se-table-layout-fixed"),this.util.addClass(t.columnFixedButton,"active")):(this.util.removeClass(n,"se-table-layout-fixed"),this.util.addClass(n,"se-table-layout-auto"),this.util.removeClass(t.columnFixedButton,"active")))},setActiveButton:function(e,t){const n=this.context.table;/^TH$/i.test(e.nodeName)?(n.insertRowAboveButton.setAttribute("disabled",!0),n.insertRowBelowButton.setAttribute("disabled",!0)):(n.insertRowAboveButton.removeAttribute("disabled"),n.insertRowBelowButton.removeAttribute("disabled")),!t||e===t?(n.splitButton.removeAttribute("disabled"),n.mergeButton.setAttribute("disabled",!0)):(n.splitButton.setAttribute("disabled",!0),n.mergeButton.removeAttribute("disabled"))},_bindOnSelect:null,_bindOffSelect:null,_bindOffShift:null,_selectedCells:null,_shift:!1,_fixedCell:null,_fixedCellName:null,_selectedCell:null,_selectedTable:null,_ref:null,_toggleEditor:function(e){this.context.element.wysiwyg.setAttribute("contenteditable",e),e?this.util.removeClass(this.context.element.wysiwyg,"se-disabled"):this.util.addClass(this.context.element.wysiwyg,"se-disabled")},_offCellMultiSelect:function(e){e.stopPropagation();const t=this.plugins.table;t._shift?t._initBind&&(this._wd.removeEventListener("touchmove",t._initBind),t._initBind=null):(t._removeEvents.call(this),t._toggleEditor.call(this,!0)),!(!t._fixedCell||!t._selectedTable)&&(t.setActiveButton.call(this,t._fixedCell,t._selectedCell),t.call_controller_tableEdit.call(this,t._selectedCell||t._fixedCell),t._selectedCells=t._selectedTable.querySelectorAll(".se-table-selected-cell"),t._selectedCell&&t._fixedCell&&this.focusEdge(t._selectedCell),t._shift||(t._fixedCell=null,t._selectedCell=null,t._fixedCellName=null))},_onCellMultiSelect:function(e){this._antiBlur=!0;const t=this.plugins.table,n=this.util.getParentElement(e.target,this.util.isCell);if(t._shift)n===t._fixedCell?t._toggleEditor.call(this,!0):t._toggleEditor.call(this,!1);else if(!t._ref){if(n===t._fixedCell)return;t._toggleEditor.call(this,!1)}!n||n===t._selectedCell||t._fixedCellName!==n.nodeName||t._selectedTable!==this.util.getParentElement(n,"TABLE")||(t._selectedCell=n,t._setMultiCells.call(this,t._fixedCell,n))},_setMultiCells:function(e,t){const n=this.plugins.table,i=n._selectedTable.rows,s=this.util,o=n._selectedTable.querySelectorAll(".se-table-selected-cell");for(let d=0,h=o.length;d<h;d++)s.removeClass(o[d],"se-table-selected-cell");if(e===t&&(s.addClass(e,"se-table-selected-cell"),!n._shift))return;let l=!0,a=[],r=[];const f=n._ref={_i:0,cs:null,ce:null,rs:null,re:null};for(let d=0,h=i.length,b,_;d<h;d++){b=i[d].cells,_=0;for(let C=0,S=b.length,c,u,p,v;C<S;C++){if(c=b[C],p=c.colSpan-1,v=c.rowSpan-1,u=C+_,a.length>0)for(let y=0,w;y<a.length;y++)w=a[y],!(w.row>d)&&(u>=w.index?(_+=w.cs,u+=w.cs,w.rs-=1,w.row=d+1,w.rs<1&&(a.splice(y,1),y--)):C===S-1&&(w.rs-=1,w.row=d+1,w.rs<1&&(a.splice(y,1),y--)));if(l){if((c===e||c===t)&&(f.cs=f.cs!==null&&f.cs<u?f.cs:u,f.ce=f.ce!==null&&f.ce>u+p?f.ce:u+p,f.rs=f.rs!==null&&f.rs<d?f.rs:d,f.re=f.re!==null&&f.re>d+v?f.re:d+v,f._i+=1),f._i===2){l=!1,a=[],r=[],d=-1;break}}else if(s.getOverlapRangeAtIndex(f.cs,f.ce,u,u+p)&&s.getOverlapRangeAtIndex(f.rs,f.re,d,d+v)){const y=f.cs<u?f.cs:u,w=f.ce>u+p?f.ce:u+p,x=f.rs<d?f.rs:d,E=f.re>d+v?f.re:d+v;if(f.cs!==y||f.ce!==w||f.rs!==x||f.re!==E){f.cs=y,f.ce=w,f.rs=x,f.re=E,d=-1,a=[],r=[];break}s.addClass(c,"se-table-selected-cell")}v>0&&r.push({index:u,cs:p+1,rs:v,row:-1}),_+=c.colSpan-1}a=a.concat(r).sort(function(C,S){return C.index-S.index}),r=[]}},_removeEvents:function(){const e=this.plugins.table;e._initBind&&(this._wd.removeEventListener("touchmove",e._initBind),e._initBind=null),e._bindOnSelect&&(this._wd.removeEventListener("mousedown",e._bindOnSelect),this._wd.removeEventListener("mousemove",e._bindOnSelect),e._bindOnSelect=null),e._bindOffSelect&&(this._wd.removeEventListener("mouseup",e._bindOffSelect),e._bindOffSelect=null),e._bindOffShift&&(this._wd.removeEventListener("keyup",e._bindOffShift),e._bindOffShift=null)},_initBind:null,onTableCellMultiSelect:function(e,t){const n=this.plugins.table;n._removeEvents.call(this),this.controllersOff(),n._shift=t,n._fixedCell=e,n._fixedCellName=e.nodeName,n._selectedTable=this.util.getParentElement(e,"TABLE");const i=n._selectedTable.querySelectorAll(".se-table-selected-cell");for(let s=0,o=i.length;s<o;s++)this.util.removeClass(i[s],"se-table-selected-cell");this.util.addClass(e,"se-table-selected-cell"),n._bindOnSelect=n._onCellMultiSelect.bind(this),n._bindOffSelect=n._offCellMultiSelect.bind(this),t?(n._bindOffShift=(function(){this.controllersOn(this.context.table.resizeDiv,this.context.table.tableController,this.plugins.table.init.bind(this),e,"table"),n._ref||this.controllersOff()}).bind(this),this._wd.addEventListener("keyup",n._bindOffShift,!1),this._wd.addEventListener("mousedown",n._bindOnSelect,!1)):this._wd.addEventListener("mousemove",n._bindOnSelect,!1),this._wd.addEventListener("mouseup",n._bindOffSelect,!1),n._initBind=n.init.bind(this),this._wd.addEventListener("touchmove",n._initBind,!1)},onClick_tableController:function(e){e.stopPropagation();const t=e.target.getAttribute("data-command")?e.target:e.target.parentNode;if(t.getAttribute("disabled"))return;const n=t.getAttribute("data-command"),i=t.getAttribute("data-value"),s=t.getAttribute("data-option"),o=this.plugins.table;if(typeof o._closeSplitMenu=="function"&&(o._closeSplitMenu(),n==="onsplit")||!n)return;e.preventDefault();const l=this.context.table;switch(n){case"insert":case"delete":o.editTable.call(this,i,s);break;case"header":o.toggleHeader.call(this);break;case"onsplit":o.openSplitMenu.call(this);break;case"split":o.splitCells.call(this,i);break;case"merge":o.mergeCells.call(this);break;case"resize":l._maxWidth=!l._maxWidth,o.setTableStyle.call(this,"width"),o.setPositionControllerTop.call(this,l._element),o.setPositionControllerDiv.call(this,l._tdElement,o._shift);break;case"layout":l._fixedColumn=!l._fixedColumn,o.setTableStyle.call(this,"column"),o.setPositionControllerTop.call(this,l._element),o.setPositionControllerDiv.call(this,l._tdElement,o._shift);break;case"remove":const a=l._element.parentNode;this.util.removeItem(l._element),this.controllersOff(),a!==this.context.element.wysiwyg&&this.util.removeItemAllParents(a,function(r){return r.childNodes.length===0},null),this.focus()}this.history.push(!1)}},jC={name:"formatBlock",display:"submenu",add:function(e,t){const n=e.context;n.formatBlock={targetText:t.querySelector(".txt"),targetTooltip:t.parentNode.querySelector(".se-tooltip-text"),_formatList:null,currentFormat:""};let i=this.setSubmenu(e);i.querySelector("ul").addEventListener("click",this.pickUp.bind(e)),n.formatBlock._formatList=i.querySelectorAll("li button"),e.initMenuTarget(this.name,t,i),i=null},setSubmenu:function(e){const t=e.options,n=e.lang.toolbar,i=e.util.createElement("DIV");i.className="se-submenu se-list-layer se-list-format";const s=["p","div","blockquote","pre","h1","h2","h3","h4","h5","h6"],o=!t.formats||t.formats.length===0?s:t.formats;let l='<div class="se-list-inner"><ul class="se-list-basic">';for(let a=0,r=o.length,f,d,h,b,_,C,S;a<r;a++)f=o[a],typeof f=="string"&&s.indexOf(f)>-1?(d=f.toLowerCase(),h=d==="blockquote"?"range":d==="pre"?"free":"replace",_=/^h/.test(d)?d.match(/\d+/)[0]:"",b=n["tag_"+(_?"h":d)]+_,S="",C=""):(d=f.tag.toLowerCase(),h=f.command,b=f.name||d,S=f.class,C=S?' class="'+S+'"':""),l+='<li><button type="button" class="se-btn-list" data-command="'+h+'" data-value="'+d+'" data-class="'+S+'" title="'+b+'" aria-label="'+b+'"><'+d+C+">"+b+"</"+d+"></button></li>";return l+="</ul></div>",i.innerHTML=l,i},active:function(e){let t=this.lang.toolbar.formats;const n=this.context.formatBlock.targetText;if(!e)this.util.changeTxt(n,t);else if(this.util.isFormatElement(e)){const s=this.context.formatBlock._formatList,o=e.nodeName.toLowerCase(),l=(e.className.match(/(\s|^)__se__format__[^\s]+/)||[""])[0].trim();for(let a=0,r=s.length,f;a<r;a++)if(f=s[a],o===f.getAttribute("data-value")&&l===f.getAttribute("data-class")){t=f.title;break}return this.util.changeTxt(n,t),n.setAttribute("data-value",o),n.setAttribute("data-class",l),!0}return!1},on:function(){const e=this.context.formatBlock,t=e._formatList,n=e.targetText,i=(n.getAttribute("data-value")||"")+(n.getAttribute("data-class")||"");if(i!==e.currentFormat){for(let s=0,o=t.length,l;s<o;s++)l=t[s],i===l.getAttribute("data-value")+l.getAttribute("data-class")?this.util.addClass(l,"active"):this.util.removeClass(l,"active");e.currentFormat=i}},pickUp:function(e){e.preventDefault(),e.stopPropagation();let t=e.target,n=null,i=null,s=null,o="";for(;!n&&!/UL/i.test(t.tagName);){if(n=t.getAttribute("data-command"),i=t.getAttribute("data-value"),o=t.getAttribute("data-class"),n){s=t.firstChild;break}t=t.parentNode}if(n){if(n==="range"){const l=s.cloneNode(!1);this.applyRangeFormatElement(l)}else{let l=this.getRange(),a=this.getSelectedElementsAndComponents(!1);if(a.length===0&&(l=this.getRange_addLine(l,null),a=this.getSelectedElementsAndComponents(!1),a.length===0))return;const r=l.startOffset,f=l.endOffset,d=this.util;let h=a[0],b=a[a.length-1];const _=d.getNodePath(l.startContainer,h,null,null),C=d.getNodePath(l.endContainer,b,null,null),S=this.detachList(a,!1);S.sc&&(h=S.sc),S.ec&&(b=S.ec),this.setRange(d.getNodeFromPath(_,h),r,d.getNodeFromPath(C,b),f);const c=this.getSelectedElementsAndComponents(!1);if(n==="free"){const u=c.length-1;let p=c[u].parentNode,v=s.cloneNode(!1);const y=v;for(let w=u,x,E,k,N,T,R,M=!0;w>=0;w--)if(x=c[w],x!==(c[w+1]?c[w+1].parentNode:null)){if(R=d.isComponent(x),E=R?"":x.innerHTML.replace(/(?!>)\s+(?=<)|\n/g," "),k=d.getParentElement(x,function(A){return A.parentNode===p}),(p!==x.parentNode||R)&&(d.isFormatElement(p)?(p.parentNode.insertBefore(v,p.nextSibling),p=p.parentNode):(p.insertBefore(v,k?k.nextSibling:null),p=x.parentNode),N=v.nextSibling,N&&v.nodeName===N.nodeName&&d.isSameAttributes(v,N)&&(v.innerHTML+="<BR>"+N.innerHTML,d.removeItem(N)),v=s.cloneNode(!1),M=!0),T=v.innerHTML,v.innerHTML=(M||!E||!T||/<br>$/i.test(E)?E:E+"<BR>")+T,w===0){p.insertBefore(v,x),N=x.nextSibling,N&&v.nodeName===N.nodeName&&d.isSameAttributes(v,N)&&(v.innerHTML+="<BR>"+N.innerHTML,d.removeItem(N));const A=v.previousSibling;A&&v.nodeName===A.nodeName&&d.isSameAttributes(v,A)&&(A.innerHTML+="<BR>"+v.innerHTML,d.removeItem(v))}R||d.removeItem(x),E&&(M=!1)}this.setRange(y,0,y,0)}else{for(let u=0,p=c.length,v,y;u<p;u++)v=c[u],(v.nodeName.toLowerCase()!==i.toLowerCase()||(v.className.match(/(\s|^)__se__format__[^\s]+/)||[""])[0].trim()!==o)&&!d.isComponent(v)&&(y=s.cloneNode(!1),d.copyFormatAttributes(y,v),y.innerHTML=v.innerHTML,v.parentNode.replaceChild(y,v)),u===0&&(h=y||v),u===p-1&&(b=y||v),y=null;this.setRange(d.getNodeFromPath(_,h),r,d.getNodeFromPath(C,b),f)}this.history.push(!1)}this.submenuOff()}}},zC={name:"lineHeight",display:"submenu",add:function(e,t){const n=e.context;n.lineHeight={_sizeList:null,currentSize:-1};let i=this.setSubmenu(e),s=i.querySelector("ul");s.addEventListener("click",this.pickup.bind(e)),n.lineHeight._sizeList=s.querySelectorAll("li button"),e.initMenuTarget(this.name,t,i),i=null,s=null},setSubmenu:function(e){const t=e.options,n=e.lang,i=e.util.createElement("DIV");i.className="se-submenu se-list-layer";const s=t.lineHeights?t.lineHeights:[{text:"1",value:1},{text:"1.15",value:1.15},{text:"1.5",value:1.5},{text:"2",value:2}];let o='<div class="se-list-inner"><ul class="se-list-basic"><li><button type="button" class="default_value se-btn-list" title="'+n.toolbar.default+'" aria-label="'+n.toolbar.default+'">('+n.toolbar.default+")</button></li>";for(let l=0,a=s.length,r;l<a;l++)r=s[l],o+='<li><button type="button" class="se-btn-list" data-value="'+r.value+'" title="'+r.text+'" aria-label="'+r.text+'">'+r.text+"</button></li>";return o+="</ul></div>",i.innerHTML=o,i},on:function(){const e=this.context.lineHeight,t=e._sizeList,n=this.util.getFormatElement(this.getSelectionNode()),i=n?n.style.lineHeight+"":"";if(i!==e.currentSize){for(let s=0,o=t.length;s<o;s++)i===t[s].getAttribute("data-value")?this.util.addClass(t[s],"active"):this.util.removeClass(t[s],"active");e.currentSize=i}},pickup:function(e){if(!/^BUTTON$/i.test(e.target.tagName))return!1;e.preventDefault(),e.stopPropagation();const t=e.target.getAttribute("data-value")||"",n=this.getSelectedElements();for(let i=0,s=n.length;i<s;i++)n[i].style.lineHeight=t;this.submenuOff(),this.history.push(!1)}},HC={name:"template",display:"submenu",add:function(e,t){const n=e.context;n.template={selectedIndex:-1};let i=this.setSubmenu(e);i.querySelector("ul").addEventListener("click",this.pickup.bind(e)),e.initMenuTarget(this.name,t,i),i=null},setSubmenu:function(e){const t=e.options.templates;if(!t||t.length===0)throw Error('[SUNEDITOR.plugins.template.fail] To use the "template" plugin, please define the "templates" option.');const n=e.util.createElement("DIV");n.className="se-list-layer";let i='<div class="se-submenu se-list-inner"><ul class="se-list-basic">';for(let s=0,o=t.length,l;s<o;s++)l=t[s],i+='<li><button type="button" class="se-btn-list" data-value="'+s+'" title="'+l.name+'" aria-label="'+l.name+'">'+l.name+"</button></li>";return i+="</ul></div>",n.innerHTML=i,n},pickup:function(e){if(!/^BUTTON$/i.test(e.target.tagName))return!1;e.preventDefault(),e.stopPropagation(),this.context.template.selectedIndex=e.target.getAttribute("data-value")*1;const t=this.options.templates[this.context.template.selectedIndex];if(t.html)this.setContents(t.html);else throw this.submenuOff(),Error('[SUNEDITOR.template.fail] cause : "templates[i].html not found"');this.submenuOff()}},VC={name:"paragraphStyle",display:"submenu",add:function(e,t){const n=e.context;n.paragraphStyle={_classList:null};let i=this.setSubmenu(e);i.querySelector("ul").addEventListener("click",this.pickUp.bind(e)),n.paragraphStyle._classList=i.querySelectorAll("li button"),e.initMenuTarget(this.name,t,i),i=null},setSubmenu:function(e){const t=e.options,n=e.util.createElement("DIV");n.className="se-submenu se-list-layer se-list-format";const i=e.lang.menu,s={spaced:{name:i.spaced,class:"__se__p-spaced",_class:""},bordered:{name:i.bordered,class:"__se__p-bordered",_class:""},neon:{name:i.neon,class:"__se__p-neon",_class:""}},o=!t.paragraphStyles||t.paragraphStyles.length===0?["spaced","bordered","neon"]:t.paragraphStyles;let l='<div class="se-list-inner"><ul class="se-list-basic">';for(let a=0,r=o.length,f,d,h,b;a<r;a++){if(f=o[a],typeof f=="string"){const _=s[f.toLowerCase()];if(!_)continue;f=_}d=f.name,h=f.class?' class="'+f.class+'"':"",b=f._class,l+='<li><button type="button" class="se-btn-list'+(b?" "+b:"")+'" data-value="'+f.class+'" title="'+d+'" aria-label="'+d+'"><div'+h+">"+d+"</div></button></li>"}return l+="</ul></div>",n.innerHTML=l,n},on:function(){const t=this.context.paragraphStyle._classList,n=this.util.getFormatElement(this.getSelectionNode());for(let i=0,s=t.length;i<s;i++)this.util.hasClass(n,t[i].getAttribute("data-value"))?this.util.addClass(t[i],"active"):this.util.removeClass(t[i],"active")},pickUp:function(e){e.preventDefault(),e.stopPropagation();let t=e.target,n=null;for(;!/^UL$/i.test(t.tagName)&&(n=t.getAttribute("data-value"),!n);)t=t.parentNode;if(!n)return;let i=this.getSelectedElements();if(i.length===0&&(this.getRange_addLine(this.getRange(),null),i=this.getSelectedElements(),i.length===0))return;const s=this.util.hasClass(t,"active")?this.util.removeClass.bind(this.util):this.util.addClass.bind(this.util);for(let o=0,l=i.length;o<l;o++)s(i[o],n);this.submenuOff(),this.history.push(!1)}},WC={name:"textStyle",display:"submenu",add:function(e,t){const n=e.context;n.textStyle={_styleList:null};let i=this.setSubmenu(e),s=i.querySelector("ul");s.addEventListener("click",this.pickup.bind(e)),n.textStyle._styleList=i.querySelectorAll("li button"),e.initMenuTarget(this.name,t,i),i=null,s=null},setSubmenu:function(e){const t=e.options,n=e.util.createElement("DIV");n.className="se-submenu se-list-layer se-list-format";const i={code:{name:e.lang.menu.code,class:"__se__t-code",tag:"code"},translucent:{name:e.lang.menu.translucent,style:"opacity: 0.5;",tag:"span"},shadow:{name:e.lang.menu.shadow,class:"__se__t-shadow",tag:"span"}},s=t.textStyles?t.textStyles:e._w.Object.keys(i);let o='<div class="se-list-inner"><ul class="se-list-basic">';for(let l=0,a=s.length,r,f,d,h,b,_,C;l<a;l++){if(r=s[l],h="",_="",b=[],typeof r=="string"){const S=i[r.toLowerCase()];if(!S)continue;r=S}d=r.name,f=r.tag||"span",C=r._class,r.style&&(h+=' style="'+r.style+'"',_+=r.style.replace(/:[^;]+(;|$)\s*/g,","),b.push("style")),r.class&&(h+=' class="'+r.class+'"',_+="."+r.class.trim().replace(/\s+/g,",."),b.push("class")),_=_.replace(/,$/,""),o+='<li><button type="button" class="se-btn-list'+(C?" "+C:"")+'" data-command="'+f+'" data-value="'+_+'" title="'+d+'" aria-label="'+d+'"><'+f+h+">"+d+"</"+f+"></button></li>"}return o+="</ul></div>",n.innerHTML=o,n},on:function(){const e=this.util,n=this.context.textStyle._styleList,i=this.getSelectionNode();for(let s=0,o=n.length,l,a,r;s<o;s++){l=n[s],a=l.getAttribute("data-value").split(",");for(let f=0,d,h;f<a.length;f++){for(d=i,r=!1;d&&!e.isFormatElement(d)&&!e.isComponent(d);){if(d.nodeName.toLowerCase()===l.getAttribute("data-command").toLowerCase()&&(h=a[f],/^\./.test(h)?e.hasClass(d,h.replace(/^\./,"")):d.style[h])){r=!0;break}d=d.parentNode}if(!r)break}r?e.addClass(l,"active"):e.removeClass(l,"active")}},pickup:function(e){e.preventDefault(),e.stopPropagation();let t=e.target,n=null,i=null;for(;!n&&!/UL/i.test(t.tagName);){if(n=t.getAttribute("data-command"),n){i=t.firstChild;break}t=t.parentNode}if(!n)return;const s=i.style.cssText.replace(/:.+(;|$)/g,",").split(",");s.pop();const o=i.classList;for(let r=0,f=o.length;r<f;r++)s.push("."+o[r]);const l=this.util.hasClass(t,"active")?null:i.cloneNode(!1),a=l?null:[i.nodeName];this.nodeChange(l,s,a,!0),this.submenuOff()}};var ah={exports:{}};(function(e){(function(t,n){e.exports=t.document?n(t,!0):function(i){if(!i.document)throw new Error("SUNEDITOR_MODULES a window with a document");return n(i)}})(typeof window<"u"?window:Yn,function(t,n){const i={name:"dialog",add:function(s){const o=s.context;o.dialog={kind:"",updateModal:!1,_closeSignal:!1};let l=s.util.createElement("DIV");l.className="se-dialog sun-editor-common";let a=s.util.createElement("DIV");a.className="se-dialog-back",a.style.display="none";let r=s.util.createElement("DIV");r.className="se-dialog-inner",r.style.display="none",l.appendChild(a),l.appendChild(r),o.dialog.modalArea=l,o.dialog.back=a,o.dialog.modal=r,o.dialog.modal.addEventListener("mousedown",this._onMouseDown_dialog.bind(s)),o.dialog.modal.addEventListener("click",this._onClick_dialog.bind(s)),o.element.relative.appendChild(l),l=null,a=null,r=null},_onMouseDown_dialog:function(s){/se-dialog-inner/.test(s.target.className)?this.context.dialog._closeSignal=!0:this.context.dialog._closeSignal=!1},_onClick_dialog:function(s){(/close/.test(s.target.getAttribute("data-command"))||this.context.dialog._closeSignal)&&this.plugins.dialog.close.call(this)},open:function(s,o){if(this.modalForm)return!1;this.plugins.dialog._bindClose&&(this._d.removeEventListener("keydown",this.plugins.dialog._bindClose),this.plugins.dialog._bindClose=null),this.plugins.dialog._bindClose=(function(a){/27/.test(a.keyCode)&&this.plugins.dialog.close.call(this)}).bind(this),this._d.addEventListener("keydown",this.plugins.dialog._bindClose),this.context.dialog.updateModal=o,this.options.popupDisplay==="full"?this.context.dialog.modalArea.style.position="fixed":this.context.dialog.modalArea.style.position="absolute",this.context.dialog.kind=s,this.modalForm=this.context[s].modal;const l=this.context[s].focusElement;typeof this.plugins[s].on=="function"&&this.plugins[s].on.call(this,o),this.context.dialog.modalArea.style.display="block",this.context.dialog.back.style.display="block",this.context.dialog.modal.style.display="block",this.modalForm.style.display="block",l&&l.focus()},_bindClose:null,close:function(){this.plugins.dialog._bindClose&&(this._d.removeEventListener("keydown",this.plugins.dialog._bindClose),this.plugins.dialog._bindClose=null);const s=this.context.dialog.kind;this.modalForm.style.display="none",this.context.dialog.back.style.display="none",this.context.dialog.modalArea.style.display="none",this.context.dialog.updateModal=!1,typeof this.plugins[s].init=="function"&&this.plugins[s].init.call(this),this.context.dialog.kind="",this.modalForm=null,this.focus()}};return typeof n>"u"&&(t.SUNEDITOR_MODULES||Object.defineProperty(t,"SUNEDITOR_MODULES",{enumerable:!0,writable:!1,configurable:!1,value:{}}),Object.defineProperty(t.SUNEDITOR_MODULES,"dialog",{enumerable:!0,writable:!1,configurable:!1,value:i})),i})})(ah);var $C=ah.exports;const Fi=Zn($C),UC={name:"selectMenu",add:function(e){e.context.selectMenu={caller:{},callerContext:null}},setForm:function(){return'<div class="se-select-list"></div>'},createList:function(e,t,n){e.form.innerHTML="<ul>"+n+"</ul>",e.items=t,e.menus=e.form.querySelectorAll("li")},initEvent:function(e,t){const n=t.querySelector(".se-select-list"),i=this.context.selectMenu.caller[e]={form:n,items:[],menus:[],index:-1,item:null,clickMethod:null,callerName:e};n.addEventListener("mousedown",this.plugins.selectMenu.onMousedown_list),n.addEventListener("mousemove",this.plugins.selectMenu.onMouseMove_list.bind(this,i)),n.addEventListener("click",this.plugins.selectMenu.onClick_list.bind(this,i))},onMousedown_list:function(e){e.preventDefault(),e.stopPropagation()},onMouseMove_list:function(e,t){this.util.addClass(e.form,"__se_select-menu-mouse-move");const n=t.target.getAttribute("data-index");n&&(e.index=n*1)},onClick_list:function(e,t){const n=t.target.getAttribute("data-index");n&&e.clickMethod.call(this,e.items[n])},moveItem:function(e,t){this.util.removeClass(e.form,"__se_select-menu-mouse-move"),t=e.index+t;const n=e.menus,i=n.length,s=e.index=t>=i?0:t<0?i-1:t;for(let o=0;o<i;o++)o===s?this.util.addClass(n[o],"active"):this.util.removeClass(n[o],"active");e.item=e.items[s]},getItem:function(e,t){return t=!t||t<0?e.index:t,e.items[t]},on:function(e,t){const n=this.context.selectMenu.caller[e];this.context.selectMenu.callerContext=n,n.clickMethod=t,n.callerName=e},open:function(e,t){const n=e.form;n.style.visibility="hidden",n.style.display="block",t(n),n.style.visibility=""},close:function(e){e.form.style.display="none",e.items=[],e.menus=[],e.index=-1,e.item=null},init:function(e){e&&(e.items=[],e.menus=[],e.index=-1,e.item=null,e.callerName="",this.context.selectMenu.callerContext=null)}},ch={name:"anchor",add:function(e){e.addModule([UC]),e.context.anchor={caller:{},forms:this.setDialogForm(e),host:(e._w.location.origin+e._w.location.pathname).replace(/\/$/,""),callerContext:null}},setDialogForm:function(e){const t=e.lang,n=e.options.linkRel,i=(e.options.linkRelDefault.default||"").split(" "),s=e.icons,o=e.util.createElement("DIV");let l='<div class="se-dialog-body"><div class="se-dialog-form"><label>'+t.dialogBox.linkBox.url+'</label><div class="se-dialog-form-files"><input class="se-input-form se-input-url" type="text" placeholder="'+(e.options.protocol||"")+'" /><button type="button" class="se-btn se-dialog-files-edge-button _se_bookmark_button" title="'+t.dialogBox.linkBox.bookmark+'" aria-label="'+t.dialogBox.linkBox.bookmark+'">'+s.bookmark+"</button>"+e.plugins.selectMenu.setForm()+'</div><div class="se-anchor-preview-form"><span class="se-svg se-anchor-preview-icon _se_anchor_bookmark_icon">'+s.bookmark+'</span><span class="se-svg se-anchor-preview-icon _se_anchor_download_icon">'+s.download+'</span><pre class="se-link-preview"></pre></div></div><div class="se-dialog-form"><label>'+t.dialogBox.linkBox.text+'</label><input class="se-input-form _se_anchor_text" type="text" /></div><div class="se-dialog-form-footer"><label><input type="checkbox" class="se-dialog-btn-check _se_anchor_check" /> '+t.dialogBox.linkBox.newWindowCheck+'</label><label><input type="checkbox" class="se-dialog-btn-check _se_anchor_download" /> '+t.dialogBox.linkBox.downloadLinkCheck+"</label>";if(n.length>0){l+='<div class="se-anchor-rel"><button type="button" class="se-btn se-btn-select se-anchor-rel-btn"><rel></button><div class="se-anchor-rel-wrapper"><pre class="se-link-preview se-anchor-rel-preview"></pre></div><div class="se-list-layer"><div class="se-list-inner"><ul class="se-list-basic se-list-checked">';for(let a=0,r=n.length,f;a<r;a++)f=n[a],l+='<li><button type="button" class="se-btn-list'+(i.indexOf(f)>-1?" se-checked":"")+'" data-command="'+f+'" title="'+f+'" aria-label="'+f+'"><span class="se-svg">'+s.checked+"</span>"+f+"</button></li>";l+="</ul></div></div></div>"}return l+="</div></div>",o.innerHTML=l,o},initEvent:function(e,t){const n=this.plugins.anchor,i=this.context.anchor.caller[e]={modal:t,urlInput:null,linkDefaultRel:this.options.linkRelDefault,defaultRel:this.options.linkRelDefault.default||"",currentRel:[],linkAnchor:null,linkValue:"",_change:!1,callerName:e};typeof i.linkDefaultRel.default=="string"&&(i.linkDefaultRel.default=i.linkDefaultRel.default.trim()),typeof i.linkDefaultRel.check_new_window=="string"&&(i.linkDefaultRel.check_new_window=i.linkDefaultRel.check_new_window.trim()),typeof i.linkDefaultRel.check_bookmark=="string"&&(i.linkDefaultRel.check_bookmark=i.linkDefaultRel.check_bookmark.trim()),i.urlInput=t.querySelector(".se-input-url"),i.anchorText=t.querySelector("._se_anchor_text"),i.newWindowCheck=t.querySelector("._se_anchor_check"),i.downloadCheck=t.querySelector("._se_anchor_download"),i.download=t.querySelector("._se_anchor_download_icon"),i.preview=t.querySelector(".se-link-preview"),i.bookmark=t.querySelector("._se_anchor_bookmark_icon"),i.bookmarkButton=t.querySelector("._se_bookmark_button"),this.plugins.selectMenu.initEvent.call(this,e,t);const s=this.context.selectMenu.caller[e];this.options.linkRel.length>0&&(i.relButton=t.querySelector(".se-anchor-rel-btn"),i.relList=t.querySelector(".se-list-layer"),i.relPreview=t.querySelector(".se-anchor-rel-preview"),i.relButton.addEventListener("click",n.onClick_relButton.bind(this,i)),i.relList.addEventListener("click",n.onClick_relList.bind(this,i))),i.newWindowCheck.addEventListener("change",n.onChange_newWindowCheck.bind(this,i)),i.downloadCheck.addEventListener("change",n.onChange_downloadCheck.bind(this,i)),i.anchorText.addEventListener("input",n.onChangeAnchorText.bind(this,i)),i.urlInput.addEventListener("input",n.onChangeUrlInput.bind(this,i)),i.urlInput.addEventListener("keydown",n.onKeyDownUrlInput.bind(this,s)),i.urlInput.addEventListener("focus",n.onFocusUrlInput.bind(this,i,s)),i.urlInput.addEventListener("blur",n.onBlurUrlInput.bind(this,s)),i.bookmarkButton.addEventListener("click",n.onClick_bookmarkButton.bind(this,i))},on:function(e,t){const n=this.plugins.anchor;if(!t)n.init.call(this,e),e.anchorText.value=this.getSelection().toString().trim(),e.newWindowCheck.checked=this.options.linkTargetNewWindow;else if(e.linkAnchor){this.context.dialog.updateModal=!0;const i=e.linkAnchor.getAttribute("href");e.linkValue=e.preview.textContent=e.urlInput.value=n.selfPathBookmark.call(this,i)?i.substr(i.lastIndexOf("#")):i,e.anchorText.value=e.linkAnchor.textContent,e.newWindowCheck.checked=!!/_blank/i.test(e.linkAnchor.target),e.downloadCheck.checked=e.linkAnchor.download}this.context.anchor.callerContext=e,n.setRel.call(this,e,t&&e.linkAnchor?e.linkAnchor.rel:e.defaultRel),n.setLinkPreview.call(this,e,e.linkValue),this.plugins.selectMenu.on.call(this,e.callerName,this.plugins.anchor.setHeaderBookmark)},selfPathBookmark:function(e){const t=this._w.location.href.replace(/\/$/,"");return e.indexOf("#")===0||e.indexOf(t)===0&&e.indexOf("#")===(t.indexOf("#")===-1?t.length:t.substr(0,t.indexOf("#")).length)},_closeRelMenu:null,toggleRelList:function(e,t){if(!t)this.plugins.anchor._closeRelMenu&&this.plugins.anchor._closeRelMenu();else{const n=e.relButton,i=e.relList;this.util.addClass(n,"active"),i.style.visibility="hidden",i.style.display="block",this.options.rtl?i.style.left=n.offsetLeft-i.offsetWidth-1+"px":i.style.left=n.offsetLeft+n.offsetWidth+1+"px",i.style.top=n.offsetTop+n.offsetHeight/2-i.offsetHeight/2+"px",i.style.visibility="",this.plugins.anchor._closeRelMenu=(function(s,o,l){l&&(s.relButton.contains(l.target)||s.relList.contains(l.target))||(this.util.removeClass(o,"active"),s.relList.style.display="none",this.modalForm.removeEventListener("click",this.plugins.anchor._closeRelMenu),this.plugins.anchor._closeRelMenu=null)}).bind(this,e,n),this.modalForm.addEventListener("click",this.plugins.anchor._closeRelMenu)}},onClick_relButton:function(e,t){this.plugins.anchor.toggleRelList.call(this,e,!this.util.hasClass(t.target,"active"))},onClick_relList:function(e,t){const n=t.target,i=n.getAttribute("data-command");if(!i)return;const s=e.currentRel,o=this.util.toggleClass(n,"se-checked"),l=s.indexOf(i);o?l===-1&&s.push(i):l>-1&&s.splice(l,1),e.relPreview.title=e.relPreview.textContent=s.join(" ")},setRel:function(e,t){const n=e.relList,i=e.currentRel=t?t.split(" "):[];if(!n)return;const s=n.querySelectorAll("button");for(let o=0,l=s.length,a;o<l;o++)a=s[o].getAttribute("data-command"),i.indexOf(a)>-1?this.util.addClass(s[o],"se-checked"):this.util.removeClass(s[o],"se-checked");e.relPreview.title=e.relPreview.textContent=i.join(" ")},createHeaderList:function(e,t,n){const i=this.util.getListChildren(this.context.element.wysiwyg,function(a){return/h[1-6]/i.test(a.nodeName)});if(i.length===0)return;const s=new this._w.RegExp("^"+n.replace(/^#/,""),"i"),o=[];let l="";for(let a=0,r=i.length,f;a<r;a++)f=i[a],s.test(f.textContent)&&(o.push(f),l+='<li class="se-select-item" data-index="'+a+'">'+f.textContent+"</li>");o.length===0?this.plugins.selectMenu.close.call(this,t):(this.plugins.selectMenu.createList(t,o,l),this.plugins.selectMenu.open.call(this,t,this.plugins.anchor._setMenuListPosition.bind(this,e)))},_setMenuListPosition:function(e,t){t.style.top=e.urlInput.offsetHeight+1+"px"},onKeyDownUrlInput:function(e,t){switch(t.keyCode){case 38:t.preventDefault(),t.stopPropagation(),this.plugins.selectMenu.moveItem.call(this,e,-1);break;case 40:t.preventDefault(),t.stopPropagation(),this.plugins.selectMenu.moveItem.call(this,e,1);break;case 13:e.index>-1&&(t.preventDefault(),t.stopPropagation(),this.plugins.anchor.setHeaderBookmark.call(this,this.plugins.selectMenu.getItem(e,null)));break}},setHeaderBookmark:function(e){const t=this.context.anchor.callerContext,n=e.id||"h_"+this._w.Math.random().toString().replace(/.+\./,"");e.id=n,t.urlInput.value="#"+n,(!t.anchorText.value.trim()||!t._change)&&(t.anchorText.value=e.textContent),this.plugins.anchor.setLinkPreview.call(this,t,t.urlInput.value),this.plugins.selectMenu.close.call(this,this.context.selectMenu.callerContext),this.context.anchor.callerContext.urlInput.focus()},onChangeAnchorText:function(e,t){e._change=!!t.target.value.trim()},onChangeUrlInput:function(e,t){const n=t.target.value.trim();this.plugins.anchor.setLinkPreview.call(this,e,n),this.plugins.anchor.selfPathBookmark.call(this,n)?this.plugins.anchor.createHeaderList.call(this,e,this.context.selectMenu.callerContext,n):this.plugins.selectMenu.close.call(this,this.context.selectMenu.callerContext)},onFocusUrlInput:function(e,t){const n=e.urlInput.value;this.plugins.anchor.selfPathBookmark.call(this,n)&&this.plugins.anchor.createHeaderList.call(this,e,t,n)},onBlurUrlInput:function(e){this.plugins.selectMenu.close.call(this,e)},setLinkPreview:function(e,t){const n=e.preview,i=this.options.linkProtocol,s=this.options.linkNoPrefix,o=/^(mailto\:|tel\:|sms\:|https*\:\/\/|#)/.test(t)||t.indexOf(i)===0,l=i?this._w.RegExp("^"+this.util.escapeStringRegexp(t.substr(0,i.length))).test(i):!1;t=e.linkValue=n.textContent=t?s?t:i&&!o&&!l?i+t:o?t:/^www\./.test(t)?"http://"+t:this.context.anchor.host+(/^\//.test(t)?"":"/")+t:"",this.plugins.anchor.selfPathBookmark.call(this,t)?(e.bookmark.style.display="block",this.util.addClass(e.bookmarkButton,"active")):(e.bookmark.style.display="none",this.util.removeClass(e.bookmarkButton,"active")),!this.plugins.anchor.selfPathBookmark.call(this,t)&&e.downloadCheck.checked?e.download.style.display="block":e.download.style.display="none"},setCtx:function(e,t){e&&(t.linkAnchor=e,t.linkValue=e.href,t.currentRel=e.rel.split(" "))},updateAnchor:function(e,t,n,i,s){!this.plugins.anchor.selfPathBookmark.call(this,t)&&i.downloadCheck.checked?e.setAttribute("download",n||t):e.removeAttribute("download"),i.newWindowCheck.checked?e.target="_blank":e.removeAttribute("target");const o=i.currentRel.join(" ");o?e.rel=o:e.removeAttribute("rel"),e.href=t,s?e.children.length===0&&(e.textContent=""):e.textContent=n},createAnchor:function(e,t){if(e.linkValue.length===0)return null;const n=e.linkValue,i=e.anchorText,s=i.value.length===0?n:i.value,o=e.linkAnchor||this.util.createElement("A");return this.plugins.anchor.updateAnchor.call(this,o,n,s,e,t),e.linkValue=e.preview.textContent=e.urlInput.value=e.anchorText.value="",o},onClick_bookmarkButton:function(e){let t=e.urlInput.value;this.plugins.anchor.selfPathBookmark.call(this,t)?(t=t.substr(1),e.bookmark.style.display="none",this.util.removeClass(e.bookmarkButton,"active"),this.plugins.selectMenu.close.call(this,this.context.selectMenu.callerContext)):(t="#"+t,e.bookmark.style.display="block",this.util.addClass(e.bookmarkButton,"active"),e.downloadCheck.checked=!1,e.download.style.display="none",this.plugins.anchor.createHeaderList.call(this,e,this.context.selectMenu.callerContext,t)),e.urlInput.value=t,this.plugins.anchor.setLinkPreview.call(this,e,t),e.urlInput.focus()},onChange_newWindowCheck:function(e,t){typeof e.linkDefaultRel.check_new_window=="string"&&(t.target.checked?this.plugins.anchor.setRel.call(this,e,this.plugins.anchor._relMerge.call(this,e,e.linkDefaultRel.check_new_window)):this.plugins.anchor.setRel.call(this,e,this.plugins.anchor._relDelete.call(this,e,e.linkDefaultRel.check_new_window)))},onChange_downloadCheck:function(e,t){t.target.checked?(e.download.style.display="block",e.bookmark.style.display="none",this.util.removeClass(e.bookmarkButton,"active"),e.linkValue=e.preview.textContent=e.urlInput.value=e.urlInput.value.replace(/^\#+/,""),typeof e.linkDefaultRel.check_bookmark=="string"&&this.plugins.anchor.setRel.call(this,e,this.plugins.anchor._relMerge.call(this,e,e.linkDefaultRel.check_bookmark))):(e.download.style.display="none",typeof e.linkDefaultRel.check_bookmark=="string"&&this.plugins.anchor.setRel.call(this,e,this.plugins.anchor._relDelete.call(this,e,e.linkDefaultRel.check_bookmark)))},_relMerge:function(e,t){const n=e.currentRel;if(!t)return n.join(" ");if(/^only\:/.test(t))return t=t.replace(/^only\:/,"").trim(),e.currentRel=t.split(" "),t;const i=t.split(" ");for(let s=0,o=i.length,l;s<o;s++)l=n.indexOf(i[s]),l===-1&&n.push(i[s]);return n.join(" ")},_relDelete:function(e,t){if(!t)return e.currentRel.join(" ");/^only\:/.test(t)&&(t=t.replace(/^only\:/,"").trim());const n=e.currentRel.join(" ").replace(this._w.RegExp(t+"\\s*"),"");return e.currentRel=n.split(" "),n},init:function(e){e.linkAnchor=null,e.linkValue=e.preview.textContent=e.urlInput.value="",e.anchorText.value="",e.newWindowCheck.checked=!1,e.downloadCheck.checked=!1,e._change=!1,this.plugins.anchor.setRel.call(this,e,e.defaultRel),e.relList&&this.plugins.anchor.toggleRelList.call(this,e,!1),this.context.anchor.callerContext=null,this.plugins.selectMenu.init.call(this,this.context.selectMenu.callerContext)}},YC={name:"link",display:"dialog",add:function(e){e.addModule([Fi,ch]);const t=e.context,n=t.link={focusElement:null,_linkAnchor:null,anchorCtx:null};let i=this.setDialog(e);n.modal=i;let s=this.setController_LinkButton(e);n.linkController=s,i.querySelector("form").addEventListener("submit",this.submit.bind(e)),s.addEventListener("click",this.onClick_linkController.bind(e)),t.dialog.modal.appendChild(i),t.element.relative.appendChild(s),e.plugins.anchor.initEvent.call(e,"link",i),n.focusElement=t.anchor.caller.link.urlInput,i=null,s=null},setDialog:function(e){const t=e.lang,n=e.util.createElement("DIV"),i=e.icons;n.className="se-dialog-content",n.style.display="none";let s='<form><div class="se-dialog-header"><button type="button" data-command="close" class="se-btn se-dialog-close" title="'+t.dialogBox.close+'" aria-label="'+t.dialogBox.close+'">'+i.cancel+'</button><span class="se-modal-title">'+t.dialogBox.linkBox.title+"</span></div>"+e.context.anchor.forms.innerHTML+'<div class="se-dialog-footer"><button type="submit" class="se-btn-primary" title="'+t.dialogBox.submitButton+'" aria-label="'+t.dialogBox.submitButton+'"><span>'+t.dialogBox.submitButton+"</span></button></div></form>";return n.innerHTML=s,n},setController_LinkButton:function(e){const t=e.lang,n=e.icons,i=e.util.createElement("DIV");return i.className="se-controller se-controller-link",i.innerHTML='<div class="se-arrow se-arrow-up"></div><div class="link-content"><span><a target="_blank" href=""></a> </span><div class="se-btn-group"><button type="button" data-command="update" tabindex="-1" class="se-btn se-tooltip">'+n.edit+'<span class="se-tooltip-inner"><span class="se-tooltip-text">'+t.controller.edit+'</span></span></button><button type="button" data-command="unlink" tabindex="-1" class="se-btn se-tooltip">'+n.unlink+'<span class="se-tooltip-inner"><span class="se-tooltip-text">'+t.controller.unlink+'</span></span></button><button type="button" data-command="delete" tabindex="-1" class="se-btn se-tooltip">'+n.delete+'<span class="se-tooltip-inner"><span class="se-tooltip-text">'+t.controller.remove+"</span></span></button></div></div>",i},open:function(){this.plugins.dialog.open.call(this,"link",this.currentControllerName==="link")},submit:function(e){this.showLoading(),e.preventDefault(),e.stopPropagation();try{const t=this.plugins.anchor.createAnchor.call(this,this.context.anchor.caller.link,!1);if(t===null)return;if(this.context.dialog.updateModal){const n=this.context.link._linkAnchor.childNodes[0];this.setRange(n,0,n,n.textContent.length)}else{const n=this.getSelectedElements();if(n.length>1){const i=this.util.createElement(n[0].nodeName);if(i.appendChild(t),!this.insertNode(i,null,!0))return}else if(!this.insertNode(t,null,!0))return;this.setRange(t.childNodes[0],0,t.childNodes[0],t.textContent.length)}}finally{this.plugins.dialog.close.call(this),this.closeLoading(),this.history.push(!1)}return!1},active:function(e){if(!e)this.controllerArray.indexOf(this.context.link.linkController)>-1&&this.controllersOff();else if(this.util.isAnchor(e)&&e.getAttribute("data-image-link")===null)return this.controllerArray.indexOf(this.context.link.linkController)<0&&this.plugins.link.call_controller.call(this,e),!0;return!1},on:function(e){this.plugins.anchor.on.call(this,this.context.anchor.caller.link,e)},call_controller:function(e){this.editLink=this.context.link._linkAnchor=this.context.anchor.caller.link.linkAnchor=e;const t=this.context.link.linkController,n=t.querySelector("a");n.href=e.href,n.title=e.textContent,n.textContent=e.textContent,this.util.addClass(e,"on"),this.setControllerPosition(t,e,"bottom",{left:0,top:0}),this.controllersOn(t,e,"link",this.util.removeClass.bind(this.util,this.context.link._linkAnchor,"on"))},onClick_linkController:function(e){e.stopPropagation();const t=e.target.getAttribute("data-command")||e.target.parentNode.getAttribute("data-command");if(t){if(e.preventDefault(),/update/.test(t))this.plugins.dialog.open.call(this,"link",!0);else if(/unlink/.test(t)){const n=this.util.getChildElement(this.context.link._linkAnchor,function(s){return s.childNodes.length===0||s.nodeType===3},!1),i=this.util.getChildElement(this.context.link._linkAnchor,function(s){return s.childNodes.length===0||s.nodeType===3},!0);this.setRange(n,0,i,i.textContent.length),this.nodeChange(null,null,["A"],!1)}else this.util.removeItem(this.context.link._linkAnchor),this.context.anchor.caller.link.linkAnchor=null,this.focus(),this.history.push(!1);this.controllersOff()}},init:function(){this.context.link.linkController.style.display="none",this.plugins.anchor.init.call(this,this.context.anchor.caller.link)}};var uh={exports:{}};(function(e){(function(t,n){e.exports=t.document?n(t,!0):function(i){if(!i.document)throw new Error("SUNEDITOR_MODULES a window with a document");return n(i)}})(typeof window<"u"?window:Yn,function(t,n){const i={name:"component",set_container:function(s,o){const l=this.util.createElement("DIV");return l.className="se-component "+o,l.appendChild(s),l},set_cover:function(s){const o=this.util.createElement("FIGURE");return o.appendChild(s),o},create_caption:function(){const s=this.util.createElement("FIGCAPTION");return s.innerHTML="<div>"+this.lang.dialogBox.caption+"</div>",s}};return typeof n>"u"&&(t.SUNEDITOR_MODULES||Object.defineProperty(t,"SUNEDITOR_MODULES",{enumerable:!0,writable:!1,configurable:!1,value:{}}),Object.defineProperty(t.SUNEDITOR_MODULES,"component",{enumerable:!0,writable:!1,configurable:!1,value:i})),i})})(uh);var ZC=uh.exports;const Xo=Zn(ZC);var dh={exports:{}};(function(e){(function(t,n){e.exports=t.document?n(t,!0):function(i){if(!i.document)throw new Error("SUNEDITOR_MODULES a window with a document");return n(i)}})(typeof window<"u"?window:Yn,function(t,n){const i={name:"resizing",add:function(s){const o=s.icons,l=s.context;l.resizing={_resizeClientX:0,_resizeClientY:0,_resize_plugin:"",_resize_w:0,_resize_h:0,_origin_w:0,_origin_h:0,_rotateVertical:!1,_resize_direction:"",_move_path:null,_isChange:!1,alignIcons:{basic:o.align_justify,left:o.align_left,right:o.align_right,center:o.align_center}};let a=this.setController_resize(s);l.resizing.resizeContainer=a,l.resizing.resizeDiv=a.querySelector(".se-modal-resize"),l.resizing.resizeDot=a.querySelector(".se-resize-dot"),l.resizing.resizeDisplay=a.querySelector(".se-resize-display");let r=this.setController_button(s);l.resizing.resizeButton=r;let f=l.resizing.resizeHandles=l.resizing.resizeDot.querySelectorAll("span");l.resizing.resizeButtonGroup=r.querySelector("._se_resizing_btn_group"),l.resizing.rotationButtons=r.querySelectorAll("._se_resizing_btn_group ._se_rotation"),l.resizing.percentageButtons=r.querySelectorAll("._se_resizing_btn_group ._se_percentage"),l.resizing.alignMenu=r.querySelector(".se-resizing-align-list"),l.resizing.alignMenuList=l.resizing.alignMenu.querySelectorAll("button"),l.resizing.alignButton=r.querySelector("._se_resizing_align_button"),l.resizing.autoSizeButton=r.querySelector("._se_resizing_btn_group ._se_auto_size"),l.resizing.captionButton=r.querySelector("._se_resizing_caption_button"),a.addEventListener("mousedown",function(d){d.preventDefault()}),f[0].addEventListener("mousedown",this.onMouseDown_resize_handle.bind(s)),f[1].addEventListener("mousedown",this.onMouseDown_resize_handle.bind(s)),f[2].addEventListener("mousedown",this.onMouseDown_resize_handle.bind(s)),f[3].addEventListener("mousedown",this.onMouseDown_resize_handle.bind(s)),f[4].addEventListener("mousedown",this.onMouseDown_resize_handle.bind(s)),f[5].addEventListener("mousedown",this.onMouseDown_resize_handle.bind(s)),f[6].addEventListener("mousedown",this.onMouseDown_resize_handle.bind(s)),f[7].addEventListener("mousedown",this.onMouseDown_resize_handle.bind(s)),r.addEventListener("click",this.onClick_resizeButton.bind(s)),l.element.relative.appendChild(a),l.element.relative.appendChild(r),a=null,r=null,f=null},setController_resize:function(s){const o=s.util.createElement("DIV");return o.className="se-controller se-resizing-container",o.style.display="none",o.innerHTML='<div class="se-modal-resize"></div><div class="se-resize-dot"><span class="tl"></span><span class="tr"></span><span class="bl"></span><span class="br"></span><span class="lw"></span><span class="th"></span><span class="rw"></span><span class="bh"></span><div class="se-resize-display"></div></div>',o},setController_button:function(s){const o=s.lang,l=s.icons,a=s.util.createElement("DIV");return a.className="se-controller se-controller-resizing",a.innerHTML='<div class="se-arrow se-arrow-up"></div><div class="se-btn-group _se_resizing_btn_group"><button type="button" data-command="percent" data-value="1" class="se-tooltip _se_percentage"><span>100%</span><span class="se-tooltip-inner"><span class="se-tooltip-text">'+o.controller.resize100+'</span></span></button><button type="button" data-command="percent" data-value="0.75" class="se-tooltip _se_percentage"><span>75%</span><span class="se-tooltip-inner"><span class="se-tooltip-text">'+o.controller.resize75+'</span></span></button><button type="button" data-command="percent" data-value="0.5" class="se-tooltip _se_percentage"><span>50%</span><span class="se-tooltip-inner"><span class="se-tooltip-text">'+o.controller.resize50+'</span></span></button><button type="button" data-command="auto" class="se-btn se-tooltip _se_auto_size">'+l.auto_size+'<span class="se-tooltip-inner"><span class="se-tooltip-text">'+o.controller.autoSize+'</span></span></button><button type="button" data-command="rotate" data-value="-90" class="se-btn se-tooltip _se_rotation">'+l.rotate_left+'<span class="se-tooltip-inner"><span class="se-tooltip-text">'+o.controller.rotateLeft+'</span></span></button><button type="button" data-command="rotate" data-value="90" class="se-btn se-tooltip _se_rotation">'+l.rotate_right+'<span class="se-tooltip-inner"><span class="se-tooltip-text">'+o.controller.rotateRight+'</span></span></button></div><div class="se-btn-group" style="padding-top: 0;"><button type="button" data-command="mirror" data-value="h" class="se-btn se-tooltip">'+l.mirror_horizontal+'<span class="se-tooltip-inner"><span class="se-tooltip-text">'+o.controller.mirrorHorizontal+'</span></span></button><button type="button" data-command="mirror" data-value="v" class="se-btn se-tooltip">'+l.mirror_vertical+'<span class="se-tooltip-inner"><span class="se-tooltip-text">'+o.controller.mirrorVertical+'</span></span></button><button type="button" data-command="onalign" class="se-btn se-tooltip _se_resizing_align_button">'+l.align_justify+'<span class="se-tooltip-inner"><span class="se-tooltip-text">'+o.toolbar.align+'</span></span></button><div class="se-btn-group-sub sun-editor-common se-list-layer se-resizing-align-list"><div class="se-list-inner"><ul class="se-list-basic"><li><button type="button" class="se-btn-list se-tooltip" data-command="align" data-value="basic">'+l.align_justify+'<span class="se-tooltip-inner"><span class="se-tooltip-text">'+o.dialogBox.basic+'</span></span></button></li><li><button type="button" class="se-btn-list se-tooltip" data-command="align" data-value="left">'+l.align_left+'<span class="se-tooltip-inner"><span class="se-tooltip-text">'+o.dialogBox.left+'</span></span></button></li><li><button type="button" class="se-btn-list se-tooltip" data-command="align" data-value="center">'+l.align_center+'<span class="se-tooltip-inner"><span class="se-tooltip-text">'+o.dialogBox.center+'</span></span></button></li><li><button type="button" class="se-btn-list se-tooltip" data-command="align" data-value="right">'+l.align_right+'<span class="se-tooltip-inner"><span class="se-tooltip-text">'+o.dialogBox.right+'</span></span></button></li></ul></div></div><button type="button" data-command="caption" class="se-btn se-tooltip _se_resizing_caption_button">'+l.caption+'<span class="se-tooltip-inner"><span class="se-tooltip-text">'+o.dialogBox.caption+'</span></span></button><button type="button" data-command="revert" class="se-btn se-tooltip">'+l.revert+'<span class="se-tooltip-inner"><span class="se-tooltip-text">'+o.dialogBox.revertButton+'</span></span></button><button type="button" data-command="update" class="se-btn se-tooltip">'+l.modify+'<span class="se-tooltip-inner"><span class="se-tooltip-text">'+o.controller.edit+'</span></span></button><button type="button" data-command="delete" class="se-btn se-tooltip">'+l.delete+'<span class="se-tooltip-inner"><span class="se-tooltip-text">'+o.controller.remove+"</span></span></button></div>",a},_module_getSizeX:function(s,o,l,a){return o||(o=s._element),l||(l=s._cover),a||(a=s._container),o?/%$/.test(o.style.width)?(a&&this.util.getNumber(a.style.width,2)||100)+"%":o.style.width:""},_module_getSizeY:function(s,o,l,a){return o||(o=s._element),l||(l=s._cover),a||(a=s._container),!a||!l?o&&o.style.height||"":this.util.getNumber(l.style.paddingBottom,0)>0&&!this.context.resizing._rotateVertical?l.style.height:!/%$/.test(o.style.height)||!/%$/.test(o.style.width)?o.style.height:(a&&this.util.getNumber(a.style.height,2)||100)+"%"},_module_setModifyInputSize:function(s,o){const l=s._onlyPercentage&&this.context.resizing._rotateVertical;s.proportion.checked=s._proportionChecked=s._element.getAttribute("data-proportion")!=="false";let a=l?"":this.plugins.resizing._module_getSizeX.call(this,s);if(a===s._defaultSizeX&&(a=""),s._onlyPercentage&&(a=this.util.getNumber(a,2)),s.inputX.value=a,o.setInputSize.call(this,"x"),!s._onlyPercentage){let r=l?"":this.plugins.resizing._module_getSizeY.call(this,s);r===s._defaultSizeY&&(r=""),s._onlyPercentage&&(r=this.util.getNumber(r,2)),s.inputY.value=r}s.inputX.disabled=!!l,s.inputY.disabled=!!l,s.proportion.disabled=!!l,o.setRatio.call(this)},_module_setInputSize:function(s,o){if(s._onlyPercentage){o==="x"&&s.inputX.value>100&&(s.inputX.value=100);return}if(s.proportion.checked&&s._ratio&&/\d/.test(s.inputX.value)&&/\d/.test(s.inputY.value)){const l=s.inputX.value.replace(/\d+|\./g,"")||s.sizeUnit,a=s.inputY.value.replace(/\d+|\./g,"")||s.sizeUnit;if(l!==a)return;const r=l==="%"?2:0;o==="x"?s.inputY.value=this.util.getNumber(s._ratioY*this.util.getNumber(s.inputX.value,r),r)+a:s.inputX.value=this.util.getNumber(s._ratioX*this.util.getNumber(s.inputY.value,r),r)+l}},_module_setRatio:function(s){const o=s.inputX.value,l=s.inputY.value;if(s.proportion.checked&&/\d+/.test(o)&&/\d+/.test(l)){const a=o.replace(/\d+|\./g,"")||s.sizeUnit,r=l.replace(/\d+|\./g,"")||s.sizeUnit;if(a!==r)s._ratio=!1;else if(!s._ratio){const f=this.util.getNumber(o,0),d=this.util.getNumber(l,0);s._ratio=!0,s._ratioX=f/d,s._ratioY=d/f}}else s._ratio=!1},_module_sizeRevert:function(s){s._onlyPercentage?s.inputX.value=s._origin_w>100?100:s._origin_w:(s.inputX.value=s._origin_w,s.inputY.value=s._origin_h)},_module_saveCurrentSize:function(s){const o=this.plugins.resizing._module_getSizeX.call(this,s),l=this.plugins.resizing._module_getSizeY.call(this,s);s._element.setAttribute("width",o.replace("px","")),s._element.setAttribute("height",l.replace("px","")),s._element.setAttribute("data-size",o+","+l),s._videoRatio&&(s._videoRatio=l)},call_controller_resize:function(s,o){const l=this.context.resizing,a=this.context[o];l._resize_plugin=o;const r=l.resizeContainer,f=l.resizeDiv,d=this.util.getOffset(s,this.context.element.wysiwygFrame),h=l._rotateVertical=/^(90|270)$/.test(Math.abs(s.getAttribute("data-rotate")).toString()),b=h?s.offsetHeight:s.offsetWidth,_=h?s.offsetWidth:s.offsetHeight,C=d.top,S=d.left-this.context.element.wysiwygFrame.scrollLeft;r.style.top=C+"px",r.style.left=S+"px",r.style.width=b+"px",r.style.height=_+"px",f.style.top="0px",f.style.left="0px",f.style.width=b+"px",f.style.height=_+"px";let c=s.getAttribute("data-align")||"basic";c=c==="none"?"basic":c;const u=this.util.getParentElement(s,this.util.isComponent),p=this.util.getParentElement(s,"FIGURE"),v=this.plugins.resizing._module_getSizeX.call(this,a,s,p,u)||"auto",y=a._onlyPercentage&&o==="image"?"":", "+(this.plugins.resizing._module_getSizeY.call(this,a,s,p,u)||"auto");this.util.changeTxt(l.resizeDisplay,this.lang.dialogBox[c]+" ("+v+y+")"),l.resizeButtonGroup.style.display=a._resizing?"":"none";const w=a._resizing&&!a._resizeDotHide&&!a._onlyPercentage?"flex":"none",x=l.resizeHandles;for(let M=0,A=x.length;M<A;M++)x[M].style.display=w;if(a._resizing){const M=l.rotationButtons;M[0].style.display=M[1].style.display=a._rotation?"":"none"}if(a._alignHide)l.alignButton.style.display="none";else{l.alignButton.style.display="";const M=l.alignMenuList;this.util.changeElement(l.alignButton.firstElementChild,l.alignIcons[c]);for(let A=0,D=M.length;A<D;A++)M[A].getAttribute("data-value")===c?this.util.addClass(M[A],"on"):this.util.removeClass(M[A],"on")}const E=l.percentageButtons,k=/%$/.test(s.style.width)&&/%$/.test(u.style.width)?this.util.getNumber(u.style.width,0)/100+"":"";for(let M=0,A=E.length;M<A;M++)E[M].getAttribute("data-value")===k?this.util.addClass(E[M],"active"):this.util.removeClass(E[M],"active");a._captionShow?(l.captionButton.style.display="",this.util.getChildElement(s.parentNode,"figcaption")?(this.util.addClass(l.captionButton,"active"),a._captionChecked=!0):(this.util.removeClass(l.captionButton,"active"),a._captionChecked=!1)):l.captionButton.style.display="none",r.style.display="block";const N={left:0,top:50};this.options.iframe&&(N.left-=this.context.element.wysiwygFrame.parentElement.offsetLeft,N.top-=this.context.element.wysiwygFrame.parentElement.offsetTop),this.setControllerPosition(l.resizeButton,r,"bottom",N);const T=function(){this.util.setDisabledButtons.call(this.util,!1,this.resizingDisabledButtons),this.history._resetCachingButton()};this.controllersOn(r,l.resizeButton,T.bind(this),s,o),this.util.setDisabledButtons(!0,this.resizingDisabledButtons),l._resize_w=b,l._resize_h=_;const R=(s.getAttribute("origin-size")||"").split(",");return l._origin_w=R[0]||s.naturalWidth,l._origin_h=R[1]||s.naturalHeight,{w:b,h:_,t:C,l:S}},_closeAlignMenu:null,openAlignMenu:function(){const s=this.context.resizing.alignButton;this.util.addClass(s,"on"),this.context.resizing.alignMenu.style.top=s.offsetTop+s.offsetHeight+"px",this.context.resizing.alignMenu.style.left=s.offsetLeft-s.offsetWidth/2+"px",this.context.resizing.alignMenu.style.display="block",this.plugins.resizing._closeAlignMenu=(function(){this.util.removeClass(this.context.resizing.alignButton,"on"),this.context.resizing.alignMenu.style.display="none",this.removeDocEvent("click",this.plugins.resizing._closeAlignMenu),this.plugins.resizing._closeAlignMenu=null}).bind(this),this.addDocEvent("click",this.plugins.resizing._closeAlignMenu)},onClick_resizeButton:function(s){s.stopPropagation();const o=s.target,l=o.getAttribute("data-command")||o.parentNode.getAttribute("data-command");if(!l)return;const a=o.getAttribute("data-value")||o.parentNode.getAttribute("data-value"),r=this.context.resizing._resize_plugin,f=this.context[r],d=f._element,h=this.plugins[r];if(s.preventDefault(),!(typeof this.plugins.resizing._closeAlignMenu=="function"&&(this.plugins.resizing._closeAlignMenu(),l==="onalign"))){switch(l){case"auto":this.plugins.resizing.resetTransform.call(this,d),h.setAutoSize.call(this),this.selectComponent(d,r);break;case"percent":let b=this.plugins.resizing._module_getSizeY.call(this,f);if(this.context.resizing._rotateVertical){const w=d.getAttribute("data-percentage");w&&(b=w.split(",")[1])}this.plugins.resizing.resetTransform.call(this,d),h.setPercentSize.call(this,a*100,this.util.getNumber(b,0)===null||!/%$/.test(b)?"":b),this.selectComponent(d,r);break;case"mirror":const _=d.getAttribute("data-rotate")||"0";let C=d.getAttribute("data-rotateX")||"",S=d.getAttribute("data-rotateY")||"";a==="h"&&!this.context.resizing._rotateVertical||a==="v"&&this.context.resizing._rotateVertical?S=S?"":"180":C=C?"":"180",d.setAttribute("data-rotateX",C),d.setAttribute("data-rotateY",S),this.plugins.resizing._setTransForm(d,_,C,S);break;case"rotate":const c=this.context.resizing,u=d.getAttribute("data-rotate")*1+a*1,p=this._w.Math.abs(u)>=360?0:u;d.setAttribute("data-rotate",p),c._rotateVertical=/^(90|270)$/.test(this._w.Math.abs(p).toString()),this.plugins.resizing.setTransformSize.call(this,d,null,null),this.selectComponent(d,r);break;case"onalign":this.plugins.resizing.openAlignMenu.call(this);return;case"align":const v=a==="basic"?"none":a;h.setAlign.call(this,v,null,null,null),this.selectComponent(d,r);break;case"caption":const y=!f._captionChecked;if(h.openModify.call(this,!0),f._captionChecked=f.captionCheckEl.checked=y,h.update_image.call(this,!1,!1,!1),y){const w=this.util.getChildElement(f._caption,function(x){return x.nodeType===3});w?this.setRange(w,0,w,w.textContent.length):f._caption.focus(),this.controllersOff()}else this.selectComponent(d,r),h.openModify.call(this,!0);break;case"revert":h.setOriginSize.call(this),this.selectComponent(d,r);break;case"update":h.openModify.call(this),this.controllersOff();break;case"delete":h.destroy.call(this);break}this.history.push(!1)}},resetTransform:function(s){const o=(s.getAttribute("data-size")||s.getAttribute("data-origin")||"").split(",");this.context.resizing._rotateVertical=!1,s.style.maxWidth="",s.style.transform="",s.style.transformOrigin="",s.setAttribute("data-rotate",""),s.setAttribute("data-rotateX",""),s.setAttribute("data-rotateY",""),this.plugins[this.context.resizing._resize_plugin].setSize.call(this,o[0]?o[0]:"auto",o[1]?o[1]:"",!0)},setTransformSize:function(s,o,l){let a=s.getAttribute("data-percentage");const r=this.context.resizing._rotateVertical,f=s.getAttribute("data-rotate")*1;let d="";if(a&&!r)a=a.split(","),a[0]==="auto"&&a[1]==="auto"?this.plugins[this.context.resizing._resize_plugin].setAutoSize.call(this):this.plugins[this.context.resizing._resize_plugin].setPercentSize.call(this,a[0],a[1]);else{const h=this.util.getParentElement(s,"FIGURE"),b=o||s.offsetWidth,_=l||s.offsetHeight,C=(r?_:b)+"px",S=(r?b:_)+"px";if(this.plugins[this.context.resizing._resize_plugin].cancelPercentAttr.call(this),this.plugins[this.context.resizing._resize_plugin].setSize.call(this,b+"px",_+"px",!0),h.style.width=C,h.style.height=this.context[this.context.resizing._resize_plugin]._caption?"":S,r){let c=b/2+"px "+b/2+"px 0",u=_/2+"px "+_/2+"px 0";d=f===90||f===-270?u:c}}s.style.transformOrigin=d,this.plugins.resizing._setTransForm(s,f.toString(),s.getAttribute("data-rotateX")||"",s.getAttribute("data-rotateY")||""),r?s.style.maxWidth="none":s.style.maxWidth="",this.plugins.resizing.setCaptionPosition.call(this,s)},_setTransForm:function(s,o,l,a){let r=(s.offsetWidth-s.offsetHeight)*(/-/.test(o)?1:-1),f="";if(/[1-9]/.test(o)&&(l||a))switch(f=l?"Y":"X",o){case"90":f=l&&a?"X":a?f:"";break;case"270":r*=-1,f=l&&a?"Y":l?f:"";break;case"-90":f=l&&a?"Y":l?f:"";break;case"-270":r*=-1,f=l&&a?"X":a?f:"";break;default:f=""}o%180===0&&(s.style.maxWidth=""),s.style.transform="rotate("+o+"deg)"+(l?" rotateX("+l+"deg)":"")+(a?" rotateY("+a+"deg)":"")+(f?" translate"+f+"("+r+"px)":"")},setCaptionPosition:function(s){const o=this.util.getChildElement(this.util.getParentElement(s,"FIGURE"),"FIGCAPTION");o&&(o.style.marginTop=(this.context.resizing._rotateVertical?s.offsetWidth-s.offsetHeight:0)+"px")},onMouseDown_resize_handle:function(s){s.stopPropagation(),s.preventDefault();const o=this.context.resizing,l=o._resize_direction=s.target.classList[0];o._resizeClientX=s.clientX,o._resizeClientY=s.clientY,this.context.element.resizeBackground.style.display="block",o.resizeButton.style.display="none",o.resizeDiv.style.float=/l/.test(l)?"right":/r/.test(l)?"left":"none";const a=(function(d){if(d.type==="keydown"&&d.keyCode!==27)return;const h=o._isChange;o._isChange=!1,this.removeDocEvent("mousemove",r),this.removeDocEvent("mouseup",a),this.removeDocEvent("keydown",a),d.type==="keydown"?(this.controllersOff(),this.context.element.resizeBackground.style.display="none",this.plugins[this.context.resizing._resize_plugin].init.call(this)):(this.plugins.resizing.cancel_controller_resize.call(this,l),h&&this.history.push(!1))}).bind(this),r=this.plugins.resizing.resizing_element.bind(this,o,l,this.context[o._resize_plugin]);this.addDocEvent("mousemove",r),this.addDocEvent("mouseup",a),this.addDocEvent("keydown",a)},resizing_element:function(s,o,l,a){const r=a.clientX,f=a.clientY;let d=l._element_w,h=l._element_h;const b=l._element_w+(/r/.test(o)?r-s._resizeClientX:s._resizeClientX-r),_=l._element_h+(/b/.test(o)?f-s._resizeClientY:s._resizeClientY-f),C=l._element_h/l._element_w*b;/t/.test(o)&&(s.resizeDiv.style.top=l._element_h-(/h/.test(o)?_:C)+"px"),/l/.test(o)&&(s.resizeDiv.style.left=l._element_w-b+"px"),/r|l/.test(o)&&(s.resizeDiv.style.width=b+"px",d=b),/^(t|b)[^h]$/.test(o)?(s.resizeDiv.style.height=C+"px",h=C):/^(t|b)h$/.test(o)&&(s.resizeDiv.style.height=_+"px",h=_),s._resize_w=d,s._resize_h=h,this.util.changeTxt(s.resizeDisplay,this._w.Math.round(d)+" x "+this._w.Math.round(h)),s._isChange=!0},cancel_controller_resize:function(s){const o=this.context.resizing._rotateVertical;this.controllersOff(),this.context.element.resizeBackground.style.display="none";let l=this._w.Math.round(o?this.context.resizing._resize_h:this.context.resizing._resize_w),a=this._w.Math.round(o?this.context.resizing._resize_w:this.context.resizing._resize_h);if(!o&&!/%$/.test(l)){const d=this.context.element.wysiwygFrame.clientWidth-32-2;this.util.getNumber(l,0)>d&&(a=this._w.Math.round(a/l*d),l=d)}const r=this.context.resizing._resize_plugin;this.plugins[r].setSize.call(this,l,a,!1,s),o&&this.plugins.resizing.setTransformSize.call(this,this.context[this.context.resizing._resize_plugin]._element,l,a),this.selectComponent(this.context[r]._element,r)}};return typeof n>"u"&&(t.SUNEDITOR_MODULES||Object.defineProperty(t,"SUNEDITOR_MODULES",{enumerable:!0,writable:!1,configurable:!1,value:{}}),Object.defineProperty(t.SUNEDITOR_MODULES,"resizing",{enumerable:!0,writable:!1,configurable:!1,value:i})),i})})(dh);var qC=dh.exports;const fh=Zn(qC);var hh={exports:{}};(function(e){(function(t,n){e.exports=t.document?n(t,!0):function(i){if(!i.document)throw new Error("SUNEDITOR_MODULES a window with a document");return n(i)}})(typeof window<"u"?window:Yn,function(t,n){const i={name:"fileManager",_xmlHttp:null,_checkMediaComponent:function(s){return/IMG|IFRAME|VIDEO|AUDIO/i.test(s.tagName)?/FIGURE/i.test(s.parentElement.nodeName)||/FIGURE/i.test(s.parentElement.parentElement.nodeName):!0},upload:function(s,o,l,a,r){this.showLoading();const f=this.plugins.fileManager,d=f._xmlHttp=this.util.getXMLHttpRequest();if(d.onreadystatechange=f._callBackUpload.bind(this,d,a,r),d.open("post",s,!0),o!==null&&typeof o=="object"&&this._w.Object.keys(o).length>0)for(let h in o)d.setRequestHeader(h,o[h]);d.send(l)},_callBackUpload:function(s,o,l){if(s.readyState===4)if(s.status===200)try{o(s)}catch(a){throw Error('[SUNEDITOR.fileManager.upload.callBack.fail] cause : "'+a.message+'"')}finally{this.closeLoading()}else{this.closeLoading();const a=s.responseText?JSON.parse(s.responseText):s;if(typeof l!="function"||l("",a,this)){const r="[SUNEDITOR.fileManager.upload.serverException] status: "+s.status+", response: "+(a.errorMessage||s.responseText);throw this.functions.noticeOpen(r),Error(r)}}},checkInfo:function(s,o,l,a,r){let f=[];for(let u=0,p=o.length;u<p;u++)f=f.concat([].slice.call(this.context.element.wysiwyg.querySelectorAll(o[u]+':not([data-se-embed="true"])')));const d=this.plugins.fileManager,h=this.context[s],b=h._infoList,_=d.setInfo.bind(this);if(f.length===b.length)if(this._componentsInfoReset){for(let u=0,p=f.length;u<p;u++)_(s,f[u],l,null,r);return}else{let u=!1;for(let p=0,v=b.length,y;p<v;p++)if(y=b[p],f.filter(function(w){return y.src===w.src&&y.index.toString()===w.getAttribute("data-index")}).length===0){u=!0;break}if(!u)return}const C=r?this.context.resizing._resize_plugin:"";r&&(this.context.resizing._resize_plugin=s);const S=[],c=[];for(let u=0,p=b.length;u<p;u++)c[u]=b[u].index;for(h.__updateTags=f;f.length>0;){const u=f.shift();!this.util.getParentElement(u,this.util.isMediaComponent)||!d._checkMediaComponent(u)?(S.push(h._infoIndex),a(u)):!u.getAttribute("data-index")||c.indexOf(u.getAttribute("data-index")*1)<0?(S.push(h._infoIndex),u.removeAttribute("data-index"),_(s,u,l,null,r)):S.push(u.getAttribute("data-index")*1)}for(let u=0,p;u<b.length;u++)p=b[u].index,!(S.indexOf(p)>-1)&&(b.splice(u,1),typeof l=="function"&&l(null,p,"delete",null,0,this),u--);r&&(this.context.resizing._resize_plugin=C)},setInfo:function(s,o,l,a,r){const f=r?this.context.resizing._resize_plugin:"";r&&(this.context.resizing._resize_plugin=s);const d=this.plugins[s],h=this.context[s],b=h._infoList;let _=o.getAttribute("data-index"),C=null,S="";if(a||(a={name:o.getAttribute("data-file-name")||(typeof o.src=="string"?o.src.split("/").pop():""),size:o.getAttribute("data-file-size")||0}),!_||this._componentsInfoInit)S="create",_=h._infoIndex++,o.setAttribute("data-index",_),o.setAttribute("data-file-name",a.name),o.setAttribute("data-file-size",a.size),C={src:o.src,index:_*1,name:a.name,size:a.size},b.push(C);else{S="update",_*=1;for(let c=0,u=b.length;c<u;c++)if(_===b[c].index){C=b[c];break}C||(_=h._infoIndex++,C={index:_},b.push(C)),C.src=o.src,C.name=o.getAttribute("data-file-name"),C.size=o.getAttribute("data-file-size")*1}if(C.element=o,C.delete=d.destroy.bind(this,o),C.select=(function(c){c.scrollIntoView(!0),this._w.setTimeout(d.select.bind(this,c))}).bind(this,o),r){if(!o.getAttribute("origin-size")&&o.naturalWidth&&o.setAttribute("origin-size",o.naturalWidth+","+o.naturalHeight),!o.getAttribute("data-origin")){const c=this.util.getParentElement(o,this.util.isMediaComponent),u=this.util.getParentElement(o,"FIGURE"),p=this.plugins.resizing._module_getSizeX.call(this,h,o,u,c),v=this.plugins.resizing._module_getSizeY.call(this,h,o,u,c);o.setAttribute("data-origin",p+","+v),o.setAttribute("data-size",p+","+v)}if(!o.style.width){const c=(o.getAttribute("data-size")||o.getAttribute("data-origin")||"").split(",");d.onModifyMode.call(this,o,null),d.applySize.call(this,c[0],c[1])}this.context.resizing._resize_plugin=f}typeof l=="function"&&l(o,_,S,C,--h._uploadFileLength<0?0:h._uploadFileLength,this)},deleteInfo:function(s,o,l){if(o>=0){const a=this.context[s]._infoList;for(let r=0,f=a.length;r<f;r++)if(o===a[r].index){a.splice(r,1),typeof l=="function"&&l(null,o,"delete",null,0,this);return}}},resetInfo:function(s,o){const l=this.context[s];if(typeof o=="function"){const a=l._infoList;for(let r=0,f=a.length;r<f;r++)o(null,a[r].index,"delete",null,0,this)}l._infoList=[],l._infoIndex=0}};return typeof n>"u"&&(t.SUNEDITOR_MODULES||Object.defineProperty(t,"SUNEDITOR_MODULES",{enumerable:!0,writable:!1,configurable:!1,value:{}}),Object.defineProperty(t.SUNEDITOR_MODULES,"fileManager",{enumerable:!0,writable:!1,configurable:!1,value:i})),i})})(hh);var GC=hh.exports;const Qo=Zn(GC),KC={name:"image",display:"dialog",add:function(e){e.addModule([Fi,ch,Xo,fh,Qo]);const t=e.options,n=e.context,i=n.image={_infoList:[],_infoIndex:0,_uploadFileLength:0,focusElement:null,sizeUnit:t._imageSizeUnit,_linkElement:"",_altText:"",_align:"none",_floatClassRegExp:"__se__float\\-[a-z]+",_v_src:{_linkValue:""},svgDefaultSize:"30%",base64RenderIndex:0,_element:null,_cover:null,_container:null,inputX:null,inputY:null,_element_w:1,_element_h:1,_element_l:0,_element_t:0,_defaultSizeX:"auto",_defaultSizeY:"auto",_origin_w:t.imageWidth==="auto"?"":t.imageWidth,_origin_h:t.imageHeight==="auto"?"":t.imageHeight,_proportionChecked:!0,_resizing:t.imageResizing,_resizeDotHide:!t.imageHeightShow,_rotation:t.imageRotation,_alignHide:!t.imageAlignShow,_onlyPercentage:t.imageSizeOnlyPercentage,_ratio:!1,_ratioX:1,_ratioY:1,_captionShow:!0,_captionChecked:!1,_caption:null,captionCheckEl:null};let s=this.setDialog(e);i.modal=s,i.imgInputFile=s.querySelector("._se_image_file"),i.imgUrlFile=s.querySelector("._se_image_url"),i.focusElement=i.imgInputFile||i.imgUrlFile,i.altText=s.querySelector("._se_image_alt"),i.captionCheckEl=s.querySelector("._se_image_check_caption"),i.previewSrc=s.querySelector("._se_tab_content_image .se-link-preview"),s.querySelector(".se-dialog-tabs").addEventListener("click",this.openTab.bind(e)),s.querySelector("form").addEventListener("submit",this.submit.bind(e)),i.imgInputFile&&s.querySelector(".se-file-remove").addEventListener("click",this._removeSelectedFiles.bind(i.imgInputFile,i.imgUrlFile,i.previewSrc)),i.imgUrlFile&&i.imgUrlFile.addEventListener("input",this._onLinkPreview.bind(i.previewSrc,i._v_src,t.linkProtocol)),i.imgInputFile&&i.imgUrlFile&&i.imgInputFile.addEventListener("change",this._fileInputChange.bind(i));const o=s.querySelector(".__se__gallery");o&&o.addEventListener("click",this._openGallery.bind(e)),i.proportion={},i.inputX={},i.inputY={},t.imageResizing&&(i.proportion=s.querySelector("._se_image_check_proportion"),i.inputX=s.querySelector("._se_image_size_x"),i.inputY=s.querySelector("._se_image_size_y"),i.inputX.value=t.imageWidth,i.inputY.value=t.imageHeight,i.inputX.addEventListener("keyup",this.setInputSize.bind(e,"x")),i.inputY.addEventListener("keyup",this.setInputSize.bind(e,"y")),i.inputX.addEventListener("change",this.setRatio.bind(e)),i.inputY.addEventListener("change",this.setRatio.bind(e)),i.proportion.addEventListener("change",this.setRatio.bind(e)),s.querySelector(".se-dialog-btn-revert").addEventListener("click",this.sizeRevert.bind(e))),n.dialog.modal.appendChild(s),e.plugins.anchor.initEvent.call(e,"image",s.querySelector("._se_tab_content_url")),i.anchorCtx=e.context.anchor.caller.image,s=null},setDialog:function(e){const t=e.options,n=e.lang,i=e.util.createElement("DIV");i.className="se-dialog-content se-dialog-image",i.style.display="none";let s='<div class="se-dialog-header"><button type="button" data-command="close" class="se-btn se-dialog-close" class="close" title="'+n.dialogBox.close+'" aria-label="'+n.dialogBox.close+'">'+e.icons.cancel+'</button><span class="se-modal-title">'+n.dialogBox.imageBox.title+'</span></div><div class="se-dialog-tabs"><button type="button" class="_se_tab_link active" data-tab-link="image">'+n.toolbar.image+'</button><button type="button" class="_se_tab_link" data-tab-link="url">'+n.toolbar.link+'</button></div><form method="post" enctype="multipart/form-data"><div class="_se_tab_content _se_tab_content_image"><div class="se-dialog-body"><div style="border-bottom: 1px dashed #ccc;">';if(t.imageFileInput&&(s+='<div class="se-dialog-form"><label>'+n.dialogBox.imageBox.file+'</label><div class="se-dialog-form-files"><input class="se-input-form _se_image_file" type="file" accept="'+t.imageAccept+'"'+(t.imageMultipleFile?' multiple="multiple"':"")+'/><button type="button" class="se-btn se-dialog-files-edge-button se-file-remove" title="'+n.controller.remove+'" aria-label="'+n.controller.remove+'">'+e.icons.cancel+"</button></div></div>"),t.imageUrlInput&&(s+='<div class="se-dialog-form"><label>'+n.dialogBox.imageBox.url+'</label><div class="se-dialog-form-files"><input class="se-input-form se-input-url _se_image_url" type="text" />'+(t.imageGalleryUrl&&e.plugins.imageGallery?'<button type="button" class="se-btn se-dialog-files-edge-button __se__gallery" title="'+n.toolbar.imageGallery+'" aria-label="'+n.toolbar.imageGallery+'">'+e.icons.image_gallery+"</button>":"")+'</div><pre class="se-link-preview"></pre></div>'),s+='</div><div class="se-dialog-form"><label>'+n.dialogBox.imageBox.altText+'</label><input class="se-input-form _se_image_alt" type="text" /></div>',t.imageResizing){const o=t.imageSizeOnlyPercentage,l=o?' style="display: none !important;"':"",a=t.imageHeightShow?"":' style="display: none !important;"';s+='<div class="se-dialog-form">',o||!t.imageHeightShow?s+='<div class="se-dialog-size-text"><label class="size-w">'+n.dialogBox.size+"</label></div>":s+='<div class="se-dialog-size-text"><label class="size-w">'+n.dialogBox.width+'</label><label class="se-dialog-size-x"> </label><label class="size-h">'+n.dialogBox.height+"</label></div>",s+='<input class="se-input-control _se_image_size_x" placeholder="auto"'+(o?' type="number" min="1"':'type="text"')+(o?' max="100"':"")+' /><label class="se-dialog-size-x"'+a+">"+(o?"%":"x")+'</label><input type="text" class="se-input-control _se_image_size_y" placeholder="auto"'+l+(o?' max="100"':"")+a+"/><label"+l+a+'><input type="checkbox" class="se-dialog-btn-check _se_image_check_proportion" checked/> '+n.dialogBox.proportion+'</label><button type="button" title="'+n.dialogBox.revertButton+'" aria-label="'+n.dialogBox.revertButton+'" class="se-btn se-dialog-btn-revert" style="float: right;">'+e.icons.revert+"</button></div>"}return s+='<div class="se-dialog-form se-dialog-form-footer"><label><input type="checkbox" class="se-dialog-btn-check _se_image_check_caption" /> '+n.dialogBox.caption+'</label></div></div></div><div class="_se_tab_content _se_tab_content_url" style="display: none">'+e.context.anchor.forms.innerHTML+'</div><div class="se-dialog-footer"><div'+(t.imageAlignShow?"":' style="display: none"')+'><label><input type="radio" name="suneditor_image_radio" class="se-dialog-btn-radio" value="none" checked>'+n.dialogBox.basic+'</label><label><input type="radio" name="suneditor_image_radio" class="se-dialog-btn-radio" value="left">'+n.dialogBox.left+'</label><label><input type="radio" name="suneditor_image_radio" class="se-dialog-btn-radio" value="center">'+n.dialogBox.center+'</label><label><input type="radio" name="suneditor_image_radio" class="se-dialog-btn-radio" value="right">'+n.dialogBox.right+'</label></div><button type="submit" class="se-btn-primary" title="'+n.dialogBox.submitButton+'" aria-label="'+n.dialogBox.submitButton+'"><span>'+n.dialogBox.submitButton+"</span></button></div></form>",i.innerHTML=s,i},_fileInputChange:function(){this.imgInputFile.value?(this.imgUrlFile.setAttribute("disabled",!0),this.previewSrc.style.textDecoration="line-through"):(this.imgUrlFile.removeAttribute("disabled"),this.previewSrc.style.textDecoration="")},_removeSelectedFiles:function(e,t){this.value="",e&&(e.removeAttribute("disabled"),t.style.textDecoration="")},_openGallery:function(){this.callPlugin("imageGallery",this.plugins.imageGallery.open.bind(this,this.plugins.image._setUrlInput.bind(this.context.image)),null)},_setUrlInput:function(e){this.altText.value=e.alt,this._v_src._linkValue=this.previewSrc.textContent=this.imgUrlFile.value=e.getAttribute("data-value")||e.src,this.imgUrlFile.focus()},_onLinkPreview:function(e,t,n){const i=n.target.value.trim();e._linkValue=this.textContent=i?t&&i.indexOf("://")===-1&&i.indexOf("#")!==0?t+i:i.indexOf("://")===-1?"/"+i:i:""},fileTags:["img"],select:function(e){this.plugins.image.onModifyMode.call(this,e,this.plugins.resizing.call_controller_resize.call(this,e,"image"))},destroy:function(e){const t=e||this.context.image._element,n=this.util.getParentElement(t,this.util.isMediaComponent)||t,i=t.getAttribute("data-index")*1;if(typeof this.functions.onImageDeleteBefore=="function"&&this.functions.onImageDeleteBefore(t,n,i,this)===!1)return;let s=n.previousElementSibling||n.nextElementSibling;const o=n.parentNode;this.util.removeItem(n),this.plugins.image.init.call(this),this.controllersOff(),o!==this.context.element.wysiwyg&&this.util.removeItemAllParents(o,function(l){return l.childNodes.length===0},null),this.focusEdge(s),this.plugins.fileManager.deleteInfo.call(this,"image",i,this.functions.onImageUpload),this.history.push(!1)},on:function(e){const t=this.context.image;e?t.imgInputFile&&this.options.imageMultipleFile&&t.imgInputFile.removeAttribute("multiple"):(t.inputX.value=t._origin_w=this.options.imageWidth===t._defaultSizeX?"":this.options.imageWidth,t.inputY.value=t._origin_h=this.options.imageHeight===t._defaultSizeY?"":this.options.imageHeight,t.imgInputFile&&this.options.imageMultipleFile&&t.imgInputFile.setAttribute("multiple","multiple")),this.plugins.anchor.on.call(this,t.anchorCtx,e)},open:function(){this.plugins.dialog.open.call(this,"image",this.currentControllerName==="image")},openTab:function(e){const t=this.context.image.modal,n=e==="init"?t.querySelector("._se_tab_link"):e.target;if(!/^BUTTON$/i.test(n.tagName))return!1;const i=n.getAttribute("data-tab-link"),s="_se_tab_content";let o,l,a;for(l=t.getElementsByClassName(s),o=0;o<l.length;o++)l[o].style.display="none";for(a=t.getElementsByClassName("_se_tab_link"),o=0;o<a.length;o++)this.util.removeClass(a[o],"active");return t.querySelector("."+s+"_"+i).style.display="block",this.util.addClass(n,"active"),i==="image"&&this.context.image.focusElement?this.context.image.focusElement.focus():i==="url"&&this.context.anchor.caller.image.urlInput.focus(),!1},submit:function(e){const t=this.context.image,n=this.plugins.image;e.preventDefault(),e.stopPropagation(),t._altText=t.altText.value,t._align=t.modal.querySelector('input[name="suneditor_image_radio"]:checked').value,t._captionChecked=t.captionCheckEl.checked,t._resizing&&(t._proportionChecked=t.proportion.checked);try{this.context.dialog.updateModal&&n.update_image.call(this,!1,!0,!1),t.imgInputFile&&t.imgInputFile.files.length>0?(this.showLoading(),n.submitAction.call(this,this.context.image.imgInputFile.files)):t.imgUrlFile&&t._v_src._linkValue.length>0&&(this.showLoading(),n.onRender_imgUrl.call(this,t._v_src._linkValue))}catch(i){throw this.closeLoading(),Error('[SUNEDITOR.image.submit.fail] cause : "'+i.message+'"')}finally{this.plugins.dialog.close.call(this)}return!1},submitAction:function(e){if(e.length===0)return;let t=0,n=[];for(let a=0,r=e.length;a<r;a++)/image/i.test(e[a].type)&&(n.push(e[a]),t+=e[a].size);const i=this.options.imageUploadSizeLimit;if(i>0){let a=0;const r=this.context.image._infoList;for(let f=0,d=r.length;f<d;f++)a+=r[f].size*1;if(t+a>i){this.closeLoading();const f="[SUNEDITOR.imageUpload.fail] Size of uploadable total images: "+i/1e3+"KB";(typeof this.functions.onImageUploadError!="function"||this.functions.onImageUploadError(f,{limitSize:i,currentSize:a,uploadSize:t},this))&&this.functions.noticeOpen(f);return}}const s=this.context.image;s._uploadFileLength=n.length;const l={anchor:this.plugins.anchor.createAnchor.call(this,s.anchorCtx,!0),inputWidth:s.inputX.value,inputHeight:s.inputY.value,align:s._align,isUpdate:this.context.dialog.updateModal,alt:s._altText,element:s._element};if(typeof this.functions.onImageUploadBefore=="function"){const a=this.functions.onImageUploadBefore(n,l,this,(function(r){r&&this._w.Array.isArray(r.result)?this.plugins.image.register.call(this,l,r):this.plugins.image.upload.call(this,l,r)}).bind(this));if(typeof a>"u")return;if(!a){this.closeLoading();return}this._w.Array.isArray(a)&&a.length>0&&(n=a)}this.plugins.image.upload.call(this,l,n)},error:function(e,t){if(this.closeLoading(),typeof this.functions.onImageUploadError!="function"||this.functions.onImageUploadError(e,t,this))throw this.functions.noticeOpen(e),Error("[SUNEDITOR.plugin.image.error] response: "+e)},upload:function(e,t){if(!t){this.closeLoading();return}if(typeof t=="string"){this.plugins.image.error.call(this,t,null);return}const n=this.options.imageUploadUrl,i=this.context.dialog.updateModal?1:t.length;if(typeof n=="string"&&n.length>0){const s=new FormData;for(let o=0;o<i;o++)s.append("file-"+o,t[o]);this.plugins.fileManager.upload.call(this,n,this.options.imageUploadHeader,s,this.plugins.image.callBack_imgUpload.bind(this,e),this.functions.onImageUploadError)}else this.plugins.image.setup_reader.call(this,t,e.anchor,e.inputWidth,e.inputHeight,e.align,e.alt,i,e.isUpdate)},callBack_imgUpload:function(e,t){if(typeof this.functions.imageUploadHandler=="function")this.functions.imageUploadHandler(t,e,this);else{const n=JSON.parse(t.responseText);n.errorMessage?this.plugins.image.error.call(this,n.errorMessage,n):this.plugins.image.register.call(this,e,n)}},register:function(e,t){const n=t.result;for(let i=0,s=n.length,o;i<s;i++)if(o={name:n[i].name,size:n[i].size},e.isUpdate){this.plugins.image.update_src.call(this,n[i].url,e.element,o);break}else this.plugins.image.create_image.call(this,n[i].url,e.anchor,e.inputWidth,e.inputHeight,e.align,o,e.alt);this.closeLoading()},setup_reader:function(e,t,n,i,s,o,l,a){try{if(l===0){this.closeLoading(),console.warn("[SUNEDITOR.image.base64.fail] cause : No applicable files");return}this.context.image.base64RenderIndex=l;const r=this._w.FileReader,f=[l];this.context.image.inputX.value=n,this.context.image.inputY.value=i;for(let d=0,h,b;d<l;d++)h=new r,b=e[d],h.onload=(function(_,C,S,c,u){f[u]={result:_.result,file:c},--this.context.image.base64RenderIndex===0&&(this.plugins.image.onRender_imgBase64.call(this,C,f,S,t,n,i,s,o),this.closeLoading())}).bind(this,h,a,this.context.image._element,b,d),h.readAsDataURL(b)}catch(r){throw this.closeLoading(),Error('[SUNEDITOR.image.setup_reader.fail] cause : "'+r.message+'"')}},onRender_imgBase64:function(e,t,n,i,s,o,l,a){const r=this.plugins.image.update_src,f=this.plugins.image.create_image;for(let d=0,h=t.length;d<h;d++)e?(this.context.image._element.setAttribute("data-file-name",t[d].file.name),this.context.image._element.setAttribute("data-file-size",t[d].file.size),r.call(this,t[d].result,n,t[d].file)):f.call(this,t[d].result,i,s,o,l,t[d].file,a)},onRender_imgUrl:function(e){if(e||(e=this.context.image._v_src._linkValue),!e)return!1;const t=this.context.image;try{const n={name:e.split("/").pop(),size:0};this.context.dialog.updateModal?this.plugins.image.update_src.call(this,e,t._element,n):this.plugins.image.create_image.call(this,e,this.plugins.anchor.createAnchor.call(this,t.anchorCtx,!0),t.inputX.value,t.inputY.value,t._align,n,t._altText)}catch(n){throw Error('[SUNEDITOR.image.URLRendering.fail] cause : "'+n.message+'"')}finally{this.closeLoading()}},onRender_link:function(e,t){return t?(t.setAttribute("data-image-link","image"),e.setAttribute("data-image-link",t.href),t.appendChild(e),t):e},setInputSize:function(e,t){if(t&&t.keyCode===32){t.preventDefault();return}this.plugins.resizing._module_setInputSize.call(this,this.context.image,e)},setRatio:function(){this.plugins.resizing._module_setRatio.call(this,this.context.image)},checkFileInfo:function(){const e=this.plugins.image,t=this.context.image,n=(function(i){e.onModifyMode.call(this,i,null),e.openModify.call(this,!0),t.inputX.value=t._origin_w,t.inputY.value=t._origin_h;const s=this.util.getFormatElement(i);s&&(t._align=s.style.textAlign||s.style.float),this.util.isAnchor(i.parentNode)&&!t.anchorCtx.linkValue&&(t.anchorCtx.linkValue=" "),e.update_image.call(this,!0,!1,!0),e.init.call(this)}).bind(this);this.plugins.fileManager.checkInfo.call(this,"image",["img"],this.functions.onImageUpload,n,!0)},resetFileInfo:function(){this.plugins.fileManager.resetInfo.call(this,"image",this.functions.onImageUpload)},create_image:function(e,t,n,i,s,o,l){const a=this.plugins.image,r=this.context.image;this.context.resizing._resize_plugin="image";let f=this.util.createElement("IMG");f.src=e,f.alt=l,f.setAttribute("data-rotate","0"),t=a.onRender_link.call(this,f,t?t.cloneNode(!1):null),r._resizing&&f.setAttribute("data-proportion",r._proportionChecked);const d=this.plugins.component.set_cover.call(this,t),h=this.plugins.component.set_container.call(this,d,"se-image-container");r._captionChecked&&(r._caption=this.plugins.component.create_caption.call(this),d.appendChild(r._caption)),r._element=f,r._cover=d,r._container=h,a.applySize.call(this,n,i),a.setAlign.call(this,s,f,d,h),f.onload=a._image_create_onload.bind(this,f,r.svgDefaultSize,h),this.insertComponent(h,!0,!0,!this.options.mediaAutoSelect)&&this.plugins.fileManager.setInfo.call(this,"image",f,this.functions.onImageUpload,o,!0),this.context.resizing._resize_plugin=""},_image_create_onload:function(e,t,n){if(e.offsetWidth===0&&this.plugins.image.applySize.call(this,t,""),this.options.mediaAutoSelect)this.selectComponent(e,"image");else{const i=this.appendFormatTag(n,null);i&&this.setRange(i,0,i,0)}this.history.push(!1)},update_image:function(e,t,n){const i=this.context.image;let s=i._element,o=i._cover,l=i._container,a=!1;o===null&&(a=!0,s=i._element.cloneNode(!0),o=this.plugins.component.set_cover.call(this,s)),l===null?(o=o.cloneNode(!0),s=o.querySelector("img"),a=!0,l=this.plugins.component.set_container.call(this,o,"se-image-container")):a&&(l.innerHTML="",l.appendChild(o),i._cover=o,i._element=s,a=!1);let r;const f=this.util.isNumber(i.inputX.value)?i.inputX.value+i.sizeUnit:i.inputX.value,d=this.util.isNumber(i.inputY.value)?i.inputY.value+i.sizeUnit:i.inputY.value;/%$/.test(s.style.width)?r=f!==l.style.width||d!==l.style.height:r=f!==s.style.width||d!==s.style.height,s.alt=i._altText;let h=!1;i._captionChecked?i._caption||(i._caption=this.plugins.component.create_caption.call(this),o.appendChild(i._caption),h=!0):i._caption&&(this.util.removeItem(i._caption),i._caption=null,h=!0);let b=null;const _=this.plugins.anchor.createAnchor.call(this,i.anchorCtx,!0);if(_)i._linkElement!==_||a&&!l.contains(_)?(i._linkElement=_.cloneNode(!1),o.insertBefore(this.plugins.image.onRender_link.call(this,s,i._linkElement),i._caption),b=i._element):i._linkElement.setAttribute("data-image-link","image");else if(i._linkElement!==null){const S=s;if(S.setAttribute("data-image-link",""),o.contains(i._linkElement)){const c=S.cloneNode(!0);o.removeChild(i._linkElement),o.insertBefore(c,i._caption),i._element=s=c}}let C=null;if(a){const S=i._element.parentNode;if(C=this.util.isRangeFormatElement(S)||this.util.isWysiwygDiv(S)?i._element:S||i._element,this.util.getParentElement(i._element,this.util.isNotCheckingNode))C=b?_:i._element,C.parentNode.replaceChild(l,C);else if(this.util.isListCell(C)){const c=this.util.getParentElement(i._element,function(u){return u.parentNode===C});C.insertBefore(l,c),this.util.removeItem(i._element),this.util.removeEmptyNode(c,null,!0)}else if(this.util.isFormatElement(C)){const c=this.util.getParentElement(i._element,function(u){return u.parentNode===C});C=this.util.splitElement(C,c),C.parentNode.insertBefore(l,C),this.util.removeItem(i._element),this.util.removeEmptyNode(C,null,!0),C.children.length===0&&(C.innerHTML=this.util.htmlRemoveWhiteSpace(C.innerHTML))}else if(this.util.isFormatElement(C.parentNode)){const c=C.parentNode;c.parentNode.insertBefore(l,C.previousSibling?c.nextElementSibling:c),i.__updateTags.map(function(u){return C.contains(u)}).length===0&&this.util.removeItem(C)}else C=this.util.isFigures(C.parentNode)?C.parentNode:C,C.parentNode.replaceChild(l,C);s=l.querySelector("img"),i._element=s,i._cover=o,i._container=l}b&&(a?(this.util.removeItem(b),this.util.getListChildren(_,function(S){return/IMG/i.test(S.tagName)}).length===0&&this.util.removeItem(_)):this.util.removeItem(_)),(h||!i._onlyPercentage&&r)&&!e&&(/\d+/.test(s.style.height)||this.context.resizing._rotateVertical&&i._captionChecked)&&(/%$/.test(i.inputX.value)||/%$/.test(i.inputY.value)?this.plugins.resizing.resetTransform.call(this,s):this.plugins.resizing.setTransformSize.call(this,s,this.util.getNumber(i.inputX.value,0),this.util.getNumber(i.inputY.value,0))),i._resizing&&(s.setAttribute("data-proportion",i._proportionChecked),r&&this.plugins.image.applySize.call(this)),this.plugins.image.setAlign.call(this,null,s,null,null),e&&this.plugins.fileManager.setInfo.call(this,"image",s,this.functions.onImageUpload,null,!0),t&&this.selectComponent(s,"image"),n||this.history.push(!1)},update_src:function(e,t,n){t.src=e,this._w.setTimeout(this.plugins.fileManager.setInfo.bind(this,"image",t,this.functions.onImageUpload,n,!0)),this.selectComponent(t,"image")},onModifyMode:function(e,t){if(!e)return;const n=this.context.image;n._linkElement=n.anchorCtx.linkAnchor=this.util.isAnchor(e.parentNode)?e.parentNode:null,n._element=e,n._cover=this.util.getParentElement(e,"FIGURE"),n._container=this.util.getParentElement(e,this.util.isMediaComponent),n._caption=this.util.getChildElement(n._cover,"FIGCAPTION"),n._align=e.getAttribute("data-align")||e.style.float||"none",e.style.float="",this.plugins.anchor.setCtx(n._linkElement,n.anchorCtx),t&&(n._element_w=t.w,n._element_h=t.h,n._element_t=t.t,n._element_l=t.l);let i=n._element.getAttribute("data-size")||n._element.getAttribute("data-origin"),s,o;i?(i=i.split(","),s=i[0],o=i[1]):t&&(s=t.w,o=t.h),n._origin_w=s||e.style.width||e.width||"",n._origin_h=o||e.style.height||e.height||""},openModify:function(e){const t=this.context.image;t.imgUrlFile&&(t._v_src._linkValue=t.previewSrc.textContent=t.imgUrlFile.value=t._element.src),t._altText=t.altText.value=t._element.alt,(t.modal.querySelector('input[name="suneditor_image_radio"][value="'+t._align+'"]')||t.modal.querySelector('input[name="suneditor_image_radio"][value="none"]')).checked=!0,t._align=t.modal.querySelector('input[name="suneditor_image_radio"]:checked').value,t._captionChecked=t.captionCheckEl.checked=!!t._caption,t._resizing&&this.plugins.resizing._module_setModifyInputSize.call(this,t,this.plugins.image),e||this.plugins.dialog.open.call(this,"image",!0)},applySize:function(e,t){const n=this.context.image;return e||(e=n.inputX.value||this.options.imageWidth),t||(t=n.inputY.value||this.options.imageHeight),n._onlyPercentage&&e||/%$/.test(e)?(this.plugins.image.setPercentSize.call(this,e,t),!0):((!e||e==="auto")&&(!t||t==="auto")?this.plugins.image.setAutoSize.call(this):this.plugins.image.setSize.call(this,e,t,!1),!1)},sizeRevert:function(){this.plugins.resizing._module_sizeRevert.call(this,this.context.image)},setSize:function(e,t,n,i){const s=this.context.image,o=/^(rw|lw)$/.test(i)&&/\d+/.test(s._element.style.height);/^(th|bh)$/.test(i)&&/\d+/.test(s._element.style.width)||(s._element.style.width=this.util.isNumber(e)?e+s.sizeUnit:e,this.plugins.image.cancelPercentAttr.call(this)),o||(s._element.style.height=this.util.isNumber(t)?t+s.sizeUnit:/%$/.test(t)?"":t),s._align==="center"&&this.plugins.image.setAlign.call(this,null,null,null,null),n||s._element.removeAttribute("data-percentage"),this.plugins.resizing._module_saveCurrentSize.call(this,s)},setAutoSize:function(){const e=this.context.image;e._caption&&(e._caption.style.marginTop=""),this.plugins.resizing.resetTransform.call(this,e._element),this.plugins.image.cancelPercentAttr.call(this),e._element.style.maxWidth="",e._element.style.width="",e._element.style.height="",e._cover.style.width="",e._cover.style.height="",this.plugins.image.setAlign.call(this,null,null,null,null),e._element.setAttribute("data-percentage","auto,auto"),this.plugins.resizing._module_saveCurrentSize.call(this,e)},setOriginSize:function(){const e=this.context.image;e._element.removeAttribute("data-percentage"),this.plugins.resizing.resetTransform.call(this,e._element),this.plugins.image.cancelPercentAttr.call(this);const t=(e._element.getAttribute("data-origin")||"").split(","),n=t[0],i=t[1];t&&(e._onlyPercentage||/%$/.test(n)&&(/%$/.test(i)||!/\d/.test(i))?this.plugins.image.setPercentSize.call(this,n,i):this.plugins.image.setSize.call(this,n,i),this.plugins.resizing._module_saveCurrentSize.call(this,e))},setPercentSize:function(e,t){const n=this.context.image;t=t&&!/%$/.test(t)&&!this.util.getNumber(t,0)?this.util.isNumber(t)?t+"%":t:this.util.isNumber(t)?t+n.sizeUnit:t||"";const i=/%$/.test(t);n._container.style.width=this.util.isNumber(e)?e+"%":e,n._container.style.height="",n._cover.style.width="100%",n._cover.style.height=i?t:"",n._element.style.width="100%",n._element.style.height=i?"":t,n._element.style.maxWidth="",n._align==="center"&&this.plugins.image.setAlign.call(this,null,null,null,null),n._element.setAttribute("data-percentage",e+","+t),this.plugins.resizing.setCaptionPosition.call(this,n._element),this.plugins.resizing._module_saveCurrentSize.call(this,n)},cancelPercentAttr:function(){const e=this.context.image;e._cover.style.width="",e._cover.style.height="",e._container.style.width="",e._container.style.height="",this.util.removeClass(e._container,this.context.image._floatClassRegExp),this.util.addClass(e._container,"__se__float-"+e._align),e._align==="center"&&this.plugins.image.setAlign.call(this,null,null,null,null)},setAlign:function(e,t,n,i){const s=this.context.image;e||(e=s._align),t||(t=s._element),n||(n=s._cover),i||(i=s._container),/%$/.test(t.style.width)&&e==="center"?(i.style.minWidth="100%",n.style.width=i.style.width):(i.style.minWidth="",n.style.width=this.context.resizing._rotateVertical?t.style.height||t.offsetHeight:!t.style.width||t.style.width==="auto"?"":t.style.width||"100%"),this.util.hasClass(i,"__se__float-"+e)||(this.util.removeClass(i,s._floatClassRegExp),this.util.addClass(i,"__se__float-"+e)),t.setAttribute("data-align",e)},init:function(){const e=this.context.image;e.imgInputFile&&(e.imgInputFile.value=""),e.imgUrlFile&&(e._v_src._linkValue=e.previewSrc.textContent=e.imgUrlFile.value=""),e.imgInputFile&&e.imgUrlFile&&(e.imgUrlFile.removeAttribute("disabled"),e.previewSrc.style.textDecoration=""),e.altText.value="",e.modal.querySelector('input[name="suneditor_image_radio"][value="none"]').checked=!0,e.captionCheckEl.checked=!1,e._element=null,this.plugins.image.openTab.call(this,"init"),e._resizing&&(e.inputX.value=this.options.imageWidth===e._defaultSizeX?"":this.options.imageWidth,e.inputY.value=this.options.imageHeight===e._defaultSizeY?"":this.options.imageHeight,e.proportion.checked=!0,e._ratio=!1,e._ratioX=1,e._ratioY=1),this.plugins.anchor.init.call(this,e.anchorCtx)}},XC={name:"video",display:"dialog",add:function(e){e.addModule([Fi,Xo,fh,Qo]);const t=e.options,n=e.context,i=n.video={_infoList:[],_infoIndex:0,_uploadFileLength:0,focusElement:null,sizeUnit:t._videoSizeUnit,_align:"none",_floatClassRegExp:"__se__float\\-[a-z]+",_youtubeQuery:t.youtubeQuery,_vimeoQuery:t.vimeoQuery,_videoRatio:t.videoRatio*100+"%",_defaultRatio:t.videoRatio*100+"%",_linkValue:"",_element:null,_cover:null,_container:null,inputX:null,inputY:null,_element_w:1,_element_h:1,_element_l:0,_element_t:0,_defaultSizeX:"100%",_defaultSizeY:t.videoRatio*100+"%",_origin_w:t.videoWidth==="100%"?"":t.videoWidth,_origin_h:t.videoHeight==="56.25%"?"":t.videoHeight,_proportionChecked:!0,_resizing:t.videoResizing,_resizeDotHide:!t.videoHeightShow,_rotation:t.videoRotation,_alignHide:!t.videoAlignShow,_onlyPercentage:t.videoSizeOnlyPercentage,_ratio:!1,_ratioX:1,_ratioY:1,_captionShow:!1};let s=this.setDialog(e);i.modal=s,i.videoInputFile=s.querySelector("._se_video_file"),i.videoUrlFile=s.querySelector(".se-input-url"),i.focusElement=i.videoUrlFile||i.videoInputFile,i.preview=s.querySelector(".se-link-preview"),s.querySelector("form").addEventListener("submit",this.submit.bind(e)),i.videoInputFile&&s.querySelector(".se-dialog-files-edge-button").addEventListener("click",this._removeSelectedFiles.bind(i.videoInputFile,i.videoUrlFile,i.preview)),i.videoInputFile&&i.videoUrlFile&&i.videoInputFile.addEventListener("change",this._fileInputChange.bind(i)),i.videoUrlFile&&i.videoUrlFile.addEventListener("input",this._onLinkPreview.bind(i.preview,i,t.linkProtocol)),i.proportion={},i.videoRatioOption={},i.inputX={},i.inputY={},t.videoResizing&&(i.proportion=s.querySelector("._se_video_check_proportion"),i.videoRatioOption=s.querySelector(".se-video-ratio"),i.inputX=s.querySelector("._se_video_size_x"),i.inputY=s.querySelector("._se_video_size_y"),i.inputX.value=t.videoWidth,i.inputY.value=t.videoHeight,i.inputX.addEventListener("keyup",this.setInputSize.bind(e,"x")),i.inputY.addEventListener("keyup",this.setInputSize.bind(e,"y")),i.inputX.addEventListener("change",this.setRatio.bind(e)),i.inputY.addEventListener("change",this.setRatio.bind(e)),i.proportion.addEventListener("change",this.setRatio.bind(e)),i.videoRatioOption.addEventListener("change",this.setVideoRatio.bind(e)),s.querySelector(".se-dialog-btn-revert").addEventListener("click",this.sizeRevert.bind(e))),n.dialog.modal.appendChild(s),s=null},setDialog:function(e){const t=e.options,n=e.lang,i=e.util.createElement("DIV");i.className="se-dialog-content",i.style.display="none";let s='<form method="post" enctype="multipart/form-data"><div class="se-dialog-header"><button type="button" data-command="close" class="se-btn se-dialog-close" title="'+n.dialogBox.close+'" aria-label="'+n.dialogBox.close+'">'+e.icons.cancel+'</button><span class="se-modal-title">'+n.dialogBox.videoBox.title+'</span></div><div class="se-dialog-body">';if(t.videoFileInput&&(s+='<div class="se-dialog-form"><label>'+n.dialogBox.videoBox.file+'</label><div class="se-dialog-form-files"><input class="se-input-form _se_video_file" type="file" accept="'+t.videoAccept+'"'+(t.videoMultipleFile?' multiple="multiple"':"")+'/><button type="button" data-command="filesRemove" class="se-btn se-dialog-files-edge-button se-file-remove" title="'+n.controller.remove+'" aria-label="'+n.controller.remove+'">'+e.icons.cancel+"</button></div></div>"),t.videoUrlInput&&(s+='<div class="se-dialog-form"><label>'+n.dialogBox.videoBox.url+'</label><input class="se-input-form se-input-url" type="text" /><pre class="se-link-preview"></pre></div>'),t.videoResizing){const o=t.videoRatioList||[{name:"16:9",value:.5625},{name:"4:3",value:.75},{name:"21:9",value:.4285}],l=t.videoRatio,a=t.videoSizeOnlyPercentage,r=a?' style="display: none !important;"':"",f=t.videoHeightShow?"":' style="display: none !important;"',d=t.videoRatioShow?"":' style="display: none !important;"',h=!a&&!t.videoHeightShow&&!t.videoRatioShow?' style="display: none !important;"':"";s+='<div class="se-dialog-form"><div class="se-dialog-size-text"><label class="size-w">'+n.dialogBox.width+'</label><label class="se-dialog-size-x"> </label><label class="size-h"'+f+">"+n.dialogBox.height+'</label><label class="size-h"'+d+">("+n.dialogBox.ratio+')</label></div><input class="se-input-control _se_video_size_x" placeholder="100%"'+(a?' type="number" min="1"':'type="text"')+(a?' max="100"':"")+'/><label class="se-dialog-size-x"'+h+">"+(a?"%":"x")+'</label><input class="se-input-control _se_video_size_y" placeholder="'+t.videoRatio*100+'%"'+(a?' type="number" min="1"':'type="text"')+(a?' max="100"':"")+f+'/><select class="se-input-select se-video-ratio" title="'+n.dialogBox.ratio+'" aria-label="'+n.dialogBox.ratio+'"'+d+">",f||(s+='<option value=""> - </option>');for(let b=0,_=o.length;b<_;b++)s+='<option value="'+o[b].value+'"'+(l.toString()===o[b].value.toString()?" selected":"")+">"+o[b].name+"</option>";s+='</select><button type="button" title="'+n.dialogBox.revertButton+'" aria-label="'+n.dialogBox.revertButton+'" class="se-btn se-dialog-btn-revert" style="float: right;">'+e.icons.revert+'</button></div><div class="se-dialog-form se-dialog-form-footer"'+r+h+'><label><input type="checkbox" class="se-dialog-btn-check _se_video_check_proportion" checked/> '+n.dialogBox.proportion+"</label></div>"}return s+='</div><div class="se-dialog-footer"><div'+(t.videoAlignShow?"":' style="display: none"')+'><label><input type="radio" name="suneditor_video_radio" class="se-dialog-btn-radio" value="none" checked>'+n.dialogBox.basic+'</label><label><input type="radio" name="suneditor_video_radio" class="se-dialog-btn-radio" value="left">'+n.dialogBox.left+'</label><label><input type="radio" name="suneditor_video_radio" class="se-dialog-btn-radio" value="center">'+n.dialogBox.center+'</label><label><input type="radio" name="suneditor_video_radio" class="se-dialog-btn-radio" value="right">'+n.dialogBox.right+'</label></div><button type="submit" class="se-btn-primary" title="'+n.dialogBox.submitButton+'" aria-label="'+n.dialogBox.submitButton+'"><span>'+n.dialogBox.submitButton+"</span></button></div></form>",i.innerHTML=s,i},_fileInputChange:function(){this.videoInputFile.value?(this.videoUrlFile.setAttribute("disabled",!0),this.preview.style.textDecoration="line-through"):(this.videoUrlFile.removeAttribute("disabled"),this.preview.style.textDecoration="")},_removeSelectedFiles:function(e,t){this.value="",e&&(e.removeAttribute("disabled"),t.style.textDecoration="")},_onLinkPreview:function(e,t,n){const i=n.target.value.trim();/^<iframe.*\/iframe>$/.test(i)?(e._linkValue=i,this.textContent='<IFrame :src=".."></IFrame>'):e._linkValue=this.textContent=i?t&&i.indexOf("://")===-1&&i.indexOf("#")!==0?t+i:i.indexOf("://")===-1?"/"+i:i:""},_setTagAttrs:function(e){e.setAttribute("controls",!0);const t=this.options.videoTagAttrs;if(t)for(let n in t)this.util.hasOwn(t,n)&&e.setAttribute(n,t[n])},createVideoTag:function(){const e=this.util.createElement("VIDEO");return this.plugins.video._setTagAttrs.call(this,e),e},_setIframeAttrs:function(e){e.frameBorder="0",e.allowFullscreen=!0;const t=this.options.videoIframeAttrs;if(t)for(let n in t)this.util.hasOwn(t,n)&&e.setAttribute(n,t[n])},createIframeTag:function(){const e=this.util.createElement("IFRAME");return this.plugins.video._setIframeAttrs.call(this,e),e},fileTags:["iframe","video"],select:function(e){this.plugins.video.onModifyMode.call(this,e,this.plugins.resizing.call_controller_resize.call(this,e,"video"))},destroy:function(e){const t=e||this.context.video._element,n=this.context.video._container,i=t.getAttribute("data-index")*1;if(typeof this.functions.onVideoDeleteBefore=="function"&&this.functions.onVideoDeleteBefore(t,n,i,this)===!1)return;let s=n.previousElementSibling||n.nextElementSibling;const o=n.parentNode;this.util.removeItem(n),this.plugins.video.init.call(this),this.controllersOff(),o!==this.context.element.wysiwyg&&this.util.removeItemAllParents(o,function(l){return l.childNodes.length===0},null),this.focusEdge(s),this.plugins.fileManager.deleteInfo.call(this,"video",i,this.functions.onVideoUpload),this.history.push(!1)},on:function(e){const t=this.context.video;e?t.videoInputFile&&this.options.videoMultipleFile&&t.videoInputFile.removeAttribute("multiple"):(t.inputX.value=t._origin_w=this.options.videoWidth===t._defaultSizeX?"":this.options.videoWidth,t.inputY.value=t._origin_h=this.options.videoHeight===t._defaultSizeY?"":this.options.videoHeight,t.proportion.disabled=!0,t.videoInputFile&&this.options.videoMultipleFile&&t.videoInputFile.setAttribute("multiple","multiple")),t._resizing&&this.plugins.video.setVideoRatioSelect.call(this,t._origin_h||t._defaultRatio)},open:function(){this.plugins.dialog.open.call(this,"video",this.currentControllerName==="video")},setVideoRatio:function(e){const t=this.context.video,n=e.target.options[e.target.selectedIndex].value;t._defaultSizeY=t._videoRatio=n?n*100+"%":t._defaultSizeY,t.inputY.placeholder=n?n*100+"%":"",t.inputY.value=""},setInputSize:function(e,t){if(t&&t.keyCode===32){t.preventDefault();return}const n=this.context.video;this.plugins.resizing._module_setInputSize.call(this,n,e),e==="y"&&this.plugins.video.setVideoRatioSelect.call(this,t.target.value||n._defaultRatio)},setRatio:function(){this.plugins.resizing._module_setRatio.call(this,this.context.video)},submit:function(e){const t=this.context.video,n=this.plugins.video;e.preventDefault(),e.stopPropagation(),t._align=t.modal.querySelector('input[name="suneditor_video_radio"]:checked').value;try{t.videoInputFile&&t.videoInputFile.files.length>0?(this.showLoading(),n.submitAction.call(this,this.context.video.videoInputFile.files)):t.videoUrlFile&&t._linkValue.length>0&&(this.showLoading(),n.setup_url.call(this,t._linkValue))}catch(i){throw this.closeLoading(),Error('[SUNEDITOR.video.submit.fail] cause : "'+i.message+'"')}finally{this.plugins.dialog.close.call(this)}return!1},submitAction:function(e){if(e.length===0)return;let t=0,n=[];for(let l=0,a=e.length;l<a;l++)/video/i.test(e[l].type)&&(n.push(e[l]),t+=e[l].size);const i=this.options.videoUploadSizeLimit;if(i>0){let l=0;const a=this.context.video._infoList;for(let r=0,f=a.length;r<f;r++)l+=a[r].size*1;if(t+l>i){this.closeLoading();const r="[SUNEDITOR.videoUpload.fail] Size of uploadable total videos: "+i/1e3+"KB";(typeof this.functions.onVideoUploadError!="function"||this.functions.onVideoUploadError(r,{limitSize:i,currentSize:l,uploadSize:t},this))&&this.functions.noticeOpen(r);return}}const s=this.context.video;s._uploadFileLength=n.length;const o={inputWidth:s.inputX.value,inputHeight:s.inputY.value,align:s._align,isUpdate:this.context.dialog.updateModal,element:s._element};if(typeof this.functions.onVideoUploadBefore=="function"){const l=this.functions.onVideoUploadBefore(n,o,this,(function(a){a&&this._w.Array.isArray(a.result)?this.plugins.video.register.call(this,o,a):this.plugins.video.upload.call(this,o,a)}).bind(this));if(typeof l>"u")return;if(!l){this.closeLoading();return}typeof l=="object"&&l.length>0&&(n=l)}this.plugins.video.upload.call(this,o,n)},error:function(e,t){if(this.closeLoading(),typeof this.functions.onVideoUploadError!="function"||this.functions.onVideoUploadError(e,t,this))throw this.functions.noticeOpen(e),Error("[SUNEDITOR.plugin.video.error] response: "+e)},upload:function(e,t){if(!t){this.closeLoading();return}if(typeof t=="string"){this.plugins.video.error.call(this,t,null);return}const n=this.options.videoUploadUrl,i=this.context.dialog.updateModal?1:t.length;if(typeof n=="string"&&n.length>0){const s=new FormData;for(let o=0;o<i;o++)s.append("file-"+o,t[o]);this.plugins.fileManager.upload.call(this,n,this.options.videoUploadHeader,s,this.plugins.video.callBack_videoUpload.bind(this,e),this.functions.onVideoUploadError)}else throw Error('[SUNEDITOR.videoUpload.fail] cause : There is no "videoUploadUrl" option.')},callBack_videoUpload:function(e,t){if(typeof this.functions.videoUploadHandler=="function")this.functions.videoUploadHandler(t,e,this);else{const n=JSON.parse(t.responseText);n.errorMessage?this.plugins.video.error.call(this,n.errorMessage,n):this.plugins.video.register.call(this,e,n)}},register:function(e,t){const n=t.result,i=this.plugins.video.createVideoTag.call(this);for(let s=0,o=n.length,l;s<o;s++)l={name:n[s].name,size:n[s].size},this.plugins.video.create_video.call(this,e.isUpdate?e.element:i.cloneNode(!1),n[s].url,e.inputWidth,e.inputHeight,e.align,l,e.isUpdate);this.closeLoading()},setup_url:function(e){try{const t=this.context.video;if(e||(e=t._linkValue),!e||/^<iframe.*\/iframe>$/.test(e)&&(e=new this._w.DOMParser().parseFromString(e,"text/html").querySelector("iframe").src,e.length===0))return!1;if(/youtu\.?be/.test(e)){if(/^http/.test(e)||(e="https://"+e),e=e.replace("watch?v=",""),/^\/\/.+\/embed\//.test(e)||(e=e.replace(e.match(/\/\/.+\//)[0],"//www.youtube.com/embed/").replace("&","?&")),t._youtubeQuery.length>0)if(/\?/.test(e)){const n=e.split("?");e=n[0]+"?"+t._youtubeQuery+"&"+n[1]}else e+="?"+t._youtubeQuery}else if(/vimeo\.com/.test(e)&&(e.endsWith("/")&&(e=e.slice(0,-1)),e="https://player.vimeo.com/video/"+e.slice(e.lastIndexOf("/")+1),t._vimeoQuery.length>0))if(/\?/.test(e)){const n=e.split("?");e=n[0]+"?"+t._vimeoQuery+"&"+n[1]}else e+="?"+t._vimeoQuery;this.plugins.video.create_video.call(this,this.plugins.video[!/embed|iframe|player|\/e\/|\.php|\.html?/.test(e)&&!/vimeo\.com/.test(e)?"createVideoTag":"createIframeTag"].call(this),e,t.inputX.value,t.inputY.value,t._align,null,this.context.dialog.updateModal)}catch(t){throw Error('[SUNEDITOR.video.upload.fail] cause : "'+t.message+'"')}finally{this.closeLoading()}},create_video:function(e,t,n,i,s,o,l){this.context.resizing._resize_plugin="video";const a=this.context.video;let r=null,f=null,d=!1;if(l){if(e=a._element,e.src!==t){d=!0;const S=/youtu\.?be/.test(t),c=/vimeo\.com/.test(t);if((S||c)&&!/^iframe$/i.test(e.nodeName)){const u=this.plugins.video.createIframeTag.call(this);u.src=t,e.parentNode.replaceChild(u,e),a._element=e=u}else if(!S&&!c&&!/^video$/i.test(e.nodeName)){const u=this.plugins.video.createVideoTag.call(this);u.src=t,e.parentNode.replaceChild(u,e),a._element=e=u}else e.src=t}f=a._container,r=this.util.getParentElement(e,"FIGURE")}else d=!0,e.src=t,a._element=e,r=this.plugins.component.set_cover.call(this,e),f=this.plugins.component.set_container.call(this,r,"se-video-container");a._cover=r,a._container=f;const h=this.plugins.resizing._module_getSizeX.call(this,a)!==(n||a._defaultSizeX)||this.plugins.resizing._module_getSizeY.call(this,a)!==(i||a._videoRatio),b=!l||h;a._resizing&&(this.context.video._proportionChecked=a.proportion.checked,e.setAttribute("data-proportion",a._proportionChecked));let _=!1;b&&(_=this.plugins.video.applySize.call(this)),_&&s==="center"||this.plugins.video.setAlign.call(this,null,e,r,f);let C=!0;if(l)a._resizing&&this.context.resizing._rotateVertical&&b&&this.plugins.resizing.setTransformSize.call(this,e,null,null);else if(C=this.insertComponent(f,!1,!0,!this.options.mediaAutoSelect),!this.options.mediaAutoSelect){const S=this.appendFormatTag(f,null);S&&this.setRange(S,0,S,0)}C&&(d&&this.plugins.fileManager.setInfo.call(this,"video",e,this.functions.onVideoUpload,o,!0),l&&(this.selectComponent(e,"video"),this.history.push(!1))),this.context.resizing._resize_plugin=""},_update_videoCover:function(e){if(!e)return;const t=this.context.video;/^video$/i.test(e.nodeName)?this.plugins.video._setTagAttrs.call(this,e):this.plugins.video._setIframeAttrs.call(this,e);const n=e.parentNode;let i=this.util.isRangeFormatElement(n)||this.util.isWysiwygDiv(n)?e:n||e;const s=e;t._element=e=e.cloneNode(!0);const o=t._cover=this.plugins.component.set_cover.call(this,e),l=t._container=this.plugins.component.set_container.call(this,o,"se-video-container");try{const a=i.querySelector("figcaption");let r=null;a&&(r=this.util.createElement("DIV"),r.innerHTML=a.innerHTML,this.util.removeItem(a));const f=(e.getAttribute("data-size")||e.getAttribute("data-origin")||"").split(",");this.plugins.video.applySize.call(this,f[0]||s.style.width||s.width||"",f[1]||s.style.height||s.height||"");const d=this.util.getFormatElement(s);if(d&&(t._align=d.style.textAlign||d.style.float),this.plugins.video.setAlign.call(this,null,e,o,l),this.util.getParentElement(s,this.util.isNotCheckingNode))s.parentNode.replaceChild(l,s);else if(this.util.isListCell(i)){const h=this.util.getParentElement(s,function(b){return b.parentNode===i});i.insertBefore(l,h),this.util.removeItem(s),this.util.removeEmptyNode(h,null,!0)}else if(this.util.isFormatElement(i)){const h=this.util.getParentElement(s,function(b){return b.parentNode===i});i=this.util.splitElement(i,h),i.parentNode.insertBefore(l,i),this.util.removeItem(s),this.util.removeEmptyNode(i,null,!0),i.children.length===0&&(i.innerHTML=this.util.htmlRemoveWhiteSpace(i.innerHTML))}else i.parentNode.replaceChild(l,i);r&&i.parentNode.insertBefore(r,l.nextElementSibling)}catch(a){console.warn("[SUNEDITOR.video.error] Maybe the video tag is nested.",a)}this.plugins.fileManager.setInfo.call(this,"video",e,this.functions.onVideoUpload,null,!0),this.plugins.video.init.call(this)},onModifyMode:function(e,t){const n=this.context.video;n._element=e,n._cover=this.util.getParentElement(e,"FIGURE"),n._container=this.util.getParentElement(e,this.util.isMediaComponent),n._align=e.style.float||e.getAttribute("data-align")||"none",e.style.float="",t&&(n._element_w=t.w,n._element_h=t.h,n._element_t=t.t,n._element_l=t.l);let i=n._element.getAttribute("data-size")||n._element.getAttribute("data-origin"),s,o;i?(i=i.split(","),s=i[0],o=i[1]):t&&(s=t.w,o=t.h),n._origin_w=s||e.style.width||e.width||"",n._origin_h=o||e.style.height||e.height||""},openModify:function(e){const t=this.context.video;if(t.videoUrlFile&&(t._linkValue=t.preview.textContent=t.videoUrlFile.value=t._element.src||(t._element.querySelector("source")||"").src||""),(t.modal.querySelector('input[name="suneditor_video_radio"][value="'+t._align+'"]')||t.modal.querySelector('input[name="suneditor_video_radio"][value="none"]')).checked=!0,t._resizing){this.plugins.resizing._module_setModifyInputSize.call(this,t,this.plugins.video);const n=t._videoRatio=this.plugins.resizing._module_getSizeY.call(this,t);this.plugins.video.setVideoRatioSelect.call(this,n)||(t.inputY.value=t._onlyPercentage?this.util.getNumber(n,2):n)}e||this.plugins.dialog.open.call(this,"video",!0)},setVideoRatioSelect:function(e){let t=!1;const n=this.context.video,i=n.videoRatioOption.options;/%$/.test(e)||n._onlyPercentage?e=this.util.getNumber(e,2)/100+"":(!this.util.isNumber(e)||e*1>=1)&&(e=""),n.inputY.placeholder="";for(let s=0,o=i.length;s<o;s++)i[s].value===e?(t=i[s].selected=!0,n.inputY.placeholder=e?e*100+"%":""):i[s].selected=!1;return t},checkFileInfo:function(){this.plugins.fileManager.checkInfo.call(this,"video",["iframe","video"],this.functions.onVideoUpload,this.plugins.video._update_videoCover.bind(this),!0)},resetFileInfo:function(){this.plugins.fileManager.resetInfo.call(this,"video",this.functions.onVideoUpload)},applySize:function(e,t){const n=this.context.video;return e||(e=n.inputX.value||this.options.videoWidth),t||(t=n.inputY.value||this.options.videoHeight),n._onlyPercentage||/%$/.test(e)||!e?(this.plugins.video.setPercentSize.call(this,e||"100%",t||(/%$/.test(n._videoRatio)?n._videoRatio:n._defaultRatio)),!0):((!e||e==="auto")&&(!t||t==="auto")?this.plugins.video.setAutoSize.call(this):this.plugins.video.setSize.call(this,e,t||n._videoRatio||n._defaultRatio,!1),!1)},sizeRevert:function(){this.plugins.resizing._module_sizeRevert.call(this,this.context.video)},setSize:function(e,t,n,i){const s=this.context.video,o=/^(rw|lw)$/.test(i),l=/^(th|bh)$/.test(i);l||(e=this.util.getNumber(e,0)),o||(t=this.util.isNumber(t)?t+s.sizeUnit:t||""),e=e?e+s.sizeUnit:"",l||(s._element.style.width=e),o||(s._cover.style.paddingBottom=s._cover.style.height=t),!l&&!/%$/.test(e)&&(s._cover.style.width=e,s._container.style.width=""),!o&&!/%$/.test(t)?s._element.style.height=t:s._element.style.height="",n||s._element.removeAttribute("data-percentage"),this.plugins.resizing._module_saveCurrentSize.call(this,s)},setAutoSize:function(){this.plugins.video.setPercentSize.call(this,100,this.context.video._defaultRatio)},setOriginSize:function(e){const t=this.context.video;t._element.removeAttribute("data-percentage"),this.plugins.resizing.resetTransform.call(this,t._element),this.plugins.video.cancelPercentAttr.call(this);const n=((e?t._element.getAttribute("data-size"):"")||t._element.getAttribute("data-origin")||"").split(",");if(n){const i=n[0],s=n[1];t._onlyPercentage||/%$/.test(i)&&(/%$/.test(s)||!/\d/.test(s))?this.plugins.video.setPercentSize.call(this,i,s):this.plugins.video.setSize.call(this,i,s),this.plugins.resizing._module_saveCurrentSize.call(this,t)}},setPercentSize:function(e,t){const n=this.context.video;t=t&&!/%$/.test(t)&&!this.util.getNumber(t,0)?this.util.isNumber(t)?t+"%":t:this.util.isNumber(t)?t+n.sizeUnit:t||n._defaultRatio,n._container.style.width=this.util.isNumber(e)?e+"%":e,n._container.style.height="",n._cover.style.width="100%",n._cover.style.height=t,n._cover.style.paddingBottom=t,n._element.style.width="100%",n._element.style.height="100%",n._element.style.maxWidth="",n._align==="center"&&this.plugins.video.setAlign.call(this,null,null,null,null),n._element.setAttribute("data-percentage",e+","+t),this.plugins.resizing._module_saveCurrentSize.call(this,n)},cancelPercentAttr:function(){const e=this.context.video;e._cover.style.width="",e._cover.style.height="",e._cover.style.paddingBottom="",e._container.style.width="",e._container.style.height="",this.util.removeClass(e._container,this.context.video._floatClassRegExp),this.util.addClass(e._container,"__se__float-"+e._align),e._align==="center"&&this.plugins.video.setAlign.call(this,null,null,null,null)},setAlign:function(e,t,n,i){const s=this.context.video;e||(e=s._align),t||(t=s._element),n||(n=s._cover),i||(i=s._container),/%$/.test(t.style.width)&&e==="center"?(i.style.minWidth="100%",n.style.width=i.style.width,n.style.height=n.style.height,n.style.paddingBottom=/%$/.test(n.style.height)?this.util.getNumber(this.util.getNumber(n.style.height,2)/100*this.util.getNumber(n.style.width,2),2)+"%":n.style.height):(i.style.minWidth="",n.style.width=this.context.resizing._rotateVertical?t.style.height||t.offsetHeight:t.style.width||"100%",n.style.paddingBottom=n.style.height),this.util.hasClass(i,"__se__float-"+e)||(this.util.removeClass(i,s._floatClassRegExp),this.util.addClass(i,"__se__float-"+e)),t.setAttribute("data-align",e)},init:function(){const e=this.context.video;e.videoInputFile&&(e.videoInputFile.value=""),e.videoUrlFile&&(e._linkValue=e.preview.textContent=e.videoUrlFile.value=""),e.videoInputFile&&e.videoUrlFile&&(e.videoUrlFile.removeAttribute("disabled"),e.preview.style.textDecoration=""),e._origin_w=this.options.videoWidth,e._origin_h=this.options.videoHeight,e.modal.querySelector('input[name="suneditor_video_radio"][value="none"]').checked=!0,e._resizing&&(e.inputX.value=this.options.videoWidth===e._defaultSizeX?"":this.options.videoWidth,e.inputY.value=this.options.videoHeight===e._defaultSizeY?"":this.options.videoHeight,e.proportion.checked=!0,e.proportion.disabled=!0,this.plugins.video.setVideoRatioSelect.call(this,e._defaultRatio))}},QC={name:"audio",display:"dialog",add:function(e){e.addModule([Fi,Xo,Qo]);const t=e.context,n=t.audio={_infoList:[],_infoIndex:0,_uploadFileLength:0,focusElement:null,targetSelect:null,_origin_w:e.options.audioWidth,_origin_h:e.options.audioHeight,_linkValue:"",_element:null,_cover:null,_container:null};let i=this.setDialog(e);n.modal=i,n.audioInputFile=i.querySelector("._se_audio_files"),n.audioUrlFile=i.querySelector(".se-input-url"),n.focusElement=n.audioInputFile||n.audioUrlFile,n.preview=i.querySelector(".se-link-preview");let s=this.setController(e);n.controller=s,i.querySelector("form").addEventListener("submit",this.submit.bind(e)),n.audioInputFile&&i.querySelector(".se-dialog-files-edge-button").addEventListener("click",this._removeSelectedFiles.bind(n.audioInputFile,n.audioUrlFile,n.preview)),n.audioInputFile&&n.audioUrlFile&&n.audioInputFile.addEventListener("change",this._fileInputChange.bind(n)),s.addEventListener("click",this.onClick_controller.bind(e)),n.audioUrlFile&&n.audioUrlFile.addEventListener("input",this._onLinkPreview.bind(n.preview,n,e.options.linkProtocol)),t.dialog.modal.appendChild(i),t.element.relative.appendChild(s),i=null,s=null},setDialog:function(e){const t=e.options,n=e.lang,i=e.util.createElement("DIV");i.className="se-dialog-content",i.style.display="none";let s='<form method="post" enctype="multipart/form-data"><div class="se-dialog-header"><button type="button" data-command="close" class="se-btn se-dialog-close" title="'+n.dialogBox.close+'" aria-label="'+n.dialogBox.close+'">'+e.icons.cancel+'</button><span class="se-modal-title">'+n.dialogBox.audioBox.title+'</span></div><div class="se-dialog-body">';return t.audioFileInput&&(s+='<div class="se-dialog-form"><label>'+n.dialogBox.audioBox.file+'</label><div class="se-dialog-form-files"><input class="se-input-form _se_audio_files" type="file" accept="'+t.audioAccept+'"'+(t.audioMultipleFile?' multiple="multiple"':"")+'/><button type="button" data-command="filesRemove" class="se-btn se-dialog-files-edge-button se-file-remove" title="'+n.controller.remove+'" aria-label="'+n.controller.remove+'">'+e.icons.cancel+"</button></div></div>"),t.audioUrlInput&&(s+='<div class="se-dialog-form"><label>'+n.dialogBox.audioBox.url+'</label><input class="se-input-form se-input-url" type="text" /><pre class="se-link-preview"></pre></div>'),s+='</div><div class="se-dialog-footer"><button type="submit" class="se-btn-primary" title="'+n.dialogBox.submitButton+'" aria-label="'+n.dialogBox.submitButton+'"><span>'+n.dialogBox.submitButton+"</span></button></div></form>",i.innerHTML=s,i},setController:function(e){const t=e.lang,n=e.icons,i=e.util.createElement("DIV");return i.className="se-controller se-controller-link",i.innerHTML='<div class="se-arrow se-arrow-up"></div><div class="link-content"><div class="se-btn-group"><button type="button" data-command="update" tabindex="-1" class="se-tooltip">'+n.edit+'<span class="se-tooltip-inner"><span class="se-tooltip-text">'+t.controller.edit+'</span></span></button><button type="button" data-command="delete" tabindex="-1" class="se-tooltip">'+n.delete+'<span class="se-tooltip-inner"><span class="se-tooltip-text">'+t.controller.remove+"</span></span></button></div></div>",i},_fileInputChange:function(){this.audioInputFile.value?(this.audioUrlFile.setAttribute("disabled",!0),this.preview.style.textDecoration="line-through"):(this.audioUrlFile.removeAttribute("disabled"),this.preview.style.textDecoration="")},_removeSelectedFiles:function(e,t){this.value="",e&&(e.removeAttribute("disabled"),t.style.textDecoration="")},_createAudioTag:function(){const e=this.util.createElement("AUDIO");this.plugins.audio._setTagAttrs.call(this,e);const t=this.context.audio._origin_w,n=this.context.audio._origin_h;return e.setAttribute("origin-size",t+","+n),e.style.cssText=(t?"width:"+t+"; ":"")+(n?"height:"+n+";":""),e},_setTagAttrs:function(e){e.setAttribute("controls",!0);const t=this.options.audioTagAttrs;if(t)for(let n in t)this.util.hasOwn(t,n)&&e.setAttribute(n,t[n])},_onLinkPreview:function(e,t,n){const i=n.target.value.trim();e._linkValue=this.textContent=i?t&&i.indexOf("://")===-1&&i.indexOf("#")!==0?t+i:i.indexOf("://")===-1?"/"+i:i:""},fileTags:["audio"],select:function(e){this.plugins.audio.onModifyMode.call(this,e)},destroy:function(e){e=e||this.context.audio._element;const t=this.util.getParentElement(e,this.util.isComponent)||e,n=e.getAttribute("data-index")*1;if(typeof this.functions.onAudioDeleteBefore=="function"&&this.functions.onAudioDeleteBefore(e,t,n,this)===!1)return;const i=t.previousElementSibling||t.nextElementSibling,s=t.parentNode;this.util.removeItem(t),this.plugins.audio.init.call(this),this.controllersOff(),s!==this.context.element.wysiwyg&&this.util.removeItemAllParents(s,function(o){return o.childNodes.length===0},null),this.focusEdge(i),this.plugins.fileManager.deleteInfo.call(this,"audio",n,this.functions.onAudioUpload),this.history.push(!1)},checkFileInfo:function(){this.plugins.fileManager.checkInfo.call(this,"audio",["audio"],this.functions.onAudioUpload,this.plugins.audio.updateCover.bind(this),!1)},resetFileInfo:function(){this.plugins.fileManager.resetInfo.call(this,"audio",this.functions.onAudioUpload)},on:function(e){const t=this.context.audio;e?t._element?(this.context.dialog.updateModal=!0,t._linkValue=t.preview.textContent=t.audioUrlFile.value=t._element.src,t.audioInputFile&&this.options.audioMultipleFile&&t.audioInputFile.removeAttribute("multiple")):t.audioInputFile&&this.options.audioMultipleFile&&t.audioInputFile.removeAttribute("multiple"):(this.plugins.audio.init.call(this),t.audioInputFile&&this.options.audioMultipleFile&&t.audioInputFile.setAttribute("multiple","multiple"))},open:function(){this.plugins.dialog.open.call(this,"audio",this.currentControllerName==="audio")},submit:function(e){const t=this.context.audio;e.preventDefault(),e.stopPropagation();try{t.audioInputFile&&t.audioInputFile.files.length>0?(this.showLoading(),this.plugins.audio.submitAction.call(this,t.audioInputFile.files)):t.audioUrlFile&&t._linkValue.length>0&&(this.showLoading(),this.plugins.audio.setupUrl.call(this,t._linkValue))}catch(n){throw this.closeLoading(),Error('[SUNEDITOR.audio.submit.fail] cause : "'+n.message+'"')}finally{this.plugins.dialog.close.call(this)}return!1},submitAction:function(e){if(e.length===0)return;let t=0,n=[];for(let l=0,a=e.length;l<a;l++)/audio/i.test(e[l].type)&&(n.push(e[l]),t+=e[l].size);const i=this.options.audioUploadSizeLimit;if(i>0){let l=0;const a=this.context.audio._infoList;for(let r=0,f=a.length;r<f;r++)l+=a[r].size*1;if(t+l>i){this.closeLoading();const r="[SUNEDITOR.audioUpload.fail] Size of uploadable total audios: "+i/1e3+"KB";(typeof this.functions.onAudioUploadError!="function"||this.functions.onAudioUploadError(r,{limitSize:i,currentSize:l,uploadSize:t},this))&&this.functions.noticeOpen(r);return}}const s=this.context.audio;s._uploadFileLength=n.length;const o={isUpdate:this.context.dialog.updateModal,element:s._element};if(typeof this.functions.onAudioUploadBefore=="function"){const l=this.functions.onAudioUploadBefore(n,o,this,(function(a){a&&this._w.Array.isArray(a.result)?this.plugins.audio.register.call(this,o,a):this.plugins.audio.upload.call(this,o,a)}).bind(this));if(typeof l>"u")return;if(!l){this.closeLoading();return}typeof l=="object"&&l.length>0&&(n=l)}this.plugins.audio.upload.call(this,o,n)},error:function(e,t){if(this.closeLoading(),typeof this.functions.onAudioUploadError!="function"||this.functions.onAudioUploadError(e,t,this))throw this.functions.noticeOpen(e),Error("[SUNEDITOR.plugin.audio.exception] response: "+e)},upload:function(e,t){if(!t){this.closeLoading();return}if(typeof t=="string"){this.plugins.audio.error.call(this,t,null);return}const n=this.options.audioUploadUrl,i=this.context.dialog.updateModal?1:t.length,s=new FormData;for(let o=0;o<i;o++)s.append("file-"+o,t[o]);this.plugins.fileManager.upload.call(this,n,this.options.audioUploadHeader,s,this.plugins.audio.callBack_upload.bind(this,e),this.functions.onAudioUploadError)},callBack_upload:function(e,t){if(typeof this.functions.audioUploadHandler=="function")this.functions.audioUploadHandler(t,e,this);else{const n=JSON.parse(t.responseText);n.errorMessage?this.plugins.audio.error.call(this,n.errorMessage,n):this.plugins.audio.register.call(this,e,n)}},register:function(e,t){const n=t.result;for(let i=0,s=n.length,o,l;i<s;i++)e.isUpdate?l=e.element:l=this.plugins.audio._createAudioTag.call(this),o={name:n[i].name,size:n[i].size},this.plugins.audio.create_audio.call(this,l,n[i].url,o,e.isUpdate);this.closeLoading()},setupUrl:function(e){try{if(e.length===0)return!1;this.plugins.audio.create_audio.call(this,this.plugins.audio._createAudioTag.call(this),e,null,this.context.dialog.updateModal)}catch(t){throw Error('[SUNEDITOR.audio.audio.fail] cause : "'+t.message+'"')}finally{this.closeLoading()}},create_audio:function(e,t,n,i){const s=this.context.audio;if(i)if(s._element&&(e=s._element),e&&e.src!==t)e.src=t,this.selectComponent(e,"audio");else{this.selectComponent(e,"audio");return}else{e.src=t;const o=this.plugins.component.set_cover.call(this,e),l=this.plugins.component.set_container.call(this,o,"");if(!this.insertComponent(l,!1,!0,!this.options.mediaAutoSelect)){this.focus();return}if(!this.options.mediaAutoSelect){const a=this.appendFormatTag(l,null);a&&this.setRange(a,0,a,0)}}this.plugins.fileManager.setInfo.call(this,"audio",e,this.functions.onAudioUpload,n,!1),i&&this.history.push(!1)},updateCover:function(e){const t=this.context.audio;this.plugins.audio._setTagAttrs.call(this,e);const n=e.parentNode;let i=this.util.isRangeFormatElement(n)||this.util.isWysiwygDiv(n)?e:n||e;const s=e;t._element=e=e.cloneNode(!1);const o=this.plugins.component.set_cover.call(this,e),l=this.plugins.component.set_container.call(this,o,"se-audio-container");try{if(this.util.getParentElement(s,this.util.isNotCheckingNode))s.parentNode.replaceChild(l,s);else if(this.util.isListCell(i)){const a=this.util.getParentElement(s,function(r){return r.parentNode===i});i.insertBefore(l,a),this.util.removeItem(s),this.util.removeEmptyNode(a,null,!0)}else if(this.util.isFormatElement(i)){const a=this.util.getParentElement(s,function(r){return r.parentNode===i});i=this.util.splitElement(i,a),i.parentNode.insertBefore(l,i),this.util.removeItem(s),this.util.removeEmptyNode(i,null,!0),i.children.length===0&&(i.innerHTML=this.util.htmlRemoveWhiteSpace(i.innerHTML))}else i.parentNode.replaceChild(l,i)}catch(a){console.warn("[SUNEDITOR.audio.error] Maybe the audio tag is nested.",a)}this.plugins.fileManager.setInfo.call(this,"audio",e,this.functions.onAudioUpload,null,!1),this.plugins.audio.init.call(this)},onModifyMode:function(e){const t=this.context.audio;this.setControllerPosition(t.controller,e,"bottom",{left:0,top:0}),this.controllersOn(t.controller,e,this.plugins.audio.onControllerOff.bind(this,e),"audio"),this.util.addClass(e,"active"),t._element=e,t._cover=this.util.getParentElement(e,"FIGURE"),t._container=this.util.getParentElement(e,this.util.isComponent)},openModify:function(e){if(this.context.audio.audioUrlFile){const t=this.context.audio;t._linkValue=t.preview.textContent=t.audioUrlFile.value=t._element.src}e||this.plugins.dialog.open.call(this,"audio",!0)},onClick_controller:function(e){e.stopPropagation();const t=e.target.getAttribute("data-command");t&&(e.preventDefault(),/update/.test(t)?this.plugins.audio.openModify.call(this,!1):this.plugins.audio.destroy.call(this,this.context.audio._element),this.controllersOff())},onControllerOff:function(e){this.util.removeClass(e,"active"),this.context.audio.controller.style.display="none"},init:function(){if(this.context.dialog.updateModal)return;const e=this.context.audio;e.audioInputFile&&(e.audioInputFile.value=""),e.audioUrlFile&&(e._linkValue=e.preview.textContent=e.audioUrlFile.value=""),e.audioInputFile&&e.audioUrlFile&&(e.audioUrlFile.removeAttribute("disabled"),e.preview.style.textDecoration=""),e._element=null}},Ba="https://katex.org/docs/supported.html",JC={name:"math",display:"dialog",add:function(e){e.addModule([Fi]);const t=e.context;t.math={focusElement:null,previewElement:null,fontSizeElement:null,defaultFontSize:"",_mathExp:null};let n=this.setDialog(e);t.math.modal=n,t.math.focusElement=n.querySelector(".se-math-exp"),t.math.previewElement=n.querySelector(".se-math-preview"),t.math.fontSizeElement=n.querySelector(".se-math-size"),t.math.focusElement.addEventListener("paste",function(s){typeof e.functions.onPasteMath=="function"&&e.functions.onPasteMath(s,e)},!1),t.math.focusElement.addEventListener(e.util.isIE?"textinput":"input",this._renderMathExp.bind(e,t.math),!1),t.math.fontSizeElement.addEventListener("change",(function(s){this.fontSize=s.target.value}).bind(t.math.previewElement.style),!1);let i=this.setController_MathButton(e);t.math.mathController=i,t.math._mathExp=null,n.querySelector("form").addEventListener("submit",this.submit.bind(e),!1),i.addEventListener("click",this.onClick_mathController.bind(e)),t.math.previewElement.style.fontSize=t.math.defaultFontSize,t.dialog.modal.appendChild(n),t.element.relative.appendChild(i),n=null,i=null},setDialog:function(e){const t=e.lang,n=e.util.createElement("DIV"),i=e.options.mathFontSize;let s=i[0].value;n.className="se-dialog-content",n.style.display="none";let o='<form><div class="se-dialog-header"><button type="button" data-command="close" class="se-btn se-dialog-close" title="'+t.dialogBox.close+'" aria-label="'+t.dialogBox.close+'">'+e.icons.cancel+'</button><span class="se-modal-title">'+t.dialogBox.mathBox.title+'</span></div><div class="se-dialog-body"><div class="se-dialog-form"><label>'+t.dialogBox.mathBox.inputLabel+' (<a href="'+Ba+'" target="_blank">KaTeX</a>)</label><textarea class="se-input-form se-math-exp" type="text"></textarea></div><div class="se-dialog-form"><label>'+t.dialogBox.mathBox.fontSizeLabel+'</label><select class="se-input-select se-math-size">';for(let l=0,a=i.length,r;l<a;l++)r=i[l],r.default&&(s=r.value),o+='<option value="'+r.value+'"'+(r.default?" selected":"")+">"+r.text+"</option>";return o+='</select></div><div class="se-dialog-form"><label>'+t.dialogBox.mathBox.previewLabel+'</label><p class="se-math-preview"></p></div></div><div class="se-dialog-footer"><button type="submit" class="se-btn-primary" title="'+t.dialogBox.submitButton+'" aria-label="'+t.dialogBox.submitButton+'"><span>'+t.dialogBox.submitButton+"</span></button></div></form>",e.context.math.defaultFontSize=s,n.innerHTML=o,n},setController_MathButton:function(e){const t=e.lang,n=e.util.createElement("DIV");return n.className="se-controller se-controller-link",n.innerHTML='<div class="se-arrow se-arrow-up"></div><div class="link-content"><div class="se-btn-group"><button type="button" data-command="update" tabindex="-1" class="se-btn se-tooltip">'+e.icons.edit+'<span class="se-tooltip-inner"><span class="se-tooltip-text">'+t.controller.edit+'</span></span></button><button type="button" data-command="delete" tabindex="-1" class="se-btn se-tooltip">'+e.icons.delete+'<span class="se-tooltip-inner"><span class="se-tooltip-text">'+t.controller.remove+"</span></span></button></div></div>",n},open:function(){this.plugins.dialog.open.call(this,"math",this.currentControllerName==="math")},managedTags:function(){return{className:"katex",method:function(e){if(!e.getAttribute("data-exp")||!this.options.katex)return;const t=this._d.createRange().createContextualFragment(this.plugins.math._renderer.call(this,this.util.HTMLDecoder(e.getAttribute("data-exp"))));e.innerHTML=t.querySelector(".katex").innerHTML,e.setAttribute("contenteditable",!1)}}},_renderer:function(e){let t="";try{this.util.removeClass(this.context.math.focusElement,"se-error"),t=this.options.katex.src.renderToString(e,{throwOnError:!0,displayMode:!0})}catch(n){this.util.addClass(this.context.math.focusElement,"se-error"),t='<span class="se-math-katex-error">Katex syntax error. (Refer <a href="'+Ba+'" target="_blank">KaTeX</a>)</span>',console.warn("[SUNEDITOR.math.Katex.error] ",n)}return t},_renderMathExp:function(e,t){e.previewElement.innerHTML=this.plugins.math._renderer.call(this,t.target.value)},submit:function(e){this.showLoading(),e.preventDefault(),e.stopPropagation();const t=(function(){if(this.context.math.focusElement.value.trim().length===0)return!1;const n=this.context.math,i=n.focusElement.value,s=n.previewElement.querySelector(".katex");if(!s)return!1;if(s.className="__se__katex "+s.className,s.setAttribute("contenteditable",!1),s.setAttribute("data-exp",this.util.HTMLEncoder(i)),s.setAttribute("data-font-size",n.fontSizeElement.value),s.style.fontSize=n.fontSizeElement.value,this.context.dialog.updateModal){const o=this.util.getParentElement(n._mathExp,".katex");o.parentNode.replaceChild(s,o),this.setRange(s,0,s,1)}else{const o=this.getSelectedElements();if(o.length>1){const a=this.util.createElement(o[0].nodeName);if(a.appendChild(s),!this.insertNode(a,null,!0))return!1}else if(!this.insertNode(s,null,!0))return!1;const l=this.util.createTextNode(this.util.zeroWidthSpace);s.parentNode.insertBefore(l,s.nextSibling),this.setRange(s,0,s,1)}return n.focusElement.value="",n.fontSizeElement.value="1em",n.previewElement.style.fontSize="1em",n.previewElement.innerHTML="",!0}).bind(this);try{t()&&(this.plugins.dialog.close.call(this),this.history.push(!1))}catch{this.plugins.dialog.close.call(this)}finally{this.closeLoading()}return!1},active:function(e){if(!e)this.controllerArray.indexOf(this.context.math.mathController)>-1&&this.controllersOff();else if(e.getAttribute("data-exp"))return this.controllerArray.indexOf(this.context.math.mathController)<0&&(this.setRange(e,0,e,1),this.plugins.math.call_controller.call(this,e)),!0;return!1},on:function(e){if(!e)this.plugins.math.init.call(this);else{const t=this.context.math;if(t._mathExp){const n=this.util.HTMLDecoder(t._mathExp.getAttribute("data-exp")),i=t._mathExp.getAttribute("data-font-size")||"1em";this.context.dialog.updateModal=!0,t.focusElement.value=n,t.fontSizeElement.value=i,t.previewElement.innerHTML=this.plugins.math._renderer.call(this,n),t.previewElement.style.fontSize=i}}},call_controller:function(e){this.context.math._mathExp=e;const t=this.context.math.mathController;this.setControllerPosition(t,e,"bottom",{left:0,top:0}),this.controllersOn(t,e,"math")},onClick_mathController:function(e){e.stopPropagation();const t=e.target.getAttribute("data-command")||e.target.parentNode.getAttribute("data-command");t&&(e.preventDefault(),/update/.test(t)?(this.context.math.focusElement.value=this.util.HTMLDecoder(this.context.math._mathExp.getAttribute("data-exp")),this.plugins.dialog.open.call(this,"math",!0)):(this.util.removeItem(this.context.math._mathExp),this.context.math._mathExp=null,this.focus(),this.history.push(!1)),this.controllersOff())},init:function(){const e=this.context.math;e.mathController.style.display="none",e._mathExp=null,e.focusElement.value="",e.previewElement.innerHTML=""}};var ph={exports:{}};(function(e){(function(t,n){e.exports=t.document?n(t,!0):function(i){if(!i.document)throw new Error("SUNEDITOR_MODULES a window with a document");return n(i)}})(typeof window<"u"?window:Yn,function(t,n){const i={name:"fileBrowser",_xmlHttp:null,_loading:null,add:function(s){const o=s.context;o.fileBrowser={_closeSignal:!1,area:null,header:null,tagArea:null,body:null,list:null,tagElements:null,items:[],selectedTags:[],selectorHandler:null,contextPlugin:"",columnSize:4};let l=s.util.createElement("DIV");l.className="se-file-browser sun-editor-common";let a=s.util.createElement("DIV");a.className="se-file-browser-back";let r=s.util.createElement("DIV");r.className="se-file-browser-inner",r.innerHTML=this.set_browser(s),l.appendChild(a),l.appendChild(r),this._loading=l.querySelector(".se-loading-box"),o.fileBrowser.area=l,o.fileBrowser.header=r.querySelector(".se-file-browser-header"),o.fileBrowser.titleArea=r.querySelector(".se-file-browser-title"),o.fileBrowser.tagArea=r.querySelector(".se-file-browser-tags"),o.fileBrowser.body=r.querySelector(".se-file-browser-body"),o.fileBrowser.list=r.querySelector(".se-file-browser-list"),o.fileBrowser.tagArea.addEventListener("click",this.onClickTag.bind(s)),o.fileBrowser.list.addEventListener("click",this.onClickFile.bind(s)),r.addEventListener("mousedown",this._onMouseDown_browser.bind(s)),r.addEventListener("click",this._onClick_browser.bind(s)),o.element.relative.appendChild(l),l=null,a=null,r=null},set_browser:function(s){const o=s.lang;return'<div class="se-file-browser-content"><div class="se-file-browser-header"><button type="button" data-command="close" class="se-btn se-file-browser-close" class="close" title="'+o.dialogBox.close+'" aria-label="'+o.dialogBox.close+'">'+s.icons.cancel+'</button><span class="se-file-browser-title"></span><div class="se-file-browser-tags"></div></div><div class="se-file-browser-body"><div class="se-loading-box sun-editor-common"><div class="se-loading-effect"></div></div><div class="se-file-browser-list"></div></div></div>'},_onMouseDown_browser:function(s){/se-file-browser-inner/.test(s.target.className)?this.context.fileBrowser._closeSignal=!0:this.context.fileBrowser._closeSignal=!1},_onClick_browser:function(s){s.stopPropagation(),(/close/.test(s.target.getAttribute("data-command"))||this.context.fileBrowser._closeSignal)&&this.plugins.fileBrowser.close.call(this)},open:function(s,o){this.plugins.fileBrowser._bindClose&&(this._d.removeEventListener("keydown",this.plugins.fileBrowser._bindClose),this.plugins.fileBrowser._bindClose=null),this.plugins.fileBrowser._bindClose=(function(f){/27/.test(f.keyCode)&&this.plugins.fileBrowser.close.call(this)}).bind(this),this._d.addEventListener("keydown",this.plugins.fileBrowser._bindClose);const l=this.context.fileBrowser;l.contextPlugin=s,l.selectorHandler=o;const a=this.context[s],r=a.listClass;this.util.hasClass(l.list,r)||(l.list.className="se-file-browser-list "+r),this.options.popupDisplay==="full"?l.area.style.position="fixed":l.area.style.position="absolute",l.titleArea.textContent=a.title,l.area.style.display="block",this.context[s].directData?this.plugins.fileBrowser._drawListItem.call(this,this.context[s].directData,!0):this.plugins.fileBrowser._drawFileList.call(this,this.context[s].url,this.context[s].header)},_bindClose:null,close:function(){const s=this.plugins.fileBrowser;s._xmlHttp&&s._xmlHttp.abort(),s._bindClose&&(this._d.removeEventListener("keydown",s._bindClose),s._bindClose=null);const o=this.context.fileBrowser;o.area.style.display="none",o.selectorHandler=null,o.selectedTags=[],o.items=[],o.list.innerHTML=o.tagArea.innerHTML=o.titleArea.textContent="",typeof this.plugins[o.contextPlugin].init=="function"&&this.plugins[o.contextPlugin].init.call(this),o.contextPlugin=""},showBrowserLoading:function(){this._loading.style.display="block"},closeBrowserLoading:function(){this._loading.style.display="none"},_drawFileList:function(s,o){const l=this.plugins.fileBrowser,a=l._xmlHttp=this.util.getXMLHttpRequest();if(a.onreadystatechange=l._callBackGet.bind(this,a),a.open("get",s,!0),o!==null&&typeof o=="object"&&this._w.Object.keys(o).length>0)for(let r in o)a.setRequestHeader(r,o[r]);a.send(null),this.plugins.fileBrowser.showBrowserLoading()},_callBackGet:function(s){if(s.readyState===4){if(this.plugins.fileBrowser._xmlHttp=null,s.status===200)try{const o=JSON.parse(s.responseText);o.result.length>0?this.plugins.fileBrowser._drawListItem.call(this,o.result,!0):o.nullMessage&&(this.context.fileBrowser.list.innerHTML=o.nullMessage)}catch(o){throw Error('[SUNEDITOR.fileBrowser.drawList.fail] cause : "'+o.message+'"')}finally{this.plugins.fileBrowser.closeBrowserLoading(),this.context.fileBrowser.body.style.maxHeight=this._w.innerHeight-this.context.fileBrowser.header.offsetHeight-50+"px"}else if(this.plugins.fileBrowser.closeBrowserLoading(),s.status!==0){const o=s.responseText?JSON.parse(s.responseText):s,l="[SUNEDITOR.fileBrowser.get.serverException] status: "+s.status+", response: "+(o.errorMessage||s.responseText);throw Error(l)}}},_drawListItem:function(s,o){const l=this.context.fileBrowser,a=this.context[l.contextPlugin],r=[],f=s.length,d=a.columnSize||l.columnSize,h=d<=1?1:Math.round(f/d)||1,b=a.itemTemplateHandler;let _="",C='<div class="se-file-item-column">',S=1;for(let c=0,u,p;c<f;c++)if(u=s[c],p=u.tag?typeof u.tag=="string"?u.tag.split(","):u.tag:[],p=u.tag=p.map(function(v){return v.trim()}),C+=b(u),(c+1)%h===0&&S<d&&c+1<f&&(S++,C+='</div><div class="se-file-item-column">'),o&&p.length>0)for(let v=0,y=p.length,w;v<y;v++)w=p[v],w&&r.indexOf(w)===-1&&(r.push(w),_+='<a title="'+w+'" aria-label="'+w+'">'+w+"</a>");C+="</div>",l.list.innerHTML=C,o&&(l.items=s,l.tagArea.innerHTML=_,l.tagElements=l.tagArea.querySelectorAll("A"))},onClickTag:function(s){const o=s.target;if(!this.util.isAnchor(o))return;const l=o.textContent,a=this.plugins.fileBrowser,r=this.context.fileBrowser,f=r.tagArea.querySelector('a[title="'+l+'"]'),d=r.selectedTags,h=d.indexOf(l);h>-1?(d.splice(h,1),this.util.removeClass(f,"on")):(d.push(l),this.util.addClass(f,"on")),a._drawListItem.call(this,d.length===0?r.items:r.items.filter(function(b){return b.tag.some(function(_){return d.indexOf(_)>-1})}),!1)},onClickFile:function(s){s.preventDefault(),s.stopPropagation();const o=this.context.fileBrowser,l=o.list;let a=s.target,r=null;if(a===l)return;for(;l!==a.parentNode&&(r=a.getAttribute("data-command"),!r);)a=a.parentNode;if(!r)return;(o.selectorHandler||this.context[o.contextPlugin].selectorHandler)(a,a.parentNode.querySelector(".__se__img_name").textContent),this.plugins.fileBrowser.close.call(this)}};return typeof n>"u"&&(t.SUNEDITOR_MODULES||Object.defineProperty(t,"SUNEDITOR_MODULES",{enumerable:!0,writable:!1,configurable:!1,value:{}}),Object.defineProperty(t.SUNEDITOR_MODULES,"fileBrowser",{enumerable:!0,writable:!1,configurable:!1,value:i})),i})})(ph);var eS=ph.exports;const tS=Zn(eS),nS={name:"imageGallery",add:function(e){e.addModule([tS]);const t=e.context;t.imageGallery={title:e.lang.toolbar.imageGallery,directData:e.options.imageGalleryData,url:e.options.imageGalleryUrl,header:e.options.imageGalleryHeader,listClass:"se-image-list",itemTemplateHandler:this.drawItems,selectorHandler:this.setImage.bind(e),columnSize:4}},open:function(e){this.plugins.fileBrowser.open.call(this,"imageGallery",e)},drawItems:function(e){const t=e.src.split("/").pop();return'<div class="se-file-item-img"><img src="'+(e.thumbnail||e.src)+'" alt="'+(e.alt||t)+'" data-command="pick" data-value="'+(e.src||e.thumbnail)+'"><div class="se-file-img-name se-file-name-back"></div><div class="se-file-img-name __se__img_name">'+(e.name||t)+"</div></div>"},setImage:function(e,t){this.callPlugin("image",(function(){const n={name:t,size:0};this.plugins.image.create_image.call(this,e.getAttribute("data-value"),null,this.context.image._origin_w,this.context.image._origin_h,"none",n,e.alt)}).bind(this),null)}},iS={blockquote:AC,align:RC,font:DC,fontSize:LC,fontColor:OC,hiliteColor:PC,horizontalRule:IC,list:BC,table:FC,formatBlock:jC,lineHeight:zC,template:HC,paragraphStyle:VC,textStyle:WC,link:YC,image:KC,video:XC,audio:QC,math:JC,imageGallery:nS},Jo=m.forwardRef(({value:e="",onChange:t,placeholder:n="Start writing...",height:i="200px",className:s,...o},l)=>{const a=m.useRef(null),[r,f]=m.useState(null);return m.useEffect(()=>{if(a.current&&!r){const d=MC.create(a.current,{plugins:iS,buttonList:[["undo","redo"],["font","fontSize","formatBlock"],["paragraphStyle","blockquote"],["bold","underline","italic","strike","subscript","superscript"],["fontColor","hiliteColor","textStyle"],["removeFormat"],["outdent","indent"],["align","horizontalRule","list","lineHeight"],["table","link","image","video","audio"],["fullScreen","showBlocks","codeView"],["preview","print"],["save","template"]],defaultTag:"div",minHeight:i,showPathLabel:!1,placeholder:n,resizingBar:!1,charCounter:!0,maxCharCount:1e4,width:"100%",height:"auto",mode:"classic",katex:"window.katex",imageGalleryUrl:"/editor/image-gallery",videoFileInput:!1,audioFileInput:!1,tabDisable:!1,linkProtocol:"",linkRelDefault:{default:"nofollow",check_new_window:"nofollow noopener",check_bookmark:""},iframe:!1,stickyToolbar:!1,popupDisplay:"local",display:"block",position:null,font:["Arial","Comic Sans MS","Courier New","Impact","Georgia","tahoma","Trebuchet MS","Verdana"],fontSize:[8,9,10,11,12,14,16,18,20,22,24,26,28,36,48,72],formats:["p","div","blockquote","pre","h1","h2","h3","h4","h5","h6"],colorList:["#ff0000","#ff5e00","#ffbb00","#ffe400","#abf200","#00d8ff","#0055ff","#0900ff","#6600ff","#ff00dd","#ff007f","#000000","#2d3436","#636e72","#b2bec3","#ffffff","#ffeaa7","#fab1a0","#e17055","#d63031","#fd79a8","#e84393","#6c5ce7","#a29bfe","#fdcb6e","#e17055","#00b894","#00cec9","#55a3ff","#74b9ff","#a29bfe","#ffeaa7","#fab1a0"],lineHeights:[{text:"1",value:1},{text:"1.15",value:1.15},{text:"1.5",value:1.5},{text:"2",value:2}],paragraphStyles:["spaced","neon",{name:"Custom",class:"__se__customClass"}],textStyles:["translucent",{name:"Shadow",style:"text-shadow: 2px 2px 2px #000;"}],imageSizeOnlyPercentage:!1,imageWidth:"100%",imageHeight:"auto",imageSize:"auto",imageUploadSizeLimit:5242880,imageUploadUrl:null,imageUploadHeader:{},imageUrlInput:!0,imageMultipleFile:!1,imageAccept:".jpg,.jpeg,.png,.gif,.svg,.webp",videoWidth:"100%",videoHeight:"auto",videoSize:"auto",videoUploadSizeLimit:10485760,videoUploadUrl:null,videoUploadHeader:{},videoUrlInput:!0,videoMultipleFile:!1,videoAccept:".mp4,.avi,.wmv,.flv,.mov,.webm,.m4v",audioWidth:"100%",audioHeight:"auto",audioSize:"auto",audioUploadSizeLimit:10485760,audioUploadUrl:null,audioUploadHeader:{},audioUrlInput:!0,audioMultipleFile:!1,audioAccept:".mp3,.wav,.ogg,.flac,.aac,.wma",tableCellControllerPosition:"cell",tableResizing:!0,tableUseBackgroundColor:!0,tableBackgroundColor:"#fff",codeMirror:null,codeMirror_src:null,codeMirror_options:null,fullScreenOffset:0,previewTemplate:null,printTemplate:null,iframeAttributes:{},iframeStyles:{},attributesWhitelist:{},tagsBlacklist:"",pasteTagsWhitelist:"",pasteAttributesWhitelist:"",pasteKeepOnlyTags:"",pasteDenyTags:"",pasteTagsBlacklist:"",pasteKeepOnlyAttributes:"",pasteDenyAttributes:"",pasteTagsRemove:"",pasteAttributesRemove:"",...o});d.onChange=h=>{t==null||t(h)},f(d)}return()=>{r&&(r.destroy(),f(null))}},[t,i,n,o]),m.useEffect(()=>{r&&e!==r.getContents()&&r.setContents(e)},[r,e]),m.useImperativeHandle(l,()=>({getContents:()=>r==null?void 0:r.getContents(),setContents:d=>r==null?void 0:r.setContents(d),insertHTML:d=>r==null?void 0:r.insertHTML(d),focus:()=>r==null?void 0:r.core.focus(),blur:()=>r==null?void 0:r.core.blur()}),[r]),g.jsx("div",{className:ne("sun-editor-wrapper",s),children:g.jsx("div",{ref:a})})});Jo.displayName="RichTextEditor";function sS(e,t=[]){let n=[];function i(o,l){const a=m.createContext(l),r=n.length;n=[...n,l];const f=h=>{var u;const{scope:b,children:_,...C}=h,S=((u=b==null?void 0:b[e])==null?void 0:u[r])||a,c=m.useMemo(()=>C,Object.values(C));return g.jsx(S.Provider,{value:c,children:_})};f.displayName=o+"Provider";function d(h,b){var S;const _=((S=b==null?void 0:b[e])==null?void 0:S[r])||a,C=m.useContext(_);if(C)return C;if(l!==void 0)return l;throw new Error(`\`${h}\` must be used within \`${o}\``)}return[f,d]}const s=()=>{const o=n.map(l=>m.createContext(l));return function(a){const r=(a==null?void 0:a[e])||o;return m.useMemo(()=>({[`__scope${e}`]:{...a,[e]:r}}),[a,r])}};return s.scopeName=e,[i,rS(s,...t)]}function rS(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const i=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const l=i.reduce((a,{useScope:r,scopeName:f})=>{const h=r(o)[`__scope${f}`];return{...a,...h}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}function oS(e){const t=lS(e),n=m.forwardRef((i,s)=>{const{children:o,...l}=i,a=m.Children.toArray(o),r=a.find(cS);if(r){const f=r.props.children,d=a.map(h=>h===r?m.Children.count(f)>1?m.Children.only(null):m.isValidElement(f)?f.props.children:null:h);return g.jsx(t,{...l,ref:s,children:m.isValidElement(f)?m.cloneElement(f,void 0,d):null})}return g.jsx(t,{...l,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}function lS(e){const t=m.forwardRef((n,i)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const l=dS(s),a=uS(o,s.props);return s.type!==m.Fragment&&(a.ref=i?je(i,l):l),m.cloneElement(s,a)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var aS=Symbol("radix.slottable");function cS(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===aS}function uS(e,t){const n={...t};for(const i in t){const s=e[i],o=t[i];/^on[A-Z]/.test(i)?s&&o?n[i]=(...a)=>{const r=o(...a);return s(...a),r}:s&&(n[i]=s):i==="style"?n[i]={...s,...o}:i==="className"&&(n[i]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function dS(e){var i,s;let t=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var fS=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],hS=fS.reduce((e,t)=>{const n=oS(`Primitive.${t}`),i=m.forwardRef((s,o)=>{const{asChild:l,...a}=s,r=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(r,{...a,ref:o})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{});function pS(e,t=[]){let n=[];function i(o,l){const a=m.createContext(l),r=n.length;n=[...n,l];const f=h=>{var u;const{scope:b,children:_,...C}=h,S=((u=b==null?void 0:b[e])==null?void 0:u[r])||a,c=m.useMemo(()=>C,Object.values(C));return g.jsx(S.Provider,{value:c,children:_})};f.displayName=o+"Provider";function d(h,b){var S;const _=((S=b==null?void 0:b[e])==null?void 0:S[r])||a,C=m.useContext(_);if(C)return C;if(l!==void 0)return l;throw new Error(`\`${h}\` must be used within \`${o}\``)}return[f,d]}const s=()=>{const o=n.map(l=>m.createContext(l));return function(a){const r=(a==null?void 0:a[e])||o;return m.useMemo(()=>({[`__scope${e}`]:{...a,[e]:r}}),[a,r])}};return s.scopeName=e,[i,mS(s,...t)]}function mS(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const i=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const l=i.reduce((a,{useScope:r,scopeName:f})=>{const h=r(o)[`__scope${f}`];return{...a,...h}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}function mh(e){const t=gS(e),n=m.forwardRef((i,s)=>{const{children:o,...l}=i,a=m.Children.toArray(o),r=a.find(bS);if(r){const f=r.props.children,d=a.map(h=>h===r?m.Children.count(f)>1?m.Children.only(null):m.isValidElement(f)?f.props.children:null:h);return g.jsx(t,{...l,ref:s,children:m.isValidElement(f)?m.cloneElement(f,void 0,d):null})}return g.jsx(t,{...l,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}function gS(e){const t=m.forwardRef((n,i)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const l=xS(s),a=yS(o,s.props);return s.type!==m.Fragment&&(a.ref=i?je(i,l):l),m.cloneElement(s,a)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var vS=Symbol("radix.slottable");function bS(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===vS}function yS(e,t){const n={...t};for(const i in t){const s=e[i],o=t[i];/^on[A-Z]/.test(i)?s&&o?n[i]=(...a)=>{const r=o(...a);return s(...a),r}:s&&(n[i]=s):i==="style"?n[i]={...s,...o}:i==="className"&&(n[i]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function xS(e){var i,s;let t=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var wS=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ji=wS.reduce((e,t)=>{const n=mh(`Primitive.${t}`),i=m.forwardRef((s,o)=>{const{asChild:l,...a}=s,r=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(r,{...a,ref:o})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{});function _S(e,t){e&&wi.flushSync(()=>e.dispatchEvent(t))}var Gr=["Enter"," "],CS=["ArrowDown","PageUp","Home"],gh=["ArrowUp","PageDown","End"],SS=[...CS,...gh],ES={ltr:[...Gr,"ArrowRight"],rtl:[...Gr,"ArrowLeft"]},NS={ltr:["ArrowLeft"],rtl:["ArrowRight"]},zi="Menu",[gi,kS,TS]=co(zi),[mn,vh]=pS(zi,[TS,en,js]),Hi=en(),bh=js(),[yh,rn]=mn(zi),[MS,Vi]=mn(zi),xh=e=>{const{__scopeMenu:t,open:n=!1,children:i,dir:s,onOpenChange:o,modal:l=!0}=e,a=Hi(t),[r,f]=m.useState(null),d=m.useRef(!1),h=Ze(o),b=Ei(s);return m.useEffect(()=>{const _=()=>{d.current=!0,document.addEventListener("pointerdown",C,{capture:!0,once:!0}),document.addEventListener("pointermove",C,{capture:!0,once:!0})},C=()=>d.current=!1;return document.addEventListener("keydown",_,{capture:!0}),()=>{document.removeEventListener("keydown",_,{capture:!0}),document.removeEventListener("pointerdown",C,{capture:!0}),document.removeEventListener("pointermove",C,{capture:!0})}},[]),g.jsx(Ti,{...a,children:g.jsx(yh,{scope:t,open:n,onOpenChange:h,content:r,onContentChange:f,children:g.jsx(MS,{scope:t,onClose:m.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:d,dir:b,modal:l,children:i})})})};xh.displayName=zi;var AS="MenuAnchor",el=m.forwardRef((e,t)=>{const{__scopeMenu:n,...i}=e,s=Hi(n);return g.jsx(Mi,{...s,...i,ref:t})});el.displayName=AS;var tl="MenuPortal",[RS,wh]=mn(tl,{forceMount:void 0}),_h=e=>{const{__scopeMenu:t,forceMount:n,children:i,container:s}=e,o=rn(tl,t);return g.jsx(RS,{scope:t,forceMount:n,children:g.jsx(Ke,{present:n||o.open,children:g.jsx(Ai,{asChild:!0,container:s,children:i})})})};_h.displayName=tl;var pt="MenuContent",[DS,nl]=mn(pt),Ch=m.forwardRef((e,t)=>{const n=wh(pt,e.__scopeMenu),{forceMount:i=n.forceMount,...s}=e,o=rn(pt,e.__scopeMenu),l=Vi(pt,e.__scopeMenu);return g.jsx(gi.Provider,{scope:e.__scopeMenu,children:g.jsx(Ke,{present:i||o.open,children:g.jsx(gi.Slot,{scope:e.__scopeMenu,children:l.modal?g.jsx(LS,{...s,ref:t}):g.jsx(OS,{...s,ref:t})})})})}),LS=m.forwardRef((e,t)=>{const n=rn(pt,e.__scopeMenu),i=m.useRef(null),s=ye(t,i);return m.useEffect(()=>{const o=i.current;if(o)return Ms(o)},[]),g.jsx(il,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:oe(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),OS=m.forwardRef((e,t)=>{const n=rn(pt,e.__scopeMenu);return g.jsx(il,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),PS=mh("MenuContent.ScrollLock"),il=m.forwardRef((e,t)=>{const{__scopeMenu:n,loop:i=!1,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:l,disableOutsidePointerEvents:a,onEntryFocus:r,onEscapeKeyDown:f,onPointerDownOutside:d,onFocusOutside:h,onInteractOutside:b,onDismiss:_,disableOutsideScroll:C,...S}=e,c=rn(pt,n),u=Vi(pt,n),p=Hi(n),v=bh(n),y=kS(n),[w,x]=m.useState(null),E=m.useRef(null),k=ye(t,E,c.onContentChange),N=m.useRef(0),T=m.useRef(""),R=m.useRef(0),M=m.useRef(null),A=m.useRef("right"),D=m.useRef(0),$=C?Ri:m.Fragment,H=C?{as:PS,allowPinchZoom:!0}:void 0,j=z=>{var V,X;const O=T.current+z,B=y().filter(Z=>!Z.disabled),L=document.activeElement,U=(V=B.find(Z=>Z.ref.current===L))==null?void 0:V.textValue,P=B.map(Z=>Z.textValue),W=ZS(P,O,U),Q=(X=B.find(Z=>Z.textValue===W))==null?void 0:X.ref.current;(function Z(G){T.current=G,window.clearTimeout(N.current),G!==""&&(N.current=window.setTimeout(()=>Z(""),1e3))})(O),Q&&setTimeout(()=>Q.focus())};m.useEffect(()=>()=>window.clearTimeout(N.current),[]),_s();const F=m.useCallback(z=>{var B,L;return A.current===((B=M.current)==null?void 0:B.side)&&GS(z,(L=M.current)==null?void 0:L.area)},[]);return g.jsx(DS,{scope:n,searchRef:T,onItemEnter:m.useCallback(z=>{F(z)&&z.preventDefault()},[F]),onItemLeave:m.useCallback(z=>{var O;F(z)||((O=E.current)==null||O.focus(),x(null))},[F]),onTriggerLeave:m.useCallback(z=>{F(z)&&z.preventDefault()},[F]),pointerGraceTimerRef:R,onPointerGraceIntentChange:m.useCallback(z=>{M.current=z},[]),children:g.jsx($,{...H,children:g.jsx(Ni,{asChild:!0,trapped:s,onMountAutoFocus:oe(o,z=>{var O;z.preventDefault(),(O=E.current)==null||O.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:g.jsx(Vn,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:f,onPointerDownOutside:d,onFocusOutside:h,onInteractOutside:b,onDismiss:_,children:g.jsx(Dd,{asChild:!0,...v,dir:u.dir,orientation:"vertical",loop:i,currentTabStopId:w,onCurrentTabStopIdChange:x,onEntryFocus:oe(r,z=>{u.isUsingKeyboardRef.current||z.preventDefault()}),preventScrollOnEntryFocus:!0,children:g.jsx(ks,{role:"menu","aria-orientation":"vertical","data-state":zh(c.open),"data-radix-menu-content":"",dir:u.dir,...p,...S,ref:k,style:{outline:"none",...S.style},onKeyDown:oe(S.onKeyDown,z=>{const B=z.target.closest("[data-radix-menu-content]")===z.currentTarget,L=z.ctrlKey||z.altKey||z.metaKey,U=z.key.length===1;B&&(z.key==="Tab"&&z.preventDefault(),!L&&U&&j(z.key));const P=E.current;if(z.target!==P||!SS.includes(z.key))return;z.preventDefault();const Q=y().filter(V=>!V.disabled).map(V=>V.ref.current);gh.includes(z.key)&&Q.reverse(),US(Q)}),onBlur:oe(e.onBlur,z=>{z.currentTarget.contains(z.target)||(window.clearTimeout(N.current),T.current="")}),onPointerMove:oe(e.onPointerMove,vi(z=>{const O=z.target,B=D.current!==z.clientX;if(z.currentTarget.contains(O)&&B){const L=z.clientX>D.current?"right":"left";A.current=L,D.current=z.clientX}}))})})})})})})});Ch.displayName=pt;var IS="MenuGroup",sl=m.forwardRef((e,t)=>{const{__scopeMenu:n,...i}=e;return g.jsx(ji.div,{role:"group",...i,ref:t})});sl.displayName=IS;var BS="MenuLabel",Sh=m.forwardRef((e,t)=>{const{__scopeMenu:n,...i}=e;return g.jsx(ji.div,{...i,ref:t})});Sh.displayName=BS;var ds="MenuItem",Fa="menu.itemSelect",Ks=m.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:i,...s}=e,o=m.useRef(null),l=Vi(ds,e.__scopeMenu),a=nl(ds,e.__scopeMenu),r=ye(t,o),f=m.useRef(!1),d=()=>{const h=o.current;if(!n&&h){const b=new CustomEvent(Fa,{bubbles:!0,cancelable:!0});h.addEventListener(Fa,_=>i==null?void 0:i(_),{once:!0}),_S(h,b),b.defaultPrevented?f.current=!1:l.onClose()}};return g.jsx(Eh,{...s,ref:r,disabled:n,onClick:oe(e.onClick,d),onPointerDown:h=>{var b;(b=e.onPointerDown)==null||b.call(e,h),f.current=!0},onPointerUp:oe(e.onPointerUp,h=>{var b;f.current||(b=h.currentTarget)==null||b.click()}),onKeyDown:oe(e.onKeyDown,h=>{const b=a.searchRef.current!=="";n||b&&h.key===" "||Gr.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})});Ks.displayName=ds;var Eh=m.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:i=!1,textValue:s,...o}=e,l=nl(ds,n),a=bh(n),r=m.useRef(null),f=ye(t,r),[d,h]=m.useState(!1),[b,_]=m.useState("");return m.useEffect(()=>{const C=r.current;C&&_((C.textContent??"").trim())},[o.children]),g.jsx(gi.ItemSlot,{scope:n,disabled:i,textValue:s??b,children:g.jsx(Ld,{asChild:!0,...a,focusable:!i,children:g.jsx(ji.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":i||void 0,"data-disabled":i?"":void 0,...o,ref:f,onPointerMove:oe(e.onPointerMove,vi(C=>{i?l.onItemLeave(C):(l.onItemEnter(C),C.defaultPrevented||C.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:oe(e.onPointerLeave,vi(C=>l.onItemLeave(C))),onFocus:oe(e.onFocus,()=>h(!0)),onBlur:oe(e.onBlur,()=>h(!1))})})})}),FS="MenuCheckboxItem",Nh=m.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:i,...s}=e;return g.jsx(Rh,{scope:e.__scopeMenu,checked:n,children:g.jsx(Ks,{role:"menuitemcheckbox","aria-checked":fs(n)?"mixed":n,...s,ref:t,"data-state":ll(n),onSelect:oe(s.onSelect,()=>i==null?void 0:i(fs(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Nh.displayName=FS;var kh="MenuRadioGroup",[jS,zS]=mn(kh,{value:void 0,onValueChange:()=>{}}),Th=m.forwardRef((e,t)=>{const{value:n,onValueChange:i,...s}=e,o=Ze(i);return g.jsx(jS,{scope:e.__scopeMenu,value:n,onValueChange:o,children:g.jsx(sl,{...s,ref:t})})});Th.displayName=kh;var Mh="MenuRadioItem",Ah=m.forwardRef((e,t)=>{const{value:n,...i}=e,s=zS(Mh,e.__scopeMenu),o=n===s.value;return g.jsx(Rh,{scope:e.__scopeMenu,checked:o,children:g.jsx(Ks,{role:"menuitemradio","aria-checked":o,...i,ref:t,"data-state":ll(o),onSelect:oe(i.onSelect,()=>{var l;return(l=s.onValueChange)==null?void 0:l.call(s,n)},{checkForDefaultPrevented:!1})})})});Ah.displayName=Mh;var rl="MenuItemIndicator",[Rh,HS]=mn(rl,{checked:!1}),Dh=m.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:i,...s}=e,o=HS(rl,n);return g.jsx(Ke,{present:i||fs(o.checked)||o.checked===!0,children:g.jsx(ji.span,{...s,ref:t,"data-state":ll(o.checked)})})});Dh.displayName=rl;var VS="MenuSeparator",Lh=m.forwardRef((e,t)=>{const{__scopeMenu:n,...i}=e;return g.jsx(ji.div,{role:"separator","aria-orientation":"horizontal",...i,ref:t})});Lh.displayName=VS;var WS="MenuArrow",Oh=m.forwardRef((e,t)=>{const{__scopeMenu:n,...i}=e,s=Hi(n);return g.jsx(Ts,{...s,...i,ref:t})});Oh.displayName=WS;var ol="MenuSub",[$S,Ph]=mn(ol),Ih=e=>{const{__scopeMenu:t,children:n,open:i=!1,onOpenChange:s}=e,o=rn(ol,t),l=Hi(t),[a,r]=m.useState(null),[f,d]=m.useState(null),h=Ze(s);return m.useEffect(()=>(o.open===!1&&h(!1),()=>h(!1)),[o.open,h]),g.jsx(Ti,{...l,children:g.jsx(yh,{scope:t,open:i,onOpenChange:h,content:f,onContentChange:d,children:g.jsx($S,{scope:t,contentId:it(),triggerId:it(),trigger:a,onTriggerChange:r,children:n})})})};Ih.displayName=ol;var oi="MenuSubTrigger",Bh=m.forwardRef((e,t)=>{const n=rn(oi,e.__scopeMenu),i=Vi(oi,e.__scopeMenu),s=Ph(oi,e.__scopeMenu),o=nl(oi,e.__scopeMenu),l=m.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:r}=o,f={__scopeMenu:e.__scopeMenu},d=m.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);return m.useEffect(()=>d,[d]),m.useEffect(()=>{const h=a.current;return()=>{window.clearTimeout(h),r(null)}},[a,r]),g.jsx(el,{asChild:!0,...f,children:g.jsx(Eh,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":zh(n.open),...e,ref:je(t,s.onTriggerChange),onClick:h=>{var b;(b=e.onClick)==null||b.call(e,h),!(e.disabled||h.defaultPrevented)&&(h.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:oe(e.onPointerMove,vi(h=>{o.onItemEnter(h),!h.defaultPrevented&&!e.disabled&&!n.open&&!l.current&&(o.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:oe(e.onPointerLeave,vi(h=>{var _,C;d();const b=(_=n.content)==null?void 0:_.getBoundingClientRect();if(b){const S=(C=n.content)==null?void 0:C.dataset.side,c=S==="right",u=c?-5:5,p=b[c?"left":"right"],v=b[c?"right":"left"];o.onPointerGraceIntentChange({area:[{x:h.clientX+u,y:h.clientY},{x:p,y:b.top},{x:v,y:b.top},{x:v,y:b.bottom},{x:p,y:b.bottom}],side:S}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(h),h.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:oe(e.onKeyDown,h=>{var _;const b=o.searchRef.current!=="";e.disabled||b&&h.key===" "||ES[i.dir].includes(h.key)&&(n.onOpenChange(!0),(_=n.content)==null||_.focus(),h.preventDefault())})})})});Bh.displayName=oi;var Fh="MenuSubContent",jh=m.forwardRef((e,t)=>{const n=wh(pt,e.__scopeMenu),{forceMount:i=n.forceMount,...s}=e,o=rn(pt,e.__scopeMenu),l=Vi(pt,e.__scopeMenu),a=Ph(Fh,e.__scopeMenu),r=m.useRef(null),f=ye(t,r);return g.jsx(gi.Provider,{scope:e.__scopeMenu,children:g.jsx(Ke,{present:i||o.open,children:g.jsx(gi.Slot,{scope:e.__scopeMenu,children:g.jsx(il,{id:a.contentId,"aria-labelledby":a.triggerId,...s,ref:f,align:"start",side:l.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var h;l.isUsingKeyboardRef.current&&((h=r.current)==null||h.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:oe(e.onFocusOutside,d=>{d.target!==a.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:oe(e.onEscapeKeyDown,d=>{l.onClose(),d.preventDefault()}),onKeyDown:oe(e.onKeyDown,d=>{var _;const h=d.currentTarget.contains(d.target),b=NS[l.dir].includes(d.key);h&&b&&(o.onOpenChange(!1),(_=a.trigger)==null||_.focus(),d.preventDefault())})})})})})});jh.displayName=Fh;function zh(e){return e?"open":"closed"}function fs(e){return e==="indeterminate"}function ll(e){return fs(e)?"indeterminate":e?"checked":"unchecked"}function US(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function YS(e,t){return e.map((n,i)=>e[(t+i)%e.length])}function ZS(e,t,n){const s=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let l=YS(e,Math.max(o,0));s.length===1&&(l=l.filter(f=>f!==n));const r=l.find(f=>f.toLowerCase().startsWith(s.toLowerCase()));return r!==n?r:void 0}function qS(e,t){const{x:n,y:i}=e;let s=!1;for(let o=0,l=t.length-1;o<t.length;l=o++){const a=t[o],r=t[l],f=a.x,d=a.y,h=r.x,b=r.y;d>i!=b>i&&n<(h-f)*(i-d)/(b-d)+f&&(s=!s)}return s}function GS(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return qS(n,t)}function vi(e){return t=>t.pointerType==="mouse"?e(t):void 0}var KS=xh,XS=el,QS=_h,JS=Ch,e4=sl,t4=Sh,n4=Ks,i4=Nh,s4=Th,r4=Ah,o4=Dh,l4=Lh,a4=Oh,c4=Ih,u4=Bh,d4=jh,Xs="DropdownMenu",[f4]=sS(Xs,[vh]),et=vh(),[h4,Hh]=f4(Xs),Vh=e=>{const{__scopeDropdownMenu:t,children:n,dir:i,open:s,defaultOpen:o,onOpenChange:l,modal:a=!0}=e,r=et(t),f=m.useRef(null),[d,h]=wt({prop:s,defaultProp:o??!1,onChange:l,caller:Xs});return g.jsx(h4,{scope:t,triggerId:it(),triggerRef:f,contentId:it(),open:d,onOpenChange:h,onOpenToggle:m.useCallback(()=>h(b=>!b),[h]),modal:a,children:g.jsx(KS,{...r,open:d,onOpenChange:h,dir:i,modal:a,children:n})})};Vh.displayName=Xs;var Wh="DropdownMenuTrigger",$h=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:i=!1,...s}=e,o=Hh(Wh,n),l=et(n);return g.jsx(XS,{asChild:!0,...l,children:g.jsx(hS.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":i?"":void 0,disabled:i,...s,ref:je(t,o.triggerRef),onPointerDown:oe(e.onPointerDown,a=>{!i&&a.button===0&&a.ctrlKey===!1&&(o.onOpenToggle(),o.open||a.preventDefault())}),onKeyDown:oe(e.onKeyDown,a=>{i||(["Enter"," "].includes(a.key)&&o.onOpenToggle(),a.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});$h.displayName=Wh;var p4="DropdownMenuPortal",Uh=e=>{const{__scopeDropdownMenu:t,...n}=e,i=et(t);return g.jsx(QS,{...i,...n})};Uh.displayName=p4;var Yh="DropdownMenuContent",Zh=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...i}=e,s=Hh(Yh,n),o=et(n),l=m.useRef(!1);return g.jsx(JS,{id:s.contentId,"aria-labelledby":s.triggerId,...o,...i,ref:t,onCloseAutoFocus:oe(e.onCloseAutoFocus,a=>{var r;l.current||(r=s.triggerRef.current)==null||r.focus(),l.current=!1,a.preventDefault()}),onInteractOutside:oe(e.onInteractOutside,a=>{const r=a.detail.originalEvent,f=r.button===0&&r.ctrlKey===!0,d=r.button===2||f;(!s.modal||d)&&(l.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Zh.displayName=Yh;var m4="DropdownMenuGroup",qh=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...i}=e,s=et(n);return g.jsx(e4,{...s,...i,ref:t})});qh.displayName=m4;var g4="DropdownMenuLabel",Gh=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...i}=e,s=et(n);return g.jsx(t4,{...s,...i,ref:t})});Gh.displayName=g4;var v4="DropdownMenuItem",Kh=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...i}=e,s=et(n);return g.jsx(n4,{...s,...i,ref:t})});Kh.displayName=v4;var b4="DropdownMenuCheckboxItem",Xh=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...i}=e,s=et(n);return g.jsx(i4,{...s,...i,ref:t})});Xh.displayName=b4;var y4="DropdownMenuRadioGroup",Qh=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...i}=e,s=et(n);return g.jsx(s4,{...s,...i,ref:t})});Qh.displayName=y4;var x4="DropdownMenuRadioItem",Jh=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...i}=e,s=et(n);return g.jsx(r4,{...s,...i,ref:t})});Jh.displayName=x4;var w4="DropdownMenuItemIndicator",e0=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...i}=e,s=et(n);return g.jsx(o4,{...s,...i,ref:t})});e0.displayName=w4;var _4="DropdownMenuSeparator",t0=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...i}=e,s=et(n);return g.jsx(l4,{...s,...i,ref:t})});t0.displayName=_4;var C4="DropdownMenuArrow",S4=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...i}=e,s=et(n);return g.jsx(a4,{...s,...i,ref:t})});S4.displayName=C4;var E4=e=>{const{__scopeDropdownMenu:t,children:n,open:i,onOpenChange:s,defaultOpen:o}=e,l=et(t),[a,r]=wt({prop:i,defaultProp:o??!1,onChange:s,caller:"DropdownMenuSub"});return g.jsx(c4,{...l,open:a,onOpenChange:r,children:n})},N4="DropdownMenuSubTrigger",n0=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...i}=e,s=et(n);return g.jsx(u4,{...s,...i,ref:t})});n0.displayName=N4;var k4="DropdownMenuSubContent",i0=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...i}=e,s=et(n);return g.jsx(d4,{...s,...i,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});i0.displayName=k4;var T4=Vh,M4=$h,s0=Uh,r0=Zh,A4=qh,o0=Gh,l0=Kh,a0=Xh,R4=Qh,c0=Jh,u0=e0,d0=t0,D4=E4,f0=n0,h0=i0;const al=T4,cl=M4,L4=A4,O4=s0,P4=D4,I4=R4,p0=m.forwardRef(({className:e,inset:t,children:n,...i},s)=>g.jsxs(f0,{ref:s,className:ne("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...i,children:[n,g.jsx(_i,{className:"ml-auto h-4 w-4"})]}));p0.displayName=f0.displayName;const m0=m.forwardRef(({className:e,...t},n)=>g.jsx(h0,{ref:n,className:ne("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));m0.displayName=h0.displayName;const Qs=m.forwardRef(({className:e,sideOffset:t=4,...n},i)=>g.jsx(s0,{children:g.jsx(r0,{ref:i,sideOffset:t,className:ne("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));Qs.displayName=r0.displayName;const bi=m.forwardRef(({className:e,inset:t,...n},i)=>g.jsx(l0,{ref:i,className:ne("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));bi.displayName=l0.displayName;const g0=m.forwardRef(({className:e,children:t,checked:n,...i},s)=>g.jsxs(a0,{ref:s,className:ne("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...i,children:[g.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:g.jsx(u0,{children:g.jsx(ui,{className:"h-4 w-4"})})}),t]}));g0.displayName=a0.displayName;const v0=m.forwardRef(({className:e,children:t,...n},i)=>g.jsxs(c0,{ref:i,className:ne("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[g.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:g.jsx(u0,{children:g.jsx(ym,{className:"h-2 w-2 fill-current"})})}),t]}));v0.displayName=c0.displayName;const Js=m.forwardRef(({className:e,inset:t,...n},i)=>g.jsx(o0,{ref:i,className:ne("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));Js.displayName=o0.displayName;const yi=m.forwardRef(({className:e,...t},n)=>g.jsx(d0,{ref:n,className:ne("-mx-1 my-1 h-px bg-muted",e),...t}));yi.displayName=d0.displayName;const b0=({className:e,...t})=>g.jsx("span",{className:ne("ml-auto text-xs tracking-widest opacity-60",e),...t});b0.displayName="DropdownMenuShortcut";function B4(e){const t=F4(e),n=m.forwardRef((i,s)=>{const{children:o,...l}=i,a=m.Children.toArray(o),r=a.find(z4);if(r){const f=r.props.children,d=a.map(h=>h===r?m.Children.count(f)>1?m.Children.only(null):m.isValidElement(f)?f.props.children:null:h);return g.jsx(t,{...l,ref:s,children:m.isValidElement(f)?m.cloneElement(f,void 0,d):null})}return g.jsx(t,{...l,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}function F4(e){const t=m.forwardRef((n,i)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const l=V4(s),a=H4(o,s.props);return s.type!==m.Fragment&&(a.ref=i?je(i,l):l),m.cloneElement(s,a)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var j4=Symbol("radix.slottable");function z4(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===j4}function H4(e,t){const n={...t};for(const i in t){const s=e[i],o=t[i];/^on[A-Z]/.test(i)?s&&o?n[i]=(...a)=>{const r=o(...a);return s(...a),r}:s&&(n[i]=s):i==="style"?n[i]={...s,...o}:i==="className"&&(n[i]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function V4(e){var i,s;let t=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var W4=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Wi=W4.reduce((e,t)=>{const n=B4(`Primitive.${t}`),i=m.forwardRef((s,o)=>{const{asChild:l,...a}=s,r=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(r,{...a,ref:o})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{});function $4(e,t=[]){let n=[];function i(o,l){const a=m.createContext(l),r=n.length;n=[...n,l];const f=h=>{var u;const{scope:b,children:_,...C}=h,S=((u=b==null?void 0:b[e])==null?void 0:u[r])||a,c=m.useMemo(()=>C,Object.values(C));return g.jsx(S.Provider,{value:c,children:_})};f.displayName=o+"Provider";function d(h,b){var S;const _=((S=b==null?void 0:b[e])==null?void 0:S[r])||a,C=m.useContext(_);if(C)return C;if(l!==void 0)return l;throw new Error(`\`${h}\` must be used within \`${o}\``)}return[f,d]}const s=()=>{const o=n.map(l=>m.createContext(l));return function(a){const r=(a==null?void 0:a[e])||o;return m.useMemo(()=>({[`__scope${e}`]:{...a,[e]:r}}),[a,r])}};return s.scopeName=e,[i,U4(s,...t)]}function U4(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const i=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const l=i.reduce((a,{useScope:r,scopeName:f})=>{const h=r(o)[`__scope${f}`];return{...a,...h}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}function Y4(e,t){return m.useReducer((n,i)=>t[n][i]??n,e)}var ul="ScrollArea",[y0]=$4(ul),[Z4,mt]=y0(ul),x0=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:i="hover",dir:s,scrollHideDelay:o=600,...l}=e,[a,r]=m.useState(null),[f,d]=m.useState(null),[h,b]=m.useState(null),[_,C]=m.useState(null),[S,c]=m.useState(null),[u,p]=m.useState(0),[v,y]=m.useState(0),[w,x]=m.useState(!1),[E,k]=m.useState(!1),N=ye(t,R=>r(R)),T=Ei(s);return g.jsx(Z4,{scope:n,type:i,dir:T,scrollHideDelay:o,scrollArea:a,viewport:f,onViewportChange:d,content:h,onContentChange:b,scrollbarX:_,onScrollbarXChange:C,scrollbarXEnabled:w,onScrollbarXEnabledChange:x,scrollbarY:S,onScrollbarYChange:c,scrollbarYEnabled:E,onScrollbarYEnabledChange:k,onCornerWidthChange:p,onCornerHeightChange:y,children:g.jsx(Wi.div,{dir:T,...l,ref:N,style:{position:"relative","--radix-scroll-area-corner-width":u+"px","--radix-scroll-area-corner-height":v+"px",...e.style}})})});x0.displayName=ul;var w0="ScrollAreaViewport",_0=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:i,nonce:s,...o}=e,l=mt(w0,n),a=m.useRef(null),r=ye(t,a,l.onViewportChange);return g.jsxs(g.Fragment,{children:[g.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),g.jsx(Wi.div,{"data-radix-scroll-area-viewport":"",...o,ref:r,style:{overflowX:l.scrollbarXEnabled?"scroll":"hidden",overflowY:l.scrollbarYEnabled?"scroll":"hidden",...e.style},children:g.jsx("div",{ref:l.onContentChange,style:{minWidth:"100%",display:"table"},children:i})})]})});_0.displayName=w0;var Ot="ScrollAreaScrollbar",dl=m.forwardRef((e,t)=>{const{forceMount:n,...i}=e,s=mt(Ot,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:l}=s,a=e.orientation==="horizontal";return m.useEffect(()=>(a?o(!0):l(!0),()=>{a?o(!1):l(!1)}),[a,o,l]),s.type==="hover"?g.jsx(q4,{...i,ref:t,forceMount:n}):s.type==="scroll"?g.jsx(G4,{...i,ref:t,forceMount:n}):s.type==="auto"?g.jsx(C0,{...i,ref:t,forceMount:n}):s.type==="always"?g.jsx(fl,{...i,ref:t}):null});dl.displayName=Ot;var q4=m.forwardRef((e,t)=>{const{forceMount:n,...i}=e,s=mt(Ot,e.__scopeScrollArea),[o,l]=m.useState(!1);return m.useEffect(()=>{const a=s.scrollArea;let r=0;if(a){const f=()=>{window.clearTimeout(r),l(!0)},d=()=>{r=window.setTimeout(()=>l(!1),s.scrollHideDelay)};return a.addEventListener("pointerenter",f),a.addEventListener("pointerleave",d),()=>{window.clearTimeout(r),a.removeEventListener("pointerenter",f),a.removeEventListener("pointerleave",d)}}},[s.scrollArea,s.scrollHideDelay]),g.jsx(Ke,{present:n||o,children:g.jsx(C0,{"data-state":o?"visible":"hidden",...i,ref:t})})}),G4=m.forwardRef((e,t)=>{const{forceMount:n,...i}=e,s=mt(Ot,e.__scopeScrollArea),o=e.orientation==="horizontal",l=tr(()=>r("SCROLL_END"),100),[a,r]=Y4("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return m.useEffect(()=>{if(a==="idle"){const f=window.setTimeout(()=>r("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(f)}},[a,s.scrollHideDelay,r]),m.useEffect(()=>{const f=s.viewport,d=o?"scrollLeft":"scrollTop";if(f){let h=f[d];const b=()=>{const _=f[d];h!==_&&(r("SCROLL"),l()),h=_};return f.addEventListener("scroll",b),()=>f.removeEventListener("scroll",b)}},[s.viewport,o,r,l]),g.jsx(Ke,{present:n||a!=="hidden",children:g.jsx(fl,{"data-state":a==="hidden"?"hidden":"visible",...i,ref:t,onPointerEnter:oe(e.onPointerEnter,()=>r("POINTER_ENTER")),onPointerLeave:oe(e.onPointerLeave,()=>r("POINTER_LEAVE"))})})}),C0=m.forwardRef((e,t)=>{const n=mt(Ot,e.__scopeScrollArea),{forceMount:i,...s}=e,[o,l]=m.useState(!1),a=e.orientation==="horizontal",r=tr(()=>{if(n.viewport){const f=n.viewport.offsetWidth<n.viewport.scrollWidth,d=n.viewport.offsetHeight<n.viewport.scrollHeight;l(a?f:d)}},10);return jn(n.viewport,r),jn(n.content,r),g.jsx(Ke,{present:i||o,children:g.jsx(fl,{"data-state":o?"visible":"hidden",...s,ref:t})})}),fl=m.forwardRef((e,t)=>{const{orientation:n="vertical",...i}=e,s=mt(Ot,e.__scopeScrollArea),o=m.useRef(null),l=m.useRef(0),[a,r]=m.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),f=T0(a.viewport,a.content),d={...i,sizes:a,onSizesChange:r,hasThumb:f>0&&f<1,onThumbChange:b=>o.current=b,onThumbPointerUp:()=>l.current=0,onThumbPointerDown:b=>l.current=b};function h(b,_){return t3(b,l.current,a,_)}return n==="horizontal"?g.jsx(K4,{...d,ref:t,onThumbPositionChange:()=>{if(s.viewport&&o.current){const b=s.viewport.scrollLeft,_=ja(b,a,s.dir);o.current.style.transform=`translate3d(${_}px, 0, 0)`}},onWheelScroll:b=>{s.viewport&&(s.viewport.scrollLeft=b)},onDragScroll:b=>{s.viewport&&(s.viewport.scrollLeft=h(b,s.dir))}}):n==="vertical"?g.jsx(X4,{...d,ref:t,onThumbPositionChange:()=>{if(s.viewport&&o.current){const b=s.viewport.scrollTop,_=ja(b,a);o.current.style.transform=`translate3d(0, ${_}px, 0)`}},onWheelScroll:b=>{s.viewport&&(s.viewport.scrollTop=b)},onDragScroll:b=>{s.viewport&&(s.viewport.scrollTop=h(b))}}):null}),K4=m.forwardRef((e,t)=>{const{sizes:n,onSizesChange:i,...s}=e,o=mt(Ot,e.__scopeScrollArea),[l,a]=m.useState(),r=m.useRef(null),f=ye(t,r,o.onScrollbarXChange);return m.useEffect(()=>{r.current&&a(getComputedStyle(r.current))},[r]),g.jsx(E0,{"data-orientation":"horizontal",...s,ref:f,sizes:n,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":er(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,h)=>{if(o.viewport){const b=o.viewport.scrollLeft+d.deltaX;e.onWheelScroll(b),A0(b,h)&&d.preventDefault()}},onResize:()=>{r.current&&o.viewport&&l&&i({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:r.current.clientWidth,paddingStart:ps(l.paddingLeft),paddingEnd:ps(l.paddingRight)}})}})}),X4=m.forwardRef((e,t)=>{const{sizes:n,onSizesChange:i,...s}=e,o=mt(Ot,e.__scopeScrollArea),[l,a]=m.useState(),r=m.useRef(null),f=ye(t,r,o.onScrollbarYChange);return m.useEffect(()=>{r.current&&a(getComputedStyle(r.current))},[r]),g.jsx(E0,{"data-orientation":"vertical",...s,ref:f,sizes:n,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":er(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,h)=>{if(o.viewport){const b=o.viewport.scrollTop+d.deltaY;e.onWheelScroll(b),A0(b,h)&&d.preventDefault()}},onResize:()=>{r.current&&o.viewport&&l&&i({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:r.current.clientHeight,paddingStart:ps(l.paddingTop),paddingEnd:ps(l.paddingBottom)}})}})}),[Q4,S0]=y0(Ot),E0=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:i,hasThumb:s,onThumbChange:o,onThumbPointerUp:l,onThumbPointerDown:a,onThumbPositionChange:r,onDragScroll:f,onWheelScroll:d,onResize:h,...b}=e,_=mt(Ot,n),[C,S]=m.useState(null),c=ye(t,N=>S(N)),u=m.useRef(null),p=m.useRef(""),v=_.viewport,y=i.content-i.viewport,w=Ze(d),x=Ze(r),E=tr(h,10);function k(N){if(u.current){const T=N.clientX-u.current.left,R=N.clientY-u.current.top;f({x:T,y:R})}}return m.useEffect(()=>{const N=T=>{const R=T.target;(C==null?void 0:C.contains(R))&&w(T,y)};return document.addEventListener("wheel",N,{passive:!1}),()=>document.removeEventListener("wheel",N,{passive:!1})},[v,C,y,w]),m.useEffect(x,[i,x]),jn(C,E),jn(_.content,E),g.jsx(Q4,{scope:n,scrollbar:C,hasThumb:s,onThumbChange:Ze(o),onThumbPointerUp:Ze(l),onThumbPositionChange:x,onThumbPointerDown:Ze(a),children:g.jsx(Wi.div,{...b,ref:c,style:{position:"absolute",...b.style},onPointerDown:oe(e.onPointerDown,N=>{N.button===0&&(N.target.setPointerCapture(N.pointerId),u.current=C.getBoundingClientRect(),p.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",_.viewport&&(_.viewport.style.scrollBehavior="auto"),k(N))}),onPointerMove:oe(e.onPointerMove,k),onPointerUp:oe(e.onPointerUp,N=>{const T=N.target;T.hasPointerCapture(N.pointerId)&&T.releasePointerCapture(N.pointerId),document.body.style.webkitUserSelect=p.current,_.viewport&&(_.viewport.style.scrollBehavior=""),u.current=null})})})}),hs="ScrollAreaThumb",N0=m.forwardRef((e,t)=>{const{forceMount:n,...i}=e,s=S0(hs,e.__scopeScrollArea);return g.jsx(Ke,{present:n||s.hasThumb,children:g.jsx(J4,{ref:t,...i})})}),J4=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:i,...s}=e,o=mt(hs,n),l=S0(hs,n),{onThumbPositionChange:a}=l,r=ye(t,h=>l.onThumbChange(h)),f=m.useRef(void 0),d=tr(()=>{f.current&&(f.current(),f.current=void 0)},100);return m.useEffect(()=>{const h=o.viewport;if(h){const b=()=>{if(d(),!f.current){const _=n3(h,a);f.current=_,a()}};return a(),h.addEventListener("scroll",b),()=>h.removeEventListener("scroll",b)}},[o.viewport,d,a]),g.jsx(Wi.div,{"data-state":l.hasThumb?"visible":"hidden",...s,ref:r,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...i},onPointerDownCapture:oe(e.onPointerDownCapture,h=>{const _=h.target.getBoundingClientRect(),C=h.clientX-_.left,S=h.clientY-_.top;l.onThumbPointerDown({x:C,y:S})}),onPointerUp:oe(e.onPointerUp,l.onThumbPointerUp)})});N0.displayName=hs;var hl="ScrollAreaCorner",k0=m.forwardRef((e,t)=>{const n=mt(hl,e.__scopeScrollArea),i=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&i?g.jsx(e3,{...e,ref:t}):null});k0.displayName=hl;var e3=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,...i}=e,s=mt(hl,n),[o,l]=m.useState(0),[a,r]=m.useState(0),f=!!(o&&a);return jn(s.scrollbarX,()=>{var h;const d=((h=s.scrollbarX)==null?void 0:h.offsetHeight)||0;s.onCornerHeightChange(d),r(d)}),jn(s.scrollbarY,()=>{var h;const d=((h=s.scrollbarY)==null?void 0:h.offsetWidth)||0;s.onCornerWidthChange(d),l(d)}),f?g.jsx(Wi.div,{...i,ref:t,style:{width:o,height:a,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function ps(e){return e?parseInt(e,10):0}function T0(e,t){const n=e/t;return isNaN(n)?0:n}function er(e){const t=T0(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,i=(e.scrollbar.size-n)*t;return Math.max(i,18)}function t3(e,t,n,i="ltr"){const s=er(n),o=s/2,l=t||o,a=s-l,r=n.scrollbar.paddingStart+l,f=n.scrollbar.size-n.scrollbar.paddingEnd-a,d=n.content-n.viewport,h=i==="ltr"?[0,d]:[d*-1,0];return M0([r,f],h)(e)}function ja(e,t,n="ltr"){const i=er(t),s=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-s,l=t.content-t.viewport,a=o-i,r=n==="ltr"?[0,l]:[l*-1,0],f=Rr(e,r);return M0([0,l],[0,a])(f)}function M0(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const i=(t[1]-t[0])/(e[1]-e[0]);return t[0]+i*(n-e[0])}}function A0(e,t){return e>0&&e<t}var n3=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},i=0;return function s(){const o={left:e.scrollLeft,top:e.scrollTop},l=n.left!==o.left,a=n.top!==o.top;(l||a)&&t(),n=o,i=window.requestAnimationFrame(s)}(),()=>window.cancelAnimationFrame(i)};function tr(e,t){const n=Ze(e),i=m.useRef(0);return m.useEffect(()=>()=>window.clearTimeout(i.current),[]),m.useCallback(()=>{window.clearTimeout(i.current),i.current=window.setTimeout(n,t)},[n,t])}function jn(e,t){const n=Ze(t);$e(()=>{let i=0;if(e){const s=new ResizeObserver(()=>{cancelAnimationFrame(i),i=window.requestAnimationFrame(n)});return s.observe(e),()=>{window.cancelAnimationFrame(i),s.unobserve(e)}}},[e,n])}var R0=x0,i3=_0,s3=k0;const D0=m.forwardRef(({className:e,children:t,...n},i)=>g.jsxs(R0,{ref:i,className:ne("relative overflow-hidden",e),...n,children:[g.jsx(i3,{className:"h-full w-full rounded-[inherit]",children:t}),g.jsx(pl,{}),g.jsx(s3,{})]}));D0.displayName=R0.displayName;const pl=m.forwardRef(({className:e,orientation:t="vertical",...n},i)=>g.jsx(dl,{ref:i,orientation:t,className:ne("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:g.jsx(N0,{className:"relative flex-1 rounded-full bg-border"})}));pl.displayName=dl.displayName;const L0=bs("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive",success:"border-green-500/50 text-green-700 dark:text-green-400 [&>svg]:text-green-500",warning:"border-yellow-500/50 text-yellow-700 dark:text-yellow-400 [&>svg]:text-yellow-500",info:"border-blue-500/50 text-blue-700 dark:text-blue-400 [&>svg]:text-blue-500"}},defaultVariants:{variant:"default"}}),ml=m.forwardRef(({className:e,variant:t,...n},i)=>g.jsx("div",{ref:i,role:"alert",className:ne(L0({variant:t}),e),...n}));ml.displayName="Alert";const gl=m.forwardRef(({className:e,...t},n)=>g.jsx("h5",{ref:n,className:ne("mb-1 font-medium leading-none tracking-tight",e),...t}));gl.displayName="AlertTitle";const vl=m.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:ne("text-sm [&_p]:leading-relaxed",e),...t}));vl.displayName="AlertDescription";const O0=m.forwardRef(({variant:e,title:t,children:n,className:i,...s},o)=>{const l={default:Yl,destructive:bm,success:vm,warning:gm,info:Yl},a=l[e]||l.default;return g.jsxs(ml,{ref:o,variant:e,className:i,...s,children:[g.jsx(a,{className:"h-4 w-4"}),t&&g.jsx(gl,{children:t}),n&&g.jsx(vl,{children:n})]})});O0.displayName="AlertWithIcon";const bl=m.forwardRef(({className:e,...t},n)=>g.jsx("div",{className:"relative w-full overflow-auto",children:g.jsx("table",{ref:n,className:ne("w-full caption-bottom text-sm",e),...t})}));bl.displayName="Table";const yl=m.forwardRef(({className:e,...t},n)=>g.jsx("thead",{ref:n,className:ne("[&_tr]:border-b",e),...t}));yl.displayName="TableHeader";const xl=m.forwardRef(({className:e,...t},n)=>g.jsx("tbody",{ref:n,className:ne("[&_tr:last-child]:border-0",e),...t}));xl.displayName="TableBody";const P0=m.forwardRef(({className:e,...t},n)=>g.jsx("tfoot",{ref:n,className:ne("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));P0.displayName="TableFooter";const En=m.forwardRef(({className:e,...t},n)=>g.jsx("tr",{ref:n,className:ne("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));En.displayName="TableRow";const li=m.forwardRef(({className:e,...t},n)=>g.jsx("th",{ref:n,className:ne("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));li.displayName="TableHead";const ln=m.forwardRef(({className:e,...t},n)=>g.jsx("td",{ref:n,className:ne("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));ln.displayName="TableCell";const I0=m.forwardRef(({className:e,...t},n)=>g.jsx("caption",{ref:n,className:ne("mt-4 text-sm text-muted-foreground",e),...t}));I0.displayName="TableCaption";const wl=m.forwardRef(({options:e=[],value:t,onChange:n,onSearch:i,placeholder:s="Select...",searchPlaceholder:o="Search...",loading:l=!1,disabled:a=!1,multiple:r=!1,clearable:f=!0,className:d,renderOption:h,renderValue:b,getOptionLabel:_=y=>(y==null?void 0:y.label)||(y==null?void 0:y.name)||String(y),getOptionValue:C=y=>(y==null?void 0:y.value)||(y==null?void 0:y.id)||y,filterOption:S,noOptionsMessage:c="No options found",loadingMessage:u="Loading...",...p},v)=>{const[y,w]=m.useState(!1),[x,E]=m.useState(""),[k,N]=m.useState(0),T=m.useRef(null),R=m.useRef(null),M=m.useMemo(()=>x?S?e.filter(B=>S(B,x)):e.filter(B=>_(B).toLowerCase().includes(x.toLowerCase())):e,[e,x,S,_]),A=m.useMemo(()=>uc(B=>{i==null||i(B)},300),[i]),D=B=>{const L=B.target.value;E(L),N(0),A(L)},$=B=>{if(r){const L=Array.isArray(t)?t:[],U=C(B);L.some(W=>C(W)===U)?n==null||n(L.filter(W=>C(W)!==U)):n==null||n([...L,B])}else n==null||n(B),w(!1),E("")},H=B=>{B.stopPropagation(),n==null||n(r?[]:null),E("")},j=B=>{if(!y){(B.key==="Enter"||B.key===" "||B.key==="ArrowDown")&&(B.preventDefault(),w(!0));return}switch(B.key){case"ArrowDown":B.preventDefault(),N(L=>Math.min(L+1,M.length-1));break;case"ArrowUp":B.preventDefault(),N(L=>Math.max(L-1,0));break;case"Enter":B.preventDefault(),M[k]&&$(M[k]);break;case"Escape":B.preventDefault(),w(!1),E("");break}};m.useEffect(()=>{const B=L=>{T.current&&!T.current.contains(L.target)&&(w(!1),E(""))};return document.addEventListener("mousedown",B),()=>document.removeEventListener("mousedown",B)},[]);const F=B=>r?(Array.isArray(t)?t:[]).some(U=>C(U)===C(B)):t&&C(t)===C(B),z=r?Array.isArray(t)&&t.length>0:!!t,O=()=>{if(!z)return g.jsx("span",{className:"text-muted-foreground",children:s});if(b)return b(t);if(r){const B=Array.isArray(t)?t:[];return B.length===1?_(B[0]):`${B.length} selected`}return _(t)};return g.jsxs("div",{ref:T,className:ne("relative w-full",d),...p,children:[g.jsxs("button",{ref:v,type:"button",role:"combobox","aria-expanded":y,"aria-haspopup":"listbox",disabled:a,onClick:()=>w(!y),onKeyDown:j,className:ne("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",y&&"ring-2 ring-ring ring-offset-2"),children:[g.jsx("span",{className:"flex-1 text-left truncate",children:O()}),g.jsxs("div",{className:"flex items-center gap-1",children:[f&&z&&!a&&g.jsx(Mn,{className:"h-4 w-4 opacity-50 hover:opacity-100 cursor-pointer",onClick:H}),g.jsx(ys,{className:ne("h-4 w-4 opacity-50 transition-transform",y&&"rotate-180")})]})]}),y&&g.jsxs("div",{className:"absolute z-50 mt-1 w-full rounded-md border bg-popover text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95",children:[g.jsxs("div",{className:"flex items-center border-b px-3",children:[g.jsx(to,{className:"h-4 w-4 shrink-0 opacity-50"}),g.jsx("input",{ref:R,type:"text",value:x,onChange:D,placeholder:o,className:"flex h-10 w-full bg-transparent py-3 pl-2 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",autoFocus:!0}),l&&g.jsx(un,{className:"h-4 w-4 animate-spin"})]}),g.jsx("div",{className:"max-h-60 overflow-auto p-1",children:l&&M.length===0?g.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:u}):M.length===0?g.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:c}):M.map((B,L)=>g.jsxs("div",{role:"option","aria-selected":F(B),onClick:()=>$(B),onMouseEnter:()=>N(L),className:ne("relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none",k===L&&"bg-accent text-accent-foreground",F(B)&&"bg-accent/50"),children:[r&&g.jsx("div",{className:ne("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",F(B)&&"bg-primary text-primary-foreground"),children:F(B)&&g.jsx(ui,{className:"h-3 w-3"})}),h?h(B):g.jsx("span",{className:"flex-1",children:_(B)}),!r&&F(B)&&g.jsx(ui,{className:"ml-auto h-4 w-4"})]},C(B)))})]})]})});wl.displayName="SearchSelect";const $t=m.forwardRef(({className:e,label:t,description:n,error:i,required:s,children:o,...l},a)=>{const r=m.useId();return g.jsxs("div",{ref:a,className:ne("space-y-2",e),...l,children:[t&&g.jsxs(Kt,{htmlFor:r,className:ne(i&&"text-destructive"),children:[t,s&&g.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),m.Children.map(o,f=>m.isValidElement(f)?m.cloneElement(f,{id:r,"aria-invalid":!!i}):f),n&&!i&&g.jsx("p",{className:"text-sm text-muted-foreground",children:n}),i&&g.jsx("p",{className:"text-sm text-destructive",children:i})]})});$t.displayName="FormField";const ms=m.forwardRef(({label:e,description:t,error:n,required:i,className:s,inputClassName:o,onChange:l,...a},r)=>{const f=d=>{l==null||l(d.target.value)};return g.jsx($t,{label:e,description:t,error:n,required:i,className:s,children:g.jsx(Ln,{ref:r,className:ne(n&&"border-destructive",o),onChange:f,...a})})});ms.displayName="QInput";const _l=m.forwardRef(({label:e,description:t,error:n,required:i,className:s,textareaClassName:o,onChange:l,...a},r)=>{const f=d=>{l==null||l(d.target.value)};return g.jsx($t,{label:e,description:t,error:n,required:i,className:s,children:g.jsx(no,{ref:r,className:ne(n&&"border-destructive",o),onChange:f,...a})})});_l.displayName="QTextarea";const Cl=m.forwardRef(({label:e,description:t,error:n,required:i,options:s=[],placeholder:o="Select...",className:l,value:a,onChange:r,getOptionLabel:f,getOptionValue:d,optionLabel:h,optionValue:b,..._},C)=>{const S=f||(h?u=>u==null?void 0:u[h]:u=>(u==null?void 0:u.label)||(u==null?void 0:u.name)||(u==null?void 0:u.display_name)||String(u)),c=d||(b?u=>u==null?void 0:u[b]:u=>(u==null?void 0:u.value)||(u==null?void 0:u.id)||u);return g.jsx($t,{label:e,description:t,error:n,required:i,className:l,children:g.jsxs(xo,{value:a,onValueChange:r,..._,children:[g.jsx(Os,{ref:C,className:ne(n&&"border-destructive"),children:g.jsx(wo,{placeholder:o})}),g.jsx(Ps,{children:s.map(u=>g.jsx(Is,{value:String(c(u)),children:S(u)},c(u)))})]})})});Cl.displayName="QSelect";const Sl=m.forwardRef(({label:e,description:t,error:n,required:i,className:s,...o},l)=>g.jsx($t,{label:e,description:t,error:n,required:i,className:s,children:g.jsx(wl,{ref:l,...o})}));Sl.displayName="QSearchSelect";const El=m.forwardRef(({label:e,description:t,error:n,className:i,checked:s,onCheckedChange:o,onChange:l,...a},r)=>{const f=m.useId(),d=h=>{l==null||l(h),o==null||o(h)};return g.jsxs("div",{className:ne("flex items-center justify-between space-x-2",i),children:[g.jsxs("div",{className:"space-y-0.5",children:[e&&g.jsx(Kt,{htmlFor:f,className:"text-base",children:e}),t&&g.jsx("p",{className:"text-sm text-muted-foreground",children:t}),n&&g.jsx("p",{className:"text-sm text-destructive",children:n})]}),g.jsx(ao,{ref:r,id:f,checked:s,onCheckedChange:d,...a})]})});El.displayName="QSwitch";const Nl=m.forwardRef(({label:e,description:t,error:n,className:i,checked:s,onCheckedChange:o,...l},a)=>{const r=m.useId();return g.jsxs("div",{className:ne("flex items-start space-x-2",i),children:[g.jsx(On,{ref:a,id:r,checked:s,onCheckedChange:o,className:"mt-1",...l}),g.jsxs("div",{className:"space-y-1 leading-none",children:[e&&g.jsx(Kt,{htmlFor:r,children:e}),t&&g.jsx("p",{className:"text-sm text-muted-foreground",children:t}),n&&g.jsx("p",{className:"text-sm text-destructive",children:n})]})]})});Nl.displayName="QCheckbox";const B0=m.forwardRef(({onSubmit:e,className:t,children:n,...i},s)=>{const o=l=>{l.preventDefault(),e==null||e(l)};return g.jsx("form",{ref:s,onSubmit:o,className:ne("space-y-4",t),...i,children:n})});B0.displayName="QForm";const F0=m.forwardRef(({label:e,description:t,error:n,required:i,className:s,value:o,onChange:l,placeholder:a="Pick a date",...r},f)=>g.jsx($t,{label:e,description:t,error:n,required:i,className:s,children:g.jsx(Go,{ref:f,date:o,onDateChange:l,placeholder:a,...r})}));F0.displayName="QDatePicker";const j0=m.forwardRef(({label:e,description:t,error:n,required:i,className:s,value:o,onChange:l,placeholder:a="Pick a date range",...r},f)=>g.jsx($t,{label:e,description:t,error:n,required:i,className:s,children:g.jsx(Ko,{ref:f,dateRange:o,onDateRangeChange:l,placeholder:a,...r})}));j0.displayName="QDateRangePicker";const z0=m.forwardRef(({label:e,description:t,error:n,required:i,className:s,value:o,onChange:l,placeholder:a="Start writing...",height:r="200px",...f},d)=>g.jsx($t,{label:e,description:t,error:n,required:i,className:s,children:g.jsx(Jo,{ref:d,value:o,onChange:l,placeholder:a,height:r,...f})}));z0.displayName="QRichTextEditor";const kl=({currentPage:e=1,totalPages:t=1,totalItems:n=0,pageSize:i=10,pageSizeOptions:s=[10,20,50,100],onPageChange:o,onPageSizeChange:l,showPageSizeSelector:a=!0,showInfo:r=!0,className:f})=>{const d=(e-1)*i+1,h=Math.min(e*i,n),b=e>1,_=e<t,C=()=>{const S=[];if(t<=5)for(let u=1;u<=t;u++)S.push(u);else{S.push(1),e>3&&S.push("...");const u=Math.max(2,e-1),p=Math.min(t-1,e+1);for(let v=u;v<=p;v++)S.push(v);e<t-2&&S.push("..."),t>1&&S.push(t)}return S};return g.jsxs("div",{className:ne("flex flex-col sm:flex-row items-center justify-between gap-4 px-2 py-4",f),children:[g.jsxs("div",{className:"flex items-center gap-4",children:[a&&g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"text-sm text-muted-foreground",children:"Rows per page"}),g.jsxs(xo,{value:String(i),onValueChange:S=>l==null?void 0:l(Number(S)),children:[g.jsx(Os,{className:"h-8 w-[70px]",children:g.jsx(wo,{placeholder:i})}),g.jsx(Ps,{side:"top",children:s.map(S=>g.jsx(Is,{value:String(S),children:S},S))})]})]}),r&&n>0&&g.jsxs("span",{className:"text-sm text-muted-foreground",children:["Showing ",d," to ",h," of ",n," results"]})]}),g.jsxs("div",{className:"flex items-center gap-1",children:[g.jsxs(we,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>o==null?void 0:o(1),disabled:!b,children:[g.jsx(pm,{className:"h-4 w-4"}),g.jsx("span",{className:"sr-only",children:"First page"})]}),g.jsxs(we,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>o==null?void 0:o(e-1),disabled:!b,children:[g.jsx(eo,{className:"h-4 w-4"}),g.jsx("span",{className:"sr-only",children:"Previous page"})]}),g.jsx("div",{className:"flex items-center gap-1",children:C().map((S,c)=>S==="..."?g.jsx("span",{className:"px-2 text-muted-foreground",children:"..."},`ellipsis-${c}`):g.jsx(we,{variant:e===S?"default":"outline",size:"icon",className:"h-8 w-8",onClick:()=>o==null?void 0:o(S),children:S},S))}),g.jsxs(we,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>o==null?void 0:o(e+1),disabled:!_,children:[g.jsx(_i,{className:"h-4 w-4"}),g.jsx("span",{className:"sr-only",children:"Next page"})]}),g.jsxs(we,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>o==null?void 0:o(t),disabled:!_,children:[g.jsx(mm,{className:"h-4 w-4"}),g.jsx("span",{className:"sr-only",children:"Last page"})]})]})]})};kl.displayName="Pagination";const zn=({variant:e="spinner",size:t="default",text:n,className:i,fullScreen:s=!1,overlay:o=!1})=>{const l={sm:"h-4 w-4",default:"h-8 w-8",lg:"h-12 w-12",xl:"h-16 w-16"},a=ne("flex flex-col items-center justify-center gap-3",s&&"fixed inset-0 z-50",o&&"bg-background/80 backdrop-blur-sm",i),r=()=>{switch(e){case"spinner":return g.jsx(un,{className:ne("animate-spin text-primary",l[t])});case"dots":return g.jsx("div",{className:"flex gap-1",children:[0,1,2].map(f=>g.jsx("div",{className:ne("rounded-full bg-primary animate-bounce",t==="sm"&&"h-1.5 w-1.5",t==="default"&&"h-2 w-2",t==="lg"&&"h-3 w-3",t==="xl"&&"h-4 w-4"),style:{animationDelay:`${f*.15}s`}},f))});case"pulse":return g.jsx("div",{className:ne("rounded-full bg-primary animate-pulse",l[t])});case"skeleton":return g.jsxs("div",{className:"space-y-3 w-full max-w-sm",children:[g.jsx("div",{className:"h-4 bg-muted rounded animate-pulse"}),g.jsx("div",{className:"h-4 bg-muted rounded animate-pulse w-3/4"}),g.jsx("div",{className:"h-4 bg-muted rounded animate-pulse w-1/2"})]});default:return g.jsx(un,{className:ne("animate-spin text-primary",l[t])})}};return g.jsxs("div",{className:a,children:[r(),n&&g.jsx("p",{className:"text-sm text-muted-foreground animate-pulse",children:n})]})};zn.displayName="Loading";const H0=({loading:e,children:t,text:n,className:i})=>g.jsxs("div",{className:ne("relative",i),children:[t,e&&g.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-background/80 backdrop-blur-sm rounded-lg",children:g.jsx(zn,{text:n})})]});H0.displayName="LoadingOverlay";const V0=m.forwardRef(({loading:e,loadingText:t,children:n,disabled:i,className:s,...o},l)=>g.jsx(we,{ref:l,disabled:i||e,className:s,...o,children:e?g.jsxs(g.Fragment,{children:[g.jsx(un,{className:"mr-2 h-4 w-4 animate-spin"}),t||"Loading..."]}):n}));V0.displayName="LoadingButton";const Gn=({icon:e=Ul,title:t="No data found",description:n="There are no items to display.",action:i,actionLabel:s,onAction:o,variant:l="default",className:a,children:r})=>{const f={default:{icon:Ul,title:"No data found",description:"There are no items to display."},search:{icon:to,title:"No results found",description:"Try adjusting your search or filters to find what you're looking for."},empty:{icon:fc,title:"Get started",description:"Create your first item to get started."},error:{icon:hc,title:"Something went wrong",description:"There was an error loading the data. Please try again."}},d=f[l]||f.default,h=e||d.icon,b=t||d.title,_=n||d.description;return g.jsxs("div",{className:ne("flex flex-col items-center justify-center py-12 px-4 text-center",a),children:[g.jsx("div",{className:"rounded-full bg-muted p-4 mb-4",children:g.jsx(h,{className:"h-8 w-8 text-muted-foreground"})}),g.jsx("h3",{className:"text-lg font-semibold mb-2",children:b}),g.jsx("p",{className:"text-sm text-muted-foreground mb-6 max-w-sm",children:_}),r,(i||o)&&g.jsx(we,{onClick:o,children:s||"Take Action"})]})};Gn.displayName="EmptyState";const Tl=({searchTerm:e,onClear:t,className:n})=>g.jsx(Gn,{variant:"search",title:`No results for "${e}"`,description:"Try searching with different keywords or check your filters.",className:n,children:t&&g.jsx(we,{variant:"outline",onClick:t,children:"Clear Search"})});Tl.displayName="SearchEmptyState";const W0=({itemName:e="item",onCreate:t,className:n})=>g.jsx(Gn,{variant:"empty",icon:fc,title:`No ${e}s yet`,description:`Create your first ${e} to get started.`,onAction:t,actionLabel:`Create ${e}`,className:n});W0.displayName="CreateEmptyState";const $0=({error:e,onRetry:t,className:n})=>g.jsx(Gn,{variant:"error",title:"Error loading data",description:(e==null?void 0:e.message)||"Something went wrong. Please try again.",onAction:t,actionLabel:"Try Again",className:n});$0.displayName="ErrorState";const nr=({open:e,onOpenChange:t,title:n,description:i,children:s,footer:o,size:l="default",showClose:a=!0,className:r,...f})=>{const d={sm:"max-w-sm",default:"max-w-lg",lg:"max-w-2xl",xl:"max-w-4xl",full:"max-w-[95vw]"};return g.jsx(Sd,{open:e,onOpenChange:t,...f,children:g.jsxs(To,{className:ne(d[l],r),children:[(n||i)&&g.jsxs(Mo,{children:[n&&g.jsx(Ao,{children:n}),i&&g.jsx(Ro,{children:i})]}),s,o&&g.jsx(Fs,{children:o})]})})};nr.displayName="Modal";const Ml=({open:e,onOpenChange:t,onConfirm:n,onCancel:i,title:s="Are you sure?",description:o="This action cannot be undone.",confirmText:l="Confirm",cancelText:a="Cancel",variant:r="default",loading:f=!1,className:d})=>{const h=async()=>{await(n==null?void 0:n())},b=()=>{i==null||i(),t==null||t(!1)};return g.jsx(nr,{open:e,onOpenChange:t,title:s,description:o,size:"sm",className:d,footer:g.jsxs("div",{className:"flex gap-2 justify-end",children:[g.jsx(we,{variant:"outline",onClick:b,disabled:f,children:a}),g.jsx(we,{variant:r==="destructive"?"destructive":"default",onClick:h,disabled:f,children:f?"Loading...":l})]})})};Ml.displayName="ConfirmModal";const xi=({open:e,onOpenChange:t,onConfirm:n,itemName:i="item",loading:s=!1})=>g.jsx(Ml,{open:e,onOpenChange:t,onConfirm:n,title:`Delete ${i}?`,description:`Are you sure you want to delete this ${i}? This action cannot be undone.`,confirmText:"Delete",variant:"destructive",loading:s});xi.displayName="DeleteConfirmModal";const U0=({open:e,onOpenChange:t,onSubmit:n,title:i,description:s,children:o,submitText:l="Save",cancelText:a="Cancel",loading:r=!1,size:f="default",className:d})=>{const h=async b=>{b==null||b.preventDefault(),await(n==null?void 0:n())};return g.jsx(nr,{open:e,onOpenChange:t,title:i,description:s,size:f,className:d,children:g.jsxs("form",{onSubmit:h,children:[g.jsx("div",{className:"py-4",children:o}),g.jsxs(Fs,{children:[g.jsx(we,{type:"button",variant:"outline",onClick:()=>t==null?void 0:t(!1),disabled:r,children:a}),g.jsx(we,{type:"submit",disabled:r,children:r?"Saving...":l})]})]})})};U0.displayName="FormModal";const Al=({data:e=[],columns:t=[],loading:n=!1,error:i=null,pagination:s=null,currentPage:o=1,pageSize:l=10,totalItems:a=0,totalPages:r=1,onPageChange:f,onPageSizeChange:d,sortable:h=!0,sortColumn:b=null,sortDirection:_=null,onSort:C,searchable:S=!0,searchValue:c="",onSearchChange:u,searchPlaceholder:p="Search...",selectable:v=!1,selectedRows:y=[],onSelectionChange:w,actions:x=[],onRowClick:E,striped:k=!1,hover:N=!0,compact:T=!1,className:R,emptyTitle:M="No data found",emptyDescription:A="There are no items to display.",emptyAction:D,onEmptyAction:$,getRowKey:H=j=>j.id||j._id})=>{const[j,F]=m.useState(c);m.useEffect(()=>{const V=setTimeout(()=>{u&&j!==c&&u(j)},300);return()=>clearTimeout(V)},[j]);const z=V=>{if(!h||!V.sortable)return;const X=V.sortKey||V.accessor;let Z="asc";b===X&&(Z=_==="asc"?"desc":"asc"),C==null||C(X,Z)},O=V=>{V?w==null||w(e.map(H)):w==null||w([])},B=(V,X)=>{X?w==null||w([...y,V]):w==null||w(y.filter(Z=>Z!==V))},L=e.length>0&&y.length===e.length,U=y.length>0&&y.length<e.length,P=(V,X,Z)=>{const G=V.accessor||V.key,J=G?typeof G=="function"?G(X):X[G]:void 0;return V.render?V.render(J,X,Z):V.format?V.format(J,X):J!==null&&typeof J=="object"?"-":J??"-"},W=V=>{if(!h||!V.sortable)return null;const X=V.sortKey||V.accessor;return b!==X?g.jsx(dm,{className:"ml-2 h-4 w-4 opacity-50"}):_==="asc"?g.jsx(fm,{className:"ml-2 h-4 w-4"}):g.jsx(um,{className:"ml-2 h-4 w-4"})},Q=V=>{if(!x||x.length===0)return null;const X=x.filter(Z=>Z.hidden?typeof Z.hidden=="function"?!Z.hidden(V):!Z.hidden:!0);return X.length===0?null:g.jsxs(al,{children:[g.jsx(cl,{asChild:!0,children:g.jsxs(we,{variant:"ghost",size:"icon",className:"h-8 w-8",children:[g.jsx(wm,{className:"h-4 w-4"}),g.jsx("span",{className:"sr-only",children:"Open menu"})]})}),g.jsxs(Qs,{align:"end",children:[g.jsx(Js,{children:"Actions"}),g.jsx(yi,{}),X.map((Z,G)=>g.jsxs(bi,{onClick:()=>{var J;return(J=Z.onClick)==null?void 0:J.call(Z,V)},className:ne(Z.variant==="destructive"&&"text-destructive focus:text-destructive"),disabled:Z.disabled,children:[Z.icon&&g.jsx(Z.icon,{className:"mr-2 h-4 w-4"}),Z.label]},Z.label||G))]})]})};return g.jsxs("div",{className:ne("w-full",R),children:[(S||y.length>0)&&g.jsxs("div",{className:"flex items-center justify-between gap-4 mb-4",children:[S&&g.jsxs("div",{className:"relative max-w-sm",children:[g.jsx(to,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),g.jsx(Ln,{placeholder:p,value:j,onChange:V=>F(V.target.value),className:"pl-9 pr-9"}),j&&g.jsx("button",{onClick:()=>{F(""),u==null||u("")},className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:g.jsx(Mn,{className:"h-4 w-4"})})]}),v&&y.length>0&&g.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[y.length," row(s) selected",g.jsx(we,{variant:"ghost",size:"sm",onClick:()=>w==null?void 0:w([]),children:"Clear selection"})]})]}),g.jsx("div",{className:"rounded-md border",children:g.jsxs(bl,{children:[g.jsx(yl,{children:g.jsxs(En,{children:[v&&g.jsx(li,{className:"w-12",children:g.jsx(On,{checked:L,indeterminate:U,onCheckedChange:O})}),t.map((V,X)=>g.jsx(li,{className:ne(V.headerClassName,h&&V.sortable&&"cursor-pointer select-none"),style:{width:V.width},onClick:()=>z(V),children:g.jsxs("div",{className:"flex items-center",children:[V.header||V.label,W(V)]})},V.accessor||X)),x&&x.length>0&&g.jsx(li,{className:"w-12",children:"Actions"})]})}),g.jsx(xl,{children:n?g.jsx(En,{children:g.jsx(ln,{colSpan:t.length+(v?1:0)+(x!=null&&x.length?1:0),className:"h-48",children:g.jsx(zn,{text:"Loading data..."})})}):e.length===0?g.jsx(En,{children:g.jsx(ln,{colSpan:t.length+(v?1:0)+(x!=null&&x.length?1:0),className:"h-48",children:j?g.jsx(Tl,{searchTerm:j,onClear:()=>{F(""),u==null||u("")}}):g.jsx(Gn,{title:M,description:A,onAction:$,actionLabel:D})})}):e.map((V,X)=>{const Z=H(V),G=y.includes(Z);return g.jsxs(En,{"data-state":G?"selected":void 0,className:ne(k&&X%2===1&&"bg-muted/50",N&&"cursor-pointer",E&&"hover:bg-muted"),onClick:()=>E==null?void 0:E(V),children:[v&&g.jsx(ln,{onClick:J=>J.stopPropagation(),children:g.jsx(On,{checked:G,onCheckedChange:J=>B(Z,J)})}),t.map((J,ee)=>g.jsx(ln,{className:ne(T&&"py-2",J.cellClassName),children:P(J,V,X)},J.accessor||ee)),x&&x.length>0&&g.jsx(ln,{onClick:J=>J.stopPropagation(),children:Q(V)})]},Z)})})]})}),!n&&e.length>0&&s!==!1&&g.jsx(kl,{currentPage:o,totalPages:r,totalItems:a,pageSize:l,onPageChange:f,onPageSizeChange:d})]})};Al.displayName="DataTable";const Y0=({store:e,data:t,loading:n=!1,error:i=null,columns:s=[],currentPage:o=1,pageSize:l=10,totalItems:a=0,totalPages:r=1,onPageChange:f,onPageSizeChange:d,sortColumn:h,sortDirection:b,onSort:_,searchValue:C="",onSearchChange:S,searchPlaceholder:c="Search...",selectable:u=!1,selectedRows:p=[],onSelectionChange:v,onCreate:y,onView:w,onEdit:x,onDelete:E,onRefresh:k,onExport:N,createPath:T,detailPath:R,editPath:M,additionalActions:A=[],bulkActions:D=[],title:$,description:H,createLabel:j="Create",refreshLabel:F="Refresh",exportLabel:z="Export",viewLabel:O="View",editLabel:B="Edit",deleteLabel:L="Delete",itemName:U="item",getRowKey:P=ue=>ue.id||ue._id,showHeader:W=!0,showToolbar:Q=!0,compact:V=!1,className:X,deleteConfirmTitle:Z,deleteConfirmDescription:G,getDeleteItemName:J,filters:ee,headerActions:se,searchable:le=!0})=>{const ue=Je.useNavigate(),[Se,Re]=m.useState(!1),[ge,ke]=m.useState(null),[I,Y]=m.useState(!1),[q,re]=m.useState(""),ie=m.useRef(!1),te=m.useRef(q),ae=m.useRef(null),ve=m.useRef(null),me=(e==null?void 0:e.items)??t??[],xe=(e==null?void 0:e.loading)??n,Ae=(e==null?void 0:e.error)??i,Ee=(e==null?void 0:e.pagination)??{page:o,pageSize:l,total:a,totalPages:r},Fe=Ee.page??o,Ie=Ee.pageSize??l,Ye=Ee.total??a,Ge=Ee.totalPages??r,ze=e==null?void 0:e.fetchList,Pt=e==null?void 0:e.delete,ut=e==null?void 0:e.setPage,gn=e==null?void 0:e.setPageSize,he=e==null?void 0:e.setFilters;m.useEffect(()=>{ze&&!ie.current&&(ie.current=!0,ae.current=Fe,ve.current=Ie,ze())},[ze]),m.useEffect(()=>{if(!ze||!ie.current)return;const Ce=ae.current!==Fe,lr=ve.current!==Ie;(Ce||lr)&&(ae.current=Fe,ve.current=Ie,ze())},[Fe,Ie,ze]),m.useEffect(()=>{if(!ze||!ie.current||te.current===q)return;const Ce=setTimeout(()=>{le&&(te.current=q,he==null||he({search:q}),Fe!==1?ut==null||ut(1):ze())},300);return()=>clearTimeout(Ce)},[q,le,Fe,he,ut,ze]);const Te=m.useCallback(Ce=>{ut?ut(Ce):f==null||f(Ce)},[ut,f]),fe=m.useCallback(Ce=>{gn?gn(Ce):d==null||d(Ce)},[gn,d]),Ne=m.useCallback(Ce=>{he?re(Ce):S==null||S(Ce)},[he,S]),Xe=m.useCallback(()=>{T?ue(T):y==null||y()},[T,ue,y]),_e=m.useCallback(Ce=>{R?ue(`${R}/${P(Ce)}`):w==null||w(Ce)},[R,ue,P,w]),Ui=m.useCallback(Ce=>{M?ue(`${M}/${P(Ce)}/edit`):x==null||x(Ce)},[M,ue,P,x]),rr=m.useCallback(()=>{ze?ze():k==null||k()},[ze,k]),Yi=m.useCallback(Ce=>{ke(Ce),Re(!0)},[]),Kn=async()=>{if(ge){Y(!0);try{Pt?(await Pt(P(ge)),ze==null||ze()):E&&await E(ge),Re(!1),ke(null)}catch(Ce){console.error("Delete error:",Ce)}finally{Y(!1)}}},Xn=m.useMemo(()=>{const Ce=[];return(R||w)&&Ce.push({label:O,icon:_m,onClick:_e}),(M||x)&&Ce.push({label:B,icon:Mr,onClick:Ui}),(Pt||E)&&Ce.push({label:L,icon:Ar,variant:"destructive",onClick:Yi}),[...Ce,...A]},[R,M,w,x,Pt,E,O,B,L,_e,Ui,Yi,A]),or=T||y,cp=ze||k,Il=m.useMemo(()=>ge?J?J(ge):ge.name||ge.title||U:U,[ge,J,U]),Bl=()=>Q?g.jsxs("div",{className:"flex items-center gap-2",children:[se,u&&p.length>0&&D.length>0&&g.jsx(g.Fragment,{children:D.map((Ce,lr)=>g.jsxs(we,{variant:Ce.variant||"outline",size:"sm",onClick:()=>{var jl;return(jl=Ce.onClick)==null?void 0:jl.call(Ce,p)},disabled:Ce.disabled,children:[Ce.icon&&g.jsx(Ce.icon,{className:"mr-2 h-4 w-4"}),Ce.label]},Ce.label||lr))}),N&&g.jsxs(we,{variant:"outline",size:"sm",onClick:N,children:[g.jsx(xm,{className:"mr-2 h-4 w-4"}),z]}),cp&&g.jsxs(we,{variant:"outline",size:"sm",onClick:rr,disabled:xe,children:[g.jsx(hc,{className:ne("mr-2 h-4 w-4",xe&&"animate-spin")}),F]}),or&&g.jsxs(we,{size:"sm",onClick:Xe,children:[g.jsx(Em,{className:"mr-2 h-4 w-4"}),j]})]}):null,Fl=g.jsxs(g.Fragment,{children:[ee&&g.jsx("div",{className:"mb-4 flex items-center gap-2",children:ee}),g.jsx(Al,{data:me,columns:s,loading:xe,error:Ae,currentPage:Fe,pageSize:Ie,totalItems:Ye,totalPages:Ge,onPageChange:Te,onPageSizeChange:fe,sortColumn:h,sortDirection:b,onSort:_,searchable:le,searchValue:he?q:C,onSearchChange:Ne,searchPlaceholder:c,selectable:u,selectedRows:p,onSelectionChange:v,actions:Xn,getRowKey:P,compact:V,emptyTitle:`No ${U}s found`,emptyDescription:`Create your first ${U} to get started.`,emptyAction:or?`Create ${U}`:void 0,onEmptyAction:or?Xe:void 0}),g.jsx(xi,{open:Se,onOpenChange:Re,onConfirm:Kn,title:Z||`Delete ${U}`,description:G||`Are you sure you want to delete "${Il}"? This action cannot be undone.`,itemName:Il,loading:I})]});return W&&($||H)?g.jsxs(ft,{className:X,children:[g.jsxs(An,{className:"flex flex-row items-center justify-between space-y-0 pb-4",children:[g.jsxs("div",{children:[$&&g.jsx(Rn,{children:$}),H&&g.jsx(Dn,{children:H})]}),Bl()]}),g.jsx(ht,{children:Fl})]}):g.jsxs("div",{className:X,children:[Q&&g.jsxs("div",{className:"flex items-center justify-between mb-4",children:[g.jsx("div",{}),Bl()]}),Fl]})};Y0.displayName="CrudList";var $i=e=>e.type==="checkbox",cn=e=>e instanceof Date,nt=e=>e==null;const Z0=e=>typeof e=="object";var We=e=>!nt(e)&&!Array.isArray(e)&&Z0(e)&&!cn(e),r3=e=>We(e)&&e.target?$i(e.target)?e.target.checked:e.target.value:e,o3=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,l3=(e,t)=>e.has(o3(t)),a3=e=>{const t=e.constructor&&e.constructor.prototype;return We(t)&&t.hasOwnProperty("isPrototypeOf")},Rl=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function qe(e){let t;const n=Array.isArray(e),i=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(!(Rl&&(e instanceof Blob||i))&&(n||We(e)))if(t=n?[]:Object.create(Object.getPrototypeOf(e)),!n&&!a3(e))t=e;else for(const s in e)e.hasOwnProperty(s)&&(t[s]=qe(e[s]));else return e;return t}var ir=e=>/^\w*$/.test(e),He=e=>e===void 0,Dl=e=>Array.isArray(e)?e.filter(Boolean):[],Ll=e=>Dl(e.replace(/["|']|\]/g,"").split(/\.|\[/)),ce=(e,t,n)=>{if(!t||!We(e))return n;const i=(ir(t)?[t]:Ll(t)).reduce((s,o)=>nt(s)?s:s[o],e);return He(i)||i===e?He(e[t])?n:e[t]:i},Nt=e=>typeof e=="boolean",Oe=(e,t,n)=>{let i=-1;const s=ir(t)?[t]:Ll(t),o=s.length,l=o-1;for(;++i<o;){const a=s[i];let r=n;if(i!==l){const f=e[a];r=We(f)||Array.isArray(f)?f:isNaN(+s[i+1])?{}:[]}if(a==="__proto__"||a==="constructor"||a==="prototype")return;e[a]=r,e=e[a]}};const za={BLUR:"blur",FOCUS_OUT:"focusout"},bt={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Bt={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},c3=K.createContext(null);c3.displayName="HookFormContext";var u3=(e,t,n,i=!0)=>{const s={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(s,o,{get:()=>{const l=o;return t._proxyFormState[l]!==bt.all&&(t._proxyFormState[l]=!i||bt.all),e[l]}});return s};const d3=typeof window<"u"?K.useLayoutEffect:K.useEffect;var ot=e=>typeof e=="string",f3=(e,t,n,i,s)=>ot(e)?(i&&t.watch.add(e),ce(n,e,s)):Array.isArray(e)?e.map(o=>(i&&t.watch.add(o),ce(n,o))):(i&&(t.watchAll=!0),n),Kr=e=>nt(e)||!Z0(e);function Gt(e,t,n=new WeakSet){if(Kr(e)||Kr(t))return Object.is(e,t);if(cn(e)&&cn(t))return e.getTime()===t.getTime();const i=Object.keys(e),s=Object.keys(t);if(i.length!==s.length)return!1;if(n.has(e)||n.has(t))return!0;n.add(e),n.add(t);for(const o of i){const l=e[o];if(!s.includes(o))return!1;if(o!=="ref"){const a=t[o];if(cn(l)&&cn(a)||We(l)&&We(a)||Array.isArray(l)&&Array.isArray(a)?!Gt(l,a,n):!Object.is(l,a))return!1}}return!0}var q0=(e,t,n,i,s)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[i]:s||!0}}:{},ai=e=>Array.isArray(e)?e:[e],Ha=()=>{let e=[];return{get observers(){return e},next:s=>{for(const o of e)o.next&&o.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(o=>o!==s)}}),unsubscribe:()=>{e=[]}}};function G0(e,t){const n={};for(const i in e)if(e.hasOwnProperty(i)){const s=e[i],o=t[i];if(s&&We(s)&&o){const l=G0(s,o);We(l)&&(n[i]=l)}else e[i]&&(n[i]=o)}return n}var tt=e=>We(e)&&!Object.keys(e).length,Ol=e=>e.type==="file",yt=e=>typeof e=="function",gs=e=>{if(!Rl)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},K0=e=>e.type==="select-multiple",Pl=e=>e.type==="radio",h3=e=>Pl(e)||$i(e),kr=e=>gs(e)&&e.isConnected;function p3(e,t){const n=t.slice(0,-1).length;let i=0;for(;i<n;)e=He(e)?i++:e[t[i++]];return e}function m3(e){for(const t in e)if(e.hasOwnProperty(t)&&!He(e[t]))return!1;return!0}function Ve(e,t){const n=Array.isArray(t)?t:ir(t)?[t]:Ll(t),i=n.length===1?e:p3(e,n),s=n.length-1,o=n[s];return i&&delete i[o],s!==0&&(We(i)&&tt(i)||Array.isArray(i)&&m3(i))&&Ve(e,n.slice(0,-1)),e}var g3=e=>{for(const t in e)if(yt(e[t]))return!0;return!1};function X0(e){return Array.isArray(e)||We(e)&&!g3(e)}function Xr(e,t={}){for(const n in e){const i=e[n];X0(i)?(t[n]=Array.isArray(i)?[]:{},Xr(i,t[n])):He(i)||(t[n]=!0)}return t}function Sn(e,t,n){n||(n=Xr(t));for(const i in e){const s=e[i];if(X0(s))He(t)||Kr(n[i])?n[i]=Xr(s,Array.isArray(s)?[]:{}):Sn(s,nt(t)?{}:t[i],n[i]);else{const o=t[i];n[i]=!Gt(s,o)}}return n}const Va={value:!1,isValid:!1},Wa={value:!0,isValid:!0};var Q0=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!He(e[0].attributes.value)?He(e[0].value)||e[0].value===""?Wa:{value:e[0].value,isValid:!0}:Wa:Va}return Va},J0=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:i})=>He(e)?e:t?e===""?NaN:e&&+e:n&&ot(e)?new Date(e):i?i(e):e;const $a={isValid:!1,value:null};var ep=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,$a):$a;function Ua(e){const t=e.ref;return Ol(t)?t.files:Pl(t)?ep(e.refs).value:K0(t)?[...t.selectedOptions].map(({value:n})=>n):$i(t)?Q0(e.refs).value:J0(He(t.value)?e.ref.value:t.value,e)}var v3=(e,t,n,i)=>{const s={};for(const o of e){const l=ce(t,o);l&&Oe(s,o,l._f)}return{criteriaMode:n,names:[...e],fields:s,shouldUseNativeValidation:i}},vs=e=>e instanceof RegExp,ni=e=>He(e)?e:vs(e)?e.source:We(e)?vs(e.value)?e.value.source:e.value:e,Ya=e=>({isOnSubmit:!e||e===bt.onSubmit,isOnBlur:e===bt.onBlur,isOnChange:e===bt.onChange,isOnAll:e===bt.all,isOnTouch:e===bt.onTouched});const Za="AsyncFunction";var b3=e=>!!e&&!!e.validate&&!!(yt(e.validate)&&e.validate.constructor.name===Za||We(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===Za)),y3=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),qa=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(i=>e.startsWith(i)&&/^\.\w+/.test(e.slice(i.length))));const ci=(e,t,n,i)=>{for(const s of n||Object.keys(e)){const o=ce(e,s);if(o){const{_f:l,...a}=o;if(l){if(l.refs&&l.refs[0]&&t(l.refs[0],s)&&!i)return!0;if(l.ref&&t(l.ref,l.name)&&!i)return!0;if(ci(a,t))break}else if(We(a)&&ci(a,t))break}}};function Ga(e,t,n){const i=ce(e,n);if(i||ir(n))return{error:i,name:n};const s=n.split(".");for(;s.length;){const o=s.join("."),l=ce(t,o),a=ce(e,o);if(l&&!Array.isArray(l)&&n!==o)return{name:n};if(a&&a.type)return{name:o,error:a};if(a&&a.root&&a.root.type)return{name:`${o}.root`,error:a.root};s.pop()}return{name:n}}var x3=(e,t,n,i)=>{n(e);const{name:s,...o}=e;return tt(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(l=>t[l]===(!i||bt.all))},w3=(e,t,n)=>!e||!t||e===t||ai(e).some(i=>i&&(n?i===t:i.startsWith(t)||t.startsWith(i))),_3=(e,t,n,i,s)=>s.isOnAll?!1:!n&&s.isOnTouch?!(t||e):(n?i.isOnBlur:s.isOnBlur)?!e:(n?i.isOnChange:s.isOnChange)?e:!0,C3=(e,t)=>!Dl(ce(e,t)).length&&Ve(e,t),S3=(e,t,n)=>{const i=ai(ce(e,n));return Oe(i,"root",t[n]),Oe(e,n,i),e};function Ka(e,t,n="validate"){if(ot(e)||Array.isArray(e)&&e.every(ot)||Nt(e)&&!e)return{type:n,message:ot(e)?e:"",ref:t}}var _n=e=>We(e)&&!vs(e)?e:{value:e,message:""},Xa=async(e,t,n,i,s,o)=>{const{ref:l,refs:a,required:r,maxLength:f,minLength:d,min:h,max:b,pattern:_,validate:C,name:S,valueAsNumber:c,mount:u}=e._f,p=ce(n,S);if(!u||t.has(S))return{};const v=a?a[0]:l,y=M=>{s&&v.reportValidity&&(v.setCustomValidity(Nt(M)?"":M||""),v.reportValidity())},w={},x=Pl(l),E=$i(l),k=x||E,N=(c||Ol(l))&&He(l.value)&&He(p)||gs(l)&&l.value===""||p===""||Array.isArray(p)&&!p.length,T=q0.bind(null,S,i,w),R=(M,A,D,$=Bt.maxLength,H=Bt.minLength)=>{const j=M?A:D;w[S]={type:M?$:H,message:j,ref:l,...T(M?$:H,j)}};if(o?!Array.isArray(p)||!p.length:r&&(!k&&(N||nt(p))||Nt(p)&&!p||E&&!Q0(a).isValid||x&&!ep(a).isValid)){const{value:M,message:A}=ot(r)?{value:!!r,message:r}:_n(r);if(M&&(w[S]={type:Bt.required,message:A,ref:v,...T(Bt.required,A)},!i))return y(A),w}if(!N&&(!nt(h)||!nt(b))){let M,A;const D=_n(b),$=_n(h);if(!nt(p)&&!isNaN(p)){const H=l.valueAsNumber||p&&+p;nt(D.value)||(M=H>D.value),nt($.value)||(A=H<$.value)}else{const H=l.valueAsDate||new Date(p),j=O=>new Date(new Date().toDateString()+" "+O),F=l.type=="time",z=l.type=="week";ot(D.value)&&p&&(M=F?j(p)>j(D.value):z?p>D.value:H>new Date(D.value)),ot($.value)&&p&&(A=F?j(p)<j($.value):z?p<$.value:H<new Date($.value))}if((M||A)&&(R(!!M,D.message,$.message,Bt.max,Bt.min),!i))return y(w[S].message),w}if((f||d)&&!N&&(ot(p)||o&&Array.isArray(p))){const M=_n(f),A=_n(d),D=!nt(M.value)&&p.length>+M.value,$=!nt(A.value)&&p.length<+A.value;if((D||$)&&(R(D,M.message,A.message),!i))return y(w[S].message),w}if(_&&!N&&ot(p)){const{value:M,message:A}=_n(_);if(vs(M)&&!p.match(M)&&(w[S]={type:Bt.pattern,message:A,ref:l,...T(Bt.pattern,A)},!i))return y(A),w}if(C){if(yt(C)){const M=await C(p,n),A=Ka(M,v);if(A&&(w[S]={...A,...T(Bt.validate,A.message)},!i))return y(A.message),w}else if(We(C)){let M={};for(const A in C){if(!tt(M)&&!i)break;const D=Ka(await C[A](p,n),v,A);D&&(M={...D,...T(A,D.message)},y(D.message),i&&(w[S]=M))}if(!tt(M)&&(w[S]={ref:v,...M},!i))return w}}return y(!0),w};const E3={mode:bt.onSubmit,reValidateMode:bt.onChange,shouldFocusError:!0};function N3(e={}){let t={...E3,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:yt(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},i={},s=We(t.defaultValues)||We(t.values)?qe(t.defaultValues||t.values)||{}:{},o=t.shouldUnregister?{}:qe(s),l={action:!1,mount:!1,watch:!1},a={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},r,f=0;const d={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let h={...d};const b={array:Ha(),state:Ha()},_=t.criteriaMode===bt.all,C=I=>Y=>{clearTimeout(f),f=setTimeout(I,Y)},S=async I=>{if(!t.disabled&&(d.isValid||h.isValid||I)){const Y=t.resolver?tt((await E()).errors):await N(i,!0);Y!==n.isValid&&b.state.next({isValid:Y})}},c=(I,Y)=>{!t.disabled&&(d.isValidating||d.validatingFields||h.isValidating||h.validatingFields)&&((I||Array.from(a.mount)).forEach(q=>{q&&(Y?Oe(n.validatingFields,q,Y):Ve(n.validatingFields,q))}),b.state.next({validatingFields:n.validatingFields,isValidating:!tt(n.validatingFields)}))},u=(I,Y=[],q,re,ie=!0,te=!0)=>{if(re&&q&&!t.disabled){if(l.action=!0,te&&Array.isArray(ce(i,I))){const ae=q(ce(i,I),re.argA,re.argB);ie&&Oe(i,I,ae)}if(te&&Array.isArray(ce(n.errors,I))){const ae=q(ce(n.errors,I),re.argA,re.argB);ie&&Oe(n.errors,I,ae),C3(n.errors,I)}if((d.touchedFields||h.touchedFields)&&te&&Array.isArray(ce(n.touchedFields,I))){const ae=q(ce(n.touchedFields,I),re.argA,re.argB);ie&&Oe(n.touchedFields,I,ae)}(d.dirtyFields||h.dirtyFields)&&(n.dirtyFields=Sn(s,o)),b.state.next({name:I,isDirty:R(I,Y),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Oe(o,I,Y)},p=(I,Y)=>{Oe(n.errors,I,Y),b.state.next({errors:n.errors})},v=I=>{n.errors=I,b.state.next({errors:n.errors,isValid:!1})},y=(I,Y,q,re)=>{const ie=ce(i,I);if(ie){const te=ce(o,I,He(q)?ce(s,I):q);He(te)||re&&re.defaultChecked||Y?Oe(o,I,Y?te:Ua(ie._f)):D(I,te),l.mount&&!l.action&&S()}},w=(I,Y,q,re,ie)=>{let te=!1,ae=!1;const ve={name:I};if(!t.disabled){if(!q||re){(d.isDirty||h.isDirty)&&(ae=n.isDirty,n.isDirty=ve.isDirty=R(),te=ae!==ve.isDirty);const me=Gt(ce(s,I),Y);ae=!!ce(n.dirtyFields,I),me?Ve(n.dirtyFields,I):Oe(n.dirtyFields,I,!0),ve.dirtyFields=n.dirtyFields,te=te||(d.dirtyFields||h.dirtyFields)&&ae!==!me}if(q){const me=ce(n.touchedFields,I);me||(Oe(n.touchedFields,I,q),ve.touchedFields=n.touchedFields,te=te||(d.touchedFields||h.touchedFields)&&me!==q)}te&&ie&&b.state.next(ve)}return te?ve:{}},x=(I,Y,q,re)=>{const ie=ce(n.errors,I),te=(d.isValid||h.isValid)&&Nt(Y)&&n.isValid!==Y;if(t.delayError&&q?(r=C(()=>p(I,q)),r(t.delayError)):(clearTimeout(f),r=null,q?Oe(n.errors,I,q):Ve(n.errors,I)),(q?!Gt(ie,q):ie)||!tt(re)||te){const ae={...re,...te&&Nt(Y)?{isValid:Y}:{},errors:n.errors,name:I};n={...n,...ae},b.state.next(ae)}},E=async I=>{c(I,!0);const Y=await t.resolver(o,t.context,v3(I||a.mount,i,t.criteriaMode,t.shouldUseNativeValidation));return c(I),Y},k=async I=>{const{errors:Y}=await E(I);if(I)for(const q of I){const re=ce(Y,q);re?Oe(n.errors,q,re):Ve(n.errors,q)}else n.errors=Y;return Y},N=async(I,Y,q={valid:!0})=>{for(const re in I){const ie=I[re];if(ie){const{_f:te,...ae}=ie;if(te){const ve=a.array.has(te.name),me=ie._f&&b3(ie._f);me&&d.validatingFields&&c([te.name],!0);const xe=await Xa(ie,a.disabled,o,_,t.shouldUseNativeValidation&&!Y,ve);if(me&&d.validatingFields&&c([te.name]),xe[te.name]&&(q.valid=!1,Y))break;!Y&&(ce(xe,te.name)?ve?S3(n.errors,xe,te.name):Oe(n.errors,te.name,xe[te.name]):Ve(n.errors,te.name))}!tt(ae)&&await N(ae,Y,q)}}return q.valid},T=()=>{for(const I of a.unMount){const Y=ce(i,I);Y&&(Y._f.refs?Y._f.refs.every(q=>!kr(q)):!kr(Y._f.ref))&&V(I)}a.unMount=new Set},R=(I,Y)=>!t.disabled&&(I&&Y&&Oe(o,I,Y),!Gt(O(),s)),M=(I,Y,q)=>f3(I,a,{...l.mount?o:He(Y)?s:ot(I)?{[I]:Y}:Y},q,Y),A=I=>Dl(ce(l.mount?o:s,I,t.shouldUnregister?ce(s,I,[]):[])),D=(I,Y,q={})=>{const re=ce(i,I);let ie=Y;if(re){const te=re._f;te&&(!te.disabled&&Oe(o,I,J0(Y,te)),ie=gs(te.ref)&&nt(Y)?"":Y,K0(te.ref)?[...te.ref.options].forEach(ae=>ae.selected=ie.includes(ae.value)):te.refs?$i(te.ref)?te.refs.forEach(ae=>{(!ae.defaultChecked||!ae.disabled)&&(Array.isArray(ie)?ae.checked=!!ie.find(ve=>ve===ae.value):ae.checked=ie===ae.value||!!ie)}):te.refs.forEach(ae=>ae.checked=ae.value===ie):Ol(te.ref)?te.ref.value="":(te.ref.value=ie,te.ref.type||b.state.next({name:I,values:qe(o)})))}(q.shouldDirty||q.shouldTouch)&&w(I,ie,q.shouldTouch,q.shouldDirty,!0),q.shouldValidate&&z(I)},$=(I,Y,q)=>{for(const re in Y){if(!Y.hasOwnProperty(re))return;const ie=Y[re],te=I+"."+re,ae=ce(i,te);(a.array.has(I)||We(ie)||ae&&!ae._f)&&!cn(ie)?$(te,ie,q):D(te,ie,q)}},H=(I,Y,q={})=>{const re=ce(i,I),ie=a.array.has(I),te=qe(Y);Oe(o,I,te),ie?(b.array.next({name:I,values:qe(o)}),(d.isDirty||d.dirtyFields||h.isDirty||h.dirtyFields)&&q.shouldDirty&&b.state.next({name:I,dirtyFields:Sn(s,o),isDirty:R(I,te)})):re&&!re._f&&!nt(te)?$(I,te,q):D(I,te,q),qa(I,a)&&b.state.next({...n,name:I}),b.state.next({name:l.mount?I:void 0,values:qe(o)})},j=async I=>{l.mount=!0;const Y=I.target;let q=Y.name,re=!0;const ie=ce(i,q),te=me=>{re=Number.isNaN(me)||cn(me)&&isNaN(me.getTime())||Gt(me,ce(o,q,me))},ae=Ya(t.mode),ve=Ya(t.reValidateMode);if(ie){let me,xe;const Ae=Y.type?Ua(ie._f):r3(I),Ee=I.type===za.BLUR||I.type===za.FOCUS_OUT,Fe=!y3(ie._f)&&!t.resolver&&!ce(n.errors,q)&&!ie._f.deps||_3(Ee,ce(n.touchedFields,q),n.isSubmitted,ve,ae),Ie=qa(q,a,Ee);Oe(o,q,Ae),Ee?(!Y||!Y.readOnly)&&(ie._f.onBlur&&ie._f.onBlur(I),r&&r(0)):ie._f.onChange&&ie._f.onChange(I);const Ye=w(q,Ae,Ee),Ge=!tt(Ye)||Ie;if(!Ee&&b.state.next({name:q,type:I.type,values:qe(o)}),Fe)return(d.isValid||h.isValid)&&(t.mode==="onBlur"?Ee&&S():Ee||S()),Ge&&b.state.next({name:q,...Ie?{}:Ye});if(!Ee&&Ie&&b.state.next({...n}),t.resolver){const{errors:ze}=await E([q]);if(te(Ae),re){const Pt=Ga(n.errors,i,q),ut=Ga(ze,i,Pt.name||q);me=ut.error,q=ut.name,xe=tt(ze)}}else c([q],!0),me=(await Xa(ie,a.disabled,o,_,t.shouldUseNativeValidation))[q],c([q]),te(Ae),re&&(me?xe=!1:(d.isValid||h.isValid)&&(xe=await N(i,!0)));re&&(ie._f.deps&&(!Array.isArray(ie._f.deps)||ie._f.deps.length>0)&&z(ie._f.deps),x(q,xe,me,Ye))}},F=(I,Y)=>{if(ce(n.errors,Y)&&I.focus)return I.focus(),1},z=async(I,Y={})=>{let q,re;const ie=ai(I);if(t.resolver){const te=await k(He(I)?I:ie);q=tt(te),re=I?!ie.some(ae=>ce(te,ae)):q}else I?(re=(await Promise.all(ie.map(async te=>{const ae=ce(i,te);return await N(ae&&ae._f?{[te]:ae}:ae)}))).every(Boolean),!(!re&&!n.isValid)&&S()):re=q=await N(i);return b.state.next({...!ot(I)||(d.isValid||h.isValid)&&q!==n.isValid?{}:{name:I},...t.resolver||!I?{isValid:q}:{},errors:n.errors}),Y.shouldFocus&&!re&&ci(i,F,I?ie:a.mount),re},O=(I,Y)=>{let q={...l.mount?o:s};return Y&&(q=G0(Y.dirtyFields?n.dirtyFields:n.touchedFields,q)),He(I)?q:ot(I)?ce(q,I):I.map(re=>ce(q,re))},B=(I,Y)=>({invalid:!!ce((Y||n).errors,I),isDirty:!!ce((Y||n).dirtyFields,I),error:ce((Y||n).errors,I),isValidating:!!ce(n.validatingFields,I),isTouched:!!ce((Y||n).touchedFields,I)}),L=I=>{I&&ai(I).forEach(Y=>Ve(n.errors,Y)),b.state.next({errors:I?n.errors:{}})},U=(I,Y,q)=>{const re=(ce(i,I,{_f:{}})._f||{}).ref,ie=ce(n.errors,I)||{},{ref:te,message:ae,type:ve,...me}=ie;Oe(n.errors,I,{...me,...Y,ref:re}),b.state.next({name:I,errors:n.errors,isValid:!1}),q&&q.shouldFocus&&re&&re.focus&&re.focus()},P=(I,Y)=>yt(I)?b.state.subscribe({next:q=>"values"in q&&I(M(void 0,Y),q)}):M(I,Y,!0),W=I=>b.state.subscribe({next:Y=>{w3(I.name,Y.name,I.exact)&&x3(Y,I.formState||d,Re,I.reRenderRoot)&&I.callback({values:{...o},...n,...Y,defaultValues:s})}}).unsubscribe,Q=I=>(l.mount=!0,h={...h,...I.formState},W({...I,formState:h})),V=(I,Y={})=>{for(const q of I?ai(I):a.mount)a.mount.delete(q),a.array.delete(q),Y.keepValue||(Ve(i,q),Ve(o,q)),!Y.keepError&&Ve(n.errors,q),!Y.keepDirty&&Ve(n.dirtyFields,q),!Y.keepTouched&&Ve(n.touchedFields,q),!Y.keepIsValidating&&Ve(n.validatingFields,q),!t.shouldUnregister&&!Y.keepDefaultValue&&Ve(s,q);b.state.next({values:qe(o)}),b.state.next({...n,...Y.keepDirty?{isDirty:R()}:{}}),!Y.keepIsValid&&S()},X=({disabled:I,name:Y})=>{(Nt(I)&&l.mount||I||a.disabled.has(Y))&&(I?a.disabled.add(Y):a.disabled.delete(Y))},Z=(I,Y={})=>{let q=ce(i,I);const re=Nt(Y.disabled)||Nt(t.disabled);return Oe(i,I,{...q||{},_f:{...q&&q._f?q._f:{ref:{name:I}},name:I,mount:!0,...Y}}),a.mount.add(I),q?X({disabled:Nt(Y.disabled)?Y.disabled:t.disabled,name:I}):y(I,!0,Y.value),{...re?{disabled:Y.disabled||t.disabled}:{},...t.progressive?{required:!!Y.required,min:ni(Y.min),max:ni(Y.max),minLength:ni(Y.minLength),maxLength:ni(Y.maxLength),pattern:ni(Y.pattern)}:{},name:I,onChange:j,onBlur:j,ref:ie=>{if(ie){Z(I,Y),q=ce(i,I);const te=He(ie.value)&&ie.querySelectorAll&&ie.querySelectorAll("input,select,textarea")[0]||ie,ae=h3(te),ve=q._f.refs||[];if(ae?ve.find(me=>me===te):te===q._f.ref)return;Oe(i,I,{_f:{...q._f,...ae?{refs:[...ve.filter(kr),te,...Array.isArray(ce(s,I))?[{}]:[]],ref:{type:te.type,name:I}}:{ref:te}}}),y(I,!1,void 0,te)}else q=ce(i,I,{}),q._f&&(q._f.mount=!1),(t.shouldUnregister||Y.shouldUnregister)&&!(l3(a.array,I)&&l.action)&&a.unMount.add(I)}}},G=()=>t.shouldFocusError&&ci(i,F,a.mount),J=I=>{Nt(I)&&(b.state.next({disabled:I}),ci(i,(Y,q)=>{const re=ce(i,q);re&&(Y.disabled=re._f.disabled||I,Array.isArray(re._f.refs)&&re._f.refs.forEach(ie=>{ie.disabled=re._f.disabled||I}))},0,!1))},ee=(I,Y)=>async q=>{let re;q&&(q.preventDefault&&q.preventDefault(),q.persist&&q.persist());let ie=qe(o);if(b.state.next({isSubmitting:!0}),t.resolver){const{errors:te,values:ae}=await E();n.errors=te,ie=qe(ae)}else await N(i);if(a.disabled.size)for(const te of a.disabled)Ve(ie,te);if(Ve(n.errors,"root"),tt(n.errors)){b.state.next({errors:{}});try{await I(ie,q)}catch(te){re=te}}else Y&&await Y({...n.errors},q),G(),setTimeout(G);if(b.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:tt(n.errors)&&!re,submitCount:n.submitCount+1,errors:n.errors}),re)throw re},se=(I,Y={})=>{ce(i,I)&&(He(Y.defaultValue)?H(I,qe(ce(s,I))):(H(I,Y.defaultValue),Oe(s,I,qe(Y.defaultValue))),Y.keepTouched||Ve(n.touchedFields,I),Y.keepDirty||(Ve(n.dirtyFields,I),n.isDirty=Y.defaultValue?R(I,qe(ce(s,I))):R()),Y.keepError||(Ve(n.errors,I),d.isValid&&S()),b.state.next({...n}))},le=(I,Y={})=>{const q=I?qe(I):s,re=qe(q),ie=tt(I),te=ie?s:re;if(Y.keepDefaultValues||(s=q),!Y.keepValues){if(Y.keepDirtyValues){const ae=new Set([...a.mount,...Object.keys(Sn(s,o))]);for(const ve of Array.from(ae))ce(n.dirtyFields,ve)?Oe(te,ve,ce(o,ve)):H(ve,ce(te,ve))}else{if(Rl&&He(I))for(const ae of a.mount){const ve=ce(i,ae);if(ve&&ve._f){const me=Array.isArray(ve._f.refs)?ve._f.refs[0]:ve._f.ref;if(gs(me)){const xe=me.closest("form");if(xe){xe.reset();break}}}}if(Y.keepFieldsRef)for(const ae of a.mount)H(ae,ce(te,ae));else i={}}o=t.shouldUnregister?Y.keepDefaultValues?qe(s):{}:qe(te),b.array.next({values:{...te}}),b.state.next({values:{...te}})}a={mount:Y.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},l.mount=!d.isValid||!!Y.keepIsValid||!!Y.keepDirtyValues||!t.shouldUnregister&&!tt(te),l.watch=!!t.shouldUnregister,l.action=!1,Y.keepErrors||(n.errors={}),b.state.next({submitCount:Y.keepSubmitCount?n.submitCount:0,isDirty:ie?!1:Y.keepDirty?n.isDirty:!!(Y.keepDefaultValues&&!Gt(I,s)),isSubmitted:Y.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:ie?{}:Y.keepDirtyValues?Y.keepDefaultValues&&o?Sn(s,o):n.dirtyFields:Y.keepDefaultValues&&I?Sn(s,I):Y.keepDirty?n.dirtyFields:{},touchedFields:Y.keepTouched?n.touchedFields:{},errors:Y.keepErrors?n.errors:{},isSubmitSuccessful:Y.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:s})},ue=(I,Y)=>le(yt(I)?I(o):I,Y),Se=(I,Y={})=>{const q=ce(i,I),re=q&&q._f;if(re){const ie=re.refs?re.refs[0]:re.ref;ie.focus&&(ie.focus(),Y.shouldSelect&&yt(ie.select)&&ie.select())}},Re=I=>{n={...n,...I}},ke={control:{register:Z,unregister:V,getFieldState:B,handleSubmit:ee,setError:U,_subscribe:W,_runSchema:E,_focusError:G,_getWatch:M,_getDirty:R,_setValid:S,_setFieldArray:u,_setDisabledField:X,_setErrors:v,_getFieldArray:A,_reset:le,_resetDefaultValues:()=>yt(t.defaultValues)&&t.defaultValues().then(I=>{ue(I,t.resetOptions),b.state.next({isLoading:!1})}),_removeUnmounted:T,_disableForm:J,_subjects:b,_proxyFormState:d,get _fields(){return i},get _formValues(){return o},get _state(){return l},set _state(I){l=I},get _defaultValues(){return s},get _names(){return a},set _names(I){a=I},get _formState(){return n},get _options(){return t},set _options(I){t={...t,...I}}},subscribe:Q,trigger:z,register:Z,handleSubmit:ee,watch:P,setValue:H,getValues:O,reset:ue,resetField:se,clearErrors:L,unregister:V,setError:U,setFocus:Se,getFieldState:B};return{...ke,formControl:ke}}function k3(e={}){const t=K.useRef(void 0),n=K.useRef(void 0),[i,s]=K.useState({isDirty:!1,isValidating:!1,isLoading:yt(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:yt(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:i},e.defaultValues&&!yt(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:l,...a}=N3(e);t.current={...a,formState:i}}const o=t.current.control;return o._options=e,d3(()=>{const l=o._subscribe({formState:o._proxyFormState,callback:()=>s({...o._formState}),reRenderRoot:!0});return s(a=>({...a,isReady:!0})),o._formState.isReady=!0,l},[o]),K.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),K.useEffect(()=>{e.mode&&(o._options.mode=e.mode),e.reValidateMode&&(o._options.reValidateMode=e.reValidateMode)},[o,e.mode,e.reValidateMode]),K.useEffect(()=>{e.errors&&(o._setErrors(e.errors),o._focusError())},[o,e.errors]),K.useEffect(()=>{e.shouldUnregister&&o._subjects.state.next({values:o._getWatch()})},[o,e.shouldUnregister]),K.useEffect(()=>{if(o._proxyFormState.isDirty){const l=o._getDirty();l!==i.isDirty&&o._subjects.state.next({isDirty:l})}},[o,i.isDirty]),K.useEffect(()=>{var l;e.values&&!Gt(e.values,n.current)?(o._reset(e.values,{keepFieldsRef:!0,...o._options.resetOptions}),!((l=o._options.resetOptions)===null||l===void 0)&&l.keepIsValid||o._setValid(),n.current=e.values,s(a=>({...a}))):o._resetDefaultValues()},[o,e.values]),K.useEffect(()=>{o._state.mount||(o._setValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),t.current.formState=u3(i,o),t.current}const Qa=(e,t,n)=>{if(e&&"reportValidity"in e){const i=ce(n,t);e.setCustomValidity(i&&i.message||""),e.reportValidity()}},tp=(e,t)=>{for(const n in t.fields){const i=t.fields[n];i&&i.ref&&"reportValidity"in i.ref?Qa(i.ref,n,e):i.refs&&i.refs.forEach(s=>Qa(s,n,e))}},T3=(e,t)=>{t.shouldUseNativeValidation&&tp(e,t);const n={};for(const i in e){const s=ce(t.fields,i),o=Object.assign(e[i]||{},{ref:s&&s.ref});if(M3(t.names||Object.keys(e),i)){const l=Object.assign({},ce(n,i));Oe(l,"root",o),Oe(n,i,l)}else Oe(n,i,o)}return n},M3=(e,t)=>e.some(n=>n.startsWith(t+"."));var A3=function(e,t){for(var n={};e.length;){var i=e[0],s=i.code,o=i.message,l=i.path.join(".");if(!n[l])if("unionErrors"in i){var a=i.unionErrors[0].errors[0];n[l]={message:a.message,type:a.code}}else n[l]={message:o,type:s};if("unionErrors"in i&&i.unionErrors.forEach(function(d){return d.errors.forEach(function(h){return e.push(h)})}),t){var r=n[l].types,f=r&&r[i.code];n[l]=q0(l,t,n,s,f?[].concat(f,i.message):i.message)}e.shift()}return n},R3=function(e,t,n){return n===void 0&&(n={}),function(i,s,o){try{return Promise.resolve(function(l,a){try{var r=Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](i,t)).then(function(f){return o.shouldUseNativeValidation&&tp({},o),{errors:{},values:n.raw?i:f}})}catch(f){return a(f)}return r&&r.then?r.then(void 0,a):r}(0,function(l){if(function(a){return Array.isArray(a==null?void 0:a.errors)}(l))return{values:{},errors:T3(A3(l.errors,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw l}))}catch(l){return Promise.reject(l)}}};const np=({useStore:e,fields:t=[],defaultValues:n={},validationSchema:i,children:s,onSubmit:o,onCancel:l,onBack:a,onBeforeSubmit:r,initialData:f=null,loading:d=!1,submitting:h=!1,title:b,description:_,submitLabel:C="Save",cancelLabel:S="Cancel",backLabel:c="Back",columns:u=1,showHeader:p=!0,showFooter:v=!0,showBack:y=!0,showCard:w=!0,listPath:x,icon:E,className:k,...N})=>{var ke;const T=Je.useNavigate(),{id:R}=Je.useParams(),M=!!R,A=e==null?void 0:e(),D=A==null?void 0:A.form,$=(A==null?void 0:A.loading)??!1,H=((ke=A==null?void 0:A.form)==null?void 0:ke.isSubmitting)??!1,j=(A==null?void 0:A.fetchAndPopulateForm)||(A==null?void 0:A.fetchById)||(A==null?void 0:A.fetchOne),F=A==null?void 0:A.create,z=A==null?void 0:A.update,O=A==null?void 0:A.resetForm,B=d||$,L=h||H;m.useEffect(()=>(M&&R&&j&&j(R),()=>{O==null||O()}),[R,M]);const U=()=>{a?a():T(x||-1)},P=()=>{l?l():U()},W=async I=>{var Y;(Y=I==null?void 0:I.preventDefault)==null||Y.call(I);try{let q=(D==null?void 0:D.values)||{};r&&(q=r(q)),M?await(z==null?void 0:z(R,q)):await(F==null?void 0:F(q)),U()}catch(q){console.error("Form submission error:",q)}};if(e&&s){const I=M?`Edit ${b}`:`Create ${b}`,Y=g.jsxs("form",{onSubmit:W,children:[s,v&&g.jsxs("div",{className:"flex items-center justify-end gap-2 mt-6 pt-4 border-t",children:[g.jsxs(we,{type:"button",variant:"outline",onClick:P,disabled:L,children:[g.jsx(Mn,{className:"mr-2 h-4 w-4"}),S]}),g.jsx(we,{type:"submit",disabled:L||B,children:L?g.jsxs(g.Fragment,{children:[g.jsx(un,{className:"mr-2 h-4 w-4 animate-spin"}),"Saving..."]}):g.jsxs(g.Fragment,{children:[g.jsx(Zl,{className:"mr-2 h-4 w-4"}),C]})})]})]});return w?g.jsxs(ft,{className:k,...N,children:[g.jsx(An,{children:g.jsxs("div",{className:"flex items-center gap-4",children:[y&&g.jsx(we,{variant:"ghost",size:"icon",onClick:U,children:g.jsx(Ft,{className:"h-4 w-4"})}),E&&g.jsx("div",{className:"h-10 w-10 rounded-full bg-primary/10 flex items-center justify-center",children:g.jsx(E,{className:"h-5 w-5 text-primary"})}),g.jsxs("div",{children:[g.jsx(Rn,{children:I}),_&&g.jsx(Dn,{children:_})]})]})}),g.jsx(ht,{children:Y})]}):g.jsxs("div",{className:ne("space-y-6",k),...N,children:[g.jsxs("div",{className:"flex items-center gap-4",children:[y&&g.jsx(we,{variant:"ghost",size:"icon",onClick:U,children:g.jsx(Ft,{className:"h-4 w-4"})}),E&&g.jsx("div",{className:"h-10 w-10 rounded-full bg-primary/10 flex items-center justify-center",children:g.jsx(E,{className:"h-5 w-5 text-primary"})}),g.jsxs("div",{children:[g.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:I}),_&&g.jsx("p",{className:"text-muted-foreground",children:_})]})]}),Y]})}const Q=k3({defaultValues:f||n,resolver:i?R3(i):void 0,mode:"onBlur"}),{handleSubmit:V,formState:{errors:X,isDirty:Z,isValid:G},reset:J,watch:ee,setValue:se,control:le}=Q;m.useEffect(()=>{f&&J(f)},[f,J]);const ue=async I=>{try{await(o==null?void 0:o(I))}catch(Y){console.error("Form submission error:",Y)}},Se=I=>{var Ye;const{name:Y,type:q="text",label:re,placeholder:ie,description:te,required:ae,disabled:ve,options:me=[],className:xe,...Ae}=I,Ee=(Ye=X[Y])==null?void 0:Ye.message,Fe=ee(Y),Ie={label:re,placeholder:ie,description:te,error:Ee,required:ae,disabled:ve||B||L,className:xe};switch(q){case"text":case"email":case"password":case"number":case"url":case"tel":return g.jsx(ms,{...Ie,type:q,...Q.register(Y),...Ae});case"textarea":return g.jsx(_l,{...Ie,...Q.register(Y),...Ae});case"select":return g.jsx(Cl,{...Ie,options:me,value:Fe,onChange:Ge=>se(Y,Ge,{shouldValidate:!0}),...Ae});case"search-select":return g.jsx(Sl,{...Ie,options:me,value:Fe,onChange:Ge=>se(Y,Ge,{shouldValidate:!0}),...Ae});case"switch":return g.jsx(El,{...Ie,checked:Fe,onCheckedChange:Ge=>se(Y,Ge,{shouldValidate:!0}),...Ae});case"checkbox":return g.jsx(Nl,{...Ie,checked:Fe,onCheckedChange:Ge=>se(Y,Ge,{shouldValidate:!0}),...Ae});case"custom":return I.render?I.render({form:Q,field:I,error:Ee,value:Fe}):null;default:return g.jsx(ms,{...Ie,type:"text",...Q.register(Y),...Ae})}},Re=ne("grid gap-4",u===1&&"grid-cols-1",u===2&&"grid-cols-1 md:grid-cols-2",u===3&&"grid-cols-1 md:grid-cols-2 lg:grid-cols-3",u===4&&"grid-cols-1 md:grid-cols-2 lg:grid-cols-4"),ge=g.jsxs("form",{onSubmit:V(ue),children:[g.jsx("div",{className:Re,children:t.map(I=>{if(I.hidden&&(typeof I.hidden=="function"?I.hidden(ee()):I.hidden))return null;const Y=I.colSpan||1,q=ne(Y===2&&"md:col-span-2",Y===3&&"md:col-span-2 lg:col-span-3",Y===4&&"md:col-span-2 lg:col-span-4",Y==="full"&&"col-span-full");return g.jsx("div",{className:q,children:Se(I)},I.name)})}),v&&g.jsxs("div",{className:"flex items-center justify-end gap-2 mt-6 pt-4 border-t",children:[l&&g.jsxs(we,{type:"button",variant:"outline",onClick:l,disabled:L,children:[g.jsx(Mn,{className:"mr-2 h-4 w-4"}),S]}),g.jsx(we,{type:"submit",disabled:L||B,children:L?g.jsxs(g.Fragment,{children:[g.jsx(un,{className:"mr-2 h-4 w-4 animate-spin"}),"Saving..."]}):g.jsxs(g.Fragment,{children:[g.jsx(Zl,{className:"mr-2 h-4 w-4"}),C]})})]})]});return p&&(b||_||y)?g.jsxs(ft,{className:k,...N,children:[g.jsx(An,{children:g.jsxs("div",{className:"flex items-center gap-4",children:[y&&a&&g.jsx(we,{variant:"ghost",size:"icon",onClick:a,children:g.jsx(Ft,{className:"h-4 w-4"})}),g.jsxs("div",{children:[b&&g.jsx(Rn,{children:b}),_&&g.jsx(Dn,{children:_})]})]})}),g.jsx(ht,{children:ge})]}):g.jsx("div",{className:k,...N,children:ge})};np.displayName="CrudForm";const ip=({useStore:e,children:t,data:n=null,loading:i=!1,error:s=null,fields:o=[],onBack:l,onEdit:a,onDelete:r,listPath:f,editPath:d,title:h,description:b,editLabel:_="Edit",deleteLabel:C="Delete",backLabel:S="Back",itemName:c="item",getItemName:u,showHeader:p=!0,showMeta:v=!0,showCard:y=!0,columns:w=2,icon:x,className:E,...k})=>{const N=Je.useNavigate(),{id:T}=Je.useParams(),R=e==null?void 0:e(),M=R==null?void 0:R.currentItem,A=(R==null?void 0:R.loading)??!1,D=R==null?void 0:R.error,$=(R==null?void 0:R.fetchById)||(R==null?void 0:R.fetchOne),H=R==null?void 0:R.delete,j=n||M,F=i||A,z=s||D,[O,B]=m.useState(!1),[L,U]=m.useState(!1);m.useEffect(()=>{T&&$&&$(T)},[T]);const P=()=>{l?l():N(f||-1)},W=()=>{a?a(j):d&&T&&N(`${d}/${T}/edit`)},Q=async()=>{U(!0);try{r?await r(j):H&&T&&(await H(T),P()),B(!1)}catch(ee){console.error("Delete error:",ee)}finally{U(!1)}},V=j&&u?u(j):(j==null?void 0:j.name)||(j==null?void 0:j.title)||c,X=(ee,se)=>{if(ee.render)return j?ee.render(se,j):g.jsx("span",{className:"text-muted-foreground",children:"-"});if(se==null||se==="")return g.jsx("span",{className:"text-muted-foreground",children:"-"});switch(ee.type){case"badge":return g.jsx(ii,{variant:ee.variant||"default",children:ee.format?ee.format(se):String(se)});case"status":const le={active:"success",inactive:"secondary",pending:"warning",error:"destructive",...ee.statusColors};return g.jsx(ii,{variant:le[se==null?void 0:se.toLowerCase()]||"default",children:ee.format?ee.format(se):String(se)});case"boolean":const ue=!!se;return g.jsx(ii,{variant:ue?"success":"secondary",children:ue?ee.trueLabel||"Yes":ee.falseLabel||"No"});case"date":return Jr(se);case"datetime":return Ji(se);case"currency":return new Intl.NumberFormat("en-US",{style:"currency",currency:ee.currency||"USD"}).format(se);case"number":return ee.format?ee.format(se):new Intl.NumberFormat().format(se);case"list":return Array.isArray(se)?g.jsx("div",{className:"flex flex-wrap gap-1",children:se.map((Se,Re)=>g.jsx(ii,{variant:"outline",children:ee.getItemLabel?ee.getItemLabel(Se):String(Se)},Re))}):String(se);case"link":return g.jsx("a",{href:se,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:ee.linkText||se});case"email":return g.jsx("a",{href:`mailto:${se}`,className:"text-primary hover:underline",children:se});case"phone":return g.jsx("a",{href:`tel:${se}`,className:"text-primary hover:underline",children:se});case"image":return g.jsx("img",{src:se,alt:ee.label||"Image",className:ne("rounded-md object-cover",ee.imageClassName||"h-20 w-20")});case"html":return g.jsx("div",{className:"prose prose-sm max-w-none",dangerouslySetInnerHTML:{__html:se}});default:return ee.format?ee.format(se):String(se)}},Z=ee=>{if(j)return ee.accessor?typeof ee.accessor=="function"?ee.accessor(j):j[ee.accessor]:j[ee.name]},G=ne("grid gap-6",w===1&&"grid-cols-1",w===2&&"grid-cols-1 md:grid-cols-2",w===3&&"grid-cols-1 md:grid-cols-2 lg:grid-cols-3"),J=g.jsxs(g.Fragment,{children:[g.jsx("div",{className:G,children:o.map(ee=>{if(ee.hidden&&(typeof ee.hidden=="function"?j&&ee.hidden(j):ee.hidden))return null;const se=Z(ee),le=ee.colSpan||1,ue=ne(le===2&&"md:col-span-2",le===3&&"lg:col-span-3",le==="full"&&"col-span-full");return g.jsxs("div",{className:ue,children:[g.jsxs("dt",{className:"text-sm font-medium text-muted-foreground mb-1",children:[ee.icon&&g.jsx(ee.icon,{className:"inline-block mr-2 h-4 w-4"}),ee.label]}),g.jsx("dd",{className:"text-sm",children:X(ee,se)})]},ee.name||ee.accessor)})}),v&&j&&(j.created_at||j.updated_at||j.createdAt||j.updatedAt)&&g.jsxs(g.Fragment,{children:[g.jsx(Si,{className:"my-6"}),g.jsxs("div",{className:"flex flex-wrap gap-6 text-sm text-muted-foreground",children:[(j.created_at||j.createdAt)&&(j.created_at||j.createdAt)!==""&&g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(ss,{className:"h-4 w-4"}),g.jsxs("span",{children:["Created: ",Ji(j.created_at||j.createdAt)]})]}),(j.updated_at||j.updatedAt)&&(j.updated_at||j.updatedAt)!==""&&g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(ss,{className:"h-4 w-4"}),g.jsxs("span",{children:["Updated: ",Ji(j.updated_at||j.updatedAt)]})]}),(j.id||j._id)&&g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(Cm,{className:"h-4 w-4"}),g.jsxs("span",{children:["ID: ",j.id||j._id]})]})]})]})]});return e&&t&&typeof t=="function"?F?g.jsx("div",{className:ne("space-y-6",E),children:g.jsx(ft,{children:g.jsx(ht,{className:"py-12",children:g.jsx(zn,{text:`Loading ${c}...`})})})}):z?g.jsx("div",{className:ne("space-y-6",E),children:g.jsx(ft,{children:g.jsxs(ht,{className:"py-12 text-center",children:[g.jsx("p",{className:"text-destructive",children:(z==null?void 0:z.message)||"An error occurred"}),g.jsxs(we,{variant:"outline",onClick:P,className:"mt-4",children:[g.jsx(Ft,{className:"mr-2 h-4 w-4"}),S]})]})})}):j?g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:ne("space-y-6",E),...k,children:[p&&g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsxs("div",{className:"flex items-center gap-4",children:[g.jsx(we,{variant:"ghost",size:"icon",onClick:P,children:g.jsx(Ft,{className:"h-4 w-4"})}),x&&g.jsx("div",{className:"h-10 w-10 rounded-full bg-primary/10 flex items-center justify-center",children:g.jsx(x,{className:"h-5 w-5 text-primary"})}),g.jsxs("div",{children:[g.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:h}),b&&g.jsx("p",{className:"text-muted-foreground",children:b})]})]}),g.jsxs("div",{className:"flex items-center gap-2",children:[(a||d)&&g.jsxs(we,{variant:"outline",onClick:W,children:[g.jsx(Mr,{className:"mr-2 h-4 w-4"}),_]}),(r||H)&&g.jsxs(we,{variant:"destructive",onClick:()=>B(!0),children:[g.jsx(Ar,{className:"mr-2 h-4 w-4"}),C]})]})]}),t(j)]}),g.jsx(xi,{open:O,onOpenChange:B,onConfirm:Q,itemName:V,loading:L})]}):g.jsx("div",{className:ne("space-y-6",E),children:g.jsx(ft,{children:g.jsxs(ht,{className:"py-12 text-center",children:[g.jsxs("p",{className:"text-muted-foreground",children:["No ",c," found"]}),g.jsxs(we,{variant:"outline",onClick:P,className:"mt-4",children:[g.jsx(Ft,{className:"mr-2 h-4 w-4"}),S]})]})})}):F?g.jsx(ft,{className:E,children:g.jsx(ht,{className:"py-12",children:g.jsx(zn,{text:`Loading ${c}...`})})}):z?g.jsx(ft,{className:E,children:g.jsxs(ht,{className:"py-12 text-center",children:[g.jsx("p",{className:"text-destructive",children:(z==null?void 0:z.message)||"An error occurred"}),g.jsxs(we,{variant:"outline",onClick:P,className:"mt-4",children:[g.jsx(Ft,{className:"mr-2 h-4 w-4"}),S]})]})}):j?g.jsxs(g.Fragment,{children:[g.jsxs(ft,{className:E,...k,children:[p&&g.jsxs(An,{className:"flex flex-row items-center justify-between space-y-0 pb-4",children:[g.jsxs("div",{className:"flex items-center gap-4",children:[g.jsx(we,{variant:"ghost",size:"icon",onClick:P,children:g.jsx(Ft,{className:"h-4 w-4"})}),g.jsxs("div",{children:[h&&g.jsx(Rn,{children:h}),b&&g.jsx(Dn,{children:b})]})]}),g.jsxs("div",{className:"flex items-center gap-2",children:[(a||d)&&g.jsxs(we,{variant:"outline",onClick:W,children:[g.jsx(Mr,{className:"mr-2 h-4 w-4"}),_]}),(r||H)&&g.jsxs(we,{variant:"destructive",onClick:()=>B(!0),children:[g.jsx(Ar,{className:"mr-2 h-4 w-4"}),C]})]})]}),g.jsx(ht,{children:J})]}),g.jsx(xi,{open:O,onOpenChange:B,onConfirm:Q,itemName:V,loading:L})]}):g.jsx(ft,{className:E,children:g.jsxs(ht,{className:"py-12 text-center",children:[g.jsxs("p",{className:"text-muted-foreground",children:["No ",c," found"]}),g.jsxs(we,{variant:"outline",onClick:P,className:"mt-4",children:[g.jsx(Ft,{className:"mr-2 h-4 w-4"}),S]})]})})};ip.displayName="CrudDetail";const sp=e=>{const{name:t="crud",apiClient:n,endpoint:i,transformResponse:s=h=>h,transformRequest:o=h=>h,initialState:l={},extraActions:a={},idField:r="id",listKey:f="results",countKey:d="count"}=e;if(!n)throw new Error("createCrudStore: apiClient is required");if(!i)throw new Error("createCrudStore: endpoint is required");return h=>h((b,_)=>({items:[],item:null,loading:!1,submitting:!1,error:null,page:1,pageSize:10,totalItems:0,totalPages:0,sortColumn:null,sortDirection:null,search:"",filters:{},selectedIds:[],...l,setPage:C=>b({page:C}),setPageSize:C=>b({pageSize:C,page:1}),setSearch:C=>b({search:C,page:1}),setFilters:C=>b({filters:C,page:1}),setSort:(C,S)=>b({sortColumn:C,sortDirection:S}),setSelectedIds:C=>b({selectedIds:C}),clearSelection:()=>b({selectedIds:[]}),clearError:()=>b({error:null}),reset:()=>b({items:[],item:null,loading:!1,submitting:!1,error:null,page:1,search:"",filters:{},selectedIds:[]}),fetchList:async(C={})=>{var c,u,p,v;const S=_();b({loading:!0,error:null});try{const y={page:S.page,page_size:S.pageSize,search:S.search||void 0,ordering:S.sortColumn?`${S.sortDirection==="desc"?"-":""}${S.sortColumn}`:void 0,...S.filters,...C};Object.keys(y).forEach(T=>{(y[T]===void 0||y[T]==="")&&delete y[T]});const x=(await n.get(i,{params:y})).data,E=x[f]||x.data||(Array.isArray(x)?x:[]),k=x[d]||x.total||E.length,N=Math.ceil(k/S.pageSize);return b({items:E.map(s),totalItems:k,totalPages:N,loading:!1}),{items:E,totalItems:k,totalPages:N}}catch(y){const w=((u=(c=y.response)==null?void 0:c.data)==null?void 0:u.message)||((v=(p=y.response)==null?void 0:p.data)==null?void 0:v.detail)||y.message||"Failed to fetch items";throw b({error:{message:w,original:y},loading:!1}),y}},fetchOne:async C=>{var S,c,u,p;b({loading:!0,error:null,item:null});try{const v=await n.get(`${i}/${C}/`),y=s(v.data);return b({item:y,loading:!1}),y}catch(v){const y=((c=(S=v.response)==null?void 0:S.data)==null?void 0:c.message)||((p=(u=v.response)==null?void 0:u.data)==null?void 0:p.detail)||v.message||"Failed to fetch item";throw b({error:{message:y,original:v},loading:!1}),v}},create:async C=>{var S,c,u,p,v;b({submitting:!0,error:null});try{const y=o(C),w=await n.post(`${i}/`,y),x=s(w.data);return b(E=>({items:[x,...E.items],totalItems:E.totalItems+1,submitting:!1})),x}catch(y){const w=((c=(S=y.response)==null?void 0:S.data)==null?void 0:c.message)||((p=(u=y.response)==null?void 0:u.data)==null?void 0:p.detail)||y.message||"Failed to create item",x=((v=y.response)==null?void 0:v.data)||{};throw b({error:{message:w,fieldErrors:x,original:y},submitting:!1}),y}},update:async(C,S)=>{var c,u,p,v,y;b({submitting:!0,error:null});try{const w=o(S),x=await n.patch(`${i}/${C}/`,w),E=s(x.data);return b(k=>{var N;return{items:k.items.map(T=>T[r]===C?E:T),item:((N=k.item)==null?void 0:N[r])===C?E:k.item,submitting:!1}}),E}catch(w){const x=((u=(c=w.response)==null?void 0:c.data)==null?void 0:u.message)||((v=(p=w.response)==null?void 0:p.data)==null?void 0:v.detail)||w.message||"Failed to update item",E=((y=w.response)==null?void 0:y.data)||{};throw b({error:{message:x,fieldErrors:E,original:w},submitting:!1}),w}},delete:async C=>{var S,c,u,p;b({submitting:!0,error:null});try{return await n.delete(`${i}/${C}/`),b(v=>{var y;return{items:v.items.filter(w=>w[r]!==C),totalItems:v.totalItems-1,item:((y=v.item)==null?void 0:y[r])===C?null:v.item,selectedIds:v.selectedIds.filter(w=>w!==C),submitting:!1}}),!0}catch(v){const y=((c=(S=v.response)==null?void 0:S.data)==null?void 0:c.message)||((p=(u=v.response)==null?void 0:u.data)==null?void 0:p.detail)||v.message||"Failed to delete item";throw b({error:{message:y,original:v},submitting:!1}),v}},bulkDelete:async C=>{var S,c,u,p;b({submitting:!0,error:null});try{return await Promise.all(C.map(v=>n.delete(`${i}/${v}/`))),b(v=>({items:v.items.filter(y=>!C.includes(y[r])),totalItems:v.totalItems-C.length,selectedIds:[],submitting:!1})),!0}catch(v){const y=((c=(S=v.response)==null?void 0:S.data)==null?void 0:c.message)||((p=(u=v.response)==null?void 0:u.data)==null?void 0:p.detail)||v.message||"Failed to delete items";throw b({error:{message:y,original:v},submitting:!1}),v}},replace:async(C,S)=>{var c,u,p,v,y;b({submitting:!0,error:null});try{const w=o(S),x=await n.put(`${i}/${C}/`,w),E=s(x.data);return b(k=>{var N;return{items:k.items.map(T=>T[r]===C?E:T),item:((N=k.item)==null?void 0:N[r])===C?E:k.item,submitting:!1}}),E}catch(w){const x=((u=(c=w.response)==null?void 0:c.data)==null?void 0:u.message)||((v=(p=w.response)==null?void 0:p.data)==null?void 0:v.detail)||w.message||"Failed to update item",E=((y=w.response)==null?void 0:y.data)||{};throw b({error:{message:x,fieldErrors:E,original:w},submitting:!1}),w}},...a}))},D3=e=>{const{create:t}=require("zustand");return t(sp(e))};function L3({brandName:e="Your Brand",brandLogo:t,brandDescription:n="Welcome back",quote:i,quoteAuthor:s,copyright:o,leftPanelClassName:l,rightPanelClassName:a,leftPanelContent:r,rightPanelContent:f,showLeftPanel:d=!0,children:h}){const b=new Date().getFullYear(),_=o||`© ${b} ${e}. All rights reserved.`,C=g.jsxs("div",{className:"flex flex-col h-full p-8 lg:p-12 text-white",children:[g.jsxs("div",{className:"flex items-center gap-3",children:[t||g.jsx("div",{className:"h-10 w-10 rounded-lg bg-white/20 flex items-center justify-center",children:g.jsx("span",{className:"text-white font-bold text-xl",children:e.charAt(0)})}),g.jsx("span",{className:"text-xl font-semibold",children:e})]}),g.jsxs("div",{className:"flex-1 flex items-center justify-center",children:[i&&g.jsxs("div",{className:"max-w-md",children:[g.jsxs("blockquote",{className:"text-2xl lg:text-3xl font-light leading-relaxed",children:['"',i,'"']}),s&&g.jsxs("p",{className:"mt-4 text-white/70",children:["— ",s]})]}),!i&&n&&g.jsx("div",{className:"text-center",children:g.jsx("p",{className:"text-2xl lg:text-3xl font-light",children:n})})]}),g.jsx("div",{className:"text-sm text-white/60",children:_})]});return g.jsxs("div",{className:"min-h-screen flex",children:[d&&g.jsx("div",{className:ne("hidden lg:flex lg:w-1/2 bg-gray-900",l),children:r||C}),g.jsx("div",{className:ne("w-full flex items-center justify-center p-8",d?"lg:w-1/2":"",a),children:g.jsx("div",{className:"w-full max-w-md",children:f||h||g.jsx(Je.Outlet,{})})})]})}function O3({onSubmit:e,isLoading:t=!1,error:n,title:i="Login",subtitle:s="Enter your email below to login to your account",emailLabel:o="Email",emailPlaceholder:l="m@example.com",passwordLabel:a="Password",rememberMeLabel:r="Remember me",forgotPasswordText:f="Forgot your password?",forgotPasswordPath:d="/forgot-password",submitButtonText:h="Login",signUpText:b="Don't have an account?",signUpLinkText:_="Sign up",signUpPath:C="/register",showRememberMe:S=!0,showForgotPassword:c=!0,showSignUp:u=!0,logo:p,className:v,children:y}){const[w,x]=K.useState(""),[E,k]=K.useState(""),[N,T]=K.useState(!1),R=async M=>{M.preventDefault(),e&&await e({email:w,password:E,rememberMe:N})};return g.jsxs("div",{className:ne("space-y-6",v),children:[p&&g.jsx("div",{className:"flex justify-center",children:p}),g.jsxs("div",{className:"space-y-2 text-center",children:[g.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:i}),s&&g.jsx("p",{className:"text-sm text-muted-foreground",children:s})]}),n&&g.jsx("div",{className:"p-3 text-sm text-destructive bg-destructive/10 rounded-md",children:n}),g.jsxs("form",{onSubmit:R,className:"space-y-4",children:[g.jsxs("div",{className:"space-y-2",children:[g.jsx(Kt,{htmlFor:"email",children:o}),g.jsx(Ln,{id:"email",type:"email",placeholder:l,value:w,onChange:M=>x(M.target.value),required:!0,autoComplete:"email"})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsx(Kt,{htmlFor:"password",children:a}),c&&d&&g.jsx(Je.Link,{to:d,className:"text-sm text-muted-foreground hover:text-primary underline-offset-4 hover:underline",children:f})]}),g.jsx(Ln,{id:"password",type:"password",value:E,onChange:M=>k(M.target.value),required:!0,autoComplete:"current-password"})]}),S&&g.jsxs("div",{className:"flex items-center space-x-2",children:[g.jsx(On,{id:"remember",checked:N,onCheckedChange:T}),g.jsx(Kt,{htmlFor:"remember",className:"text-sm font-normal cursor-pointer",children:r})]}),y,g.jsx(we,{type:"submit",className:"w-full",disabled:t,children:t?"Signing in...":h})]}),u&&C&&g.jsxs("div",{className:"text-center text-sm text-muted-foreground",children:[b," ",g.jsx(Je.Link,{to:C,className:"text-primary underline-offset-4 hover:underline",children:_})]})]})}const rp=K.createContext(null);function sr(){const e=K.useContext(rp);if(!e)throw new Error("useSidebarContext must be used within a SidebarProvider");return e}function op({defaultOpen:e=!1,defaultCollapsed:t=!1,children:n}){const[i,s]=K.useState(e),[o,l]=K.useState(t),a=K.useCallback(()=>{s(b=>!b)},[]),r=K.useCallback(b=>{s(b)},[]),f=K.useCallback(()=>{l(b=>!b)},[]),d=K.useCallback(b=>{l(b)},[]),h={isOpen:i,isCollapsed:o,toggle:a,setOpen:r,toggleCollapse:f,setCollapsed:d};return g.jsx(rp.Provider,{value:h,children:n})}function lp({items:e=[],brandName:t="Brand",brandLogo:n,brandPath:i="/dashboard",user:s,onLogout:o,userMenuItems:l=[],showUserProfile:a=!0,className:r,collapsedWidth:f="w-16",expandedWidth:d="w-60",renderItem:h,headerSlot:b,footerSlot:_}){var N,T;const{isOpen:C,isCollapsed:S,setOpen:c,toggleCollapse:u}=sr(),p=Je.useLocation(),[v,y]=K.useState([]),w=R=>{y(M=>M.includes(R)?M.filter(A=>A!==R):[...M,R])},x=(R,M=!1)=>{if(R.title)return g.jsxs("div",{className:"mt-6",children:[!S&&g.jsx("h3",{className:"px-3 text-xs font-medium text-sidebar-foreground/50 uppercase tracking-wider mb-2",children:R.title}),S&&g.jsx(Si,{className:"my-3 bg-sidebar-border"})]},R.title);if(h)return h(R,{isCollapsed:S,isSubItem:M,location:p});const A=R.icon,D=R.children&&R.children.length>0,$=v.includes(R.label),H=R.path&&(p.pathname===R.path||p.pathname.startsWith(R.path+"/")),j=D&&R.children.some(F=>p.pathname===F.path||p.pathname.startsWith(F.path+"/"));return D?g.jsxs("div",{children:[g.jsxs("button",{onClick:()=>w(R.label),className:ne("w-full flex items-center gap-3 px-3 py-2 rounded-lg transition-colors text-sm",j?"bg-sidebar-accent text-sidebar-accent-foreground":"hover:bg-sidebar-accent text-sidebar-foreground hover:text-sidebar-accent-foreground",S&&"justify-center px-2"),title:S?R.label:void 0,children:[A&&g.jsx(A,{className:"h-4 w-4 flex-shrink-0"}),!S&&g.jsxs(g.Fragment,{children:[g.jsx("span",{className:"flex-1 text-left",children:R.label}),g.jsx(ys,{className:ne("h-4 w-4 transition-transform",$&&"rotate-180")})]})]}),!S&&$&&g.jsx("div",{className:"ml-4 mt-1 space-y-0.5",children:R.children.map(F=>x(F,!0))})]},R.label):g.jsxs(Je.Link,{to:R.path,className:ne("flex items-center gap-3 px-3 py-2 rounded-lg transition-colors",H?"bg-sidebar-primary text-sidebar-primary-foreground":"hover:bg-sidebar-accent text-sidebar-foreground hover:text-sidebar-accent-foreground",S&&"justify-center px-2","text-sm"),title:S?R.label:void 0,children:[A&&g.jsx(A,{className:"h-4 w-4 flex-shrink-0"}),!S&&g.jsx("span",{children:R.label})]},R.path||R.label)},E=g.jsxs("div",{className:"flex items-center justify-between h-14 px-3 border-b border-sidebar-border",children:[!S&&g.jsxs(Je.Link,{to:i,className:"flex items-center gap-2",children:[n||g.jsx("div",{className:"h-7 w-7 rounded-md bg-sidebar-primary flex items-center justify-center",children:g.jsx("span",{className:"text-sidebar-primary-foreground font-semibold text-sm",children:t.charAt(0)})}),g.jsx("span",{className:"font-semibold text-sidebar-foreground",children:t})]}),S&&g.jsx(Je.Link,{to:i,className:"mx-auto",children:n||g.jsx("div",{className:"h-7 w-7 rounded-md bg-sidebar-primary flex items-center justify-center",children:g.jsx("span",{className:"text-sidebar-primary-foreground font-semibold text-sm",children:t.charAt(0)})})}),g.jsx("button",{onClick:()=>c(!1),className:"p-1.5 rounded-lg hover:bg-sidebar-accent lg:hidden",children:g.jsx(Mn,{className:"h-4 w-4 text-sidebar-foreground"})}),g.jsx("button",{onClick:u,className:ne("hidden lg:block p-1.5 rounded-lg hover:bg-sidebar-accent",S&&"mx-auto"),children:S?g.jsx(_i,{className:"h-4 w-4 text-sidebar-foreground"}):g.jsx(eo,{className:"h-4 w-4 text-sidebar-foreground"})})]}),k=s&&a&&g.jsx("div",{className:"px-3 py-3 border-t border-sidebar-border",children:g.jsxs(al,{children:[g.jsx(cl,{asChild:!0,children:g.jsxs("button",{className:ne("w-full flex items-center gap-3 px-2 py-2 rounded-lg transition-colors hover:bg-sidebar-accent",S&&"justify-center px-0"),children:[g.jsxs(Oo,{className:"h-8 w-8",children:[g.jsx(Po,{src:s.avatar,alt:s.firstName||"User"}),g.jsxs(Io,{className:"bg-sidebar-primary text-sidebar-primary-foreground text-xs",children:[((N=s.firstName)==null?void 0:N[0])||"U",((T=s.lastName)==null?void 0:T[0])||""]})]}),!S&&g.jsxs("div",{className:"flex-1 text-left",children:[g.jsxs("p",{className:"text-sm font-medium text-sidebar-foreground truncate",children:[s.firstName," ",s.lastName]}),g.jsx("p",{className:"text-xs text-sidebar-foreground/50 truncate",children:s.email})]})]})}),g.jsxs(Qs,{align:"end",className:"w-56",children:[g.jsx(Js,{children:"My Account"}),g.jsx(yi,{}),l.map((R,M)=>g.jsx(bi,{asChild:!!R.path,onClick:R.onClick,children:R.path?g.jsx(Je.Link,{to:R.path,children:R.label}):R.label},M)),l.length>0&&g.jsx(yi,{}),o&&g.jsx(bi,{onClick:o,className:"text-destructive",children:"Log out"})]})]})});return g.jsxs(g.Fragment,{children:[C&&g.jsx("div",{className:"fixed inset-0 bg-black/50 z-40 lg:hidden",onClick:()=>c(!1)}),g.jsxs("aside",{className:ne("fixed top-0 left-0 z-50 h-full bg-sidebar border-r border-sidebar-border transition-all duration-300 ease-in-out flex flex-col",C?"translate-x-0":"-translate-x-full",S?f:d,"lg:translate-x-0",r),children:[b||E,g.jsx("nav",{className:"flex-1 overflow-y-auto px-3 py-3",children:g.jsx("div",{className:"space-y-1",children:e.map(R=>x(R))})}),_||k]})]})}function ap({pathNames:e={},showBreadcrumbs:t=!0,showMenuButton:n=!0,className:i,leftSlot:s,rightSlot:o,breadcrumbsSlot:l,children:a}){const{toggle:r}=sr(),f=Je.useLocation(),d={dashboard:"Dashboard",users:"Users",roles:"Roles",permissions:"Permissions",settings:"Settings",profile:"Profile",create:"Create",edit:"Edit",...e},h=()=>{const b=f.pathname.split("/").filter(Boolean);return g.jsx("nav",{className:"flex items-center gap-1 text-sm",children:b.map((_,C)=>{const S="/"+b.slice(0,C+1).join("/"),c=C===b.length-1,u=d[_]||_;return g.jsxs("div",{className:"flex items-center gap-1",children:[C>0&&g.jsx(_i,{className:"h-4 w-4 text-muted-foreground"}),c?g.jsx("span",{className:"font-medium text-foreground",children:u}):g.jsx(Je.Link,{to:S,className:"text-muted-foreground hover:text-foreground transition-colors",children:u})]},S)})})};return g.jsxs("header",{className:ne("sticky top-0 z-30 bg-background",i),children:[g.jsxs("div",{className:"flex items-center h-14 px-4 md:px-6",children:[n&&g.jsx("button",{onClick:r,className:"p-2 -ml-2 rounded-lg hover:bg-muted lg:hidden",children:g.jsx(Sm,{className:"h-5 w-5"})}),g.jsx("div",{className:"flex items-center gap-4 flex-1",children:s||t&&(l||g.jsx(h,{}))}),o&&g.jsx("div",{className:"flex items-center gap-2",children:o}),a]}),g.jsx(Si,{})]})}function P3({sidebarProps:e,headerProps:t,showHeader:n=!0,showSidebar:i=!0,contentClassName:s,mainSlot:o,children:l}){const{isCollapsed:a}=sr();return g.jsxs("div",{className:"min-h-screen bg-background",children:[i&&g.jsx(lp,{...e}),g.jsxs("div",{className:ne("transition-all duration-300 ease-in-out",i&&(a?"lg:ml-16":"lg:ml-60")),children:[n&&g.jsx(ap,{...t}),g.jsx("main",{className:ne("p-4 md:p-6",s),children:o||l||g.jsx(Je.Outlet,{})})]})]})}function I3({sidebarProps:e={},headerProps:t={},defaultOpen:n=!1,defaultCollapsed:i=!1,showHeader:s=!0,showSidebar:o=!0,contentClassName:l,mainSlot:a,children:r}){return g.jsx(op,{defaultOpen:n,defaultCollapsed:i,children:g.jsx(P3,{sidebarProps:e,headerProps:t,showHeader:s,showSidebar:o,contentClassName:l,mainSlot:a,children:r})})}exports.Alert=ml;exports.AlertDescription=vl;exports.AlertTitle=gl;exports.AlertWithIcon=O0;exports.AuthLayout=L3;exports.Avatar=Oo;exports.AvatarFallback=Io;exports.AvatarImage=Po;exports.Badge=ii;exports.Button=we;exports.Calendar=Gs;exports.Card=ft;exports.CardContent=ht;exports.CardDescription=Dn;exports.CardFooter=mc;exports.CardHeader=An;exports.CardTitle=Rn;exports.Checkbox=On;exports.ConfirmModal=Ml;exports.CreateEmptyState=W0;exports.CrudDetail=ip;exports.CrudForm=np;exports.CrudList=Y0;exports.DashboardLayout=I3;exports.DataTable=Al;exports.DatePicker=Go;exports.DateRangePicker=Ko;exports.DeleteConfirmModal=xi;exports.Dialog=Sd;exports.DialogClose=Wy;exports.DialogContent=To;exports.DialogDescription=Ro;exports.DialogFooter=Fs;exports.DialogHeader=Mo;exports.DialogOverlay=ko;exports.DialogPortal=Ed;exports.DialogTitle=Ao;exports.DialogTrigger=Vy;exports.DropdownMenu=al;exports.DropdownMenuCheckboxItem=g0;exports.DropdownMenuContent=Qs;exports.DropdownMenuGroup=L4;exports.DropdownMenuItem=bi;exports.DropdownMenuLabel=Js;exports.DropdownMenuPortal=O4;exports.DropdownMenuRadioGroup=I4;exports.DropdownMenuRadioItem=v0;exports.DropdownMenuSeparator=yi;exports.DropdownMenuShortcut=b0;exports.DropdownMenuSub=P4;exports.DropdownMenuSubContent=m0;exports.DropdownMenuSubTrigger=p0;exports.DropdownMenuTrigger=cl;exports.EmptyState=Gn;exports.ErrorState=$0;exports.FormField=$t;exports.FormModal=U0;exports.Header=ap;exports.Input=Ln;exports.Label=Kt;exports.Loading=zn;exports.LoadingButton=V0;exports.LoadingOverlay=H0;exports.LoginPage=O3;exports.Modal=nr;exports.Pagination=kl;exports.Popover=jo;exports.PopoverContent=Ys;exports.PopoverTrigger=zo;exports.QCheckbox=Nl;exports.QDatePicker=F0;exports.QDateRangePicker=j0;exports.QForm=B0;exports.QInput=ms;exports.QRichTextEditor=z0;exports.QSearchSelect=Sl;exports.QSelect=Cl;exports.QSwitch=El;exports.QTabs=Kd;exports.QTextarea=_l;exports.RichTextEditor=Jo;exports.ScrollArea=D0;exports.ScrollBar=pl;exports.SearchEmptyState=Tl;exports.SearchSelect=wl;exports.Select=xo;exports.SelectContent=Ps;exports.SelectGroup=xy;exports.SelectItem=Is;exports.SelectLabel=ed;exports.SelectScrollDownButton=Co;exports.SelectScrollUpButton=_o;exports.SelectSeparator=td;exports.SelectTrigger=Os;exports.SelectValue=wo;exports.Separator=Si;exports.Sidebar=lp;exports.SidebarProvider=op;exports.Skeleton=ag;exports.Switch=ao;exports.Table=bl;exports.TableBody=xl;exports.TableCaption=I0;exports.TableCell=ln;exports.TableFooter=P0;exports.TableHead=li;exports.TableHeader=yl;exports.TableRow=En;exports.Tabs=wx;exports.TabsContent=Gd;exports.TabsList=Zd;exports.TabsTrigger=qd;exports.Textarea=no;exports.Tooltip=aw;exports.TooltipContent=gf;exports.TooltipProvider=lw;exports.TooltipTrigger=cw;exports.alertVariants=L0;exports.badgeVariants=gc;exports.buildQueryString=om;exports.buttonVariants=pc;exports.capitalize=Jp;exports.cn=ne;exports.createCrudStore=sp;exports.createStore=D3;exports.debounce=uc;exports.deepClone=tm;exports.formatCurrency=Kp;exports.formatDate=Jr;exports.formatDateTime=Ji;exports.formatRelativeTime=Xp;exports.generateId=sm;exports.getInitials=im;exports.isEmpty=nm;exports.parseQueryString=rm;exports.slugify=em;exports.truncate=Qp;exports.useSidebarContext=sr;
|
|
242
253
|
//# sourceMappingURL=index.cjs.map
|