@kaushalparajuli/react-crud-ui 1.0.35 → 1.0.38
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 +10 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1368 -1360
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("react/jsx-runtime"),K=require("react"),bc=require("react-dom"),Je=require("react-router-dom");function yc(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=yc(K),Ti=yc(bc);function ia(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ze(...e){return t=>{let n=!1;const i=e.map(s=>{const o=ia(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():ia(e[s],null)}}}}function ve(...e){return m.useCallback(ze(...e),e)}var Cm=Symbol.for("react.lazy"),us=m[" use ".trim().toString()];function Sm(e){return typeof e=="object"&&e!==null&&"then"in e}function xc(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Cm&&"_payload"in e&&Sm(e._payload)}function _c(e){const t=Nm(e),n=m.forwardRef((i,s)=>{let{children:o,...l}=i;xc(o)&&typeof us=="function"&&(o=us(o._payload));const a=m.Children.toArray(o),r=a.find(km);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 Em=_c("Slot");function Nm(e){const t=m.forwardRef((n,i)=>{let{children:s,...o}=n;if(xc(s)&&typeof us=="function"&&(s=us(s._payload)),m.isValidElement(s)){const l=Am(s),a=Mm(o,s.props);return s.type!==m.Fragment&&(a.ref=i?ze(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 Tm=Symbol("radix.slottable");function km(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Tm}function Mm(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 Am(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 wc(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=wc(e[t]))&&(i&&(i+=" "),i+=n)}else for(n in e)e[n]&&(i&&(i+=" "),i+=n);return i}function Cc(){for(var e,t,n=0,i="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=wc(e))&&(i&&(i+=" "),i+=t);return i}const sa=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,ra=Cc,Es=(e,t)=>n=>{var i;if((t==null?void 0:t.variants)==null)return ra(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=sa(d)||sa(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,...w}=d;return Object.entries(w).every(C=>{let[S,c]=C;return Array.isArray(c)?c.includes({...o,...a}[S]):{...o,...a}[S]===c})?[...f,h,b]:f},[]);return ra(e,l,r,n==null?void 0:n.class,n==null?void 0:n.className)},lo="-",Dm=e=>{const t=Lm(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:i}=e;return{getClassGroupId:l=>{const a=l.split(lo);return a[0]===""&&a.length!==1&&a.shift(),Sc(a,t)||Rm(l)},getConflictingClassGroupIds:(l,a)=>{const r=n[l]||[];return a&&i[l]?[...r,...i[l]]:r}}},Sc=(e,t)=>{var l;if(e.length===0)return t.classGroupId;const n=e[0],i=t.nextPart.get(n),s=i?Sc(e.slice(1),i):void 0;if(s)return s;if(t.validators.length===0)return;const o=e.join(lo);return(l=t.validators.find(({validator:a})=>a(o)))==null?void 0:l.classGroupId},oa=/^\[(.+)\]$/,Rm=e=>{if(oa.test(e)){const t=oa.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Lm=e=>{const{theme:t,prefix:n}=e,i={nextPart:new Map,validators:[]};return Pm(Object.entries(e.classGroups),n).forEach(([o,l])=>{Br(l,i,o,t)}),i},Br=(e,t,n,i)=>{e.forEach(s=>{if(typeof s=="string"){const o=s===""?t:la(t,s);o.classGroupId=n;return}if(typeof s=="function"){if(Om(s)){Br(s(i),t,n,i);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([o,l])=>{Br(l,la(t,o),n,i)})})},la=(e,t)=>{let n=e;return t.split(lo).forEach(i=>{n.nextPart.has(i)||n.nextPart.set(i,{nextPart:new Map,validators:[]}),n=n.nextPart.get(i)}),n},Om=e=>e.isThemeGetter,Pm=(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,Im=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)}}},Ec="!",Bm=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),w=b.startsWith(Ec),C=w?b.substring(1):b,S=h&&h>d?h-d:void 0;return{modifiers:r,hasImportantModifier:w,baseClassName:C,maybePostfixModifierPosition:S}};return n?a=>n({className:a,parseClassName:l}):l},Fm=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},jm=e=>({cache:Im(e.cacheSize),parseClassName:Bm(e),...Dm(e)}),zm=/\s+/,Hm=(e,t)=>{const{parseClassName:n,getClassGroupId:i,getConflictingClassGroupIds:s}=t,o=[],l=e.trim().split(zm);let a="";for(let r=l.length-1;r>=0;r-=1){const f=l[r],{modifiers:d,hasImportantModifier:h,baseClassName:b,maybePostfixModifierPosition:w}=n(f);let C=!!w,S=i(C?b.substring(0,w):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=Fm(d).join(":"),u=h?c+Ec: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 _=v[y];o.push(u+_)}a=f+(a.length>0?" "+a:a)}return a};function Vm(){let e=0,t,n,i="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Nc(t))&&(i&&(i+=" "),i+=n);return i}const Nc=e=>{if(typeof e=="string")return e;let t,n="";for(let i=0;i<e.length;i++)e[i]&&(t=Nc(e[i]))&&(n&&(n+=" "),n+=t);return n};function Wm(e,...t){let n,i,s,o=l;function l(r){const f=t.reduce((d,h)=>h(d),e());return n=jm(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=Hm(r,n);return s(r,d),d}return function(){return o(Vm.apply(null,arguments))}}const Ie=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Tc=/^\[(?:([a-z-]+):)?(.+)\]$/i,$m=/^\d+\/\d+$/,Um=new Set(["px","full","screen"]),Ym=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,qm=/\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$/,Zm=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Gm=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Km=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,It=e=>Dn(e)||Um.has(e)||$m.test(e),Yt=e=>Zn(e,"length",sg),Dn=e=>!!e&&!Number.isNaN(Number(e)),vr=e=>Zn(e,"number",Dn),ii=e=>!!e&&Number.isInteger(Number(e)),Xm=e=>e.endsWith("%")&&Dn(e.slice(0,-1)),ye=e=>Tc.test(e),qt=e=>Ym.test(e),Qm=new Set(["length","size","percentage"]),Jm=e=>Zn(e,Qm,kc),eg=e=>Zn(e,"position",kc),tg=new Set(["image","url"]),ng=e=>Zn(e,tg,og),ig=e=>Zn(e,"",rg),si=()=>!0,Zn=(e,t,n)=>{const i=Tc.exec(e);return i?i[1]?typeof t=="string"?i[1]===t:t.has(i[1]):n(i[2]):!1},sg=e=>qm.test(e)&&!Zm.test(e),kc=()=>!1,rg=e=>Gm.test(e),og=e=>Km.test(e),lg=()=>{const e=Ie("colors"),t=Ie("spacing"),n=Ie("blur"),i=Ie("brightness"),s=Ie("borderColor"),o=Ie("borderRadius"),l=Ie("borderSpacing"),a=Ie("borderWidth"),r=Ie("contrast"),f=Ie("grayscale"),d=Ie("hueRotate"),h=Ie("invert"),b=Ie("gap"),w=Ie("gradientColorStops"),C=Ie("gradientColorStopPositions"),S=Ie("inset"),c=Ie("margin"),u=Ie("opacity"),p=Ie("padding"),v=Ie("saturate"),y=Ie("scale"),_=Ie("sepia"),x=Ie("skew"),E=Ie("space"),T=Ie("translate"),N=()=>["auto","contain","none"],k=()=>["auto","hidden","clip","visible","scroll"],D=()=>["auto",ye,t],M=()=>[ye,t],A=()=>["",It,Yt],R=()=>["auto",Dn,ye],z=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],V=()=>["solid","dashed","dotted","double","none"],H=()=>["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"],L=()=>["","0",ye],O=()=>["auto","avoid","all","avoid-page","page","left","right","column"],j=()=>[Dn,ye];return{cacheSize:500,separator:":",theme:{colors:[si],spacing:[It,Yt],blur:["none","",qt,ye],brightness:j(),borderColor:[e],borderRadius:["none","","full",qt,ye],borderSpacing:M(),borderWidth:A(),contrast:j(),grayscale:L(),hueRotate:j(),invert:L(),gap:M(),gradientColorStops:[e],gradientColorStopPositions:[Xm,Yt],inset:D(),margin:D(),opacity:j(),padding:M(),saturate:j(),scale:j(),sepia:L(),skew:j(),space:M(),translate:M()},classGroups:{aspect:[{aspect:["auto","square","video",ye]}],container:["container"],columns:[{columns:[qt]}],"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:[...z(),ye]}],overflow:[{overflow:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],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",ii,ye]}],basis:[{basis:D()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ye]}],grow:[{grow:L()}],shrink:[{shrink:L()}],order:[{order:["first","last","none",ii,ye]}],"grid-cols":[{"grid-cols":[si]}],"col-start-end":[{col:["auto",{span:["full",ii,ye]},ye]}],"col-start":[{"col-start":R()}],"col-end":[{"col-end":R()}],"grid-rows":[{"grid-rows":[si]}],"row-start-end":[{row:["auto",{span:[ii,ye]},ye]}],"row-start":[{"row-start":R()}],"row-end":[{"row-end":R()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ye]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ye]}],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",ye,t]}],"min-w":[{"min-w":[ye,t,"min","max","fit"]}],"max-w":[{"max-w":[ye,t,"none","full","min","max","fit","prose",{screen:[qt]},qt]}],h:[{h:[ye,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ye,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ye,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ye,t,"auto","min","max","fit"]}],"font-size":[{text:["base",qt,Yt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",vr]}],"font-family":[{font:[si]}],"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",ye]}],"line-clamp":[{"line-clamp":["none",Dn,vr]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",It,ye]}],"list-image":[{"list-image":["none",ye]}],"list-style-type":[{list:["none","disc","decimal",ye]}],"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:[...V(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",It,Yt]}],"underline-offset":[{"underline-offset":["auto",It,ye]}],"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",ye]}],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",ye]}],"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:[...z(),eg]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Jm]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},ng]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[C]}],"gradient-via-pos":[{via:[C]}],"gradient-to-pos":[{to:[C]}],"gradient-from":[{from:[w]}],"gradient-via":[{via:[w]}],"gradient-to":[{to:[w]}],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:[...V(),"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:V()}],"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:["",...V()]}],"outline-offset":[{"outline-offset":[It,ye]}],"outline-w":[{outline:[It,Yt]}],"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,Yt]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",qt,ig]}],"shadow-color":[{shadow:[si]}],opacity:[{opacity:[u]}],"mix-blend":[{"mix-blend":[...H(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":H()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[i]}],contrast:[{contrast:[r]}],"drop-shadow":[{"drop-shadow":["","none",qt,ye]}],grayscale:[{grayscale:[f]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[h]}],saturate:[{saturate:[v]}],sepia:[{sepia:[_]}],"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":[_]}],"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",ye]}],duration:[{duration:j()}],ease:[{ease:["linear","in","out","in-out",ye]}],delay:[{delay:j()}],animate:[{animate:["none","spin","ping","pulse","bounce",ye]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[y]}],"scale-x":[{"scale-x":[y]}],"scale-y":[{"scale-y":[y]}],rotate:[{rotate:[ii,ye]}],"translate-x":[{"translate-x":[T]}],"translate-y":[{"translate-y":[T]}],"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",ye]}],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",ye]}],"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",ye]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[It,Yt,vr]}],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"]}}},ag=Wm(lg);function J(...e){return ag(Cc(e))}function cg(e,t="NPR"){return new Intl.NumberFormat("en-NP",{style:"currency",currency:t,minimumFractionDigits:2}).format(e)}function ao(e,t={}){const n={year:"numeric",month:"long",day:"numeric"};return new Date(e).toLocaleDateString("en-US",{...n,...t})}function os(e){return new Date(e).toLocaleString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function ug(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`:ao(e)}function dg(e,t=100){return e?e.length<=t?e:e.slice(0,t)+"...":""}function fg(e){return e?e.charAt(0).toUpperCase()+e.slice(1):""}function hg(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function Mc(e,t=300){let n;return function(...s){const o=()=>{clearTimeout(n),e(...s)};clearTimeout(n),n=setTimeout(o,t)}}function pg(e){return JSON.parse(JSON.stringify(e))}function mg(e){return e?Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1:!0}function gg(e){return e?e.split(" ").map(t=>t[0]).join("").toUpperCase().slice(0,2):""}function vg(){return Math.random().toString(36).substring(2,9)}function bg(e){const t=new URLSearchParams(e),n={};for(const[i,s]of t)n[i]=s;return n}function yg(e){const t=new URLSearchParams;return Object.entries(e).forEach(([n,i])=>{i!=null&&i!==""&&t.append(n,i)}),t.toString()}/**
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("react/jsx-runtime"),K=require("react"),bc=require("react-dom"),Je=require("react-router-dom");function yc(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=yc(K),Ti=yc(bc);function ia(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ze(...e){return t=>{let n=!1;const i=e.map(s=>{const o=ia(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():ia(e[s],null)}}}}function ve(...e){return m.useCallback(ze(...e),e)}var Cm=Symbol.for("react.lazy"),us=m[" use ".trim().toString()];function Sm(e){return typeof e=="object"&&e!==null&&"then"in e}function xc(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Cm&&"_payload"in e&&Sm(e._payload)}function _c(e){const t=Nm(e),n=m.forwardRef((i,s)=>{let{children:o,...l}=i;xc(o)&&typeof us=="function"&&(o=us(o._payload));const a=m.Children.toArray(o),r=a.find(km);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 Em=_c("Slot");function Nm(e){const t=m.forwardRef((n,i)=>{let{children:s,...o}=n;if(xc(s)&&typeof us=="function"&&(s=us(s._payload)),m.isValidElement(s)){const l=Am(s),a=Mm(o,s.props);return s.type!==m.Fragment&&(a.ref=i?ze(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 Tm=Symbol("radix.slottable");function km(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Tm}function Mm(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 Am(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 wc(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=wc(e[t]))&&(i&&(i+=" "),i+=n)}else for(n in e)e[n]&&(i&&(i+=" "),i+=n);return i}function Cc(){for(var e,t,n=0,i="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=wc(e))&&(i&&(i+=" "),i+=t);return i}const sa=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,ra=Cc,Es=(e,t)=>n=>{var i;if((t==null?void 0:t.variants)==null)return ra(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=sa(d)||sa(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,...C}=d;return Object.entries(C).every(w=>{let[S,c]=w;return Array.isArray(c)?c.includes({...o,...a}[S]):{...o,...a}[S]===c})?[...f,h,b]:f},[]);return ra(e,l,r,n==null?void 0:n.class,n==null?void 0:n.className)},lo="-",Dm=e=>{const t=Lm(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:i}=e;return{getClassGroupId:l=>{const a=l.split(lo);return a[0]===""&&a.length!==1&&a.shift(),Sc(a,t)||Rm(l)},getConflictingClassGroupIds:(l,a)=>{const r=n[l]||[];return a&&i[l]?[...r,...i[l]]:r}}},Sc=(e,t)=>{var l;if(e.length===0)return t.classGroupId;const n=e[0],i=t.nextPart.get(n),s=i?Sc(e.slice(1),i):void 0;if(s)return s;if(t.validators.length===0)return;const o=e.join(lo);return(l=t.validators.find(({validator:a})=>a(o)))==null?void 0:l.classGroupId},oa=/^\[(.+)\]$/,Rm=e=>{if(oa.test(e)){const t=oa.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Lm=e=>{const{theme:t,prefix:n}=e,i={nextPart:new Map,validators:[]};return Pm(Object.entries(e.classGroups),n).forEach(([o,l])=>{Br(l,i,o,t)}),i},Br=(e,t,n,i)=>{e.forEach(s=>{if(typeof s=="string"){const o=s===""?t:la(t,s);o.classGroupId=n;return}if(typeof s=="function"){if(Om(s)){Br(s(i),t,n,i);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([o,l])=>{Br(l,la(t,o),n,i)})})},la=(e,t)=>{let n=e;return t.split(lo).forEach(i=>{n.nextPart.has(i)||n.nextPart.set(i,{nextPart:new Map,validators:[]}),n=n.nextPart.get(i)}),n},Om=e=>e.isThemeGetter,Pm=(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,Im=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)}}},Ec="!",Bm=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),C=b.startsWith(Ec),w=C?b.substring(1):b,S=h&&h>d?h-d:void 0;return{modifiers:r,hasImportantModifier:C,baseClassName:w,maybePostfixModifierPosition:S}};return n?a=>n({className:a,parseClassName:l}):l},Fm=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},jm=e=>({cache:Im(e.cacheSize),parseClassName:Bm(e),...Dm(e)}),zm=/\s+/,Hm=(e,t)=>{const{parseClassName:n,getClassGroupId:i,getConflictingClassGroupIds:s}=t,o=[],l=e.trim().split(zm);let a="";for(let r=l.length-1;r>=0;r-=1){const f=l[r],{modifiers:d,hasImportantModifier:h,baseClassName:b,maybePostfixModifierPosition:C}=n(f);let w=!!C,S=i(w?b.substring(0,C):b);if(!S){if(!w){a=f+(a.length>0?" "+a:a);continue}if(S=i(b),!S){a=f+(a.length>0?" "+a:a);continue}w=!1}const c=Fm(d).join(":"),u=h?c+Ec:c,p=u+S;if(o.includes(p))continue;o.push(p);const v=s(S,w);for(let y=0;y<v.length;++y){const _=v[y];o.push(u+_)}a=f+(a.length>0?" "+a:a)}return a};function Vm(){let e=0,t,n,i="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Nc(t))&&(i&&(i+=" "),i+=n);return i}const Nc=e=>{if(typeof e=="string")return e;let t,n="";for(let i=0;i<e.length;i++)e[i]&&(t=Nc(e[i]))&&(n&&(n+=" "),n+=t);return n};function Wm(e,...t){let n,i,s,o=l;function l(r){const f=t.reduce((d,h)=>h(d),e());return n=jm(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=Hm(r,n);return s(r,d),d}return function(){return o(Vm.apply(null,arguments))}}const Ie=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Tc=/^\[(?:([a-z-]+):)?(.+)\]$/i,$m=/^\d+\/\d+$/,Um=new Set(["px","full","screen"]),Ym=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,qm=/\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$/,Zm=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Gm=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Km=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,It=e=>Dn(e)||Um.has(e)||$m.test(e),Yt=e=>Zn(e,"length",sg),Dn=e=>!!e&&!Number.isNaN(Number(e)),vr=e=>Zn(e,"number",Dn),ii=e=>!!e&&Number.isInteger(Number(e)),Xm=e=>e.endsWith("%")&&Dn(e.slice(0,-1)),ye=e=>Tc.test(e),qt=e=>Ym.test(e),Qm=new Set(["length","size","percentage"]),Jm=e=>Zn(e,Qm,kc),eg=e=>Zn(e,"position",kc),tg=new Set(["image","url"]),ng=e=>Zn(e,tg,og),ig=e=>Zn(e,"",rg),si=()=>!0,Zn=(e,t,n)=>{const i=Tc.exec(e);return i?i[1]?typeof t=="string"?i[1]===t:t.has(i[1]):n(i[2]):!1},sg=e=>qm.test(e)&&!Zm.test(e),kc=()=>!1,rg=e=>Gm.test(e),og=e=>Km.test(e),lg=()=>{const e=Ie("colors"),t=Ie("spacing"),n=Ie("blur"),i=Ie("brightness"),s=Ie("borderColor"),o=Ie("borderRadius"),l=Ie("borderSpacing"),a=Ie("borderWidth"),r=Ie("contrast"),f=Ie("grayscale"),d=Ie("hueRotate"),h=Ie("invert"),b=Ie("gap"),C=Ie("gradientColorStops"),w=Ie("gradientColorStopPositions"),S=Ie("inset"),c=Ie("margin"),u=Ie("opacity"),p=Ie("padding"),v=Ie("saturate"),y=Ie("scale"),_=Ie("sepia"),x=Ie("skew"),E=Ie("space"),T=Ie("translate"),N=()=>["auto","contain","none"],k=()=>["auto","hidden","clip","visible","scroll"],D=()=>["auto",ye,t],M=()=>[ye,t],A=()=>["",It,Yt],R=()=>["auto",Dn,ye],z=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],V=()=>["solid","dashed","dotted","double","none"],H=()=>["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"],L=()=>["","0",ye],O=()=>["auto","avoid","all","avoid-page","page","left","right","column"],j=()=>[Dn,ye];return{cacheSize:500,separator:":",theme:{colors:[si],spacing:[It,Yt],blur:["none","",qt,ye],brightness:j(),borderColor:[e],borderRadius:["none","","full",qt,ye],borderSpacing:M(),borderWidth:A(),contrast:j(),grayscale:L(),hueRotate:j(),invert:L(),gap:M(),gradientColorStops:[e],gradientColorStopPositions:[Xm,Yt],inset:D(),margin:D(),opacity:j(),padding:M(),saturate:j(),scale:j(),sepia:L(),skew:j(),space:M(),translate:M()},classGroups:{aspect:[{aspect:["auto","square","video",ye]}],container:["container"],columns:[{columns:[qt]}],"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:[...z(),ye]}],overflow:[{overflow:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],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",ii,ye]}],basis:[{basis:D()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ye]}],grow:[{grow:L()}],shrink:[{shrink:L()}],order:[{order:["first","last","none",ii,ye]}],"grid-cols":[{"grid-cols":[si]}],"col-start-end":[{col:["auto",{span:["full",ii,ye]},ye]}],"col-start":[{"col-start":R()}],"col-end":[{"col-end":R()}],"grid-rows":[{"grid-rows":[si]}],"row-start-end":[{row:["auto",{span:[ii,ye]},ye]}],"row-start":[{"row-start":R()}],"row-end":[{"row-end":R()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ye]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ye]}],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",ye,t]}],"min-w":[{"min-w":[ye,t,"min","max","fit"]}],"max-w":[{"max-w":[ye,t,"none","full","min","max","fit","prose",{screen:[qt]},qt]}],h:[{h:[ye,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ye,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ye,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ye,t,"auto","min","max","fit"]}],"font-size":[{text:["base",qt,Yt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",vr]}],"font-family":[{font:[si]}],"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",ye]}],"line-clamp":[{"line-clamp":["none",Dn,vr]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",It,ye]}],"list-image":[{"list-image":["none",ye]}],"list-style-type":[{list:["none","disc","decimal",ye]}],"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:[...V(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",It,Yt]}],"underline-offset":[{"underline-offset":["auto",It,ye]}],"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",ye]}],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",ye]}],"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:[...z(),eg]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Jm]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},ng]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[w]}],"gradient-via-pos":[{via:[w]}],"gradient-to-pos":[{to:[w]}],"gradient-from":[{from:[C]}],"gradient-via":[{via:[C]}],"gradient-to":[{to:[C]}],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:[...V(),"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:V()}],"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:["",...V()]}],"outline-offset":[{"outline-offset":[It,ye]}],"outline-w":[{outline:[It,Yt]}],"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,Yt]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",qt,ig]}],"shadow-color":[{shadow:[si]}],opacity:[{opacity:[u]}],"mix-blend":[{"mix-blend":[...H(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":H()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[i]}],contrast:[{contrast:[r]}],"drop-shadow":[{"drop-shadow":["","none",qt,ye]}],grayscale:[{grayscale:[f]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[h]}],saturate:[{saturate:[v]}],sepia:[{sepia:[_]}],"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":[_]}],"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",ye]}],duration:[{duration:j()}],ease:[{ease:["linear","in","out","in-out",ye]}],delay:[{delay:j()}],animate:[{animate:["none","spin","ping","pulse","bounce",ye]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[y]}],"scale-x":[{"scale-x":[y]}],"scale-y":[{"scale-y":[y]}],rotate:[{rotate:[ii,ye]}],"translate-x":[{"translate-x":[T]}],"translate-y":[{"translate-y":[T]}],"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",ye]}],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",ye]}],"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",ye]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[It,Yt,vr]}],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"]}}},ag=Wm(lg);function J(...e){return ag(Cc(e))}function cg(e,t="NPR"){return new Intl.NumberFormat("en-NP",{style:"currency",currency:t,minimumFractionDigits:2}).format(e)}function ao(e,t={}){const n={year:"numeric",month:"long",day:"numeric"};return new Date(e).toLocaleDateString("en-US",{...n,...t})}function os(e){return new Date(e).toLocaleString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function ug(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`:ao(e)}function dg(e,t=100){return e?e.length<=t?e:e.slice(0,t)+"...":""}function fg(e){return e?e.charAt(0).toUpperCase()+e.slice(1):""}function hg(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function Mc(e,t=300){let n;return function(...s){const o=()=>{clearTimeout(n),e(...s)};clearTimeout(n),n=setTimeout(o,t)}}function pg(e){return JSON.parse(JSON.stringify(e))}function mg(e){return e?Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1:!0}function gg(e){return e?e.split(" ").map(t=>t[0]).join("").toUpperCase().slice(0,2):""}function vg(){return Math.random().toString(36).substring(2,9)}function bg(e){const t=new URLSearchParams(e),n={};for(const[i,s]of t)n[i]=s;return n}function yg(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.
|
|
@@ -178,7 +178,7 @@
|
|
|
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 Pn=Ae("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Ts=Es("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"}}),_e=m.forwardRef(({className:e,variant:t,size:n,asChild:i=!1,loading:s=!1,children:o,disabled:l,...a},r)=>{const f=i?Em:"button";return g.jsxs(f,{className:J(Ts({variant:t,size:n,className:e})),ref:r,disabled:l||s,...a,children:[s&&g.jsx(hn,{className:"mr-2 h-4 w-4 animate-spin"}),o]})});_e.displayName="Button";const ht=m.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:J("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));ht.displayName="Card";const In=m.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:J("flex flex-col space-y-1.5 p-6",e),...t}));In.displayName="CardHeader";const Bn=m.forwardRef(({className:e,...t},n)=>g.jsx("h3",{ref:n,className:J("text-2xl font-semibold leading-none tracking-tight",e),...t}));Bn.displayName="CardTitle";const Fn=m.forwardRef(({className:e,...t},n)=>g.jsx("p",{ref:n,className:J("text-sm text-muted-foreground",e),...t}));Fn.displayName="CardDescription";const pt=m.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:J("p-6 pt-0",e),...t}));pt.displayName="CardContent";const Lc=m.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:J("flex items-center p-6 pt-0",e),...t}));Lc.displayName="CardFooter";const Oc=Es("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 ai({className:e,variant:t,...n}){return g.jsx("div",{className:J(Oc({variant:t}),e),...n})}const jn=m.forwardRef(({className:e,type:t,...n},i)=>g.jsx("input",{type:t,className:J("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}));jn.displayName="Input";var jg=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Mi=jg.reduce((e,t)=>{const n=_c(`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}},{}),zg="Label",Pc=m.forwardRef((e,t)=>g.jsx(Mi.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())}}));Pc.displayName=zg;var Ic=Pc;const Hg=Es("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Xt=m.forwardRef(({className:e,...t},n)=>g.jsx(Ic,{ref:n,className:J(Hg(),e),...t}));Xt.displayName=Ic.displayName;const fo=m.forwardRef(({className:e,...t},n)=>g.jsx("textarea",{className:J("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}));fo.displayName="Textarea";function Vg(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:w,...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:w})};f.displayName=o+"Provider";function d(h,b){var S;const w=((S=b==null?void 0:b[e])==null?void 0:S[r])||a,C=m.useContext(w);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,Wg(s,...t)]}function Wg(...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 Ye=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},$g=m[" useInsertionEffect ".trim().toString()]||Ye;function wt({prop:e,defaultProp:t,onChange:n=()=>{},caller:i}){const[s,o,l]=Ug({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=Yg(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 Ug({defaultProp:e,onChange:t}){const[n,i]=m.useState(e),s=m.useRef(n),o=m.useRef(t);return $g(()=>{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 Yg(e){return typeof e=="function"}function ho(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 po(e){const[t,n]=m.useState(void 0);return Ye(()=>{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 qg(e,t){return m.useReducer((n,i)=>t[n][i]??n,e)}var Ke=e=>{const{present:t,children:n}=e,i=Zg(t),s=typeof n=="function"?n({present:i.isPresent}):m.Children.only(n),o=ve(i.ref,Gg(s));return typeof n=="function"||i.isPresent?m.cloneElement(s,{ref:o}):null};Ke.displayName="Presence";function Zg(e){const[t,n]=m.useState(),i=m.useRef(null),s=m.useRef(e),o=m.useRef("none"),l=e?"mounted":"unmounted",[a,r]=qg(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const f=es(i.current);o.current=a==="mounted"?f:"none"},[a]),Ye(()=>{const f=i.current,d=s.current;if(d!==e){const b=o.current,w=es(f);e?r("MOUNT"):w==="none"||(f==null?void 0:f.display)==="none"?r("UNMOUNT"):r(d&&b!==w?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,r]),Ye(()=>{if(t){let f;const d=t.ownerDocument.defaultView??window,h=w=>{const S=es(i.current).includes(CSS.escape(w.animationName));if(w.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=w=>{w.target===t&&(o.current=es(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 es(e){return(e==null?void 0:e.animationName)||"none"}function Gg(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 Kg(e){const t=Xg(e),n=m.forwardRef((i,s)=>{const{children:o,...l}=i,a=m.Children.toArray(o),r=a.find(Jg);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 Xg(e){const t=m.forwardRef((n,i)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const l=t1(s),a=e1(o,s.props);return s.type!==m.Fragment&&(a.ref=i?ze(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 Qg=Symbol("radix.slottable");function Jg(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Qg}function e1(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 t1(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 n1=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],mo=n1.reduce((e,t)=>{const n=Kg(`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}},{}),ks="Checkbox",[i1]=Vg(ks),[s1,go]=i1(ks);function r1(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,w]=wt({prop:n,defaultProp:s??!1,onChange:r,caller:ks}),[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:w,control:C,setControl:S,name:a,form:l,value:d,hasConsumerStoppedPropagationRef:p,required:f,defaultChecked:Qt(s)?!1:s,isFormControl:v,bubbleInput:c,setBubbleInput:u};return g.jsx(s1,{scope:t,...y,children:o1(h)?h(y):i})}var Bc="CheckboxTrigger",Fc=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:w,bubbleInput:C}=go(Bc,e),S=ve(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(mo.button,{type:"button",role:"checkbox","aria-checked":Qt(r)?"mixed":r,"aria-required":f,"data-state":Wc(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=>Qt(p)?!0:!p),C&&w&&(b.current=u.isPropagationStopped(),b.current||u.stopPropagation())})})});Fc.displayName=Bc;var vo=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(r1,{__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(Fc,{...h,ref:t,__scopeCheckbox:n}),b&&g.jsx(Vc,{__scopeCheckbox:n})]})})});vo.displayName=ks;var jc="CheckboxIndicator",zc=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:i,...s}=e,o=go(jc,n);return g.jsx(Ke,{present:i||Qt(o.checked)||o.checked===!0,children:g.jsx(mo.span,{"data-state":Wc(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:t,style:{pointerEvents:"none",...e.style}})})});zc.displayName=jc;var Hc="CheckboxBubbleInput",Vc=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:w}=go(Hc,e),C=ve(n,w),S=ho(o),c=po(i);m.useEffect(()=>{const p=b;if(!p)return;const v=window.HTMLInputElement.prototype,_=Object.getOwnPropertyDescriptor(v,"checked").set,x=!s.current;if(S!==o&&_){const E=new Event("click",{bubbles:x});p.indeterminate=Qt(o),_.call(p,Qt(o)?!1:o),p.dispatchEvent(E)}},[b,S,o,s]);const u=m.useRef(Qt(o)?!1:o);return g.jsx(mo.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%)"}})});Vc.displayName=Hc;function o1(e){return typeof e=="function"}function Qt(e){return e==="indeterminate"}function Wc(e){return Qt(e)?"indeterminate":e?"checked":"unchecked"}const zn=m.forwardRef(({className:e,...t},n)=>g.jsx(vo,{ref:n,className:J("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(zc,{className:J("flex items-center justify-center text-current"),children:g.jsx(gi,{className:"h-4 w-4"})})}));zn.displayName=vo.displayName;function l1(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:w,...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:w})};f.displayName=o+"Provider";function d(h,b){var S;const w=((S=b==null?void 0:b[e])==null?void 0:S[r])||a,C=m.useContext(w);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,a1(s,...t)]}function a1(...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 c1(e){const t=u1(e),n=m.forwardRef((i,s)=>{const{children:o,...l}=i,a=m.Children.toArray(o),r=a.find(f1);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 u1(e){const t=m.forwardRef((n,i)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const l=p1(s),a=h1(o,s.props);return s.type!==m.Fragment&&(a.ref=i?ze(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 d1=Symbol("radix.slottable");function f1(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===d1}function h1(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 p1(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 m1=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],$c=m1.reduce((e,t)=>{const n=c1(`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}},{}),Ms="Switch",[g1]=l1(Ms),[v1,b1]=g1(Ms),Uc=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,w]=m.useState(null),C=ve(t,v=>w(v)),S=m.useRef(!1),c=b?d||!!b.closest("form"):!0,[u,p]=wt({prop:s,defaultProp:o??!1,onChange:f,caller:Ms});return g.jsxs(v1,{scope:n,checked:u,disabled:a,children:[g.jsx($c.button,{type:"button",role:"switch","aria-checked":u,"aria-required":l,"data-state":Gc(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(Zc,{control:b,bubbles:!S.current,name:i,value:r,checked:u,required:l,disabled:a,form:d,style:{transform:"translateX(-100%)"}})]})});Uc.displayName=Ms;var Yc="SwitchThumb",qc=m.forwardRef((e,t)=>{const{__scopeSwitch:n,...i}=e,s=b1(Yc,n);return g.jsx($c.span,{"data-state":Gc(s.checked),"data-disabled":s.disabled?"":void 0,...i,ref:t})});qc.displayName=Yc;var y1="SwitchBubbleInput",Zc=m.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:i=!0,...s},o)=>{const l=m.useRef(null),a=ve(l,o),r=ho(n),f=po(t);return m.useEffect(()=>{const d=l.current;if(!d)return;const h=window.HTMLInputElement.prototype,w=Object.getOwnPropertyDescriptor(h,"checked").set;if(r!==n&&w){const C=new Event("click",{bubbles:i});w.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}})});Zc.displayName=y1;function Gc(e){return e?"checked":"unchecked"}var Kc=Uc,x1=qc;const bo=m.forwardRef(({className:e,...t},n)=>g.jsx(Kc,{className:J("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(x1,{className:J("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")})}));bo.displayName=Kc.displayName;function _1({className:e,...t}){return g.jsx("div",{className:J("animate-pulse rounded-md bg-muted",e),...t})}var w1="Separator",da="horizontal",C1=["horizontal","vertical"],Xc=m.forwardRef((e,t)=>{const{decorative:n,orientation:i=da,...s}=e,o=S1(i)?i:da,a=n?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return g.jsx(Mi.div,{"data-orientation":o,...a,...s,ref:t})});Xc.displayName=w1;function S1(e){return C1.includes(e)}var Qc=Xc;const Ai=m.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...i},s)=>g.jsx(Qc,{ref:s,decorative:n,orientation:t,className:J("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...i}));Ai.displayName=Qc.displayName;function zr(e,[t,n]){return Math.min(n,Math.max(t,e))}function E1(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:w,...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:w})};f.displayName=o+"Provider";function d(h,b){var S;const w=((S=b==null?void 0:b[e])==null?void 0:S[r])||a,C=m.useContext(w);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,N1(s,...t)]}function N1(...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 fa(e){const t=T1(e),n=m.forwardRef((i,s)=>{const{children:o,...l}=i,a=m.Children.toArray(o),r=a.find(M1);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 T1(e){const t=m.forwardRef((n,i)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const l=D1(s),a=A1(o,s.props);return s.type!==m.Fragment&&(a.ref=i?ze(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 k1=Symbol("radix.slottable");function M1(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===k1}function A1(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 D1(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 yo(e){const t=e+"CollectionProvider",[n,i]=E1(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=fa(a),f=K.forwardRef((S,c)=>{const{scope:u,children:p}=S,v=o(a,u),y=ve(c,v.collectionRef);return g.jsx(r,{ref:y,children:p})});f.displayName=a;const d=e+"CollectionItemSlot",h="data-radix-collection-item",b=fa(d),w=K.forwardRef((S,c)=>{const{scope:u,children:p,...v}=S,y=K.useRef(null),_=ve(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:_,children:p})});w.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:w},C,i]}function R1(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:w,...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:w})};f.displayName=o+"Provider";function d(h,b){var S;const w=((S=b==null?void 0:b[e])==null?void 0:S[r])||a,C=m.useContext(w);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,L1(s,...t)]}function L1(...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 O1=m.createContext(void 0);function Di(e){const t=m.useContext(O1);return e||t||"ltr"}function P1(e){const t=I1(e),n=m.forwardRef((i,s)=>{const{children:o,...l}=i,a=m.Children.toArray(o),r=a.find(F1);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 I1(e){const t=m.forwardRef((n,i)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const l=z1(s),a=j1(o,s.props);return s.type!==m.Fragment&&(a.ref=i?ze(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 B1=Symbol("radix.slottable");function F1(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===B1}function j1(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 z1(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 H1=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Jc=H1.reduce((e,t)=>{const n=P1(`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 V1(e,t){e&&Ti.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 W1(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 $1="DismissableLayer",Hr="dismissableLayer.update",U1="dismissableLayer.pointerDownOutside",Y1="dismissableLayer.focusOutside",ha,eu=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Gn=m.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:l,onDismiss:a,...r}=e,f=m.useContext(eu),[d,h]=m.useState(null),b=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,w]=m.useState({}),C=ve(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,_=G1(E=>{const T=E.target,N=[...f.branches].some(k=>k.contains(T));!y||N||(s==null||s(E),l==null||l(E),E.defaultPrevented||a==null||a())},b),x=K1(E=>{const T=E.target;[...f.branches].some(k=>k.contains(T))||(o==null||o(E),l==null||l(E),E.defaultPrevented||a==null||a())},b);return W1(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&&(ha=b.body.style.pointerEvents,b.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(d)),f.layers.add(d),pa(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(b.body.style.pointerEvents=ha)}},[d,b,n,f]),m.useEffect(()=>()=>{d&&(f.layers.delete(d),f.layersWithOutsidePointerEventsDisabled.delete(d),pa())},[d,f]),m.useEffect(()=>{const E=()=>w({});return document.addEventListener(Hr,E),()=>document.removeEventListener(Hr,E)},[]),g.jsx(Jc.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,_.onPointerDownCapture)})});Gn.displayName=$1;var q1="DismissableLayerBranch",Z1=m.forwardRef((e,t)=>{const n=m.useContext(eu),i=m.useRef(null),s=ve(t,i);return m.useEffect(()=>{const o=i.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),g.jsx(Jc.div,{...e,ref:s})});Z1.displayName=q1;function G1(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(){tu(U1,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 K1(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&&tu(Y1,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 pa(){const e=new CustomEvent(Hr);document.dispatchEvent(e)}function tu(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?V1(s,o):s.dispatchEvent(o)}var br=0;function As(){m.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ma()),document.body.insertAdjacentElement("beforeend",e[1]??ma()),br++,()=>{br===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),br--}},[])}function ma(){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 X1(e){const t=Q1(e),n=m.forwardRef((i,s)=>{const{children:o,...l}=i,a=m.Children.toArray(o),r=a.find(ev);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 Q1(e){const t=m.forwardRef((n,i)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const l=nv(s),a=tv(o,s.props);return s.type!==m.Fragment&&(a.ref=i?ze(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 J1=Symbol("radix.slottable");function ev(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===J1}function tv(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 nv(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 iv=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],sv=iv.reduce((e,t)=>{const n=X1(`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}},{}),yr="focusScope.autoFocusOnMount",xr="focusScope.autoFocusOnUnmount",ga={bubbles:!1,cancelable:!0},rv="FocusScope",Ri=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=ve(t,S=>r(S)),w=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(i){let S=function(v){if(w.paused||!a)return;const y=v.target;a.contains(y)?h.current=y:Gt(h.current,{select:!0})},c=function(v){if(w.paused||!a)return;const y=v.relatedTarget;y!==null&&(a.contains(y)||Gt(h.current,{select:!0}))},u=function(v){if(document.activeElement===document.body)for(const _ of v)_.removedNodes.length>0&&Gt(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,w.paused]),m.useEffect(()=>{if(a){ba.add(w);const S=document.activeElement;if(!a.contains(S)){const u=new CustomEvent(yr,ga);a.addEventListener(yr,f),a.dispatchEvent(u),u.defaultPrevented||(ov(dv(nu(a)),{select:!0}),document.activeElement===S&&Gt(a))}return()=>{a.removeEventListener(yr,f),setTimeout(()=>{const u=new CustomEvent(xr,ga);a.addEventListener(xr,d),a.dispatchEvent(u),u.defaultPrevented||Gt(S??document.body,{select:!0}),a.removeEventListener(xr,d),ba.remove(w)},0)}}},[a,f,d,w]);const C=m.useCallback(S=>{if(!n&&!i||w.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]=lv(p);v&&y?!S.shiftKey&&u===y?(S.preventDefault(),n&&Gt(v,{select:!0})):S.shiftKey&&u===v&&(S.preventDefault(),n&&Gt(y,{select:!0})):u===p&&S.preventDefault()}},[n,i,w.paused]);return g.jsx(sv.div,{tabIndex:-1,...l,ref:b,onKeyDown:C})});Ri.displayName=rv;function ov(e,{select:t=!1}={}){const n=document.activeElement;for(const i of e)if(Gt(i,{select:t}),document.activeElement!==n)return}function lv(e){const t=nu(e),n=va(t,e),i=va(t.reverse(),e);return[n,i]}function nu(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 va(e,t){for(const n of e)if(!av(n,{upTo:t}))return n}function av(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 cv(e){return e instanceof HTMLInputElement&&"select"in e}function Gt(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&cv(e)&&t&&e.select()}}var ba=uv();function uv(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=ya(e,t),e.unshift(t)},remove(t){var n;e=ya(e,t),(n=e[0])==null||n.resume()}}}function ya(e,t){const n=[...e],i=n.indexOf(t);return i!==-1&&n.splice(i,1),n}function dv(e){return e.filter(t=>t.tagName!=="A")}var fv=m[" useId ".trim().toString()]||(()=>{}),hv=0;function st(e){const[t,n]=m.useState(fv());return Ye(()=>{n(i=>i??String(hv++))},[e]),e||(t?`radix-${t}`:"")}const pv=["top","right","bottom","left"],en=Math.min,ot=Math.max,fs=Math.round,ts=Math.floor,Dt=e=>({x:e,y:e}),mv={left:"right",right:"left",bottom:"top",top:"bottom"},gv={start:"end",end:"start"};function Vr(e,t,n){return ot(e,en(t,n))}function Vt(e,t){return typeof e=="function"?e(t):e}function Wt(e){return e.split("-")[0]}function Kn(e){return e.split("-")[1]}function xo(e){return e==="x"?"y":"x"}function _o(e){return e==="y"?"height":"width"}const vv=new Set(["top","bottom"]);function Mt(e){return vv.has(Wt(e))?"y":"x"}function wo(e){return xo(Mt(e))}function bv(e,t,n){n===void 0&&(n=!1);const i=Kn(e),s=wo(e),o=_o(s);let l=s==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(l=hs(l)),[l,hs(l)]}function yv(e){const t=hs(e);return[Wr(e),t,Wr(t)]}function Wr(e){return e.replace(/start|end/g,t=>gv[t])}const xa=["left","right"],_a=["right","left"],xv=["top","bottom"],_v=["bottom","top"];function wv(e,t,n){switch(e){case"top":case"bottom":return n?t?_a:xa:t?xa:_a;case"left":case"right":return t?xv:_v;default:return[]}}function Cv(e,t,n,i){const s=Kn(e);let o=wv(Wt(e),n==="start",i);return s&&(o=o.map(l=>l+"-"+s),t&&(o=o.concat(o.map(Wr)))),o}function hs(e){return e.replace(/left|right|bottom|top/g,t=>mv[t])}function Sv(e){return{top:0,right:0,bottom:0,left:0,...e}}function iu(e){return typeof e!="number"?Sv(e):{top:e,right:e,bottom:e,left:e}}function ps(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 wa(e,t,n){let{reference:i,floating:s}=e;const o=Mt(t),l=wo(t),a=_o(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 w;switch(r){case"top":w={x:d,y:i.y-s.height};break;case"bottom":w={x:d,y:i.y+i.height};break;case"right":w={x:i.x+i.width,y:h};break;case"left":w={x:i.x-s.width,y:h};break;default:w={x:i.x,y:i.y}}switch(Kn(t)){case"start":w[l]-=b*(n&&f?-1:1);break;case"end":w[l]+=b*(n&&f?-1:1);break}return w}const Ev=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}=wa(f,i,r),b=i,w={},C=0;for(let S=0;S<a.length;S++){const{name:c,fn:u}=a[S],{x:p,y:v,data:y,reset:_}=await u({x:d,y:h,initialPlacement:i,placement:b,strategy:s,middlewareData:w,rects:f,platform:l,elements:{reference:e,floating:t}});d=p??d,h=v??h,w={...w,[c]:{...w[c],...y}},_&&C<=50&&(C++,typeof _=="object"&&(_.placement&&(b=_.placement),_.rects&&(f=_.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:s}):_.rects),{x:d,y:h}=wa(f,b,r)),S=-1)}return{x:d,y:h,placement:b,strategy:s,middlewareData:w}};async function vi(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:w=0}=Vt(t,e),C=iu(w),c=a[b?h==="floating"?"reference":"floating":h],u=ps(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},_=ps(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:p,offsetParent:v,strategy:r}):p);return{top:(u.top-_.top+C.top)/y.y,bottom:(_.bottom-u.bottom+C.bottom)/y.y,left:(u.left-_.left+C.left)/y.x,right:(_.right-u.right+C.right)/y.x}}const Nv=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=iu(d),b={x:n,y:i},w=wo(s),C=_o(w),S=await l.getDimensions(f),c=w==="y",u=c?"top":"left",p=c?"bottom":"right",v=c?"clientHeight":"clientWidth",y=o.reference[C]+o.reference[w]-b[w]-o.floating[C],_=b[w]-o.reference[w],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 T=y/2-_/2,N=E/2-S[C]/2-1,k=en(h[u],N),D=en(h[p],N),M=k,A=E-S[C]-D,R=E/2-S[C]/2+T,z=Vr(M,R,A),V=!r.arrow&&Kn(s)!=null&&R!==z&&o.reference[C]/2-(R<M?k:D)-S[C]/2<0,H=V?R<M?R-M:R-A:0;return{[w]:b[w]+H,data:{[w]:z,centerOffset:R-z-H,...V&&{alignmentOffset:H}},reset:V}}}),Tv=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:w="bestFit",fallbackAxisSideDirection:C="none",flipAlignment:S=!0,...c}=Vt(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const u=Wt(s),p=Mt(a),v=Wt(a)===a,y=await(r.isRTL==null?void 0:r.isRTL(f.floating)),_=b||(v||!S?[hs(a)]:yv(a)),x=C!=="none";!b&&x&&_.push(...Cv(a,S,C,y));const E=[a,..._],T=await vi(t,c),N=[];let k=((i=o.flip)==null?void 0:i.overflows)||[];if(d&&N.push(T[u]),h){const R=bv(s,l,y);N.push(T[R[0]],T[R[1]])}if(k=[...k,{placement:s,overflows:N}],!N.every(R=>R<=0)){var D,M;const R=(((D=o.flip)==null?void 0:D.index)||0)+1,z=E[R];if(z&&(!(h==="alignment"?p!==Mt(z):!1)||k.every(F=>Mt(F.placement)===p?F.overflows[0]>0:!0)))return{data:{index:R,overflows:k},reset:{placement:z}};let V=(M=k.filter(H=>H.overflows[0]<=0).sort((H,F)=>H.overflows[1]-F.overflows[1])[0])==null?void 0:M.placement;if(!V)switch(w){case"bestFit":{var A;const H=(A=k.filter(F=>{if(x){const L=Mt(F.placement);return L===p||L==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(L=>L>0).reduce((L,O)=>L+O,0)]).sort((F,L)=>F[1]-L[1])[0])==null?void 0:A[0];H&&(V=H);break}case"initialPlacement":V=a;break}if(s!==V)return{reset:{placement:V}}}return{}}}};function Ca(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Sa(e){return pv.some(t=>e[t]>=0)}const kv=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 vi(t,{...s,elementContext:"reference"}),l=Ca(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:Sa(l)}}}case"escaped":{const o=await vi(t,{...s,altBoundary:!0}),l=Ca(o,n.floating);return{data:{escapedOffsets:l,escaped:Sa(l)}}}default:return{}}}}},su=new Set(["left","top"]);async function Mv(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=Kn(n),r=Mt(n)==="y",f=su.has(l)?-1:1,d=o&&r?-1:1,h=Vt(t,e);let{mainAxis:b,crossAxis:w,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"&&(w=a==="end"?C*-1:C),r?{x:w*d,y:b*f}:{x:b*f,y:w*d}}const Av=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 Mv(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}}}}},Dv=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 vi(t,r),h=Mt(Wt(s)),b=xo(h);let w=f[b],C=f[h];if(o){const c=b==="y"?"top":"left",u=b==="y"?"bottom":"right",p=w+d[c],v=w-d[u];w=Vr(p,w,v)}if(l){const c=h==="y"?"top":"left",u=h==="y"?"bottom":"right",p=C+d[c],v=C-d[u];C=Vr(p,C,v)}const S=a.fn({...t,[b]:w,[h]:C});return{...S,data:{x:S.x-n,y:S.y-i,enabled:{[b]:o,[h]:l}}}}}},Rv=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=Mt(s),b=xo(h);let w=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,_=o.reference[b]+o.reference[v]-c.mainAxis;w<y?w=y:w>_&&(w=_)}if(f){var u,p;const v=b==="y"?"width":"height",y=su.has(Wt(s)),_=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<_?C=_:C>x&&(C=x)}return{[b]:w,[h]:C}}}},Lv=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 vi(t,f),h=Wt(s),b=Kn(s),w=Mt(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=en(S-d[c],p),_=en(C-d[u],v),x=!t.middlewareData.shift;let E=y,T=_;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(T=v),(i=t.middlewareData.shift)!=null&&i.enabled.y&&(E=p),x&&!b){const k=ot(d.left,0),D=ot(d.right,0),M=ot(d.top,0),A=ot(d.bottom,0);w?T=C-2*(k!==0||D!==0?k+D:ot(d.left,d.right)):E=S-2*(M!==0||A!==0?M+A:ot(d.top,d.bottom))}await r({...t,availableWidth:T,availableHeight:E});const N=await l.getDimensions(a.floating);return C!==N.width||S!==N.height?{reset:{rects:!0}}:{}}}};function Ds(){return typeof window<"u"}function Xn(e){return ru(e)?(e.nodeName||"").toLowerCase():"#document"}function at(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Lt(e){var t;return(t=(ru(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ru(e){return Ds()?e instanceof Node||e instanceof at(e).Node:!1}function Ct(e){return Ds()?e instanceof Element||e instanceof at(e).Element:!1}function Rt(e){return Ds()?e instanceof HTMLElement||e instanceof at(e).HTMLElement:!1}function Ea(e){return!Ds()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof at(e).ShadowRoot}const Ov=new Set(["inline","contents"]);function Li(e){const{overflow:t,overflowX:n,overflowY:i,display:s}=St(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+n)&&!Ov.has(s)}const Pv=new Set(["table","td","th"]);function Iv(e){return Pv.has(Xn(e))}const Bv=[":popover-open",":modal"];function Rs(e){return Bv.some(t=>{try{return e.matches(t)}catch{return!1}})}const Fv=["transform","translate","scale","rotate","perspective"],jv=["transform","translate","scale","rotate","perspective","filter"],zv=["paint","layout","strict","content"];function Co(e){const t=So(),n=Ct(e)?St(e):e;return Fv.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)||jv.some(i=>(n.willChange||"").includes(i))||zv.some(i=>(n.contain||"").includes(i))}function Hv(e){let t=tn(e);for(;Rt(t)&&!Hn(t);){if(Co(t))return t;if(Rs(t))return null;t=tn(t)}return null}function So(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Vv=new Set(["html","body","#document"]);function Hn(e){return Vv.has(Xn(e))}function St(e){return at(e).getComputedStyle(e)}function Ls(e){return Ct(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function tn(e){if(Xn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ea(e)&&e.host||Lt(e);return Ea(t)?t.host:t}function ou(e){const t=tn(e);return Hn(t)?e.ownerDocument?e.ownerDocument.body:e.body:Rt(t)&&Li(t)?t:ou(t)}function bi(e,t,n){var i;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=ou(e),o=s===((i=e.ownerDocument)==null?void 0:i.body),l=at(s);if(o){const a=$r(l);return t.concat(l,l.visualViewport||[],Li(s)?s:[],a&&n?bi(a):[])}return t.concat(s,bi(s,[],n))}function $r(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function lu(e){const t=St(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=fs(n)!==o||fs(i)!==l;return a&&(n=o,i=l),{width:n,height:i,$:a}}function Eo(e){return Ct(e)?e:e.contextElement}function Rn(e){const t=Eo(e);if(!Rt(t))return Dt(1);const n=t.getBoundingClientRect(),{width:i,height:s,$:o}=lu(t);let l=(o?fs(n.width):n.width)/i,a=(o?fs(n.height):n.height)/s;return(!l||!Number.isFinite(l))&&(l=1),(!a||!Number.isFinite(a))&&(a=1),{x:l,y:a}}const Wv=Dt(0);function au(e){const t=at(e);return!So()||!t.visualViewport?Wv:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function $v(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==at(e)?!1:t}function pn(e,t,n,i){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),o=Eo(e);let l=Dt(1);t&&(i?Ct(i)&&(l=Rn(i)):l=Rn(e));const a=$v(o,n,i)?au(o):Dt(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=at(o),w=i&&Ct(i)?at(i):i;let C=b,S=$r(C);for(;S&&i&&w!==C;){const c=Rn(S),u=S.getBoundingClientRect(),p=St(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=at(S),S=$r(C)}}return ps({width:d,height:h,x:r,y:f})}function Os(e,t){const n=Ls(e).scrollLeft;return t?t.left+n:pn(Lt(e)).left+n}function cu(e,t){const n=e.getBoundingClientRect(),i=n.left+t.scrollLeft-Os(e,n),s=n.top+t.scrollTop;return{x:i,y:s}}function Uv(e){let{elements:t,rect:n,offsetParent:i,strategy:s}=e;const o=s==="fixed",l=Lt(i),a=t?Rs(t.floating):!1;if(i===l||a&&o)return n;let r={scrollLeft:0,scrollTop:0},f=Dt(1);const d=Dt(0),h=Rt(i);if((h||!h&&!o)&&((Xn(i)!=="body"||Li(l))&&(r=Ls(i)),Rt(i))){const w=pn(i);f=Rn(i),d.x=w.x+i.clientLeft,d.y=w.y+i.clientTop}const b=l&&!h&&!o?cu(l,r):Dt(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 Yv(e){return Array.from(e.getClientRects())}function qv(e){const t=Lt(e),n=Ls(e),i=e.ownerDocument.body,s=ot(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),o=ot(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight);let l=-n.scrollLeft+Os(e);const a=-n.scrollTop;return St(i).direction==="rtl"&&(l+=ot(t.clientWidth,i.clientWidth)-s),{width:s,height:o,x:l,y:a}}const Na=25;function Zv(e,t){const n=at(e),i=Lt(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=So();(!d||d&&t==="fixed")&&(a=s.offsetLeft,r=s.offsetTop)}const f=Os(i);if(f<=0){const d=i.ownerDocument,h=d.body,b=getComputedStyle(h),w=d.compatMode==="CSS1Compat"&&parseFloat(b.marginLeft)+parseFloat(b.marginRight)||0,C=Math.abs(i.clientWidth-h.clientWidth-w);C<=Na&&(o-=C)}else f<=Na&&(o+=f);return{width:o,height:l,x:a,y:r}}const Gv=new Set(["absolute","fixed"]);function Kv(e,t){const n=pn(e,!0,t==="fixed"),i=n.top+e.clientTop,s=n.left+e.clientLeft,o=Rt(e)?Rn(e):Dt(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 Ta(e,t,n){let i;if(t==="viewport")i=Zv(e,n);else if(t==="document")i=qv(Lt(e));else if(Ct(t))i=Kv(t,n);else{const s=au(e);i={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return ps(i)}function uu(e,t){const n=tn(e);return n===t||!Ct(n)||Hn(n)?!1:St(n).position==="fixed"||uu(n,t)}function Xv(e,t){const n=t.get(e);if(n)return n;let i=bi(e,[],!1).filter(a=>Ct(a)&&Xn(a)!=="body"),s=null;const o=St(e).position==="fixed";let l=o?tn(e):e;for(;Ct(l)&&!Hn(l);){const a=St(l),r=Co(l);!r&&a.position==="fixed"&&(s=null),(o?!r&&!s:!r&&a.position==="static"&&!!s&&Gv.has(s.position)||Li(l)&&!r&&uu(e,l))?i=i.filter(d=>d!==l):s=a,l=tn(l)}return t.set(e,i),i}function Qv(e){let{element:t,boundary:n,rootBoundary:i,strategy:s}=e;const l=[...n==="clippingAncestors"?Rs(t)?[]:Xv(t,this._c):[].concat(n),i],a=l[0],r=l.reduce((f,d)=>{const h=Ta(t,d,s);return f.top=ot(h.top,f.top),f.right=en(h.right,f.right),f.bottom=en(h.bottom,f.bottom),f.left=ot(h.left,f.left),f},Ta(t,a,s));return{width:r.right-r.left,height:r.bottom-r.top,x:r.left,y:r.top}}function Jv(e){const{width:t,height:n}=lu(e);return{width:t,height:n}}function eb(e,t,n){const i=Rt(t),s=Lt(t),o=n==="fixed",l=pn(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const r=Dt(0);function f(){r.x=Os(s)}if(i||!i&&!o)if((Xn(t)!=="body"||Li(s))&&(a=Ls(t)),i){const w=pn(t,!0,o,t);r.x=w.x+t.clientLeft,r.y=w.y+t.clientTop}else s&&f();o&&!i&&s&&f();const d=s&&!i&&!o?cu(s,a):Dt(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 _r(e){return St(e).position==="static"}function ka(e,t){if(!Rt(e)||St(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Lt(e)===n&&(n=n.ownerDocument.body),n}function du(e,t){const n=at(e);if(Rs(e))return n;if(!Rt(e)){let s=tn(e);for(;s&&!Hn(s);){if(Ct(s)&&!_r(s))return s;s=tn(s)}return n}let i=ka(e,t);for(;i&&Iv(i)&&_r(i);)i=ka(i,t);return i&&Hn(i)&&_r(i)&&!Co(i)?n:i||Hv(e)||n}const tb=async function(e){const t=this.getOffsetParent||du,n=this.getDimensions,i=await n(e.floating);return{reference:eb(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function nb(e){return St(e).direction==="rtl"}const ib={convertOffsetParentRelativeRectToViewportRelativeRect:Uv,getDocumentElement:Lt,getClippingRect:Qv,getOffsetParent:du,getElementRects:tb,getClientRects:Yv,getDimensions:Jv,getScale:Rn,isElement:Ct,isRTL:nb};function fu(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function sb(e,t){let n=null,i;const s=Lt(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:w}=f;if(a||t(),!b||!w)return;const C=ts(h),S=ts(s.clientWidth-(d+b)),c=ts(s.clientHeight-(h+w)),u=ts(d),v={rootMargin:-C+"px "+-S+"px "+-c+"px "+-u+"px",threshold:ot(0,en(1,r))||1};let y=!0;function _(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&&!fu(f,e.getBoundingClientRect())&&l(),y=!1}try{n=new IntersectionObserver(_,{...v,root:s.ownerDocument})}catch{n=new IntersectionObserver(_,v)}n.observe(e)}return l(!0),o}function rb(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=Eo(e),d=s||o?[...f?bi(f):[],...bi(t)]:[];d.forEach(u=>{s&&u.addEventListener("scroll",n,{passive:!0}),o&&u.addEventListener("resize",n)});const h=f&&a?sb(f,n):null;let b=-1,w=null;l&&(w=new ResizeObserver(u=>{let[p]=u;p&&p.target===f&&w&&(w.unobserve(t),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var v;(v=w)==null||v.observe(t)})),n()}),f&&!r&&w.observe(f),w.observe(t));let C,S=r?pn(e):null;r&&c();function c(){const u=pn(e);S&&!fu(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=w)==null||u.disconnect(),w=null,r&&cancelAnimationFrame(C)}}const ob=Av,lb=Dv,ab=Tv,cb=Lv,ub=kv,Ma=Nv,db=Rv,fb=(e,t,n)=>{const i=new Map,s={platform:ib,...n},o={...s.platform,_c:i};return Ev(e,t,{...s,platform:o})};var hb=typeof document<"u",pb=function(){},ls=hb?K.useLayoutEffect:pb;function ms(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(!ms(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)&&!ms(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function hu(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Aa(e,t){const n=hu(e);return Math.round(t*n)/n}function wr(e){const t=m.useRef(e);return ls(()=>{t.current=e}),t}function mb(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,w]=m.useState(i);ms(b,i)||w(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,_=l||c,x=m.useRef(null),E=m.useRef(null),T=m.useRef(d),N=r!=null,k=wr(r),D=wr(s),M=wr(f),A=m.useCallback(()=>{if(!x.current||!E.current)return;const F={placement:t,strategy:n,middleware:b};D.current&&(F.platform=D.current),fb(x.current,E.current,F).then(L=>{const O={...L,isPositioned:M.current!==!1};R.current&&!ms(T.current,O)&&(T.current=O,Ti.flushSync(()=>{h(O)}))})},[b,t,n,D,M]);ls(()=>{f===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,h(F=>({...F,isPositioned:!1})))},[f]);const R=m.useRef(!1);ls(()=>(R.current=!0,()=>{R.current=!1}),[]),ls(()=>{if(y&&(x.current=y),_&&(E.current=_),y&&_){if(k.current)return k.current(y,_,A);A()}},[y,_,A,k,N]);const z=m.useMemo(()=>({reference:x,floating:E,setReference:p,setFloating:v}),[p,v]),V=m.useMemo(()=>({reference:y,floating:_}),[y,_]),H=m.useMemo(()=>{const F={position:n,left:0,top:0};if(!V.floating)return F;const L=Aa(V.floating,d.x),O=Aa(V.floating,d.y);return a?{...F,transform:"translate("+L+"px, "+O+"px)",...hu(V.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:L,top:O}},[n,a,V.floating,d.x,d.y]);return m.useMemo(()=>({...d,update:A,refs:z,elements:V,floatingStyles:H}),[d,A,z,V,H])}const gb=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?Ma({element:i.current,padding:s}).fn(n):{}:i?Ma({element:i,padding:s}).fn(n):{}}}},vb=(e,t)=>({...ob(e),options:[e,t]}),bb=(e,t)=>({...lb(e),options:[e,t]}),yb=(e,t)=>({...db(e),options:[e,t]}),xb=(e,t)=>({...ab(e),options:[e,t]}),_b=(e,t)=>({...cb(e),options:[e,t]}),wb=(e,t)=>({...ub(e),options:[e,t]}),Cb=(e,t)=>({...gb(e),options:[e,t]});function Sb(e){const t=Eb(e),n=m.forwardRef((i,s)=>{const{children:o,...l}=i,a=m.Children.toArray(o),r=a.find(Tb);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 Eb(e){const t=m.forwardRef((n,i)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const l=Mb(s),a=kb(o,s.props);return s.type!==m.Fragment&&(a.ref=i?ze(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 Nb=Symbol("radix.slottable");function Tb(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Nb}function kb(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 Mb(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 Ab=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Db=Ab.reduce((e,t)=>{const n=Sb(`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}},{}),Rb="Arrow",pu=m.forwardRef((e,t)=>{const{children:n,width:i=10,height:s=5,...o}=e;return g.jsx(Db.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"})})});pu.displayName=Rb;var Lb=pu;function Ob(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:w,...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:w})};f.displayName=o+"Provider";function d(h,b){var S;const w=((S=b==null?void 0:b[e])==null?void 0:S[r])||a,C=m.useContext(w);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,Pb(s,...t)]}function Pb(...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 Ib(e){const t=Bb(e),n=m.forwardRef((i,s)=>{const{children:o,...l}=i,a=m.Children.toArray(o),r=a.find(jb);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 Bb(e){const t=m.forwardRef((n,i)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const l=Hb(s),a=zb(o,s.props);return s.type!==m.Fragment&&(a.ref=i?ze(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 Fb=Symbol("radix.slottable");function jb(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Fb}function zb(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 Hb(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 Vb=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],mu=Vb.reduce((e,t)=>{const n=Ib(`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}},{}),No="Popper",[gu,nn]=Ob(No),[Wb,vu]=gu(No),bu=e=>{const{__scopePopper:t,children:n}=e,[i,s]=m.useState(null);return g.jsx(Wb,{scope:t,anchor:i,onAnchorChange:s,children:n})};bu.displayName=No;var yu="PopperAnchor",xu=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:i,...s}=e,o=vu(yu,n),l=m.useRef(null),a=ve(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(mu.div,{...s,ref:a})});xu.displayName=yu;var To="PopperContent",[$b,Ub]=gu(To),_u=m.forwardRef((e,t)=>{var W,X,q,G,ee,re;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:w="optimized",onPlaced:C,...S}=e,c=vu(To,n),[u,p]=m.useState(null),v=ve(t,ce=>p(ce)),[y,_]=m.useState(null),x=po(y),E=(x==null?void 0:x.width)??0,T=(x==null?void 0:x.height)??0,N=i+(o!=="center"?"-"+o:""),k=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},D=Array.isArray(f)?f:[f],M=D.length>0,A={padding:k,boundary:D.filter(qb),altBoundary:M},{refs:R,floatingStyles:z,placement:V,isPositioned:H,middlewareData:F}=mb({strategy:"fixed",placement:N,whileElementsMounted:(...ce)=>rb(...ce,{animationFrame:w==="always"}),elements:{reference:c.anchor},middleware:[vb({mainAxis:s+T,alignmentAxis:l}),r&&bb({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?yb():void 0,...A}),r&&xb({...A}),_b({...A,apply:({elements:ce,rects:ie,availableWidth:le,availableHeight:we})=>{const{width:Ce,height:be}=ie.reference,Ne=ce.floating.style;Ne.setProperty("--radix-popper-available-width",`${le}px`),Ne.setProperty("--radix-popper-available-height",`${we}px`),Ne.setProperty("--radix-popper-anchor-width",`${Ce}px`),Ne.setProperty("--radix-popper-anchor-height",`${be}px`)}}),y&&Cb({element:y,padding:a}),Zb({arrowWidth:E,arrowHeight:T}),b&&wb({strategy:"referenceHidden",...A})]}),[L,O]=Su(V),j=Ze(C);Ye(()=>{H&&(j==null||j())},[H,j]);const P=(W=F.arrow)==null?void 0:W.x,U=(X=F.arrow)==null?void 0:X.y,I=((q=F.arrow)==null?void 0:q.centerOffset)!==0,[$,Q]=m.useState();return Ye(()=>{u&&Q(window.getComputedStyle(u).zIndex)},[u]),g.jsx("div",{ref:R.setFloating,"data-radix-popper-content-wrapper":"",style:{...z,transform:H?z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:$,"--radix-popper-transform-origin":[(G=F.transformOrigin)==null?void 0:G.x,(ee=F.transformOrigin)==null?void 0:ee.y].join(" "),...((re=F.hide)==null?void 0:re.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:g.jsx($b,{scope:n,placedSide:L,onArrowChange:_,arrowX:P,arrowY:U,shouldHideArrow:I,children:g.jsx(mu.div,{"data-side":L,"data-align":O,...S,ref:v,style:{...S.style,animation:H?void 0:"none"}})})})});_u.displayName=To;var wu="PopperArrow",Yb={top:"bottom",right:"left",bottom:"top",left:"right"},Cu=m.forwardRef(function(t,n){const{__scopePopper:i,...s}=t,o=Ub(wu,i),l=Yb[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(Lb,{...s,ref:n,style:{...s.style,display:"block"}})})});Cu.displayName=wu;function qb(e){return e!==null}var Zb=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]=Su(n),h={start:"0%",center:"50%",end:"100%"}[d],b=(((u=s.arrow)==null?void 0:u.x)??0)+a/2,w=(((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:`${w}px`):f==="left"&&(C=`${i.floating.width+r}px`,S=l?h:`${w}px`),{data:{x:C,y:S}}}});function Su(e){const[t,n="center"]=e.split("-");return[t,n]}var Oi=bu,Pi=xu,Ps=_u,Is=Cu;function Gb(e){const t=Kb(e),n=m.forwardRef((i,s)=>{const{children:o,...l}=i,a=m.Children.toArray(o),r=a.find(Qb);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 Kb(e){const t=m.forwardRef((n,i)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const l=ey(s),a=Jb(o,s.props);return s.type!==m.Fragment&&(a.ref=i?ze(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 Xb=Symbol("radix.slottable");function Qb(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Xb}function Jb(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 ey(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 ty=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ny=ty.reduce((e,t)=>{const n=Gb(`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}},{}),iy="Portal",Ii=m.forwardRef((e,t)=>{var a;const{container:n,...i}=e,[s,o]=m.useState(!1);Ye(()=>o(!0),[]);const l=n||s&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return l?bc.createPortal(g.jsx(ny.div,{...i,ref:t}),l):null});Ii.displayName=iy;function Eu(e){const t=sy(e),n=m.forwardRef((i,s)=>{const{children:o,...l}=i,a=m.Children.toArray(o),r=a.find(oy);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=ay(s),a=ly(o,s.props);return s.type!==m.Fragment&&(a.ref=i?ze(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 ry=Symbol("radix.slottable");function oy(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ry}function ly(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 ay(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 cy=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ut=cy.reduce((e,t)=>{const n=Eu(`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 uy(e){const t=dy(e),n=m.forwardRef((i,s)=>{const{children:o,...l}=i,a=m.Children.toArray(o),r=a.find(hy);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 dy(e){const t=m.forwardRef((n,i)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const l=my(s),a=py(o,s.props);return s.type!==m.Fragment&&(a.ref=i?ze(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 fy=Symbol("radix.slottable");function hy(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===fy}function py(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 my(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 gy=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],vy=gy.reduce((e,t)=>{const n=uy(`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}},{}),Nu=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"}),by="VisuallyHidden",Tu=m.forwardRef((e,t)=>g.jsx(vy.span,{...e,ref:t,style:{...Nu,...e.style}}));Tu.displayName=by;var yy=Tu,xy=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},wn=new WeakMap,ns=new WeakMap,is={},Cr=0,ku=function(e){return e&&(e.host||ku(e.parentNode))},_y=function(e,t){return t.map(function(n){if(e.contains(n))return n;var i=ku(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})},wy=function(e,t,n,i){var s=_y(t,Array.isArray(e)?e:[e]);is[n]||(is[n]=new WeakMap);var o=is[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 w=b.getAttribute(i),C=w!==null&&w!=="false",S=(wn.get(b)||0)+1,c=(o.get(b)||0)+1;wn.set(b,S),o.set(b,c),l.push(b),S===1&&C&&ns.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(),Cr++,function(){l.forEach(function(h){var b=wn.get(h)-1,w=o.get(h)-1;wn.set(h,b),o.set(h,w),b||(ns.has(h)||h.removeAttribute(i),ns.delete(h)),w||h.removeAttribute(n)}),Cr--,Cr||(wn=new WeakMap,wn=new WeakMap,ns=new WeakMap,is={})}},Bs=function(e,t,n){n===void 0&&(n="data-aria-hidden");var i=Array.from(Array.isArray(e)?e:[e]),s=xy(e);return s?(i.push.apply(i,Array.from(s.querySelectorAll("[aria-live], script"))),wy(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 Mu(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 Cy(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 as="right-scroll-bar-position",cs="width-before-scroll-bar",Sy="with-scroll-bars-hidden",Ey="--removed-body-scroll-bar-size";function Sr(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Ny(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 Ty=typeof window<"u"?m.useLayoutEffect:m.useEffect,Da=new WeakMap;function ky(e,t){var n=Ny(null,function(i){return e.forEach(function(s){return Sr(s,i)})});return Ty(function(){var i=Da.get(n);if(i){var s=new Set(i),o=new Set(e),l=n.current;s.forEach(function(a){o.has(a)||Sr(a,null)}),o.forEach(function(a){s.has(a)||Sr(a,l)})}Da.set(n,e)},[e]),n}function My(e){return e}function Ay(e,t){t===void 0&&(t=My);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 Dy(e){e===void 0&&(e={});var t=Ay(null);return t.options=kt({async:!0,ssr:!1},e),t}var Au=function(e){var t=e.sideCar,n=Mu(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))};Au.isSideCarExport=!0;function Ry(e,t){return e.useMedium(t),Au}var Du=Dy(),Er=function(){},Fs=m.forwardRef(function(e,t){var n=m.useRef(null),i=m.useState({onScrollCapture:Er,onWheelCapture:Er,onTouchMoveCapture:Er}),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,w=e.noRelative,C=e.noIsolation,S=e.inert,c=e.allowPinchZoom,u=e.as,p=u===void 0?"div":u,v=e.gapMode,y=Mu(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),_=b,x=ky([n,t]),E=kt(kt({},y),s);return m.createElement(m.Fragment,null,d&&m.createElement(_,{sideCar:Du,removeScrollBar:f,shards:h,noRelative:w,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))});Fs.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Fs.classNames={fullWidth:cs,zeroRight:as};var Ly=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Oy(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Ly();return t&&e.setAttribute("nonce",t),e}function Py(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Iy(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var By=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Oy())&&(Py(t,n),Iy(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Fy=function(){var e=By();return function(t,n){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Ru=function(){var e=Fy(),t=function(n){var i=n.styles,s=n.dynamic;return e(i,s),null};return t},jy={left:0,top:0,right:0,gap:0},Nr=function(e){return parseInt(e||"",10)||0},zy=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[Nr(n),Nr(i),Nr(s)]},Hy=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return jy;var t=zy(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])}},Vy=Ru(),Ln="data-scroll-locked",Wy=function(e,t,n,i){var s=e.left,o=e.top,l=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
181
|
+
*/const Pn=Ae("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Ts=Es("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"}}),_e=m.forwardRef(({className:e,variant:t,size:n,asChild:i=!1,loading:s=!1,children:o,disabled:l,...a},r)=>{const f=i?Em:"button";return g.jsxs(f,{className:J(Ts({variant:t,size:n,className:e})),ref:r,disabled:l||s,...a,children:[s&&g.jsx(hn,{className:"mr-2 h-4 w-4 animate-spin"}),o]})});_e.displayName="Button";const ht=m.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:J("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));ht.displayName="Card";const In=m.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:J("flex flex-col space-y-1.5 p-6",e),...t}));In.displayName="CardHeader";const Bn=m.forwardRef(({className:e,...t},n)=>g.jsx("h3",{ref:n,className:J("text-2xl font-semibold leading-none tracking-tight",e),...t}));Bn.displayName="CardTitle";const Fn=m.forwardRef(({className:e,...t},n)=>g.jsx("p",{ref:n,className:J("text-sm text-muted-foreground",e),...t}));Fn.displayName="CardDescription";const pt=m.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:J("p-6 pt-0",e),...t}));pt.displayName="CardContent";const Lc=m.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:J("flex items-center p-6 pt-0",e),...t}));Lc.displayName="CardFooter";const Oc=Es("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 ai({className:e,variant:t,...n}){return g.jsx("div",{className:J(Oc({variant:t}),e),...n})}const jn=m.forwardRef(({className:e,type:t,...n},i)=>g.jsx("input",{type:t,className:J("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}));jn.displayName="Input";var jg=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Mi=jg.reduce((e,t)=>{const n=_c(`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}},{}),zg="Label",Pc=m.forwardRef((e,t)=>g.jsx(Mi.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())}}));Pc.displayName=zg;var Ic=Pc;const Hg=Es("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Xt=m.forwardRef(({className:e,...t},n)=>g.jsx(Ic,{ref:n,className:J(Hg(),e),...t}));Xt.displayName=Ic.displayName;const fo=m.forwardRef(({className:e,...t},n)=>g.jsx("textarea",{className:J("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}));fo.displayName="Textarea";function Vg(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,...w}=h,S=((u=b==null?void 0:b[e])==null?void 0:u[r])||a,c=m.useMemo(()=>w,Object.values(w));return g.jsx(S.Provider,{value:c,children:C})};f.displayName=o+"Provider";function d(h,b){var S;const C=((S=b==null?void 0:b[e])==null?void 0:S[r])||a,w=m.useContext(C);if(w)return w;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,Wg(s,...t)]}function Wg(...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 Ye=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},$g=m[" useInsertionEffect ".trim().toString()]||Ye;function wt({prop:e,defaultProp:t,onChange:n=()=>{},caller:i}){const[s,o,l]=Ug({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=Yg(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 Ug({defaultProp:e,onChange:t}){const[n,i]=m.useState(e),s=m.useRef(n),o=m.useRef(t);return $g(()=>{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 Yg(e){return typeof e=="function"}function ho(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 po(e){const[t,n]=m.useState(void 0);return Ye(()=>{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 qg(e,t){return m.useReducer((n,i)=>t[n][i]??n,e)}var Ke=e=>{const{present:t,children:n}=e,i=Zg(t),s=typeof n=="function"?n({present:i.isPresent}):m.Children.only(n),o=ve(i.ref,Gg(s));return typeof n=="function"||i.isPresent?m.cloneElement(s,{ref:o}):null};Ke.displayName="Presence";function Zg(e){const[t,n]=m.useState(),i=m.useRef(null),s=m.useRef(e),o=m.useRef("none"),l=e?"mounted":"unmounted",[a,r]=qg(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const f=es(i.current);o.current=a==="mounted"?f:"none"},[a]),Ye(()=>{const f=i.current,d=s.current;if(d!==e){const b=o.current,C=es(f);e?r("MOUNT"):C==="none"||(f==null?void 0:f.display)==="none"?r("UNMOUNT"):r(d&&b!==C?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,r]),Ye(()=>{if(t){let f;const d=t.ownerDocument.defaultView??window,h=C=>{const S=es(i.current).includes(CSS.escape(C.animationName));if(C.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=C=>{C.target===t&&(o.current=es(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 es(e){return(e==null?void 0:e.animationName)||"none"}function Gg(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 Kg(e){const t=Xg(e),n=m.forwardRef((i,s)=>{const{children:o,...l}=i,a=m.Children.toArray(o),r=a.find(Jg);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 Xg(e){const t=m.forwardRef((n,i)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const l=t1(s),a=e1(o,s.props);return s.type!==m.Fragment&&(a.ref=i?ze(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 Qg=Symbol("radix.slottable");function Jg(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Qg}function e1(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 t1(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 n1=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],mo=n1.reduce((e,t)=>{const n=Kg(`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}},{}),ks="Checkbox",[i1]=Vg(ks),[s1,go]=i1(ks);function r1(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,C]=wt({prop:n,defaultProp:s??!1,onChange:r,caller:ks}),[w,S]=m.useState(null),[c,u]=m.useState(null),p=m.useRef(!1),v=w?!!l||!!w.closest("form"):!0,y={checked:b,disabled:o,setChecked:C,control:w,setControl:S,name:a,form:l,value:d,hasConsumerStoppedPropagationRef:p,required:f,defaultChecked:Qt(s)?!1:s,isFormControl:v,bubbleInput:c,setBubbleInput:u};return g.jsx(s1,{scope:t,...y,children:o1(h)?h(y):i})}var Bc="CheckboxTrigger",Fc=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:C,bubbleInput:w}=go(Bc,e),S=ve(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(mo.button,{type:"button",role:"checkbox","aria-checked":Qt(r)?"mixed":r,"aria-required":f,"data-state":Wc(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=>Qt(p)?!0:!p),w&&C&&(b.current=u.isPropagationStopped(),b.current||u.stopPropagation())})})});Fc.displayName=Bc;var vo=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(r1,{__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(Fc,{...h,ref:t,__scopeCheckbox:n}),b&&g.jsx(Vc,{__scopeCheckbox:n})]})})});vo.displayName=ks;var jc="CheckboxIndicator",zc=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:i,...s}=e,o=go(jc,n);return g.jsx(Ke,{present:i||Qt(o.checked)||o.checked===!0,children:g.jsx(mo.span,{"data-state":Wc(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:t,style:{pointerEvents:"none",...e.style}})})});zc.displayName=jc;var Hc="CheckboxBubbleInput",Vc=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:C}=go(Hc,e),w=ve(n,C),S=ho(o),c=po(i);m.useEffect(()=>{const p=b;if(!p)return;const v=window.HTMLInputElement.prototype,_=Object.getOwnPropertyDescriptor(v,"checked").set,x=!s.current;if(S!==o&&_){const E=new Event("click",{bubbles:x});p.indeterminate=Qt(o),_.call(p,Qt(o)?!1:o),p.dispatchEvent(E)}},[b,S,o,s]);const u=m.useRef(Qt(o)?!1:o);return g.jsx(mo.input,{type:"checkbox","aria-hidden":!0,defaultChecked:l??u.current,required:a,disabled:r,name:f,value:d,form:h,...t,tabIndex:-1,ref:w,style:{...t.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Vc.displayName=Hc;function o1(e){return typeof e=="function"}function Qt(e){return e==="indeterminate"}function Wc(e){return Qt(e)?"indeterminate":e?"checked":"unchecked"}const zn=m.forwardRef(({className:e,...t},n)=>g.jsx(vo,{ref:n,className:J("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(zc,{className:J("flex items-center justify-center text-current"),children:g.jsx(gi,{className:"h-4 w-4"})})}));zn.displayName=vo.displayName;function l1(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,...w}=h,S=((u=b==null?void 0:b[e])==null?void 0:u[r])||a,c=m.useMemo(()=>w,Object.values(w));return g.jsx(S.Provider,{value:c,children:C})};f.displayName=o+"Provider";function d(h,b){var S;const C=((S=b==null?void 0:b[e])==null?void 0:S[r])||a,w=m.useContext(C);if(w)return w;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,a1(s,...t)]}function a1(...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 c1(e){const t=u1(e),n=m.forwardRef((i,s)=>{const{children:o,...l}=i,a=m.Children.toArray(o),r=a.find(f1);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 u1(e){const t=m.forwardRef((n,i)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const l=p1(s),a=h1(o,s.props);return s.type!==m.Fragment&&(a.ref=i?ze(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 d1=Symbol("radix.slottable");function f1(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===d1}function h1(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 p1(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 m1=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],$c=m1.reduce((e,t)=>{const n=c1(`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}},{}),Ms="Switch",[g1]=l1(Ms),[v1,b1]=g1(Ms),Uc=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,C]=m.useState(null),w=ve(t,v=>C(v)),S=m.useRef(!1),c=b?d||!!b.closest("form"):!0,[u,p]=wt({prop:s,defaultProp:o??!1,onChange:f,caller:Ms});return g.jsxs(v1,{scope:n,checked:u,disabled:a,children:[g.jsx($c.button,{type:"button",role:"switch","aria-checked":u,"aria-required":l,"data-state":Gc(u),"data-disabled":a?"":void 0,disabled:a,value:r,...h,ref:w,onClick:oe(e.onClick,v=>{p(y=>!y),c&&(S.current=v.isPropagationStopped(),S.current||v.stopPropagation())})}),c&&g.jsx(Zc,{control:b,bubbles:!S.current,name:i,value:r,checked:u,required:l,disabled:a,form:d,style:{transform:"translateX(-100%)"}})]})});Uc.displayName=Ms;var Yc="SwitchThumb",qc=m.forwardRef((e,t)=>{const{__scopeSwitch:n,...i}=e,s=b1(Yc,n);return g.jsx($c.span,{"data-state":Gc(s.checked),"data-disabled":s.disabled?"":void 0,...i,ref:t})});qc.displayName=Yc;var y1="SwitchBubbleInput",Zc=m.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:i=!0,...s},o)=>{const l=m.useRef(null),a=ve(l,o),r=ho(n),f=po(t);return m.useEffect(()=>{const d=l.current;if(!d)return;const h=window.HTMLInputElement.prototype,C=Object.getOwnPropertyDescriptor(h,"checked").set;if(r!==n&&C){const w=new Event("click",{bubbles:i});C.call(d,n),d.dispatchEvent(w)}},[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}})});Zc.displayName=y1;function Gc(e){return e?"checked":"unchecked"}var Kc=Uc,x1=qc;const bo=m.forwardRef(({className:e,...t},n)=>g.jsx(Kc,{className:J("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(x1,{className:J("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")})}));bo.displayName=Kc.displayName;function _1({className:e,...t}){return g.jsx("div",{className:J("animate-pulse rounded-md bg-muted",e),...t})}var w1="Separator",da="horizontal",C1=["horizontal","vertical"],Xc=m.forwardRef((e,t)=>{const{decorative:n,orientation:i=da,...s}=e,o=S1(i)?i:da,a=n?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return g.jsx(Mi.div,{"data-orientation":o,...a,...s,ref:t})});Xc.displayName=w1;function S1(e){return C1.includes(e)}var Qc=Xc;const Ai=m.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...i},s)=>g.jsx(Qc,{ref:s,decorative:n,orientation:t,className:J("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...i}));Ai.displayName=Qc.displayName;function zr(e,[t,n]){return Math.min(n,Math.max(t,e))}function E1(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,...w}=h,S=((u=b==null?void 0:b[e])==null?void 0:u[r])||a,c=m.useMemo(()=>w,Object.values(w));return g.jsx(S.Provider,{value:c,children:C})};f.displayName=o+"Provider";function d(h,b){var S;const C=((S=b==null?void 0:b[e])==null?void 0:S[r])||a,w=m.useContext(C);if(w)return w;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,N1(s,...t)]}function N1(...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 fa(e){const t=T1(e),n=m.forwardRef((i,s)=>{const{children:o,...l}=i,a=m.Children.toArray(o),r=a.find(M1);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 T1(e){const t=m.forwardRef((n,i)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const l=D1(s),a=A1(o,s.props);return s.type!==m.Fragment&&(a.ref=i?ze(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 k1=Symbol("radix.slottable");function M1(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===k1}function A1(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 D1(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 yo(e){const t=e+"CollectionProvider",[n,i]=E1(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=fa(a),f=K.forwardRef((S,c)=>{const{scope:u,children:p}=S,v=o(a,u),y=ve(c,v.collectionRef);return g.jsx(r,{ref:y,children:p})});f.displayName=a;const d=e+"CollectionItemSlot",h="data-radix-collection-item",b=fa(d),C=K.forwardRef((S,c)=>{const{scope:u,children:p,...v}=S,y=K.useRef(null),_=ve(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:_,children:p})});C.displayName=d;function w(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},w,i]}function R1(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,...w}=h,S=((u=b==null?void 0:b[e])==null?void 0:u[r])||a,c=m.useMemo(()=>w,Object.values(w));return g.jsx(S.Provider,{value:c,children:C})};f.displayName=o+"Provider";function d(h,b){var S;const C=((S=b==null?void 0:b[e])==null?void 0:S[r])||a,w=m.useContext(C);if(w)return w;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,L1(s,...t)]}function L1(...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 O1=m.createContext(void 0);function Di(e){const t=m.useContext(O1);return e||t||"ltr"}function P1(e){const t=I1(e),n=m.forwardRef((i,s)=>{const{children:o,...l}=i,a=m.Children.toArray(o),r=a.find(F1);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 I1(e){const t=m.forwardRef((n,i)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const l=z1(s),a=j1(o,s.props);return s.type!==m.Fragment&&(a.ref=i?ze(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 B1=Symbol("radix.slottable");function F1(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===B1}function j1(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 z1(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 H1=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Jc=H1.reduce((e,t)=>{const n=P1(`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 V1(e,t){e&&Ti.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 W1(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 $1="DismissableLayer",Hr="dismissableLayer.update",U1="dismissableLayer.pointerDownOutside",Y1="dismissableLayer.focusOutside",ha,eu=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Gn=m.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:l,onDismiss:a,...r}=e,f=m.useContext(eu),[d,h]=m.useState(null),b=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,C]=m.useState({}),w=ve(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,_=G1(E=>{const T=E.target,N=[...f.branches].some(k=>k.contains(T));!y||N||(s==null||s(E),l==null||l(E),E.defaultPrevented||a==null||a())},b),x=K1(E=>{const T=E.target;[...f.branches].some(k=>k.contains(T))||(o==null||o(E),l==null||l(E),E.defaultPrevented||a==null||a())},b);return W1(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&&(ha=b.body.style.pointerEvents,b.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(d)),f.layers.add(d),pa(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(b.body.style.pointerEvents=ha)}},[d,b,n,f]),m.useEffect(()=>()=>{d&&(f.layers.delete(d),f.layersWithOutsidePointerEventsDisabled.delete(d),pa())},[d,f]),m.useEffect(()=>{const E=()=>C({});return document.addEventListener(Hr,E),()=>document.removeEventListener(Hr,E)},[]),g.jsx(Jc.div,{...r,ref:w,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,_.onPointerDownCapture)})});Gn.displayName=$1;var q1="DismissableLayerBranch",Z1=m.forwardRef((e,t)=>{const n=m.useContext(eu),i=m.useRef(null),s=ve(t,i);return m.useEffect(()=>{const o=i.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),g.jsx(Jc.div,{...e,ref:s})});Z1.displayName=q1;function G1(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(){tu(U1,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 K1(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&&tu(Y1,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 pa(){const e=new CustomEvent(Hr);document.dispatchEvent(e)}function tu(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?V1(s,o):s.dispatchEvent(o)}var br=0;function As(){m.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ma()),document.body.insertAdjacentElement("beforeend",e[1]??ma()),br++,()=>{br===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),br--}},[])}function ma(){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 X1(e){const t=Q1(e),n=m.forwardRef((i,s)=>{const{children:o,...l}=i,a=m.Children.toArray(o),r=a.find(ev);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 Q1(e){const t=m.forwardRef((n,i)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const l=nv(s),a=tv(o,s.props);return s.type!==m.Fragment&&(a.ref=i?ze(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 J1=Symbol("radix.slottable");function ev(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===J1}function tv(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 nv(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 iv=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],sv=iv.reduce((e,t)=>{const n=X1(`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}},{}),yr="focusScope.autoFocusOnMount",xr="focusScope.autoFocusOnUnmount",ga={bubbles:!1,cancelable:!0},rv="FocusScope",Ri=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=ve(t,S=>r(S)),C=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(i){let S=function(v){if(C.paused||!a)return;const y=v.target;a.contains(y)?h.current=y:Gt(h.current,{select:!0})},c=function(v){if(C.paused||!a)return;const y=v.relatedTarget;y!==null&&(a.contains(y)||Gt(h.current,{select:!0}))},u=function(v){if(document.activeElement===document.body)for(const _ of v)_.removedNodes.length>0&&Gt(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,C.paused]),m.useEffect(()=>{if(a){ba.add(C);const S=document.activeElement;if(!a.contains(S)){const u=new CustomEvent(yr,ga);a.addEventListener(yr,f),a.dispatchEvent(u),u.defaultPrevented||(ov(dv(nu(a)),{select:!0}),document.activeElement===S&&Gt(a))}return()=>{a.removeEventListener(yr,f),setTimeout(()=>{const u=new CustomEvent(xr,ga);a.addEventListener(xr,d),a.dispatchEvent(u),u.defaultPrevented||Gt(S??document.body,{select:!0}),a.removeEventListener(xr,d),ba.remove(C)},0)}}},[a,f,d,C]);const w=m.useCallback(S=>{if(!n&&!i||C.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]=lv(p);v&&y?!S.shiftKey&&u===y?(S.preventDefault(),n&&Gt(v,{select:!0})):S.shiftKey&&u===v&&(S.preventDefault(),n&&Gt(y,{select:!0})):u===p&&S.preventDefault()}},[n,i,C.paused]);return g.jsx(sv.div,{tabIndex:-1,...l,ref:b,onKeyDown:w})});Ri.displayName=rv;function ov(e,{select:t=!1}={}){const n=document.activeElement;for(const i of e)if(Gt(i,{select:t}),document.activeElement!==n)return}function lv(e){const t=nu(e),n=va(t,e),i=va(t.reverse(),e);return[n,i]}function nu(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 va(e,t){for(const n of e)if(!av(n,{upTo:t}))return n}function av(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 cv(e){return e instanceof HTMLInputElement&&"select"in e}function Gt(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&cv(e)&&t&&e.select()}}var ba=uv();function uv(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=ya(e,t),e.unshift(t)},remove(t){var n;e=ya(e,t),(n=e[0])==null||n.resume()}}}function ya(e,t){const n=[...e],i=n.indexOf(t);return i!==-1&&n.splice(i,1),n}function dv(e){return e.filter(t=>t.tagName!=="A")}var fv=m[" useId ".trim().toString()]||(()=>{}),hv=0;function st(e){const[t,n]=m.useState(fv());return Ye(()=>{n(i=>i??String(hv++))},[e]),e||(t?`radix-${t}`:"")}const pv=["top","right","bottom","left"],en=Math.min,ot=Math.max,fs=Math.round,ts=Math.floor,Dt=e=>({x:e,y:e}),mv={left:"right",right:"left",bottom:"top",top:"bottom"},gv={start:"end",end:"start"};function Vr(e,t,n){return ot(e,en(t,n))}function Vt(e,t){return typeof e=="function"?e(t):e}function Wt(e){return e.split("-")[0]}function Kn(e){return e.split("-")[1]}function xo(e){return e==="x"?"y":"x"}function _o(e){return e==="y"?"height":"width"}const vv=new Set(["top","bottom"]);function Mt(e){return vv.has(Wt(e))?"y":"x"}function wo(e){return xo(Mt(e))}function bv(e,t,n){n===void 0&&(n=!1);const i=Kn(e),s=wo(e),o=_o(s);let l=s==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(l=hs(l)),[l,hs(l)]}function yv(e){const t=hs(e);return[Wr(e),t,Wr(t)]}function Wr(e){return e.replace(/start|end/g,t=>gv[t])}const xa=["left","right"],_a=["right","left"],xv=["top","bottom"],_v=["bottom","top"];function wv(e,t,n){switch(e){case"top":case"bottom":return n?t?_a:xa:t?xa:_a;case"left":case"right":return t?xv:_v;default:return[]}}function Cv(e,t,n,i){const s=Kn(e);let o=wv(Wt(e),n==="start",i);return s&&(o=o.map(l=>l+"-"+s),t&&(o=o.concat(o.map(Wr)))),o}function hs(e){return e.replace(/left|right|bottom|top/g,t=>mv[t])}function Sv(e){return{top:0,right:0,bottom:0,left:0,...e}}function iu(e){return typeof e!="number"?Sv(e):{top:e,right:e,bottom:e,left:e}}function ps(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 wa(e,t,n){let{reference:i,floating:s}=e;const o=Mt(t),l=wo(t),a=_o(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 C;switch(r){case"top":C={x:d,y:i.y-s.height};break;case"bottom":C={x:d,y:i.y+i.height};break;case"right":C={x:i.x+i.width,y:h};break;case"left":C={x:i.x-s.width,y:h};break;default:C={x:i.x,y:i.y}}switch(Kn(t)){case"start":C[l]-=b*(n&&f?-1:1);break;case"end":C[l]+=b*(n&&f?-1:1);break}return C}const Ev=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}=wa(f,i,r),b=i,C={},w=0;for(let S=0;S<a.length;S++){const{name:c,fn:u}=a[S],{x:p,y:v,data:y,reset:_}=await u({x:d,y:h,initialPlacement:i,placement:b,strategy:s,middlewareData:C,rects:f,platform:l,elements:{reference:e,floating:t}});d=p??d,h=v??h,C={...C,[c]:{...C[c],...y}},_&&w<=50&&(w++,typeof _=="object"&&(_.placement&&(b=_.placement),_.rects&&(f=_.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:s}):_.rects),{x:d,y:h}=wa(f,b,r)),S=-1)}return{x:d,y:h,placement:b,strategy:s,middlewareData:C}};async function vi(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:C=0}=Vt(t,e),w=iu(C),c=a[b?h==="floating"?"reference":"floating":h],u=ps(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},_=ps(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:p,offsetParent:v,strategy:r}):p);return{top:(u.top-_.top+w.top)/y.y,bottom:(_.bottom-u.bottom+w.bottom)/y.y,left:(u.left-_.left+w.left)/y.x,right:(_.right-u.right+w.right)/y.x}}const Nv=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=iu(d),b={x:n,y:i},C=wo(s),w=_o(C),S=await l.getDimensions(f),c=C==="y",u=c?"top":"left",p=c?"bottom":"right",v=c?"clientHeight":"clientWidth",y=o.reference[w]+o.reference[C]-b[C]-o.floating[w],_=b[C]-o.reference[C],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[w]);const T=y/2-_/2,N=E/2-S[w]/2-1,k=en(h[u],N),D=en(h[p],N),M=k,A=E-S[w]-D,R=E/2-S[w]/2+T,z=Vr(M,R,A),V=!r.arrow&&Kn(s)!=null&&R!==z&&o.reference[w]/2-(R<M?k:D)-S[w]/2<0,H=V?R<M?R-M:R-A:0;return{[C]:b[C]+H,data:{[C]:z,centerOffset:R-z-H,...V&&{alignmentOffset:H}},reset:V}}}),Tv=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:C="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:S=!0,...c}=Vt(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const u=Wt(s),p=Mt(a),v=Wt(a)===a,y=await(r.isRTL==null?void 0:r.isRTL(f.floating)),_=b||(v||!S?[hs(a)]:yv(a)),x=w!=="none";!b&&x&&_.push(...Cv(a,S,w,y));const E=[a,..._],T=await vi(t,c),N=[];let k=((i=o.flip)==null?void 0:i.overflows)||[];if(d&&N.push(T[u]),h){const R=bv(s,l,y);N.push(T[R[0]],T[R[1]])}if(k=[...k,{placement:s,overflows:N}],!N.every(R=>R<=0)){var D,M;const R=(((D=o.flip)==null?void 0:D.index)||0)+1,z=E[R];if(z&&(!(h==="alignment"?p!==Mt(z):!1)||k.every(F=>Mt(F.placement)===p?F.overflows[0]>0:!0)))return{data:{index:R,overflows:k},reset:{placement:z}};let V=(M=k.filter(H=>H.overflows[0]<=0).sort((H,F)=>H.overflows[1]-F.overflows[1])[0])==null?void 0:M.placement;if(!V)switch(C){case"bestFit":{var A;const H=(A=k.filter(F=>{if(x){const L=Mt(F.placement);return L===p||L==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(L=>L>0).reduce((L,O)=>L+O,0)]).sort((F,L)=>F[1]-L[1])[0])==null?void 0:A[0];H&&(V=H);break}case"initialPlacement":V=a;break}if(s!==V)return{reset:{placement:V}}}return{}}}};function Ca(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Sa(e){return pv.some(t=>e[t]>=0)}const kv=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 vi(t,{...s,elementContext:"reference"}),l=Ca(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:Sa(l)}}}case"escaped":{const o=await vi(t,{...s,altBoundary:!0}),l=Ca(o,n.floating);return{data:{escapedOffsets:l,escaped:Sa(l)}}}default:return{}}}}},su=new Set(["left","top"]);async function Mv(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=Kn(n),r=Mt(n)==="y",f=su.has(l)?-1:1,d=o&&r?-1:1,h=Vt(t,e);let{mainAxis:b,crossAxis:C,alignmentAxis:w}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&typeof w=="number"&&(C=a==="end"?w*-1:w),r?{x:C*d,y:b*f}:{x:b*f,y:C*d}}const Av=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 Mv(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}}}}},Dv=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 vi(t,r),h=Mt(Wt(s)),b=xo(h);let C=f[b],w=f[h];if(o){const c=b==="y"?"top":"left",u=b==="y"?"bottom":"right",p=C+d[c],v=C-d[u];C=Vr(p,C,v)}if(l){const c=h==="y"?"top":"left",u=h==="y"?"bottom":"right",p=w+d[c],v=w-d[u];w=Vr(p,w,v)}const S=a.fn({...t,[b]:C,[h]:w});return{...S,data:{x:S.x-n,y:S.y-i,enabled:{[b]:o,[h]:l}}}}}},Rv=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=Mt(s),b=xo(h);let C=d[b],w=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,_=o.reference[b]+o.reference[v]-c.mainAxis;C<y?C=y:C>_&&(C=_)}if(f){var u,p;const v=b==="y"?"width":"height",y=su.has(Wt(s)),_=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);w<_?w=_:w>x&&(w=x)}return{[b]:C,[h]:w}}}},Lv=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 vi(t,f),h=Wt(s),b=Kn(s),C=Mt(s)==="y",{width:w,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=w-d.left-d.right,y=en(S-d[c],p),_=en(w-d[u],v),x=!t.middlewareData.shift;let E=y,T=_;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(T=v),(i=t.middlewareData.shift)!=null&&i.enabled.y&&(E=p),x&&!b){const k=ot(d.left,0),D=ot(d.right,0),M=ot(d.top,0),A=ot(d.bottom,0);C?T=w-2*(k!==0||D!==0?k+D:ot(d.left,d.right)):E=S-2*(M!==0||A!==0?M+A:ot(d.top,d.bottom))}await r({...t,availableWidth:T,availableHeight:E});const N=await l.getDimensions(a.floating);return w!==N.width||S!==N.height?{reset:{rects:!0}}:{}}}};function Ds(){return typeof window<"u"}function Xn(e){return ru(e)?(e.nodeName||"").toLowerCase():"#document"}function at(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Lt(e){var t;return(t=(ru(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ru(e){return Ds()?e instanceof Node||e instanceof at(e).Node:!1}function Ct(e){return Ds()?e instanceof Element||e instanceof at(e).Element:!1}function Rt(e){return Ds()?e instanceof HTMLElement||e instanceof at(e).HTMLElement:!1}function Ea(e){return!Ds()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof at(e).ShadowRoot}const Ov=new Set(["inline","contents"]);function Li(e){const{overflow:t,overflowX:n,overflowY:i,display:s}=St(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+n)&&!Ov.has(s)}const Pv=new Set(["table","td","th"]);function Iv(e){return Pv.has(Xn(e))}const Bv=[":popover-open",":modal"];function Rs(e){return Bv.some(t=>{try{return e.matches(t)}catch{return!1}})}const Fv=["transform","translate","scale","rotate","perspective"],jv=["transform","translate","scale","rotate","perspective","filter"],zv=["paint","layout","strict","content"];function Co(e){const t=So(),n=Ct(e)?St(e):e;return Fv.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)||jv.some(i=>(n.willChange||"").includes(i))||zv.some(i=>(n.contain||"").includes(i))}function Hv(e){let t=tn(e);for(;Rt(t)&&!Hn(t);){if(Co(t))return t;if(Rs(t))return null;t=tn(t)}return null}function So(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Vv=new Set(["html","body","#document"]);function Hn(e){return Vv.has(Xn(e))}function St(e){return at(e).getComputedStyle(e)}function Ls(e){return Ct(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function tn(e){if(Xn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ea(e)&&e.host||Lt(e);return Ea(t)?t.host:t}function ou(e){const t=tn(e);return Hn(t)?e.ownerDocument?e.ownerDocument.body:e.body:Rt(t)&&Li(t)?t:ou(t)}function bi(e,t,n){var i;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=ou(e),o=s===((i=e.ownerDocument)==null?void 0:i.body),l=at(s);if(o){const a=$r(l);return t.concat(l,l.visualViewport||[],Li(s)?s:[],a&&n?bi(a):[])}return t.concat(s,bi(s,[],n))}function $r(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function lu(e){const t=St(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=fs(n)!==o||fs(i)!==l;return a&&(n=o,i=l),{width:n,height:i,$:a}}function Eo(e){return Ct(e)?e:e.contextElement}function Rn(e){const t=Eo(e);if(!Rt(t))return Dt(1);const n=t.getBoundingClientRect(),{width:i,height:s,$:o}=lu(t);let l=(o?fs(n.width):n.width)/i,a=(o?fs(n.height):n.height)/s;return(!l||!Number.isFinite(l))&&(l=1),(!a||!Number.isFinite(a))&&(a=1),{x:l,y:a}}const Wv=Dt(0);function au(e){const t=at(e);return!So()||!t.visualViewport?Wv:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function $v(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==at(e)?!1:t}function pn(e,t,n,i){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),o=Eo(e);let l=Dt(1);t&&(i?Ct(i)&&(l=Rn(i)):l=Rn(e));const a=$v(o,n,i)?au(o):Dt(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=at(o),C=i&&Ct(i)?at(i):i;let w=b,S=$r(w);for(;S&&i&&C!==w;){const c=Rn(S),u=S.getBoundingClientRect(),p=St(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,w=at(S),S=$r(w)}}return ps({width:d,height:h,x:r,y:f})}function Os(e,t){const n=Ls(e).scrollLeft;return t?t.left+n:pn(Lt(e)).left+n}function cu(e,t){const n=e.getBoundingClientRect(),i=n.left+t.scrollLeft-Os(e,n),s=n.top+t.scrollTop;return{x:i,y:s}}function Uv(e){let{elements:t,rect:n,offsetParent:i,strategy:s}=e;const o=s==="fixed",l=Lt(i),a=t?Rs(t.floating):!1;if(i===l||a&&o)return n;let r={scrollLeft:0,scrollTop:0},f=Dt(1);const d=Dt(0),h=Rt(i);if((h||!h&&!o)&&((Xn(i)!=="body"||Li(l))&&(r=Ls(i)),Rt(i))){const C=pn(i);f=Rn(i),d.x=C.x+i.clientLeft,d.y=C.y+i.clientTop}const b=l&&!h&&!o?cu(l,r):Dt(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 Yv(e){return Array.from(e.getClientRects())}function qv(e){const t=Lt(e),n=Ls(e),i=e.ownerDocument.body,s=ot(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),o=ot(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight);let l=-n.scrollLeft+Os(e);const a=-n.scrollTop;return St(i).direction==="rtl"&&(l+=ot(t.clientWidth,i.clientWidth)-s),{width:s,height:o,x:l,y:a}}const Na=25;function Zv(e,t){const n=at(e),i=Lt(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=So();(!d||d&&t==="fixed")&&(a=s.offsetLeft,r=s.offsetTop)}const f=Os(i);if(f<=0){const d=i.ownerDocument,h=d.body,b=getComputedStyle(h),C=d.compatMode==="CSS1Compat"&&parseFloat(b.marginLeft)+parseFloat(b.marginRight)||0,w=Math.abs(i.clientWidth-h.clientWidth-C);w<=Na&&(o-=w)}else f<=Na&&(o+=f);return{width:o,height:l,x:a,y:r}}const Gv=new Set(["absolute","fixed"]);function Kv(e,t){const n=pn(e,!0,t==="fixed"),i=n.top+e.clientTop,s=n.left+e.clientLeft,o=Rt(e)?Rn(e):Dt(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 Ta(e,t,n){let i;if(t==="viewport")i=Zv(e,n);else if(t==="document")i=qv(Lt(e));else if(Ct(t))i=Kv(t,n);else{const s=au(e);i={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return ps(i)}function uu(e,t){const n=tn(e);return n===t||!Ct(n)||Hn(n)?!1:St(n).position==="fixed"||uu(n,t)}function Xv(e,t){const n=t.get(e);if(n)return n;let i=bi(e,[],!1).filter(a=>Ct(a)&&Xn(a)!=="body"),s=null;const o=St(e).position==="fixed";let l=o?tn(e):e;for(;Ct(l)&&!Hn(l);){const a=St(l),r=Co(l);!r&&a.position==="fixed"&&(s=null),(o?!r&&!s:!r&&a.position==="static"&&!!s&&Gv.has(s.position)||Li(l)&&!r&&uu(e,l))?i=i.filter(d=>d!==l):s=a,l=tn(l)}return t.set(e,i),i}function Qv(e){let{element:t,boundary:n,rootBoundary:i,strategy:s}=e;const l=[...n==="clippingAncestors"?Rs(t)?[]:Xv(t,this._c):[].concat(n),i],a=l[0],r=l.reduce((f,d)=>{const h=Ta(t,d,s);return f.top=ot(h.top,f.top),f.right=en(h.right,f.right),f.bottom=en(h.bottom,f.bottom),f.left=ot(h.left,f.left),f},Ta(t,a,s));return{width:r.right-r.left,height:r.bottom-r.top,x:r.left,y:r.top}}function Jv(e){const{width:t,height:n}=lu(e);return{width:t,height:n}}function eb(e,t,n){const i=Rt(t),s=Lt(t),o=n==="fixed",l=pn(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const r=Dt(0);function f(){r.x=Os(s)}if(i||!i&&!o)if((Xn(t)!=="body"||Li(s))&&(a=Ls(t)),i){const C=pn(t,!0,o,t);r.x=C.x+t.clientLeft,r.y=C.y+t.clientTop}else s&&f();o&&!i&&s&&f();const d=s&&!i&&!o?cu(s,a):Dt(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 _r(e){return St(e).position==="static"}function ka(e,t){if(!Rt(e)||St(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Lt(e)===n&&(n=n.ownerDocument.body),n}function du(e,t){const n=at(e);if(Rs(e))return n;if(!Rt(e)){let s=tn(e);for(;s&&!Hn(s);){if(Ct(s)&&!_r(s))return s;s=tn(s)}return n}let i=ka(e,t);for(;i&&Iv(i)&&_r(i);)i=ka(i,t);return i&&Hn(i)&&_r(i)&&!Co(i)?n:i||Hv(e)||n}const tb=async function(e){const t=this.getOffsetParent||du,n=this.getDimensions,i=await n(e.floating);return{reference:eb(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function nb(e){return St(e).direction==="rtl"}const ib={convertOffsetParentRelativeRectToViewportRelativeRect:Uv,getDocumentElement:Lt,getClippingRect:Qv,getOffsetParent:du,getElementRects:tb,getClientRects:Yv,getDimensions:Jv,getScale:Rn,isElement:Ct,isRTL:nb};function fu(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function sb(e,t){let n=null,i;const s=Lt(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:C}=f;if(a||t(),!b||!C)return;const w=ts(h),S=ts(s.clientWidth-(d+b)),c=ts(s.clientHeight-(h+C)),u=ts(d),v={rootMargin:-w+"px "+-S+"px "+-c+"px "+-u+"px",threshold:ot(0,en(1,r))||1};let y=!0;function _(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&&!fu(f,e.getBoundingClientRect())&&l(),y=!1}try{n=new IntersectionObserver(_,{...v,root:s.ownerDocument})}catch{n=new IntersectionObserver(_,v)}n.observe(e)}return l(!0),o}function rb(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=Eo(e),d=s||o?[...f?bi(f):[],...bi(t)]:[];d.forEach(u=>{s&&u.addEventListener("scroll",n,{passive:!0}),o&&u.addEventListener("resize",n)});const h=f&&a?sb(f,n):null;let b=-1,C=null;l&&(C=new ResizeObserver(u=>{let[p]=u;p&&p.target===f&&C&&(C.unobserve(t),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var v;(v=C)==null||v.observe(t)})),n()}),f&&!r&&C.observe(f),C.observe(t));let w,S=r?pn(e):null;r&&c();function c(){const u=pn(e);S&&!fu(S,u)&&n(),S=u,w=requestAnimationFrame(c)}return n(),()=>{var u;d.forEach(p=>{s&&p.removeEventListener("scroll",n),o&&p.removeEventListener("resize",n)}),h==null||h(),(u=C)==null||u.disconnect(),C=null,r&&cancelAnimationFrame(w)}}const ob=Av,lb=Dv,ab=Tv,cb=Lv,ub=kv,Ma=Nv,db=Rv,fb=(e,t,n)=>{const i=new Map,s={platform:ib,...n},o={...s.platform,_c:i};return Ev(e,t,{...s,platform:o})};var hb=typeof document<"u",pb=function(){},ls=hb?K.useLayoutEffect:pb;function ms(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(!ms(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)&&!ms(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function hu(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Aa(e,t){const n=hu(e);return Math.round(t*n)/n}function wr(e){const t=m.useRef(e);return ls(()=>{t.current=e}),t}function mb(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,C]=m.useState(i);ms(b,i)||C(i);const[w,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||w,_=l||c,x=m.useRef(null),E=m.useRef(null),T=m.useRef(d),N=r!=null,k=wr(r),D=wr(s),M=wr(f),A=m.useCallback(()=>{if(!x.current||!E.current)return;const F={placement:t,strategy:n,middleware:b};D.current&&(F.platform=D.current),fb(x.current,E.current,F).then(L=>{const O={...L,isPositioned:M.current!==!1};R.current&&!ms(T.current,O)&&(T.current=O,Ti.flushSync(()=>{h(O)}))})},[b,t,n,D,M]);ls(()=>{f===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,h(F=>({...F,isPositioned:!1})))},[f]);const R=m.useRef(!1);ls(()=>(R.current=!0,()=>{R.current=!1}),[]),ls(()=>{if(y&&(x.current=y),_&&(E.current=_),y&&_){if(k.current)return k.current(y,_,A);A()}},[y,_,A,k,N]);const z=m.useMemo(()=>({reference:x,floating:E,setReference:p,setFloating:v}),[p,v]),V=m.useMemo(()=>({reference:y,floating:_}),[y,_]),H=m.useMemo(()=>{const F={position:n,left:0,top:0};if(!V.floating)return F;const L=Aa(V.floating,d.x),O=Aa(V.floating,d.y);return a?{...F,transform:"translate("+L+"px, "+O+"px)",...hu(V.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:L,top:O}},[n,a,V.floating,d.x,d.y]);return m.useMemo(()=>({...d,update:A,refs:z,elements:V,floatingStyles:H}),[d,A,z,V,H])}const gb=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?Ma({element:i.current,padding:s}).fn(n):{}:i?Ma({element:i,padding:s}).fn(n):{}}}},vb=(e,t)=>({...ob(e),options:[e,t]}),bb=(e,t)=>({...lb(e),options:[e,t]}),yb=(e,t)=>({...db(e),options:[e,t]}),xb=(e,t)=>({...ab(e),options:[e,t]}),_b=(e,t)=>({...cb(e),options:[e,t]}),wb=(e,t)=>({...ub(e),options:[e,t]}),Cb=(e,t)=>({...gb(e),options:[e,t]});function Sb(e){const t=Eb(e),n=m.forwardRef((i,s)=>{const{children:o,...l}=i,a=m.Children.toArray(o),r=a.find(Tb);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 Eb(e){const t=m.forwardRef((n,i)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const l=Mb(s),a=kb(o,s.props);return s.type!==m.Fragment&&(a.ref=i?ze(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 Nb=Symbol("radix.slottable");function Tb(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Nb}function kb(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 Mb(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 Ab=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Db=Ab.reduce((e,t)=>{const n=Sb(`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}},{}),Rb="Arrow",pu=m.forwardRef((e,t)=>{const{children:n,width:i=10,height:s=5,...o}=e;return g.jsx(Db.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"})})});pu.displayName=Rb;var Lb=pu;function Ob(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,...w}=h,S=((u=b==null?void 0:b[e])==null?void 0:u[r])||a,c=m.useMemo(()=>w,Object.values(w));return g.jsx(S.Provider,{value:c,children:C})};f.displayName=o+"Provider";function d(h,b){var S;const C=((S=b==null?void 0:b[e])==null?void 0:S[r])||a,w=m.useContext(C);if(w)return w;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,Pb(s,...t)]}function Pb(...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 Ib(e){const t=Bb(e),n=m.forwardRef((i,s)=>{const{children:o,...l}=i,a=m.Children.toArray(o),r=a.find(jb);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 Bb(e){const t=m.forwardRef((n,i)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const l=Hb(s),a=zb(o,s.props);return s.type!==m.Fragment&&(a.ref=i?ze(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 Fb=Symbol("radix.slottable");function jb(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Fb}function zb(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 Hb(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 Vb=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],mu=Vb.reduce((e,t)=>{const n=Ib(`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}},{}),No="Popper",[gu,nn]=Ob(No),[Wb,vu]=gu(No),bu=e=>{const{__scopePopper:t,children:n}=e,[i,s]=m.useState(null);return g.jsx(Wb,{scope:t,anchor:i,onAnchorChange:s,children:n})};bu.displayName=No;var yu="PopperAnchor",xu=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:i,...s}=e,o=vu(yu,n),l=m.useRef(null),a=ve(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(mu.div,{...s,ref:a})});xu.displayName=yu;var To="PopperContent",[$b,Ub]=gu(To),_u=m.forwardRef((e,t)=>{var W,X,q,G,ee,re;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:C="optimized",onPlaced:w,...S}=e,c=vu(To,n),[u,p]=m.useState(null),v=ve(t,ce=>p(ce)),[y,_]=m.useState(null),x=po(y),E=(x==null?void 0:x.width)??0,T=(x==null?void 0:x.height)??0,N=i+(o!=="center"?"-"+o:""),k=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},D=Array.isArray(f)?f:[f],M=D.length>0,A={padding:k,boundary:D.filter(qb),altBoundary:M},{refs:R,floatingStyles:z,placement:V,isPositioned:H,middlewareData:F}=mb({strategy:"fixed",placement:N,whileElementsMounted:(...ce)=>rb(...ce,{animationFrame:C==="always"}),elements:{reference:c.anchor},middleware:[vb({mainAxis:s+T,alignmentAxis:l}),r&&bb({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?yb():void 0,...A}),r&&xb({...A}),_b({...A,apply:({elements:ce,rects:ie,availableWidth:le,availableHeight:we})=>{const{width:Ce,height:be}=ie.reference,Ne=ce.floating.style;Ne.setProperty("--radix-popper-available-width",`${le}px`),Ne.setProperty("--radix-popper-available-height",`${we}px`),Ne.setProperty("--radix-popper-anchor-width",`${Ce}px`),Ne.setProperty("--radix-popper-anchor-height",`${be}px`)}}),y&&Cb({element:y,padding:a}),Zb({arrowWidth:E,arrowHeight:T}),b&&wb({strategy:"referenceHidden",...A})]}),[L,O]=Su(V),j=Ze(w);Ye(()=>{H&&(j==null||j())},[H,j]);const P=(W=F.arrow)==null?void 0:W.x,U=(X=F.arrow)==null?void 0:X.y,I=((q=F.arrow)==null?void 0:q.centerOffset)!==0,[$,Q]=m.useState();return Ye(()=>{u&&Q(window.getComputedStyle(u).zIndex)},[u]),g.jsx("div",{ref:R.setFloating,"data-radix-popper-content-wrapper":"",style:{...z,transform:H?z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:$,"--radix-popper-transform-origin":[(G=F.transformOrigin)==null?void 0:G.x,(ee=F.transformOrigin)==null?void 0:ee.y].join(" "),...((re=F.hide)==null?void 0:re.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:g.jsx($b,{scope:n,placedSide:L,onArrowChange:_,arrowX:P,arrowY:U,shouldHideArrow:I,children:g.jsx(mu.div,{"data-side":L,"data-align":O,...S,ref:v,style:{...S.style,animation:H?void 0:"none"}})})})});_u.displayName=To;var wu="PopperArrow",Yb={top:"bottom",right:"left",bottom:"top",left:"right"},Cu=m.forwardRef(function(t,n){const{__scopePopper:i,...s}=t,o=Ub(wu,i),l=Yb[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(Lb,{...s,ref:n,style:{...s.style,display:"block"}})})});Cu.displayName=wu;function qb(e){return e!==null}var Zb=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]=Su(n),h={start:"0%",center:"50%",end:"100%"}[d],b=(((u=s.arrow)==null?void 0:u.x)??0)+a/2,C=(((p=s.arrow)==null?void 0:p.y)??0)+r/2;let w="",S="";return f==="bottom"?(w=l?h:`${b}px`,S=`${-r}px`):f==="top"?(w=l?h:`${b}px`,S=`${i.floating.height+r}px`):f==="right"?(w=`${-r}px`,S=l?h:`${C}px`):f==="left"&&(w=`${i.floating.width+r}px`,S=l?h:`${C}px`),{data:{x:w,y:S}}}});function Su(e){const[t,n="center"]=e.split("-");return[t,n]}var Oi=bu,Pi=xu,Ps=_u,Is=Cu;function Gb(e){const t=Kb(e),n=m.forwardRef((i,s)=>{const{children:o,...l}=i,a=m.Children.toArray(o),r=a.find(Qb);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 Kb(e){const t=m.forwardRef((n,i)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const l=ey(s),a=Jb(o,s.props);return s.type!==m.Fragment&&(a.ref=i?ze(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 Xb=Symbol("radix.slottable");function Qb(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Xb}function Jb(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 ey(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 ty=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ny=ty.reduce((e,t)=>{const n=Gb(`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}},{}),iy="Portal",Ii=m.forwardRef((e,t)=>{var a;const{container:n,...i}=e,[s,o]=m.useState(!1);Ye(()=>o(!0),[]);const l=n||s&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return l?bc.createPortal(g.jsx(ny.div,{...i,ref:t}),l):null});Ii.displayName=iy;function Eu(e){const t=sy(e),n=m.forwardRef((i,s)=>{const{children:o,...l}=i,a=m.Children.toArray(o),r=a.find(oy);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=ay(s),a=ly(o,s.props);return s.type!==m.Fragment&&(a.ref=i?ze(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 ry=Symbol("radix.slottable");function oy(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ry}function ly(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 ay(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 cy=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ut=cy.reduce((e,t)=>{const n=Eu(`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 uy(e){const t=dy(e),n=m.forwardRef((i,s)=>{const{children:o,...l}=i,a=m.Children.toArray(o),r=a.find(hy);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 dy(e){const t=m.forwardRef((n,i)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const l=my(s),a=py(o,s.props);return s.type!==m.Fragment&&(a.ref=i?ze(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 fy=Symbol("radix.slottable");function hy(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===fy}function py(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 my(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 gy=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],vy=gy.reduce((e,t)=>{const n=uy(`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}},{}),Nu=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"}),by="VisuallyHidden",Tu=m.forwardRef((e,t)=>g.jsx(vy.span,{...e,ref:t,style:{...Nu,...e.style}}));Tu.displayName=by;var yy=Tu,xy=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},wn=new WeakMap,ns=new WeakMap,is={},Cr=0,ku=function(e){return e&&(e.host||ku(e.parentNode))},_y=function(e,t){return t.map(function(n){if(e.contains(n))return n;var i=ku(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})},wy=function(e,t,n,i){var s=_y(t,Array.isArray(e)?e:[e]);is[n]||(is[n]=new WeakMap);var o=is[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 C=b.getAttribute(i),w=C!==null&&C!=="false",S=(wn.get(b)||0)+1,c=(o.get(b)||0)+1;wn.set(b,S),o.set(b,c),l.push(b),S===1&&w&&ns.set(b,!0),c===1&&b.setAttribute(n,"true"),w||b.setAttribute(i,"true")}catch(u){console.error("aria-hidden: cannot operate on ",b,u)}})};return d(t),a.clear(),Cr++,function(){l.forEach(function(h){var b=wn.get(h)-1,C=o.get(h)-1;wn.set(h,b),o.set(h,C),b||(ns.has(h)||h.removeAttribute(i),ns.delete(h)),C||h.removeAttribute(n)}),Cr--,Cr||(wn=new WeakMap,wn=new WeakMap,ns=new WeakMap,is={})}},Bs=function(e,t,n){n===void 0&&(n="data-aria-hidden");var i=Array.from(Array.isArray(e)?e:[e]),s=xy(e);return s?(i.push.apply(i,Array.from(s.querySelectorAll("[aria-live], script"))),wy(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 Mu(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 Cy(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 as="right-scroll-bar-position",cs="width-before-scroll-bar",Sy="with-scroll-bars-hidden",Ey="--removed-body-scroll-bar-size";function Sr(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Ny(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 Ty=typeof window<"u"?m.useLayoutEffect:m.useEffect,Da=new WeakMap;function ky(e,t){var n=Ny(null,function(i){return e.forEach(function(s){return Sr(s,i)})});return Ty(function(){var i=Da.get(n);if(i){var s=new Set(i),o=new Set(e),l=n.current;s.forEach(function(a){o.has(a)||Sr(a,null)}),o.forEach(function(a){s.has(a)||Sr(a,l)})}Da.set(n,e)},[e]),n}function My(e){return e}function Ay(e,t){t===void 0&&(t=My);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 Dy(e){e===void 0&&(e={});var t=Ay(null);return t.options=kt({async:!0,ssr:!1},e),t}var Au=function(e){var t=e.sideCar,n=Mu(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))};Au.isSideCarExport=!0;function Ry(e,t){return e.useMedium(t),Au}var Du=Dy(),Er=function(){},Fs=m.forwardRef(function(e,t){var n=m.useRef(null),i=m.useState({onScrollCapture:Er,onWheelCapture:Er,onTouchMoveCapture:Er}),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,C=e.noRelative,w=e.noIsolation,S=e.inert,c=e.allowPinchZoom,u=e.as,p=u===void 0?"div":u,v=e.gapMode,y=Mu(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),_=b,x=ky([n,t]),E=kt(kt({},y),s);return m.createElement(m.Fragment,null,d&&m.createElement(_,{sideCar:Du,removeScrollBar:f,shards:h,noRelative:C,noIsolation:w,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))});Fs.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Fs.classNames={fullWidth:cs,zeroRight:as};var Ly=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Oy(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Ly();return t&&e.setAttribute("nonce",t),e}function Py(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Iy(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var By=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Oy())&&(Py(t,n),Iy(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Fy=function(){var e=By();return function(t,n){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Ru=function(){var e=Fy(),t=function(n){var i=n.styles,s=n.dynamic;return e(i,s),null};return t},jy={left:0,top:0,right:0,gap:0},Nr=function(e){return parseInt(e||"",10)||0},zy=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[Nr(n),Nr(i),Nr(s)]},Hy=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return jy;var t=zy(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])}},Vy=Ru(),Ln="data-scroll-locked",Wy=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
182
|
.`.concat(Sy,` {
|
|
183
183
|
overflow: hidden `).concat(i,`;
|
|
184
184
|
padding-right: `).concat(a,"px ").concat(i,`;
|
|
@@ -215,14 +215,14 @@
|
|
|
215
215
|
body[`).concat(Ln,`] {
|
|
216
216
|
`).concat(Ey,": ").concat(a,`px;
|
|
217
217
|
}
|
|
218
|
-
`)},Ra=function(){var e=parseInt(document.body.getAttribute(Ln)||"0",10);return isFinite(e)?e:0},$y=function(){m.useEffect(function(){return document.body.setAttribute(Ln,(Ra()+1).toString()),function(){var e=Ra()-1;e<=0?document.body.removeAttribute(Ln):document.body.setAttribute(Ln,e.toString())}},[])},Uy=function(e){var t=e.noRelative,n=e.noImportant,i=e.gapMode,s=i===void 0?"margin":i;$y();var o=m.useMemo(function(){return Hy(s)},[s]);return m.createElement(Vy,{styles:Wy(o,!t,s,n?"":"!important")})},Ur=!1;if(typeof window<"u")try{var ss=Object.defineProperty({},"passive",{get:function(){return Ur=!0,!0}});window.addEventListener("test",ss,ss),window.removeEventListener("test",ss,ss)}catch{Ur=!1}var Cn=Ur?{passive:!1}:!1,Yy=function(e){return e.tagName==="TEXTAREA"},Lu=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Yy(e)&&n[t]==="visible")},qy=function(e){return Lu(e,"overflowY")},Zy=function(e){return Lu(e,"overflowX")},La=function(e,t){var n=t.ownerDocument,i=t;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var s=Ou(e,i);if(s){var o=Pu(e,i),l=o[1],a=o[2];if(l>a)return!0}i=i.parentNode}while(i&&i!==n.body);return!1},Gy=function(e){var t=e.scrollTop,n=e.scrollHeight,i=e.clientHeight;return[t,n,i]},Ky=function(e){var t=e.scrollLeft,n=e.scrollWidth,i=e.clientWidth;return[t,n,i]},Ou=function(e,t){return e==="v"?qy(t):Zy(t)},Pu=function(e,t){return e==="v"?Gy(t):Ky(t)},Xy=function(e,t){return e==="h"&&t==="rtl"?-1:1},Qy=function(e,t,n,i,s){var o=Xy(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
|
|
218
|
+
`)},Ra=function(){var e=parseInt(document.body.getAttribute(Ln)||"0",10);return isFinite(e)?e:0},$y=function(){m.useEffect(function(){return document.body.setAttribute(Ln,(Ra()+1).toString()),function(){var e=Ra()-1;e<=0?document.body.removeAttribute(Ln):document.body.setAttribute(Ln,e.toString())}},[])},Uy=function(e){var t=e.noRelative,n=e.noImportant,i=e.gapMode,s=i===void 0?"margin":i;$y();var o=m.useMemo(function(){return Hy(s)},[s]);return m.createElement(Vy,{styles:Wy(o,!t,s,n?"":"!important")})},Ur=!1;if(typeof window<"u")try{var ss=Object.defineProperty({},"passive",{get:function(){return Ur=!0,!0}});window.addEventListener("test",ss,ss),window.removeEventListener("test",ss,ss)}catch{Ur=!1}var Cn=Ur?{passive:!1}:!1,Yy=function(e){return e.tagName==="TEXTAREA"},Lu=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Yy(e)&&n[t]==="visible")},qy=function(e){return Lu(e,"overflowY")},Zy=function(e){return Lu(e,"overflowX")},La=function(e,t){var n=t.ownerDocument,i=t;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var s=Ou(e,i);if(s){var o=Pu(e,i),l=o[1],a=o[2];if(l>a)return!0}i=i.parentNode}while(i&&i!==n.body);return!1},Gy=function(e){var t=e.scrollTop,n=e.scrollHeight,i=e.clientHeight;return[t,n,i]},Ky=function(e){var t=e.scrollLeft,n=e.scrollWidth,i=e.clientWidth;return[t,n,i]},Ou=function(e,t){return e==="v"?qy(t):Zy(t)},Pu=function(e,t){return e==="v"?Gy(t):Ky(t)},Xy=function(e,t){return e==="h"&&t==="rtl"?-1:1},Qy=function(e,t,n,i,s){var o=Xy(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 C=Pu(e,a),w=C[0],S=C[1],c=C[2],u=S-c-o*w;(w||u)&&Ou(e,a)&&(h+=u,b+=w);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},rs=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Oa=function(e){return[e.deltaX,e.deltaY]},Pa=function(e){return e&&"current"in e?e.current:e},Jy=function(e,t){return e[0]===t[0]&&e[1]===t[1]},ex=function(e){return`
|
|
219
219
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
220
220
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
221
|
-
`)},tx=0,Sn=[];function nx(e){var t=m.useRef([]),n=m.useRef([0,0]),i=m.useRef(),s=m.useState(tx++)[0],o=m.useState(Ru)[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=Cy([e.lockRef.current],(e.shards||[]).map(Pa),!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=rs(S),p=n.current,v="deltaX"in S?S.deltaX:p[0]-u[0],y="deltaY"in S?S.deltaY:p[1]-u[1],_,x=S.target,E=Math.abs(v)>Math.abs(y)?"h":"v";if("touches"in S&&E==="h"&&x.type==="range")return!1;var T=window.getSelection(),N=T&&T.anchorNode,k=N?N===x||N.contains(x):!1;if(k)return!1;var D=La(E,x);if(!D)return!0;if(D?_=E:(_=E==="v"?"h":"v",D=La(E,x)),!D)return!1;if(!i.current&&"changedTouches"in S&&(v||y)&&(i.current=_),!_)return!0;var M=i.current||_;return Qy(M,c,S,M==="h"?v:y)},[]),r=m.useCallback(function(S){var c=S;if(!(!Sn.length||Sn[Sn.length-1]!==o)){var u="deltaY"in c?Oa(c):rs(c),p=t.current.filter(function(_){return _.name===c.type&&(_.target===c.target||c.target===_.shadowParent)&&Jy(_.delta,u)})[0];if(p&&p.should){c.cancelable&&c.preventDefault();return}if(!p){var v=(l.current.shards||[]).map(Pa).filter(Boolean).filter(function(_){return _.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:ix(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=rs(S),i.current=void 0},[]),h=m.useCallback(function(S){f(S.type,Oa(S),S.target,a(S,e.lockRef.current))},[]),b=m.useCallback(function(S){f(S.type,rs(S),S.target,a(S,e.lockRef.current))},[]);m.useEffect(function(){return Sn.push(o),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:b}),document.addEventListener("wheel",r,Cn),document.addEventListener("touchmove",r,Cn),document.addEventListener("touchstart",d,Cn),function(){Sn=Sn.filter(function(S){return S!==o}),document.removeEventListener("wheel",r,Cn),document.removeEventListener("touchmove",r,Cn),document.removeEventListener("touchstart",d,Cn)}},[]);var w=e.removeScrollBar,C=e.inert;return m.createElement(m.Fragment,null,C?m.createElement(o,{styles:ex(s)}):null,w?m.createElement(Uy,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function ix(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const sx=Ry(Du,nx);var Bi=m.forwardRef(function(e,t){return m.createElement(Fs,kt({},e,{ref:t,sideCar:sx}))});Bi.classNames=Fs.classNames;var rx=[" ","Enter","ArrowUp","ArrowDown"],ox=[" ","Enter"],mn="Select",[js,zs,lx]=yo(mn),[Qn]=R1(mn,[lx,nn]),Hs=nn(),[ax,sn]=Qn(mn),[cx,ux]=Qn(mn),Iu=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:w,form:C}=e,S=Hs(t),[c,u]=m.useState(null),[p,v]=m.useState(null),[y,_]=m.useState(!1),x=Di(f),[E,T]=wt({prop:i,defaultProp:s??!1,onChange:o,caller:mn}),[N,k]=wt({prop:l,defaultProp:a,onChange:r,caller:mn}),D=m.useRef(null),M=c?C||!!c.closest("form"):!0,[A,R]=m.useState(new Set),z=Array.from(A).map(V=>V.props.value).join(";");return g.jsx(Oi,{...S,children:g.jsxs(ax,{required:w,scope:t,trigger:c,onTriggerChange:u,valueNode:p,onValueNodeChange:v,valueNodeHasChildren:y,onValueNodeHasChildrenChange:_,contentId:st(),value:N,onValueChange:k,open:E,onOpenChange:T,dir:x,triggerPointerDownPosRef:D,disabled:b,children:[g.jsx(js.Provider,{scope:t,children:g.jsx(cx,{scope:e.__scopeSelect,onNativeOptionAdd:m.useCallback(V=>{R(H=>new Set(H).add(V))},[]),onNativeOptionRemove:m.useCallback(V=>{R(H=>{const F=new Set(H);return F.delete(V),F})},[]),children:n})}),M?g.jsxs(ld,{"aria-hidden":!0,required:w,tabIndex:-1,name:d,autoComplete:h,value:N,onChange:V=>k(V.target.value),disabled:b,form:C,children:[N===void 0?g.jsx("option",{value:""}):null,Array.from(A)]},z):null]})})};Iu.displayName=mn;var Bu="SelectTrigger",Fu=m.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:i=!1,...s}=e,o=Hs(n),l=sn(Bu,n),a=l.disabled||i,r=ve(t,l.onTriggerChange),f=zs(n),d=m.useRef("touch"),[h,b,w]=cd(S=>{const c=f().filter(v=>!v.disabled),u=c.find(v=>v.value===l.value),p=ud(c,S,u);p!==void 0&&l.onValueChange(p.value)}),C=S=>{a||(l.onOpenChange(!0),w()),S&&(l.triggerPointerDownPosRef.current={x:Math.round(S.pageX),y:Math.round(S.pageY)})};return g.jsx(Pi,{asChild:!0,...o,children:g.jsx(ut.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":ad(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===" ")&&rx.includes(S.key)&&(C(),S.preventDefault())})})})});Fu.displayName=Bu;var ju="SelectValue",zu=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:i,style:s,children:o,placeholder:l="",...a}=e,r=sn(ju,n),{onValueNodeHasChildrenChange:f}=r,d=o!==void 0,h=ve(t,r.onValueNodeChange);return Ye(()=>{f(d)},[f,d]),g.jsx(ut.span,{...a,ref:h,style:{pointerEvents:"none"},children:ad(r.value)?g.jsx(g.Fragment,{children:l}):o})});zu.displayName=ju;var dx="SelectIcon",Hu=m.forwardRef((e,t)=>{const{__scopeSelect:n,children:i,...s}=e;return g.jsx(ut.span,{"aria-hidden":!0,...s,ref:t,children:i||"▼"})});Hu.displayName=dx;var fx="SelectPortal",Vu=e=>g.jsx(Ii,{asChild:!0,...e});Vu.displayName=fx;var gn="SelectContent",Wu=m.forwardRef((e,t)=>{const n=sn(gn,e.__scopeSelect),[i,s]=m.useState();if(Ye(()=>{s(new DocumentFragment)},[]),!n.open){const o=i;return o?Ti.createPortal(g.jsx($u,{scope:e.__scopeSelect,children:g.jsx(js.Slot,{scope:e.__scopeSelect,children:g.jsx("div",{children:e.children})})}),o):null}return g.jsx(Uu,{...e,ref:t})});Wu.displayName=gn;var bt=10,[$u,rn]=Qn(gn),hx="SelectContentImpl",px=Eu("SelectContent.RemoveScroll"),Uu=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:w,sticky:C,hideWhenDetached:S,avoidCollisions:c,...u}=e,p=sn(gn,n),[v,y]=m.useState(null),[_,x]=m.useState(null),E=ve(t,W=>y(W)),[T,N]=m.useState(null),[k,D]=m.useState(null),M=zs(n),[A,R]=m.useState(!1),z=m.useRef(!1);m.useEffect(()=>{if(v)return Bs(v)},[v]),As();const V=m.useCallback(W=>{const[X,...q]=M().map(re=>re.ref.current),[G]=q.slice(-1),ee=document.activeElement;for(const re of W)if(re===ee||(re==null||re.scrollIntoView({block:"nearest"}),re===X&&_&&(_.scrollTop=0),re===G&&_&&(_.scrollTop=_.scrollHeight),re==null||re.focus(),document.activeElement!==ee))return},[M,_]),H=m.useCallback(()=>V([T,v]),[V,T,v]);m.useEffect(()=>{A&&H()},[A,H]);const{onOpenChange:F,triggerPointerDownPosRef:L}=p;m.useEffect(()=>{if(v){let W={x:0,y:0};const X=G=>{var ee,re;W={x:Math.abs(Math.round(G.pageX)-(((ee=L.current)==null?void 0:ee.x)??0)),y:Math.abs(Math.round(G.pageY)-(((re=L.current)==null?void 0:re.y)??0))}},q=G=>{W.x<=10&&W.y<=10?G.preventDefault():v.contains(G.target)||F(!1),document.removeEventListener("pointermove",X),L.current=null};return L.current!==null&&(document.addEventListener("pointermove",X),document.addEventListener("pointerup",q,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",X),document.removeEventListener("pointerup",q,{capture:!0})}}},[v,F,L]),m.useEffect(()=>{const W=()=>F(!1);return window.addEventListener("blur",W),window.addEventListener("resize",W),()=>{window.removeEventListener("blur",W),window.removeEventListener("resize",W)}},[F]);const[O,j]=cd(W=>{const X=M().filter(ee=>!ee.disabled),q=X.find(ee=>ee.ref.current===document.activeElement),G=ud(X,W,q);G&&setTimeout(()=>G.ref.current.focus())}),P=m.useCallback((W,X,q)=>{const G=!z.current&&!q;(p.value!==void 0&&p.value===X||G)&&(N(W),G&&(z.current=!0))},[p.value]),U=m.useCallback(()=>v==null?void 0:v.focus(),[v]),I=m.useCallback((W,X,q)=>{const G=!z.current&&!q;(p.value!==void 0&&p.value===X||G)&&D(W)},[p.value]),$=i==="popper"?Yr:Yu,Q=$===Yr?{side:a,sideOffset:r,align:f,alignOffset:d,arrowPadding:h,collisionBoundary:b,collisionPadding:w,sticky:C,hideWhenDetached:S,avoidCollisions:c}:{};return g.jsx($u,{scope:n,content:v,viewport:_,onViewportChange:x,itemRefCallback:P,selectedItem:T,onItemLeave:U,itemTextRefCallback:I,focusSelectedItem:H,selectedItemText:k,position:i,isPositioned:A,searchRef:O,children:g.jsx(Bi,{as:px,allowPinchZoom:!0,children:g.jsx(Ri,{asChild:!0,trapped:p.open,onMountAutoFocus:W=>{W.preventDefault()},onUnmountAutoFocus:oe(s,W=>{var X;(X=p.trigger)==null||X.focus({preventScroll:!0}),W.preventDefault()}),children:g.jsx(Gn,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:W=>W.preventDefault(),onDismiss:()=>p.onOpenChange(!1),children:g.jsx($,{role:"listbox",id:p.contentId,"data-state":p.open?"open":"closed",dir:p.dir,onContextMenu:W=>W.preventDefault(),...u,...Q,onPlaced:()=>R(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...u.style},onKeyDown:oe(u.onKeyDown,W=>{const X=W.ctrlKey||W.altKey||W.metaKey;if(W.key==="Tab"&&W.preventDefault(),!X&&W.key.length===1&&j(W.key),["ArrowUp","ArrowDown","Home","End"].includes(W.key)){let G=M().filter(ee=>!ee.disabled).map(ee=>ee.ref.current);if(["ArrowUp","End"].includes(W.key)&&(G=G.slice().reverse()),["ArrowUp","ArrowDown"].includes(W.key)){const ee=W.target,re=G.indexOf(ee);G=G.slice(re+1)}setTimeout(()=>V(G)),W.preventDefault()}})})})})})})});Uu.displayName=hx;var mx="SelectItemAlignedPosition",Yu=m.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:i,...s}=e,o=sn(gn,n),l=rn(gn,n),[a,r]=m.useState(null),[f,d]=m.useState(null),h=ve(t,E=>d(E)),b=zs(n),w=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(),T=f.getBoundingClientRect(),N=o.valueNode.getBoundingClientRect(),k=u.getBoundingClientRect();if(o.dir!=="rtl"){const ee=k.left-T.left,re=N.left-ee,ce=E.left-re,ie=E.width+ce,le=Math.max(ie,T.width),we=window.innerWidth-bt,Ce=zr(re,[bt,Math.max(bt,we-le)]);a.style.minWidth=ie+"px",a.style.left=Ce+"px"}else{const ee=T.right-k.right,re=window.innerWidth-N.right-ee,ce=window.innerWidth-E.right-re,ie=E.width+ce,le=Math.max(ie,T.width),we=window.innerWidth-bt,Ce=zr(re,[bt,Math.max(bt,we-le)]);a.style.minWidth=ie+"px",a.style.right=Ce+"px"}const D=b(),M=window.innerHeight-bt*2,A=S.scrollHeight,R=window.getComputedStyle(f),z=parseInt(R.borderTopWidth,10),V=parseInt(R.paddingTop,10),H=parseInt(R.borderBottomWidth,10),F=parseInt(R.paddingBottom,10),L=z+V+A+F+H,O=Math.min(c.offsetHeight*5,L),j=window.getComputedStyle(S),P=parseInt(j.paddingTop,10),U=parseInt(j.paddingBottom,10),I=E.top+E.height/2-bt,$=M-I,Q=c.offsetHeight/2,W=c.offsetTop+Q,X=z+V+W,q=L-X;if(X<=I){const ee=D.length>0&&c===D[D.length-1].ref.current;a.style.bottom="0px";const re=f.clientHeight-S.offsetTop-S.offsetHeight,ce=Math.max($,Q+(ee?U:0)+re+H),ie=X+ce;a.style.height=ie+"px"}else{const ee=D.length>0&&c===D[0].ref.current;a.style.top="0px";const ce=Math.max(I,z+S.offsetTop+(ee?P:0)+Q)+q;a.style.height=ce+"px",S.scrollTop=X-I+S.offsetTop}a.style.margin=`${bt}px 0`,a.style.minHeight=O+"px",a.style.maxHeight=M+"px",i==null||i(),requestAnimationFrame(()=>w.current=!0)}},[b,o.trigger,o.valueNode,a,f,S,c,u,o.dir,i]);Ye(()=>v(),[v]);const[y,_]=m.useState();Ye(()=>{f&&_(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(vx,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:w,onScrollButtonChange:x,children:g.jsx("div",{ref:r,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:y},children:g.jsx(ut.div,{...s,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});Yu.displayName=mx;var gx="SelectPopperPosition",Yr=m.forwardRef((e,t)=>{const{__scopeSelect:n,align:i="start",collisionPadding:s=bt,...o}=e,l=Hs(n);return g.jsx(Ps,{...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)"}})});Yr.displayName=gx;var[vx,ko]=Qn(gn,{}),qr="SelectViewport",qu=m.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:i,...s}=e,o=rn(qr,n),l=ko(qr,n),a=ve(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(js.Slot,{scope:n,children:g.jsx(ut.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 w=Math.abs(r.current-d.scrollTop);if(w>0){const C=window.innerHeight-bt*2,S=parseFloat(h.style.minHeight),c=parseFloat(h.style.height),u=Math.max(S,c);if(u<C){const p=u+w,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})})})]})});qu.displayName=qr;var Zu="SelectGroup",[bx,yx]=Qn(Zu),Gu=m.forwardRef((e,t)=>{const{__scopeSelect:n,...i}=e,s=st();return g.jsx(bx,{scope:n,id:s,children:g.jsx(ut.div,{role:"group","aria-labelledby":s,...i,ref:t})})});Gu.displayName=Zu;var Ku="SelectLabel",Xu=m.forwardRef((e,t)=>{const{__scopeSelect:n,...i}=e,s=yx(Ku,n);return g.jsx(ut.div,{id:s.id,...i,ref:t})});Xu.displayName=Ku;var gs="SelectItem",[xx,Qu]=Qn(gs),Ju=m.forwardRef((e,t)=>{const{__scopeSelect:n,value:i,disabled:s=!1,textValue:o,...l}=e,a=sn(gs,n),r=rn(gs,n),f=a.value===i,[d,h]=m.useState(o??""),[b,w]=m.useState(!1),C=ve(t,p=>{var v;return(v=r.itemRefCallback)==null?void 0:v.call(r,p,i,s)}),S=st(),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(xx,{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(js.ItemSlot,{scope:n,value:i,disabled:s,textValue:d,children:g.jsx(ut.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,()=>w(!0)),onBlur:oe(l.onBlur,()=>w(!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===" "||(ox.includes(p.key)&&u(),p.key===" "&&p.preventDefault())})})})})});Ju.displayName=gs;var ci="SelectItemText",ed=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:i,style:s,...o}=e,l=sn(ci,n),a=rn(ci,n),r=Qu(ci,n),f=ux(ci,n),[d,h]=m.useState(null),b=ve(t,u=>h(u),r.onItemTextChange,u=>{var p;return(p=a.itemTextRefCallback)==null?void 0:p.call(a,u,r.value,r.disabled)}),w=d==null?void 0:d.textContent,C=m.useMemo(()=>g.jsx("option",{value:r.value,disabled:r.disabled,children:w},r.value),[r.disabled,r.value,w]),{onNativeOptionAdd:S,onNativeOptionRemove:c}=f;return Ye(()=>(S(C),()=>c(C)),[S,c,C]),g.jsxs(g.Fragment,{children:[g.jsx(ut.span,{id:r.textId,...o,ref:b}),r.isSelected&&l.valueNode&&!l.valueNodeHasChildren?Ti.createPortal(o.children,l.valueNode):null]})});ed.displayName=ci;var td="SelectItemIndicator",nd=m.forwardRef((e,t)=>{const{__scopeSelect:n,...i}=e;return Qu(td,n).isSelected?g.jsx(ut.span,{"aria-hidden":!0,...i,ref:t}):null});nd.displayName=td;var Zr="SelectScrollUpButton",id=m.forwardRef((e,t)=>{const n=rn(Zr,e.__scopeSelect),i=ko(Zr,e.__scopeSelect),[s,o]=m.useState(!1),l=ve(t,i.onScrollButtonChange);return Ye(()=>{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(rd,{...e,ref:l,onAutoScroll:()=>{const{viewport:a,selectedItem:r}=n;a&&r&&(a.scrollTop=a.scrollTop-r.offsetHeight)}}):null});id.displayName=Zr;var Gr="SelectScrollDownButton",sd=m.forwardRef((e,t)=>{const n=rn(Gr,e.__scopeSelect),i=ko(Gr,e.__scopeSelect),[s,o]=m.useState(!1),l=ve(t,i.onScrollButtonChange);return Ye(()=>{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(rd,{...e,ref:l,onAutoScroll:()=>{const{viewport:a,selectedItem:r}=n;a&&r&&(a.scrollTop=a.scrollTop+r.offsetHeight)}}):null});sd.displayName=Gr;var rd=m.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:i,...s}=e,o=rn("SelectScrollButton",n),l=m.useRef(null),a=zs(n),r=m.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return m.useEffect(()=>()=>r(),[r]),Ye(()=>{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(ut.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()})})}),_x="SelectSeparator",od=m.forwardRef((e,t)=>{const{__scopeSelect:n,...i}=e;return g.jsx(ut.div,{"aria-hidden":!0,...i,ref:t})});od.displayName=_x;var Kr="SelectArrow",wx=m.forwardRef((e,t)=>{const{__scopeSelect:n,...i}=e,s=Hs(n),o=sn(Kr,n),l=rn(Kr,n);return o.open&&l.position==="popper"?g.jsx(Is,{...s,...i,ref:t}):null});wx.displayName=Kr;var Cx="SelectBubbleInput",ld=m.forwardRef(({__scopeSelect:e,value:t,...n},i)=>{const s=m.useRef(null),o=ve(i,s),l=ho(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(ut.select,{...n,style:{...Nu,...n.style},ref:o,defaultValue:t})});ld.displayName=Cx;function ad(e){return e===""||e===void 0}function cd(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 ud(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=Sx(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 Sx(e,t){return e.map((n,i)=>e[(t+i)%e.length])}var Ex=Iu,dd=Fu,Nx=zu,Tx=Hu,kx=Vu,fd=Wu,Mx=qu,Ax=Gu,hd=Xu,pd=Ju,Dx=ed,Rx=nd,md=id,gd=sd,vd=od;const Mo=Ex,Lx=Ax,Ao=Nx,Vs=m.forwardRef(({className:e,children:t,...n},i)=>g.jsxs(dd,{ref:i,className:J("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(Tx,{asChild:!0,children:g.jsx(Ns,{className:"h-4 w-4 opacity-50"})})]}));Vs.displayName=dd.displayName;const Do=m.forwardRef(({className:e,...t},n)=>g.jsx(md,{ref:n,className:J("flex cursor-default items-center justify-center py-1",e),...t,children:g.jsx(Ng,{className:"h-4 w-4"})}));Do.displayName=md.displayName;const Ro=m.forwardRef(({className:e,...t},n)=>g.jsx(gd,{ref:n,className:J("flex cursor-default items-center justify-center py-1",e),...t,children:g.jsx(Ns,{className:"h-4 w-4"})}));Ro.displayName=gd.displayName;const Ws=m.forwardRef(({className:e,children:t,position:n="popper",...i},s)=>g.jsx(kx,{children:g.jsxs(fd,{ref:s,className:J("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(Do,{}),g.jsx(Mx,{className:J("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),g.jsx(Ro,{})]})}));Ws.displayName=fd.displayName;const bd=m.forwardRef(({className:e,...t},n)=>g.jsx(hd,{ref:n,className:J("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));bd.displayName=hd.displayName;const $s=m.forwardRef(({className:e,children:t,...n},i)=>g.jsxs(pd,{ref:i,className:J("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(Rx,{children:g.jsx(gi,{className:"h-4 w-4"})})}),g.jsx(Dx,{children:t})]}));$s.displayName=pd.displayName;const yd=m.forwardRef(({className:e,...t},n)=>g.jsx(vd,{ref:n,className:J("-mx-1 my-1 h-px bg-muted",e),...t}));yd.displayName=vd.displayName;function Ox(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 Px(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:w,...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:w})};f.displayName=o+"Provider";function d(h,b){var S;const w=((S=b==null?void 0:b[e])==null?void 0:S[r])||a,C=m.useContext(w);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,Ix(s,...t)]}function Ix(...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 xd(e){const t=Bx(e),n=m.forwardRef((i,s)=>{const{children:o,...l}=i,a=m.Children.toArray(o),r=a.find(jx);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 Bx(e){const t=m.forwardRef((n,i)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const l=Hx(s),a=zx(o,s.props);return s.type!==m.Fragment&&(a.ref=i?ze(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 Fx=Symbol("radix.slottable");function jx(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Fx}function zx(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 Hx(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"],Fi=Vx.reduce((e,t)=>{const n=xd(`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="Dialog",[_d,wd]=Px(Us),[Wx,Et]=_d(Us),Cd=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:Us});return g.jsx(Wx,{scope:t,triggerRef:a,contentRef:r,contentId:st(),titleId:st(),descriptionId:st(),open:f,onOpenChange:d,onOpenToggle:m.useCallback(()=>d(h=>!h),[d]),modal:l,children:n})};Cd.displayName=Us;var Sd="DialogTrigger",Ed=m.forwardRef((e,t)=>{const{__scopeDialog:n,...i}=e,s=Et(Sd,n),o=ve(t,s.triggerRef);return g.jsx(Fi.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Po(s.open),...i,ref:o,onClick:oe(e.onClick,s.onOpenToggle)})});Ed.displayName=Sd;var Lo="DialogPortal",[$x,Nd]=_d(Lo,{forceMount:void 0}),Td=e=>{const{__scopeDialog:t,forceMount:n,children:i,container:s}=e,o=Et(Lo,t);return g.jsx($x,{scope:t,forceMount:n,children:m.Children.map(i,l=>g.jsx(Ke,{present:n||o.open,children:g.jsx(Ii,{asChild:!0,container:s,children:l})}))})};Td.displayName=Lo;var vs="DialogOverlay",kd=m.forwardRef((e,t)=>{const n=Nd(vs,e.__scopeDialog),{forceMount:i=n.forceMount,...s}=e,o=Et(vs,e.__scopeDialog);return o.modal?g.jsx(Ke,{present:i||o.open,children:g.jsx(Yx,{...s,ref:t})}):null});kd.displayName=vs;var Ux=xd("DialogOverlay.RemoveScroll"),Yx=m.forwardRef((e,t)=>{const{__scopeDialog:n,...i}=e,s=Et(vs,n);return g.jsx(Bi,{as:Ux,allowPinchZoom:!0,shards:[s.contentRef],children:g.jsx(Fi.div,{"data-state":Po(s.open),...i,ref:t,style:{pointerEvents:"auto",...i.style}})})}),vn="DialogContent",Md=m.forwardRef((e,t)=>{const n=Nd(vn,e.__scopeDialog),{forceMount:i=n.forceMount,...s}=e,o=Et(vn,e.__scopeDialog);return g.jsx(Ke,{present:i||o.open,children:o.modal?g.jsx(qx,{...s,ref:t}):g.jsx(Zx,{...s,ref:t})})});Md.displayName=vn;var qx=m.forwardRef((e,t)=>{const n=Et(vn,e.__scopeDialog),i=m.useRef(null),s=ve(t,n.contentRef,i);return m.useEffect(()=>{const o=i.current;if(o)return Bs(o)},[]),g.jsx(Ad,{...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())})}),Zx=m.forwardRef((e,t)=>{const n=Et(vn,e.__scopeDialog),i=m.useRef(!1),s=m.useRef(!1);return g.jsx(Ad,{...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()}})}),Ad=m.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:o,...l}=e,a=Et(vn,n),r=m.useRef(null),f=ve(t,r);return As(),g.jsxs(g.Fragment,{children:[g.jsx(Ri,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:s,onUnmountAutoFocus:o,children:g.jsx(Gn,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":Po(a.open),...l,ref:f,onDismiss:()=>a.onOpenChange(!1)})}),g.jsxs(g.Fragment,{children:[g.jsx(Kx,{titleId:a.titleId}),g.jsx(Qx,{contentRef:r,descriptionId:a.descriptionId})]})]})}),Oo="DialogTitle",Dd=m.forwardRef((e,t)=>{const{__scopeDialog:n,...i}=e,s=Et(Oo,n);return g.jsx(Fi.h2,{id:s.titleId,...i,ref:t})});Dd.displayName=Oo;var Rd="DialogDescription",Ld=m.forwardRef((e,t)=>{const{__scopeDialog:n,...i}=e,s=Et(Rd,n);return g.jsx(Fi.p,{id:s.descriptionId,...i,ref:t})});Ld.displayName=Rd;var Od="DialogClose",Pd=m.forwardRef((e,t)=>{const{__scopeDialog:n,...i}=e,s=Et(Od,n);return g.jsx(Fi.button,{type:"button",...i,ref:t,onClick:oe(e.onClick,()=>s.onOpenChange(!1))})});Pd.displayName=Od;function Po(e){return e?"open":"closed"}var Id="DialogTitleWarning",[Gx,Bd]=Ox(Id,{contentName:vn,titleName:Oo,docsSlug:"dialog"}),Kx=({titleId:e})=>{const t=Bd(Id),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
221
|
+
`)},tx=0,Sn=[];function nx(e){var t=m.useRef([]),n=m.useRef([0,0]),i=m.useRef(),s=m.useState(tx++)[0],o=m.useState(Ru)[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=Cy([e.lockRef.current],(e.shards||[]).map(Pa),!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=rs(S),p=n.current,v="deltaX"in S?S.deltaX:p[0]-u[0],y="deltaY"in S?S.deltaY:p[1]-u[1],_,x=S.target,E=Math.abs(v)>Math.abs(y)?"h":"v";if("touches"in S&&E==="h"&&x.type==="range")return!1;var T=window.getSelection(),N=T&&T.anchorNode,k=N?N===x||N.contains(x):!1;if(k)return!1;var D=La(E,x);if(!D)return!0;if(D?_=E:(_=E==="v"?"h":"v",D=La(E,x)),!D)return!1;if(!i.current&&"changedTouches"in S&&(v||y)&&(i.current=_),!_)return!0;var M=i.current||_;return Qy(M,c,S,M==="h"?v:y)},[]),r=m.useCallback(function(S){var c=S;if(!(!Sn.length||Sn[Sn.length-1]!==o)){var u="deltaY"in c?Oa(c):rs(c),p=t.current.filter(function(_){return _.name===c.type&&(_.target===c.target||c.target===_.shadowParent)&&Jy(_.delta,u)})[0];if(p&&p.should){c.cancelable&&c.preventDefault();return}if(!p){var v=(l.current.shards||[]).map(Pa).filter(Boolean).filter(function(_){return _.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:ix(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=rs(S),i.current=void 0},[]),h=m.useCallback(function(S){f(S.type,Oa(S),S.target,a(S,e.lockRef.current))},[]),b=m.useCallback(function(S){f(S.type,rs(S),S.target,a(S,e.lockRef.current))},[]);m.useEffect(function(){return Sn.push(o),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:b}),document.addEventListener("wheel",r,Cn),document.addEventListener("touchmove",r,Cn),document.addEventListener("touchstart",d,Cn),function(){Sn=Sn.filter(function(S){return S!==o}),document.removeEventListener("wheel",r,Cn),document.removeEventListener("touchmove",r,Cn),document.removeEventListener("touchstart",d,Cn)}},[]);var C=e.removeScrollBar,w=e.inert;return m.createElement(m.Fragment,null,w?m.createElement(o,{styles:ex(s)}):null,C?m.createElement(Uy,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function ix(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const sx=Ry(Du,nx);var Bi=m.forwardRef(function(e,t){return m.createElement(Fs,kt({},e,{ref:t,sideCar:sx}))});Bi.classNames=Fs.classNames;var rx=[" ","Enter","ArrowUp","ArrowDown"],ox=[" ","Enter"],mn="Select",[js,zs,lx]=yo(mn),[Qn]=R1(mn,[lx,nn]),Hs=nn(),[ax,sn]=Qn(mn),[cx,ux]=Qn(mn),Iu=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:C,form:w}=e,S=Hs(t),[c,u]=m.useState(null),[p,v]=m.useState(null),[y,_]=m.useState(!1),x=Di(f),[E,T]=wt({prop:i,defaultProp:s??!1,onChange:o,caller:mn}),[N,k]=wt({prop:l,defaultProp:a,onChange:r,caller:mn}),D=m.useRef(null),M=c?w||!!c.closest("form"):!0,[A,R]=m.useState(new Set),z=Array.from(A).map(V=>V.props.value).join(";");return g.jsx(Oi,{...S,children:g.jsxs(ax,{required:C,scope:t,trigger:c,onTriggerChange:u,valueNode:p,onValueNodeChange:v,valueNodeHasChildren:y,onValueNodeHasChildrenChange:_,contentId:st(),value:N,onValueChange:k,open:E,onOpenChange:T,dir:x,triggerPointerDownPosRef:D,disabled:b,children:[g.jsx(js.Provider,{scope:t,children:g.jsx(cx,{scope:e.__scopeSelect,onNativeOptionAdd:m.useCallback(V=>{R(H=>new Set(H).add(V))},[]),onNativeOptionRemove:m.useCallback(V=>{R(H=>{const F=new Set(H);return F.delete(V),F})},[]),children:n})}),M?g.jsxs(ld,{"aria-hidden":!0,required:C,tabIndex:-1,name:d,autoComplete:h,value:N,onChange:V=>k(V.target.value),disabled:b,form:w,children:[N===void 0?g.jsx("option",{value:""}):null,Array.from(A)]},z):null]})})};Iu.displayName=mn;var Bu="SelectTrigger",Fu=m.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:i=!1,...s}=e,o=Hs(n),l=sn(Bu,n),a=l.disabled||i,r=ve(t,l.onTriggerChange),f=zs(n),d=m.useRef("touch"),[h,b,C]=cd(S=>{const c=f().filter(v=>!v.disabled),u=c.find(v=>v.value===l.value),p=ud(c,S,u);p!==void 0&&l.onValueChange(p.value)}),w=S=>{a||(l.onOpenChange(!0),C()),S&&(l.triggerPointerDownPosRef.current={x:Math.round(S.pageX),y:Math.round(S.pageY)})};return g.jsx(Pi,{asChild:!0,...o,children:g.jsx(ut.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":ad(l.value)?"":void 0,...s,ref:r,onClick:oe(s.onClick,S=>{S.currentTarget.focus(),d.current!=="mouse"&&w(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"&&(w(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===" ")&&rx.includes(S.key)&&(w(),S.preventDefault())})})})});Fu.displayName=Bu;var ju="SelectValue",zu=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:i,style:s,children:o,placeholder:l="",...a}=e,r=sn(ju,n),{onValueNodeHasChildrenChange:f}=r,d=o!==void 0,h=ve(t,r.onValueNodeChange);return Ye(()=>{f(d)},[f,d]),g.jsx(ut.span,{...a,ref:h,style:{pointerEvents:"none"},children:ad(r.value)?g.jsx(g.Fragment,{children:l}):o})});zu.displayName=ju;var dx="SelectIcon",Hu=m.forwardRef((e,t)=>{const{__scopeSelect:n,children:i,...s}=e;return g.jsx(ut.span,{"aria-hidden":!0,...s,ref:t,children:i||"▼"})});Hu.displayName=dx;var fx="SelectPortal",Vu=e=>g.jsx(Ii,{asChild:!0,...e});Vu.displayName=fx;var gn="SelectContent",Wu=m.forwardRef((e,t)=>{const n=sn(gn,e.__scopeSelect),[i,s]=m.useState();if(Ye(()=>{s(new DocumentFragment)},[]),!n.open){const o=i;return o?Ti.createPortal(g.jsx($u,{scope:e.__scopeSelect,children:g.jsx(js.Slot,{scope:e.__scopeSelect,children:g.jsx("div",{children:e.children})})}),o):null}return g.jsx(Uu,{...e,ref:t})});Wu.displayName=gn;var bt=10,[$u,rn]=Qn(gn),hx="SelectContentImpl",px=Eu("SelectContent.RemoveScroll"),Uu=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:C,sticky:w,hideWhenDetached:S,avoidCollisions:c,...u}=e,p=sn(gn,n),[v,y]=m.useState(null),[_,x]=m.useState(null),E=ve(t,W=>y(W)),[T,N]=m.useState(null),[k,D]=m.useState(null),M=zs(n),[A,R]=m.useState(!1),z=m.useRef(!1);m.useEffect(()=>{if(v)return Bs(v)},[v]),As();const V=m.useCallback(W=>{const[X,...q]=M().map(re=>re.ref.current),[G]=q.slice(-1),ee=document.activeElement;for(const re of W)if(re===ee||(re==null||re.scrollIntoView({block:"nearest"}),re===X&&_&&(_.scrollTop=0),re===G&&_&&(_.scrollTop=_.scrollHeight),re==null||re.focus(),document.activeElement!==ee))return},[M,_]),H=m.useCallback(()=>V([T,v]),[V,T,v]);m.useEffect(()=>{A&&H()},[A,H]);const{onOpenChange:F,triggerPointerDownPosRef:L}=p;m.useEffect(()=>{if(v){let W={x:0,y:0};const X=G=>{var ee,re;W={x:Math.abs(Math.round(G.pageX)-(((ee=L.current)==null?void 0:ee.x)??0)),y:Math.abs(Math.round(G.pageY)-(((re=L.current)==null?void 0:re.y)??0))}},q=G=>{W.x<=10&&W.y<=10?G.preventDefault():v.contains(G.target)||F(!1),document.removeEventListener("pointermove",X),L.current=null};return L.current!==null&&(document.addEventListener("pointermove",X),document.addEventListener("pointerup",q,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",X),document.removeEventListener("pointerup",q,{capture:!0})}}},[v,F,L]),m.useEffect(()=>{const W=()=>F(!1);return window.addEventListener("blur",W),window.addEventListener("resize",W),()=>{window.removeEventListener("blur",W),window.removeEventListener("resize",W)}},[F]);const[O,j]=cd(W=>{const X=M().filter(ee=>!ee.disabled),q=X.find(ee=>ee.ref.current===document.activeElement),G=ud(X,W,q);G&&setTimeout(()=>G.ref.current.focus())}),P=m.useCallback((W,X,q)=>{const G=!z.current&&!q;(p.value!==void 0&&p.value===X||G)&&(N(W),G&&(z.current=!0))},[p.value]),U=m.useCallback(()=>v==null?void 0:v.focus(),[v]),I=m.useCallback((W,X,q)=>{const G=!z.current&&!q;(p.value!==void 0&&p.value===X||G)&&D(W)},[p.value]),$=i==="popper"?Yr:Yu,Q=$===Yr?{side:a,sideOffset:r,align:f,alignOffset:d,arrowPadding:h,collisionBoundary:b,collisionPadding:C,sticky:w,hideWhenDetached:S,avoidCollisions:c}:{};return g.jsx($u,{scope:n,content:v,viewport:_,onViewportChange:x,itemRefCallback:P,selectedItem:T,onItemLeave:U,itemTextRefCallback:I,focusSelectedItem:H,selectedItemText:k,position:i,isPositioned:A,searchRef:O,children:g.jsx(Bi,{as:px,allowPinchZoom:!0,children:g.jsx(Ri,{asChild:!0,trapped:p.open,onMountAutoFocus:W=>{W.preventDefault()},onUnmountAutoFocus:oe(s,W=>{var X;(X=p.trigger)==null||X.focus({preventScroll:!0}),W.preventDefault()}),children:g.jsx(Gn,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:W=>W.preventDefault(),onDismiss:()=>p.onOpenChange(!1),children:g.jsx($,{role:"listbox",id:p.contentId,"data-state":p.open?"open":"closed",dir:p.dir,onContextMenu:W=>W.preventDefault(),...u,...Q,onPlaced:()=>R(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...u.style},onKeyDown:oe(u.onKeyDown,W=>{const X=W.ctrlKey||W.altKey||W.metaKey;if(W.key==="Tab"&&W.preventDefault(),!X&&W.key.length===1&&j(W.key),["ArrowUp","ArrowDown","Home","End"].includes(W.key)){let G=M().filter(ee=>!ee.disabled).map(ee=>ee.ref.current);if(["ArrowUp","End"].includes(W.key)&&(G=G.slice().reverse()),["ArrowUp","ArrowDown"].includes(W.key)){const ee=W.target,re=G.indexOf(ee);G=G.slice(re+1)}setTimeout(()=>V(G)),W.preventDefault()}})})})})})})});Uu.displayName=hx;var mx="SelectItemAlignedPosition",Yu=m.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:i,...s}=e,o=sn(gn,n),l=rn(gn,n),[a,r]=m.useState(null),[f,d]=m.useState(null),h=ve(t,E=>d(E)),b=zs(n),C=m.useRef(!1),w=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(),T=f.getBoundingClientRect(),N=o.valueNode.getBoundingClientRect(),k=u.getBoundingClientRect();if(o.dir!=="rtl"){const ee=k.left-T.left,re=N.left-ee,ce=E.left-re,ie=E.width+ce,le=Math.max(ie,T.width),we=window.innerWidth-bt,Ce=zr(re,[bt,Math.max(bt,we-le)]);a.style.minWidth=ie+"px",a.style.left=Ce+"px"}else{const ee=T.right-k.right,re=window.innerWidth-N.right-ee,ce=window.innerWidth-E.right-re,ie=E.width+ce,le=Math.max(ie,T.width),we=window.innerWidth-bt,Ce=zr(re,[bt,Math.max(bt,we-le)]);a.style.minWidth=ie+"px",a.style.right=Ce+"px"}const D=b(),M=window.innerHeight-bt*2,A=S.scrollHeight,R=window.getComputedStyle(f),z=parseInt(R.borderTopWidth,10),V=parseInt(R.paddingTop,10),H=parseInt(R.borderBottomWidth,10),F=parseInt(R.paddingBottom,10),L=z+V+A+F+H,O=Math.min(c.offsetHeight*5,L),j=window.getComputedStyle(S),P=parseInt(j.paddingTop,10),U=parseInt(j.paddingBottom,10),I=E.top+E.height/2-bt,$=M-I,Q=c.offsetHeight/2,W=c.offsetTop+Q,X=z+V+W,q=L-X;if(X<=I){const ee=D.length>0&&c===D[D.length-1].ref.current;a.style.bottom="0px";const re=f.clientHeight-S.offsetTop-S.offsetHeight,ce=Math.max($,Q+(ee?U:0)+re+H),ie=X+ce;a.style.height=ie+"px"}else{const ee=D.length>0&&c===D[0].ref.current;a.style.top="0px";const ce=Math.max(I,z+S.offsetTop+(ee?P:0)+Q)+q;a.style.height=ce+"px",S.scrollTop=X-I+S.offsetTop}a.style.margin=`${bt}px 0`,a.style.minHeight=O+"px",a.style.maxHeight=M+"px",i==null||i(),requestAnimationFrame(()=>C.current=!0)}},[b,o.trigger,o.valueNode,a,f,S,c,u,o.dir,i]);Ye(()=>v(),[v]);const[y,_]=m.useState();Ye(()=>{f&&_(window.getComputedStyle(f).zIndex)},[f]);const x=m.useCallback(E=>{E&&w.current===!0&&(v(),p==null||p(),w.current=!1)},[v,p]);return g.jsx(vx,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:C,onScrollButtonChange:x,children:g.jsx("div",{ref:r,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:y},children:g.jsx(ut.div,{...s,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});Yu.displayName=mx;var gx="SelectPopperPosition",Yr=m.forwardRef((e,t)=>{const{__scopeSelect:n,align:i="start",collisionPadding:s=bt,...o}=e,l=Hs(n);return g.jsx(Ps,{...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)"}})});Yr.displayName=gx;var[vx,ko]=Qn(gn,{}),qr="SelectViewport",qu=m.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:i,...s}=e,o=rn(qr,n),l=ko(qr,n),a=ve(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(js.Slot,{scope:n,children:g.jsx(ut.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 C=Math.abs(r.current-d.scrollTop);if(C>0){const w=window.innerHeight-bt*2,S=parseFloat(h.style.minHeight),c=parseFloat(h.style.height),u=Math.max(S,c);if(u<w){const p=u+C,v=Math.min(w,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})})})]})});qu.displayName=qr;var Zu="SelectGroup",[bx,yx]=Qn(Zu),Gu=m.forwardRef((e,t)=>{const{__scopeSelect:n,...i}=e,s=st();return g.jsx(bx,{scope:n,id:s,children:g.jsx(ut.div,{role:"group","aria-labelledby":s,...i,ref:t})})});Gu.displayName=Zu;var Ku="SelectLabel",Xu=m.forwardRef((e,t)=>{const{__scopeSelect:n,...i}=e,s=yx(Ku,n);return g.jsx(ut.div,{id:s.id,...i,ref:t})});Xu.displayName=Ku;var gs="SelectItem",[xx,Qu]=Qn(gs),Ju=m.forwardRef((e,t)=>{const{__scopeSelect:n,value:i,disabled:s=!1,textValue:o,...l}=e,a=sn(gs,n),r=rn(gs,n),f=a.value===i,[d,h]=m.useState(o??""),[b,C]=m.useState(!1),w=ve(t,p=>{var v;return(v=r.itemRefCallback)==null?void 0:v.call(r,p,i,s)}),S=st(),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(xx,{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(js.ItemSlot,{scope:n,value:i,disabled:s,textValue:d,children:g.jsx(ut.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:w,onFocus:oe(l.onFocus,()=>C(!0)),onBlur:oe(l.onBlur,()=>C(!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===" "||(ox.includes(p.key)&&u(),p.key===" "&&p.preventDefault())})})})})});Ju.displayName=gs;var ci="SelectItemText",ed=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:i,style:s,...o}=e,l=sn(ci,n),a=rn(ci,n),r=Qu(ci,n),f=ux(ci,n),[d,h]=m.useState(null),b=ve(t,u=>h(u),r.onItemTextChange,u=>{var p;return(p=a.itemTextRefCallback)==null?void 0:p.call(a,u,r.value,r.disabled)}),C=d==null?void 0:d.textContent,w=m.useMemo(()=>g.jsx("option",{value:r.value,disabled:r.disabled,children:C},r.value),[r.disabled,r.value,C]),{onNativeOptionAdd:S,onNativeOptionRemove:c}=f;return Ye(()=>(S(w),()=>c(w)),[S,c,w]),g.jsxs(g.Fragment,{children:[g.jsx(ut.span,{id:r.textId,...o,ref:b}),r.isSelected&&l.valueNode&&!l.valueNodeHasChildren?Ti.createPortal(o.children,l.valueNode):null]})});ed.displayName=ci;var td="SelectItemIndicator",nd=m.forwardRef((e,t)=>{const{__scopeSelect:n,...i}=e;return Qu(td,n).isSelected?g.jsx(ut.span,{"aria-hidden":!0,...i,ref:t}):null});nd.displayName=td;var Zr="SelectScrollUpButton",id=m.forwardRef((e,t)=>{const n=rn(Zr,e.__scopeSelect),i=ko(Zr,e.__scopeSelect),[s,o]=m.useState(!1),l=ve(t,i.onScrollButtonChange);return Ye(()=>{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(rd,{...e,ref:l,onAutoScroll:()=>{const{viewport:a,selectedItem:r}=n;a&&r&&(a.scrollTop=a.scrollTop-r.offsetHeight)}}):null});id.displayName=Zr;var Gr="SelectScrollDownButton",sd=m.forwardRef((e,t)=>{const n=rn(Gr,e.__scopeSelect),i=ko(Gr,e.__scopeSelect),[s,o]=m.useState(!1),l=ve(t,i.onScrollButtonChange);return Ye(()=>{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(rd,{...e,ref:l,onAutoScroll:()=>{const{viewport:a,selectedItem:r}=n;a&&r&&(a.scrollTop=a.scrollTop+r.offsetHeight)}}):null});sd.displayName=Gr;var rd=m.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:i,...s}=e,o=rn("SelectScrollButton",n),l=m.useRef(null),a=zs(n),r=m.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return m.useEffect(()=>()=>r(),[r]),Ye(()=>{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(ut.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()})})}),_x="SelectSeparator",od=m.forwardRef((e,t)=>{const{__scopeSelect:n,...i}=e;return g.jsx(ut.div,{"aria-hidden":!0,...i,ref:t})});od.displayName=_x;var Kr="SelectArrow",wx=m.forwardRef((e,t)=>{const{__scopeSelect:n,...i}=e,s=Hs(n),o=sn(Kr,n),l=rn(Kr,n);return o.open&&l.position==="popper"?g.jsx(Is,{...s,...i,ref:t}):null});wx.displayName=Kr;var Cx="SelectBubbleInput",ld=m.forwardRef(({__scopeSelect:e,value:t,...n},i)=>{const s=m.useRef(null),o=ve(i,s),l=ho(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(ut.select,{...n,style:{...Nu,...n.style},ref:o,defaultValue:t})});ld.displayName=Cx;function ad(e){return e===""||e===void 0}function cd(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 ud(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=Sx(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 Sx(e,t){return e.map((n,i)=>e[(t+i)%e.length])}var Ex=Iu,dd=Fu,Nx=zu,Tx=Hu,kx=Vu,fd=Wu,Mx=qu,Ax=Gu,hd=Xu,pd=Ju,Dx=ed,Rx=nd,md=id,gd=sd,vd=od;const Mo=Ex,Lx=Ax,Ao=Nx,Vs=m.forwardRef(({className:e,children:t,...n},i)=>g.jsxs(dd,{ref:i,className:J("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(Tx,{asChild:!0,children:g.jsx(Ns,{className:"h-4 w-4 opacity-50"})})]}));Vs.displayName=dd.displayName;const Do=m.forwardRef(({className:e,...t},n)=>g.jsx(md,{ref:n,className:J("flex cursor-default items-center justify-center py-1",e),...t,children:g.jsx(Ng,{className:"h-4 w-4"})}));Do.displayName=md.displayName;const Ro=m.forwardRef(({className:e,...t},n)=>g.jsx(gd,{ref:n,className:J("flex cursor-default items-center justify-center py-1",e),...t,children:g.jsx(Ns,{className:"h-4 w-4"})}));Ro.displayName=gd.displayName;const Ws=m.forwardRef(({className:e,children:t,position:n="popper",...i},s)=>g.jsx(kx,{children:g.jsxs(fd,{ref:s,className:J("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(Do,{}),g.jsx(Mx,{className:J("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),g.jsx(Ro,{})]})}));Ws.displayName=fd.displayName;const bd=m.forwardRef(({className:e,...t},n)=>g.jsx(hd,{ref:n,className:J("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));bd.displayName=hd.displayName;const $s=m.forwardRef(({className:e,children:t,...n},i)=>g.jsxs(pd,{ref:i,className:J("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(Rx,{children:g.jsx(gi,{className:"h-4 w-4"})})}),g.jsx(Dx,{children:t})]}));$s.displayName=pd.displayName;const yd=m.forwardRef(({className:e,...t},n)=>g.jsx(vd,{ref:n,className:J("-mx-1 my-1 h-px bg-muted",e),...t}));yd.displayName=vd.displayName;function Ox(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 Px(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,...w}=h,S=((u=b==null?void 0:b[e])==null?void 0:u[r])||a,c=m.useMemo(()=>w,Object.values(w));return g.jsx(S.Provider,{value:c,children:C})};f.displayName=o+"Provider";function d(h,b){var S;const C=((S=b==null?void 0:b[e])==null?void 0:S[r])||a,w=m.useContext(C);if(w)return w;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,Ix(s,...t)]}function Ix(...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 xd(e){const t=Bx(e),n=m.forwardRef((i,s)=>{const{children:o,...l}=i,a=m.Children.toArray(o),r=a.find(jx);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 Bx(e){const t=m.forwardRef((n,i)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const l=Hx(s),a=zx(o,s.props);return s.type!==m.Fragment&&(a.ref=i?ze(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 Fx=Symbol("radix.slottable");function jx(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Fx}function zx(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 Hx(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"],Fi=Vx.reduce((e,t)=>{const n=xd(`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="Dialog",[_d,wd]=Px(Us),[Wx,Et]=_d(Us),Cd=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:Us});return g.jsx(Wx,{scope:t,triggerRef:a,contentRef:r,contentId:st(),titleId:st(),descriptionId:st(),open:f,onOpenChange:d,onOpenToggle:m.useCallback(()=>d(h=>!h),[d]),modal:l,children:n})};Cd.displayName=Us;var Sd="DialogTrigger",Ed=m.forwardRef((e,t)=>{const{__scopeDialog:n,...i}=e,s=Et(Sd,n),o=ve(t,s.triggerRef);return g.jsx(Fi.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Po(s.open),...i,ref:o,onClick:oe(e.onClick,s.onOpenToggle)})});Ed.displayName=Sd;var Lo="DialogPortal",[$x,Nd]=_d(Lo,{forceMount:void 0}),Td=e=>{const{__scopeDialog:t,forceMount:n,children:i,container:s}=e,o=Et(Lo,t);return g.jsx($x,{scope:t,forceMount:n,children:m.Children.map(i,l=>g.jsx(Ke,{present:n||o.open,children:g.jsx(Ii,{asChild:!0,container:s,children:l})}))})};Td.displayName=Lo;var vs="DialogOverlay",kd=m.forwardRef((e,t)=>{const n=Nd(vs,e.__scopeDialog),{forceMount:i=n.forceMount,...s}=e,o=Et(vs,e.__scopeDialog);return o.modal?g.jsx(Ke,{present:i||o.open,children:g.jsx(Yx,{...s,ref:t})}):null});kd.displayName=vs;var Ux=xd("DialogOverlay.RemoveScroll"),Yx=m.forwardRef((e,t)=>{const{__scopeDialog:n,...i}=e,s=Et(vs,n);return g.jsx(Bi,{as:Ux,allowPinchZoom:!0,shards:[s.contentRef],children:g.jsx(Fi.div,{"data-state":Po(s.open),...i,ref:t,style:{pointerEvents:"auto",...i.style}})})}),vn="DialogContent",Md=m.forwardRef((e,t)=>{const n=Nd(vn,e.__scopeDialog),{forceMount:i=n.forceMount,...s}=e,o=Et(vn,e.__scopeDialog);return g.jsx(Ke,{present:i||o.open,children:o.modal?g.jsx(qx,{...s,ref:t}):g.jsx(Zx,{...s,ref:t})})});Md.displayName=vn;var qx=m.forwardRef((e,t)=>{const n=Et(vn,e.__scopeDialog),i=m.useRef(null),s=ve(t,n.contentRef,i);return m.useEffect(()=>{const o=i.current;if(o)return Bs(o)},[]),g.jsx(Ad,{...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())})}),Zx=m.forwardRef((e,t)=>{const n=Et(vn,e.__scopeDialog),i=m.useRef(!1),s=m.useRef(!1);return g.jsx(Ad,{...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()}})}),Ad=m.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:o,...l}=e,a=Et(vn,n),r=m.useRef(null),f=ve(t,r);return As(),g.jsxs(g.Fragment,{children:[g.jsx(Ri,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:s,onUnmountAutoFocus:o,children:g.jsx(Gn,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":Po(a.open),...l,ref:f,onDismiss:()=>a.onOpenChange(!1)})}),g.jsxs(g.Fragment,{children:[g.jsx(Kx,{titleId:a.titleId}),g.jsx(Qx,{contentRef:r,descriptionId:a.descriptionId})]})]})}),Oo="DialogTitle",Dd=m.forwardRef((e,t)=>{const{__scopeDialog:n,...i}=e,s=Et(Oo,n);return g.jsx(Fi.h2,{id:s.titleId,...i,ref:t})});Dd.displayName=Oo;var Rd="DialogDescription",Ld=m.forwardRef((e,t)=>{const{__scopeDialog:n,...i}=e,s=Et(Rd,n);return g.jsx(Fi.p,{id:s.descriptionId,...i,ref:t})});Ld.displayName=Rd;var Od="DialogClose",Pd=m.forwardRef((e,t)=>{const{__scopeDialog:n,...i}=e,s=Et(Od,n);return g.jsx(Fi.button,{type:"button",...i,ref:t,onClick:oe(e.onClick,()=>s.onOpenChange(!1))})});Pd.displayName=Od;function Po(e){return e?"open":"closed"}var Id="DialogTitleWarning",[Gx,Bd]=Ox(Id,{contentName:vn,titleName:Oo,docsSlug:"dialog"}),Kx=({titleId:e})=>{const t=Bd(Id),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 m.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Xx="DialogDescriptionWarning",Qx=({contentRef:e,descriptionId:t})=>{const i=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Bd(Xx).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},Fd=Cd,jd=Ed,zd=Td,Io=kd,Bo=Md,Fo=Dd,jo=Ld,Ys=Pd;const Hd=Fd,Jx=jd,Vd=zd,e_=Ys,zo=m.forwardRef(({className:e,...t},n)=>g.jsx(Io,{ref:n,className:J("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}));zo.displayName=Io.displayName;const Ho=m.forwardRef(({className:e,children:t,...n},i)=>g.jsxs(Vd,{children:[g.jsx(zo,{}),g.jsxs(Bo,{ref:i,className:J("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(Ys,{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(Pn,{className:"h-4 w-4"}),g.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Ho.displayName=Bo.displayName;const Vo=({className:e,...t})=>g.jsx("div",{className:J("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Vo.displayName="DialogHeader";const qs=({className:e,...t})=>g.jsx("div",{className:J("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});qs.displayName="DialogFooter";const Wo=m.forwardRef(({className:e,...t},n)=>g.jsx(Fo,{ref:n,className:J("text-lg font-semibold leading-none tracking-tight",e),...t}));Wo.displayName=Fo.displayName;const $o=m.forwardRef(({className:e,...t},n)=>g.jsx(jo,{ref:n,className:J("text-sm text-muted-foreground",e),...t}));$o.displayName=jo.displayName;function t_(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:w,...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:w})};f.displayName=o+"Provider";function d(h,b){var S;const w=((S=b==null?void 0:b[e])==null?void 0:S[r])||a,C=m.useContext(w);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,n_(s,...t)]}function n_(...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 i_(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:w,...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:w})};f.displayName=o+"Provider";function d(h,b){var S;const w=((S=b==null?void 0:b[e])==null?void 0:S[r])||a,C=m.useContext(w);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,s_(s,...t)]}function s_(...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 r_(e){const t=o_(e),n=m.forwardRef((i,s)=>{const{children:o,...l}=i,a=m.Children.toArray(o),r=a.find(a_);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 o_(e){const t=m.forwardRef((n,i)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const l=u_(s),a=c_(o,s.props);return s.type!==m.Fragment&&(a.ref=i?ze(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 l_=Symbol("radix.slottable");function a_(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===l_}function c_(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 u_(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 d_=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Wd=d_.reduce((e,t)=>{const n=r_(`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}},{}),Tr="rovingFocusGroup.onEntryFocus",f_={bubbles:!1,cancelable:!0},ji="RovingFocusGroup",[Xr,$d,h_]=yo(ji),[p_,Zs]=i_(ji,[h_]),[m_,g_]=p_(ji),Ud=m.forwardRef((e,t)=>g.jsx(Xr.Provider,{scope:e.__scopeRovingFocusGroup,children:g.jsx(Xr.Slot,{scope:e.__scopeRovingFocusGroup,children:g.jsx(v_,{...e,ref:t})})}));Ud.displayName=ji;var v_=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),w=ve(t,b),C=Di(o),[S,c]=wt({prop:l,defaultProp:a??null,onChange:r,caller:ji}),[u,p]=m.useState(!1),v=Ze(f),y=$d(n),_=m.useRef(!1),[x,E]=m.useState(0);return m.useEffect(()=>{const T=b.current;if(T)return T.addEventListener(Tr,v),()=>T.removeEventListener(Tr,v)},[v]),g.jsx(m_,{scope:n,orientation:i,dir:C,loop:s,currentTabStopId:S,onItemFocus:m.useCallback(T=>c(T),[c]),onItemShiftTab:m.useCallback(()=>p(!0),[]),onFocusableItemAdd:m.useCallback(()=>E(T=>T+1),[]),onFocusableItemRemove:m.useCallback(()=>E(T=>T-1),[]),children:g.jsx(Wd.div,{tabIndex:u||x===0?-1:0,"data-orientation":i,...h,ref:w,style:{outline:"none",...e.style},onMouseDown:oe(e.onMouseDown,()=>{_.current=!0}),onFocus:oe(e.onFocus,T=>{const N=!_.current;if(T.target===T.currentTarget&&N&&!u){const k=new CustomEvent(Tr,f_);if(T.currentTarget.dispatchEvent(k),!k.defaultPrevented){const D=y().filter(V=>V.focusable),M=D.find(V=>V.active),A=D.find(V=>V.id===S),z=[M,A,...D].filter(Boolean).map(V=>V.ref.current);Zd(z,d)}}_.current=!1}),onBlur:oe(e.onBlur,()=>p(!1))})})}),Yd="RovingFocusGroupItem",qd=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:i=!0,active:s=!1,tabStopId:o,children:l,...a}=e,r=st(),f=o||r,d=g_(Yd,n),h=d.currentTabStopId===f,b=$d(n),{onFocusableItemAdd:w,onFocusableItemRemove:C,currentTabStopId:S}=d;return m.useEffect(()=>{if(i)return w(),()=>C()},[i,w,C]),g.jsx(Xr.ItemSlot,{scope:n,id:f,focusable:i,active:s,children:g.jsx(Wd.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=x_(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?__(v,y+1):v.slice(y+1)}setTimeout(()=>Zd(v))}}),children:typeof l=="function"?l({isCurrentTabStop:h,hasTabStop:S!=null}):l})})});qd.displayName=Yd;var b_={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function y_(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function x_(e,t,n){const i=y_(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(i))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(i)))return b_[i]}function Zd(e,t=!1){const n=document.activeElement;for(const i of e)if(i===n||(i.focus({preventScroll:t}),document.activeElement!==n))return}function __(e,t){return e.map((n,i)=>e[(t+i)%e.length])}var Gd=Ud,Kd=qd;function w_(e){const t=C_(e),n=m.forwardRef((i,s)=>{const{children:o,...l}=i,a=m.Children.toArray(o),r=a.find(E_);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 C_(e){const t=m.forwardRef((n,i)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const l=T_(s),a=N_(o,s.props);return s.type!==m.Fragment&&(a.ref=i?ze(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 S_=Symbol("radix.slottable");function E_(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===S_}function N_(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 T_(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 k_=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Gs=k_.reduce((e,t)=>{const n=w_(`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}},{}),Ks="Tabs",[M_]=t_(Ks,[Zs]),Xd=Zs(),[A_,Uo]=M_(Ks),Qd=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:i,onValueChange:s,defaultValue:o,orientation:l="horizontal",dir:a,activationMode:r="automatic",...f}=e,d=Di(a),[h,b]=wt({prop:i,onChange:s,defaultProp:o??"",caller:Ks});return g.jsx(A_,{scope:n,baseId:st(),value:h,onValueChange:b,orientation:l,dir:d,activationMode:r,children:g.jsx(Gs.div,{dir:d,"data-orientation":l,...f,ref:t})})});Qd.displayName=Ks;var Jd="TabsList",ef=m.forwardRef((e,t)=>{const{__scopeTabs:n,loop:i=!0,...s}=e,o=Uo(Jd,n),l=Xd(n);return g.jsx(Gd,{asChild:!0,...l,orientation:o.orientation,dir:o.dir,loop:i,children:g.jsx(Gs.div,{role:"tablist","aria-orientation":o.orientation,...s,ref:t})})});ef.displayName=Jd;var tf="TabsTrigger",nf=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:i,disabled:s=!1,...o}=e,l=Uo(tf,n),a=Xd(n),r=of(l.baseId,i),f=lf(l.baseId,i),d=i===l.value;return g.jsx(Kd,{asChild:!0,...a,focusable:!s,active:d,children:g.jsx(Gs.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)})})})});nf.displayName=tf;var sf="TabsContent",rf=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:i,forceMount:s,children:o,...l}=e,a=Uo(sf,n),r=of(a.baseId,i),f=lf(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(Gs.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})})});rf.displayName=sf;function of(e,t){return`${e}-trigger-${t}`}function lf(e,t){return`${e}-content-${t}`}var D_=Qd,af=ef,cf=nf,uf=rf;const R_=D_,df=m.forwardRef(({className:e,...t},n)=>g.jsx(af,{ref:n,className:J("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));df.displayName=af.displayName;const ff=m.forwardRef(({className:e,...t},n)=>g.jsx(cf,{ref:n,className:J("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}));ff.displayName=cf.displayName;const hf=m.forwardRef(({className:e,...t},n)=>g.jsx(uf,{ref:n,className:J("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));hf.displayName=uf.displayName;const pf=({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=w=>{d(w),i==null||i(w)};return g.jsxs("div",{className:J("w-full",s),...r,children:[g.jsx("div",{className:J("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",o),role:"tablist",children:e.map(w=>g.jsxs("button",{role:"tab","aria-selected":f===w.value,"aria-controls":`tabpanel-${w.value}`,onClick:()=>h(w.value),disabled:w.disabled,className:J("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===w.value?"bg-background text-foreground shadow-sm":"hover:bg-background/50",l),children:[w.icon&&g.jsx("span",{className:"mr-2",children:w.icon}),w.label,w.badge&&g.jsx("span",{className:"ml-2 rounded-full bg-primary/10 px-2 py-0.5 text-xs text-primary",children:w.badge})]},w.value))}),e.map(w=>g.jsx("div",{id:`tabpanel-${w.value}`,role:"tabpanel","aria-labelledby":w.value,hidden:f!==w.value,className:J("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===w.value&&w.content},w.value))]})};pf.displayName="QTabs";function L_(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:w,...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:w})};f.displayName=o+"Provider";function d(h,b){var S;const w=((S=b==null?void 0:b[e])==null?void 0:S[r])||a,C=m.useContext(w);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,O_(s,...t)]}function O_(...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 Be=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Jn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function mf(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function i(){return this instanceof i?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(i){var s=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(n,i,s.get?s:{enumerable:!0,get:function(){return e[i]}})}),n}var Qr={exports:{}},kr={};/**
|
|
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},Xx="DialogDescriptionWarning",Qx=({contentRef:e,descriptionId:t})=>{const i=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Bd(Xx).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},Fd=Cd,jd=Ed,zd=Td,Io=kd,Bo=Md,Fo=Dd,jo=Ld,Ys=Pd;const Hd=Fd,Jx=jd,Vd=zd,e_=Ys,zo=m.forwardRef(({className:e,...t},n)=>g.jsx(Io,{ref:n,className:J("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}));zo.displayName=Io.displayName;const Ho=m.forwardRef(({className:e,children:t,...n},i)=>g.jsxs(Vd,{children:[g.jsx(zo,{}),g.jsxs(Bo,{ref:i,className:J("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(Ys,{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(Pn,{className:"h-4 w-4"}),g.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Ho.displayName=Bo.displayName;const Vo=({className:e,...t})=>g.jsx("div",{className:J("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Vo.displayName="DialogHeader";const qs=({className:e,...t})=>g.jsx("div",{className:J("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});qs.displayName="DialogFooter";const Wo=m.forwardRef(({className:e,...t},n)=>g.jsx(Fo,{ref:n,className:J("text-lg font-semibold leading-none tracking-tight",e),...t}));Wo.displayName=Fo.displayName;const $o=m.forwardRef(({className:e,...t},n)=>g.jsx(jo,{ref:n,className:J("text-sm text-muted-foreground",e),...t}));$o.displayName=jo.displayName;function t_(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,...w}=h,S=((u=b==null?void 0:b[e])==null?void 0:u[r])||a,c=m.useMemo(()=>w,Object.values(w));return g.jsx(S.Provider,{value:c,children:C})};f.displayName=o+"Provider";function d(h,b){var S;const C=((S=b==null?void 0:b[e])==null?void 0:S[r])||a,w=m.useContext(C);if(w)return w;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,n_(s,...t)]}function n_(...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 i_(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,...w}=h,S=((u=b==null?void 0:b[e])==null?void 0:u[r])||a,c=m.useMemo(()=>w,Object.values(w));return g.jsx(S.Provider,{value:c,children:C})};f.displayName=o+"Provider";function d(h,b){var S;const C=((S=b==null?void 0:b[e])==null?void 0:S[r])||a,w=m.useContext(C);if(w)return w;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,s_(s,...t)]}function s_(...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 r_(e){const t=o_(e),n=m.forwardRef((i,s)=>{const{children:o,...l}=i,a=m.Children.toArray(o),r=a.find(a_);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 o_(e){const t=m.forwardRef((n,i)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const l=u_(s),a=c_(o,s.props);return s.type!==m.Fragment&&(a.ref=i?ze(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 l_=Symbol("radix.slottable");function a_(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===l_}function c_(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 u_(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 d_=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Wd=d_.reduce((e,t)=>{const n=r_(`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}},{}),Tr="rovingFocusGroup.onEntryFocus",f_={bubbles:!1,cancelable:!0},ji="RovingFocusGroup",[Xr,$d,h_]=yo(ji),[p_,Zs]=i_(ji,[h_]),[m_,g_]=p_(ji),Ud=m.forwardRef((e,t)=>g.jsx(Xr.Provider,{scope:e.__scopeRovingFocusGroup,children:g.jsx(Xr.Slot,{scope:e.__scopeRovingFocusGroup,children:g.jsx(v_,{...e,ref:t})})}));Ud.displayName=ji;var v_=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),C=ve(t,b),w=Di(o),[S,c]=wt({prop:l,defaultProp:a??null,onChange:r,caller:ji}),[u,p]=m.useState(!1),v=Ze(f),y=$d(n),_=m.useRef(!1),[x,E]=m.useState(0);return m.useEffect(()=>{const T=b.current;if(T)return T.addEventListener(Tr,v),()=>T.removeEventListener(Tr,v)},[v]),g.jsx(m_,{scope:n,orientation:i,dir:w,loop:s,currentTabStopId:S,onItemFocus:m.useCallback(T=>c(T),[c]),onItemShiftTab:m.useCallback(()=>p(!0),[]),onFocusableItemAdd:m.useCallback(()=>E(T=>T+1),[]),onFocusableItemRemove:m.useCallback(()=>E(T=>T-1),[]),children:g.jsx(Wd.div,{tabIndex:u||x===0?-1:0,"data-orientation":i,...h,ref:C,style:{outline:"none",...e.style},onMouseDown:oe(e.onMouseDown,()=>{_.current=!0}),onFocus:oe(e.onFocus,T=>{const N=!_.current;if(T.target===T.currentTarget&&N&&!u){const k=new CustomEvent(Tr,f_);if(T.currentTarget.dispatchEvent(k),!k.defaultPrevented){const D=y().filter(V=>V.focusable),M=D.find(V=>V.active),A=D.find(V=>V.id===S),z=[M,A,...D].filter(Boolean).map(V=>V.ref.current);Zd(z,d)}}_.current=!1}),onBlur:oe(e.onBlur,()=>p(!1))})})}),Yd="RovingFocusGroupItem",qd=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:i=!0,active:s=!1,tabStopId:o,children:l,...a}=e,r=st(),f=o||r,d=g_(Yd,n),h=d.currentTabStopId===f,b=$d(n),{onFocusableItemAdd:C,onFocusableItemRemove:w,currentTabStopId:S}=d;return m.useEffect(()=>{if(i)return C(),()=>w()},[i,C,w]),g.jsx(Xr.ItemSlot,{scope:n,id:f,focusable:i,active:s,children:g.jsx(Wd.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=x_(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?__(v,y+1):v.slice(y+1)}setTimeout(()=>Zd(v))}}),children:typeof l=="function"?l({isCurrentTabStop:h,hasTabStop:S!=null}):l})})});qd.displayName=Yd;var b_={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function y_(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function x_(e,t,n){const i=y_(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(i))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(i)))return b_[i]}function Zd(e,t=!1){const n=document.activeElement;for(const i of e)if(i===n||(i.focus({preventScroll:t}),document.activeElement!==n))return}function __(e,t){return e.map((n,i)=>e[(t+i)%e.length])}var Gd=Ud,Kd=qd;function w_(e){const t=C_(e),n=m.forwardRef((i,s)=>{const{children:o,...l}=i,a=m.Children.toArray(o),r=a.find(E_);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 C_(e){const t=m.forwardRef((n,i)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const l=T_(s),a=N_(o,s.props);return s.type!==m.Fragment&&(a.ref=i?ze(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 S_=Symbol("radix.slottable");function E_(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===S_}function N_(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 T_(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 k_=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Gs=k_.reduce((e,t)=>{const n=w_(`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}},{}),Ks="Tabs",[M_]=t_(Ks,[Zs]),Xd=Zs(),[A_,Uo]=M_(Ks),Qd=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:i,onValueChange:s,defaultValue:o,orientation:l="horizontal",dir:a,activationMode:r="automatic",...f}=e,d=Di(a),[h,b]=wt({prop:i,onChange:s,defaultProp:o??"",caller:Ks});return g.jsx(A_,{scope:n,baseId:st(),value:h,onValueChange:b,orientation:l,dir:d,activationMode:r,children:g.jsx(Gs.div,{dir:d,"data-orientation":l,...f,ref:t})})});Qd.displayName=Ks;var Jd="TabsList",ef=m.forwardRef((e,t)=>{const{__scopeTabs:n,loop:i=!0,...s}=e,o=Uo(Jd,n),l=Xd(n);return g.jsx(Gd,{asChild:!0,...l,orientation:o.orientation,dir:o.dir,loop:i,children:g.jsx(Gs.div,{role:"tablist","aria-orientation":o.orientation,...s,ref:t})})});ef.displayName=Jd;var tf="TabsTrigger",nf=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:i,disabled:s=!1,...o}=e,l=Uo(tf,n),a=Xd(n),r=of(l.baseId,i),f=lf(l.baseId,i),d=i===l.value;return g.jsx(Kd,{asChild:!0,...a,focusable:!s,active:d,children:g.jsx(Gs.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)})})})});nf.displayName=tf;var sf="TabsContent",rf=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:i,forceMount:s,children:o,...l}=e,a=Uo(sf,n),r=of(a.baseId,i),f=lf(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(Gs.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})})});rf.displayName=sf;function of(e,t){return`${e}-trigger-${t}`}function lf(e,t){return`${e}-content-${t}`}var D_=Qd,af=ef,cf=nf,uf=rf;const R_=D_,df=m.forwardRef(({className:e,...t},n)=>g.jsx(af,{ref:n,className:J("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));df.displayName=af.displayName;const ff=m.forwardRef(({className:e,...t},n)=>g.jsx(cf,{ref:n,className:J("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}));ff.displayName=cf.displayName;const hf=m.forwardRef(({className:e,...t},n)=>g.jsx(uf,{ref:n,className:J("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));hf.displayName=uf.displayName;const pf=({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=C=>{d(C),i==null||i(C)};return g.jsxs("div",{className:J("w-full",s),...r,children:[g.jsx("div",{className:J("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",o),role:"tablist",children:e.map(C=>g.jsxs("button",{role:"tab","aria-selected":f===C.value,"aria-controls":`tabpanel-${C.value}`,onClick:()=>h(C.value),disabled:C.disabled,className:J("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===C.value?"bg-background text-foreground shadow-sm":"hover:bg-background/50",l),children:[C.icon&&g.jsx("span",{className:"mr-2",children:C.icon}),C.label,C.badge&&g.jsx("span",{className:"ml-2 rounded-full bg-primary/10 px-2 py-0.5 text-xs text-primary",children:C.badge})]},C.value))}),e.map(C=>g.jsx("div",{id:`tabpanel-${C.value}`,role:"tabpanel","aria-labelledby":C.value,hidden:f!==C.value,className:J("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===C.value&&C.content},C.value))]})};pf.displayName="QTabs";function L_(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,...w}=h,S=((u=b==null?void 0:b[e])==null?void 0:u[r])||a,c=m.useMemo(()=>w,Object.values(w));return g.jsx(S.Provider,{value:c,children:C})};f.displayName=o+"Provider";function d(h,b){var S;const C=((S=b==null?void 0:b[e])==null?void 0:S[r])||a,w=m.useContext(C);if(w)return w;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,O_(s,...t)]}function O_(...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 Be=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Jn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function mf(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function i(){return this instanceof i?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(i){var s=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(n,i,s.get?s:{enumerable:!0,get:function(){return e[i]}})}),n}var Qr={exports:{}},kr={};/**
|
|
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 Ia;function P_(){if(Ia)return kr;Ia=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
|
|
233
|
+
*/var Ia;function P_(){if(Ia)return kr;Ia=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 C=b(),w=i({inst:{value:C,getSnapshot:b}}),S=w[0].inst,c=w[1];return o(function(){S.value=C,S.getSnapshot=b,r(S)&&c({inst:S})},[h,C,b]),s(function(){return r(S)&&c({inst:S}),h(function(){r(S)&&c({inst:S})})},[h]),l(C),C}function r(h){var b=h.getSnapshot;h=h.value;try{var C=b();return!n(h,C)}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 kr.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:d,kr}var Mr={};/**
|
|
234
234
|
* @license React
|
|
235
235
|
* use-sync-external-store-shim.development.js
|
|
236
236
|
*
|
|
@@ -238,10 +238,10 @@ 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 Ba;function I_(){return Ba||(Ba=1,process.env.NODE_ENV!=="production"&&function(){function e(w,C){return w===C&&(w!==0||1/w===1/C)||w!==w&&C!==C}function t(w,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})},[w,S,C]),a(function(){return n(u)&&p({inst:u}),w(function(){n(u)&&p({inst:u})})},[w]),f(S),S}function n(w){var C=w.getSnapshot;w=w.value;try{var S=C();return!o(w,S)}catch{return!0}}function i(w,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;Mr.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())}()),Mr}process.env.NODE_ENV==="production"?Qr.exports=P_():Qr.exports=I_();var B_=Qr.exports;function F_(){return B_.useSyncExternalStore(j_,()=>!0,()=>!1)}function j_(){return()=>{}}var Yo="Avatar",[z_]=L_(Yo),[H_,gf]=z_(Yo),vf=m.forwardRef((e,t)=>{const{__scopeAvatar:n,...i}=e,[s,o]=m.useState("idle");return g.jsx(H_,{scope:n,imageLoadingStatus:s,onImageLoadingStatusChange:o,children:g.jsx(Mi.span,{...i,ref:t})})});vf.displayName=Yo;var bf="AvatarImage",yf=m.forwardRef((e,t)=>{const{__scopeAvatar:n,src:i,onLoadingStatusChange:s=()=>{},...o}=e,l=gf(bf,n),a=V_(i,o),r=Ze(f=>{s(f),l.onImageLoadingStatusChange(f)});return Ye(()=>{a!=="idle"&&r(a)},[a,r]),a==="loaded"?g.jsx(Mi.img,{...o,ref:t,src:i}):null});yf.displayName=bf;var xf="AvatarFallback",_f=m.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:i,...s}=e,o=gf(xf,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(Mi.span,{...s,ref:t}):null});_f.displayName=xf;function Fa(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function V_(e,{referrerPolicy:t,crossOrigin:n}){const i=F_(),s=m.useRef(null),o=i?(s.current||(s.current=new window.Image),s.current):null,[l,a]=m.useState(()=>Fa(o,e));return Ye(()=>{a(Fa(o,e))},[o,e]),Ye(()=>{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 wf=vf,Cf=yf,Sf=_f;const qo=m.forwardRef(({className:e,...t},n)=>g.jsx(wf,{ref:n,className:J("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));qo.displayName=wf.displayName;const Zo=m.forwardRef(({className:e,...t},n)=>g.jsx(Cf,{ref:n,className:J("aspect-square h-full w-full",e),...t}));Zo.displayName=Cf.displayName;const Go=m.forwardRef(({className:e,...t},n)=>g.jsx(Sf,{ref:n,className:J("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));Go.displayName=Sf.displayName;function W_(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:w,...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:w})};f.displayName=o+"Provider";function d(h,b){var S;const w=((S=b==null?void 0:b[e])==null?void 0:S[r])||a,C=m.useContext(w);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,$_(s,...t)]}function $_(...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 U_(e){const t=Y_(e),n=m.forwardRef((i,s)=>{const{children:o,...l}=i,a=m.Children.toArray(o),r=a.find(Z_);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 Y_(e){const t=m.forwardRef((n,i)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const l=K_(s),a=G_(o,s.props);return s.type!==m.Fragment&&(a.ref=i?ze(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 Ef=Symbol("radix.slottable");function q_(e){const t=({children:n})=>g.jsx(g.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=Ef,t}function Z_(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ef}function G_(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 K_(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 X_=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Q_=X_.reduce((e,t)=>{const n=U_(`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]=W_("Tooltip",[nn]),Qs=nn(),Nf="TooltipProvider",J_=700,Jr="tooltip.open",[ew,Ko]=Xs(Nf),Tf=e=>{const{__scopeTooltip:t,delayDuration:n=J_,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(ew,{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})};Tf.displayName=Nf;var yi="Tooltip",[tw,Js]=Xs(yi),kf=e=>{const{__scopeTooltip:t,children:n,open:i,defaultOpen:s,onOpenChange:o,disableHoverableContent:l,delayDuration:a}=e,r=Ko(yi,e.__scopeTooltip),f=Qs(t),[d,h]=m.useState(null),b=st(),w=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(Jr))):r.onClose(),o==null||o(E)},caller:yi}),v=m.useMemo(()=>u?c.current?"delayed-open":"instant-open":"closed",[u]),y=m.useCallback(()=>{window.clearTimeout(w.current),w.current=0,c.current=!1,p(!0)},[p]),_=m.useCallback(()=>{window.clearTimeout(w.current),w.current=0,p(!1)},[p]),x=m.useCallback(()=>{window.clearTimeout(w.current),w.current=window.setTimeout(()=>{c.current=!0,p(!0),w.current=0},S)},[S,p]);return m.useEffect(()=>()=>{w.current&&(window.clearTimeout(w.current),w.current=0)},[]),g.jsx(Oi,{...f,children:g.jsx(tw,{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?_():(window.clearTimeout(w.current),w.current=0)},[_,C]),onOpen:y,onClose:_,disableHoverableContent:C,children:n})})};kf.displayName=yi;var eo="TooltipTrigger",Mf=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...i}=e,s=Js(eo,n),o=Ko(eo,n),l=Qs(n),a=m.useRef(null),r=ve(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(Pi,{asChild:!0,...l,children:g.jsx(Q_.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)})})});Mf.displayName=eo;var nw="TooltipPortal",[u5,iw]=Xs(nw,{forceMount:void 0}),Vn="TooltipContent",Af=m.forwardRef((e,t)=>{const n=iw(Vn,e.__scopeTooltip),{forceMount:i=n.forceMount,side:s="top",...o}=e,l=Js(Vn,e.__scopeTooltip);return g.jsx(Ke,{present:i||l.open,children:l.disableHoverableContent?g.jsx(Df,{side:s,...o,ref:t}):g.jsx(sw,{side:s,...o,ref:t})})}),sw=m.forwardRef((e,t)=>{const n=Js(Vn,e.__scopeTooltip),i=Ko(Vn,e.__scopeTooltip),s=m.useRef(null),o=ve(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]),w=m.useCallback((C,S)=>{const c=C.currentTarget,u={x:C.clientX,y:C.clientY},p=cw(u,c.getBoundingClientRect()),v=uw(u,p),y=dw(S.getBoundingClientRect()),_=hw([...v,...y]);a(_),h(!0)},[h]);return m.useEffect(()=>()=>b(),[b]),m.useEffect(()=>{if(r&&d){const C=c=>w(c,d),S=c=>w(c,r);return r.addEventListener("pointerleave",C),d.addEventListener("pointerleave",S),()=>{r.removeEventListener("pointerleave",C),d.removeEventListener("pointerleave",S)}}},[r,d,w,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=!fw(u,l);p?b():v&&(b(),f())};return document.addEventListener("pointermove",C),()=>document.removeEventListener("pointermove",C)}},[r,d,l,f,b]),g.jsx(Df,{...e,ref:o})}),[rw,ow]=Xs(yi,{isInside:!1}),lw=q_("TooltipContent"),Df=m.forwardRef((e,t)=>{const{__scopeTooltip:n,children:i,"aria-label":s,onEscapeKeyDown:o,onPointerDownOutside:l,...a}=e,r=Js(Vn,n),f=Qs(n),{onClose:d}=r;return m.useEffect(()=>(document.addEventListener(Jr,d),()=>document.removeEventListener(Jr,d)),[d]),m.useEffect(()=>{if(r.trigger){const h=b=>{const w=b.target;w!=null&&w.contains(r.trigger)&&d()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[r.trigger,d]),g.jsx(Gn,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:h=>h.preventDefault(),onDismiss:d,children:g.jsxs(Ps,{"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(lw,{children:i}),g.jsx(rw,{scope:n,isInside:!0,children:g.jsx(yy,{id:r.contentId,role:"tooltip",children:s||i})})]})})});Af.displayName=Vn;var Rf="TooltipArrow",aw=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...i}=e,s=Qs(n);return ow(Rf,n).isInside?null:g.jsx(Is,{...s,...i,ref:t})});aw.displayName=Rf;function cw(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 uw(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 dw(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 fw(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 hw(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),pw(t)}function pw(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 mw=Tf,gw=kf,vw=Mf,Lf=Af;const bw=mw,yw=gw,xw=vw,Of=m.forwardRef(({className:e,sideOffset:t=4,...n},i)=>g.jsx(Lf,{ref:i,sideOffset:t,className:J("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}));Of.displayName=Lf.displayName;function _w(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:w,...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:w})};f.displayName=o+"Provider";function d(h,b){var S;const w=((S=b==null?void 0:b[e])==null?void 0:S[r])||a,C=m.useContext(w);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,ww(s,...t)]}function ww(...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 Pf(e){const t=Cw(e),n=m.forwardRef((i,s)=>{const{children:o,...l}=i,a=m.Children.toArray(o),r=a.find(Ew);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 Cw(e){const t=m.forwardRef((n,i)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const l=Tw(s),a=Nw(o,s.props);return s.type!==m.Fragment&&(a.ref=i?ze(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 Sw=Symbol("radix.slottable");function Ew(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Sw}function Nw(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 Tw(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 kw=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],If=kw.reduce((e,t)=>{const n=Pf(`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}},{}),er="Popover",[Bf]=_w(er,[nn]),zi=nn(),[Mw,on]=Bf(er),Ff=e=>{const{__scopePopover:t,children:n,open:i,defaultOpen:s,onOpenChange:o,modal:l=!1}=e,a=zi(t),r=m.useRef(null),[f,d]=m.useState(!1),[h,b]=wt({prop:i,defaultProp:s??!1,onChange:o,caller:er});return g.jsx(Oi,{...a,children:g.jsx(Mw,{scope:t,contentId:st(),triggerRef:r,open:h,onOpenChange:b,onOpenToggle:m.useCallback(()=>b(w=>!w),[b]),hasCustomAnchor:f,onCustomAnchorAdd:m.useCallback(()=>d(!0),[]),onCustomAnchorRemove:m.useCallback(()=>d(!1),[]),modal:l,children:n})})};Ff.displayName=er;var jf="PopoverAnchor",Aw=m.forwardRef((e,t)=>{const{__scopePopover:n,...i}=e,s=on(jf,n),o=zi(n),{onCustomAnchorAdd:l,onCustomAnchorRemove:a}=s;return m.useEffect(()=>(l(),()=>a()),[l,a]),g.jsx(Pi,{...o,...i,ref:t})});Aw.displayName=jf;var zf="PopoverTrigger",Hf=m.forwardRef((e,t)=>{const{__scopePopover:n,...i}=e,s=on(zf,n),o=zi(n),l=ve(t,s.triggerRef),a=g.jsx(If.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Yf(s.open),...i,ref:l,onClick:oe(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?a:g.jsx(Pi,{asChild:!0,...o,children:a})});Hf.displayName=zf;var Xo="PopoverPortal",[Dw,Rw]=Bf(Xo,{forceMount:void 0}),Vf=e=>{const{__scopePopover:t,forceMount:n,children:i,container:s}=e,o=on(Xo,t);return g.jsx(Dw,{scope:t,forceMount:n,children:g.jsx(Ke,{present:n||o.open,children:g.jsx(Ii,{asChild:!0,container:s,children:i})})})};Vf.displayName=Xo;var Wn="PopoverContent",Wf=m.forwardRef((e,t)=>{const n=Rw(Wn,e.__scopePopover),{forceMount:i=n.forceMount,...s}=e,o=on(Wn,e.__scopePopover);return g.jsx(Ke,{present:i||o.open,children:o.modal?g.jsx(Ow,{...s,ref:t}):g.jsx(Pw,{...s,ref:t})})});Wf.displayName=Wn;var Lw=Pf("PopoverContent.RemoveScroll"),Ow=m.forwardRef((e,t)=>{const n=on(Wn,e.__scopePopover),i=m.useRef(null),s=ve(t,i),o=m.useRef(!1);return m.useEffect(()=>{const l=i.current;if(l)return Bs(l)},[]),g.jsx(Bi,{as:Lw,allowPinchZoom:!0,children:g.jsx($f,{...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})})})}),Pw=m.forwardRef((e,t)=>{const n=on(Wn,e.__scopePopover),i=m.useRef(!1),s=m.useRef(!1);return g.jsx($f,{...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()}})}),$f=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=on(Wn,n),w=zi(n);return As(),g.jsx(Ri,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:s,onUnmountAutoFocus:o,children:g.jsx(Gn,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:d,onEscapeKeyDown:a,onPointerDownOutside:r,onFocusOutside:f,onDismiss:()=>b.onOpenChange(!1),children:g.jsx(Ps,{"data-state":Yf(b.open),role:"dialog",id:b.contentId,...w,...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)"}})})})}),Uf="PopoverClose",Iw=m.forwardRef((e,t)=>{const{__scopePopover:n,...i}=e,s=on(Uf,n);return g.jsx(If.button,{type:"button",...i,ref:t,onClick:oe(e.onClick,()=>s.onOpenChange(!1))})});Iw.displayName=Uf;var Bw="PopoverArrow",Fw=m.forwardRef((e,t)=>{const{__scopePopover:n,...i}=e,s=zi(n);return g.jsx(Is,{...s,...i,ref:t})});Fw.displayName=Bw;function Yf(e){return e?"open":"closed"}var jw=Ff,zw=Hf,Hw=Vf,qf=Wf;const Qo=jw,Jo=zw,tr=m.forwardRef(({className:e,align:t="center",sideOffset:n=4,...i},s)=>g.jsx(Hw,{children:g.jsx(qf,{ref:s,align:t,sideOffset:n,className:J("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})}));tr.displayName=qf.displayName;function Vw(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 Ar={},ui={};function dn(e,t){try{const i=(Ar[e]||(Ar[e]=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format))(t).split("GMT")[1];return i in ui?ui[i]:ja(i,i.split(":"))}catch{if(e in ui)return ui[e];const n=e==null?void 0:e.match(Ww);return n?ja(e,n.slice(1)):NaN}}const Ww=/([+-]\d\d):?(\d\d)?/;function ja(e,t){const n=+(t[0]||0),i=+(t[1]||0),s=+(t[2]||0)/60;return ui[e]=n*60+i>0?n*60+i+s:n*60-i-s}class At extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(dn(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)),Zf(this),to(this)):this.setTime(Date.now())}static tz(t,...n){return n.length?new At(...n,t):new At(Date.now(),t)}withTimeZone(t){return new At(+this,t)}getTimezoneOffset(){const t=-dn(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),to(this),+this}[Symbol.for("constructDateFrom")](t){return new At(+new Date(t),this.timeZone)}}const za=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!za.test(e))return;const t=e.replace(za,"$1UTC");At.prototype[t]&&(e.startsWith("get")?At.prototype[e]=function(){return this.internal[t]()}:(At.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),$w(this),+this},At.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),to(this),+this}))});function to(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-dn(e.timeZone,e)*60))}function $w(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()),Zf(e)}function Zf(e){const t=dn(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(-(dn(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=dn(e.timeZone,e),w=b>0?Math.floor(b):Math.ceil(b),S=-new Date(+e).getTimezoneOffset()-w,c=w!==n,u=S-r;if(c&&u){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+u);const p=dn(e.timeZone,e),v=p>0?Math.floor(p):Math.ceil(p),y=w-v;y&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+y),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+y))}}class Qe extends At{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} (${Vw(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 Gf=6048e5,Uw=864e5,Ha=Symbol.for("constructDateFrom");function qe(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Ha in e?e[Ha](t):e instanceof Date?new e.constructor(t):new Date(t)}function Le(e,t){return qe(t||e,e)}function Kf(e,t,n){const i=Le(e,n==null?void 0:n.in);return isNaN(t)?qe(e,NaN):(t&&i.setDate(i.getDate()+t),i)}function Xf(e,t,n){const i=Le(e,n==null?void 0:n.in);if(isNaN(t))return qe(e,NaN);if(!t)return i;const s=i.getDate(),o=qe(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 Yw={};function Hi(){return Yw}function $n(e,t){var a,r,f,d;const n=Hi(),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 xi(e,t){return $n(e,{...t,weekStartsOn:1})}function Qf(e,t){const n=Le(e,t==null?void 0:t.in),i=n.getFullYear(),s=qe(n,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const o=xi(s),l=qe(n,0);l.setFullYear(i,0,4),l.setHours(0,0,0,0);const a=xi(l);return n.getTime()>=o.getTime()?i+1:n.getTime()>=a.getTime()?i:i-1}function Va(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 ei(e,...t){const n=qe.bind(null,t.find(i=>typeof i=="object"));return t.map(n)}function _i(e,t){const n=Le(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function el(e,t,n){const[i,s]=ei(n==null?void 0:n.in,e,t),o=_i(i),l=_i(s),a=+o-Va(o),r=+l-Va(l);return Math.round((a-r)/Uw)}function qw(e,t){const n=Qf(e,t),i=qe(e,0);return i.setFullYear(n,0,4),i.setHours(0,0,0,0),xi(i)}function Zw(e,t,n){return Kf(e,t*7,n)}function Gw(e,t,n){return Xf(e,t*12,n)}function Kw(e,t){let n,i=t==null?void 0:t.in;return e.forEach(s=>{!i&&typeof s=="object"&&(i=qe.bind(null,s));const o=Le(s,i);(!n||n<o||isNaN(+o))&&(n=o)}),qe(i,n||NaN)}function Xw(e,t){let n,i=t==null?void 0:t.in;return e.forEach(s=>{!i&&typeof s=="object"&&(i=qe.bind(null,s));const o=Le(s,i);(!n||n>o||isNaN(+o))&&(n=o)}),qe(i,n||NaN)}function Qw(e,t,n){const[i,s]=ei(n==null?void 0:n.in,e,t);return+_i(i)==+_i(s)}function Jf(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Jw(e){return!(!Jf(e)&&typeof e!="number"||isNaN(+Le(e)))}function eh(e,t,n){const[i,s]=ei(n==null?void 0:n.in,e,t),o=i.getFullYear()-s.getFullYear(),l=i.getMonth()-s.getMonth();return o*12+l}function e2(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 th(e,t){const[n,i]=ei(e,t.start,t.end);return{start:n,end:i}}function t2(e,t){const{start:n,end:i}=th(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(qe(n,l)),l.setMonth(l.getMonth()+a);return s?r.reverse():r}function n2(e,t){const n=Le(e,t==null?void 0:t.in);return n.setDate(1),n.setHours(0,0,0,0),n}function i2(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 nh(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 s2(e,t){const{start:n,end:i}=th(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(qe(n,l)),l.setFullYear(l.getFullYear()+a);return s?r.reverse():r}function ih(e,t){var a,r,f,d;const n=Hi(),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 r2(e,t){return ih(e,{...t,weekStartsOn:1})}const o2={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"}},l2=(e,t,n)=>{let i;const s=o2[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 Dr(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const a2={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},c2={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},u2={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},d2={date:Dr({formats:a2,defaultWidth:"full"}),time:Dr({formats:c2,defaultWidth:"full"}),dateTime:Dr({formats:u2,defaultWidth:"full"})},f2={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},h2=(e,t,n,i)=>f2[e];function ri(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 p2={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},m2={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},g2={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"]},v2={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"]},b2={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"}},y2={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"}},x2=(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"},_2={ordinalNumber:x2,era:ri({values:p2,defaultWidth:"wide"}),quarter:ri({values:m2,defaultWidth:"wide",argumentCallback:e=>e-1}),month:ri({values:g2,defaultWidth:"wide"}),day:ri({values:v2,defaultWidth:"wide"}),dayPeriod:ri({values:b2,defaultWidth:"wide",formattingValues:y2,defaultFormattingWidth:"wide"})};function oi(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)?C2(a,h=>h.test(l)):w2(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 w2(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function C2(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function S2(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 E2=/^(\d+)(th|st|nd|rd)?/i,N2=/\d+/i,T2={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},k2={any:[/^b/i,/^(a|c)/i]},M2={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},A2={any:[/1/i,/2/i,/3/i,/4/i]},D2={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},R2={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]},L2={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},O2={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]},P2={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},I2={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}},B2={ordinalNumber:S2({matchPattern:E2,parsePattern:N2,valueCallback:e=>parseInt(e,10)}),era:oi({matchPatterns:T2,defaultMatchWidth:"wide",parsePatterns:k2,defaultParseWidth:"any"}),quarter:oi({matchPatterns:M2,defaultMatchWidth:"wide",parsePatterns:A2,defaultParseWidth:"any",valueCallback:e=>e+1}),month:oi({matchPatterns:D2,defaultMatchWidth:"wide",parsePatterns:R2,defaultParseWidth:"any"}),day:oi({matchPatterns:L2,defaultMatchWidth:"wide",parsePatterns:O2,defaultParseWidth:"any"}),dayPeriod:oi({matchPatterns:P2,defaultMatchWidth:"any",parsePatterns:I2,defaultParseWidth:"any"})},kn={code:"en-US",formatDistance:l2,formatLong:d2,formatRelative:h2,localize:_2,match:B2,options:{weekStartsOn:0,firstWeekContainsDate:1}};function F2(e,t){const n=Le(e,t==null?void 0:t.in);return el(n,nh(n))+1}function tl(e,t){const n=Le(e,t==null?void 0:t.in),i=+xi(n)-+qw(n);return Math.round(i/Gf)+1}function sh(e,t){var d,h,b,w;const n=Le(e,t==null?void 0:t.in),i=n.getFullYear(),s=Hi(),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??((w=(b=s.locale)==null?void 0:b.options)==null?void 0:w.firstWeekContainsDate)??1,l=qe((t==null?void 0:t.in)||e,0);l.setFullYear(i+1,0,o),l.setHours(0,0,0,0);const a=$n(l,t),r=qe((t==null?void 0:t.in)||e,0);r.setFullYear(i,0,o),r.setHours(0,0,0,0);const f=$n(r,t);return+n>=+a?i+1:+n>=+f?i:i-1}function j2(e,t){var a,r,f,d;const n=Hi(),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=sh(e,t),o=qe((t==null?void 0:t.in)||e,0);return o.setFullYear(s,0,i),o.setHours(0,0,0,0),$n(o,t)}function nl(e,t){const n=Le(e,t==null?void 0:t.in),i=+$n(n,t)-+j2(n,t);return Math.round(i/Gf)+1}function Re(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 Re(t==="yy"?i%100:i,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Re(n+1,2)},d(e,t){return Re(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 Re(e.getHours()%12||12,t.length)},H(e,t){return Re(e.getHours(),t.length)},m(e,t){return Re(e.getMinutes(),t.length)},s(e,t){return Re(e.getSeconds(),t.length)},S(e,t){const n=t.length,i=e.getMilliseconds(),s=Math.trunc(i*Math.pow(10,n-3));return Re(s,t.length)}},En={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Wa={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=sh(e,i),o=s>0?s:1-s;if(t==="YY"){const l=o%100;return Re(l,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):Re(o,t.length)},R:function(e,t){const n=Qf(e);return Re(n,t.length)},u:function(e,t){const n=e.getFullYear();return Re(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 Re(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 Re(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 Re(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=nl(e,i);return t==="wo"?n.ordinalNumber(s,{unit:"week"}):Re(s,t.length)},I:function(e,t,n){const i=tl(e);return t==="Io"?n.ordinalNumber(i,{unit:"week"}):Re(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=F2(e);return t==="Do"?n.ordinalNumber(i,{unit:"dayOfYear"}):Re(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 Re(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 Re(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 Re(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=En.noon:i===0?s=En.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=En.evening:i>=12?s=En.afternoon:i>=4?s=En.morning:s=En.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"}):Re(i,t.length)},k:function(e,t,n){let i=e.getHours();return i===0&&(i=24),t==="ko"?n.ordinalNumber(i,{unit:"hour"}):Re(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 Ua(i);case"XXXX":case"XX":return cn(i);case"XXXXX":case"XXX":default:return cn(i,":")}},x:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"x":return Ua(i);case"xxxx":case"xx":return cn(i);case"xxxxx":case"xxx":default:return cn(i,":")}},O:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+$a(i,":");case"OOOO":default:return"GMT"+cn(i,":")}},z:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+$a(i,":");case"zzzz":default:return"GMT"+cn(i,":")}},t:function(e,t,n){const i=Math.trunc(+e/1e3);return Re(i,t.length)},T:function(e,t,n){return Re(+e,t.length)}};function $a(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+Re(o,2)}function Ua(e,t){return e%60===0?(e>0?"-":"+")+Re(Math.abs(e)/60,2):cn(e,t)}function cn(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),s=Re(Math.trunc(i/60),2),o=Re(i%60,2);return n+s+t+o}const Ya=(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"})}},rh=(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"})}},z2=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],i=n[1],s=n[2];if(!s)return Ya(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}}",Ya(i,t)).replace("{{time}}",rh(s,t))},H2={p:rh,P:z2},V2=/^D+$/,W2=/^Y+$/,$2=["D","DD","YY","YYYY"];function U2(e){return V2.test(e)}function Y2(e){return W2.test(e)}function q2(e,t,n){const i=Z2(e,t,n);if(console.warn(i),$2.includes(e))throw new RangeError(i)}function Z2(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 G2=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,K2=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,X2=/^'([^]*?)'?$/,Q2=/''/g,J2=/[a-zA-Z]/;function jt(e,t,n){var d,h,b,w,C,S,c,u;const i=Hi(),s=(n==null?void 0:n.locale)??i.locale??kn,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??((w=(b=i.locale)==null?void 0:b.options)==null?void 0:w.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(!Jw(a))throw new RangeError("Invalid time value");let r=t.match(K2).map(p=>{const v=p[0];if(v==="p"||v==="P"){const y=H2[v];return y(p,s.formatLong)}return p}).join("").match(G2).map(p=>{if(p==="''")return{isToken:!1,value:"'"};const v=p[0];if(v==="'")return{isToken:!1,value:eC(p)};if(Wa[v])return{isToken:!0,value:p};if(v.match(J2))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)&&Y2(v)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&U2(v))&&q2(v,t,String(e));const y=Wa[v[0]];return y(a,v,s.localize,f)}).join("")}function eC(e){const t=e.match(X2);return t?t[1].replace(Q2,"'"):e}function tC(e,t){const n=Le(e,t==null?void 0:t.in),i=n.getFullYear(),s=n.getMonth(),o=qe(n,0);return o.setFullYear(i,s+1,0),o.setHours(0,0,0,0),o.getDate()}function nC(e,t){return Le(e,t==null?void 0:t.in).getMonth()}function iC(e,t){return Le(e,t==null?void 0:t.in).getFullYear()}function sC(e,t){return+Le(e)>+Le(t)}function rC(e,t){return+Le(e)<+Le(t)}function oC(e,t,n){const[i,s]=ei(n==null?void 0:n.in,e,t);return i.getFullYear()===s.getFullYear()&&i.getMonth()===s.getMonth()}function lC(e,t,n){const[i,s]=ei(n==null?void 0:n.in,e,t);return i.getFullYear()===s.getFullYear()}function aC(e,t,n){const i=Le(e,n==null?void 0:n.in),s=i.getFullYear(),o=i.getDate(),l=qe(e,0);l.setFullYear(s,t,15),l.setHours(0,0,0,0);const a=tC(l);return i.setMonth(t,Math.min(o,a)),i}function cC(e,t,n){const i=Le(e,n==null?void 0:n.in);return isNaN(+i)?qe(e,NaN):(i.setFullYear(t),i)}const qa=5,uC=4;function dC(e,t){const n=t.startOfMonth(e),i=n.getDay()>0?n.getDay():7,s=t.addDays(e,-i+1),o=t.addDays(s,qa*7-1);return t.getMonth(e)===t.getMonth(o)?qa:uC}function oh(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 fC(e,t){const n=oh(e,t),i=dC(e,t);return t.addDays(n,i*7-1)}const lh={...kn,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:kn,...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:kn,...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:kn,...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:kn,...t}),i(e,"cccc")}}};class ct{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):Kf(i,s)},this.addMonths=(i,s)=>{var o;return(o=this.overrides)!=null&&o.addMonths?this.overrides.addMonths(i,s):Xf(i,s)},this.addWeeks=(i,s)=>{var o;return(o=this.overrides)!=null&&o.addWeeks?this.overrides.addWeeks(i,s):Zw(i,s)},this.addYears=(i,s)=>{var o;return(o=this.overrides)!=null&&o.addYears?this.overrides.addYears(i,s):Gw(i,s)},this.differenceInCalendarDays=(i,s)=>{var o;return(o=this.overrides)!=null&&o.differenceInCalendarDays?this.overrides.differenceInCalendarDays(i,s):el(i,s)},this.differenceInCalendarMonths=(i,s)=>{var o;return(o=this.overrides)!=null&&o.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(i,s):eh(i,s)},this.eachMonthOfInterval=i=>{var s;return(s=this.overrides)!=null&&s.eachMonthOfInterval?this.overrides.eachMonthOfInterval(i):t2(i)},this.eachYearOfInterval=i=>{var a;const s=(a=this.overrides)!=null&&a.eachYearOfInterval?this.overrides.eachYearOfInterval(i):s2(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):fC(i,this)},this.endOfISOWeek=i=>{var s;return(s=this.overrides)!=null&&s.endOfISOWeek?this.overrides.endOfISOWeek(i):r2(i)},this.endOfMonth=i=>{var s;return(s=this.overrides)!=null&&s.endOfMonth?this.overrides.endOfMonth(i):e2(i)},this.endOfWeek=(i,s)=>{var o;return(o=this.overrides)!=null&&o.endOfWeek?this.overrides.endOfWeek(i,s):ih(i,this.options)},this.endOfYear=i=>{var s;return(s=this.overrides)!=null&&s.endOfYear?this.overrides.endOfYear(i):i2(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):tl(i)},this.getMonth=(i,s)=>{var o;return(o=this.overrides)!=null&&o.getMonth?this.overrides.getMonth(i,this.options):nC(i,this.options)},this.getYear=(i,s)=>{var o;return(o=this.overrides)!=null&&o.getYear?this.overrides.getYear(i,this.options):iC(i,this.options)},this.getWeek=(i,s)=>{var o;return(o=this.overrides)!=null&&o.getWeek?this.overrides.getWeek(i,this.options):nl(i,this.options)},this.isAfter=(i,s)=>{var o;return(o=this.overrides)!=null&&o.isAfter?this.overrides.isAfter(i,s):sC(i,s)},this.isBefore=(i,s)=>{var o;return(o=this.overrides)!=null&&o.isBefore?this.overrides.isBefore(i,s):rC(i,s)},this.isDate=i=>{var s;return(s=this.overrides)!=null&&s.isDate?this.overrides.isDate(i):Jf(i)},this.isSameDay=(i,s)=>{var o;return(o=this.overrides)!=null&&o.isSameDay?this.overrides.isSameDay(i,s):Qw(i,s)},this.isSameMonth=(i,s)=>{var o;return(o=this.overrides)!=null&&o.isSameMonth?this.overrides.isSameMonth(i,s):oC(i,s)},this.isSameYear=(i,s)=>{var o;return(o=this.overrides)!=null&&o.isSameYear?this.overrides.isSameYear(i,s):lC(i,s)},this.max=i=>{var s;return(s=this.overrides)!=null&&s.max?this.overrides.max(i):Kw(i)},this.min=i=>{var s;return(s=this.overrides)!=null&&s.min?this.overrides.min(i):Xw(i)},this.setMonth=(i,s)=>{var o;return(o=this.overrides)!=null&&o.setMonth?this.overrides.setMonth(i,s):aC(i,s)},this.setYear=(i,s)=>{var o;return(o=this.overrides)!=null&&o.setYear?this.overrides.setYear(i,s):cC(i,s)},this.startOfBroadcastWeek=(i,s)=>{var o;return(o=this.overrides)!=null&&o.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(i,this):oh(i,this)},this.startOfDay=i=>{var s;return(s=this.overrides)!=null&&s.startOfDay?this.overrides.startOfDay(i):_i(i)},this.startOfISOWeek=i=>{var s;return(s=this.overrides)!=null&&s.startOfISOWeek?this.overrides.startOfISOWeek(i):xi(i)},this.startOfMonth=i=>{var s;return(s=this.overrides)!=null&&s.startOfMonth?this.overrides.startOfMonth(i):n2(i)},this.startOfWeek=(i,s)=>{var o;return(o=this.overrides)!=null&&o.startOfWeek?this.overrides.startOfWeek(i,this.options):$n(i,this.options)},this.startOfYear=i=>{var s;return(s=this.overrides)!=null&&s.startOfYear?this.overrides.startOfYear(i):nh(i)},this.options={locale:lh,...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&&ct.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&&ct.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)}}ct.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 Ot=new ct;class ah{constructor(t,n,i=Ot){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 hC{constructor(t,n){this.date=t,this.weeks=n}}class pC{constructor(t,n){this.days=n,this.weekNumber=t}}function mC(e){return K.createElement("button",{...e})}function gC(e){return K.createElement("span",{...e})}function vC(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 bC(e){const{day:t,modifiers:n,...i}=e;return K.createElement("td",{...i})}function yC(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 fe;(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"})(fe||(fe={}));var je;(function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"})(je||(je={}));var _t;(function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"})(_t||(_t={}));var rt;(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"})(rt||(rt={}));function xC(e){const{options:t,className:n,components:i,classNames:s,...o}=e,l=[s[fe.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[fe.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[fe.CaptionLabel],"aria-hidden":!0},a==null?void 0:a.label,K.createElement(i.Chevron,{orientation:"down",size:18,className:s[fe.Chevron]})))}function _C(e){return K.createElement("div",{...e})}function wC(e){return K.createElement("div",{...e})}function CC(e){const{calendarMonth:t,displayIndex:n,...i}=e;return K.createElement("div",{...i},e.children)}function SC(e){const{calendarMonth:t,displayIndex:n,...i}=e;return K.createElement("div",{...i})}function EC(e){return K.createElement("table",{...e})}function NC(e){return K.createElement("div",{...e})}const ch=K.createContext(void 0);function Vi(){const e=K.useContext(ch);if(e===void 0)throw new Error("useDayPicker() must be used within a custom component.");return e}function TC(e){const{components:t}=Vi();return K.createElement(t.Dropdown,{...e})}function kC(e){const{onPreviousClick:t,onNextClick:n,previousMonth:i,nextMonth:s,...o}=e,{components:l,classNames:a,labels:{labelPrevious:r,labelNext:f}}=Vi(),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[fe.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[fe.Chevron],orientation:"left"})),K.createElement(l.NextMonthButton,{type:"button",className:a[fe.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[fe.Chevron]})))}function MC(e){const{components:t}=Vi();return K.createElement(t.Button,{...e})}function AC(e){return K.createElement("option",{...e})}function DC(e){const{components:t}=Vi();return K.createElement(t.Button,{...e})}function RC(e){const{rootRef:t,...n}=e;return K.createElement("div",{...n,ref:t})}function LC(e){return K.createElement("select",{...e})}function OC(e){const{week:t,...n}=e;return K.createElement("tr",{...n})}function PC(e){return K.createElement("th",{...e})}function IC(e){return K.createElement("thead",{"aria-hidden":!0},K.createElement("tr",{...e}))}function BC(e){const{week:t,...n}=e;return K.createElement("th",{...n})}function FC(e){return K.createElement("th",{...e})}function jC(e){return K.createElement("tbody",{...e})}function zC(e){const{components:t}=Vi();return K.createElement(t.Dropdown,{...e})}const HC=Object.freeze(Object.defineProperty({__proto__:null,Button:mC,CaptionLabel:gC,Chevron:vC,Day:bC,DayButton:yC,Dropdown:xC,DropdownNav:_C,Footer:wC,Month:CC,MonthCaption:SC,MonthGrid:EC,Months:NC,MonthsDropdown:TC,Nav:kC,NextMonthButton:MC,Option:AC,PreviousMonthButton:DC,Root:RC,Select:LC,Week:OC,WeekNumber:BC,WeekNumberHeader:FC,Weekday:PC,Weekdays:IC,Weeks:jC,YearsDropdown:zC},Symbol.toStringTag,{value:"Module"}));function zt(e,t,n=!1,i=Ot){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 il(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function nr(e){return!!(e&&typeof e=="object"&&"from"in e)}function sl(e){return!!(e&&typeof e=="object"&&"after"in e)}function rl(e){return!!(e&&typeof e=="object"&&"before"in e)}function uh(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function dh(e,t){return Array.isArray(e)&&e.every(t.isDate)}function Ht(e,t,n=Ot){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(dh(a,n))return a.some(r=>s(e,r));if(nr(a))return zt(a,e,!1,n);if(uh(a))return Array.isArray(a.dayOfWeek)?a.dayOfWeek.includes(e.getDay()):a.dayOfWeek===e.getDay();if(il(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 sl(a)?o(e,a.after)>0:rl(a)?o(a.before,e)>0:typeof a=="function"?a(e):!1})}function VC(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:w,isBefore:C,endOfMonth:S,isAfter:c}=s,u=n&&w(n),p=i&&S(i),v={[je.focused]:[],[je.outside]:[],[je.disabled]:[],[je.hidden]:[],[je.today]:[]},y={};for(const _ of e){const{date:x,displayMonth:E}=_,T=!!(E&&!b(x,E)),N=!!(u&&C(x,u)),k=!!(p&&c(x,p)),D=!!(o&&Ht(x,o,s)),M=!!(l&&Ht(x,l,s))||N||k||!f&&!r&&T||f&&r===!1&&T,A=h(x,d);T&&v.outside.push(_),D&&v.disabled.push(_),M&&v.hidden.push(_),A&&v.today.push(_),a&&Object.keys(a).forEach(R=>{const z=a==null?void 0:a[R];z&&Ht(x,z,s)&&(y[R]?y[R].push(_):y[R]=[_])})}return _=>{const x={[je.focused]:!1,[je.disabled]:!1,[je.hidden]:!1,[je.outside]:!1,[je.today]:!1},E={};for(const T in v){const N=v[T];x[T]=N.some(k=>k===_)}for(const T in y)E[T]=y[T].some(N=>N===_);return{...x,...E}}}function WC(e,t,n={}){return Object.entries(e).filter(([,s])=>s===!0).reduce((s,[o])=>(n[o]?s.push(n[o]):t[je[o]]?s.push(t[je[o]]):t[_t[o]]&&s.push(t[_t[o]]),s),[t[fe.Day]])}function $C(e){return{...HC,...e}}function UC(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 YC(){const e={};for(const t in fe)e[fe[t]]=`rdp-${fe[t]}`;for(const t in je)e[je[t]]=`rdp-${je[t]}`;for(const t in _t)e[_t[t]]=`rdp-${_t[t]}`;for(const t in rt)e[rt[t]]=`rdp-${rt[t]}`;return e}function fh(e,t,n){return(n??new ct(t)).formatMonthYear(e)}const qC=fh;function ZC(e,t,n){return(n??new ct(t)).format(e,"d")}function GC(e,t=Ot){return t.format(e,"LLLL")}function KC(e,t,n){return(n??new ct(t)).format(e,"cccccc")}function XC(e,t=Ot){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)}function QC(){return""}function hh(e,t=Ot){return t.format(e,"yyyy")}const JC=hh,eS=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:fh,formatDay:ZC,formatMonthCaption:qC,formatMonthDropdown:GC,formatWeekNumber:XC,formatWeekNumberHeader:QC,formatWeekdayName:KC,formatYearCaption:JC,formatYearDropdown:hh},Symbol.toStringTag,{value:"Module"}));function tS(e){return e!=null&&e.formatMonthCaption&&!e.formatCaption&&(e.formatCaption=e.formatMonthCaption),e!=null&&e.formatYearCaption&&!e.formatYearDropdown&&(e.formatYearDropdown=e.formatYearCaption),{...eS,...e}}function ol(e,t,n,i){let s=(i??new ct(n)).format(e,"PPPP");return t.today&&(s=`Today, ${s}`),t.selected&&(s=`${s}, selected`),s}const nS=ol;function ll(e,t,n){return(n??new ct(t)).formatMonthYear(e)}const iS=ll;function ph(e,t,n,i){let s=(i??new ct(n)).format(e,"PPPP");return t!=null&&t.today&&(s=`Today, ${s}`),s}function mh(e){return"Choose the Month"}function gh(){return""}const sS="Go to the Next Month";function vh(e,t){return sS}function bh(e){return"Go to the Previous Month"}function yh(e,t,n){return(n??new ct(t)).format(e,"cccc")}function xh(e,t){return`Week ${e}`}function _h(e){return"Week Number"}function wh(e){return"Choose the Year"}const rS=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:iS,labelDay:nS,labelDayButton:ol,labelGrid:ll,labelGridcell:ph,labelMonthDropdown:mh,labelNav:gh,labelNext:vh,labelPrevious:bh,labelWeekNumber:xh,labelWeekNumberHeader:_h,labelWeekday:yh,labelYearDropdown:wh},Symbol.toStringTag,{value:"Module"})),vt=(e,t,n)=>t||(n?typeof n=="function"?n:(...i)=>n:e);function oS(e,t){var i;const n=((i=t.locale)==null?void 0:i.labels)??{};return{...rS,...e??{},labelDayButton:vt(ol,e==null?void 0:e.labelDayButton,n.labelDayButton),labelMonthDropdown:vt(mh,e==null?void 0:e.labelMonthDropdown,n.labelMonthDropdown),labelNext:vt(vh,e==null?void 0:e.labelNext,n.labelNext),labelPrevious:vt(bh,e==null?void 0:e.labelPrevious,n.labelPrevious),labelWeekNumber:vt(xh,e==null?void 0:e.labelWeekNumber,n.labelWeekNumber),labelYearDropdown:vt(wh,e==null?void 0:e.labelYearDropdown,n.labelYearDropdown),labelGrid:vt(ll,e==null?void 0:e.labelGrid,n.labelGrid),labelGridcell:vt(ph,e==null?void 0:e.labelGridcell,n.labelGridcell),labelNav:vt(gh,e==null?void 0:e.labelNav,n.labelNav),labelWeekNumberHeader:vt(_h,e==null?void 0:e.labelWeekNumberHeader,n.labelWeekNumberHeader),labelWeekday:vt(yh,e==null?void 0:e.labelWeekday,n.labelWeekday)}}function lS(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 w=i.formatMonthDropdown(b,s),C=f(b),S=t&&b<o(t)||n&&b>o(n)||!1;return{value:C,label:w,disabled:S}})}function aS(e,t={},n={}){let i={...t==null?void 0:t[fe.Day]};return Object.entries(e).filter(([,s])=>s===!0).forEach(([s])=>{i={...i,...n==null?void 0:n[s]}}),i}function cS(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 uS(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 w=n.formatYearDropdown(b,i);return{value:r(b),label:w,disabled:!1}})}function dS(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),w=((((f==null?void 0:f.weekStartsOn)??s)+6)%7-d.getDay()+7)%7;return d.setDate(d.getDate()+w),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),w=d.getFullYear()*12+d.getMonth();for(;b.getFullYear()*12+b.getMonth()<=w;)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 nl(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 tl(f)},differenceInCalendarDays:(r,f)=>{const d=l(r),h=l(f);return el(d,h)},differenceInCalendarMonths:(r,f)=>{const d=l(r),h=l(f);return eh(d,h)}}}const Wi=e=>e instanceof HTMLElement?e:null,Rr=e=>[...e.querySelectorAll("[data-animated-month]")??[]],fS=e=>Wi(e.querySelector("[data-animated-month]")),Lr=e=>Wi(e.querySelector("[data-animated-caption]")),Or=e=>Wi(e.querySelector("[data-animated-weeks]")),hS=e=>Wi(e.querySelector("[data-animated-nav]")),pS=e=>Wi(e.querySelector("[data-animated-weekdays]"));function mS(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[rt.caption_after_enter]:n[rt.caption_before_enter],w=h?n[rt.weeks_after_enter]:n[rt.weeks_before_enter],C=l.current,S=e.current.cloneNode(!0);if(S instanceof HTMLElement?(Rr(S).forEach(v=>{if(!(v instanceof HTMLElement))return;const y=fS(v);y&&v.contains(y)&&v.removeChild(y);const _=Lr(v);_&&_.classList.remove(b);const x=Or(v);x&&x.classList.remove(w)}),l.current=S):l.current=null,r.current||d||s)return;const c=C instanceof HTMLElement?Rr(C):[],u=Rr(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=hS(e.current);p&&(p.style.zIndex="1"),u.forEach((v,y)=>{const _=c[y];if(!_)return;v.style.position="relative",v.style.overflow="hidden";const x=Lr(v);x&&x.classList.add(b);const E=Or(v);E&&E.classList.add(w);const T=()=>{r.current=!1,e.current&&(e.current.style.isolation=""),p&&(p.style.zIndex=""),x&&x.classList.remove(b),E&&E.classList.remove(w),v.style.position="",v.style.overflow="",v.contains(_)&&v.removeChild(_)};_.style.pointerEvents="none",_.style.position="absolute",_.style.overflow="hidden",_.setAttribute("aria-hidden","true");const N=pS(_);N&&(N.style.opacity="0");const k=Lr(_);k&&(k.classList.add(h?n[rt.caption_before_exit]:n[rt.caption_after_exit]),k.addEventListener("animationend",T));const D=Or(_);D&&D.classList.add(h?n[rt.weeks_before_exit]:n[rt.weeks_after_exit]),v.insertBefore(_,v.firstChild)})}})}function gS(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:w,endOfMonth:C,endOfWeek:S,isAfter:c,startOfBroadcastWeek:u,startOfISOWeek:p,startOfWeek:v}=i,y=r?u(s,i):l?p(s):v(s),_=r?b(o):l?w(C(o)):S(C(o)),x=t&&(r?b(t):l?w(t):S(t)),E=x&&c(_,x)?x:_,T=d(E,y),N=h(o,s)+1,k=[];for(let A=0;A<=T;A++){const R=f(y,A);k.push(R)}const M=(r?35:42)*N;if(a&&k.length<M){const A=M-k.length;for(let R=0;R<A;R++){const z=f(k[k.length-1],1);k.push(z)}}return k}function vS(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 bS(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 Za(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 yS(e,t,n,i){const{addDays:s,endOfBroadcastWeek:o,endOfISOWeek:l,endOfMonth:a,endOfWeek:r,getISOWeek:f,getWeek:d,startOfBroadcastWeek:h,startOfISOWeek:b,startOfWeek:w}=i,C=e.reduce((S,c)=>{const u=n.broadcastCalendar?h(c,i):n.ISOWeek?b(c):w(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(T=>{const N=y-v.length;return T>p&&T<=s(p,N)});v.push(...E)}const _=v.reduce((E,T)=>{const N=n.ISOWeek?f(T):d(T),k=E.find(M=>M.weekNumber===N),D=new ah(T,c,i);return k?k.days.push(D):E.push(new pC(N,[D])),E},[]),x=new hC(c,_);return S.push(x),S},[]);return n.reverseMonths?C.reverse():C}function xS(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:w,fromMonth:C,toMonth:S}=e;!n&&C&&(n=C),!n&&b&&(n=t.newDate(b,0,1)),!i&&S&&(i=S),!i&&w&&(i=d(w,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):w?i=d(w,11,31):!i&&c&&(i=f(e.today??h())),[n&&o(n),i&&o(i)]}function _S(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 wS(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 CS(e){const t=[];return e.reduce((n,i)=>n.concat(i.weeks.slice()),t.slice())}function ir(e,t){const[n,i]=K.useState(e);return[t===void 0?n:t,i]}function SS(e,t){var y;const[n,i]=xS(e,t),{startOfMonth:s,endOfMonth:o}=t,l=Za(e,n,i,t),[a,r]=ir(l,e.month?l:void 0);K.useEffect(()=>{const _=Za(e,n,i,t);r(_)},[e.timeZone]);const{months:f,weeks:d,days:h,previousMonth:b,nextMonth:w}=K.useMemo(()=>{const _=bS(a,i,{numberOfMonths:e.numberOfMonths},t),x=gS(_,e.endMonth?o(e.endMonth):void 0,{ISOWeek:e.ISOWeek,fixedWeeks:e.fixedWeeks,broadcastCalendar:e.broadcastCalendar},t),E=yS(_,x,{broadcastCalendar:e.broadcastCalendar,fixedWeeks:e.fixedWeeks,ISOWeek:e.ISOWeek,reverseMonths:e.reverseMonths},t),T=CS(E),N=vS(E),k=wS(a,n,e,t),D=_S(a,i,e,t);return{months:E,weeks:T,days:N,previousMonth:k,nextMonth:D}},[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=_=>d.some(x=>x.days.some(E=>E.isEqualTo(_))),u=_=>{if(C)return;let x=s(_);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:w,goToMonth:u,goToDay:_=>{c(_)||u(_.date)}}}var Nt;(function(e){e[e.Today=0]="Today",e[e.Selected=1]="Selected",e[e.LastFocused=2]="LastFocused",e[e.FocusedModifier=3]="FocusedModifier"})(Nt||(Nt={}));function Ga(e){return!e[je.disabled]&&!e[je.hidden]&&!e[je.outside]}function ES(e,t,n,i){let s,o=-1;for(const l of e){const a=t(l);Ga(a)&&(a[je.focused]&&o<Nt.FocusedModifier?(s=l,o=Nt.FocusedModifier):i!=null&&i.isEqualTo(l)&&o<Nt.LastFocused?(s=l,o=Nt.LastFocused):n(l.date)&&o<Nt.Selected?(s=l,o=Nt.Selected):a[je.today]&&o<Nt.Today&&(s=l,o=Nt.Today))}return s||(s=e.find(l=>Ga(t(l)))),s}function NS(e,t,n,i,s,o,l){const{ISOWeek:a,broadcastCalendar:r}=o,{addDays:f,addMonths:d,addWeeks:h,addYears:b,endOfBroadcastWeek:w,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?w(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 Ch(e,t,n,i,s,o,l,a=0){if(a>365)return;const r=NS(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 ah(r,h,l);return!f&&!d?b:Ch(e,t,b,i,s,o,l,a+1)}function TS(e,t,n,i,s){const{autoFocus:o}=e,[l,a]=K.useState(),r=ES(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=Ch(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 kS(e,t){const{selected:n,required:i,onSelect:s}=e,[o,l]=ir(n,s?n:void 0),a=s?n:o,{isSameDay:r}=t,f=w=>(a==null?void 0:a.some(C=>r(C,w)))??!1,{min:d,max:h}=e;return{selected:a,select:(w,C,S)=>{let c=[...a??[]];if(f(w)){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,w))}else(a==null?void 0:a.length)===h?c=[w]:c=[...c,w];return s||l(c),s==null||s(c,w,C,S),c},isSelected:f}}function MS(e,t,n=0,i=0,s=!1,o=Ot){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 AS(e,t,n=Ot){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 Ka(e,t,n=Ot){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 DS(e,t,n=Ot){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):dh(a,n)?a.some(r=>zt(e,r,!1,n)):nr(a)?a.from&&a.to?Ka(e,{from:a.from,to:a.to},n):!1:uh(a)?AS(e,a.dayOfWeek,n):il(a)?n.isAfter(a.before,a.after)?Ka(e,{from:n.addDays(a.after,1),to:n.addDays(a.before,-1)},n):Ht(e.from,a,n)||Ht(e.to,a,n):sl(a)||rl(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 RS(e,t){const{disabled:n,excludeDisabled:i,selected:s,required:o,onSelect:l}=e,[a,r]=ir(s,l?s:void 0),f=l?s:a;return{selected:f,select:(b,w,C)=>{const{min:S,max:c}=e,u=b?MS(b,f,S,c,o,t):void 0;return i&&n&&(u!=null&&u.from)&&u.to&&DS({from:u.from,to:u.to},n,t)&&(u.from=b,u.to=void 0),l||r(u),l==null||l(u,b,w,C),u},isSelected:b=>f&&zt(f,b,!1,t)}}function LS(e,t){const{selected:n,required:i,onSelect:s}=e,[o,l]=ir(n,s?n:void 0),a=s?n:o,{isSameDay:r}=t;return{selected:a,select:(h,b,w)=>{let C=h;return!i&&a&&a&&r(h,a)&&(C=void 0),s||l(C),s==null||s(C,h,b,w),C},isSelected:h=>a?r(a,h):!1}}function OS(e,t){const n=LS(e,t),i=kS(e,t),s=RS(e,t);switch(e.mode){case"single":return n;case"multiple":return i;case"range":return s;default:return}}function ft(e,t){return e instanceof Qe&&e.timeZone===t?e:new Qe(e,t)}function Nn(e,t,n){return ft(e,t)}function Xa(e,t,n){return typeof e=="boolean"||typeof e=="function"?e:e instanceof Date?Nn(e,t):Array.isArray(e)?e.map(i=>i instanceof Date?Nn(i,t):i):nr(e)?{...e,from:e.from?ft(e.from,t):e.from,to:e.to?ft(e.to,t):e.to}:il(e)?{before:Nn(e.before,t),after:Nn(e.after,t)}:sl(e)?{after:Nn(e.after,t)}:rl(e)?{before:Nn(e.before,t)}:e}function Pr(e,t,n){return e&&(Array.isArray(e)?e.map(i=>Xa(i,t)):Xa(e,t))}function PS(e){var an;let t=e;const n=t.timeZone;if(n&&(t={...e,timeZone:n},t.today&&(t.today=ft(t.today,n)),t.month&&(t.month=ft(t.month,n)),t.defaultMonth&&(t.defaultMonth=ft(t.defaultMonth,n)),t.startMonth&&(t.startMonth=ft(t.startMonth,n)),t.endMonth&&(t.endMonth=ft(t.endMonth,n)),t.mode==="single"&&t.selected?t.selected=ft(t.selected,n):t.mode==="multiple"&&t.selected?t.selected=(an=t.selected)==null?void 0:an.map(he=>ft(he,n)):t.mode==="range"&&t.selected&&(t.selected={from:t.selected.from?ft(t.selected.from,n):t.selected.from,to:t.selected.to?ft(t.selected.to,n):t.selected.to}),t.disabled!==void 0&&(t.disabled=Pr(t.disabled,n)),t.hidden!==void 0&&(t.hidden=Pr(t.hidden,n)),t.modifiers)){const he={};Object.keys(t.modifiers).forEach(Te=>{var de;he[Te]=Pr((de=t.modifiers)==null?void 0:de[Te],n)}),t.modifiers=he}const{components:i,formatters:s,labels:o,dateLib:l,locale:a,classNames:r}=K.useMemo(()=>{const he={...lh,...t.locale},Te=t.broadcastCalendar?1:t.weekStartsOn,de=t.noonSafe&&t.timeZone?dS(t.timeZone,{weekStartsOn:Te,locale:he}):void 0,Me=t.dateLib&&de?{...de,...t.dateLib}:t.dateLib??de,tt=new ct({locale:he,weekStartsOn:Te,firstWeekContainsDate:t.firstWeekContainsDate,useAdditionalWeekYearTokens:t.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:t.useAdditionalDayOfYearTokens,timeZone:t.timeZone,numerals:t.numerals},Me);return{dateLib:tt,components:$C(t.components),formatters:tS(t.formatters),labels:oS(t.labels,tt.options),locale:he,classNames:{...YC(),...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:w,onDayClick:C,onDayFocus:S,onDayKeyDown:c,onDayMouseEnter:u,onDayMouseLeave:p,onNextClick:v,onPrevClick:y,showWeekNumber:_,styles:x}=t,{formatCaption:E,formatDay:T,formatMonthDropdown:N,formatWeekNumber:k,formatWeekNumberHeader:D,formatWeekdayName:M,formatYearDropdown:A}=s,R=SS(t,l),{days:z,months:V,navStart:H,navEnd:F,previousMonth:L,nextMonth:O,goToMonth:j}=R,P=VC(z,t,H,F,l),{isSelected:U,select:I,selected:$}=OS(t,l)??{},{blur:Q,focused:W,isFocusTarget:X,moveFocus:q,setFocused:G}=TS(t,R,P,U??(()=>!1),l),{labelDayButton:ee,labelGridcell:re,labelGrid:ce,labelMonthDropdown:ie,labelNav:le,labelPrevious:we,labelNext:Ce,labelWeekday:be,labelWeekNumber:Ne,labelWeekNumberHeader:B,labelYearDropdown:Y}=o,Z=K.useMemo(()=>cS(l,t.ISOWeek,t.broadcastCalendar,t.today),[l,t.ISOWeek,t.broadcastCalendar,t.today]),se=d!==void 0||C!==void 0,ne=K.useCallback(()=>{L&&(j(L),y==null||y(L))},[L,j,y]),te=K.useCallback(()=>{O&&(j(O),v==null||v(O))},[j,O,v]),ae=K.useCallback((he,Te)=>de=>{de.preventDefault(),de.stopPropagation(),G(he),!Te.disabled&&(I==null||I(he.date,Te,de),C==null||C(he.date,Te,de))},[I,C,G]),ge=K.useCallback((he,Te)=>de=>{G(he),S==null||S(he.date,Te,de)},[S,G]),pe=K.useCallback((he,Te)=>de=>{Q(),w==null||w(he.date,Te,de)},[Q,w]),xe=K.useCallback((he,Te)=>de=>{const Me={ArrowLeft:[de.shiftKey?"month":"day",t.dir==="rtl"?"after":"before"],ArrowRight:[de.shiftKey?"month":"day",t.dir==="rtl"?"before":"after"],ArrowDown:[de.shiftKey?"year":"week","after"],ArrowUp:[de.shiftKey?"year":"week","before"],PageUp:[de.shiftKey?"year":"month","before"],PageDown:[de.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(Me[de.key]){de.preventDefault(),de.stopPropagation();const[tt,Ee]=Me[de.key];q(tt,Ee)}c==null||c(he.date,Te,de)},[q,c,t.dir]),De=K.useCallback((he,Te)=>de=>{u==null||u(he.date,Te,de)},[u]),ke=K.useCallback((he,Te)=>de=>{p==null||p(he.date,Te,de)},[p]),Xe=K.useCallback(he=>Te=>{const de=Number(Te.target.value),Me=l.setMonth(l.startOfMonth(he),de);j(Me)},[l,j]),Fe=K.useCallback(he=>Te=>{const de=Number(Te.target.value),Me=l.setYear(l.startOfMonth(he),de);j(Me)},[l,j]),{className:Pe,style:He}=K.useMemo(()=>({className:[r[fe.Root],t.className].filter(Boolean).join(" "),style:{...x==null?void 0:x[fe.Root],...t.style}}),[r,t.className,t.style,x]),yn=UC(t),xn=K.useRef(null);mS(xn,!!t.animate,{classNames:r,months:V,focused:W,dateLib:l});const Ve={dayPickerProps:t,selected:$,select:I,isSelected:U,months:V,nextMonth:O,previousMonth:L,goToMonth:j,getModifiers:P,components:i,classNames:r,styles:x,labels:o,formatters:s};return K.createElement(ch.Provider,{value:Ve},K.createElement(i.Root,{rootRef:t.animate?xn:void 0,className:Pe,style:He,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"],...yn},K.createElement(i.Months,{className:r[fe.Months],style:x==null?void 0:x[fe.Months]},!t.hideNavigation&&!h&&K.createElement(i.Nav,{"data-animated-nav":t.animate?"true":void 0,className:r[fe.Nav],style:x==null?void 0:x[fe.Nav],"aria-label":le(),onPreviousClick:ne,onNextClick:te,previousMonth:L,nextMonth:O}),V.map((he,Te)=>K.createElement(i.Month,{"data-animated-month":t.animate?"true":void 0,className:r[fe.Month],style:x==null?void 0:x[fe.Month],key:Te,displayIndex:Te,calendarMonth:he},h==="around"&&!t.hideNavigation&&Te===0&&K.createElement(i.PreviousMonthButton,{type:"button",className:r[fe.PreviousMonthButton],tabIndex:L?void 0:-1,"aria-disabled":L?void 0:!0,"aria-label":we(L),onClick:ne,"data-animated-button":t.animate?"true":void 0},K.createElement(i.Chevron,{disabled:L?void 0:!0,className:r[fe.Chevron],orientation:t.dir==="rtl"?"right":"left"})),K.createElement(i.MonthCaption,{"data-animated-caption":t.animate?"true":void 0,className:r[fe.MonthCaption],style:x==null?void 0:x[fe.MonthCaption],calendarMonth:he,displayIndex:Te},f!=null&&f.startsWith("dropdown")?K.createElement(i.DropdownNav,{className:r[fe.Dropdowns],style:x==null?void 0:x[fe.Dropdowns]},(()=>{const de=f==="dropdown"||f==="dropdown-months"?K.createElement(i.MonthsDropdown,{key:"month",className:r[fe.MonthsDropdown],"aria-label":ie(),classNames:r,components:i,disabled:!!t.disableNavigation,onChange:Xe(he.date),options:lS(he.date,H,F,s,l),style:x==null?void 0:x[fe.Dropdown],value:l.getMonth(he.date)}):K.createElement("span",{key:"month"},N(he.date,l)),Me=f==="dropdown"||f==="dropdown-years"?K.createElement(i.YearsDropdown,{key:"year",className:r[fe.YearsDropdown],"aria-label":Y(l.options),classNames:r,components:i,disabled:!!t.disableNavigation,onChange:Fe(he.date),options:uS(H,F,s,l,!!t.reverseYears),style:x==null?void 0:x[fe.Dropdown],value:l.getYear(he.date)}):K.createElement("span",{key:"year"},A(he.date,l));return l.getMonthYearOrder()==="year-first"?[Me,de]:[de,Me]})(),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[fe.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[fe.NextMonthButton],tabIndex:O?void 0:-1,"aria-disabled":O?void 0:!0,"aria-label":Ce(O),onClick:te,"data-animated-button":t.animate?"true":void 0},K.createElement(i.Chevron,{disabled:O?void 0:!0,className:r[fe.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[fe.Nav],style:x==null?void 0:x[fe.Nav],"aria-label":le(),onPreviousClick:ne,onNextClick:te,previousMonth:L,nextMonth:O}),K.createElement(i.MonthGrid,{role:"grid","aria-multiselectable":d==="multiple"||d==="range","aria-label":ce(he.date,l.options,l)||void 0,className:r[fe.MonthGrid],style:x==null?void 0:x[fe.MonthGrid]},!t.hideWeekdays&&K.createElement(i.Weekdays,{"data-animated-weekdays":t.animate?"true":void 0,className:r[fe.Weekdays],style:x==null?void 0:x[fe.Weekdays]},_&&K.createElement(i.WeekNumberHeader,{"aria-label":B(l.options),className:r[fe.WeekNumberHeader],style:x==null?void 0:x[fe.WeekNumberHeader],scope:"col"},D()),Z.map(de=>K.createElement(i.Weekday,{"aria-label":be(de,l.options,l),className:r[fe.Weekday],key:String(de),style:x==null?void 0:x[fe.Weekday],scope:"col"},M(de,l.options,l)))),K.createElement(i.Weeks,{"data-animated-weeks":t.animate?"true":void 0,className:r[fe.Weeks],style:x==null?void 0:x[fe.Weeks]},he.weeks.map(de=>K.createElement(i.Week,{className:r[fe.Week],key:de.weekNumber,style:x==null?void 0:x[fe.Week],week:de},_&&K.createElement(i.WeekNumber,{week:de,style:x==null?void 0:x[fe.WeekNumber],"aria-label":Ne(de.weekNumber,{locale:a}),className:r[fe.WeekNumber],scope:"row",role:"rowheader"},k(de.weekNumber,l)),de.days.map(Me=>{const{date:tt}=Me,Ee=P(Me);if(Ee[je.focused]=!Ee.hidden&&!!(W!=null&&W.isEqualTo(Me)),Ee[_t.selected]=(U==null?void 0:U(tt))||Ee.selected,nr($)){const{from:ni,to:_n}=$;Ee[_t.range_start]=!!(ni&&_n&&l.isSameDay(tt,ni)),Ee[_t.range_end]=!!(ni&&_n&&l.isSameDay(tt,_n)),Ee[_t.range_middle]=zt($,tt,!0,l)}const Xi=aS(Ee,x,t.modifiersStyles),Qi=WC(Ee,r,t.modifiersClassNames),Ji=!se&&!Ee.hidden?re(tt,Ee,l.options,l):void 0;return K.createElement(i.Day,{key:`${Me.isoDate}_${Me.displayMonthId}`,day:Me,modifiers:Ee,className:Qi.join(" "),style:Xi,role:"gridcell","aria-selected":Ee.selected||void 0,"aria-label":Ji,"data-day":Me.isoDate,"data-month":Me.outside?Me.dateMonthId:void 0,"data-selected":Ee.selected||void 0,"data-disabled":Ee.disabled||void 0,"data-hidden":Ee.hidden||void 0,"data-outside":Me.outside||void 0,"data-focused":Ee.focused||void 0,"data-today":Ee.today||void 0},!Ee.hidden&&se?K.createElement(i.DayButton,{className:r[fe.DayButton],style:x==null?void 0:x[fe.DayButton],type:"button",day:Me,modifiers:Ee,disabled:!Ee.focused&&Ee.disabled||void 0,"aria-disabled":Ee.focused&&Ee.disabled||void 0,tabIndex:X(Me)?0:-1,"aria-label":ee(tt,Ee,l.options,l),onClick:ae(Me,Ee),onBlur:pe(Me,Ee),onFocus:ge(Me,Ee),onKeyDown:xe(Me,Ee),onMouseEnter:De(Me,Ee),onMouseLeave:ke(Me,Ee)},T(tt,l.options,l)):!Ee.hidden&&T(Me.date,l.options,l))})))))))),t.footer&&K.createElement(i.Footer,{className:r[fe.Footer],style:x==null?void 0:x[fe.Footer],role:"status","aria-live":"polite"},t.footer)))}const sr=m.forwardRef(({className:e,classNames:t,showOutsideDays:n=!0,...i},s)=>g.jsx(PS,{ref:s,showOutsideDays:n,className:J("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:J("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:J("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(co,{className:"h-4 w-4"}),IconRight:({...o})=>g.jsx(ki,{className:"h-4 w-4"})},...i}));sr.displayName="Calendar";const al=m.forwardRef(({date:e,onDateChange:t,placeholder:n="Pick a date",className:i,...s},o)=>g.jsxs(Qo,{children:[g.jsx(Jo,{asChild:!0,children:g.jsxs(_e,{ref:o,variant:"outline",className:J("w-[280px] justify-start text-left font-normal",!e&&"text-muted-foreground",i),...s,children:[g.jsx(ds,{className:"mr-2 h-4 w-4"}),e?jt(e,"PPP"):g.jsx("span",{children:n})]})}),g.jsx(tr,{className:"w-auto p-0",children:g.jsx(sr,{mode:"single",selected:e,onSelect:t,initialFocus:!0})})]}));al.displayName="DatePicker";const cl=m.forwardRef(({dateRange:e,onDateRangeChange:t,placeholder:n="Pick a date range",className:i,...s},o)=>g.jsx("div",{className:J("grid gap-2",i),children:g.jsxs(Qo,{children:[g.jsx(Jo,{asChild:!0,children:g.jsxs(_e,{ref:o,id:"date",variant:"outline",className:J("w-[300px] justify-start text-left font-normal",!e&&"text-muted-foreground"),...s,children:[g.jsx(ds,{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(tr,{className:"w-auto p-0",align:"start",children:g.jsx(sr,{initialFocus:!0,mode:"range",defaultMonth:e==null?void 0:e.from,selected:e,onSelect:t,numberOfMonths:2})})]})}));cl.displayName="DateRangePicker";var rr={},ul={};const Sh={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))}},Eh={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)}},Nh={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()}},Th={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()}},kh={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}},Mh={name:"fontColor",display:"submenu",add:function(e,t){e.addModule([kh]);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()}},Ah={name:"hiliteColor",display:"submenu",add:function(e,t){e.addModule([kh]);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()}},Dh={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())}},Rh={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,w=!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)))){w=!1;break}if(w&&(!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 _=v-1;_>=0;_--)if(s[_].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,_,x;v<y;v++)x=o.getRangeFormatElement(s[v],p),!(!x||!o.isList(x))&&(_?_!==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)),_=x,c={r:_,f:[o.getParentElement(s[v],"LI")]}):c.f.push(o.getParentElement(s[v],"LI")):(_=x,c={r:_,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,_=null;const x=(function(E){return!this.isComponent(E)&&!this.isList(E)}).bind(o);for(let E=0,T=s.length,N,k,D,M,A,R,z,V,H;E<T;E++){if(k=s[E],k.childNodes.length===0&&!o._isIgnoreNodeChange(k)){o.removeItem(k);continue}if(M=s[E+1],A=k.parentNode,R=M?M.parentNode:null,D=o.isListCell(k),H=o.isRangeFormatElement(A)?A:null,z=D&&!o.isWysiwygDiv(A)?A.parentNode:A,V=D&&!o.isWysiwygDiv(A)?!M||o.isListCell(z)?A:A.nextSibling:k.nextSibling,N=o.createElement("LI"),o.copyFormatAttributes(N,k),E===0&&h.sc===k&&(h.sc=N),E===T-1&&h.ec===k&&(h.ec=N),o.isComponent(k)){const F=/^HR$/i.test(k.nodeName);F||(N.innerHTML="<br>"),N.innerHTML+=k.outerHTML,F&&(N.innerHTML+="<br>")}else{const F=k.childNodes;for(;F[0];)N.appendChild(F[0])}p.appendChild(N),(!M||z!==R||o.isRangeFormatElement(V))&&(v||(v=p),(!c||!M||z!==R)&&!(M&&o.isList(R)&&R===A)&&p.parentNode!==z&&z.insertBefore(p,V)),o.removeItem(k),c&&y===null&&(y=p.children.length-1),M&&(o.getRangeFormatElement(R,x)!==o.getRangeFormatElement(A,x)||o.isList(R)&&o.isList(A)&&o.getElementDepth(R)!==o.getElementDepth(A))&&(p=o.createElement(e)),H&&H.children.length===0&&o.removeItem(H)}y&&(v=v.children[y]),u&&(_=p.children.length-1,p.innerHTML+=f.innerHTML,p.children[_],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,w=n,C;b<w;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)}},Lh={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 w=0,C=h.length,S,c,u,p;w<C;w++){if(S=h[w],c=S.colSpan-1,u=S.rowSpan-1,p=w+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--)):w===C-1&&(y.rs-=1,y.row=d+1,y.rs<1&&(f.splice(v,1),v--)));if(d===a&&w===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(w,C){return w.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 w=0,C=b.length,S,c;w<C;w++)S=b[w].rowSpan,c=b[w].colSpan,!(S<2&&c<2)&&S+d>l&&l>d&&(b[w].rowSpan=S+a,f-=c)}if(i){const d=r[o+1];if(d){const h=[];let b=r[o].cells,w=0;for(let C=0,S=b.length,c,u;C<S;C++)c=b[C],u=C+w,w+=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,w=0;for(let S=0,c=b.length,u,p;S<c&&(u=b[S],p=S+w,w+=u.colSpan-1,!(p>=C.index&&(S--,w--,w+=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=[],w=[];for(let C=0,S=n._rowCnt,c,u,p,v,y,_;C<S;C++){c=r[C],u=a,y=!1,p=c.cells,_=0;for(let x=0,E,T=p.length,N,k,D;x<T&&(E=p[x],!!E);x++)if(N=E.rowSpan-1,k=E.colSpan-1,s){if(D=x+_,d.length>0){const M=!p[x+1];for(let A=0,R;A<d.length;A++)R=d[A],!(R.row>C)&&(D>=R.index?(_+=R.cs,D=x+_,R.rs-=1,R.row=C+1,R.rs<1&&(d.splice(A,1),A--)):M&&(R.rs-=1,R.row=C+1,R.rs<1&&(d.splice(A,1),A--)))}N>0&&f.push({rs:N,cs:k+1,index:D,row:-1}),D>=u&&D+k<=u+l?b.push(E):D<=u+l&&D+k>=u?E.colSpan-=i.getOverlapRangeAtIndex(a,a+l,D,D+k):N>0&&(D<u||D+k>u+l)&&w.push({cell:E,i:C,rs:C+N}),_+=k}else{if(x>=u)break;if(k>0){if(h<1&&k+x>=u){E.colSpan+=1,u=null,h=N+1;break}u-=k}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=w.length,p;c<u;c++)p=w[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 w=0,C=i._rowCnt,S,c;w<C;w++){S=o[w].cells,c=0;for(let u=0,p=S.length,v,y,_,x;u<p;u++){if(v=S[u],y=v.colSpan-1,_=v.rowSpan-1,x=u+c,b.length>0)for(let E=0,T;E<b.length;E++)T=b[E],!(T.row>w)&&(x>=T.index?(c+=T.cs,x+=T.cs,T.rs-=1,T.row=w+1,T.rs<1&&(b.splice(E,1),E--)):u===p-1&&(T.rs-=1,T.row=w+1,T.rs<1&&(b.splice(E,1),E--)));if(x<=a&&_>0&&h.push({index:x,cs:y+1,rs:_,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=[],w=t.getArrayIndex(o,l)+h;for(let u=0,p,v;u<w;u++){p=o[u].cells,v=0;for(let y=0,_=p.length,x,E,T;y<_&&(T=y+v,!(T>=a));y++)x=p[y],E=x.rowSpan-1,E>0&&E+u>=w&&T<a&&b.push({index:T,cs:x.colSpan}),v+=x.colSpan-1}const C=o[w],S=C.cells;let c=b.shift();for(let u=0,p=S.length,v=0,y,_,x,E;u<p;u++){if(x=u+v,y=S[u],_=y.colSpan-1,E=x+_+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+=_}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,w=l.cells;for(let C=0,S=w.length;C<S;C++)C!==b&&(w[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,w=s.length,C,S;b<w;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,w=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,_;p<v;p++)y=u[p],_=y.rowSpan-1,_>0&&c+_>=w&&(y.rowSpan-=n.getOverlapRangeAtIndex(w,C,c,c+_))}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,w;d<h;d++){b=i[d].cells,w=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+w,a.length>0)for(let y=0,_;y<a.length;y++)_=a[y],!(_.row>d)&&(u>=_.index?(w+=_.cs,u+=_.cs,_.rs-=1,_.row=d+1,_.rs<1&&(a.splice(y,1),y--)):C===S-1&&(_.rs-=1,_.row=d+1,_.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,_=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!==_||f.rs!==x||f.re!==E){f.cs=y,f.ce=_,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}),w+=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)}},Oh={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,w,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",w=/^h/.test(d)?d.match(/\d+/)[0]:"",b=n["tag_"+(w?"h":d)]+w,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 w=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(w,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 _=u,x,E,T,N,k,D,M=!0;_>=0;_--)if(x=c[_],x!==(c[_+1]?c[_+1].parentNode:null)){if(D=d.isComponent(x),E=D?"":x.innerHTML.replace(/(?!>)\s+(?=<)|\n/g," "),T=d.getParentElement(x,function(A){return A.parentNode===p}),(p!==x.parentNode||D)&&(d.isFormatElement(p)?(p.parentNode.insertBefore(v,p.nextSibling),p=p.parentNode):(p.insertBefore(v,T?T.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),k=v.innerHTML,v.innerHTML=(M||!E||!k||/<br>$/i.test(E)?E:E+"<BR>")+k,_===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))}D||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(w,h),r,d.getNodeFromPath(C,b),f)}this.history.push(!1)}this.submenuOff()}}},Ph={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)}},Ih={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()}},Bh={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 w=s[f.toLowerCase()];if(!w)continue;f=w}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)}},Fh={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,w,C;l<a;l++){if(r=s[l],h="",w="",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+'"',w+=r.style.replace(/:[^;]+(;|$)\s*/g,","),b.push("style")),r.class&&(h+=' class="'+r.class+'"',w+="."+r.class.trim().replace(/\s+/g,",."),b.push("class")),w=w.replace(/,$/,""),o+='<li><button type="button" class="se-btn-list'+(C?" "+C:"")+'" data-command="'+f+'" data-value="'+w+'" 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 jh={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:Be,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})})(jh);var IS=jh.exports;const $i=Jn(IS),BS={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)}},zh={name:"anchor",add:function(e){e.addModule([BS]),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)}},Hh={name:"link",display:"dialog",add:function(e){e.addModule([$i,zh]);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 Vh={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:Be,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})})(Vh);var FS=Vh.exports;const dl=Jn(FS);var Wh={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:Be,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,w=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=w+"px",f.style.top="0px",f.style.left="0px",f.style.width=b+"px",f.style.height=w+"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 _=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=_;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,R=M.length;A<R;A++)M[A].getAttribute("data-value")===c?this.util.addClass(M[A],"on"):this.util.removeClass(M[A],"on")}const E=l.percentageButtons,T=/%$/.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")===T?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 k=function(){this.util.setDisabledButtons.call(this.util,!1,this.resizingDisabledButtons),this.history._resetCachingButton()};this.controllersOn(r,l.resizeButton,k.bind(this),s,o),this.util.setDisabledButtons(!0,this.resizingDisabledButtons),l._resize_w=b,l._resize_h=w;const D=(s.getAttribute("origin-size")||"").split(",");return l._origin_w=D[0]||s.naturalWidth,l._origin_h=D[1]||s.naturalHeight,{w:b,h:w,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 _=d.getAttribute("data-percentage");_&&(b=_.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 w=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,w,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 _=this.util.getChildElement(f._caption,function(x){return x.nodeType===3});_?this.setRange(_,0,_,_.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,w=l||s.offsetHeight,C=(r?w:b)+"px",S=(r?b:w)+"px";if(this.plugins[this.context.resizing._resize_plugin].cancelPercentAttr.call(this),this.plugins[this.context.resizing._resize_plugin].setSize.call(this,b+"px",w+"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=w/2+"px "+w/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),w=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)?w: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=w+"px",h=w),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})})(Wh);var jS=Wh.exports;const $h=Jn(jS);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:Be,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,w=d.setInfo.bind(this);if(f.length===b.length)if(this._componentsInfoReset){for(let u=0,p=f.length;u<p;u++)w(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(_){return y.src===_.src&&y.index.toString()===_.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"),w(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 w=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}),!w||this._componentsInfoInit)S="create",w=h._infoIndex++,o.setAttribute("data-index",w),o.setAttribute("data-file-name",a.name),o.setAttribute("data-file-size",a.size),C={src:o.src,index:w*1,name:a.name,size:a.size},b.push(C);else{S="update",w*=1;for(let c=0,u=b.length;c<u;c++)if(w===b[c].index){C=b[c];break}C||(w=h._infoIndex++,C={index:w},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,w,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})})(Uh);var zS=Uh.exports;const fl=Jn(zS),Yh={name:"image",display:"dialog",add:function(e){e.addModule([$i,zh,dl,$h,fl]);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(w,C,S,c,u){f[u]={result:w.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 w=this.plugins.anchor.createAnchor.call(this,i.anchorCtx,!0);if(w)i._linkElement!==w||a&&!l.contains(w)?(i._linkElement=w.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?w: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(w,function(S){return/IMG/i.test(S.tagName)}).length===0&&this.util.removeItem(w)):this.util.removeItem(w)),(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)}},qh={name:"video",display:"dialog",add:function(e){e.addModule([$i,dl,$h,fl]);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,w=o.length;b<w;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 w=!1;b&&(w=this.plugins.video.applySize.call(this)),w&&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))}},Zh={name:"audio",display:"dialog",add:function(e){e.addModule([$i,dl,fl]);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}},Qa="https://katex.org/docs/supported.html",Gh={name:"math",display:"dialog",add:function(e){e.addModule([$i]);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="'+Qa+'" 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="'+Qa+'" 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 Kh={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:Be,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 w="",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,_;v<y;v++)_=p[v],_&&r.indexOf(_)===-1&&(r.push(_),w+='<a title="'+_+'" aria-label="'+_+'">'+_+"</a>");C+="</div>",l.list.innerHTML=C,o&&(l.items=s,l.tagArea.innerHTML=w,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(w){return d.indexOf(w)>-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})})(Kh);var HS=Kh.exports;const VS=Jn(HS),Xh={name:"imageGallery",add:function(e){e.addModule([VS]);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)}},WS={blockquote:Sh,align:Eh,font:Nh,fontSize:Th,fontColor:Mh,hiliteColor:Ah,horizontalRule:Dh,list:Rh,table:Lh,formatBlock:Oh,lineHeight:Ph,template:Ih,paragraphStyle:Bh,textStyle:Fh,link:Hh,image:Yh,video:qh,audio:Zh,math:Gh,imageGallery:Xh},$S=Object.freeze(Object.defineProperty({__proto__:null,align:Eh,audio:Zh,blockquote:Sh,default:WS,font:Nh,fontColor:Mh,fontSize:Th,formatBlock:Oh,hiliteColor:Ah,horizontalRule:Dh,image:Yh,imageGallery:Xh,lineHeight:Ph,link:Hh,list:Rh,math:Gh,paragraphStyle:Bh,table:Lh,template:Ih,textStyle:Fh,video:qh},Symbol.toStringTag,{value:"Module"})),US=mf($S),Ja={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 Qh={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:Be,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})})(Qh);var YS=Qh.exports;const qS=Jn(YS),me={_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 me.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 me.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(!me.isWysiwygDiv(o)){const l=o.parentNode;l&&t(o)&&(i={sc:o.previousElementSibling,ec:o.nextElementSibling},me.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 w=this.getPositionIndex(t);const C=e.cloneNode(!1),S=e.cloneNode(!1);for(let c=0,u=b.length;c<u;c++){if(c<w)C.appendChild(b[c]);else if(c>w)S.appendChild(b[c]);else continue;c--,u--,w--}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,me.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,w,C;h<b&&(w=d[h],C=d[h+1],!!w);h++)if(!(i.isBreak(w)||i.isMedia(w)||i.isInputElement(w))){if(n&&i._isIgnoreNodeChange(w)||!n&&(i.isTable(w)||i.isListCell(w)||i.isFormatElement(w)&&!i.isFreeFormatElement(w))){(i.isTable(w)||i.isListCell(w))&&l(w,r+1,h);continue}if(b===1&&a.nodeName===w.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=w,u=a,p=r,v=!0;p>=0;){if(i.getArrayIndex(u.childNodes,c)!==S[p]){v=!1;break}c=w.parentNode,u=c.parentNode,p--}v&&(S.splice(r,1),S[r]=h)}}i.copyTagAttributes(w,a),a.parentNode.insertBefore(w,a),i.removeItem(a)}if(!C){w.nodeType===1&&l(w,r+1,h);break}if(w.nodeName===C.nodeName&&i.isSameAttributes(w,C)&&w.href===C.href){const S=w.childNodes;let c=0;for(let y=0,_=S.length;y<_;y++)S[y].textContent.length>0&&c++;const u=w.lastChild,p=C.firstChild;let v=0;if(u&&p){const y=u.nodeType===3&&p.nodeType===3;v=u.textContent.length;let _=u.previousSibling;for(;_&&_.nodeType===3;)v+=_.textContent.length,_=_.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(w.nodeType===3){if(v=w.textContent.length,w.textContent+=C.textContent,s){let y=null;for(let _=0;_<s;_++)if(y=t[_],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[_]+=v)}}}else w.innerHTML+=C.innerHTML;i.removeItem(C),h--}else w.nodeType===1&&l(w,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,w,C;h<b;h++)if(w=f[h],C=w.parentNode,!(!C||!C.parentNode))if(this.getParentElement(w,this.isListCell)){const S=w.childNodes;for(let c=S.length-1;b>=0;c--)C.insertBefore(w,S[c]);d.push(w)}else C.parentNode.insertBefore(w,C),d.push(C);for(let h=0,b=d.length,w;h<b;h++)w=d[h],this.onlyZeroWidthSpace(w.textContent.trim())&&this.removeItem(w);for(let h=0,b=l.length;h<b;h++)this.removeItem(l[h]);for(let h=0,b=a.length,w,C,S,c;h<b;h++)if(w=a[h],c=w.parentNode,!!c)if(C=this.createElement("LI"),this.isFormatElement(w)){for(S=w.childNodes;S[0];)C.appendChild(S[0]);c.insertBefore(C,w),this.removeItem(w)}else w=w.nextSibling,C.appendChild(a[h]),c.insertBefore(C,w);for(let h=0,b=r.length,w,C;h<b;h++)w=r[h],C=this.createElement("DIV"),C.innerHTML=w.textContent.trim().length===0&&w.children.length===0?"<br>":w.innerHTML,w.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>
|
|
241
|
+
*/var Ba;function I_(){return Ba||(Ba=1,process.env.NODE_ENV!=="production"&&function(){function e(C,w){return C===w&&(C!==0||1/C===1/w)||C!==C&&w!==w}function t(C,w){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=w();if(!h){var c=w();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:w}});var u=c[0].inst,p=c[1];return r(function(){u.value=S,u.getSnapshot=w,n(u)&&p({inst:u})},[C,S,w]),a(function(){return n(u)&&p({inst:u}),C(function(){n(u)&&p({inst:u})})},[C]),f(S),S}function n(C){var w=C.getSnapshot;C=C.value;try{var S=w();return!o(C,S)}catch{return!0}}function i(C,w){return w()}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;Mr.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())}()),Mr}process.env.NODE_ENV==="production"?Qr.exports=P_():Qr.exports=I_();var B_=Qr.exports;function F_(){return B_.useSyncExternalStore(j_,()=>!0,()=>!1)}function j_(){return()=>{}}var Yo="Avatar",[z_]=L_(Yo),[H_,gf]=z_(Yo),vf=m.forwardRef((e,t)=>{const{__scopeAvatar:n,...i}=e,[s,o]=m.useState("idle");return g.jsx(H_,{scope:n,imageLoadingStatus:s,onImageLoadingStatusChange:o,children:g.jsx(Mi.span,{...i,ref:t})})});vf.displayName=Yo;var bf="AvatarImage",yf=m.forwardRef((e,t)=>{const{__scopeAvatar:n,src:i,onLoadingStatusChange:s=()=>{},...o}=e,l=gf(bf,n),a=V_(i,o),r=Ze(f=>{s(f),l.onImageLoadingStatusChange(f)});return Ye(()=>{a!=="idle"&&r(a)},[a,r]),a==="loaded"?g.jsx(Mi.img,{...o,ref:t,src:i}):null});yf.displayName=bf;var xf="AvatarFallback",_f=m.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:i,...s}=e,o=gf(xf,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(Mi.span,{...s,ref:t}):null});_f.displayName=xf;function Fa(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function V_(e,{referrerPolicy:t,crossOrigin:n}){const i=F_(),s=m.useRef(null),o=i?(s.current||(s.current=new window.Image),s.current):null,[l,a]=m.useState(()=>Fa(o,e));return Ye(()=>{a(Fa(o,e))},[o,e]),Ye(()=>{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 wf=vf,Cf=yf,Sf=_f;const qo=m.forwardRef(({className:e,...t},n)=>g.jsx(wf,{ref:n,className:J("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));qo.displayName=wf.displayName;const Zo=m.forwardRef(({className:e,...t},n)=>g.jsx(Cf,{ref:n,className:J("aspect-square h-full w-full",e),...t}));Zo.displayName=Cf.displayName;const Go=m.forwardRef(({className:e,...t},n)=>g.jsx(Sf,{ref:n,className:J("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));Go.displayName=Sf.displayName;function W_(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,...w}=h,S=((u=b==null?void 0:b[e])==null?void 0:u[r])||a,c=m.useMemo(()=>w,Object.values(w));return g.jsx(S.Provider,{value:c,children:C})};f.displayName=o+"Provider";function d(h,b){var S;const C=((S=b==null?void 0:b[e])==null?void 0:S[r])||a,w=m.useContext(C);if(w)return w;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,$_(s,...t)]}function $_(...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 U_(e){const t=Y_(e),n=m.forwardRef((i,s)=>{const{children:o,...l}=i,a=m.Children.toArray(o),r=a.find(Z_);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 Y_(e){const t=m.forwardRef((n,i)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const l=K_(s),a=G_(o,s.props);return s.type!==m.Fragment&&(a.ref=i?ze(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 Ef=Symbol("radix.slottable");function q_(e){const t=({children:n})=>g.jsx(g.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=Ef,t}function Z_(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ef}function G_(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 K_(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 X_=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Q_=X_.reduce((e,t)=>{const n=U_(`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]=W_("Tooltip",[nn]),Qs=nn(),Nf="TooltipProvider",J_=700,Jr="tooltip.open",[ew,Ko]=Xs(Nf),Tf=e=>{const{__scopeTooltip:t,delayDuration:n=J_,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(ew,{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})};Tf.displayName=Nf;var yi="Tooltip",[tw,Js]=Xs(yi),kf=e=>{const{__scopeTooltip:t,children:n,open:i,defaultOpen:s,onOpenChange:o,disableHoverableContent:l,delayDuration:a}=e,r=Ko(yi,e.__scopeTooltip),f=Qs(t),[d,h]=m.useState(null),b=st(),C=m.useRef(0),w=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(Jr))):r.onClose(),o==null||o(E)},caller:yi}),v=m.useMemo(()=>u?c.current?"delayed-open":"instant-open":"closed",[u]),y=m.useCallback(()=>{window.clearTimeout(C.current),C.current=0,c.current=!1,p(!0)},[p]),_=m.useCallback(()=>{window.clearTimeout(C.current),C.current=0,p(!1)},[p]),x=m.useCallback(()=>{window.clearTimeout(C.current),C.current=window.setTimeout(()=>{c.current=!0,p(!0),C.current=0},S)},[S,p]);return m.useEffect(()=>()=>{C.current&&(window.clearTimeout(C.current),C.current=0)},[]),g.jsx(Oi,{...f,children:g.jsx(tw,{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(()=>{w?_():(window.clearTimeout(C.current),C.current=0)},[_,w]),onOpen:y,onClose:_,disableHoverableContent:w,children:n})})};kf.displayName=yi;var eo="TooltipTrigger",Mf=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...i}=e,s=Js(eo,n),o=Ko(eo,n),l=Qs(n),a=m.useRef(null),r=ve(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(Pi,{asChild:!0,...l,children:g.jsx(Q_.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)})})});Mf.displayName=eo;var nw="TooltipPortal",[u5,iw]=Xs(nw,{forceMount:void 0}),Vn="TooltipContent",Af=m.forwardRef((e,t)=>{const n=iw(Vn,e.__scopeTooltip),{forceMount:i=n.forceMount,side:s="top",...o}=e,l=Js(Vn,e.__scopeTooltip);return g.jsx(Ke,{present:i||l.open,children:l.disableHoverableContent?g.jsx(Df,{side:s,...o,ref:t}):g.jsx(sw,{side:s,...o,ref:t})})}),sw=m.forwardRef((e,t)=>{const n=Js(Vn,e.__scopeTooltip),i=Ko(Vn,e.__scopeTooltip),s=m.useRef(null),o=ve(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]),C=m.useCallback((w,S)=>{const c=w.currentTarget,u={x:w.clientX,y:w.clientY},p=cw(u,c.getBoundingClientRect()),v=uw(u,p),y=dw(S.getBoundingClientRect()),_=hw([...v,...y]);a(_),h(!0)},[h]);return m.useEffect(()=>()=>b(),[b]),m.useEffect(()=>{if(r&&d){const w=c=>C(c,d),S=c=>C(c,r);return r.addEventListener("pointerleave",w),d.addEventListener("pointerleave",S),()=>{r.removeEventListener("pointerleave",w),d.removeEventListener("pointerleave",S)}}},[r,d,C,b]),m.useEffect(()=>{if(l){const w=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=!fw(u,l);p?b():v&&(b(),f())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[r,d,l,f,b]),g.jsx(Df,{...e,ref:o})}),[rw,ow]=Xs(yi,{isInside:!1}),lw=q_("TooltipContent"),Df=m.forwardRef((e,t)=>{const{__scopeTooltip:n,children:i,"aria-label":s,onEscapeKeyDown:o,onPointerDownOutside:l,...a}=e,r=Js(Vn,n),f=Qs(n),{onClose:d}=r;return m.useEffect(()=>(document.addEventListener(Jr,d),()=>document.removeEventListener(Jr,d)),[d]),m.useEffect(()=>{if(r.trigger){const h=b=>{const C=b.target;C!=null&&C.contains(r.trigger)&&d()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[r.trigger,d]),g.jsx(Gn,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:h=>h.preventDefault(),onDismiss:d,children:g.jsxs(Ps,{"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(lw,{children:i}),g.jsx(rw,{scope:n,isInside:!0,children:g.jsx(yy,{id:r.contentId,role:"tooltip",children:s||i})})]})})});Af.displayName=Vn;var Rf="TooltipArrow",aw=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...i}=e,s=Qs(n);return ow(Rf,n).isInside?null:g.jsx(Is,{...s,...i,ref:t})});aw.displayName=Rf;function cw(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 uw(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 dw(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 fw(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 hw(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),pw(t)}function pw(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 mw=Tf,gw=kf,vw=Mf,Lf=Af;const bw=mw,yw=gw,xw=vw,Of=m.forwardRef(({className:e,sideOffset:t=4,...n},i)=>g.jsx(Lf,{ref:i,sideOffset:t,className:J("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}));Of.displayName=Lf.displayName;function _w(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,...w}=h,S=((u=b==null?void 0:b[e])==null?void 0:u[r])||a,c=m.useMemo(()=>w,Object.values(w));return g.jsx(S.Provider,{value:c,children:C})};f.displayName=o+"Provider";function d(h,b){var S;const C=((S=b==null?void 0:b[e])==null?void 0:S[r])||a,w=m.useContext(C);if(w)return w;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,ww(s,...t)]}function ww(...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 Pf(e){const t=Cw(e),n=m.forwardRef((i,s)=>{const{children:o,...l}=i,a=m.Children.toArray(o),r=a.find(Ew);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 Cw(e){const t=m.forwardRef((n,i)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const l=Tw(s),a=Nw(o,s.props);return s.type!==m.Fragment&&(a.ref=i?ze(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 Sw=Symbol("radix.slottable");function Ew(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Sw}function Nw(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 Tw(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 kw=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],If=kw.reduce((e,t)=>{const n=Pf(`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}},{}),er="Popover",[Bf]=_w(er,[nn]),zi=nn(),[Mw,on]=Bf(er),Ff=e=>{const{__scopePopover:t,children:n,open:i,defaultOpen:s,onOpenChange:o,modal:l=!1}=e,a=zi(t),r=m.useRef(null),[f,d]=m.useState(!1),[h,b]=wt({prop:i,defaultProp:s??!1,onChange:o,caller:er});return g.jsx(Oi,{...a,children:g.jsx(Mw,{scope:t,contentId:st(),triggerRef:r,open:h,onOpenChange:b,onOpenToggle:m.useCallback(()=>b(C=>!C),[b]),hasCustomAnchor:f,onCustomAnchorAdd:m.useCallback(()=>d(!0),[]),onCustomAnchorRemove:m.useCallback(()=>d(!1),[]),modal:l,children:n})})};Ff.displayName=er;var jf="PopoverAnchor",Aw=m.forwardRef((e,t)=>{const{__scopePopover:n,...i}=e,s=on(jf,n),o=zi(n),{onCustomAnchorAdd:l,onCustomAnchorRemove:a}=s;return m.useEffect(()=>(l(),()=>a()),[l,a]),g.jsx(Pi,{...o,...i,ref:t})});Aw.displayName=jf;var zf="PopoverTrigger",Hf=m.forwardRef((e,t)=>{const{__scopePopover:n,...i}=e,s=on(zf,n),o=zi(n),l=ve(t,s.triggerRef),a=g.jsx(If.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Yf(s.open),...i,ref:l,onClick:oe(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?a:g.jsx(Pi,{asChild:!0,...o,children:a})});Hf.displayName=zf;var Xo="PopoverPortal",[Dw,Rw]=Bf(Xo,{forceMount:void 0}),Vf=e=>{const{__scopePopover:t,forceMount:n,children:i,container:s}=e,o=on(Xo,t);return g.jsx(Dw,{scope:t,forceMount:n,children:g.jsx(Ke,{present:n||o.open,children:g.jsx(Ii,{asChild:!0,container:s,children:i})})})};Vf.displayName=Xo;var Wn="PopoverContent",Wf=m.forwardRef((e,t)=>{const n=Rw(Wn,e.__scopePopover),{forceMount:i=n.forceMount,...s}=e,o=on(Wn,e.__scopePopover);return g.jsx(Ke,{present:i||o.open,children:o.modal?g.jsx(Ow,{...s,ref:t}):g.jsx(Pw,{...s,ref:t})})});Wf.displayName=Wn;var Lw=Pf("PopoverContent.RemoveScroll"),Ow=m.forwardRef((e,t)=>{const n=on(Wn,e.__scopePopover),i=m.useRef(null),s=ve(t,i),o=m.useRef(!1);return m.useEffect(()=>{const l=i.current;if(l)return Bs(l)},[]),g.jsx(Bi,{as:Lw,allowPinchZoom:!0,children:g.jsx($f,{...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})})})}),Pw=m.forwardRef((e,t)=>{const n=on(Wn,e.__scopePopover),i=m.useRef(!1),s=m.useRef(!1);return g.jsx($f,{...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()}})}),$f=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=on(Wn,n),C=zi(n);return As(),g.jsx(Ri,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:s,onUnmountAutoFocus:o,children:g.jsx(Gn,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:d,onEscapeKeyDown:a,onPointerDownOutside:r,onFocusOutside:f,onDismiss:()=>b.onOpenChange(!1),children:g.jsx(Ps,{"data-state":Yf(b.open),role:"dialog",id:b.contentId,...C,...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)"}})})})}),Uf="PopoverClose",Iw=m.forwardRef((e,t)=>{const{__scopePopover:n,...i}=e,s=on(Uf,n);return g.jsx(If.button,{type:"button",...i,ref:t,onClick:oe(e.onClick,()=>s.onOpenChange(!1))})});Iw.displayName=Uf;var Bw="PopoverArrow",Fw=m.forwardRef((e,t)=>{const{__scopePopover:n,...i}=e,s=zi(n);return g.jsx(Is,{...s,...i,ref:t})});Fw.displayName=Bw;function Yf(e){return e?"open":"closed"}var jw=Ff,zw=Hf,Hw=Vf,qf=Wf;const Qo=jw,Jo=zw,tr=m.forwardRef(({className:e,align:t="center",sideOffset:n=4,...i},s)=>g.jsx(Hw,{children:g.jsx(qf,{ref:s,align:t,sideOffset:n,className:J("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})}));tr.displayName=qf.displayName;function Vw(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 Ar={},ui={};function dn(e,t){try{const i=(Ar[e]||(Ar[e]=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format))(t).split("GMT")[1];return i in ui?ui[i]:ja(i,i.split(":"))}catch{if(e in ui)return ui[e];const n=e==null?void 0:e.match(Ww);return n?ja(e,n.slice(1)):NaN}}const Ww=/([+-]\d\d):?(\d\d)?/;function ja(e,t){const n=+(t[0]||0),i=+(t[1]||0),s=+(t[2]||0)/60;return ui[e]=n*60+i>0?n*60+i+s:n*60-i-s}class At extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(dn(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)),Zf(this),to(this)):this.setTime(Date.now())}static tz(t,...n){return n.length?new At(...n,t):new At(Date.now(),t)}withTimeZone(t){return new At(+this,t)}getTimezoneOffset(){const t=-dn(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),to(this),+this}[Symbol.for("constructDateFrom")](t){return new At(+new Date(t),this.timeZone)}}const za=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!za.test(e))return;const t=e.replace(za,"$1UTC");At.prototype[t]&&(e.startsWith("get")?At.prototype[e]=function(){return this.internal[t]()}:(At.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),$w(this),+this},At.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),to(this),+this}))});function to(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-dn(e.timeZone,e)*60))}function $w(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()),Zf(e)}function Zf(e){const t=dn(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(-(dn(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=dn(e.timeZone,e),C=b>0?Math.floor(b):Math.ceil(b),S=-new Date(+e).getTimezoneOffset()-C,c=C!==n,u=S-r;if(c&&u){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+u);const p=dn(e.timeZone,e),v=p>0?Math.floor(p):Math.ceil(p),y=C-v;y&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+y),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+y))}}class Qe extends At{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} (${Vw(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 Gf=6048e5,Uw=864e5,Ha=Symbol.for("constructDateFrom");function qe(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Ha in e?e[Ha](t):e instanceof Date?new e.constructor(t):new Date(t)}function Le(e,t){return qe(t||e,e)}function Kf(e,t,n){const i=Le(e,n==null?void 0:n.in);return isNaN(t)?qe(e,NaN):(t&&i.setDate(i.getDate()+t),i)}function Xf(e,t,n){const i=Le(e,n==null?void 0:n.in);if(isNaN(t))return qe(e,NaN);if(!t)return i;const s=i.getDate(),o=qe(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 Yw={};function Hi(){return Yw}function $n(e,t){var a,r,f,d;const n=Hi(),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 xi(e,t){return $n(e,{...t,weekStartsOn:1})}function Qf(e,t){const n=Le(e,t==null?void 0:t.in),i=n.getFullYear(),s=qe(n,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const o=xi(s),l=qe(n,0);l.setFullYear(i,0,4),l.setHours(0,0,0,0);const a=xi(l);return n.getTime()>=o.getTime()?i+1:n.getTime()>=a.getTime()?i:i-1}function Va(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 ei(e,...t){const n=qe.bind(null,t.find(i=>typeof i=="object"));return t.map(n)}function _i(e,t){const n=Le(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function el(e,t,n){const[i,s]=ei(n==null?void 0:n.in,e,t),o=_i(i),l=_i(s),a=+o-Va(o),r=+l-Va(l);return Math.round((a-r)/Uw)}function qw(e,t){const n=Qf(e,t),i=qe(e,0);return i.setFullYear(n,0,4),i.setHours(0,0,0,0),xi(i)}function Zw(e,t,n){return Kf(e,t*7,n)}function Gw(e,t,n){return Xf(e,t*12,n)}function Kw(e,t){let n,i=t==null?void 0:t.in;return e.forEach(s=>{!i&&typeof s=="object"&&(i=qe.bind(null,s));const o=Le(s,i);(!n||n<o||isNaN(+o))&&(n=o)}),qe(i,n||NaN)}function Xw(e,t){let n,i=t==null?void 0:t.in;return e.forEach(s=>{!i&&typeof s=="object"&&(i=qe.bind(null,s));const o=Le(s,i);(!n||n>o||isNaN(+o))&&(n=o)}),qe(i,n||NaN)}function Qw(e,t,n){const[i,s]=ei(n==null?void 0:n.in,e,t);return+_i(i)==+_i(s)}function Jf(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Jw(e){return!(!Jf(e)&&typeof e!="number"||isNaN(+Le(e)))}function eh(e,t,n){const[i,s]=ei(n==null?void 0:n.in,e,t),o=i.getFullYear()-s.getFullYear(),l=i.getMonth()-s.getMonth();return o*12+l}function e2(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 th(e,t){const[n,i]=ei(e,t.start,t.end);return{start:n,end:i}}function t2(e,t){const{start:n,end:i}=th(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(qe(n,l)),l.setMonth(l.getMonth()+a);return s?r.reverse():r}function n2(e,t){const n=Le(e,t==null?void 0:t.in);return n.setDate(1),n.setHours(0,0,0,0),n}function i2(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 nh(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 s2(e,t){const{start:n,end:i}=th(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(qe(n,l)),l.setFullYear(l.getFullYear()+a);return s?r.reverse():r}function ih(e,t){var a,r,f,d;const n=Hi(),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 r2(e,t){return ih(e,{...t,weekStartsOn:1})}const o2={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"}},l2=(e,t,n)=>{let i;const s=o2[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 Dr(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const a2={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},c2={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},u2={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},d2={date:Dr({formats:a2,defaultWidth:"full"}),time:Dr({formats:c2,defaultWidth:"full"}),dateTime:Dr({formats:u2,defaultWidth:"full"})},f2={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},h2=(e,t,n,i)=>f2[e];function ri(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 p2={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},m2={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},g2={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"]},v2={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"]},b2={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"}},y2={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"}},x2=(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"},_2={ordinalNumber:x2,era:ri({values:p2,defaultWidth:"wide"}),quarter:ri({values:m2,defaultWidth:"wide",argumentCallback:e=>e-1}),month:ri({values:g2,defaultWidth:"wide"}),day:ri({values:v2,defaultWidth:"wide"}),dayPeriod:ri({values:b2,defaultWidth:"wide",formattingValues:y2,defaultFormattingWidth:"wide"})};function oi(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)?C2(a,h=>h.test(l)):w2(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 w2(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function C2(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function S2(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 E2=/^(\d+)(th|st|nd|rd)?/i,N2=/\d+/i,T2={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},k2={any:[/^b/i,/^(a|c)/i]},M2={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},A2={any:[/1/i,/2/i,/3/i,/4/i]},D2={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},R2={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]},L2={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},O2={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]},P2={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},I2={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}},B2={ordinalNumber:S2({matchPattern:E2,parsePattern:N2,valueCallback:e=>parseInt(e,10)}),era:oi({matchPatterns:T2,defaultMatchWidth:"wide",parsePatterns:k2,defaultParseWidth:"any"}),quarter:oi({matchPatterns:M2,defaultMatchWidth:"wide",parsePatterns:A2,defaultParseWidth:"any",valueCallback:e=>e+1}),month:oi({matchPatterns:D2,defaultMatchWidth:"wide",parsePatterns:R2,defaultParseWidth:"any"}),day:oi({matchPatterns:L2,defaultMatchWidth:"wide",parsePatterns:O2,defaultParseWidth:"any"}),dayPeriod:oi({matchPatterns:P2,defaultMatchWidth:"any",parsePatterns:I2,defaultParseWidth:"any"})},kn={code:"en-US",formatDistance:l2,formatLong:d2,formatRelative:h2,localize:_2,match:B2,options:{weekStartsOn:0,firstWeekContainsDate:1}};function F2(e,t){const n=Le(e,t==null?void 0:t.in);return el(n,nh(n))+1}function tl(e,t){const n=Le(e,t==null?void 0:t.in),i=+xi(n)-+qw(n);return Math.round(i/Gf)+1}function sh(e,t){var d,h,b,C;const n=Le(e,t==null?void 0:t.in),i=n.getFullYear(),s=Hi(),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??((C=(b=s.locale)==null?void 0:b.options)==null?void 0:C.firstWeekContainsDate)??1,l=qe((t==null?void 0:t.in)||e,0);l.setFullYear(i+1,0,o),l.setHours(0,0,0,0);const a=$n(l,t),r=qe((t==null?void 0:t.in)||e,0);r.setFullYear(i,0,o),r.setHours(0,0,0,0);const f=$n(r,t);return+n>=+a?i+1:+n>=+f?i:i-1}function j2(e,t){var a,r,f,d;const n=Hi(),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=sh(e,t),o=qe((t==null?void 0:t.in)||e,0);return o.setFullYear(s,0,i),o.setHours(0,0,0,0),$n(o,t)}function nl(e,t){const n=Le(e,t==null?void 0:t.in),i=+$n(n,t)-+j2(n,t);return Math.round(i/Gf)+1}function Re(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 Re(t==="yy"?i%100:i,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Re(n+1,2)},d(e,t){return Re(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 Re(e.getHours()%12||12,t.length)},H(e,t){return Re(e.getHours(),t.length)},m(e,t){return Re(e.getMinutes(),t.length)},s(e,t){return Re(e.getSeconds(),t.length)},S(e,t){const n=t.length,i=e.getMilliseconds(),s=Math.trunc(i*Math.pow(10,n-3));return Re(s,t.length)}},En={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Wa={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=sh(e,i),o=s>0?s:1-s;if(t==="YY"){const l=o%100;return Re(l,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):Re(o,t.length)},R:function(e,t){const n=Qf(e);return Re(n,t.length)},u:function(e,t){const n=e.getFullYear();return Re(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 Re(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 Re(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 Re(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=nl(e,i);return t==="wo"?n.ordinalNumber(s,{unit:"week"}):Re(s,t.length)},I:function(e,t,n){const i=tl(e);return t==="Io"?n.ordinalNumber(i,{unit:"week"}):Re(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=F2(e);return t==="Do"?n.ordinalNumber(i,{unit:"dayOfYear"}):Re(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 Re(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 Re(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 Re(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=En.noon:i===0?s=En.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=En.evening:i>=12?s=En.afternoon:i>=4?s=En.morning:s=En.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"}):Re(i,t.length)},k:function(e,t,n){let i=e.getHours();return i===0&&(i=24),t==="ko"?n.ordinalNumber(i,{unit:"hour"}):Re(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 Ua(i);case"XXXX":case"XX":return cn(i);case"XXXXX":case"XXX":default:return cn(i,":")}},x:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"x":return Ua(i);case"xxxx":case"xx":return cn(i);case"xxxxx":case"xxx":default:return cn(i,":")}},O:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+$a(i,":");case"OOOO":default:return"GMT"+cn(i,":")}},z:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+$a(i,":");case"zzzz":default:return"GMT"+cn(i,":")}},t:function(e,t,n){const i=Math.trunc(+e/1e3);return Re(i,t.length)},T:function(e,t,n){return Re(+e,t.length)}};function $a(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+Re(o,2)}function Ua(e,t){return e%60===0?(e>0?"-":"+")+Re(Math.abs(e)/60,2):cn(e,t)}function cn(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),s=Re(Math.trunc(i/60),2),o=Re(i%60,2);return n+s+t+o}const Ya=(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"})}},rh=(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"})}},z2=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],i=n[1],s=n[2];if(!s)return Ya(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}}",Ya(i,t)).replace("{{time}}",rh(s,t))},H2={p:rh,P:z2},V2=/^D+$/,W2=/^Y+$/,$2=["D","DD","YY","YYYY"];function U2(e){return V2.test(e)}function Y2(e){return W2.test(e)}function q2(e,t,n){const i=Z2(e,t,n);if(console.warn(i),$2.includes(e))throw new RangeError(i)}function Z2(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 G2=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,K2=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,X2=/^'([^]*?)'?$/,Q2=/''/g,J2=/[a-zA-Z]/;function jt(e,t,n){var d,h,b,C,w,S,c,u;const i=Hi(),s=(n==null?void 0:n.locale)??i.locale??kn,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??((C=(b=i.locale)==null?void 0:b.options)==null?void 0:C.firstWeekContainsDate)??1,l=(n==null?void 0:n.weekStartsOn)??((S=(w=n==null?void 0:n.locale)==null?void 0:w.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(!Jw(a))throw new RangeError("Invalid time value");let r=t.match(K2).map(p=>{const v=p[0];if(v==="p"||v==="P"){const y=H2[v];return y(p,s.formatLong)}return p}).join("").match(G2).map(p=>{if(p==="''")return{isToken:!1,value:"'"};const v=p[0];if(v==="'")return{isToken:!1,value:eC(p)};if(Wa[v])return{isToken:!0,value:p};if(v.match(J2))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)&&Y2(v)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&U2(v))&&q2(v,t,String(e));const y=Wa[v[0]];return y(a,v,s.localize,f)}).join("")}function eC(e){const t=e.match(X2);return t?t[1].replace(Q2,"'"):e}function tC(e,t){const n=Le(e,t==null?void 0:t.in),i=n.getFullYear(),s=n.getMonth(),o=qe(n,0);return o.setFullYear(i,s+1,0),o.setHours(0,0,0,0),o.getDate()}function nC(e,t){return Le(e,t==null?void 0:t.in).getMonth()}function iC(e,t){return Le(e,t==null?void 0:t.in).getFullYear()}function sC(e,t){return+Le(e)>+Le(t)}function rC(e,t){return+Le(e)<+Le(t)}function oC(e,t,n){const[i,s]=ei(n==null?void 0:n.in,e,t);return i.getFullYear()===s.getFullYear()&&i.getMonth()===s.getMonth()}function lC(e,t,n){const[i,s]=ei(n==null?void 0:n.in,e,t);return i.getFullYear()===s.getFullYear()}function aC(e,t,n){const i=Le(e,n==null?void 0:n.in),s=i.getFullYear(),o=i.getDate(),l=qe(e,0);l.setFullYear(s,t,15),l.setHours(0,0,0,0);const a=tC(l);return i.setMonth(t,Math.min(o,a)),i}function cC(e,t,n){const i=Le(e,n==null?void 0:n.in);return isNaN(+i)?qe(e,NaN):(i.setFullYear(t),i)}const qa=5,uC=4;function dC(e,t){const n=t.startOfMonth(e),i=n.getDay()>0?n.getDay():7,s=t.addDays(e,-i+1),o=t.addDays(s,qa*7-1);return t.getMonth(e)===t.getMonth(o)?qa:uC}function oh(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 fC(e,t){const n=oh(e,t),i=dC(e,t);return t.addDays(n,i*7-1)}const lh={...kn,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:kn,...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:kn,...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:kn,...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:kn,...t}),i(e,"cccc")}}};class ct{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):Kf(i,s)},this.addMonths=(i,s)=>{var o;return(o=this.overrides)!=null&&o.addMonths?this.overrides.addMonths(i,s):Xf(i,s)},this.addWeeks=(i,s)=>{var o;return(o=this.overrides)!=null&&o.addWeeks?this.overrides.addWeeks(i,s):Zw(i,s)},this.addYears=(i,s)=>{var o;return(o=this.overrides)!=null&&o.addYears?this.overrides.addYears(i,s):Gw(i,s)},this.differenceInCalendarDays=(i,s)=>{var o;return(o=this.overrides)!=null&&o.differenceInCalendarDays?this.overrides.differenceInCalendarDays(i,s):el(i,s)},this.differenceInCalendarMonths=(i,s)=>{var o;return(o=this.overrides)!=null&&o.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(i,s):eh(i,s)},this.eachMonthOfInterval=i=>{var s;return(s=this.overrides)!=null&&s.eachMonthOfInterval?this.overrides.eachMonthOfInterval(i):t2(i)},this.eachYearOfInterval=i=>{var a;const s=(a=this.overrides)!=null&&a.eachYearOfInterval?this.overrides.eachYearOfInterval(i):s2(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):fC(i,this)},this.endOfISOWeek=i=>{var s;return(s=this.overrides)!=null&&s.endOfISOWeek?this.overrides.endOfISOWeek(i):r2(i)},this.endOfMonth=i=>{var s;return(s=this.overrides)!=null&&s.endOfMonth?this.overrides.endOfMonth(i):e2(i)},this.endOfWeek=(i,s)=>{var o;return(o=this.overrides)!=null&&o.endOfWeek?this.overrides.endOfWeek(i,s):ih(i,this.options)},this.endOfYear=i=>{var s;return(s=this.overrides)!=null&&s.endOfYear?this.overrides.endOfYear(i):i2(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):tl(i)},this.getMonth=(i,s)=>{var o;return(o=this.overrides)!=null&&o.getMonth?this.overrides.getMonth(i,this.options):nC(i,this.options)},this.getYear=(i,s)=>{var o;return(o=this.overrides)!=null&&o.getYear?this.overrides.getYear(i,this.options):iC(i,this.options)},this.getWeek=(i,s)=>{var o;return(o=this.overrides)!=null&&o.getWeek?this.overrides.getWeek(i,this.options):nl(i,this.options)},this.isAfter=(i,s)=>{var o;return(o=this.overrides)!=null&&o.isAfter?this.overrides.isAfter(i,s):sC(i,s)},this.isBefore=(i,s)=>{var o;return(o=this.overrides)!=null&&o.isBefore?this.overrides.isBefore(i,s):rC(i,s)},this.isDate=i=>{var s;return(s=this.overrides)!=null&&s.isDate?this.overrides.isDate(i):Jf(i)},this.isSameDay=(i,s)=>{var o;return(o=this.overrides)!=null&&o.isSameDay?this.overrides.isSameDay(i,s):Qw(i,s)},this.isSameMonth=(i,s)=>{var o;return(o=this.overrides)!=null&&o.isSameMonth?this.overrides.isSameMonth(i,s):oC(i,s)},this.isSameYear=(i,s)=>{var o;return(o=this.overrides)!=null&&o.isSameYear?this.overrides.isSameYear(i,s):lC(i,s)},this.max=i=>{var s;return(s=this.overrides)!=null&&s.max?this.overrides.max(i):Kw(i)},this.min=i=>{var s;return(s=this.overrides)!=null&&s.min?this.overrides.min(i):Xw(i)},this.setMonth=(i,s)=>{var o;return(o=this.overrides)!=null&&o.setMonth?this.overrides.setMonth(i,s):aC(i,s)},this.setYear=(i,s)=>{var o;return(o=this.overrides)!=null&&o.setYear?this.overrides.setYear(i,s):cC(i,s)},this.startOfBroadcastWeek=(i,s)=>{var o;return(o=this.overrides)!=null&&o.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(i,this):oh(i,this)},this.startOfDay=i=>{var s;return(s=this.overrides)!=null&&s.startOfDay?this.overrides.startOfDay(i):_i(i)},this.startOfISOWeek=i=>{var s;return(s=this.overrides)!=null&&s.startOfISOWeek?this.overrides.startOfISOWeek(i):xi(i)},this.startOfMonth=i=>{var s;return(s=this.overrides)!=null&&s.startOfMonth?this.overrides.startOfMonth(i):n2(i)},this.startOfWeek=(i,s)=>{var o;return(o=this.overrides)!=null&&o.startOfWeek?this.overrides.startOfWeek(i,this.options):$n(i,this.options)},this.startOfYear=i=>{var s;return(s=this.overrides)!=null&&s.startOfYear?this.overrides.startOfYear(i):nh(i)},this.options={locale:lh,...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&&ct.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&&ct.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)}}ct.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 Ot=new ct;class ah{constructor(t,n,i=Ot){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 hC{constructor(t,n){this.date=t,this.weeks=n}}class pC{constructor(t,n){this.days=n,this.weekNumber=t}}function mC(e){return K.createElement("button",{...e})}function gC(e){return K.createElement("span",{...e})}function vC(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 bC(e){const{day:t,modifiers:n,...i}=e;return K.createElement("td",{...i})}function yC(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 fe;(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"})(fe||(fe={}));var je;(function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"})(je||(je={}));var _t;(function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"})(_t||(_t={}));var rt;(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"})(rt||(rt={}));function xC(e){const{options:t,className:n,components:i,classNames:s,...o}=e,l=[s[fe.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[fe.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[fe.CaptionLabel],"aria-hidden":!0},a==null?void 0:a.label,K.createElement(i.Chevron,{orientation:"down",size:18,className:s[fe.Chevron]})))}function _C(e){return K.createElement("div",{...e})}function wC(e){return K.createElement("div",{...e})}function CC(e){const{calendarMonth:t,displayIndex:n,...i}=e;return K.createElement("div",{...i},e.children)}function SC(e){const{calendarMonth:t,displayIndex:n,...i}=e;return K.createElement("div",{...i})}function EC(e){return K.createElement("table",{...e})}function NC(e){return K.createElement("div",{...e})}const ch=K.createContext(void 0);function Vi(){const e=K.useContext(ch);if(e===void 0)throw new Error("useDayPicker() must be used within a custom component.");return e}function TC(e){const{components:t}=Vi();return K.createElement(t.Dropdown,{...e})}function kC(e){const{onPreviousClick:t,onNextClick:n,previousMonth:i,nextMonth:s,...o}=e,{components:l,classNames:a,labels:{labelPrevious:r,labelNext:f}}=Vi(),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[fe.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[fe.Chevron],orientation:"left"})),K.createElement(l.NextMonthButton,{type:"button",className:a[fe.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[fe.Chevron]})))}function MC(e){const{components:t}=Vi();return K.createElement(t.Button,{...e})}function AC(e){return K.createElement("option",{...e})}function DC(e){const{components:t}=Vi();return K.createElement(t.Button,{...e})}function RC(e){const{rootRef:t,...n}=e;return K.createElement("div",{...n,ref:t})}function LC(e){return K.createElement("select",{...e})}function OC(e){const{week:t,...n}=e;return K.createElement("tr",{...n})}function PC(e){return K.createElement("th",{...e})}function IC(e){return K.createElement("thead",{"aria-hidden":!0},K.createElement("tr",{...e}))}function BC(e){const{week:t,...n}=e;return K.createElement("th",{...n})}function FC(e){return K.createElement("th",{...e})}function jC(e){return K.createElement("tbody",{...e})}function zC(e){const{components:t}=Vi();return K.createElement(t.Dropdown,{...e})}const HC=Object.freeze(Object.defineProperty({__proto__:null,Button:mC,CaptionLabel:gC,Chevron:vC,Day:bC,DayButton:yC,Dropdown:xC,DropdownNav:_C,Footer:wC,Month:CC,MonthCaption:SC,MonthGrid:EC,Months:NC,MonthsDropdown:TC,Nav:kC,NextMonthButton:MC,Option:AC,PreviousMonthButton:DC,Root:RC,Select:LC,Week:OC,WeekNumber:BC,WeekNumberHeader:FC,Weekday:PC,Weekdays:IC,Weeks:jC,YearsDropdown:zC},Symbol.toStringTag,{value:"Module"}));function zt(e,t,n=!1,i=Ot){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 il(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function nr(e){return!!(e&&typeof e=="object"&&"from"in e)}function sl(e){return!!(e&&typeof e=="object"&&"after"in e)}function rl(e){return!!(e&&typeof e=="object"&&"before"in e)}function uh(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function dh(e,t){return Array.isArray(e)&&e.every(t.isDate)}function Ht(e,t,n=Ot){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(dh(a,n))return a.some(r=>s(e,r));if(nr(a))return zt(a,e,!1,n);if(uh(a))return Array.isArray(a.dayOfWeek)?a.dayOfWeek.includes(e.getDay()):a.dayOfWeek===e.getDay();if(il(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 sl(a)?o(e,a.after)>0:rl(a)?o(a.before,e)>0:typeof a=="function"?a(e):!1})}function VC(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:C,isBefore:w,endOfMonth:S,isAfter:c}=s,u=n&&C(n),p=i&&S(i),v={[je.focused]:[],[je.outside]:[],[je.disabled]:[],[je.hidden]:[],[je.today]:[]},y={};for(const _ of e){const{date:x,displayMonth:E}=_,T=!!(E&&!b(x,E)),N=!!(u&&w(x,u)),k=!!(p&&c(x,p)),D=!!(o&&Ht(x,o,s)),M=!!(l&&Ht(x,l,s))||N||k||!f&&!r&&T||f&&r===!1&&T,A=h(x,d);T&&v.outside.push(_),D&&v.disabled.push(_),M&&v.hidden.push(_),A&&v.today.push(_),a&&Object.keys(a).forEach(R=>{const z=a==null?void 0:a[R];z&&Ht(x,z,s)&&(y[R]?y[R].push(_):y[R]=[_])})}return _=>{const x={[je.focused]:!1,[je.disabled]:!1,[je.hidden]:!1,[je.outside]:!1,[je.today]:!1},E={};for(const T in v){const N=v[T];x[T]=N.some(k=>k===_)}for(const T in y)E[T]=y[T].some(N=>N===_);return{...x,...E}}}function WC(e,t,n={}){return Object.entries(e).filter(([,s])=>s===!0).reduce((s,[o])=>(n[o]?s.push(n[o]):t[je[o]]?s.push(t[je[o]]):t[_t[o]]&&s.push(t[_t[o]]),s),[t[fe.Day]])}function $C(e){return{...HC,...e}}function UC(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 YC(){const e={};for(const t in fe)e[fe[t]]=`rdp-${fe[t]}`;for(const t in je)e[je[t]]=`rdp-${je[t]}`;for(const t in _t)e[_t[t]]=`rdp-${_t[t]}`;for(const t in rt)e[rt[t]]=`rdp-${rt[t]}`;return e}function fh(e,t,n){return(n??new ct(t)).formatMonthYear(e)}const qC=fh;function ZC(e,t,n){return(n??new ct(t)).format(e,"d")}function GC(e,t=Ot){return t.format(e,"LLLL")}function KC(e,t,n){return(n??new ct(t)).format(e,"cccccc")}function XC(e,t=Ot){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)}function QC(){return""}function hh(e,t=Ot){return t.format(e,"yyyy")}const JC=hh,eS=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:fh,formatDay:ZC,formatMonthCaption:qC,formatMonthDropdown:GC,formatWeekNumber:XC,formatWeekNumberHeader:QC,formatWeekdayName:KC,formatYearCaption:JC,formatYearDropdown:hh},Symbol.toStringTag,{value:"Module"}));function tS(e){return e!=null&&e.formatMonthCaption&&!e.formatCaption&&(e.formatCaption=e.formatMonthCaption),e!=null&&e.formatYearCaption&&!e.formatYearDropdown&&(e.formatYearDropdown=e.formatYearCaption),{...eS,...e}}function ol(e,t,n,i){let s=(i??new ct(n)).format(e,"PPPP");return t.today&&(s=`Today, ${s}`),t.selected&&(s=`${s}, selected`),s}const nS=ol;function ll(e,t,n){return(n??new ct(t)).formatMonthYear(e)}const iS=ll;function ph(e,t,n,i){let s=(i??new ct(n)).format(e,"PPPP");return t!=null&&t.today&&(s=`Today, ${s}`),s}function mh(e){return"Choose the Month"}function gh(){return""}const sS="Go to the Next Month";function vh(e,t){return sS}function bh(e){return"Go to the Previous Month"}function yh(e,t,n){return(n??new ct(t)).format(e,"cccc")}function xh(e,t){return`Week ${e}`}function _h(e){return"Week Number"}function wh(e){return"Choose the Year"}const rS=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:iS,labelDay:nS,labelDayButton:ol,labelGrid:ll,labelGridcell:ph,labelMonthDropdown:mh,labelNav:gh,labelNext:vh,labelPrevious:bh,labelWeekNumber:xh,labelWeekNumberHeader:_h,labelWeekday:yh,labelYearDropdown:wh},Symbol.toStringTag,{value:"Module"})),vt=(e,t,n)=>t||(n?typeof n=="function"?n:(...i)=>n:e);function oS(e,t){var i;const n=((i=t.locale)==null?void 0:i.labels)??{};return{...rS,...e??{},labelDayButton:vt(ol,e==null?void 0:e.labelDayButton,n.labelDayButton),labelMonthDropdown:vt(mh,e==null?void 0:e.labelMonthDropdown,n.labelMonthDropdown),labelNext:vt(vh,e==null?void 0:e.labelNext,n.labelNext),labelPrevious:vt(bh,e==null?void 0:e.labelPrevious,n.labelPrevious),labelWeekNumber:vt(xh,e==null?void 0:e.labelWeekNumber,n.labelWeekNumber),labelYearDropdown:vt(wh,e==null?void 0:e.labelYearDropdown,n.labelYearDropdown),labelGrid:vt(ll,e==null?void 0:e.labelGrid,n.labelGrid),labelGridcell:vt(ph,e==null?void 0:e.labelGridcell,n.labelGridcell),labelNav:vt(gh,e==null?void 0:e.labelNav,n.labelNav),labelWeekNumberHeader:vt(_h,e==null?void 0:e.labelWeekNumberHeader,n.labelWeekNumberHeader),labelWeekday:vt(yh,e==null?void 0:e.labelWeekday,n.labelWeekday)}}function lS(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 C=i.formatMonthDropdown(b,s),w=f(b),S=t&&b<o(t)||n&&b>o(n)||!1;return{value:w,label:C,disabled:S}})}function aS(e,t={},n={}){let i={...t==null?void 0:t[fe.Day]};return Object.entries(e).filter(([,s])=>s===!0).forEach(([s])=>{i={...i,...n==null?void 0:n[s]}}),i}function cS(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 uS(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 C=n.formatYearDropdown(b,i);return{value:r(b),label:C,disabled:!1}})}function dS(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),C=((((f==null?void 0:f.weekStartsOn)??s)+6)%7-d.getDay()+7)%7;return d.setDate(d.getDate()+C),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),C=d.getFullYear()*12+d.getMonth();for(;b.getFullYear()*12+b.getMonth()<=C;)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 nl(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 tl(f)},differenceInCalendarDays:(r,f)=>{const d=l(r),h=l(f);return el(d,h)},differenceInCalendarMonths:(r,f)=>{const d=l(r),h=l(f);return eh(d,h)}}}const Wi=e=>e instanceof HTMLElement?e:null,Rr=e=>[...e.querySelectorAll("[data-animated-month]")??[]],fS=e=>Wi(e.querySelector("[data-animated-month]")),Lr=e=>Wi(e.querySelector("[data-animated-caption]")),Or=e=>Wi(e.querySelector("[data-animated-weeks]")),hS=e=>Wi(e.querySelector("[data-animated-nav]")),pS=e=>Wi(e.querySelector("[data-animated-weekdays]"));function mS(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[rt.caption_after_enter]:n[rt.caption_before_enter],C=h?n[rt.weeks_after_enter]:n[rt.weeks_before_enter],w=l.current,S=e.current.cloneNode(!0);if(S instanceof HTMLElement?(Rr(S).forEach(v=>{if(!(v instanceof HTMLElement))return;const y=fS(v);y&&v.contains(y)&&v.removeChild(y);const _=Lr(v);_&&_.classList.remove(b);const x=Or(v);x&&x.classList.remove(C)}),l.current=S):l.current=null,r.current||d||s)return;const c=w instanceof HTMLElement?Rr(w):[],u=Rr(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=hS(e.current);p&&(p.style.zIndex="1"),u.forEach((v,y)=>{const _=c[y];if(!_)return;v.style.position="relative",v.style.overflow="hidden";const x=Lr(v);x&&x.classList.add(b);const E=Or(v);E&&E.classList.add(C);const T=()=>{r.current=!1,e.current&&(e.current.style.isolation=""),p&&(p.style.zIndex=""),x&&x.classList.remove(b),E&&E.classList.remove(C),v.style.position="",v.style.overflow="",v.contains(_)&&v.removeChild(_)};_.style.pointerEvents="none",_.style.position="absolute",_.style.overflow="hidden",_.setAttribute("aria-hidden","true");const N=pS(_);N&&(N.style.opacity="0");const k=Lr(_);k&&(k.classList.add(h?n[rt.caption_before_exit]:n[rt.caption_after_exit]),k.addEventListener("animationend",T));const D=Or(_);D&&D.classList.add(h?n[rt.weeks_before_exit]:n[rt.weeks_after_exit]),v.insertBefore(_,v.firstChild)})}})}function gS(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:C,endOfMonth:w,endOfWeek:S,isAfter:c,startOfBroadcastWeek:u,startOfISOWeek:p,startOfWeek:v}=i,y=r?u(s,i):l?p(s):v(s),_=r?b(o):l?C(w(o)):S(w(o)),x=t&&(r?b(t):l?C(t):S(t)),E=x&&c(_,x)?x:_,T=d(E,y),N=h(o,s)+1,k=[];for(let A=0;A<=T;A++){const R=f(y,A);k.push(R)}const M=(r?35:42)*N;if(a&&k.length<M){const A=M-k.length;for(let R=0;R<A;R++){const z=f(k[k.length-1],1);k.push(z)}}return k}function vS(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 bS(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 Za(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 yS(e,t,n,i){const{addDays:s,endOfBroadcastWeek:o,endOfISOWeek:l,endOfMonth:a,endOfWeek:r,getISOWeek:f,getWeek:d,startOfBroadcastWeek:h,startOfISOWeek:b,startOfWeek:C}=i,w=e.reduce((S,c)=>{const u=n.broadcastCalendar?h(c,i):n.ISOWeek?b(c):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(T=>{const N=y-v.length;return T>p&&T<=s(p,N)});v.push(...E)}const _=v.reduce((E,T)=>{const N=n.ISOWeek?f(T):d(T),k=E.find(M=>M.weekNumber===N),D=new ah(T,c,i);return k?k.days.push(D):E.push(new pC(N,[D])),E},[]),x=new hC(c,_);return S.push(x),S},[]);return n.reverseMonths?w.reverse():w}function xS(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:C,fromMonth:w,toMonth:S}=e;!n&&w&&(n=w),!n&&b&&(n=t.newDate(b,0,1)),!i&&S&&(i=S),!i&&C&&(i=d(C,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):C?i=d(C,11,31):!i&&c&&(i=f(e.today??h())),[n&&o(n),i&&o(i)]}function _S(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 wS(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 CS(e){const t=[];return e.reduce((n,i)=>n.concat(i.weeks.slice()),t.slice())}function ir(e,t){const[n,i]=K.useState(e);return[t===void 0?n:t,i]}function SS(e,t){var y;const[n,i]=xS(e,t),{startOfMonth:s,endOfMonth:o}=t,l=Za(e,n,i,t),[a,r]=ir(l,e.month?l:void 0);K.useEffect(()=>{const _=Za(e,n,i,t);r(_)},[e.timeZone]);const{months:f,weeks:d,days:h,previousMonth:b,nextMonth:C}=K.useMemo(()=>{const _=bS(a,i,{numberOfMonths:e.numberOfMonths},t),x=gS(_,e.endMonth?o(e.endMonth):void 0,{ISOWeek:e.ISOWeek,fixedWeeks:e.fixedWeeks,broadcastCalendar:e.broadcastCalendar},t),E=yS(_,x,{broadcastCalendar:e.broadcastCalendar,fixedWeeks:e.fixedWeeks,ISOWeek:e.ISOWeek,reverseMonths:e.reverseMonths},t),T=CS(E),N=vS(E),k=wS(a,n,e,t),D=_S(a,i,e,t);return{months:E,weeks:T,days:N,previousMonth:k,nextMonth:D}},[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:w,onMonthChange:S}=e,c=_=>d.some(x=>x.days.some(E=>E.isEqualTo(_))),u=_=>{if(w)return;let x=s(_);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:C,goToMonth:u,goToDay:_=>{c(_)||u(_.date)}}}var Nt;(function(e){e[e.Today=0]="Today",e[e.Selected=1]="Selected",e[e.LastFocused=2]="LastFocused",e[e.FocusedModifier=3]="FocusedModifier"})(Nt||(Nt={}));function Ga(e){return!e[je.disabled]&&!e[je.hidden]&&!e[je.outside]}function ES(e,t,n,i){let s,o=-1;for(const l of e){const a=t(l);Ga(a)&&(a[je.focused]&&o<Nt.FocusedModifier?(s=l,o=Nt.FocusedModifier):i!=null&&i.isEqualTo(l)&&o<Nt.LastFocused?(s=l,o=Nt.LastFocused):n(l.date)&&o<Nt.Selected?(s=l,o=Nt.Selected):a[je.today]&&o<Nt.Today&&(s=l,o=Nt.Today))}return s||(s=e.find(l=>Ga(t(l)))),s}function NS(e,t,n,i,s,o,l){const{ISOWeek:a,broadcastCalendar:r}=o,{addDays:f,addMonths:d,addWeeks:h,addYears:b,endOfBroadcastWeek:C,endOfISOWeek:w,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?C(E):a?w(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 Ch(e,t,n,i,s,o,l,a=0){if(a>365)return;const r=NS(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 ah(r,h,l);return!f&&!d?b:Ch(e,t,b,i,s,o,l,a+1)}function TS(e,t,n,i,s){const{autoFocus:o}=e,[l,a]=K.useState(),r=ES(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=Ch(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 kS(e,t){const{selected:n,required:i,onSelect:s}=e,[o,l]=ir(n,s?n:void 0),a=s?n:o,{isSameDay:r}=t,f=C=>(a==null?void 0:a.some(w=>r(w,C)))??!1,{min:d,max:h}=e;return{selected:a,select:(C,w,S)=>{let c=[...a??[]];if(f(C)){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,C))}else(a==null?void 0:a.length)===h?c=[C]:c=[...c,C];return s||l(c),s==null||s(c,C,w,S),c},isSelected:f}}function MS(e,t,n=0,i=0,s=!1,o=Ot){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 AS(e,t,n=Ot){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 Ka(e,t,n=Ot){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 DS(e,t,n=Ot){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):dh(a,n)?a.some(r=>zt(e,r,!1,n)):nr(a)?a.from&&a.to?Ka(e,{from:a.from,to:a.to},n):!1:uh(a)?AS(e,a.dayOfWeek,n):il(a)?n.isAfter(a.before,a.after)?Ka(e,{from:n.addDays(a.after,1),to:n.addDays(a.before,-1)},n):Ht(e.from,a,n)||Ht(e.to,a,n):sl(a)||rl(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 RS(e,t){const{disabled:n,excludeDisabled:i,selected:s,required:o,onSelect:l}=e,[a,r]=ir(s,l?s:void 0),f=l?s:a;return{selected:f,select:(b,C,w)=>{const{min:S,max:c}=e,u=b?MS(b,f,S,c,o,t):void 0;return i&&n&&(u!=null&&u.from)&&u.to&&DS({from:u.from,to:u.to},n,t)&&(u.from=b,u.to=void 0),l||r(u),l==null||l(u,b,C,w),u},isSelected:b=>f&&zt(f,b,!1,t)}}function LS(e,t){const{selected:n,required:i,onSelect:s}=e,[o,l]=ir(n,s?n:void 0),a=s?n:o,{isSameDay:r}=t;return{selected:a,select:(h,b,C)=>{let w=h;return!i&&a&&a&&r(h,a)&&(w=void 0),s||l(w),s==null||s(w,h,b,C),w},isSelected:h=>a?r(a,h):!1}}function OS(e,t){const n=LS(e,t),i=kS(e,t),s=RS(e,t);switch(e.mode){case"single":return n;case"multiple":return i;case"range":return s;default:return}}function ft(e,t){return e instanceof Qe&&e.timeZone===t?e:new Qe(e,t)}function Nn(e,t,n){return ft(e,t)}function Xa(e,t,n){return typeof e=="boolean"||typeof e=="function"?e:e instanceof Date?Nn(e,t):Array.isArray(e)?e.map(i=>i instanceof Date?Nn(i,t):i):nr(e)?{...e,from:e.from?ft(e.from,t):e.from,to:e.to?ft(e.to,t):e.to}:il(e)?{before:Nn(e.before,t),after:Nn(e.after,t)}:sl(e)?{after:Nn(e.after,t)}:rl(e)?{before:Nn(e.before,t)}:e}function Pr(e,t,n){return e&&(Array.isArray(e)?e.map(i=>Xa(i,t)):Xa(e,t))}function PS(e){var an;let t=e;const n=t.timeZone;if(n&&(t={...e,timeZone:n},t.today&&(t.today=ft(t.today,n)),t.month&&(t.month=ft(t.month,n)),t.defaultMonth&&(t.defaultMonth=ft(t.defaultMonth,n)),t.startMonth&&(t.startMonth=ft(t.startMonth,n)),t.endMonth&&(t.endMonth=ft(t.endMonth,n)),t.mode==="single"&&t.selected?t.selected=ft(t.selected,n):t.mode==="multiple"&&t.selected?t.selected=(an=t.selected)==null?void 0:an.map(he=>ft(he,n)):t.mode==="range"&&t.selected&&(t.selected={from:t.selected.from?ft(t.selected.from,n):t.selected.from,to:t.selected.to?ft(t.selected.to,n):t.selected.to}),t.disabled!==void 0&&(t.disabled=Pr(t.disabled,n)),t.hidden!==void 0&&(t.hidden=Pr(t.hidden,n)),t.modifiers)){const he={};Object.keys(t.modifiers).forEach(Te=>{var de;he[Te]=Pr((de=t.modifiers)==null?void 0:de[Te],n)}),t.modifiers=he}const{components:i,formatters:s,labels:o,dateLib:l,locale:a,classNames:r}=K.useMemo(()=>{const he={...lh,...t.locale},Te=t.broadcastCalendar?1:t.weekStartsOn,de=t.noonSafe&&t.timeZone?dS(t.timeZone,{weekStartsOn:Te,locale:he}):void 0,Me=t.dateLib&&de?{...de,...t.dateLib}:t.dateLib??de,tt=new ct({locale:he,weekStartsOn:Te,firstWeekContainsDate:t.firstWeekContainsDate,useAdditionalWeekYearTokens:t.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:t.useAdditionalDayOfYearTokens,timeZone:t.timeZone,numerals:t.numerals},Me);return{dateLib:tt,components:$C(t.components),formatters:tS(t.formatters),labels:oS(t.labels,tt.options),locale:he,classNames:{...YC(),...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:C,onDayClick:w,onDayFocus:S,onDayKeyDown:c,onDayMouseEnter:u,onDayMouseLeave:p,onNextClick:v,onPrevClick:y,showWeekNumber:_,styles:x}=t,{formatCaption:E,formatDay:T,formatMonthDropdown:N,formatWeekNumber:k,formatWeekNumberHeader:D,formatWeekdayName:M,formatYearDropdown:A}=s,R=SS(t,l),{days:z,months:V,navStart:H,navEnd:F,previousMonth:L,nextMonth:O,goToMonth:j}=R,P=VC(z,t,H,F,l),{isSelected:U,select:I,selected:$}=OS(t,l)??{},{blur:Q,focused:W,isFocusTarget:X,moveFocus:q,setFocused:G}=TS(t,R,P,U??(()=>!1),l),{labelDayButton:ee,labelGridcell:re,labelGrid:ce,labelMonthDropdown:ie,labelNav:le,labelPrevious:we,labelNext:Ce,labelWeekday:be,labelWeekNumber:Ne,labelWeekNumberHeader:B,labelYearDropdown:Y}=o,Z=K.useMemo(()=>cS(l,t.ISOWeek,t.broadcastCalendar,t.today),[l,t.ISOWeek,t.broadcastCalendar,t.today]),se=d!==void 0||w!==void 0,ne=K.useCallback(()=>{L&&(j(L),y==null||y(L))},[L,j,y]),te=K.useCallback(()=>{O&&(j(O),v==null||v(O))},[j,O,v]),ae=K.useCallback((he,Te)=>de=>{de.preventDefault(),de.stopPropagation(),G(he),!Te.disabled&&(I==null||I(he.date,Te,de),w==null||w(he.date,Te,de))},[I,w,G]),ge=K.useCallback((he,Te)=>de=>{G(he),S==null||S(he.date,Te,de)},[S,G]),pe=K.useCallback((he,Te)=>de=>{Q(),C==null||C(he.date,Te,de)},[Q,C]),xe=K.useCallback((he,Te)=>de=>{const Me={ArrowLeft:[de.shiftKey?"month":"day",t.dir==="rtl"?"after":"before"],ArrowRight:[de.shiftKey?"month":"day",t.dir==="rtl"?"before":"after"],ArrowDown:[de.shiftKey?"year":"week","after"],ArrowUp:[de.shiftKey?"year":"week","before"],PageUp:[de.shiftKey?"year":"month","before"],PageDown:[de.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(Me[de.key]){de.preventDefault(),de.stopPropagation();const[tt,Ee]=Me[de.key];q(tt,Ee)}c==null||c(he.date,Te,de)},[q,c,t.dir]),De=K.useCallback((he,Te)=>de=>{u==null||u(he.date,Te,de)},[u]),ke=K.useCallback((he,Te)=>de=>{p==null||p(he.date,Te,de)},[p]),Xe=K.useCallback(he=>Te=>{const de=Number(Te.target.value),Me=l.setMonth(l.startOfMonth(he),de);j(Me)},[l,j]),Fe=K.useCallback(he=>Te=>{const de=Number(Te.target.value),Me=l.setYear(l.startOfMonth(he),de);j(Me)},[l,j]),{className:Pe,style:He}=K.useMemo(()=>({className:[r[fe.Root],t.className].filter(Boolean).join(" "),style:{...x==null?void 0:x[fe.Root],...t.style}}),[r,t.className,t.style,x]),yn=UC(t),xn=K.useRef(null);mS(xn,!!t.animate,{classNames:r,months:V,focused:W,dateLib:l});const Ve={dayPickerProps:t,selected:$,select:I,isSelected:U,months:V,nextMonth:O,previousMonth:L,goToMonth:j,getModifiers:P,components:i,classNames:r,styles:x,labels:o,formatters:s};return K.createElement(ch.Provider,{value:Ve},K.createElement(i.Root,{rootRef:t.animate?xn:void 0,className:Pe,style:He,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"],...yn},K.createElement(i.Months,{className:r[fe.Months],style:x==null?void 0:x[fe.Months]},!t.hideNavigation&&!h&&K.createElement(i.Nav,{"data-animated-nav":t.animate?"true":void 0,className:r[fe.Nav],style:x==null?void 0:x[fe.Nav],"aria-label":le(),onPreviousClick:ne,onNextClick:te,previousMonth:L,nextMonth:O}),V.map((he,Te)=>K.createElement(i.Month,{"data-animated-month":t.animate?"true":void 0,className:r[fe.Month],style:x==null?void 0:x[fe.Month],key:Te,displayIndex:Te,calendarMonth:he},h==="around"&&!t.hideNavigation&&Te===0&&K.createElement(i.PreviousMonthButton,{type:"button",className:r[fe.PreviousMonthButton],tabIndex:L?void 0:-1,"aria-disabled":L?void 0:!0,"aria-label":we(L),onClick:ne,"data-animated-button":t.animate?"true":void 0},K.createElement(i.Chevron,{disabled:L?void 0:!0,className:r[fe.Chevron],orientation:t.dir==="rtl"?"right":"left"})),K.createElement(i.MonthCaption,{"data-animated-caption":t.animate?"true":void 0,className:r[fe.MonthCaption],style:x==null?void 0:x[fe.MonthCaption],calendarMonth:he,displayIndex:Te},f!=null&&f.startsWith("dropdown")?K.createElement(i.DropdownNav,{className:r[fe.Dropdowns],style:x==null?void 0:x[fe.Dropdowns]},(()=>{const de=f==="dropdown"||f==="dropdown-months"?K.createElement(i.MonthsDropdown,{key:"month",className:r[fe.MonthsDropdown],"aria-label":ie(),classNames:r,components:i,disabled:!!t.disableNavigation,onChange:Xe(he.date),options:lS(he.date,H,F,s,l),style:x==null?void 0:x[fe.Dropdown],value:l.getMonth(he.date)}):K.createElement("span",{key:"month"},N(he.date,l)),Me=f==="dropdown"||f==="dropdown-years"?K.createElement(i.YearsDropdown,{key:"year",className:r[fe.YearsDropdown],"aria-label":Y(l.options),classNames:r,components:i,disabled:!!t.disableNavigation,onChange:Fe(he.date),options:uS(H,F,s,l,!!t.reverseYears),style:x==null?void 0:x[fe.Dropdown],value:l.getYear(he.date)}):K.createElement("span",{key:"year"},A(he.date,l));return l.getMonthYearOrder()==="year-first"?[Me,de]:[de,Me]})(),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[fe.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[fe.NextMonthButton],tabIndex:O?void 0:-1,"aria-disabled":O?void 0:!0,"aria-label":Ce(O),onClick:te,"data-animated-button":t.animate?"true":void 0},K.createElement(i.Chevron,{disabled:O?void 0:!0,className:r[fe.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[fe.Nav],style:x==null?void 0:x[fe.Nav],"aria-label":le(),onPreviousClick:ne,onNextClick:te,previousMonth:L,nextMonth:O}),K.createElement(i.MonthGrid,{role:"grid","aria-multiselectable":d==="multiple"||d==="range","aria-label":ce(he.date,l.options,l)||void 0,className:r[fe.MonthGrid],style:x==null?void 0:x[fe.MonthGrid]},!t.hideWeekdays&&K.createElement(i.Weekdays,{"data-animated-weekdays":t.animate?"true":void 0,className:r[fe.Weekdays],style:x==null?void 0:x[fe.Weekdays]},_&&K.createElement(i.WeekNumberHeader,{"aria-label":B(l.options),className:r[fe.WeekNumberHeader],style:x==null?void 0:x[fe.WeekNumberHeader],scope:"col"},D()),Z.map(de=>K.createElement(i.Weekday,{"aria-label":be(de,l.options,l),className:r[fe.Weekday],key:String(de),style:x==null?void 0:x[fe.Weekday],scope:"col"},M(de,l.options,l)))),K.createElement(i.Weeks,{"data-animated-weeks":t.animate?"true":void 0,className:r[fe.Weeks],style:x==null?void 0:x[fe.Weeks]},he.weeks.map(de=>K.createElement(i.Week,{className:r[fe.Week],key:de.weekNumber,style:x==null?void 0:x[fe.Week],week:de},_&&K.createElement(i.WeekNumber,{week:de,style:x==null?void 0:x[fe.WeekNumber],"aria-label":Ne(de.weekNumber,{locale:a}),className:r[fe.WeekNumber],scope:"row",role:"rowheader"},k(de.weekNumber,l)),de.days.map(Me=>{const{date:tt}=Me,Ee=P(Me);if(Ee[je.focused]=!Ee.hidden&&!!(W!=null&&W.isEqualTo(Me)),Ee[_t.selected]=(U==null?void 0:U(tt))||Ee.selected,nr($)){const{from:ni,to:_n}=$;Ee[_t.range_start]=!!(ni&&_n&&l.isSameDay(tt,ni)),Ee[_t.range_end]=!!(ni&&_n&&l.isSameDay(tt,_n)),Ee[_t.range_middle]=zt($,tt,!0,l)}const Xi=aS(Ee,x,t.modifiersStyles),Qi=WC(Ee,r,t.modifiersClassNames),Ji=!se&&!Ee.hidden?re(tt,Ee,l.options,l):void 0;return K.createElement(i.Day,{key:`${Me.isoDate}_${Me.displayMonthId}`,day:Me,modifiers:Ee,className:Qi.join(" "),style:Xi,role:"gridcell","aria-selected":Ee.selected||void 0,"aria-label":Ji,"data-day":Me.isoDate,"data-month":Me.outside?Me.dateMonthId:void 0,"data-selected":Ee.selected||void 0,"data-disabled":Ee.disabled||void 0,"data-hidden":Ee.hidden||void 0,"data-outside":Me.outside||void 0,"data-focused":Ee.focused||void 0,"data-today":Ee.today||void 0},!Ee.hidden&&se?K.createElement(i.DayButton,{className:r[fe.DayButton],style:x==null?void 0:x[fe.DayButton],type:"button",day:Me,modifiers:Ee,disabled:!Ee.focused&&Ee.disabled||void 0,"aria-disabled":Ee.focused&&Ee.disabled||void 0,tabIndex:X(Me)?0:-1,"aria-label":ee(tt,Ee,l.options,l),onClick:ae(Me,Ee),onBlur:pe(Me,Ee),onFocus:ge(Me,Ee),onKeyDown:xe(Me,Ee),onMouseEnter:De(Me,Ee),onMouseLeave:ke(Me,Ee)},T(tt,l.options,l)):!Ee.hidden&&T(Me.date,l.options,l))})))))))),t.footer&&K.createElement(i.Footer,{className:r[fe.Footer],style:x==null?void 0:x[fe.Footer],role:"status","aria-live":"polite"},t.footer)))}const sr=m.forwardRef(({className:e,classNames:t,showOutsideDays:n=!0,...i},s)=>g.jsx(PS,{ref:s,showOutsideDays:n,className:J("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:J("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:J("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(co,{className:"h-4 w-4"}),IconRight:({...o})=>g.jsx(ki,{className:"h-4 w-4"})},...i}));sr.displayName="Calendar";const al=m.forwardRef(({date:e,onDateChange:t,placeholder:n="Pick a date",className:i,...s},o)=>g.jsxs(Qo,{children:[g.jsx(Jo,{asChild:!0,children:g.jsxs(_e,{ref:o,variant:"outline",className:J("w-[280px] justify-start text-left font-normal",!e&&"text-muted-foreground",i),...s,children:[g.jsx(ds,{className:"mr-2 h-4 w-4"}),e?jt(e,"PPP"):g.jsx("span",{children:n})]})}),g.jsx(tr,{className:"w-auto p-0",children:g.jsx(sr,{mode:"single",selected:e,onSelect:t,initialFocus:!0})})]}));al.displayName="DatePicker";const cl=m.forwardRef(({dateRange:e,onDateRangeChange:t,placeholder:n="Pick a date range",className:i,...s},o)=>g.jsx("div",{className:J("grid gap-2",i),children:g.jsxs(Qo,{children:[g.jsx(Jo,{asChild:!0,children:g.jsxs(_e,{ref:o,id:"date",variant:"outline",className:J("w-[300px] justify-start text-left font-normal",!e&&"text-muted-foreground"),...s,children:[g.jsx(ds,{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(tr,{className:"w-auto p-0",align:"start",children:g.jsx(sr,{initialFocus:!0,mode:"range",defaultMonth:e==null?void 0:e.from,selected:e,onSelect:t,numberOfMonths:2})})]})}));cl.displayName="DateRangePicker";var rr={},ul={};const Sh={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))}},Eh={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)}},Nh={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()}},Th={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()}},kh={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}},Mh={name:"fontColor",display:"submenu",add:function(e,t){e.addModule([kh]);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()}},Ah={name:"hiliteColor",display:"submenu",add:function(e,t){e.addModule([kh]);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()}},Dh={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())}},Rh={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,C=!0;for(let w=0,S=s.length;w<S;w++)if(!o.isList(o.getRangeFormatElement(s[w],(function(c){return this.getRangeFormatElement(c)&&c!==s[w]}).bind(o)))){C=!1;break}if(C&&(!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 _=v-1;_>=0;_--)if(s[_].contains(s[v])){s.splice(v,1),v--,y--;break}}const w=o.getRangeFormatElement(l),S=w&&w.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,_,x;v<y;v++)x=o.getRangeFormatElement(s[v],p),!(!x||!o.isList(x))&&(_?_!==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)),_=x,c={r:_,f:[o.getParentElement(s[v],"LI")]}):c.f.push(o.getParentElement(s[v],"LI")):(_=x,c={r:_,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 w=r&&r.parentNode,S=f&&f.parentNode;r=w&&!o.isWysiwygDiv(w)&&w.nodeName===e?w: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,_=null;const x=(function(E){return!this.isComponent(E)&&!this.isList(E)}).bind(o);for(let E=0,T=s.length,N,k,D,M,A,R,z,V,H;E<T;E++){if(k=s[E],k.childNodes.length===0&&!o._isIgnoreNodeChange(k)){o.removeItem(k);continue}if(M=s[E+1],A=k.parentNode,R=M?M.parentNode:null,D=o.isListCell(k),H=o.isRangeFormatElement(A)?A:null,z=D&&!o.isWysiwygDiv(A)?A.parentNode:A,V=D&&!o.isWysiwygDiv(A)?!M||o.isListCell(z)?A:A.nextSibling:k.nextSibling,N=o.createElement("LI"),o.copyFormatAttributes(N,k),E===0&&h.sc===k&&(h.sc=N),E===T-1&&h.ec===k&&(h.ec=N),o.isComponent(k)){const F=/^HR$/i.test(k.nodeName);F||(N.innerHTML="<br>"),N.innerHTML+=k.outerHTML,F&&(N.innerHTML+="<br>")}else{const F=k.childNodes;for(;F[0];)N.appendChild(F[0])}p.appendChild(N),(!M||z!==R||o.isRangeFormatElement(V))&&(v||(v=p),(!c||!M||z!==R)&&!(M&&o.isList(R)&&R===A)&&p.parentNode!==z&&z.insertBefore(p,V)),o.removeItem(k),c&&y===null&&(y=p.children.length-1),M&&(o.getRangeFormatElement(R,x)!==o.getRangeFormatElement(A,x)||o.isList(R)&&o.isList(A)&&o.getElementDepth(R)!==o.getElementDepth(A))&&(p=o.createElement(e)),H&&H.children.length===0&&o.removeItem(H)}y&&(v=v.children[y]),u&&(_=p.children.length-1,p.innerHTML+=f.innerHTML,p.children[_],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,C=n,w;b<C;b++)w=t[b],w.parentNode!==i&&(this.plugins.list._insiedList.call(this,i,l,a,r,f),i=w.parentNode,l=this.util.createElement(i.nodeName)),a=w.previousElementSibling,r=w.nextElementSibling,l.appendChild(w);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)}},Lh={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 C=0,w=h.length,S,c,u,p;C<w;C++){if(S=h[C],c=S.colSpan-1,u=S.rowSpan-1,p=C+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===w-1&&(y.rs-=1,y.row=d+1,y.rs<1&&(f.splice(v,1),v--)));if(d===a&&C===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,w){return C.index-w.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 C=0,w=b.length,S,c;C<w;C++)S=b[C].rowSpan,c=b[C].colSpan,!(S<2&&c<2)&&S+d>l&&l>d&&(b[C].rowSpan=S+a,f-=c)}if(i){const d=r[o+1];if(d){const h=[];let b=r[o].cells,C=0;for(let w=0,S=b.length,c,u;w<S;w++)c=b[w],u=w+C,C+=c.colSpan-1,c.rowSpan>1&&(c.rowSpan-=1,h.push({cell:c.cloneNode(!1),index:u}));if(h.length>0){let w=h.shift();b=d.cells,C=0;for(let S=0,c=b.length,u,p;S<c&&(u=b[S],p=S+C,C+=u.colSpan-1,!(p>=w.index&&(S--,C--,C+=w.cell.colSpan-1,d.insertBefore(w.cell,u),w=h.shift(),!w)));S++);if(w){d.appendChild(w.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=[],C=[];for(let w=0,S=n._rowCnt,c,u,p,v,y,_;w<S;w++){c=r[w],u=a,y=!1,p=c.cells,_=0;for(let x=0,E,T=p.length,N,k,D;x<T&&(E=p[x],!!E);x++)if(N=E.rowSpan-1,k=E.colSpan-1,s){if(D=x+_,d.length>0){const M=!p[x+1];for(let A=0,R;A<d.length;A++)R=d[A],!(R.row>w)&&(D>=R.index?(_+=R.cs,D=x+_,R.rs-=1,R.row=w+1,R.rs<1&&(d.splice(A,1),A--)):M&&(R.rs-=1,R.row=w+1,R.rs<1&&(d.splice(A,1),A--)))}N>0&&f.push({rs:N,cs:k+1,index:D,row:-1}),D>=u&&D+k<=u+l?b.push(E):D<=u+l&&D+k>=u?E.colSpan-=i.getOverlapRangeAtIndex(a,a+l,D,D+k):N>0&&(D<u||D+k>u+l)&&C.push({cell:E,i:w,rs:w+N}),_+=k}else{if(x>=u)break;if(k>0){if(h<1&&k+x>=u){E.colSpan+=1,u=null,h=N+1;break}u-=k}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 w,S;for(let c=0,u=b.length,p;c<u;c++)p=b[c].parentNode,i.removeItem(b[c]),p.cells.length===0&&(w||(w=i.getArrayIndex(r,p)),S=i.getArrayIndex(r,p),i.removeItem(p));for(let c=0,u=C.length,p;c<u;c++)p=C[c],p.cell.rowSpan=i.getOverlapRangeAtIndex(w,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 C=0,w=i._rowCnt,S,c;C<w;C++){S=o[C].cells,c=0;for(let u=0,p=S.length,v,y,_,x;u<p;u++){if(v=S[u],y=v.colSpan-1,_=v.rowSpan-1,x=u+c,b.length>0)for(let E=0,T;E<b.length;E++)T=b[E],!(T.row>C)&&(x>=T.index?(c+=T.cs,x+=T.cs,T.rs-=1,T.row=C+1,T.rs<1&&(b.splice(E,1),E--)):u===p-1&&(T.rs-=1,T.row=C+1,T.rs<1&&(b.splice(E,1),E--)));if(x<=a&&_>0&&h.push({index:x,cs:y+1,rs:_,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=[],C=t.getArrayIndex(o,l)+h;for(let u=0,p,v;u<C;u++){p=o[u].cells,v=0;for(let y=0,_=p.length,x,E,T;y<_&&(T=y+v,!(T>=a));y++)x=p[y],E=x.rowSpan-1,E>0&&E+u>=C&&T<a&&b.push({index:T,cs:x.colSpan}),v+=x.colSpan-1}const w=o[C],S=w.cells;let c=b.shift();for(let u=0,p=S.length,v=0,y,_,x,E;u<p;u++){if(x=u+v,y=S[u],_=y.colSpan-1,E=x+_+1,c&&E>=c.index&&(v+=c.cs,E+=c.cs,c=b.shift()),E>=a||u===p-1){w.insertBefore(f,y.nextElementSibling);break}v+=_}s.rowSpan=h}else{f.rowSpan=s.rowSpan;const h=t.createElement("TR");h.appendChild(f);for(let w=0,S;w<r;w++){if(S=o[w].cells,S.length===0)return;for(let c=0,u=S.length;c<u;c++)w+S[c].rowSpan-1>=r&&(S[c].rowSpan+=1)}const b=i._physical_cellIndex,C=l.cells;for(let w=0,S=C.length;w<S;w++)w!==b&&(C[w].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,C=s.length,w,S;b<C;b++){w=s[b],h!==w.parentNode&&(h=w.parentNode),S=w.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+=w.innerHTML,n.removeItem(w),h.cells.length===0&&(l?a=h:l=h,f-=1)}if(l){const b=t._trElements,C=n.getArrayIndex(b,l),w=n.getArrayIndex(b,a||l),S=[];for(let c=0,u;c<=w;c++){if(u=b[c].cells,u.length===0){S.push(b[c]);continue}for(let p=0,v=u.length,y,_;p<v;p++)y=u[p],_=y.rowSpan-1,_>0&&c+_>=C&&(y.rowSpan-=n.getOverlapRangeAtIndex(C,w,c,c+_))}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,C;d<h;d++){b=i[d].cells,C=0;for(let w=0,S=b.length,c,u,p,v;w<S;w++){if(c=b[w],p=c.colSpan-1,v=c.rowSpan-1,u=w+C,a.length>0)for(let y=0,_;y<a.length;y++)_=a[y],!(_.row>d)&&(u>=_.index?(C+=_.cs,u+=_.cs,_.rs-=1,_.row=d+1,_.rs<1&&(a.splice(y,1),y--)):w===S-1&&(_.rs-=1,_.row=d+1,_.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,_=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!==_||f.rs!==x||f.re!==E){f.cs=y,f.ce=_,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+=c.colSpan-1}a=a.concat(r).sort(function(w,S){return w.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)}},Oh={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,w,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",C=/^h/.test(d)?d.match(/\d+/)[0]:"",b=n["tag_"+(C?"h":d)]+C,S="",w=""):(d=f.tag.toLowerCase(),h=f.command,b=f.name||d,S=f.class,w=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+w+">"+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 C=d.getNodePath(l.startContainer,h,null,null),w=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(C,h),r,d.getNodeFromPath(w,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 _=u,x,E,T,N,k,D,M=!0;_>=0;_--)if(x=c[_],x!==(c[_+1]?c[_+1].parentNode:null)){if(D=d.isComponent(x),E=D?"":x.innerHTML.replace(/(?!>)\s+(?=<)|\n/g," "),T=d.getParentElement(x,function(A){return A.parentNode===p}),(p!==x.parentNode||D)&&(d.isFormatElement(p)?(p.parentNode.insertBefore(v,p.nextSibling),p=p.parentNode):(p.insertBefore(v,T?T.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),k=v.innerHTML,v.innerHTML=(M||!E||!k||/<br>$/i.test(E)?E:E+"<BR>")+k,_===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))}D||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(C,h),r,d.getNodeFromPath(w,b),f)}this.history.push(!1)}this.submenuOff()}}},Ph={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)}},Ih={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()}},Bh={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 C=s[f.toLowerCase()];if(!C)continue;f=C}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)}},Fh={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,w;l<a;l++){if(r=s[l],h="",C="",b=[],typeof r=="string"){const S=i[r.toLowerCase()];if(!S)continue;r=S}d=r.name,f=r.tag||"span",w=r._class,r.style&&(h+=' style="'+r.style+'"',C+=r.style.replace(/:[^;]+(;|$)\s*/g,","),b.push("style")),r.class&&(h+=' class="'+r.class+'"',C+="."+r.class.trim().replace(/\s+/g,",."),b.push("class")),C=C.replace(/,$/,""),o+='<li><button type="button" class="se-btn-list'+(w?" "+w:"")+'" data-command="'+f+'" data-value="'+C+'" 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 jh={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:Be,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})})(jh);var IS=jh.exports;const $i=Jn(IS),BS={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)}},zh={name:"anchor",add:function(e){e.addModule([BS]),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)}},Hh={name:"link",display:"dialog",add:function(e){e.addModule([$i,zh]);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 Vh={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:Be,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})})(Vh);var FS=Vh.exports;const dl=Jn(FS);var Wh={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:Be,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,C=h?s.offsetWidth:s.offsetHeight,w=d.top,S=d.left-this.context.element.wysiwygFrame.scrollLeft;r.style.top=w+"px",r.style.left=S+"px",r.style.width=b+"px",r.style.height=C+"px",f.style.top="0px",f.style.left="0px",f.style.width=b+"px",f.style.height=C+"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 _=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=_;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,R=M.length;A<R;A++)M[A].getAttribute("data-value")===c?this.util.addClass(M[A],"on"):this.util.removeClass(M[A],"on")}const E=l.percentageButtons,T=/%$/.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")===T?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 k=function(){this.util.setDisabledButtons.call(this.util,!1,this.resizingDisabledButtons),this.history._resetCachingButton()};this.controllersOn(r,l.resizeButton,k.bind(this),s,o),this.util.setDisabledButtons(!0,this.resizingDisabledButtons),l._resize_w=b,l._resize_h=C;const D=(s.getAttribute("origin-size")||"").split(",");return l._origin_w=D[0]||s.naturalWidth,l._origin_h=D[1]||s.naturalHeight,{w:b,h:C,t:w,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 _=d.getAttribute("data-percentage");_&&(b=_.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 C=d.getAttribute("data-rotate")||"0";let w=d.getAttribute("data-rotateX")||"",S=d.getAttribute("data-rotateY")||"";a==="h"&&!this.context.resizing._rotateVertical||a==="v"&&this.context.resizing._rotateVertical?S=S?"":"180":w=w?"":"180",d.setAttribute("data-rotateX",w),d.setAttribute("data-rotateY",S),this.plugins.resizing._setTransForm(d,C,w,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 _=this.util.getChildElement(f._caption,function(x){return x.nodeType===3});_?this.setRange(_,0,_,_.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,C=l||s.offsetHeight,w=(r?C:b)+"px",S=(r?b:C)+"px";if(this.plugins[this.context.resizing._resize_plugin].cancelPercentAttr.call(this),this.plugins[this.context.resizing._resize_plugin].setSize.call(this,b+"px",C+"px",!0),h.style.width=w,h.style.height=this.context[this.context.resizing._resize_plugin]._caption?"":S,r){let c=b/2+"px "+b/2+"px 0",u=C/2+"px "+C/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),C=l._element_h+(/b/.test(o)?f-s._resizeClientY:s._resizeClientY-f),w=l._element_h/l._element_w*b;/t/.test(o)&&(s.resizeDiv.style.top=l._element_h-(/h/.test(o)?C:w)+"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=w+"px",h=w):/^(t|b)h$/.test(o)&&(s.resizeDiv.style.height=C+"px",h=C),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})})(Wh);var jS=Wh.exports;const $h=Jn(jS);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:Be,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,C=d.setInfo.bind(this);if(f.length===b.length)if(this._componentsInfoReset){for(let u=0,p=f.length;u<p;u++)C(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(_){return y.src===_.src&&y.index.toString()===_.getAttribute("data-index")}).length===0){u=!0;break}if(!u)return}const w=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"),C(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=w)},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 C=o.getAttribute("data-index"),w=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}),!C||this._componentsInfoInit)S="create",C=h._infoIndex++,o.setAttribute("data-index",C),o.setAttribute("data-file-name",a.name),o.setAttribute("data-file-size",a.size),w={src:o.src,index:C*1,name:a.name,size:a.size},b.push(w);else{S="update",C*=1;for(let c=0,u=b.length;c<u;c++)if(C===b[c].index){w=b[c];break}w||(C=h._infoIndex++,w={index:C},b.push(w)),w.src=o.src,w.name=o.getAttribute("data-file-name"),w.size=o.getAttribute("data-file-size")*1}if(w.element=o,w.delete=d.destroy.bind(this,o),w.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,C,S,w,--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})})(Uh);var zS=Uh.exports;const fl=Jn(zS),Yh={name:"image",display:"dialog",add:function(e){e.addModule([$i,zh,dl,$h,fl]);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,w,S,c,u){f[u]={result:C.result,file:c},--this.context.image.base64RenderIndex===0&&(this.plugins.image.onRender_imgBase64.call(this,w,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 C=this.plugins.anchor.createAnchor.call(this,i.anchorCtx,!0);if(C)i._linkElement!==C||a&&!l.contains(C)?(i._linkElement=C.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 w=null;if(a){const S=i._element.parentNode;if(w=this.util.isRangeFormatElement(S)||this.util.isWysiwygDiv(S)?i._element:S||i._element,this.util.getParentElement(i._element,this.util.isNotCheckingNode))w=b?C:i._element,w.parentNode.replaceChild(l,w);else if(this.util.isListCell(w)){const c=this.util.getParentElement(i._element,function(u){return u.parentNode===w});w.insertBefore(l,c),this.util.removeItem(i._element),this.util.removeEmptyNode(c,null,!0)}else if(this.util.isFormatElement(w)){const c=this.util.getParentElement(i._element,function(u){return u.parentNode===w});w=this.util.splitElement(w,c),w.parentNode.insertBefore(l,w),this.util.removeItem(i._element),this.util.removeEmptyNode(w,null,!0),w.children.length===0&&(w.innerHTML=this.util.htmlRemoveWhiteSpace(w.innerHTML))}else if(this.util.isFormatElement(w.parentNode)){const c=w.parentNode;c.parentNode.insertBefore(l,w.previousSibling?c.nextElementSibling:c),i.__updateTags.map(function(u){return w.contains(u)}).length===0&&this.util.removeItem(w)}else w=this.util.isFigures(w.parentNode)?w.parentNode:w,w.parentNode.replaceChild(l,w);s=l.querySelector("img"),i._element=s,i._cover=o,i._container=l}b&&(a?(this.util.removeItem(b),this.util.getListChildren(C,function(S){return/IMG/i.test(S.tagName)}).length===0&&this.util.removeItem(C)):this.util.removeItem(C)),(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)}},qh={name:"video",display:"dialog",add:function(e){e.addModule([$i,dl,$h,fl]);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,C=o.length;b<C;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 C=!1;b&&(C=this.plugins.video.applySize.call(this)),C&&s==="center"||this.plugins.video.setAlign.call(this,null,e,r,f);let w=!0;if(l)a._resizing&&this.context.resizing._rotateVertical&&b&&this.plugins.resizing.setTransformSize.call(this,e,null,null);else if(w=this.insertComponent(f,!1,!0,!this.options.mediaAutoSelect),!this.options.mediaAutoSelect){const S=this.appendFormatTag(f,null);S&&this.setRange(S,0,S,0)}w&&(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))}},Zh={name:"audio",display:"dialog",add:function(e){e.addModule([$i,dl,fl]);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}},Qa="https://katex.org/docs/supported.html",Gh={name:"math",display:"dialog",add:function(e){e.addModule([$i]);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="'+Qa+'" 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="'+Qa+'" 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 Kh={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:Be,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="",w='<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()}),w+=b(u),(c+1)%h===0&&S<d&&c+1<f&&(S++,w+='</div><div class="se-file-item-column">'),o&&p.length>0)for(let v=0,y=p.length,_;v<y;v++)_=p[v],_&&r.indexOf(_)===-1&&(r.push(_),C+='<a title="'+_+'" aria-label="'+_+'">'+_+"</a>");w+="</div>",l.list.innerHTML=w,o&&(l.items=s,l.tagArea.innerHTML=C,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(C){return d.indexOf(C)>-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})})(Kh);var HS=Kh.exports;const VS=Jn(HS),Xh={name:"imageGallery",add:function(e){e.addModule([VS]);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)}},WS={blockquote:Sh,align:Eh,font:Nh,fontSize:Th,fontColor:Mh,hiliteColor:Ah,horizontalRule:Dh,list:Rh,table:Lh,formatBlock:Oh,lineHeight:Ph,template:Ih,paragraphStyle:Bh,textStyle:Fh,link:Hh,image:Yh,video:qh,audio:Zh,math:Gh,imageGallery:Xh},$S=Object.freeze(Object.defineProperty({__proto__:null,align:Eh,audio:Zh,blockquote:Sh,default:WS,font:Nh,fontColor:Mh,fontSize:Th,formatBlock:Oh,hiliteColor:Ah,horizontalRule:Dh,image:Yh,imageGallery:Xh,lineHeight:Ph,link:Hh,list:Rh,math:Gh,paragraphStyle:Bh,table:Lh,template:Ih,textStyle:Fh,video:qh},Symbol.toStringTag,{value:"Module"})),US=mf($S),Ja={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 Qh={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:Be,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})})(Qh);var YS=Qh.exports;const qS=Jn(YS),me={_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 me.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 me.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(!me.isWysiwygDiv(o)){const l=o.parentNode;l&&t(o)&&(i={sc:o.previousElementSibling,ec:o.nextElementSibling},me.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 C=this.getPositionIndex(t);const w=e.cloneNode(!1),S=e.cloneNode(!1);for(let c=0,u=b.length;c<u;c++){if(c<C)w.appendChild(b[c]);else if(c>C)S.appendChild(b[c]);else continue;c--,u--,C--}return w.childNodes.length>0&&e.parentNode.insertBefore(w,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,me.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,w;h<b&&(C=d[h],w=d[h+1],!!C);h++)if(!(i.isBreak(C)||i.isMedia(C)||i.isInputElement(C))){if(n&&i._isIgnoreNodeChange(C)||!n&&(i.isTable(C)||i.isListCell(C)||i.isFormatElement(C)&&!i.isFreeFormatElement(C))){(i.isTable(C)||i.isListCell(C))&&l(C,r+1,h);continue}if(b===1&&a.nodeName===C.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=C,u=a,p=r,v=!0;p>=0;){if(i.getArrayIndex(u.childNodes,c)!==S[p]){v=!1;break}c=C.parentNode,u=c.parentNode,p--}v&&(S.splice(r,1),S[r]=h)}}i.copyTagAttributes(C,a),a.parentNode.insertBefore(C,a),i.removeItem(a)}if(!w){C.nodeType===1&&l(C,r+1,h);break}if(C.nodeName===w.nodeName&&i.isSameAttributes(C,w)&&C.href===w.href){const S=C.childNodes;let c=0;for(let y=0,_=S.length;y<_;y++)S[y].textContent.length>0&&c++;const u=C.lastChild,p=w.firstChild;let v=0;if(u&&p){const y=u.nodeType===3&&p.nodeType===3;v=u.textContent.length;let _=u.previousSibling;for(;_&&_.nodeType===3;)v+=_.textContent.length,_=_.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(C.nodeType===3){if(v=C.textContent.length,C.textContent+=w.textContent,s){let y=null;for(let _=0;_<s;_++)if(y=t[_],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[_]+=v)}}}else C.innerHTML+=w.innerHTML;i.removeItem(w),h--}else C.nodeType===1&&l(C,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 w=h.firstElementChild;if(!this.isFormatElement(w)&&!this.isRangeFormatElement(w)&&!this.isComponent(w))return r.push(h),!1}if(b&&h.className){const w=new this._w.Array(h.classList).map(i).join(" ").trim();w?h.className=w: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,w;h<b;h++)if(C=f[h],w=C.parentNode,!(!w||!w.parentNode))if(this.getParentElement(C,this.isListCell)){const S=C.childNodes;for(let c=S.length-1;b>=0;c--)w.insertBefore(C,S[c]);d.push(C)}else w.parentNode.insertBefore(C,w),d.push(w);for(let h=0,b=d.length,C;h<b;h++)C=d[h],this.onlyZeroWidthSpace(C.textContent.trim())&&this.removeItem(C);for(let h=0,b=l.length;h<b;h++)this.removeItem(l[h]);for(let h=0,b=a.length,C,w,S,c;h<b;h++)if(C=a[h],c=C.parentNode,!!c)if(w=this.createElement("LI"),this.isFormatElement(C)){for(S=C.childNodes;S[0];)w.appendChild(S[0]);c.insertBefore(w,C),this.removeItem(C)}else C=C.nextSibling,w.appendChild(a[h]),c.insertBefore(w,C);for(let h=0,b=r.length,C,w;h<b;h++)C=r[h],w=this.createElement("DIV"),w.innerHTML=C.textContent.trim().length===0&&C.children.length===0?"<br>":C.innerHTML,C.innerHTML=w.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
242
|
/** Iframe height auto */
|
|
243
243
|
body{height: min-content; overflow: hidden;}
|
|
244
|
-
</style>`:"")}},no={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,w=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 _=n.createElement("DIV");_.className+="se-line-breaker-component";const x=_.cloneNode(!0);_.innerHTML=x.innerHTML=t.icons.line_break;const E=n.createElement("DIV");E.className="se-resizing-back";const T=n.createElement("INPUT");T.tabIndex=-1,T.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 k=t.resizingBarContainer;return S&&k&&k.appendChild(S),f.appendChild(C),w&&f.appendChild(w),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(_),s.appendChild(x),s.appendChild(T),S&&!k&&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:w,_resizingBar:S,_navigation:c,_charWrapper:u,_charCounter:p,_loading:v,_lineBreaker:y,_lineBreaker_t:_,_lineBreaker_b:x,_resizeBack:E,_stickyDummy:r,_arrow:a,_focusTemp:T},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)me.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)me.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,w=d.placeholder;let C=d.codeView;return i.resizingBar&&me.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),w&&o.appendChild(w),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=w,e.rtl?me.addClass(i.topArea,"se-rtl"):me.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||qS,t.value=typeof t.value=="string"?t.value:null,t.allowedClassNames=new me._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?me.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)?me.getNumber(t.stickyToolbar,0):-1,t.hideToolbar=!!t.hideToolbar,t.fullScreenOffset=t.fullScreenOffset===void 0?0:/^\d+/.test(t.fullScreenOffset)?me.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=me.isNumber(t.maxCharCount)&&t.maxCharCount>-1?t.maxCharCount*1:null,t.width=t.width?me.isNumber(t.width)?t.width+"px":t.width:e.clientWidth?e.clientWidth+"px":"100%",t.minWidth=(me.isNumber(t.minWidth)?t.minWidth+"px":t.minWidth)||"",t.maxWidth=(me.isNumber(t.maxWidth)?t.maxWidth+"px":t.maxWidth)||"",t.height=t.height?me.isNumber(t.height)?t.height+"px":t.height:e.clientHeight?e.clientHeight+"px":"auto",t.minHeight=(me.isNumber(t.minHeight)?t.minHeight+"px":t.minHeight)||"",t.maxHeight=(me.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?me.isNumber(t.imageWidth)?t.imageWidth+"px":t.imageWidth:"auto",t.imageHeight=t.imageHeight?me.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)?me.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||!me.getNumber(t.videoWidth,0)?"":me.isNumber(t.videoWidth)?t.videoWidth+"px":t.videoWidth,t.videoHeight=!t.videoHeight||!me.getNumber(t.videoHeight,0)?"":me.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=me.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)?me.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?me.isNumber(t.audioWidth)?t.audioWidth+"px":t.audioWidth:"",t.audioHeight=t.audioHeight?me.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)?me.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"?Ja:[Ja,t.icons].reduce(function(o,l){for(let a in l)me.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)me.hasOwn(l,a)&&(o[a]=l[a]);return o},{}):t.icons,t.__listCommonStyle=t.__listCommonStyle||["fontSize","color","fontFamily","fontWeight","fontStyle"],t._editorStyles=me._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=me.isOSX_IOS?"⌘":"CTRL",s=me.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=me.createElement("DIV");e.className="se-btn-module se-btn-module-border";const t=me.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=me.createElement("LI"),r=me.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,w=null,C=null,S="",c=!1;const u=me.createElement("DIV");u.className="se-toolbar-more-layer";e:for(let y=0,_,x,E,T,N;y<t.length;y++)if(_=!1,N="",T=t[y],w=this._createModuleGroup(),typeof T=="object"){for(let k=0,D;k<T.length;k++){if(b=T[k],D=!1,/^\%\d+/.test(b)&&k===0){T[0]=b.replace(/[^\d]/g,""),d.push(T),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),w.div.className+=" module-float-"+N;continue}if(/^\#/.test(b)){b.substr(1)==="fix"&&(w.ul.className+=" se-menu-dir-fix");continue}if(/^\:/.test(b)){D=!0;const M=b.match(/^\:([^\-]+)\-([^\-]+)\-([^\-]+)/);E="__se__"+M[1].trim();const A=M[2].trim(),R=M[3].trim();h=["se-btn-more",A,E,"MORE",R]}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),(_?x:w.ul).appendChild(C.li),n[S]&&(f[S]=C.button),D&&(_=!0,x=me.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 k=s.cloneNode(!1);l.appendChild(k)}l.appendChild(w.div),c=!0}else if(/^\/$/.test(T)){const k=e.createElement("DIV");k.className="se-btn-module-enter",l.appendChild(k),c=!1}switch(l.children.length){case 0:l.style.display="none";break;case 1:me.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}}},io=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 ZS(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 w=d[f];o.wysiwyg.innerHTML=w.contents,e.setRange(i.getNodeFromPath(w.s.path,o.wysiwyg),w.s.offset,i.getNodeFromPath(w.e.path,o.wysiwyg),w.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 w=o.wysiwyg.innerHTML;if(!w||d[f]&&w===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:w,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:w,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(w){n.setTimeout(e._resourcesStateChange.bind(e));const C=typeof w=="number"?w>0?w:0:w?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(w){f=w<0?d.length-1:w,h()},getCurrentIndex:function(){return f},reset:function(w){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}},w||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 ec={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 GS(e,t,n,i,s,o){const l=e.element.originElement.ownerDocument||document,a=l.defaultView||window,r=me,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:ec,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),_=u.offsetWidth,x=c.parentElement.offsetLeft+3;if(s.rtl){const R=c.offsetWidth,z=_>R?_-R:0,V=z>0?0:R-_;u.style.left=x-z+V+"px",y.left>h._getEditorOffsets(u).left&&(u.style.left="0px")}else{const R=v<=_?0:v-(x+_);R<0?u.style.left=x+R+"px":u.style.left=x+"px"}let E=0,T=c;for(;T&&T!==p;)E+=T.offsetTop,T=T.offsetParent;const N=E;this._isBalloon?E+=p.offsetTop+c.offsetHeight:E-=c.offsetHeight;const k=y.top,D=u.offsetHeight,M=this.getGlobalScrollOffset().top,A=a.innerHeight-(k-M+N+c.parentElement.offsetHeight);if(A<D){let R=-1*(D-N+3);const z=k-M+R,V=D+(z<0?z:0);V>A?(u.style.height=V+"px",R=-1*(V-N+3)):(u.style.height=A+"px",R=N+c.parentElement.offsetHeight),u.style.top=R+"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 _=p==="top"?-(c.offsetHeight+2):u.offsetHeight+12;c.style.top=y.top+_+v.top+"px";const x=y.left-e.element.wysiwygFrame.scrollLeft+v.left,E=c.offsetWidth,T=u.offsetWidth,N=r.hasClass(c.firstElementChild,"se-arrow")?c.firstElementChild:null;if(s.rtl){const k=E>T?E-T:0,D=k>0?0:T-E;c.style.left=x-k+D+"px",k>0&&N&&(N.style.left=(E-14<10+k?E-14:10+k)+"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 k=e.element.wysiwygFrame.offsetWidth-(c.offsetLeft+E);k<0?(c.style.left=c.offsetLeft+k+"px",N&&(N.style.left=20-k+"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 _=this.getSelection();return _.removeAllRanges&&_.removeAllRanges(),_.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,_=u.focusOffset,x=r.compareElements(p,v),E=x.ancestor&&(x.result===0?y<=_:x.result>1);return this.setRange(E?p:v,E?y:_,E?v:p,E?_: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,_=c.endOffset,x,E,T;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[_]||y.lastChild||y;y&&y.nodeType===1&&y.lastChild;)y=y.lastChild;_=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 k=r.getFormatElement(x,null);k===r.getRangeFormatElement(k,null)&&(k=r.createElement(r.getParentElement(x,r.isCell)?"DIV":s.defaultTag),x.parentNode.insertBefore(k,x),k.appendChild(x))}if(r.isBreak(x)){const k=r.createTextNode(r.zeroWidthSpace);x.parentNode.insertBefore(k,x),x=k,N&&p===y&&(y=x,_=1)}}if(p=x,v=E,x=r.isWysiwygDiv(y)?e.element.wysiwyg.lastChild:y,E=_,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&&(T=x.childNodes,T.length!==0);)x=T[E>0?E-1:E]||!/FIGURE/i.test(T[0].nodeName)?T[0]:x.previousElementSibling||x.previousSibling||p,E=E>0?x.textContent.length:E;let k=r.getFormatElement(x,null);k===r.getRangeFormatElement(k,null)&&(k=r.createElement(r.isCell(k)?"DIV":s.defaultTag),x.parentNode.insertBefore(k,x),k.appendChild(x))}if(r.isBreak(x)){const k=r.createTextNode(r.zeroWidthSpace);x.parentNode.insertBefore(k,x),x=k,E=1,N&&!x.previousSibling&&r.removeItem(y)}}return y=x,_=E,this.setRange(p,v,y,_),!0},getSelectedElements:function(c){if(!this._resetRangeToTextNode())return[];let u=this.getRange();if(r.isWysiwygDiv(u.startContainer)){const R=e.element.wysiwyg.children;if(R.length===0)return[];this.setRange(R[0],0,R[R.length-1],R[R.length-1].textContent.trim().length),u=this.getRange()}const p=u.startContainer,v=u.endContainer,y=u.commonAncestorContainer,_=r.getListChildren(y,function(R){return c?c(R):r.isFormatElement(R)});if(!r.isWysiwygDiv(y)&&!r.isRangeFormatElement(y)&&_.unshift(r.getFormatElement(y,null)),p===v||_.length===1)return _;let x=r.getFormatElement(p,null),E=r.getFormatElement(v,null),T=null,N=null;const k=function(R){return r.isTable(R)?/^TABLE$/i.test(R.nodeName):!0};let D=r.getRangeFormatElement(x,k),M=r.getRangeFormatElement(E,k);r.isTable(D)&&r.isListCell(D.parentNode)&&(D=D.parentNode),r.isTable(M)&&r.isListCell(M.parentNode)&&(M=M.parentNode);const A=D===M;for(let R=0,z=_.length,V;R<z;R++){if(V=_[R],x===V||!A&&V===D){T=R;continue}if(E===V||!A&&V===M){N=R;break}}return T===null&&(T=0),N===null&&(N=_.length-1),_.slice(T,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 _=this.getParentElement(y,this.isComponent);return this.isFormatElement(y)&&(!_||_===p)||this.isComponent(y)&&!this.getFormatElement(y)}).bind(r));if(c){for(let y=0,_=v.length;y<_;y++)for(let x=y-1;x>=0;x--)if(v[x].contains(v[y])){v.splice(y,1),y--,_--;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 _=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 T=r.getParentElement(y.container,(function(N){return this.isRangeFormatElement(N)}).bind(r));_=r.splitElement(y.container,y.offset,T?r.getElementDepth(T)+1:0),_&&(E=_.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 T=this.getFileComponent(c);T?this.selectComponent(T.target,T.pluginName):_&&(_=r.getEdgeChildNodes(_,null).sc||_,this.setRange(_,0,_,0))}return u||this.history.push(1),_||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,_=r.isListCell(u.parentNode);let x,E,T;(_?!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,T=y.offsetWidth/2/2,p.top=x-E-12+"px",p.left=r.getOffset(y).left+T+"px",p.display="block"):p.display="none",(_?!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,T=y.offsetWidth/2/2),v.top=x+y.offsetHeight-E-12+"px",v.left=r.getOffset(y).left+y.offsetWidth-T-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 _=0,x=y.length;_<x;_++)p(y[_])})(c)},_dupleCheck:function(c,u){if(!r.isTextStyleElement(c))return;const p=(c.style.cssText.match(/[^;]+;/g)||[]).map(function(_){return _.trim()}),v=c.nodeName;if(/^span$/i.test(v)&&p.length===0)return c;let y=!1;return function _(x){if(!(r.isWysiwygDiv(x)||!r.isTextStyleElement(x))){if(x.nodeName===v){y=!0;const E=x.style.cssText.match(/[^;]+;/g)||[];for(let T=0,N=E.length,k;T<N;T++)(k=p.indexOf(E[T].trim()))>-1&&p.splice(k,1);for(let T=0,N=x.classList.length;T<N;T++)c.classList.remove(x.classList[T])}_(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(),_=r.isListCell(y.commonAncestorContainer)?y.commonAncestorContainer:r.getFormatElement(this.getSelectionNode(),null),x=r.isListCell(_)&&(r.isListCell(c)||r.isList(c)),E,T,N,k=null;const D=r.isFreeFormatElement(_),M=!D&&(r.isFormatElement(c)||r.isRangeFormatElement(c))||r.isComponent(c);if(x&&(N=u||r.isList(c)?_.lastChild:_.nextElementSibling,k=r.isList(c)?_:(N||_).parentNode),!u&&(M||r.isComponent(c)||r.isMedia(c))){const L=this.isEdgePoint(y.endContainer,y.endOffset,"end"),O=this.removeNode(),j=O.container,P=j===O.prevContainer&&y.collapsed?null:O.prevContainer;if(x&&P)if(k=P.nodeType===3?P.parentNode:P,k.contains(j)){let U=!0;for(N=j;N.parentNode&&N.parentNode!==k;)N=N.parentNode,U=!1;U&&j===P&&(N=N.nextSibling)}else N=null;else if(x&&r.isListCell(j)&&!_.parentElement)_=r.createElement("LI"),k.appendChild(_),j.appendChild(k),N=null;else if(j.nodeType===3||r.isBreak(j)||x){const U=r.getParentElement(j,(function(I){return this.isRangeFormatElement(I)||this.isListCell(I)}).bind(r));if(u=r.splitElement(j,O.offset,U?r.getElementDepth(U)+1:0),!u)r.isListCell(_)||(N=u=_);else if(x){if(_.contains(j)){const I=r.isList(_.lastElementChild);let $=null;L||($=_.cloneNode(!1),$.appendChild(u.textContent.trim()?u:r.createTextNode(r.zeroWidthSpace))),I&&($||($=_.cloneNode(!1),$.appendChild(r.createTextNode(r.zeroWidthSpace))),$.appendChild(_.lastElementChild)),$&&(_.parentNode.insertBefore($,_.nextElementSibling),N=u=$)}}else u=u.previousSibling}}y=!u&&!M?this.getRange_addLine(this.getRange(),null):this.getRange();const A=y.commonAncestorContainer,R=y.startOffset,z=y.endOffset,V=y.startContainer===A&&r.isFormatElement(A),H=V&&(A.childNodes[R]||A.childNodes[0])||y.startContainer,F=V&&(A.childNodes[z]||A.childNodes[A.childNodes.length-1])||y.endContainer;if(!x)if(u)E=u.parentNode,u=u.nextSibling,T=!0;else if(E=H,H.nodeType===3&&(E=H.parentNode),y.collapsed)if(A.nodeType===3)A.textContent.length>z?u=A.splitText(z):u=A.nextSibling;else if(r.isBreak(E))u=E,E=E.parentNode;else{let L=E.childNodes[R];const O=L&&L.nodeType===3&&r.onlyZeroWidthSpace(L)&&r.isBreak(L.nextSibling)?L.nextSibling:L;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(H===F){this.isEdgePoint(F,z)?u=F.nextSibling:u=F.splitText(z);let O=H;this.isEdgePoint(H,R)||(O=H.splitText(R)),E.removeChild(O),E.childNodes.length===0&&M&&(E.innerHTML="<br>")}else{const O=this.removeNode(),j=O.container,P=O.prevContainer;if(j&&j.childNodes.length===0&&M&&(r.isFormatElement(j)?j.innerHTML="<br>":r.isRangeFormatElement(j)&&(j.innerHTML="<"+s.defaultTag+"><br></"+s.defaultTag+">")),r.isListCell(j)&&c.nodeType===3)E=j,u=null;else if(!M&&P)if(E=P.nodeType===3?P.parentNode:P,E.contains(j)){let U=!0;for(u=j;u.parentNode&&u.parentNode!==E;)u=u.parentNode,U=!1;U&&j===P&&(u=u.nextSibling)}else u=null;else r.isWysiwygDiv(j)&&!r.isFormatElement(c)?(E=j.appendChild(r.createElement(s.defaultTag)),u=null):(u=M?F:j===P?j.nextSibling:j,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 L=E;if(r.isList(u))E=u,u=null;else if(r.isListCell(u))E=u.previousElementSibling||u;else if(!T&&!u){const O=this.removeNode(),j=O.container.nodeType===3?r.isListCell(r.getFormatElement(O.container,null))?O.container:r.getFormatElement(O.container,null)||O.container.parentNode:O.container,P=r.isWysiwygDiv(j)||r.isRangeFormatElement(j);E=P?j:j.parentNode,u=P?null:j.nextSibling}L.childNodes.length===0&&E!==L&&r.removeItem(L)}if(M&&!D&&!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 L=r.createElement(s.defaultTag);L.appendChild(c),v=c,c=L}}if(x?k.parentNode?(E=k,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 L=r.createElement("ol");E.insertBefore(L,u),E=L,u=null}x=!0}if(this._checkDuplicateNode(c,E),E.insertBefore(c,u),x)if(r.onlyZeroWidthSpace(_.textContent.trim()))r.removeItem(_),c=c.lastChild;else{const L=r.getArrayItem(_.children,r.isList);L&&(c!==L?(c.appendChild(L),c=L.previousSibling):(E.appendChild(c),c=E),r.onlyZeroWidthSpace(_.textContent.trim())&&r.removeItem(_))}}catch(L){E.appendChild(c),console.warn("[SUNEDITOR.insertNode.warn] "+L)}finally{v&&(c=v);const L=E.querySelectorAll("[data-se-duple]");if(L.length>0)for(let O=0,j=L.length,P,U,I,$;O<j;O++){for(P=L[O],I=P.childNodes,$=P.parentNode;I[0];)U=I[0],$.insertBefore(U,P);P===c&&(c=U),r.removeItem(P)}if((r.isFormatElement(c)||r.isComponent(c))&&H===F){const O=r.getFormatElement(A,null);O&&O.nodeType===1&&r.isEmptyLine(O)&&r.removeItem(O)}if(D&&(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 j=null;(!c.previousSibling||r.isBreak(c.previousSibling))&&(j=r.createTextNode(r.zeroWidthSpace),c.parentNode.insertBefore(j,c)),(!c.nextSibling||r.isBreak(c.nextSibling))&&(j=r.createTextNode(r.zeroWidthSpace),c.parentNode.insertBefore(j,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 j=r.createElement("BR"),P=r.createElement(s.defaultTag);return P.appendChild(j),r.changeElement(O,P),d.setRange(P,0,P,0),this.history.push(!0),{container:P,offset:0,prevContainer:null}}}const u=c.startOffset===0,p=d.isEdgePoint(c.endContainer,c.endOffset,"end");let v=null,y=null,_=null;u&&(y=r.getFormatElement(c.startContainer),y&&(v=y.previousElementSibling,y=v)),p&&(_=r.getFormatElement(c.endContainer),_=_&&_.nextElementSibling);let x,E=0,T=c.startContainer,N=c.endContainer,k=c.startOffset,D=c.endOffset;const M=c.commonAncestorContainer.nodeType===3&&c.commonAncestorContainer.parentNode===T.parentNode?T.parentNode:c.commonAncestorContainer;if(M===T&&M===N&&(T=M.children[k],N=M.children[D],k=D=0),!T||!N)return{container:M,offset:0};if(T===N&&c.collapsed&&T.textContent&&r.onlyZeroWidthSpace(T.textContent.substr(k)))return{container:T,offset:k,prevContainer:T&&T.parentNode?T:null};let A=null,R=null;const z=r.getListChildNodes(M,null);let V=r.getArrayIndex(z,T),H=r.getArrayIndex(z,N);if(z.length>0&&V>-1&&H>-1){for(let O=V+1,j=T;O>=0;O--)z[O]===j.parentNode&&z[O].firstChild===j&&k===0&&(V=O,j=j.parentNode);for(let O=H-1,j=N;O>V;O--)z[O]===j.parentNode&&z[O].nodeType===1&&(z.splice(O,1),j=j.parentNode,--H)}else{if(z.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:D};z.push(M),T=N=M}else if(T=N=z[0],r.isBreak(T)||r.onlyZeroWidthSpace(T))return{container:r.isMedia(M)?M:T,offset:0};V=H=0}for(let O=V;O<=H;O++){const j=z[O];if(j.length===0||j.nodeType===3&&j.data===void 0){this._nodeRemoveListItem(j);continue}if(j===T){if(T.nodeType===1){if(r.isComponent(T))continue;A=r.createTextNode(T.textContent)}else j===N?(A=r.createTextNode(T.substringData(0,k)+N.substringData(D,N.length-D)),E=k):A=r.createTextNode(T.substringData(0,k));if(A.length>0?T.data=A.data:this._nodeRemoveListItem(T),j===N)break;continue}if(j===N){if(N.nodeType===1){if(r.isComponent(N))continue;R=r.createTextNode(N.textContent)}else R=r.createTextNode(N.substringData(D,N.length-D));R.length>0?N.data=R.data:this._nodeRemoveListItem(N);continue}this._nodeRemoveListItem(j)}const F=r.getParentElement(N,"ul"),L=r.getParentElement(T,"li");if(F&&L&&L.contains(F)?(x=F.previousSibling,E=x.textContent.length):(x=N&&N.parentNode?N:T&&T.parentNode?T: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)&&!(T&&T.parentNode)&&(_?(x=_,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 D=0,M=u.length,A,R,z,V,H,F;D<M;D++)if(A=u[D],!!r.isListCell(A)&&(R=A.lastElementChild,R&&r.isListCell(A.nextElementSibling)&&u.indexOf(A.nextElementSibling)>-1&&(V=R.lastElementChild,u.indexOf(V)>-1))){let L=null;for(;L=V.lastElementChild;)if(r.isList(L))if(u.indexOf(L.lastElementChild)>-1)V=L.lastElementChild;else continue e;z=R.firstElementChild,H=u.indexOf(z),F=u.indexOf(V),u.splice(H,F-H+1),M=u.length;continue}let p=u[u.length-1],v,y,_;r.isRangeFormatElement(p)||r.isFormatElement(p)?v=p:v=r.getRangeFormatElement(p,null)||r.getFormatElement(p,null),r.isCell(v)?(y=null,_=v):(y=v.nextSibling,_=v.parentNode);let x=r.getElementDepth(v),E=null;const T=[],N=function(D,M,A){let R=null;if(D!==M&&!r.isTable(M)){if(M&&r.getElementDepth(D)===r.getElementDepth(M))return A;R=r.removeItemAllParents(M,null,D)}return R?R.ec:A};for(let D=0,M=u.length,A,R,z,V,H,F,L;D<M;D++)if(A=u[D],R=A.parentNode,!(!R||c.contains(R)))if(z=r.getElementDepth(A),r.isList(R)){if(E===null&&(F?(E=F,L=!0,F=null):E=R.cloneNode(!1)),T.push(A),H=u[D+1],D===M-1||H&&H.parentNode!==R){H&&A.contains(H.parentNode)&&(F=H.parentNode.cloneNode(!1));let O=R.parentNode,j;for(;r.isList(O);)j=r.createElement(O.nodeName),j.appendChild(E),E=j,O=O.parentNode;const P=this.detachRangeFormatElement(R,T,null,!0,!0);x>=z?(x=z,_=P.cc,y=N(_,R,P.ec),y&&(_=y.parentNode)):_===P.cc&&(y=P.ec),_!==P.cc&&(V=N(_,P.cc,V),V!==void 0?y=V:y=P.cc);for(let U=0,I=P.removeArray.length;U<I;U++)E.appendChild(P.removeArray[U]);L||c.appendChild(E),F&&P.removeArray[P.removeArray.length-1].appendChild(F),E=null,L=!1}}else x>=z&&(x=z,_=R,y=A.nextSibling),c.appendChild(A),_!==R&&(V=N(_,R),V!==void 0&&(y=V));if(this.effectNode=null,r.mergeSameTags(c,null,!1),r.mergeNestedTags(c,(function(D){return this.isList(D)}).bind(r)),y&&r.getElementDepth(y)>0&&(r.isList(y.parentNode)||r.isList(y.parentNode.parentNode))){const D=r.getParentElement(y,(function(A){return this.isRangeFormatElement(A)&&!this.isList(A)}).bind(r)),M=r.splitElement(y,null,D?r.getElementDepth(D)+1:0);M.parentNode.insertBefore(c,M)}else _.insertBefore(c,y),N(c,y);const k=r.getEdgeChildNodes(c.firstElementChild,c.lastElementChild);u.length>1?this.setRange(k.sc,0,k.ec,k.ec.textContent.length):this.setRange(k.ec,k.ec.textContent.length,k.ec,k.ec.textContent.length),this.history.push(!1)},detachRangeFormatElement:function(c,u,p,v,y){const _=this.getRange();let x=_.startOffset,E=_.endOffset,T=r.getListChildNodes(c,function(P){return P.parentNode===c}),N=c.parentNode,k=null,D=null,M=c.cloneNode(!1);const A=[],R=r.isList(p);let z=!1,V=!1,H=!1;function F(P,U,I,$){if(r.onlyZeroWidthSpace(U)&&(U.innerHTML=r.zeroWidthSpace,x=E=1),U.nodeType===3)return P.insertBefore(U,I),U;const Q=(H?U:$).childNodes;let W=U.cloneNode(!1),X=null,q=null;for(;Q[0];)q=Q[0],r._notTextNode(q)&&!r.isBreak(q)&&!r.isListCell(W)?(W.childNodes.length>0&&(X||(X=W),P.insertBefore(W,I),W=U.cloneNode(!1)),P.insertBefore(q,I),X||(X=q)):W.appendChild(q);if(W.childNodes.length>0){if(r.isListCell(P)&&r.isListCell(W)&&r.isList(I))if(R){for(X=I;I;)W.appendChild(I),I=I.nextSibling;P.parentNode.insertBefore(W,P.nextElementSibling)}else{const G=$.nextElementSibling,ee=r.detachNestedList($,!1);if(c!==ee||G!==$.nextElementSibling){const re=W.childNodes;for(;re[0];)$.appendChild(re[0]);c=ee,V=!0}}else P.insertBefore(W,I);X||(X=W)}return X}for(let P=0,U=T.length,I,$,Q;P<U;P++)if(I=T[P],!(I.nodeType===3&&r.isList(M)))if(H=!1,v&&P===0&&(!u||u.length===U||u[0]===I?k=c.previousSibling:k=M),u&&($=u.indexOf(I)),u&&$===-1)M||(M=c.cloneNode(!1)),M.appendChild(I);else{if(u&&(Q=u[$+1]),M&&M.children.length>0&&(N.insertBefore(M,c),M=null),!R&&r.isListCell(I))if(Q&&r.getElementDepth(I)!==r.getElementDepth(Q)&&(r.isListCell(N)||r.getArrayItem(I.children,r.isList,!1))){const W=I.nextElementSibling,X=r.detachNestedList(I,!1);(c!==X||W!==I.nextElementSibling)&&(c=X,V=!0)}else{const W=I;I=r.createElement(v?W.nodeName:r.isList(c.parentNode)||r.isListCell(c.parentNode)?"LI":r.isCell(c.parentNode)?"DIV":s.defaultTag);const X=r.isListCell(I),q=W.childNodes;for(;q[0]&&!(r.isList(q[0])&&!X);)I.appendChild(q[0]);r.copyFormatAttributes(I,W),H=!0}else I=I.cloneNode(!1);if(!V&&(v?(A.push(I),r.removeItem(T[P])):(p?(z||(N.insertBefore(p,c),z=!0),I=F(p,I,null,T[P])):I=F(N,I,c,T[P]),V||(u?(D=I,k||(k=I)):k||(k=D=I))),V)){V=H=!1,T=r.getListChildNodes(c,function(W){return W.parentNode===c}),M=c.cloneNode(!1),N=c.parentNode,P=-1,U=T.length;continue}}const L=c.parentNode;let O=c.nextSibling;M&&M.children.length>0&&L.insertBefore(M,O),p?k=p.previousSibling:k||(k=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 j=null;if(v)j={cc:L,sc:k,so:x,ec:O,eo:E,removeArray:A};else{k||(k=D),D||(D=k);const P=r.getEdgeChildNodes(k,D.parentNode?k:D);j={cc:(P.sc||P.ec).parentNode,sc:P.sc,so:x,ec:P.ec,eo:E,removeArray:null}}if(this.effectNode=null,y)return j;!v&&j&&(u?this.setRange(j.sc,x,j.ec,E):this.setRange(j.sc,0,j.sc,0)),this.history.push(!1)},detachList:function(c,u){let p={},v=!1,y=!1,_=null,x=null;const E=(function(T){return!this.isComponent(T)}).bind(r);for(let T=0,N=c.length,k,D,M,A;T<N;T++){if(M=T===N-1,D=r.getRangeFormatElement(c[T],E),A=r.isList(D),!k&&A)k=D,p={r:k,f:[r.getParentElement(c[T],"LI")]},T===0&&(v=!0);else if(k&&A)if(k!==D){const R=this.detachRangeFormatElement(p.f[0].parentNode,p.f,null,u,!0);D=c[T].parentNode,v&&(_=R.sc,v=!1),M&&(x=R.ec),A?(k=D,p={r:k,f:[r.getParentElement(c[T],"LI")]},M&&(y=!0)):k=null}else p.f.push(r.getParentElement(c[T],"LI")),M&&(y=!0);if(M&&r.isList(k)){const R=this.detachRangeFormatElement(p.f[0].parentNode,p.f,null,u,!0);(y||N===1)&&(x=R.ec),v&&(_=R.sc||x)}}return{sc:_,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 _=!c,x=_&&!p&&!u;let E=y.startContainer,T=y.startOffset,N=y.endContainer,k=y.endOffset;if(x&&y.collapsed&&r.isFormatElement(E.parentNode)||E===N&&E.nodeType===1&&r.isNonEditable(E)){const q=E.parentNode;if(!r.isListCell(q)||!r.getValues(q.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 q=null;const G=E.childNodes[T];G&&(G.nextSibling?q=r.isBreak(G)?G:G.nextSibling:q=null);const ee=r.createTextNode(r.zeroWidthSpace);E.insertBefore(ee,q),this.setRange(ee,1,ee,1),y=this.getRange(),E=y.startContainer,T=y.startOffset,N=y.endContainer,k=y.endOffset}r.isFormatElement(E)&&(E=E.childNodes[T]||E.firstChild,T=0),r.isFormatElement(N)&&(N=N.childNodes[k]||N.lastChild,k=N.textContent.length),_&&(c=r.createElement("DIV"));const D=a.RegExp,M=c.nodeName;if(!x&&E===N&&!p&&c){let q=E,G=0;const ee=[],re=c.style;for(let ie=0,le=re.length;ie<le;ie++)ee.push(re[ie]);const ce=c.classList;for(let ie=0,le=ce.length;ie<le;ie++)ee.push("."+ce[ie]);if(ee.length>0){for(;!r.isFormatElement(q)&&!r.isWysiwygDiv(q);){for(let ie=0;ie<ee.length;ie++)if(q.nodeType===1){const le=ee[ie],we=/^\./.test(le)?new D("\\s*"+le.replace(/^\./,"")+"(\\s+|$)","ig"):!1,Ce=_?!!q.style[le]:!!q.style[le]&&!!c.style[le]&&q.style[le]===c.style[le],be=we===!1?!1:_?!!q.className.match(we):!!q.className.match(we)&&!!c.className.match(we);(Ce||be)&&G++}q=q.parentNode}if(G>=ee.length)return}}let A={},R={},z,V="",H="",F="";if(u){for(let q=0,G=u.length,ee;q<G;q++)ee=u[q],/^\./.test(ee)?H+=(H?"|":"\\s*(?:")+ee.replace(/^\./,""):V+=(V?"|":"(?:;|^|\\s)(?:")+ee;V&&(V+=")\\s*:[^;]*\\s*(?:;|$)",V=new D(V,"ig")),H&&(H+=")(?=\\s+|$)",H=new D(H,"ig"))}if(p){F="^(?:"+p[0];for(let q=1;q<p.length;q++)F+="|"+p[q];F+=")$",F=new D(F,"i")}const L=a.Boolean,O={v:!1},j=function(q){const G=q.cloneNode(!1);if(G.nodeType===3||r.isBreak(G))return G;if(x)return null;const ee=!F&&_||F&&F.test(G.nodeName);if(ee&&!v)return O.v=!0,null;const re=G.style.cssText;let ce="";V&&re.length>0&&(ce=re.replace(V,"").trim(),ce!==re&&(O.v=!0));const ie=G.className;let le="";return H&&ie.length>0&&(le=ie.replace(H,"").trim(),le!==ie&&(O.v=!0)),_&&(H||!ie)&&(V||!re)&&!ce&&!le&&ee?(O.v=!0,null):ce||le||G.nodeName!==M||L(V)!==L(re)||L(H)!==L(ie)?(V&&re.length>0&&(G.style.cssText=ce),G.style.cssText||G.removeAttribute("style"),H&&ie.length>0&&(G.className=le.trim()),G.className.trim()||G.removeAttribute("class"),!G.style.cssText&&!G.className&&(G.nodeName===M||ee)?(O.v=!0,null):G):(O.v=!0,null)},P=this.getSelectedElements(null);y=this.getRange(),E=y.startContainer,T=y.startOffset,N=y.endContainer,k=y.endOffset,r.getFormatElement(E,null)||(E=r.getChildElement(P[0],function(q){return q.nodeType===3},!1),T=0),r.getFormatElement(N,null)||(N=r.getChildElement(P[P.length-1],function(q){return q.nodeType===3},!1),k=N.textContent.length);const U=r.getFormatElement(E,null)===r.getFormatElement(N,null),I=P.length-(U?0:1);z=c.cloneNode(!1);const $=x||_&&function(q){for(let G=0,ee=q.length;G<ee;G++)if(r._isMaintainedNode(q[G])||r._isSizeNode(q[G]))return!0;return!1}(p),Q=_||r._isSizeNode(z),W=this._util_getMaintainedNode.bind(r,$,Q),X=this._util_isMaintainedNode.bind(r,$,Q);if(U){this._resetCommonListCell(P[0],u)&&(y=this.setRange(E,T,N,k));const q=this._nodeChange_oneLine(P[0],z,j,E,T,N,k,x,_,y.collapsed,O,W,X);A.container=q.startContainer,A.offset=q.startOffset,R.container=q.endContainer,R.offset=q.endOffset,A.container===R.container&&r.onlyZeroWidthSpace(A.container)&&(A.offset=R.offset=1),this._setCommonListStyle(q.ancestor,null)}else{let q=!1;I>0&&this._resetCommonListCell(P[I],u)&&(q=!0),this._resetCommonListCell(P[0],u)&&(q=!0),q&&this.setRange(E,T,N,k),I>0&&(z=c.cloneNode(!1),R=this._nodeChange_endLine(P[I],z,j,N,k,x,_,O,W,X));for(let G=I-1,ee;G>0;G--)this._resetCommonListCell(P[G],u),z=c.cloneNode(!1),ee=this._nodeChange_middleLine(P[G],z,j,x,_,O,R.container),ee.endContainer&&ee.ancestor.contains(ee.endContainer)&&(R.ancestor=null,R.container=ee.endContainer),this._setCommonListStyle(ee.ancestor,null);z=c.cloneNode(!1),A=this._nodeChange_startLine(P[0],z,j,E,T,x,_,O,W,X,R.container),A.endContainer&&(R.ancestor=null,R.container=A.endContainer),I<=0?R=A:R.container||(R.ancestor=null,R.container=A.container,R.offset=A.container.textContent.length),this._setCommonListStyle(A.ancestor,null),this._setCommonListStyle(R.ancestor||r.getFormatElement(R.container),null)}this.controllersOff(),this.setRange(A.container,A.offset,R.container,R.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(D){return!r.isBreak(D)},!0),v=c.style,y=[],_=[],x=r.getValues(v);for(let D=0,M=this._listKebab.length;D<M;D++)x.indexOf(this._listKebab[D])>-1&&u.indexOf(this._listKebab[D])>-1&&(y.push(this._listCamel[D]),_.push(this._listKebab[D]));if(!y.length)return;const E=r.createElement("SPAN");for(let D=0,M=y.length;D<M;D++)E.style[y[D]]=v[_[D]],v.removeProperty(_[D]);let T=E.cloneNode(!1),N=null,k=!1;for(let D=0,M=p.length,A,R;D<M;D++)A=p[D],!s._textTagsMap[A.nodeName.toLowerCase()]&&(R=r.getValues(A.style),R.length===0||y.some(function(z){return R.indexOf(z)===-1})&&R.some(function(z){})?(N=A.nextSibling,T.appendChild(A)):T.childNodes.length>0&&(c.insertBefore(T,N),T=E.cloneNode(!1),N=null,k=!0));return T.childNodes.length>0&&(c.insertBefore(T,N),k=!0),v.length||c.removeAttribute("style"),k},_setCommonListStyle:function(c,u){if(!r.isListCell(c))return;const p=r.getArrayItem((u||c).childNodes,function(T){return!r.isBreak(T)},!0);if(u=p[0],!u||p.length>1||u.nodeType!==1)return;const v=u.style,y=c.style,_=u.nodeName.toLowerCase();let x=!1;s._textTagsMap[_]===s._defaultCommand.bold.toLowerCase()&&(y.fontWeight="bold"),s._textTagsMap[_]===s._defaultCommand.italic.toLowerCase()&&(y.fontStyle="italic");const E=r.getValues(v);if(E.length>0)for(let T=0,N=this._listCamel.length;T<N;T++)E.indexOf(this._listKebab[T])>-1&&(y[this._listCamel[T]]=v[this._listCamel[T]],v.removeProperty(this._listKebab[T]),x=!0);if(this._setCommonListStyle(c,u),!!x&&!v.length){const T=u.childNodes,N=u.parentNode,k=u.nextSibling;for(;T.length>0;)N.insertBefore(T[0],k);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,_,x,E,T,N,k,D,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(!T&&A===_.parentNode&&A.nodeName===u.nodeName&&r.onlyZeroWidthSpace(v.textContent.slice(0,y))&&r.onlyZeroWidthSpace(_.textContent.slice(x))){const be=A.childNodes;let Ne=!0;for(let B=0,Y=be.length,Z,se,ne,te;B<Y;B++){if(Z=be[B],te=!r.onlyZeroWidthSpace(Z),Z===v){se=!0;continue}if(Z===_){ne=!0;continue}if(!se&&te||se&&ne&&te){Ne=!1;break}}if(Ne)return r.copyTagAttributes(A,u),{ancestor:c,startContainer:v,startOffset:y,endContainer:_,endOffset:x}}k.v=!1;const R=c,z=[u],V=c.cloneNode(!1),H=v===_;let F=v,L=y,O=_,j=x,P=!1,U=!1,I,$,Q,W,X;const q=a.RegExp;function G(be){const Ne=new q("(?:;|^|\\s)(?:"+W+"null)\\s*:[^;]*\\s*(?:;|$)","ig");let B="";return Ne&&be.style.cssText.length>0&&(B=Ne.test(be.style.cssText)),!B}if(function be(Ne,B){const Y=Ne.childNodes;for(let Z=0,se=Y.length,ne;Z<se;Z++){let te=Y[Z];if(!te)continue;let ae=B,ge;if(!P&&te===F){let pe=V;X=D(te);const xe=r.createTextNode(F.nodeType===1?"":F.substringData(0,L)),De=r.createTextNode(F.nodeType===1?"":F.substringData(L,H&&j>=L?j-L:F.data.length-L));if(X){const Fe=D(B);if(Fe&&Fe.parentNode!==pe){let Pe=Fe,He=null;for(;Pe.parentNode!==pe;){for(B=He=Pe.parentNode.cloneNode(!1);Pe.childNodes[0];)He.appendChild(Pe.childNodes[0]);Pe.appendChild(He),Pe=Pe.parentNode}Pe.parentNode.appendChild(Fe)}X=X.cloneNode(!1)}r.onlyZeroWidthSpace(xe)||B.appendChild(xe);const ke=D(B);for(ke&&(X=ke),X&&(pe=X),$=te,I=[],W="";$!==pe&&$!==R&&$!==null;)ne=M($)?null:p($),ne&&$.nodeType===1&&G($)&&(I.push(ne),W+=$.style.cssText.substr(0,$.style.cssText.indexOf(":"))+"|"),$=$.parentNode;const Xe=I.pop()||De;for(Q=$=Xe;I.length>0;)$=I.pop(),Q.appendChild($),Q=$;if(u.appendChild(Xe),pe.appendChild(u),X&&!D(O)&&(u=u.cloneNode(!1),V.appendChild(u),z.push(u)),F=De,L=0,P=!0,$!==De&&$.appendChild(F),!H)continue}if(!U&&te===O){X=D(te);const pe=r.createTextNode(O.nodeType===1?"":O.substringData(j,O.length-j)),xe=r.createTextNode(H||O.nodeType===1?"":O.substringData(0,j));if(X?X=X.cloneNode(!1):M(u.parentNode)&&!X&&(u=u.cloneNode(!1),V.appendChild(u),z.push(u)),!r.onlyZeroWidthSpace(pe)){$=te,W="",I=[];const ke=[];for(;$!==V&&$!==R&&$!==null;)$.nodeType===1&&G($)&&(M($)?ke.push($.cloneNode(!1)):I.push($.cloneNode(!1)),W+=$.style.cssText.substr(0,$.style.cssText.indexOf(":"))+"|"),$=$.parentNode;for(I=I.concat(ke),ge=Q=$=I.pop()||pe;I.length>0;)$=I.pop(),Q.appendChild($),Q=$;V.appendChild(ge),$.textContent=pe.data}if(X&&ge){const ke=D(ge);ke&&(X=ke)}for($=te,I=[],W="";$!==V&&$!==R&&$!==null;)ne=M($)?null:p($),ne&&$.nodeType===1&&G($)&&(I.push(ne),W+=$.style.cssText.substr(0,$.style.cssText.indexOf(":"))+"|"),$=$.parentNode;const De=I.pop()||xe;for(Q=$=De;I.length>0;)$=I.pop(),Q.appendChild($),Q=$;X?(u=u.cloneNode(!1),u.appendChild(De),X.insertBefore(u,X.firstChild),V.appendChild(X),z.push(u),X=null):u.appendChild(De),O=xe,j=xe.data.length,U=!0,!E&&N&&(u=xe,xe.textContent=r.zeroWidthSpace),$!==xe&&$.appendChild(O);continue}if(P){if(te.nodeType===1&&!r.isBreak(te)){r._isIgnoreNodeChange(te)?(V.appendChild(te.cloneNode(!0)),N||(u=u.cloneNode(!1),V.appendChild(u),z.push(u))):be(te,te);continue}$=te,I=[],W="";const pe=[];for(;$.parentNode!==null&&$!==R&&$!==u;)ne=U?$.cloneNode(!1):p($),$.nodeType===1&&!r.isBreak(te)&&ne&&G($)&&(M($)?X||pe.push(ne):I.push(ne),W+=$.style.cssText.substr(0,$.style.cssText.indexOf(":"))+"|"),$=$.parentNode;I=I.concat(pe);const xe=I.pop()||te;for(Q=$=xe;I.length>0;)$=I.pop(),Q.appendChild($),Q=$;if(M(u.parentNode)&&!M(xe)&&!r.onlyZeroWidthSpace(u)&&(u=u.cloneNode(!1),V.appendChild(u),z.push(u)),!U&&!X&&M(xe)){u=u.cloneNode(!1);const De=xe.childNodes;for(let ke=0,Xe=De.length;ke<Xe;ke++)u.appendChild(De[ke]);xe.appendChild(u),V.appendChild(xe),z.push(u),u.children.length>0?B=$:B=u}else xe===te?U?B=V:B=u:U?(V.appendChild(xe),B=$):(u.appendChild(xe),B=$);if(X&&te.nodeType===3)if(D(te)){const De=r.getParentElement(B,(function(ke){return this._isMaintainedNode(ke.parentNode)||ke.parentNode===V}).bind(r));X.appendChild(De),u=De.cloneNode(!1),z.push(u),V.appendChild(u)}else X=null}ge=te.cloneNode(!1),B.appendChild(ge),te.nodeType===1&&!r.isBreak(te)&&(ae=ge),be(te,ae)}}(c,V),T&&!E&&!k.v)return{ancestor:c,startContainer:v,startOffset:y,endContainer:_,endOffset:x};if(E=E&&T,E)for(let be=0;be<z.length;be++){let Ne=z[be],B,Y,Z;if(N)B=r.createTextNode(r.zeroWidthSpace),V.replaceChild(B,Ne);else{const se=Ne.childNodes;for(Y=se[0];se[0];)Z=se[0],V.insertBefore(Z,Ne);r.removeItem(Ne)}be===0&&(N?F=O=B:(F=Y,O=Z))}else{if(T)for(let be=0;be<z.length;be++)this._stripRemoveNode(z[be]);N&&(F=O=u)}r.removeEmptyNode(V,u,!1),N&&(L=F.textContent.length,j=O.textContent.length);const ee=E||O.textContent.length===0;!r.isBreak(O)&&O.textContent.length===0&&(r.removeItem(O),O=F),j=ee?O.textContent.length:j;const re={s:0,e:0},ce=r.getNodePath(F,V,re),ie=!O.parentNode;ie&&(O=F);const le={s:0,e:0},we=r.getNodePath(O,V,!ie&&!ee?le:null);L+=re.s,j=N?L:ie?F.textContent.length:ee?j+re.s:j+le.s;const Ce=r.mergeSameTags(V,[ce,we],!0);return c.parentNode.replaceChild(V,c),F=r.getNodeFromPath(ce,V),O=r.getNodeFromPath(we,V),{ancestor:V,startContainer:F,startOffset:L+Ce[0],endContainer:O,endOffset:j+Ce[1]}},_nodeChange_startLine:function(c,u,p,v,y,_,x,E,T,N,k){let D=v.parentNode;for(;!D.nextSibling&&!D.previousSibling&&!r.isFormatElement(D.parentNode)&&!r.isWysiwygDiv(D.parentNode)&&D.nodeName!==u.nodeName;)D=D.parentNode;if(!x&&D.nodeName===u.nodeName&&!r.isFormatElement(D)&&!D.nextSibling&&r.onlyZeroWidthSpace(v.textContent.slice(0,y))){let P=!0,U=v.previousSibling;for(;U;){if(!r.onlyZeroWidthSpace(U)){P=!1;break}U=U.previousSibling}if(P)return r.copyTagAttributes(D,u),{ancestor:c,container:v,offset:y}}E.v=!1;const M=c,A=[u],R=c.cloneNode(!1);let z=v,V=y,H=!1,F,L,O,j;if(function P(U,I){const $=U.childNodes;for(let Q=0,W=$.length,X,q;Q<W;Q++){const G=$[Q];if(!G)continue;let ee=I;if(H&&!r.isBreak(G)){if(G.nodeType===1){if(r._isIgnoreNodeChange(G)){if(u=u.cloneNode(!1),q=G.cloneNode(!0),R.appendChild(q),R.appendChild(u),A.push(u),k&&G.contains(k)){const le=r.getNodePath(k,G);k=r.getNodeFromPath(le,q)}}else P(G,G);continue}L=G,F=[];const re=[];for(;L.parentNode!==null&&L!==M&&L!==u;)X=p(L),L.nodeType===1&&X&&(N(L)?j||re.push(X):F.push(X)),L=L.parentNode;F=F.concat(re);const ce=F.length>0,ie=F.pop()||G;for(O=L=ie;F.length>0;)L=F.pop(),O.appendChild(L),O=L;if(N(u.parentNode)&&!N(ie)&&(u=u.cloneNode(!1),R.appendChild(u),A.push(u)),!j&&N(ie)){u=u.cloneNode(!1);const le=ie.childNodes;for(let we=0,Ce=le.length;we<Ce;we++)u.appendChild(le[we]);ie.appendChild(u),R.appendChild(ie),I=N(L)?u:L,A.push(u)}else ce?(u.appendChild(ie),I=L):I=u;if(j&&G.nodeType===3)if(T(G)){const le=r.getParentElement(I,(function(we){return this._isMaintainedNode(we.parentNode)||we.parentNode===R}).bind(r));j.appendChild(le),u=le.cloneNode(!1),A.push(u),R.appendChild(u)}else j=null}if(!H&&G===z){let re=R;j=T(G);const ce=r.createTextNode(z.nodeType===1?"":z.substringData(0,V)),ie=r.createTextNode(z.nodeType===1?"":z.substringData(V,z.length-V));if(j){const Ce=T(I);if(Ce&&Ce.parentNode!==re){let be=Ce,Ne=null;for(;be.parentNode!==re;){for(I=Ne=be.parentNode.cloneNode(!1);be.childNodes[0];)Ne.appendChild(be.childNodes[0]);be.appendChild(Ne),be=be.parentNode}be.parentNode.appendChild(Ce)}j=j.cloneNode(!1)}r.onlyZeroWidthSpace(ce)||I.appendChild(ce);const le=T(I);for(le&&(j=le),j&&(re=j),L=I,F=[];L!==re&&L!==null;)X=p(L),L.nodeType===1&&X&&F.push(X),L=L.parentNode;const we=F.pop()||I;for(O=L=we;F.length>0;)L=F.pop(),O.appendChild(L),O=L;we!==I?(u.appendChild(we),I=L):I=u,r.isBreak(G)&&u.appendChild(G.cloneNode(!1)),re.appendChild(u),z=ie,V=0,H=!0,I.appendChild(z);continue}X=H?p(G):G.cloneNode(!1),X&&(I.appendChild(X),G.nodeType===1&&!r.isBreak(G)&&(ee=X)),P(G,ee)}}(c,R),x&&!_&&!E.v)return{ancestor:c,container:v,offset:y,endContainer:k};if(_=_&&x,_)for(let P=0;P<A.length;P++){let U=A[P];const I=U.childNodes,$=I[0];for(;I[0];)R.insertBefore(I[0],U);r.removeItem(U),P===0&&(z=$)}else if(x){u=u.firstChild;for(let P=0;P<A.length;P++)this._stripRemoveNode(A[P])}if(!_&&R.childNodes.length===0)c.childNodes?z=c.childNodes[0]:(z=r.createTextNode(r.zeroWidthSpace),c.appendChild(z));else{r.removeEmptyNode(R,u,!1),r.onlyZeroWidthSpace(R.textContent)&&(z=R.firstChild,V=0);const P={s:0,e:0},U=r.getNodePath(z,R,P);V+=P.s;const I=r.mergeSameTags(R,[U],!0);c.parentNode.replaceChild(R,c),z=r.getNodeFromPath(U,R),V+=I[0]}return{ancestor:R,container:z,offset:V,endContainer:k}},_nodeChange_middleLine:function(c,u,p,v,y,_,x){if(!y){let k=null;x&&c.contains(x)&&(k=r.getNodePath(x,c));const D=c.cloneNode(!0),M=u.nodeName,A=u.style.cssText,R=u.className;let z=D.childNodes,V=0,H=z.length;for(let F;V<H&&(F=z[V],F.nodeType!==3);V++)if(F.nodeName===M)F.style.cssText+=A,r.addClass(F,R);else{if(!r.isBreak(F)&&r._isIgnoreNodeChange(F))continue;if(H===1){z=F.childNodes,H=z.length,V=-1;continue}else break}if(H>0&&V===H)return c.innerHTML=D.innerHTML,{ancestor:c,endContainer:k?r.getNodeFromPath(k,c):null}}_.v=!1;const E=c.cloneNode(!1),T=[u];let N=!0;if(function k(D,M){const A=D.childNodes;for(let R=0,z=A.length,V,H;R<z;R++){let F=A[R];if(!F)continue;let L=M;if(!r.isBreak(F)&&r._isIgnoreNodeChange(F)){if(u.childNodes.length>0&&(E.appendChild(u),u=u.cloneNode(!1)),H=F.cloneNode(!0),E.appendChild(H),E.appendChild(u),T.push(u),M=u,x&&F.contains(x)){const O=r.getNodePath(x,F);x=r.getNodeFromPath(O,H)}continue}else V=p(F),V&&(N=!1,M.appendChild(V),F.nodeType===1&&(L=V));r.isBreak(F)||k(F,L)}}(c,u),N||y&&!v&&!_.v)return{ancestor:c,endContainer:x};if(E.appendChild(u),v&&y)for(let k=0;k<T.length;k++){let D=T[k];const M=D.childNodes;for(;M[0];)E.insertBefore(M[0],D);r.removeItem(D)}else if(y){u=u.firstChild;for(let k=0;k<T.length;k++)this._stripRemoveNode(T[k])}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,_,x,E,T,N){let k=v.parentNode;for(;!k.nextSibling&&!k.previousSibling&&!r.isFormatElement(k.parentNode)&&!r.isWysiwygDiv(k.parentNode)&&k.nodeName!==u.nodeName;)k=k.parentNode;if(!x&&k.nodeName===u.nodeName&&!r.isFormatElement(k)&&!k.previousSibling&&r.onlyZeroWidthSpace(v.textContent.slice(y))){let j=!0,P=v.nextSibling;for(;P;){if(!r.onlyZeroWidthSpace(P)){j=!1;break}P=P.nextSibling}if(j)return r.copyTagAttributes(k,u),{ancestor:c,container:v,offset:y}}E.v=!1;const D=c,M=[u],A=c.cloneNode(!1);let R=v,z=y,V=!1,H,F,L,O;if(function j(P,U){const I=P.childNodes;for(let $=I.length-1,Q;0<=$;$--){const W=I[$];if(!W)continue;let X=U;if(V&&!r.isBreak(W)){if(W.nodeType===1){if(r._isIgnoreNodeChange(W)){u=u.cloneNode(!1);const re=W.cloneNode(!0);A.insertBefore(re,U),A.insertBefore(u,re),M.push(u)}else j(W,W);continue}F=W,H=[];const q=[];for(;F.parentNode!==null&&F!==D&&F!==u;)Q=p(F),Q&&F.nodeType===1&&(N(F)?O||q.push(Q):H.push(Q)),F=F.parentNode;H=H.concat(q);const G=H.length>0,ee=H.pop()||W;for(L=F=ee;H.length>0;)F=H.pop(),L.appendChild(F),L=F;if(N(u.parentNode)&&!N(ee)&&(u=u.cloneNode(!1),A.insertBefore(u,A.firstChild),M.push(u)),!O&&N(ee)){u=u.cloneNode(!1);const re=ee.childNodes;for(let ce=0,ie=re.length;ce<ie;ce++)u.appendChild(re[ce]);ee.appendChild(u),A.insertBefore(ee,A.firstChild),M.push(u),u.children.length>0?U=F:U=u}else G?(u.insertBefore(ee,u.firstChild),U=F):U=u;if(O&&W.nodeType===3)if(T(W)){const re=r.getParentElement(U,(function(ce){return this._isMaintainedNode(ce.parentNode)||ce.parentNode===A}).bind(r));O.appendChild(re),u=re.cloneNode(!1),M.push(u),A.insertBefore(u,A.firstChild)}else O=null}if(!V&&W===R){O=T(W);const q=r.createTextNode(R.nodeType===1?"":R.substringData(z,R.length-z)),G=r.createTextNode(R.nodeType===1?"":R.substringData(0,z));if(O){O=O.cloneNode(!1);const re=T(U);if(re&&re.parentNode!==A){let ce=re,ie=null;for(;ce.parentNode!==A;){for(U=ie=ce.parentNode.cloneNode(!1);ce.childNodes[0];)ie.appendChild(ce.childNodes[0]);ce.appendChild(ie),ce=ce.parentNode}ce.parentNode.insertBefore(re,ce.parentNode.firstChild)}O=O.cloneNode(!1)}else N(u.parentNode)&&!O&&(u=u.cloneNode(!1),A.appendChild(u),M.push(u));for(r.onlyZeroWidthSpace(q)||U.insertBefore(q,U.firstChild),F=U,H=[];F!==A&&F!==null;)Q=N(F)?null:p(F),Q&&F.nodeType===1&&H.push(Q),F=F.parentNode;const ee=H.pop()||U;for(L=F=ee;H.length>0;)F=H.pop(),L.appendChild(F),L=F;ee!==U?(u.insertBefore(ee,u.firstChild),U=F):U=u,r.isBreak(W)&&u.appendChild(W.cloneNode(!1)),O?(O.insertBefore(u,O.firstChild),A.insertBefore(O,A.firstChild),O=null):A.insertBefore(u,A.firstChild),R=G,z=G.data.length,V=!0,U.insertBefore(R,U.firstChild);continue}Q=V?p(W):W.cloneNode(!1),Q&&(U.insertBefore(Q,U.firstChild),W.nodeType===1&&!r.isBreak(W)&&(X=Q)),j(W,X)}}(c,A),x&&!_&&!E.v)return{ancestor:c,container:v,offset:y};if(_=_&&x,_)for(let j=0;j<M.length;j++){let P=M[j];const U=P.childNodes;let I=null;for(;U[0];)I=U[0],A.insertBefore(I,P);r.removeItem(P),j===M.length-1&&(R=I,z=I.textContent.length)}else if(x){u=u.firstChild;for(let j=0;j<M.length;j++)this._stripRemoveNode(M[j])}if(!_&&A.childNodes.length===0)c.childNodes?R=c.childNodes[0]:(R=r.createTextNode(r.zeroWidthSpace),c.appendChild(R));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)?(R=A.firstChild,z=R.textContent.length):r.onlyZeroWidthSpace(R)&&(R=u,z=1);const j={s:0,e:0},P=r.getNodePath(R,A,j);z+=j.s;const U=r.mergeSameTags(A,[P],!0);c.parentNode.replaceChild(A,c),R=r.getNodeFromPath(P,A),z+=U[0]}return{ancestor:A,container:R,offset:R.nodeType===1&&z===1?R.childNodes.length:z}},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(T){return T.childNodes.length===0||T.nodeType===3},!1)||p.firstChild,y=r.getChildElement(p.lastChild,function(T){return T.childNodes.length===0||T.nodeType===3},!0)||p.lastChild;if(!v||!y)return;if(r.isMedia(v)){const T=this.getFileComponent(v),N=r.createElement("BR"),k=r.createElement(s.defaultTag);k.appendChild(N),v=T?T.component:v,v.parentNode.insertBefore(k,v),v=N}if(r.isMedia(y)){const T=r.createElement("BR"),N=r.createElement(s.defaultTag);N.appendChild(T),p.appendChild(N),y=T}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 _=this._variable.currentNodesMap,x=_.indexOf(u)>-1?null:r.createElement(u);let E=u;/^SUB$/i.test(u)&&_.indexOf("SUP")>-1?E="SUP":/^SUP$/i.test(u)&&_.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",_=s.rtl?"marginRight":"marginLeft";let x=u.startContainer,E=u.endContainer,T=u.startOffset,N=u.endOffset;for(let k=0,D=p.length,M,A;k<D;k++)M=p[k],!r.isListCell(M)||!this.plugins.list?(A=/\d+/.test(M.style[_])?r.getNumber(M.style[_],0):0,y?A-=25:A+=25,r.setStyle(M,_,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,T,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 _=0,x=y.length;_<x;_++)/^script$/i.test(y[_].tagName)&&(u.head.removeChild(y[_]),_--,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,_=v.length;y<_;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 _=0;_<y.length;_++)r.addClass(this._wd.body,s._editableClass[_])}}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>
|
|
244
|
+
</style>`:"")}},no={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,C=d.placeholder;let w=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 _=n.createElement("DIV");_.className+="se-line-breaker-component";const x=_.cloneNode(!0);_.innerHTML=x.innerHTML=t.icons.line_break;const E=n.createElement("DIV");E.className="se-resizing-back";const T=n.createElement("INPUT");T.tabIndex=-1,T.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 k=t.resizingBarContainer;return S&&k&&k.appendChild(S),f.appendChild(w),C&&f.appendChild(C),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(_),s.appendChild(x),s.appendChild(T),S&&!k&&s.appendChild(S),i.appendChild(s),w=this._checkCodeMirror(t,w),{constructed:{_top:i,_relative:s,_toolBar:o.element,_toolbarShadow:l,_menuTray:o._menuTray,_editorArea:f,_wysiwygArea:b,_codeArea:w,_placeholder:C,_resizingBar:S,_navigation:c,_charWrapper:u,_charCounter:p,_loading:v,_lineBreaker:y,_lineBreaker_t:_,_lineBreaker_b:x,_resizeBack:E,_stickyDummy:r,_arrow:a,_focusTemp:T},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)me.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)me.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,C=d.placeholder;let w=d.codeView;return i.resizingBar&&me.removeItem(i.resizingBar),h.resizingBar&&(e.resizingBarContainer&&e.resizingBarContainer!==n.resizingBarContainer?e.resizingBarContainer.appendChild(h.resizingBar):s.appendChild(h.resizingBar)),o.innerHTML="",o.appendChild(w),C&&o.appendChild(C),w=this._checkCodeMirror(e,w),i.resizingBar=h.resizingBar,i.navigation=h.navigation,i.charWrapper=h.charWrapper,i.charCounter=h.charCounter,i.wysiwygFrame=b,i.code=w,i.placeholder=C,e.rtl?me.addClass(i.topArea,"se-rtl"):me.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||qS,t.value=typeof t.value=="string"?t.value:null,t.allowedClassNames=new me._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?me.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)?me.getNumber(t.stickyToolbar,0):-1,t.hideToolbar=!!t.hideToolbar,t.fullScreenOffset=t.fullScreenOffset===void 0?0:/^\d+/.test(t.fullScreenOffset)?me.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=me.isNumber(t.maxCharCount)&&t.maxCharCount>-1?t.maxCharCount*1:null,t.width=t.width?me.isNumber(t.width)?t.width+"px":t.width:e.clientWidth?e.clientWidth+"px":"100%",t.minWidth=(me.isNumber(t.minWidth)?t.minWidth+"px":t.minWidth)||"",t.maxWidth=(me.isNumber(t.maxWidth)?t.maxWidth+"px":t.maxWidth)||"",t.height=t.height?me.isNumber(t.height)?t.height+"px":t.height:e.clientHeight?e.clientHeight+"px":"auto",t.minHeight=(me.isNumber(t.minHeight)?t.minHeight+"px":t.minHeight)||"",t.maxHeight=(me.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?me.isNumber(t.imageWidth)?t.imageWidth+"px":t.imageWidth:"auto",t.imageHeight=t.imageHeight?me.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)?me.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||!me.getNumber(t.videoWidth,0)?"":me.isNumber(t.videoWidth)?t.videoWidth+"px":t.videoWidth,t.videoHeight=!t.videoHeight||!me.getNumber(t.videoHeight,0)?"":me.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=me.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)?me.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?me.isNumber(t.audioWidth)?t.audioWidth+"px":t.audioWidth:"",t.audioHeight=t.audioHeight?me.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)?me.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"?Ja:[Ja,t.icons].reduce(function(o,l){for(let a in l)me.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)me.hasOwn(l,a)&&(o[a]=l[a]);return o},{}):t.icons,t.__listCommonStyle=t.__listCommonStyle||["fontSize","color","fontFamily","fontWeight","fontStyle"],t._editorStyles=me._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=me.isOSX_IOS?"⌘":"CTRL",s=me.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=me.createElement("DIV");e.className="se-btn-module se-btn-module-border";const t=me.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=me.createElement("LI"),r=me.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,C=null,w=null,S="",c=!1;const u=me.createElement("DIV");u.className="se-toolbar-more-layer";e:for(let y=0,_,x,E,T,N;y<t.length;y++)if(_=!1,N="",T=t[y],C=this._createModuleGroup(),typeof T=="object"){for(let k=0,D;k<T.length;k++){if(b=T[k],D=!1,/^\%\d+/.test(b)&&k===0){T[0]=b.replace(/[^\d]/g,""),d.push(T),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),C.div.className+=" module-float-"+N;continue}if(/^\#/.test(b)){b.substr(1)==="fix"&&(C.ul.className+=" se-menu-dir-fix");continue}if(/^\:/.test(b)){D=!0;const M=b.match(/^\:([^\-]+)\-([^\-]+)\-([^\-]+)/);E="__se__"+M[1].trim();const A=M[2].trim(),R=M[3].trim();h=["se-btn-more",A,E,"MORE",R]}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]}}w=this._createButton(h[0],h[1],h[2],h[3],h[4],h[5],a),(_?x:C.ul).appendChild(w.li),n[S]&&(f[S]=w.button),D&&(_=!0,x=me.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 k=s.cloneNode(!1);l.appendChild(k)}l.appendChild(C.div),c=!0}else if(/^\/$/.test(T)){const k=e.createElement("DIV");k.className="se-btn-module-enter",l.appendChild(k),c=!1}switch(l.children.length){case 0:l.style.display="none";break;case 1:me.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}}},io=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 ZS(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 C=d[f];o.wysiwyg.innerHTML=C.contents,e.setRange(i.getNodeFromPath(C.s.path,o.wysiwyg),C.s.offset,i.getNodeFromPath(C.e.path,o.wysiwyg),C.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 C=o.wysiwyg.innerHTML;if(!C||d[f]&&C===d[f].contents)return;f++;const w=e._variable._range;d.length>f&&(d=d.slice(0,f),a&&a.setAttribute("disabled",!0)),w?d[f]={contents:C,s:{path:i.getNodePath(w.startContainer,null,null),offset:w.startOffset},e:{path:i.getNodePath(w.endContainer,null,null),offset:w.endOffset}}:d[f]={contents:C,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(C){n.setTimeout(e._resourcesStateChange.bind(e));const w=typeof C=="number"?C>0?C:0:C?s:0;if((!w||r)&&(n.clearTimeout(r),!w)){b();return}r=n.setTimeout(function(){n.clearTimeout(r),r=null,b()},w)},undo:function(){f>0&&(f--,h())},redo:function(){d.length-1>f&&(f++,h())},go:function(C){f=C<0?d.length-1:C,h()},getCurrentIndex:function(){return f},reset:function(C){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}},C||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 ec={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 GS(e,t,n,i,s,o){const l=e.element.originElement.ownerDocument||document,a=l.defaultView||window,r=me,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:ec,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),_=u.offsetWidth,x=c.parentElement.offsetLeft+3;if(s.rtl){const R=c.offsetWidth,z=_>R?_-R:0,V=z>0?0:R-_;u.style.left=x-z+V+"px",y.left>h._getEditorOffsets(u).left&&(u.style.left="0px")}else{const R=v<=_?0:v-(x+_);R<0?u.style.left=x+R+"px":u.style.left=x+"px"}let E=0,T=c;for(;T&&T!==p;)E+=T.offsetTop,T=T.offsetParent;const N=E;this._isBalloon?E+=p.offsetTop+c.offsetHeight:E-=c.offsetHeight;const k=y.top,D=u.offsetHeight,M=this.getGlobalScrollOffset().top,A=a.innerHeight-(k-M+N+c.parentElement.offsetHeight);if(A<D){let R=-1*(D-N+3);const z=k-M+R,V=D+(z<0?z:0);V>A?(u.style.height=V+"px",R=-1*(V-N+3)):(u.style.height=A+"px",R=N+c.parentElement.offsetHeight),u.style.top=R+"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 _=p==="top"?-(c.offsetHeight+2):u.offsetHeight+12;c.style.top=y.top+_+v.top+"px";const x=y.left-e.element.wysiwygFrame.scrollLeft+v.left,E=c.offsetWidth,T=u.offsetWidth,N=r.hasClass(c.firstElementChild,"se-arrow")?c.firstElementChild:null;if(s.rtl){const k=E>T?E-T:0,D=k>0?0:T-E;c.style.left=x-k+D+"px",k>0&&N&&(N.style.left=(E-14<10+k?E-14:10+k)+"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 k=e.element.wysiwygFrame.offsetWidth-(c.offsetLeft+E);k<0?(c.style.left=c.offsetLeft+k+"px",N&&(N.style.left=20-k+"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 _=this.getSelection();return _.removeAllRanges&&_.removeAllRanges(),_.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,_=u.focusOffset,x=r.compareElements(p,v),E=x.ancestor&&(x.result===0?y<=_:x.result>1);return this.setRange(E?p:v,E?y:_,E?v:p,E?_: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,_=c.endOffset,x,E,T;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[_]||y.lastChild||y;y&&y.nodeType===1&&y.lastChild;)y=y.lastChild;_=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 k=r.getFormatElement(x,null);k===r.getRangeFormatElement(k,null)&&(k=r.createElement(r.getParentElement(x,r.isCell)?"DIV":s.defaultTag),x.parentNode.insertBefore(k,x),k.appendChild(x))}if(r.isBreak(x)){const k=r.createTextNode(r.zeroWidthSpace);x.parentNode.insertBefore(k,x),x=k,N&&p===y&&(y=x,_=1)}}if(p=x,v=E,x=r.isWysiwygDiv(y)?e.element.wysiwyg.lastChild:y,E=_,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&&(T=x.childNodes,T.length!==0);)x=T[E>0?E-1:E]||!/FIGURE/i.test(T[0].nodeName)?T[0]:x.previousElementSibling||x.previousSibling||p,E=E>0?x.textContent.length:E;let k=r.getFormatElement(x,null);k===r.getRangeFormatElement(k,null)&&(k=r.createElement(r.isCell(k)?"DIV":s.defaultTag),x.parentNode.insertBefore(k,x),k.appendChild(x))}if(r.isBreak(x)){const k=r.createTextNode(r.zeroWidthSpace);x.parentNode.insertBefore(k,x),x=k,E=1,N&&!x.previousSibling&&r.removeItem(y)}}return y=x,_=E,this.setRange(p,v,y,_),!0},getSelectedElements:function(c){if(!this._resetRangeToTextNode())return[];let u=this.getRange();if(r.isWysiwygDiv(u.startContainer)){const R=e.element.wysiwyg.children;if(R.length===0)return[];this.setRange(R[0],0,R[R.length-1],R[R.length-1].textContent.trim().length),u=this.getRange()}const p=u.startContainer,v=u.endContainer,y=u.commonAncestorContainer,_=r.getListChildren(y,function(R){return c?c(R):r.isFormatElement(R)});if(!r.isWysiwygDiv(y)&&!r.isRangeFormatElement(y)&&_.unshift(r.getFormatElement(y,null)),p===v||_.length===1)return _;let x=r.getFormatElement(p,null),E=r.getFormatElement(v,null),T=null,N=null;const k=function(R){return r.isTable(R)?/^TABLE$/i.test(R.nodeName):!0};let D=r.getRangeFormatElement(x,k),M=r.getRangeFormatElement(E,k);r.isTable(D)&&r.isListCell(D.parentNode)&&(D=D.parentNode),r.isTable(M)&&r.isListCell(M.parentNode)&&(M=M.parentNode);const A=D===M;for(let R=0,z=_.length,V;R<z;R++){if(V=_[R],x===V||!A&&V===D){T=R;continue}if(E===V||!A&&V===M){N=R;break}}return T===null&&(T=0),N===null&&(N=_.length-1),_.slice(T,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 _=this.getParentElement(y,this.isComponent);return this.isFormatElement(y)&&(!_||_===p)||this.isComponent(y)&&!this.getFormatElement(y)}).bind(r));if(c){for(let y=0,_=v.length;y<_;y++)for(let x=y-1;x>=0;x--)if(v[x].contains(v[y])){v.splice(y,1),y--,_--;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 _=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 T=r.getParentElement(y.container,(function(N){return this.isRangeFormatElement(N)}).bind(r));_=r.splitElement(y.container,y.offset,T?r.getElementDepth(T)+1:0),_&&(E=_.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 T=this.getFileComponent(c);T?this.selectComponent(T.target,T.pluginName):_&&(_=r.getEdgeChildNodes(_,null).sc||_,this.setRange(_,0,_,0))}return u||this.history.push(1),_||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,_=r.isListCell(u.parentNode);let x,E,T;(_?!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,T=y.offsetWidth/2/2,p.top=x-E-12+"px",p.left=r.getOffset(y).left+T+"px",p.display="block"):p.display="none",(_?!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,T=y.offsetWidth/2/2),v.top=x+y.offsetHeight-E-12+"px",v.left=r.getOffset(y).left+y.offsetWidth-T-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 _=0,x=y.length;_<x;_++)p(y[_])})(c)},_dupleCheck:function(c,u){if(!r.isTextStyleElement(c))return;const p=(c.style.cssText.match(/[^;]+;/g)||[]).map(function(_){return _.trim()}),v=c.nodeName;if(/^span$/i.test(v)&&p.length===0)return c;let y=!1;return function _(x){if(!(r.isWysiwygDiv(x)||!r.isTextStyleElement(x))){if(x.nodeName===v){y=!0;const E=x.style.cssText.match(/[^;]+;/g)||[];for(let T=0,N=E.length,k;T<N;T++)(k=p.indexOf(E[T].trim()))>-1&&p.splice(k,1);for(let T=0,N=x.classList.length;T<N;T++)c.classList.remove(x.classList[T])}_(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(),_=r.isListCell(y.commonAncestorContainer)?y.commonAncestorContainer:r.getFormatElement(this.getSelectionNode(),null),x=r.isListCell(_)&&(r.isListCell(c)||r.isList(c)),E,T,N,k=null;const D=r.isFreeFormatElement(_),M=!D&&(r.isFormatElement(c)||r.isRangeFormatElement(c))||r.isComponent(c);if(x&&(N=u||r.isList(c)?_.lastChild:_.nextElementSibling,k=r.isList(c)?_:(N||_).parentNode),!u&&(M||r.isComponent(c)||r.isMedia(c))){const L=this.isEdgePoint(y.endContainer,y.endOffset,"end"),O=this.removeNode(),j=O.container,P=j===O.prevContainer&&y.collapsed?null:O.prevContainer;if(x&&P)if(k=P.nodeType===3?P.parentNode:P,k.contains(j)){let U=!0;for(N=j;N.parentNode&&N.parentNode!==k;)N=N.parentNode,U=!1;U&&j===P&&(N=N.nextSibling)}else N=null;else if(x&&r.isListCell(j)&&!_.parentElement)_=r.createElement("LI"),k.appendChild(_),j.appendChild(k),N=null;else if(j.nodeType===3||r.isBreak(j)||x){const U=r.getParentElement(j,(function(I){return this.isRangeFormatElement(I)||this.isListCell(I)}).bind(r));if(u=r.splitElement(j,O.offset,U?r.getElementDepth(U)+1:0),!u)r.isListCell(_)||(N=u=_);else if(x){if(_.contains(j)){const I=r.isList(_.lastElementChild);let $=null;L||($=_.cloneNode(!1),$.appendChild(u.textContent.trim()?u:r.createTextNode(r.zeroWidthSpace))),I&&($||($=_.cloneNode(!1),$.appendChild(r.createTextNode(r.zeroWidthSpace))),$.appendChild(_.lastElementChild)),$&&(_.parentNode.insertBefore($,_.nextElementSibling),N=u=$)}}else u=u.previousSibling}}y=!u&&!M?this.getRange_addLine(this.getRange(),null):this.getRange();const A=y.commonAncestorContainer,R=y.startOffset,z=y.endOffset,V=y.startContainer===A&&r.isFormatElement(A),H=V&&(A.childNodes[R]||A.childNodes[0])||y.startContainer,F=V&&(A.childNodes[z]||A.childNodes[A.childNodes.length-1])||y.endContainer;if(!x)if(u)E=u.parentNode,u=u.nextSibling,T=!0;else if(E=H,H.nodeType===3&&(E=H.parentNode),y.collapsed)if(A.nodeType===3)A.textContent.length>z?u=A.splitText(z):u=A.nextSibling;else if(r.isBreak(E))u=E,E=E.parentNode;else{let L=E.childNodes[R];const O=L&&L.nodeType===3&&r.onlyZeroWidthSpace(L)&&r.isBreak(L.nextSibling)?L.nextSibling:L;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(H===F){this.isEdgePoint(F,z)?u=F.nextSibling:u=F.splitText(z);let O=H;this.isEdgePoint(H,R)||(O=H.splitText(R)),E.removeChild(O),E.childNodes.length===0&&M&&(E.innerHTML="<br>")}else{const O=this.removeNode(),j=O.container,P=O.prevContainer;if(j&&j.childNodes.length===0&&M&&(r.isFormatElement(j)?j.innerHTML="<br>":r.isRangeFormatElement(j)&&(j.innerHTML="<"+s.defaultTag+"><br></"+s.defaultTag+">")),r.isListCell(j)&&c.nodeType===3)E=j,u=null;else if(!M&&P)if(E=P.nodeType===3?P.parentNode:P,E.contains(j)){let U=!0;for(u=j;u.parentNode&&u.parentNode!==E;)u=u.parentNode,U=!1;U&&j===P&&(u=u.nextSibling)}else u=null;else r.isWysiwygDiv(j)&&!r.isFormatElement(c)?(E=j.appendChild(r.createElement(s.defaultTag)),u=null):(u=M?F:j===P?j.nextSibling:j,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 L=E;if(r.isList(u))E=u,u=null;else if(r.isListCell(u))E=u.previousElementSibling||u;else if(!T&&!u){const O=this.removeNode(),j=O.container.nodeType===3?r.isListCell(r.getFormatElement(O.container,null))?O.container:r.getFormatElement(O.container,null)||O.container.parentNode:O.container,P=r.isWysiwygDiv(j)||r.isRangeFormatElement(j);E=P?j:j.parentNode,u=P?null:j.nextSibling}L.childNodes.length===0&&E!==L&&r.removeItem(L)}if(M&&!D&&!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 L=r.createElement(s.defaultTag);L.appendChild(c),v=c,c=L}}if(x?k.parentNode?(E=k,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 L=r.createElement("ol");E.insertBefore(L,u),E=L,u=null}x=!0}if(this._checkDuplicateNode(c,E),E.insertBefore(c,u),x)if(r.onlyZeroWidthSpace(_.textContent.trim()))r.removeItem(_),c=c.lastChild;else{const L=r.getArrayItem(_.children,r.isList);L&&(c!==L?(c.appendChild(L),c=L.previousSibling):(E.appendChild(c),c=E),r.onlyZeroWidthSpace(_.textContent.trim())&&r.removeItem(_))}}catch(L){E.appendChild(c),console.warn("[SUNEDITOR.insertNode.warn] "+L)}finally{v&&(c=v);const L=E.querySelectorAll("[data-se-duple]");if(L.length>0)for(let O=0,j=L.length,P,U,I,$;O<j;O++){for(P=L[O],I=P.childNodes,$=P.parentNode;I[0];)U=I[0],$.insertBefore(U,P);P===c&&(c=U),r.removeItem(P)}if((r.isFormatElement(c)||r.isComponent(c))&&H===F){const O=r.getFormatElement(A,null);O&&O.nodeType===1&&r.isEmptyLine(O)&&r.removeItem(O)}if(D&&(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 j=null;(!c.previousSibling||r.isBreak(c.previousSibling))&&(j=r.createTextNode(r.zeroWidthSpace),c.parentNode.insertBefore(j,c)),(!c.nextSibling||r.isBreak(c.nextSibling))&&(j=r.createTextNode(r.zeroWidthSpace),c.parentNode.insertBefore(j,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 j=r.createElement("BR"),P=r.createElement(s.defaultTag);return P.appendChild(j),r.changeElement(O,P),d.setRange(P,0,P,0),this.history.push(!0),{container:P,offset:0,prevContainer:null}}}const u=c.startOffset===0,p=d.isEdgePoint(c.endContainer,c.endOffset,"end");let v=null,y=null,_=null;u&&(y=r.getFormatElement(c.startContainer),y&&(v=y.previousElementSibling,y=v)),p&&(_=r.getFormatElement(c.endContainer),_=_&&_.nextElementSibling);let x,E=0,T=c.startContainer,N=c.endContainer,k=c.startOffset,D=c.endOffset;const M=c.commonAncestorContainer.nodeType===3&&c.commonAncestorContainer.parentNode===T.parentNode?T.parentNode:c.commonAncestorContainer;if(M===T&&M===N&&(T=M.children[k],N=M.children[D],k=D=0),!T||!N)return{container:M,offset:0};if(T===N&&c.collapsed&&T.textContent&&r.onlyZeroWidthSpace(T.textContent.substr(k)))return{container:T,offset:k,prevContainer:T&&T.parentNode?T:null};let A=null,R=null;const z=r.getListChildNodes(M,null);let V=r.getArrayIndex(z,T),H=r.getArrayIndex(z,N);if(z.length>0&&V>-1&&H>-1){for(let O=V+1,j=T;O>=0;O--)z[O]===j.parentNode&&z[O].firstChild===j&&k===0&&(V=O,j=j.parentNode);for(let O=H-1,j=N;O>V;O--)z[O]===j.parentNode&&z[O].nodeType===1&&(z.splice(O,1),j=j.parentNode,--H)}else{if(z.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:D};z.push(M),T=N=M}else if(T=N=z[0],r.isBreak(T)||r.onlyZeroWidthSpace(T))return{container:r.isMedia(M)?M:T,offset:0};V=H=0}for(let O=V;O<=H;O++){const j=z[O];if(j.length===0||j.nodeType===3&&j.data===void 0){this._nodeRemoveListItem(j);continue}if(j===T){if(T.nodeType===1){if(r.isComponent(T))continue;A=r.createTextNode(T.textContent)}else j===N?(A=r.createTextNode(T.substringData(0,k)+N.substringData(D,N.length-D)),E=k):A=r.createTextNode(T.substringData(0,k));if(A.length>0?T.data=A.data:this._nodeRemoveListItem(T),j===N)break;continue}if(j===N){if(N.nodeType===1){if(r.isComponent(N))continue;R=r.createTextNode(N.textContent)}else R=r.createTextNode(N.substringData(D,N.length-D));R.length>0?N.data=R.data:this._nodeRemoveListItem(N);continue}this._nodeRemoveListItem(j)}const F=r.getParentElement(N,"ul"),L=r.getParentElement(T,"li");if(F&&L&&L.contains(F)?(x=F.previousSibling,E=x.textContent.length):(x=N&&N.parentNode?N:T&&T.parentNode?T: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)&&!(T&&T.parentNode)&&(_?(x=_,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 D=0,M=u.length,A,R,z,V,H,F;D<M;D++)if(A=u[D],!!r.isListCell(A)&&(R=A.lastElementChild,R&&r.isListCell(A.nextElementSibling)&&u.indexOf(A.nextElementSibling)>-1&&(V=R.lastElementChild,u.indexOf(V)>-1))){let L=null;for(;L=V.lastElementChild;)if(r.isList(L))if(u.indexOf(L.lastElementChild)>-1)V=L.lastElementChild;else continue e;z=R.firstElementChild,H=u.indexOf(z),F=u.indexOf(V),u.splice(H,F-H+1),M=u.length;continue}let p=u[u.length-1],v,y,_;r.isRangeFormatElement(p)||r.isFormatElement(p)?v=p:v=r.getRangeFormatElement(p,null)||r.getFormatElement(p,null),r.isCell(v)?(y=null,_=v):(y=v.nextSibling,_=v.parentNode);let x=r.getElementDepth(v),E=null;const T=[],N=function(D,M,A){let R=null;if(D!==M&&!r.isTable(M)){if(M&&r.getElementDepth(D)===r.getElementDepth(M))return A;R=r.removeItemAllParents(M,null,D)}return R?R.ec:A};for(let D=0,M=u.length,A,R,z,V,H,F,L;D<M;D++)if(A=u[D],R=A.parentNode,!(!R||c.contains(R)))if(z=r.getElementDepth(A),r.isList(R)){if(E===null&&(F?(E=F,L=!0,F=null):E=R.cloneNode(!1)),T.push(A),H=u[D+1],D===M-1||H&&H.parentNode!==R){H&&A.contains(H.parentNode)&&(F=H.parentNode.cloneNode(!1));let O=R.parentNode,j;for(;r.isList(O);)j=r.createElement(O.nodeName),j.appendChild(E),E=j,O=O.parentNode;const P=this.detachRangeFormatElement(R,T,null,!0,!0);x>=z?(x=z,_=P.cc,y=N(_,R,P.ec),y&&(_=y.parentNode)):_===P.cc&&(y=P.ec),_!==P.cc&&(V=N(_,P.cc,V),V!==void 0?y=V:y=P.cc);for(let U=0,I=P.removeArray.length;U<I;U++)E.appendChild(P.removeArray[U]);L||c.appendChild(E),F&&P.removeArray[P.removeArray.length-1].appendChild(F),E=null,L=!1}}else x>=z&&(x=z,_=R,y=A.nextSibling),c.appendChild(A),_!==R&&(V=N(_,R),V!==void 0&&(y=V));if(this.effectNode=null,r.mergeSameTags(c,null,!1),r.mergeNestedTags(c,(function(D){return this.isList(D)}).bind(r)),y&&r.getElementDepth(y)>0&&(r.isList(y.parentNode)||r.isList(y.parentNode.parentNode))){const D=r.getParentElement(y,(function(A){return this.isRangeFormatElement(A)&&!this.isList(A)}).bind(r)),M=r.splitElement(y,null,D?r.getElementDepth(D)+1:0);M.parentNode.insertBefore(c,M)}else _.insertBefore(c,y),N(c,y);const k=r.getEdgeChildNodes(c.firstElementChild,c.lastElementChild);u.length>1?this.setRange(k.sc,0,k.ec,k.ec.textContent.length):this.setRange(k.ec,k.ec.textContent.length,k.ec,k.ec.textContent.length),this.history.push(!1)},detachRangeFormatElement:function(c,u,p,v,y){const _=this.getRange();let x=_.startOffset,E=_.endOffset,T=r.getListChildNodes(c,function(P){return P.parentNode===c}),N=c.parentNode,k=null,D=null,M=c.cloneNode(!1);const A=[],R=r.isList(p);let z=!1,V=!1,H=!1;function F(P,U,I,$){if(r.onlyZeroWidthSpace(U)&&(U.innerHTML=r.zeroWidthSpace,x=E=1),U.nodeType===3)return P.insertBefore(U,I),U;const Q=(H?U:$).childNodes;let W=U.cloneNode(!1),X=null,q=null;for(;Q[0];)q=Q[0],r._notTextNode(q)&&!r.isBreak(q)&&!r.isListCell(W)?(W.childNodes.length>0&&(X||(X=W),P.insertBefore(W,I),W=U.cloneNode(!1)),P.insertBefore(q,I),X||(X=q)):W.appendChild(q);if(W.childNodes.length>0){if(r.isListCell(P)&&r.isListCell(W)&&r.isList(I))if(R){for(X=I;I;)W.appendChild(I),I=I.nextSibling;P.parentNode.insertBefore(W,P.nextElementSibling)}else{const G=$.nextElementSibling,ee=r.detachNestedList($,!1);if(c!==ee||G!==$.nextElementSibling){const re=W.childNodes;for(;re[0];)$.appendChild(re[0]);c=ee,V=!0}}else P.insertBefore(W,I);X||(X=W)}return X}for(let P=0,U=T.length,I,$,Q;P<U;P++)if(I=T[P],!(I.nodeType===3&&r.isList(M)))if(H=!1,v&&P===0&&(!u||u.length===U||u[0]===I?k=c.previousSibling:k=M),u&&($=u.indexOf(I)),u&&$===-1)M||(M=c.cloneNode(!1)),M.appendChild(I);else{if(u&&(Q=u[$+1]),M&&M.children.length>0&&(N.insertBefore(M,c),M=null),!R&&r.isListCell(I))if(Q&&r.getElementDepth(I)!==r.getElementDepth(Q)&&(r.isListCell(N)||r.getArrayItem(I.children,r.isList,!1))){const W=I.nextElementSibling,X=r.detachNestedList(I,!1);(c!==X||W!==I.nextElementSibling)&&(c=X,V=!0)}else{const W=I;I=r.createElement(v?W.nodeName:r.isList(c.parentNode)||r.isListCell(c.parentNode)?"LI":r.isCell(c.parentNode)?"DIV":s.defaultTag);const X=r.isListCell(I),q=W.childNodes;for(;q[0]&&!(r.isList(q[0])&&!X);)I.appendChild(q[0]);r.copyFormatAttributes(I,W),H=!0}else I=I.cloneNode(!1);if(!V&&(v?(A.push(I),r.removeItem(T[P])):(p?(z||(N.insertBefore(p,c),z=!0),I=F(p,I,null,T[P])):I=F(N,I,c,T[P]),V||(u?(D=I,k||(k=I)):k||(k=D=I))),V)){V=H=!1,T=r.getListChildNodes(c,function(W){return W.parentNode===c}),M=c.cloneNode(!1),N=c.parentNode,P=-1,U=T.length;continue}}const L=c.parentNode;let O=c.nextSibling;M&&M.children.length>0&&L.insertBefore(M,O),p?k=p.previousSibling:k||(k=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 j=null;if(v)j={cc:L,sc:k,so:x,ec:O,eo:E,removeArray:A};else{k||(k=D),D||(D=k);const P=r.getEdgeChildNodes(k,D.parentNode?k:D);j={cc:(P.sc||P.ec).parentNode,sc:P.sc,so:x,ec:P.ec,eo:E,removeArray:null}}if(this.effectNode=null,y)return j;!v&&j&&(u?this.setRange(j.sc,x,j.ec,E):this.setRange(j.sc,0,j.sc,0)),this.history.push(!1)},detachList:function(c,u){let p={},v=!1,y=!1,_=null,x=null;const E=(function(T){return!this.isComponent(T)}).bind(r);for(let T=0,N=c.length,k,D,M,A;T<N;T++){if(M=T===N-1,D=r.getRangeFormatElement(c[T],E),A=r.isList(D),!k&&A)k=D,p={r:k,f:[r.getParentElement(c[T],"LI")]},T===0&&(v=!0);else if(k&&A)if(k!==D){const R=this.detachRangeFormatElement(p.f[0].parentNode,p.f,null,u,!0);D=c[T].parentNode,v&&(_=R.sc,v=!1),M&&(x=R.ec),A?(k=D,p={r:k,f:[r.getParentElement(c[T],"LI")]},M&&(y=!0)):k=null}else p.f.push(r.getParentElement(c[T],"LI")),M&&(y=!0);if(M&&r.isList(k)){const R=this.detachRangeFormatElement(p.f[0].parentNode,p.f,null,u,!0);(y||N===1)&&(x=R.ec),v&&(_=R.sc||x)}}return{sc:_,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 _=!c,x=_&&!p&&!u;let E=y.startContainer,T=y.startOffset,N=y.endContainer,k=y.endOffset;if(x&&y.collapsed&&r.isFormatElement(E.parentNode)||E===N&&E.nodeType===1&&r.isNonEditable(E)){const q=E.parentNode;if(!r.isListCell(q)||!r.getValues(q.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 q=null;const G=E.childNodes[T];G&&(G.nextSibling?q=r.isBreak(G)?G:G.nextSibling:q=null);const ee=r.createTextNode(r.zeroWidthSpace);E.insertBefore(ee,q),this.setRange(ee,1,ee,1),y=this.getRange(),E=y.startContainer,T=y.startOffset,N=y.endContainer,k=y.endOffset}r.isFormatElement(E)&&(E=E.childNodes[T]||E.firstChild,T=0),r.isFormatElement(N)&&(N=N.childNodes[k]||N.lastChild,k=N.textContent.length),_&&(c=r.createElement("DIV"));const D=a.RegExp,M=c.nodeName;if(!x&&E===N&&!p&&c){let q=E,G=0;const ee=[],re=c.style;for(let ie=0,le=re.length;ie<le;ie++)ee.push(re[ie]);const ce=c.classList;for(let ie=0,le=ce.length;ie<le;ie++)ee.push("."+ce[ie]);if(ee.length>0){for(;!r.isFormatElement(q)&&!r.isWysiwygDiv(q);){for(let ie=0;ie<ee.length;ie++)if(q.nodeType===1){const le=ee[ie],we=/^\./.test(le)?new D("\\s*"+le.replace(/^\./,"")+"(\\s+|$)","ig"):!1,Ce=_?!!q.style[le]:!!q.style[le]&&!!c.style[le]&&q.style[le]===c.style[le],be=we===!1?!1:_?!!q.className.match(we):!!q.className.match(we)&&!!c.className.match(we);(Ce||be)&&G++}q=q.parentNode}if(G>=ee.length)return}}let A={},R={},z,V="",H="",F="";if(u){for(let q=0,G=u.length,ee;q<G;q++)ee=u[q],/^\./.test(ee)?H+=(H?"|":"\\s*(?:")+ee.replace(/^\./,""):V+=(V?"|":"(?:;|^|\\s)(?:")+ee;V&&(V+=")\\s*:[^;]*\\s*(?:;|$)",V=new D(V,"ig")),H&&(H+=")(?=\\s+|$)",H=new D(H,"ig"))}if(p){F="^(?:"+p[0];for(let q=1;q<p.length;q++)F+="|"+p[q];F+=")$",F=new D(F,"i")}const L=a.Boolean,O={v:!1},j=function(q){const G=q.cloneNode(!1);if(G.nodeType===3||r.isBreak(G))return G;if(x)return null;const ee=!F&&_||F&&F.test(G.nodeName);if(ee&&!v)return O.v=!0,null;const re=G.style.cssText;let ce="";V&&re.length>0&&(ce=re.replace(V,"").trim(),ce!==re&&(O.v=!0));const ie=G.className;let le="";return H&&ie.length>0&&(le=ie.replace(H,"").trim(),le!==ie&&(O.v=!0)),_&&(H||!ie)&&(V||!re)&&!ce&&!le&&ee?(O.v=!0,null):ce||le||G.nodeName!==M||L(V)!==L(re)||L(H)!==L(ie)?(V&&re.length>0&&(G.style.cssText=ce),G.style.cssText||G.removeAttribute("style"),H&&ie.length>0&&(G.className=le.trim()),G.className.trim()||G.removeAttribute("class"),!G.style.cssText&&!G.className&&(G.nodeName===M||ee)?(O.v=!0,null):G):(O.v=!0,null)},P=this.getSelectedElements(null);y=this.getRange(),E=y.startContainer,T=y.startOffset,N=y.endContainer,k=y.endOffset,r.getFormatElement(E,null)||(E=r.getChildElement(P[0],function(q){return q.nodeType===3},!1),T=0),r.getFormatElement(N,null)||(N=r.getChildElement(P[P.length-1],function(q){return q.nodeType===3},!1),k=N.textContent.length);const U=r.getFormatElement(E,null)===r.getFormatElement(N,null),I=P.length-(U?0:1);z=c.cloneNode(!1);const $=x||_&&function(q){for(let G=0,ee=q.length;G<ee;G++)if(r._isMaintainedNode(q[G])||r._isSizeNode(q[G]))return!0;return!1}(p),Q=_||r._isSizeNode(z),W=this._util_getMaintainedNode.bind(r,$,Q),X=this._util_isMaintainedNode.bind(r,$,Q);if(U){this._resetCommonListCell(P[0],u)&&(y=this.setRange(E,T,N,k));const q=this._nodeChange_oneLine(P[0],z,j,E,T,N,k,x,_,y.collapsed,O,W,X);A.container=q.startContainer,A.offset=q.startOffset,R.container=q.endContainer,R.offset=q.endOffset,A.container===R.container&&r.onlyZeroWidthSpace(A.container)&&(A.offset=R.offset=1),this._setCommonListStyle(q.ancestor,null)}else{let q=!1;I>0&&this._resetCommonListCell(P[I],u)&&(q=!0),this._resetCommonListCell(P[0],u)&&(q=!0),q&&this.setRange(E,T,N,k),I>0&&(z=c.cloneNode(!1),R=this._nodeChange_endLine(P[I],z,j,N,k,x,_,O,W,X));for(let G=I-1,ee;G>0;G--)this._resetCommonListCell(P[G],u),z=c.cloneNode(!1),ee=this._nodeChange_middleLine(P[G],z,j,x,_,O,R.container),ee.endContainer&&ee.ancestor.contains(ee.endContainer)&&(R.ancestor=null,R.container=ee.endContainer),this._setCommonListStyle(ee.ancestor,null);z=c.cloneNode(!1),A=this._nodeChange_startLine(P[0],z,j,E,T,x,_,O,W,X,R.container),A.endContainer&&(R.ancestor=null,R.container=A.endContainer),I<=0?R=A:R.container||(R.ancestor=null,R.container=A.container,R.offset=A.container.textContent.length),this._setCommonListStyle(A.ancestor,null),this._setCommonListStyle(R.ancestor||r.getFormatElement(R.container),null)}this.controllersOff(),this.setRange(A.container,A.offset,R.container,R.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(D){return!r.isBreak(D)},!0),v=c.style,y=[],_=[],x=r.getValues(v);for(let D=0,M=this._listKebab.length;D<M;D++)x.indexOf(this._listKebab[D])>-1&&u.indexOf(this._listKebab[D])>-1&&(y.push(this._listCamel[D]),_.push(this._listKebab[D]));if(!y.length)return;const E=r.createElement("SPAN");for(let D=0,M=y.length;D<M;D++)E.style[y[D]]=v[_[D]],v.removeProperty(_[D]);let T=E.cloneNode(!1),N=null,k=!1;for(let D=0,M=p.length,A,R;D<M;D++)A=p[D],!s._textTagsMap[A.nodeName.toLowerCase()]&&(R=r.getValues(A.style),R.length===0||y.some(function(z){return R.indexOf(z)===-1})&&R.some(function(z){})?(N=A.nextSibling,T.appendChild(A)):T.childNodes.length>0&&(c.insertBefore(T,N),T=E.cloneNode(!1),N=null,k=!0));return T.childNodes.length>0&&(c.insertBefore(T,N),k=!0),v.length||c.removeAttribute("style"),k},_setCommonListStyle:function(c,u){if(!r.isListCell(c))return;const p=r.getArrayItem((u||c).childNodes,function(T){return!r.isBreak(T)},!0);if(u=p[0],!u||p.length>1||u.nodeType!==1)return;const v=u.style,y=c.style,_=u.nodeName.toLowerCase();let x=!1;s._textTagsMap[_]===s._defaultCommand.bold.toLowerCase()&&(y.fontWeight="bold"),s._textTagsMap[_]===s._defaultCommand.italic.toLowerCase()&&(y.fontStyle="italic");const E=r.getValues(v);if(E.length>0)for(let T=0,N=this._listCamel.length;T<N;T++)E.indexOf(this._listKebab[T])>-1&&(y[this._listCamel[T]]=v[this._listCamel[T]],v.removeProperty(this._listKebab[T]),x=!0);if(this._setCommonListStyle(c,u),!!x&&!v.length){const T=u.childNodes,N=u.parentNode,k=u.nextSibling;for(;T.length>0;)N.insertBefore(T[0],k);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,_,x,E,T,N,k,D,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(!T&&A===_.parentNode&&A.nodeName===u.nodeName&&r.onlyZeroWidthSpace(v.textContent.slice(0,y))&&r.onlyZeroWidthSpace(_.textContent.slice(x))){const be=A.childNodes;let Ne=!0;for(let B=0,Y=be.length,Z,se,ne,te;B<Y;B++){if(Z=be[B],te=!r.onlyZeroWidthSpace(Z),Z===v){se=!0;continue}if(Z===_){ne=!0;continue}if(!se&&te||se&&ne&&te){Ne=!1;break}}if(Ne)return r.copyTagAttributes(A,u),{ancestor:c,startContainer:v,startOffset:y,endContainer:_,endOffset:x}}k.v=!1;const R=c,z=[u],V=c.cloneNode(!1),H=v===_;let F=v,L=y,O=_,j=x,P=!1,U=!1,I,$,Q,W,X;const q=a.RegExp;function G(be){const Ne=new q("(?:;|^|\\s)(?:"+W+"null)\\s*:[^;]*\\s*(?:;|$)","ig");let B="";return Ne&&be.style.cssText.length>0&&(B=Ne.test(be.style.cssText)),!B}if(function be(Ne,B){const Y=Ne.childNodes;for(let Z=0,se=Y.length,ne;Z<se;Z++){let te=Y[Z];if(!te)continue;let ae=B,ge;if(!P&&te===F){let pe=V;X=D(te);const xe=r.createTextNode(F.nodeType===1?"":F.substringData(0,L)),De=r.createTextNode(F.nodeType===1?"":F.substringData(L,H&&j>=L?j-L:F.data.length-L));if(X){const Fe=D(B);if(Fe&&Fe.parentNode!==pe){let Pe=Fe,He=null;for(;Pe.parentNode!==pe;){for(B=He=Pe.parentNode.cloneNode(!1);Pe.childNodes[0];)He.appendChild(Pe.childNodes[0]);Pe.appendChild(He),Pe=Pe.parentNode}Pe.parentNode.appendChild(Fe)}X=X.cloneNode(!1)}r.onlyZeroWidthSpace(xe)||B.appendChild(xe);const ke=D(B);for(ke&&(X=ke),X&&(pe=X),$=te,I=[],W="";$!==pe&&$!==R&&$!==null;)ne=M($)?null:p($),ne&&$.nodeType===1&&G($)&&(I.push(ne),W+=$.style.cssText.substr(0,$.style.cssText.indexOf(":"))+"|"),$=$.parentNode;const Xe=I.pop()||De;for(Q=$=Xe;I.length>0;)$=I.pop(),Q.appendChild($),Q=$;if(u.appendChild(Xe),pe.appendChild(u),X&&!D(O)&&(u=u.cloneNode(!1),V.appendChild(u),z.push(u)),F=De,L=0,P=!0,$!==De&&$.appendChild(F),!H)continue}if(!U&&te===O){X=D(te);const pe=r.createTextNode(O.nodeType===1?"":O.substringData(j,O.length-j)),xe=r.createTextNode(H||O.nodeType===1?"":O.substringData(0,j));if(X?X=X.cloneNode(!1):M(u.parentNode)&&!X&&(u=u.cloneNode(!1),V.appendChild(u),z.push(u)),!r.onlyZeroWidthSpace(pe)){$=te,W="",I=[];const ke=[];for(;$!==V&&$!==R&&$!==null;)$.nodeType===1&&G($)&&(M($)?ke.push($.cloneNode(!1)):I.push($.cloneNode(!1)),W+=$.style.cssText.substr(0,$.style.cssText.indexOf(":"))+"|"),$=$.parentNode;for(I=I.concat(ke),ge=Q=$=I.pop()||pe;I.length>0;)$=I.pop(),Q.appendChild($),Q=$;V.appendChild(ge),$.textContent=pe.data}if(X&&ge){const ke=D(ge);ke&&(X=ke)}for($=te,I=[],W="";$!==V&&$!==R&&$!==null;)ne=M($)?null:p($),ne&&$.nodeType===1&&G($)&&(I.push(ne),W+=$.style.cssText.substr(0,$.style.cssText.indexOf(":"))+"|"),$=$.parentNode;const De=I.pop()||xe;for(Q=$=De;I.length>0;)$=I.pop(),Q.appendChild($),Q=$;X?(u=u.cloneNode(!1),u.appendChild(De),X.insertBefore(u,X.firstChild),V.appendChild(X),z.push(u),X=null):u.appendChild(De),O=xe,j=xe.data.length,U=!0,!E&&N&&(u=xe,xe.textContent=r.zeroWidthSpace),$!==xe&&$.appendChild(O);continue}if(P){if(te.nodeType===1&&!r.isBreak(te)){r._isIgnoreNodeChange(te)?(V.appendChild(te.cloneNode(!0)),N||(u=u.cloneNode(!1),V.appendChild(u),z.push(u))):be(te,te);continue}$=te,I=[],W="";const pe=[];for(;$.parentNode!==null&&$!==R&&$!==u;)ne=U?$.cloneNode(!1):p($),$.nodeType===1&&!r.isBreak(te)&&ne&&G($)&&(M($)?X||pe.push(ne):I.push(ne),W+=$.style.cssText.substr(0,$.style.cssText.indexOf(":"))+"|"),$=$.parentNode;I=I.concat(pe);const xe=I.pop()||te;for(Q=$=xe;I.length>0;)$=I.pop(),Q.appendChild($),Q=$;if(M(u.parentNode)&&!M(xe)&&!r.onlyZeroWidthSpace(u)&&(u=u.cloneNode(!1),V.appendChild(u),z.push(u)),!U&&!X&&M(xe)){u=u.cloneNode(!1);const De=xe.childNodes;for(let ke=0,Xe=De.length;ke<Xe;ke++)u.appendChild(De[ke]);xe.appendChild(u),V.appendChild(xe),z.push(u),u.children.length>0?B=$:B=u}else xe===te?U?B=V:B=u:U?(V.appendChild(xe),B=$):(u.appendChild(xe),B=$);if(X&&te.nodeType===3)if(D(te)){const De=r.getParentElement(B,(function(ke){return this._isMaintainedNode(ke.parentNode)||ke.parentNode===V}).bind(r));X.appendChild(De),u=De.cloneNode(!1),z.push(u),V.appendChild(u)}else X=null}ge=te.cloneNode(!1),B.appendChild(ge),te.nodeType===1&&!r.isBreak(te)&&(ae=ge),be(te,ae)}}(c,V),T&&!E&&!k.v)return{ancestor:c,startContainer:v,startOffset:y,endContainer:_,endOffset:x};if(E=E&&T,E)for(let be=0;be<z.length;be++){let Ne=z[be],B,Y,Z;if(N)B=r.createTextNode(r.zeroWidthSpace),V.replaceChild(B,Ne);else{const se=Ne.childNodes;for(Y=se[0];se[0];)Z=se[0],V.insertBefore(Z,Ne);r.removeItem(Ne)}be===0&&(N?F=O=B:(F=Y,O=Z))}else{if(T)for(let be=0;be<z.length;be++)this._stripRemoveNode(z[be]);N&&(F=O=u)}r.removeEmptyNode(V,u,!1),N&&(L=F.textContent.length,j=O.textContent.length);const ee=E||O.textContent.length===0;!r.isBreak(O)&&O.textContent.length===0&&(r.removeItem(O),O=F),j=ee?O.textContent.length:j;const re={s:0,e:0},ce=r.getNodePath(F,V,re),ie=!O.parentNode;ie&&(O=F);const le={s:0,e:0},we=r.getNodePath(O,V,!ie&&!ee?le:null);L+=re.s,j=N?L:ie?F.textContent.length:ee?j+re.s:j+le.s;const Ce=r.mergeSameTags(V,[ce,we],!0);return c.parentNode.replaceChild(V,c),F=r.getNodeFromPath(ce,V),O=r.getNodeFromPath(we,V),{ancestor:V,startContainer:F,startOffset:L+Ce[0],endContainer:O,endOffset:j+Ce[1]}},_nodeChange_startLine:function(c,u,p,v,y,_,x,E,T,N,k){let D=v.parentNode;for(;!D.nextSibling&&!D.previousSibling&&!r.isFormatElement(D.parentNode)&&!r.isWysiwygDiv(D.parentNode)&&D.nodeName!==u.nodeName;)D=D.parentNode;if(!x&&D.nodeName===u.nodeName&&!r.isFormatElement(D)&&!D.nextSibling&&r.onlyZeroWidthSpace(v.textContent.slice(0,y))){let P=!0,U=v.previousSibling;for(;U;){if(!r.onlyZeroWidthSpace(U)){P=!1;break}U=U.previousSibling}if(P)return r.copyTagAttributes(D,u),{ancestor:c,container:v,offset:y}}E.v=!1;const M=c,A=[u],R=c.cloneNode(!1);let z=v,V=y,H=!1,F,L,O,j;if(function P(U,I){const $=U.childNodes;for(let Q=0,W=$.length,X,q;Q<W;Q++){const G=$[Q];if(!G)continue;let ee=I;if(H&&!r.isBreak(G)){if(G.nodeType===1){if(r._isIgnoreNodeChange(G)){if(u=u.cloneNode(!1),q=G.cloneNode(!0),R.appendChild(q),R.appendChild(u),A.push(u),k&&G.contains(k)){const le=r.getNodePath(k,G);k=r.getNodeFromPath(le,q)}}else P(G,G);continue}L=G,F=[];const re=[];for(;L.parentNode!==null&&L!==M&&L!==u;)X=p(L),L.nodeType===1&&X&&(N(L)?j||re.push(X):F.push(X)),L=L.parentNode;F=F.concat(re);const ce=F.length>0,ie=F.pop()||G;for(O=L=ie;F.length>0;)L=F.pop(),O.appendChild(L),O=L;if(N(u.parentNode)&&!N(ie)&&(u=u.cloneNode(!1),R.appendChild(u),A.push(u)),!j&&N(ie)){u=u.cloneNode(!1);const le=ie.childNodes;for(let we=0,Ce=le.length;we<Ce;we++)u.appendChild(le[we]);ie.appendChild(u),R.appendChild(ie),I=N(L)?u:L,A.push(u)}else ce?(u.appendChild(ie),I=L):I=u;if(j&&G.nodeType===3)if(T(G)){const le=r.getParentElement(I,(function(we){return this._isMaintainedNode(we.parentNode)||we.parentNode===R}).bind(r));j.appendChild(le),u=le.cloneNode(!1),A.push(u),R.appendChild(u)}else j=null}if(!H&&G===z){let re=R;j=T(G);const ce=r.createTextNode(z.nodeType===1?"":z.substringData(0,V)),ie=r.createTextNode(z.nodeType===1?"":z.substringData(V,z.length-V));if(j){const Ce=T(I);if(Ce&&Ce.parentNode!==re){let be=Ce,Ne=null;for(;be.parentNode!==re;){for(I=Ne=be.parentNode.cloneNode(!1);be.childNodes[0];)Ne.appendChild(be.childNodes[0]);be.appendChild(Ne),be=be.parentNode}be.parentNode.appendChild(Ce)}j=j.cloneNode(!1)}r.onlyZeroWidthSpace(ce)||I.appendChild(ce);const le=T(I);for(le&&(j=le),j&&(re=j),L=I,F=[];L!==re&&L!==null;)X=p(L),L.nodeType===1&&X&&F.push(X),L=L.parentNode;const we=F.pop()||I;for(O=L=we;F.length>0;)L=F.pop(),O.appendChild(L),O=L;we!==I?(u.appendChild(we),I=L):I=u,r.isBreak(G)&&u.appendChild(G.cloneNode(!1)),re.appendChild(u),z=ie,V=0,H=!0,I.appendChild(z);continue}X=H?p(G):G.cloneNode(!1),X&&(I.appendChild(X),G.nodeType===1&&!r.isBreak(G)&&(ee=X)),P(G,ee)}}(c,R),x&&!_&&!E.v)return{ancestor:c,container:v,offset:y,endContainer:k};if(_=_&&x,_)for(let P=0;P<A.length;P++){let U=A[P];const I=U.childNodes,$=I[0];for(;I[0];)R.insertBefore(I[0],U);r.removeItem(U),P===0&&(z=$)}else if(x){u=u.firstChild;for(let P=0;P<A.length;P++)this._stripRemoveNode(A[P])}if(!_&&R.childNodes.length===0)c.childNodes?z=c.childNodes[0]:(z=r.createTextNode(r.zeroWidthSpace),c.appendChild(z));else{r.removeEmptyNode(R,u,!1),r.onlyZeroWidthSpace(R.textContent)&&(z=R.firstChild,V=0);const P={s:0,e:0},U=r.getNodePath(z,R,P);V+=P.s;const I=r.mergeSameTags(R,[U],!0);c.parentNode.replaceChild(R,c),z=r.getNodeFromPath(U,R),V+=I[0]}return{ancestor:R,container:z,offset:V,endContainer:k}},_nodeChange_middleLine:function(c,u,p,v,y,_,x){if(!y){let k=null;x&&c.contains(x)&&(k=r.getNodePath(x,c));const D=c.cloneNode(!0),M=u.nodeName,A=u.style.cssText,R=u.className;let z=D.childNodes,V=0,H=z.length;for(let F;V<H&&(F=z[V],F.nodeType!==3);V++)if(F.nodeName===M)F.style.cssText+=A,r.addClass(F,R);else{if(!r.isBreak(F)&&r._isIgnoreNodeChange(F))continue;if(H===1){z=F.childNodes,H=z.length,V=-1;continue}else break}if(H>0&&V===H)return c.innerHTML=D.innerHTML,{ancestor:c,endContainer:k?r.getNodeFromPath(k,c):null}}_.v=!1;const E=c.cloneNode(!1),T=[u];let N=!0;if(function k(D,M){const A=D.childNodes;for(let R=0,z=A.length,V,H;R<z;R++){let F=A[R];if(!F)continue;let L=M;if(!r.isBreak(F)&&r._isIgnoreNodeChange(F)){if(u.childNodes.length>0&&(E.appendChild(u),u=u.cloneNode(!1)),H=F.cloneNode(!0),E.appendChild(H),E.appendChild(u),T.push(u),M=u,x&&F.contains(x)){const O=r.getNodePath(x,F);x=r.getNodeFromPath(O,H)}continue}else V=p(F),V&&(N=!1,M.appendChild(V),F.nodeType===1&&(L=V));r.isBreak(F)||k(F,L)}}(c,u),N||y&&!v&&!_.v)return{ancestor:c,endContainer:x};if(E.appendChild(u),v&&y)for(let k=0;k<T.length;k++){let D=T[k];const M=D.childNodes;for(;M[0];)E.insertBefore(M[0],D);r.removeItem(D)}else if(y){u=u.firstChild;for(let k=0;k<T.length;k++)this._stripRemoveNode(T[k])}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,_,x,E,T,N){let k=v.parentNode;for(;!k.nextSibling&&!k.previousSibling&&!r.isFormatElement(k.parentNode)&&!r.isWysiwygDiv(k.parentNode)&&k.nodeName!==u.nodeName;)k=k.parentNode;if(!x&&k.nodeName===u.nodeName&&!r.isFormatElement(k)&&!k.previousSibling&&r.onlyZeroWidthSpace(v.textContent.slice(y))){let j=!0,P=v.nextSibling;for(;P;){if(!r.onlyZeroWidthSpace(P)){j=!1;break}P=P.nextSibling}if(j)return r.copyTagAttributes(k,u),{ancestor:c,container:v,offset:y}}E.v=!1;const D=c,M=[u],A=c.cloneNode(!1);let R=v,z=y,V=!1,H,F,L,O;if(function j(P,U){const I=P.childNodes;for(let $=I.length-1,Q;0<=$;$--){const W=I[$];if(!W)continue;let X=U;if(V&&!r.isBreak(W)){if(W.nodeType===1){if(r._isIgnoreNodeChange(W)){u=u.cloneNode(!1);const re=W.cloneNode(!0);A.insertBefore(re,U),A.insertBefore(u,re),M.push(u)}else j(W,W);continue}F=W,H=[];const q=[];for(;F.parentNode!==null&&F!==D&&F!==u;)Q=p(F),Q&&F.nodeType===1&&(N(F)?O||q.push(Q):H.push(Q)),F=F.parentNode;H=H.concat(q);const G=H.length>0,ee=H.pop()||W;for(L=F=ee;H.length>0;)F=H.pop(),L.appendChild(F),L=F;if(N(u.parentNode)&&!N(ee)&&(u=u.cloneNode(!1),A.insertBefore(u,A.firstChild),M.push(u)),!O&&N(ee)){u=u.cloneNode(!1);const re=ee.childNodes;for(let ce=0,ie=re.length;ce<ie;ce++)u.appendChild(re[ce]);ee.appendChild(u),A.insertBefore(ee,A.firstChild),M.push(u),u.children.length>0?U=F:U=u}else G?(u.insertBefore(ee,u.firstChild),U=F):U=u;if(O&&W.nodeType===3)if(T(W)){const re=r.getParentElement(U,(function(ce){return this._isMaintainedNode(ce.parentNode)||ce.parentNode===A}).bind(r));O.appendChild(re),u=re.cloneNode(!1),M.push(u),A.insertBefore(u,A.firstChild)}else O=null}if(!V&&W===R){O=T(W);const q=r.createTextNode(R.nodeType===1?"":R.substringData(z,R.length-z)),G=r.createTextNode(R.nodeType===1?"":R.substringData(0,z));if(O){O=O.cloneNode(!1);const re=T(U);if(re&&re.parentNode!==A){let ce=re,ie=null;for(;ce.parentNode!==A;){for(U=ie=ce.parentNode.cloneNode(!1);ce.childNodes[0];)ie.appendChild(ce.childNodes[0]);ce.appendChild(ie),ce=ce.parentNode}ce.parentNode.insertBefore(re,ce.parentNode.firstChild)}O=O.cloneNode(!1)}else N(u.parentNode)&&!O&&(u=u.cloneNode(!1),A.appendChild(u),M.push(u));for(r.onlyZeroWidthSpace(q)||U.insertBefore(q,U.firstChild),F=U,H=[];F!==A&&F!==null;)Q=N(F)?null:p(F),Q&&F.nodeType===1&&H.push(Q),F=F.parentNode;const ee=H.pop()||U;for(L=F=ee;H.length>0;)F=H.pop(),L.appendChild(F),L=F;ee!==U?(u.insertBefore(ee,u.firstChild),U=F):U=u,r.isBreak(W)&&u.appendChild(W.cloneNode(!1)),O?(O.insertBefore(u,O.firstChild),A.insertBefore(O,A.firstChild),O=null):A.insertBefore(u,A.firstChild),R=G,z=G.data.length,V=!0,U.insertBefore(R,U.firstChild);continue}Q=V?p(W):W.cloneNode(!1),Q&&(U.insertBefore(Q,U.firstChild),W.nodeType===1&&!r.isBreak(W)&&(X=Q)),j(W,X)}}(c,A),x&&!_&&!E.v)return{ancestor:c,container:v,offset:y};if(_=_&&x,_)for(let j=0;j<M.length;j++){let P=M[j];const U=P.childNodes;let I=null;for(;U[0];)I=U[0],A.insertBefore(I,P);r.removeItem(P),j===M.length-1&&(R=I,z=I.textContent.length)}else if(x){u=u.firstChild;for(let j=0;j<M.length;j++)this._stripRemoveNode(M[j])}if(!_&&A.childNodes.length===0)c.childNodes?R=c.childNodes[0]:(R=r.createTextNode(r.zeroWidthSpace),c.appendChild(R));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)?(R=A.firstChild,z=R.textContent.length):r.onlyZeroWidthSpace(R)&&(R=u,z=1);const j={s:0,e:0},P=r.getNodePath(R,A,j);z+=j.s;const U=r.mergeSameTags(A,[P],!0);c.parentNode.replaceChild(A,c),R=r.getNodeFromPath(P,A),z+=U[0]}return{ancestor:A,container:R,offset:R.nodeType===1&&z===1?R.childNodes.length:z}},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(T){return T.childNodes.length===0||T.nodeType===3},!1)||p.firstChild,y=r.getChildElement(p.lastChild,function(T){return T.childNodes.length===0||T.nodeType===3},!0)||p.lastChild;if(!v||!y)return;if(r.isMedia(v)){const T=this.getFileComponent(v),N=r.createElement("BR"),k=r.createElement(s.defaultTag);k.appendChild(N),v=T?T.component:v,v.parentNode.insertBefore(k,v),v=N}if(r.isMedia(y)){const T=r.createElement("BR"),N=r.createElement(s.defaultTag);N.appendChild(T),p.appendChild(N),y=T}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 _=this._variable.currentNodesMap,x=_.indexOf(u)>-1?null:r.createElement(u);let E=u;/^SUB$/i.test(u)&&_.indexOf("SUP")>-1?E="SUP":/^SUP$/i.test(u)&&_.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",_=s.rtl?"marginRight":"marginLeft";let x=u.startContainer,E=u.endContainer,T=u.startOffset,N=u.endOffset;for(let k=0,D=p.length,M,A;k<D;k++)M=p[k],!r.isListCell(M)||!this.plugins.list?(A=/\d+/.test(M.style[_])?r.getNumber(M.style[_],0):0,y?A-=25:A+=25,r.setStyle(M,_,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,T,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 _=0,x=y.length;_<x;_++)/^script$/i.test(y[_].tagName)&&(u.head.removeChild(y[_]),_--,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,_=v.length;y<_;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 _=0;_<y.length;_++)r.addClass(this._wd.body,s._editableClass[_])}}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
245
|
<html>
|
|
246
246
|
`+this._wd.head.outerHTML.replace(/>(?!\n)/g,`>
|
|
247
247
|
`)+"<body "+p+`>
|
|
@@ -249,11 +249,11 @@ body{height: min-content; overflow: hidden;}
|
|
|
249
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,_=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,_.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=_.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,_.style.cssText=(_.style.cssText.match(/\s?display(\s+)?:(\s+)?[a-zA-Z]+;/)||[""])[0],p.style.width=y.style.height=_.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"),_=l.head.getElementsByTagName("style");let x="";for(let E=0,T=y.length;E<T;E++)x+=y[E].outerHTML;for(let E=0,T=_.length;E<T;E++)x+=_[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 _="";for(let x=0,E=v.length;x<E;x++)_+=v[x].outerHTML;for(let x=0,E=y.length;x<E;x++)_+=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>"+_+'</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,T,N,k;x<E;x++)T=y[x],k=T.style.marginRight,N=T.style.marginLeft,(k||N)&&(T.style.marginRight=N,T.style.marginLeft=k),k=T.style.textAlign,k==="left"?T.style.textAlign="right":k==="right"&&(T.style.textAlign="left");const _=e.tool;_.dir&&(r.changeTxt(_.dir.querySelector(".se-tooltip-text"),i.toolbar[s.rtl?"dir_ltr":"dir_rtl"]),r.changeElement(_.dir.firstElementChild,f[s.rtl?"dir_ltr":"dir_rtl"])),_.dir_ltr&&(u?r.removeClass(_.dir_ltr,"active"):r.addClass(_.dir_ltr,"active")),_.dir_rtl&&(u?r.addClass(_.dir_rtl,"active"):r.removeClass(_.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,_=v.length;y<_;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 _=0,x=v.length,E;_<x;_++)E=v[_].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,_){return v+(typeof u[y]=="string"?u[y]:y)+(_?" "+_:"")})},_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],_=v?v[2]:"rem";let x=y;switch(/em/.test(_)?x=p.round(y/.0625):_==="pt"?x=p.round(y*1.333):_==="%"&&(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],_=(c.match(/\sface="([^"]+)"/i)||[])[1],x=(c.match(/\scolor="([^"]+)"/i)||[])[1];(y||_||x)&&(v='style="'+(y?"font-size:"+this.util.getNumber(y/3.333,1)+"rem;":"")+(_?"font-family:"+_+";":"")+(x?"color:"+x+";":"")+'"')}if(v){u||(u=[]);const y=v.replace(/"/g,"").match(this._cleanStyleRegExp[p]);if(y){const _=[];for(let x=0,E=y.length,T;x<E;x++)if(T=y[x].match(/([a-zA-Z0-9-]+)(:)([^"']+)/),T&&!/inherit|initial|revert|unset/i.test(T[3])){const N=r.kebabToCamelCase(T[1].trim()),k=this.wwComputedStyle[N]?this.wwComputedStyle[N].replace(/"/g,""):"",D=T[3].trim();switch(N){case"fontFamily":if(!s.plugins.font||s.font.indexOf(D)===-1)continue;break;case"fontSize":if(!s.plugins.fontSize)continue;this._cleanStyleRegExp.fontSizeUnit.test(T[0])||(T[0]=T[0].replace((T[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(D))continue;break;case"backgroundColor":if(!s.plugins.hiliteColor||/rgba\(([0-9]+\s*,\s*){3}0\)|windowtext/i.test(D))continue;break}k!==D&&_.push(T[0])}_.length>0&&u.push('style="'+_.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(),_=this._attributesTagsBlacklist[y];u=u.replace(/\s(?:on[a-z]+)\s*=\s*(")[^"]*\1/ig,""),_?u=u.replace(_,""):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(T){return/^style/.test(T.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,T=v.length,N;E<T;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,_=v.length,x;y<_;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--,_--):(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 T=0,N=E.length,k,D;T<N;T++){D=[].slice.call(E[T].classList);for(let M=0,A=D.length;M<A;M++)if(k=this.managedTagsInfo.map[D[M]],k){k(E[T]);break}}}let y=v.childNodes,_="";const x=this._isFormatData(y);x&&(y=this._editFormat(v).childNodes);for(let E=0,T=y.length,N;E<T;E++){if(N=y[E],this.__allowedScriptRegExp.test(N.nodeName)){_+=N.outerHTML;continue}_+=this._makeLine(N,x)}return _=r.htmlRemoveWhiteSpace(_),_?(u&&(_=_.replace(typeof u=="string"?r.createTagsWhitelist(u):u,"")),p&&(_=_.replace(typeof p=="string"?r.createTagsBlacklist(p):p,""))):_=c,this._tagConvertor(_)},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(_){console.warn("[SUNEDITOR.convertContentsForEditor.consistencyCheck.fail] "+_)}if(this.managedTagsInfo&&this.managedTagsInfo.query){const _=u.querySelectorAll(this.managedTagsInfo.query);for(let x=0,E=_.length,T,N;x<E;x++){N=[].slice.call(_[x].classList);for(let k=0,D=N.length;k<D;k++)if(T=this.managedTagsInfo.map[N[k]],T){T(_[x]);break}}}const p=u.childNodes;let v="",y=null;for(let _=0,x;_<p.length;_++){if(x=p[_],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),_--,p[_+1]&&!r.isFormatElement(p[_+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"),_=typeof c=="string"?l.createRange().createContextualFragment(c):c,x=(function(N){return this.isFormatElement(N)||this.isComponent(N)}).bind(r),E=u?"":`
|
|
250
250
|
`;let T=u?0:this._variable.codeIndent*1;return T=T>0?new a.Array(T+1).join(" "):"",function N(k,D){const M=k.childNodes,A=y.test(k.nodeName),R=A?D:"";for(let z=0,V=M.length,H,F,L,O,j,P;z<V;z++){if(H=M[z],O=y.test(H.nodeName),F=O?E:"",L=x(H)&&!A&&!/^(TH|TD)$/i.test(k.nodeName)?E:"",H.nodeType===8){p+=`
|
|
251
251
|
<!-- `+H.textContent.trim()+" -->"+F;continue}if(H.nodeType===3){r.isList(H.parentElement)||(p+=r._HTMLConvertor(/^\n+$/.test(H.data)?"":H.data));continue}if(H.childNodes.length===0){p+=(/^HR$/i.test(H.nodeName)?E:"")+(/^PRE$/i.test(H.parentElement.nodeName)&&/^BR$/i.test(H.nodeName)?"":R)+H.outerHTML+F;continue}H.outerHTML?(j=H.nodeName.toLowerCase(),P=R||O?D:"",p+=(L||(A?"":F))+P+H.outerHTML.match(v("<"+j+"[^>]*>","i"))[0]+F,N(H,D+T),p+=(/\n$/.test(p)?P:"")+"</"+j+">"+(L||F||A||/^(TH|TD)$/i.test(H.nodeName)?E:"")):p+=new a.XMLSerializer().serializeToString(H)}}(_,""),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 _=b.getCharCount(p);if(_>u){if(y=!0,v>0){this._editorRange();const x=this.getRange(),E=x.endOffset-1,T=this.getSelectionNode().textContent,N=x.endOffset-(_-u);this.getSelectionNode().textContent=T.slice(0,N<0?0:N)+T.slice(x.endOffset,T.length),this.setRange(x.endContainer,E,x.endContainer,E)}}else _+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),_=s.addTagsWhitelist?s.addTagsWhitelist.split("|").filter(function(O){return/b|i|ins|s|strike/i.test(O)}):[];for(let O=0;O<_.length;O++)y.splice(y.indexOf(_[O].toLowerCase()),1);this._disallowedTextTagsRegExp=y.length===0?null:new p("(<\\/?)("+y.join("|")+")\\b\\s*([^>^<]+)?\\s*(?=>)","gi");const x=function(O,j){return O?O==="*"?"[a-z-]+":j?O+"|"+j: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",k="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 D='\\s*=\\s*(")[^"]*\\1',M=s.attributesWhitelist;let A={},R="";if(M)for(let O in M)!r.hasOwn(M,O)||/^on[a-z]+$/i.test(M[O])||(O==="all"?R=x(M[O],N):A[O]=new p("\\s(?:"+x(M[O],N)+")"+D,"ig"));this._attributesWhitelistRegExp=new p("\\s(?:"+(R||N+"|"+k)+")"+D,"ig"),this._attributesWhitelistRegExp_all_data=new p("\\s(?:"+((R||N)+"|data-[a-z0-9\\-]+")+")"+D,"ig"),this._attributesTagsWhitelist=A;const z=s.attributesBlacklist;if(A={},R="",z)for(let O in z)r.hasOwn(z,O)&&(O==="all"?R=x(z[O],""):A[O]=new p("\\s(?:"+x(z[O],"")+")"+D,"ig"));this._attributesBlacklistRegExp=new p("\\s(?:"+(R||"^")+")"+D,"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 V=[];this.activePlugins=[],this._fileManager.tags=[],this._fileManager.pluginMap={};let H=[],F,L;for(let O in n)if(r.hasOwn(n,O)){if(F=n[O],L=t[O],(F.active||F.action)&&L&&this.callPlugin(O,null,L),typeof F.checkFileInfo=="function"&&typeof F.resetFileInfo=="function"&&(this.callPlugin(O,null,L),this._fileInfoPluginsCheck.push(F.checkFileInfo.bind(this)),this._fileInfoPluginsReset.push(F.resetFileInfo.bind(this))),a.Array.isArray(F.fileTags)){const j=F.fileTags;this.callPlugin(O,null,L),this._fileManager.tags=this._fileManager.tags.concat(j),H.push(O);for(let P=0,U=j.length;P<U;P++)this._fileManager.pluginMap[j[P].toLowerCase()]=O}if(F.managedTags){const j=F.managedTags();V.push("."+j.className),this.managedTagsInfo.map[j.className]=j.method.bind(this)}}this.managedTagsInfo.query=V.toString(),this._fileManager.queryString=this._fileManager.tags.join(","),this._fileManager.regExp=new p("^("+(this._fileManager.tags.join("|")||"^")+")$","i"),this._fileManager.pluginRegExp=new p("^("+(H.length===0?"^":H.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=ZS(this,this._onChange_historyStack.bind(this)),this.addModule([ec]),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 _,x,E;const T=r.getParentElement(p,r.isComponent);if(!(T&&!r.isTable(T))){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,_=r.getEdgeChildNodes(E,null).sc,_||(_=r.createTextNode(r.zeroWidthSpace),E.insertBefore(_,E.firstChild)),x=_.textContent.length,this.setRange(_,x,_,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(_)){const N=r.createTextNode(r.zeroWidthSpace);_.parentNode.insertBefore(N,_),_=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(_))){const N=r.createTextNode(r.zeroWidthSpace);_.parentNode.insertBefore(N,_),_=N}this.effectNode=null,v?this.setRange(v,1,v,1):this.nativeFocus()}}},_setOptionsInit:function(c,u){this.context=e=io(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=[],_=[],x=d.activePlugins,E=x.length;let T="";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(T=N.nodeName.toUpperCase(),_.push(T),!d.isReadOnly)for(let k=0,D;k<E;k++)D=x[k],y.indexOf(D)===-1&&n[D].active.call(d,N)&&y.push(D);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(T)&&(y.push(T),r.addClass(p[T],"active"))}d._setKeyEffect(y),d._variable.currentNodes=_.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(),_=r.getFormatElement(y,null),x=r.getRangeFormatElement(y,null);let E=y;for(;E&&E.firstChild;)E=E.firstChild;const T=d.getFileComponent(E);if(T){const N=d.getRange();!x&&N.startContainer===N.endContainer&&d.selectComponent(T.target,T.pluginName)}else d.currentFileComponentInfo&&d.controllersOff();if(!_&&!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 k=r.createElement("LI"),D=y.nextElementSibling;k.appendChild(y),x.insertBefore(k,D),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 _;if(d._isBalloonAlways&&u.collapsed)_=!0;else if(y.focusNode===y.anchorNode)_=y.focusOffset<y.anchorOffset;else{const F=r.getListChildNodes(u.commonAncestorContainer,null);_=r.getArrayIndex(F,y.focusNode)<r.getArrayIndex(F,y.anchorNode)}let x=u.getClientRects();x=x[_?0:x.length-1];const E=d.getGlobalScrollOffset();let T=E.left,N=E.top;const k=v.offsetWidth,D=h._getEditorOffsets(null),M=D.top,A=D.left;if(p.style.top="-10000px",p.style.visibility="hidden",p.style.display="block",!x){const F=d.getSelectionNode();if(r.isFormatElement(F)){const L=r.createTextNode(r.zeroWidthSpace);d.insertNode(L,null,!1),d.setRange(L,1,L,1),d._editorRange(),x=d.getRange().getClientRects(),x=x[_?0:x.length-1]}if(!x){const L=r.getOffset(F,e.element.wysiwygFrame);x={left:L.left,top:L.top,right:L.left,bottom:L.top+F.offsetHeight,noText:!0},T=0,N=0}_=!0}const R=a.Math.round(e.element._arrow.offsetWidth/2),z=p.offsetWidth,V=p.offsetHeight,H=/iframe/i.test(e.element.wysiwygFrame.nodeName)?e.element.wysiwygFrame.getClientRects()[0]:null;if(H&&(x={left:x.left+H.left,top:x.top+H.top,right:x.right+H.right-H.width,bottom:x.bottom+H.bottom-H.height}),h._setToolbarOffset(_,x,p,A,k,T,N,M,R),(z!==p.offsetWidth||V!==p.offsetHeight)&&h._setToolbarOffset(_,x,p,A,k,T,N,M,R),s.toolbarContainer){const F=v.parentElement;let L=s.toolbarContainer,O=L.offsetLeft,j=L.offsetTop;for(;!L.parentElement.contains(F)||!/^(BODY|HTML)$/i.test(L.parentElement.nodeName);)L=L.offsetParent,O+=L.offsetLeft,j+=L.offsetTop;p.style.left=p.offsetLeft-O+v.offsetLeft+"px",p.style.top=p.offsetTop-j+v.offsetTop+"px"}p.style.visibility=""},_setToolbarOffset:function(c,u,p,v,y,_,x,E,T){const k=p.offsetWidth,D=u.noText&&!c?0:p.offsetHeight,M=(c?u.left:u.right)-v-k/2+_,A=M+k-y;let R=(c?u.top-D-T:u.bottom+T)-(u.noText?0:E)+x,z=M<0?1:A<0?M:M-A-1-1,V=!1;const H=R+(c?h._getEditorOffsets(null).top:p.offsetHeight-e.element.wysiwyg.offsetHeight);!c&&H>0&&h._getPageBottomSpace()<H?(c=!0,V=!0):c&&l.documentElement.offsetTop>H&&(c=!1,V=!0),V&&(R=(c?u.top-D-T:u.bottom+T)-(u.noText?0:E)+x),p.style.left=a.Math.floor(z)+"px",p.style.top=a.Math.floor(R)+"px",c?(r.removeClass(e.element._arrow,"se-arrow-up"),r.addClass(e.element._arrow,"se-arrow-down"),e.element._arrow.style.top=D+"px"):(r.removeClass(e.element._arrow,"se-arrow-down"),r.addClass(e.element._arrow,"se-arrow-up"),e.element._arrow.style.top=-T+"px");const F=a.Math.floor(k/2+(M-z));e.element._arrow.style.left=(F+T>p.offsetWidth?p.offsetWidth-T:F<T?T: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 _=r.getRangeFormatElement(v,null);d._setDefaultFormat(r.isRangeFormatElement(_)?"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",_=p.nodeType===1;let x;return _?(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,_=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,T=d._fileManager.pluginRegExp.test(d.currentControllerName)?d.currentControllerName:"";let N=r.getFormatElement(u,null)||u,k=r.getRangeFormatElement(N,null);if(!(/37|38|39|40/.test(c.keyCode)&&h._onKeyDown_wysiwyg_arrowKey(c)===!1)){switch(p){case 8:if(!E&&T){c.preventDefault(),c.stopPropagation(),d.plugins[T].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 P=N.attributes;for(;P[0];)N.removeAttribute(P[0].name)}else{const P=r.createElement(s.defaultTag);P.innerHTML="<br>",N.parentElement.replaceChild(P,N)}return d.nativeFocus(),!1}}const M=x.startContainer;if(N&&!N.previousElementSibling&&x.startOffset===0&&M.nodeType===3&&!r.isFormatElement(M.parentNode)){let P=M.parentNode.previousSibling;const U=M.parentNode.nextSibling;P||(U?P=U:(P=r.createElement("BR"),N.appendChild(P)));let I=M;for(;N.contains(I)&&!I.previousSibling;)I=I.parentNode;if(!N.contains(I)){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),k=r.getRangeFormatElement(N,null),k&&N&&!r.isCell(k)&&!/^FIGCAPTION$/i.test(k.nodeName)){if(r.isListCell(N)&&r.isList(k)&&(r.isListCell(k.parentNode)||N.previousElementSibling)&&(u===N||u.nodeType===3&&(!u.previousSibling||r.isList(u.previousSibling)))&&(r.getFormatElement(x.startContainer,null)!==r.getFormatElement(x.endContainer,null)?k.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 P=N.previousElementSibling||k.parentNode;if(r.isListCell(P)){c.preventDefault();let U=P;if(!P.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;P=U}let I=P===k.parentNode?k.previousSibling:P.lastChild;I||(I=r.createTextNode(r.zeroWidthSpace),k.parentNode.insertBefore(I,k.parentNode.firstChild));const $=I.nodeType===3?I.textContent.length:1,Q=N.childNodes;let W=I,X=Q[0];for(;X=Q[0];)P.insertBefore(X,W.nextSibling),W=X;r.removeItem(N),k.children.length===0&&r.removeItem(k),d.setRange(I,$,I,$),d.history.push(!0)}}break}if(!E&&x.startOffset===0){let P=!0,U=A;for(;U&&U!==k&&!r.isWysiwygDiv(U);){if(U.previousSibling&&(U.previousSibling.nodeType===1||!r.onlyZeroWidthSpace(U.previousSibling.textContent.trim()))){P=!1;break}U=U.parentNode}if(P&&k.parentNode){c.preventDefault(),d.detachRangeFormatElement(k,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 P=r.isListCell(N),U=u===N?N.childNodes[x.startOffset]:u,I=P?U.previousSibling:N.previousSibling,$=P||(A.nodeType===3||r.isBreak(A))&&!A.previousSibling&&x.startOffset===0;if(U&&(P||!U.previousSibling)&&(A&&r.isComponent(A.previousSibling)||$&&r.isComponent(I))){const Q=d.getFileComponent(I);Q?(c.preventDefault(),c.stopPropagation(),P?r.removeItem(U):N.textContent.length===0&&r.removeItem(N),d.selectComponent(Q.target,Q.pluginName)===!1&&d.blur()):r.isComponent(I)&&(c.preventDefault(),c.stopPropagation(),r.removeItem(I));break}if(U&&r.isNonEditable(U.previousSibling)){c.preventDefault(),c.stopPropagation(),r.removeItem(U.previousSibling);break}}break;case 46:if(T){c.preventDefault(),c.stopPropagation(),d.plugins[T].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 P=N.nextElementSibling;if(!P)break;if(r.isComponent(P)){if(c.preventDefault(),r.onlyZeroWidthSpace(N)&&(r.removeItem(N),r.isTable(P))){let I=r.getChildElement(P,r.isCell,!1);I=I.firstElementChild||I,d.setRange(I,0,I,0);break}const U=d.getFileComponent(P);U?(c.stopPropagation(),d.selectComponent(U.target,U.pluginName)===!1&&d.blur()):r.isComponent(P)&&(c.stopPropagation(),r.removeItem(P));break}}if(!E&&(d.isEdgePoint(x.endContainer,x.endOffset)||u===N&&N.childNodes[x.startOffset])){const P=u===N&&N.childNodes[x.startOffset]||u;if(P&&r.isNonEditable(P.nextSibling)){c.preventDefault(),c.stopPropagation(),r.removeItem(P.nextSibling);break}else if(r.isComponent(P)){c.preventDefault(),c.stopPropagation(),r.removeItem(P);break}}if(!E&&d._isEdgeFormat(x.endContainer,x.endOffset,"end")&&r.isFormatElement(N.nextElementSibling)&&(d._formatAttrsTemp=N.attributes),N=r.getFormatElement(x.startContainer,null),k=r.getRangeFormatElement(N,null),r.isListCell(N)&&r.isList(k)&&(u===N||u.nodeType===3&&(!u.nextSibling||r.isList(u.nextSibling))&&(r.getFormatElement(x.startContainer,null)!==r.getFormatElement(x.endContainer,null)?k.contains(x.endContainer):x.endOffset===u.textContent.length&&x.collapsed))){x.startContainer!==x.endContainer&&d.removeNode();let P=r.getArrayItem(N.children,r.isList,!1);if(P=P||N.nextElementSibling||(k.parentNode?k.parentNode.nextElementSibling:null),P&&(r.isList(P)||r.getArrayItem(P.children,r.isList,!1))){c.preventDefault();let U,I;if(r.isList(P)){const $=P.firstElementChild;for(I=$.childNodes,U=I[0];I[0];)N.insertBefore(I[0],P);r.removeItem($)}else{for(U=P.firstChild,I=P.childNodes;I[0];)N.appendChild(I[0]);r.removeItem(P)}d.setRange(U,0,U,0),d.history.push(!0)}break}break;case 9:if(T||s.tabDisable||(c.preventDefault(),y||_||r.isWysiwygDiv(u)))break;const R=!x.collapsed||d.isEdgePoint(x.startContainer,x.startOffset),z=d.getSelectedElements(null);u=d.getSelectionNode();const V=[];let H=[],F=r.isListCell(z[0]),L=r.isListCell(z[z.length-1]),O={sc:x.startContainer,so:x.startOffset,ec:x.endContainer,eo:x.endOffset};for(let P=0,U=z.length,I;P<U;P++)if(I=z[P],r.isListCell(I)){if(!I.previousElementSibling&&!v)continue;V.push(I)}else H.push(I);if(V.length>0&&R&&d.plugins.list)O=d.plugins.list.editInsideList.call(d,v,V);else{const P=r.getParentElement(u,r.isCell);if(P&&R){const U=r.getParentElement(P,"table"),I=r.getListChildren(U,r.isCell);let $=v?r.prevIdx(I,P):r.nextIdx(I,P);$===I.length&&!v&&($=0),$===-1&&v&&($=I.length-1);let Q=I[$];if(!Q)break;Q=Q.firstElementChild||Q,d.setRange(Q,0,Q,0);break}H=H.concat(V),F=L=null}if(H.length>0)if(v){const P=H.length-1;for(let $=0,Q;$<=P;$++){Q=H[$].childNodes;for(let W=0,X=Q.length,q;W<X&&(q=Q[W],!!q);W++)if(!r.onlyZeroWidthSpace(q)){/^\s{1,4}$/.test(q.textContent)?r.removeItem(q):/^\s{1,4}/.test(q.textContent)&&(q.textContent=q.textContent.replace(/^\s{1,4}/,""));break}}const U=r.getChildElement(H[0],"text",!1),I=r.getChildElement(H[P],"text",!0);!F&&U&&(O.sc=U,O.so=0),!L&&I&&(O.ec=I,O.eo=I.textContent.length)}else{const P=r.createTextNode(new a.Array(d._variable.tabSize+1).join(" "));if(H.length===1){if(!d.insertNode(P,null,!0))return!1;F||(O.sc=P,O.so=P.length),L||(O.ec=P,O.eo=P.length)}else{const U=H.length-1;for(let Q=0,W;Q<=U;Q++)W=H[Q].firstChild,W&&(r.isBreak(W)?H[Q].insertBefore(P.cloneNode(!1),W):W.textContent=P.textContent+W.textContent);const I=r.getChildElement(H[0],"text",!1),$=r.getChildElement(H[U],"text",!0);!F&&I&&(O.sc=I,O.so=0),!L&&$&&(O.ec=$,O.eo=$.textContent.length)}}d.setRange(O.sc,O.so,O.ec,O.eo),d.history.push(!1);break;case 13:const j=r.getFreeFormatElement(u,null);if(d._charTypeHTML){let P="";if(!v&&j||v?P="<br>":P="<"+N.nodeName+"><br></"+N.nodeName+">",!d.checkCharCount(P,"byte-html"))return c.preventDefault(),!1}if(!v&&!T){const P=d._isEdgeFormat(x.endContainer,x.endOffset,"end"),U=d._isEdgeFormat(x.startContainer,x.startOffset,"start");if(P&&(/^H[1-6]$/i.test(N.nodeName)||/^HR$/i.test(N.nodeName))){h._enterPrevent(c);let I=null;const $=d.appendFormatTag(N,s.defaultTag);if(P&&P.length>0){I=P.pop();const Q=I;for(;P.length>0;)I=I.appendChild(P.pop());$.appendChild(Q)}if(I=I?I.appendChild($.firstChild):$.firstChild,r.isBreak(I)){const Q=r.createTextNode(r.zeroWidthSpace);I.parentNode.insertBefore(Q,I),d.setRange(Q,1,Q,1)}else d.setRange(I,0,I,0);break}else if(k&&N&&!r.isCell(k)&&!/^FIGCAPTION$/i.test(k.nodeName)){const I=d.getRange();if(d.isEdgePoint(I.endContainer,I.endOffset)&&r.isList(u.nextSibling)){h._enterPrevent(c);const $=r.createElement("LI"),Q=r.createElement("BR");$.appendChild(Q),N.parentNode.insertBefore($,N.nextElementSibling),$.appendChild(u.nextSibling),d.setRange(Q,1,Q,1);break}if((I.commonAncestorContainer.nodeType!==3||!I.commonAncestorContainer.nextElementSibling)&&r.onlyZeroWidthSpace(N.innerText.trim())&&!r.isListCell(N.nextElementSibling)){h._enterPrevent(c);let $=null;if(r.isListCell(k.parentNode)){const Q=N.parentNode.parentNode;k=Q.parentNode;const W=r.createElement("LI");W.innerHTML="<br>",r.copyTagAttributes(W,N,s.lineAttrReset),$=W,k.insertBefore($,Q.nextElementSibling)}else{const Q=r.isCell(k.parentNode)?"DIV":r.isList(k.parentNode)?"LI":r.isFormatElement(k.nextElementSibling)&&!r.isRangeFormatElement(k.nextElementSibling)?k.nextElementSibling.nodeName:r.isFormatElement(k.previousElementSibling)&&!r.isRangeFormatElement(k.previousElementSibling)?k.previousElementSibling.nodeName:s.defaultTag;$=r.createElement(Q),r.copyTagAttributes($,N,s.lineAttrReset);const W=d.detachRangeFormatElement(k,[N],null,!0,!0);W.cc.insertBefore($,W.ec)}$.innerHTML="<br>",r.removeItemAllParents(N,null,null),d.setRange($,1,$,1);break}}if(j){h._enterPrevent(c);const I=u===j,$=d.getSelection(),Q=u.childNodes,W=$.focusOffset,X=u.previousElementSibling,q=u.nextSibling;if(!r.isClosureFreeFormatElement(j)&&Q&&(I&&x.collapsed&&Q.length-1<=W+1&&r.isBreak(Q[W])&&(!Q[W+1]||(!Q[W+2]||r.onlyZeroWidthSpace(Q[W+2].textContent))&&Q[W+1].nodeType===3&&r.onlyZeroWidthSpace(Q[W+1].textContent))&&W>0&&r.isBreak(Q[W-1])||!I&&r.onlyZeroWidthSpace(u.textContent)&&r.isBreak(X)&&(r.isBreak(X.previousSibling)||!r.onlyZeroWidthSpace(X.previousSibling.textContent))&&(!q||!r.isBreak(q)&&r.onlyZeroWidthSpace(q.textContent)))){I?r.removeItem(Q[W-1]):r.removeItem(u);const G=d.appendFormatTag(j,r.isFormatElement(j.nextElementSibling)&&!r.isRangeFormatElement(j.nextElementSibling)?j.nextElementSibling:null);r.copyFormatAttributes(G,j),d.setRange(G,1,G,1);break}if(I){b.insertHTML(x.collapsed&&r.isBreak(x.startContainer.childNodes[x.startOffset-1])?"<br>":"<br><br>",!0,!1);let G=$.focusNode;const ee=$.focusOffset;j===G&&(G=G.childNodes[ee-W>1?ee-1:ee]),d.setRange(G,1,G,1)}else{const G=$.focusNode.nextSibling,ee=r.createElement("BR");d.insertNode(ee,null,!1);const re=ee.previousSibling,ce=ee.nextSibling;!r.isBreak(G)&&!r.isBreak(re)&&(!ce||r.onlyZeroWidthSpace(ce))?(ee.parentNode.insertBefore(ee.cloneNode(!1),ee),d.setRange(ee,1,ee,1)):d.setRange(ce,0,ce,0)}h._onShortcutKey=!0;break}if(x.collapsed&&(U||P)){h._enterPrevent(c);const I=r.createElement("BR"),$=r.createElement(N.nodeName);r.copyTagAttributes($,N,s.lineAttrReset);let Q=I;do{if(!r.isBreak(u)&&u.nodeType===1){const W=u.cloneNode(!1);W.appendChild(Q),Q=W}u=u.parentNode}while(N!==u&&N.contains(u));$.appendChild(Q),N.parentNode.insertBefore($,U&&!P?N:N.nextElementSibling),P&&d.setRange(I,1,I,1);break}if(N){c.stopPropagation();let I,$=0;if(x.collapsed)r.onlyZeroWidthSpace(N)?I=d.appendFormatTag(N,N.cloneNode(!1)):I=r.splitElement(x.endContainer,x.endOffset,r.getElementDepth(N));else{const Q=r.getFormatElement(x.startContainer,null)!==r.getFormatElement(x.endContainer,null),W=N.cloneNode(!1);W.innerHTML="<br>";const X=x.commonAncestorContainer,q=X===x.startContainer&&X===x.endContainer&&r.onlyZeroWidthSpace(X)?x:d.removeNode();if(I=r.getFormatElement(q.container,null),!I){r.isWysiwygDiv(q.container)&&(h._enterPrevent(c),e.element.wysiwyg.appendChild(W),I=W,r.copyTagAttributes(I,N,s.lineAttrReset),d.setRange(I,$,I,$));break}const G=r.getRangeFormatElement(q.container);if(I=I.contains(G)?r.getChildElement(G,r.getFormatElement.bind(r)):I,Q){if(P&&!U)I.parentNode.insertBefore(W,!q.prevContainer||q.container===q.prevContainer?I.nextElementSibling:I),I=W,$=0;else if($=q.offset,U){const ee=I.parentNode.insertBefore(W,I);P&&(I=ee,$=0)}}else P&&U?(I.parentNode.insertBefore(W,q.prevContainer&&q.container===q.prevContainer?I.nextElementSibling:I),I=W,$=0):I=r.splitElement(q.container,q.offset,r.getElementDepth(N))}h._enterPrevent(c),r.copyTagAttributes(I,N,s.lineAttrReset),d.setRange(I,$,I,$);break}}if(E)break;if(k&&r.getParentElement(k,"FIGCAPTION")&&r.getParentElement(k,r.isList)&&(h._enterPrevent(c),N=d.appendFormatTag(N,null),d.setRange(N,0,N,0)),T){c.preventDefault(),c.stopPropagation(),d.containerOff(),d.controllersOff();const P=e[T],U=P._container,I=U.previousElementSibling||U.nextElementSibling;let $=null;r.isListCell(U.parentNode)?$=r.createElement("BR"):($=r.createElement(r.isFormatElement(I)&&!r.isRangeFormatElement(I)?I.nodeName:s.defaultTag),$.innerHTML="<br>"),v?U.parentNode.insertBefore($,U):U.parentNode.insertBefore($,U.nextElementSibling),d.callPlugin(T,function(){d.selectComponent(P._element,T)===!1&&d.blur()},null)}break;case 27:if(T)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?_: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&&!_&&!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(_,x){if(x||(x=0),c.preventDefault(),c.stopPropagation(),!_)return;let E=d.getFileComponent(_);E?d.selectComponent(E.target,E.pluginName):(d.setRange(_,x,_,x),d.controllersOff())},v=r.getParentElement(u,"table");if(v){const _=r.getParentElement(u,"tr"),x=r.getParentElement(u,"td");let E=x,T=x;if(x){for(;E&&E.firstChild;)E=E.firstChild;for(;T&&T.lastChild;)T=T.lastChild}let N=u;for(;N&&N.firstChild;)N=N.firstChild;const k=N===E,D=N===T;let M=null,A=0;if(c.keyCode===38&&k){const R=_&&_.previousElementSibling;for(R?M=R.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&&D){const R=_&&_.nextElementSibling;for(R?M=R.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 _=/37|38/.test(c.keyCode),x=/39|40/.test(c.keyCode);if(_){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 _=d.getSelectionNode();if(d._isBalloon&&(d._isBalloonAlways&&u!==27||!y.collapsed))if(d._isBalloonAlways)u!==27&&h._showToolbarBalloonDelay();else{h._showToolbarBalloon();return}let x=_;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(_)&&_.textContent===""&&_.children.length===0){c.preventDefault(),c.stopPropagation(),_.innerHTML="";const M=r.createElement(r.isFormatElement(d._variable.currentNodes[0])?d._variable.currentNodes[0]:s.defaultTag);M.innerHTML="<br>",_.appendChild(M),d.setRange(M,0,M,0),h._applyTagEffects(),d.history.push(!1);return}const T=r.getFormatElement(_,null),N=r.getRangeFormatElement(_,null),k=d._formatAttrsTemp;if(k){for(let M=0,A=k.length;M<A;M++){if(u===13&&/^id$/i.test(k[M].name)){T.removeAttribute("id");continue}T.setAttribute(k[M].name,k[M].value)}d._formatAttrsTemp=null}if(!T&&y.collapsed&&!r.isComponent(_)&&!r.isList(_)&&d._setDefaultFormat(r.isRangeFormatElement(N)?"DIV":s.defaultTag)!==null&&(_=d.getSelectionNode()),!p&&!v&&!h._nonTextKeyCode.test(u)&&_.nodeType===3&&r.zeroWidthRegExp.test(_.textContent)&&!(c.isComposing!==void 0?c.isComposing:h._IEisComposing)){let M=y.startOffset,A=y.endOffset;const R=(_.textContent.substring(0,A).match(h._frontZeroWidthReg)||"").length;M=y.startOffset-R,A=y.endOffset-R,_.textContent=_.textContent.replace(r.zeroWidthRegExp,""),d.setRange(_,M<0?0:M,_,A<0?0:A)}h._deleteKeyCode.test(u)&&T&&r.onlyZeroWidthSpace(T.textContent)&&!T.previousElementSibling&&(T.innerHTML="<br>",d.setRange(T,0,T,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),_=r.isCell(v),x=r.isCell(y),E=c.commonAncestorContainer;if((_&&!v.previousElementSibling&&!v.parentElement.previousElementSibling||x&&!y.nextElementSibling&&!y.parentElement.nextElementSibling)&&v!==y)if(!_)r.removeItem(r.getParentElement(y,function(k){return E===k.parentNode}));else if(!x)r.removeItem(r.getParentElement(v,function(k){return E===k.parentNode}));else return r.removeItem(r.getParentElement(v,function(k){return E===k.parentNode})),d.nativeFocus(),!0;const T=u.nodeType===1?r.getParentElement(u,".se-component"):null,N=p.nodeType===1?r.getParentElement(p,".se-component"):null;return T&&r.removeItem(T),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 _=d.getRange(),x=r.createElement("DIV"),E={sc:_.startContainer,so:_.startOffset,ec:_.endContainer,eo:_.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 _=/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,""),_&&(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 T=y.files;if(T.length>0&&!_)return/^image/.test(T[0].type)&&d.plugins.image&&b.insertImage(T),!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,_=v.wysiwyg;do y+=_.scrollTop,_=_.parentElement;while(_&&!/^(BODY|HTML)$/i.test(_.nodeName));const x=v.wysiwyg.scrollTop,E=h._getEditorOffsets(null),T=r.getOffset(u,v.wysiwygFrame).top+x,N=c.pageY+y+(s.iframe&&!s.toolbarContainer?v.toolbar.offsetHeight:0),k=T+(s.iframe?y:E.top),D=r.isListCell(u.parentNode);let M="",A="";if((D?!u.previousSibling:!r.isFormatElement(u.previousElementSibling))&&N<k+20)A=T,M="t";else if((D?!u.nextSibling:!r.isFormatElement(u.nextElementSibling))&&N>k+u.offsetHeight-20)A=T+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 _=v?y:y.firstChild;d.setRange(_,1,_,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,_;p<v;p++)_=o[p],y=_[0]*1,c.push(y),u[y]=_[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=no._createToolBar(l,c,d.plugins,s);o=u.responsiveButtons,h._setResponsiveToolbar(),e.element.toolbar.replaceChild(u._buttonTray,e.element._buttonTray);const p=io(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(_,x){for(let E in x)if(r.hasOwn(x,E))if(E==="plugins"&&x[E]&&_[E]){let T=_[E],N=x[E];T=T.length?T:a.Object.keys(T).map(function(k){return T[k]}),N=N.length?N:a.Object.keys(N).map(function(k){return N[k]}),_[E]=N.filter(function(k){return T.indexOf(k)===-1}).concat(T)}else _[E]=x[E];return _},{}),p=e.element,v=p.wysiwyg.innerHTML,y=no._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 _=l.createRange().createContextualFragment(c).childNodes;if(p){const M=d._charTypeHTML?"outerHTML":"textContent";let A="";for(let R=0,z=_.length;R<z;R++)A+=_[R][M];if(!d.checkCharCount(A,null))return}let x,E,T,N,k;for(;x=_[0];){if(N&&N.nodeType===3&&E&&E.nodeType===1&&r.isBreak(x)){N=x,r.removeItem(x);continue}T=d.insertNode(x,E,!1),E=T.container||T,k||(k=T),N=x}N.nodeType===3&&E.nodeType===1&&(E=N);const D=E.nodeType===3?T.endOffset||E.textContent.length:E.childNodes.length;v?d.setRange(k.container||k,k.startOffset||0,E,D):d.setRange(E,D,E,D)}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 _=0,x=y.length;_<x;_++)y[_]&&v.appendChild(y[_])}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 w=e.element,C=w.originElement,S=w.topArea;return C.style.display="none",S.style.display="block",s.iframe&&w.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),w.editorArea.appendChild(w.wysiwygFrame),w=C=S=null,s.iframe||(d._editorInit(!1,s.value),s.value=null),b}const KS={init:function(e){return{create:(function(t,n){return this.create(t,n,e)}).bind(this)}},create:function(e,t,n){me._propertiesInit(),typeof t!="object"&&(t={}),n&&(t=[n,t].reduce(function(o,l){for(let a in l)if(me.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=no.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 GS(io(i,s.constructed,s.options),s.pluginCallButtons,s.plugins,s.options.lang,t,s._responsiveButtons)}},XS=Object.freeze(Object.defineProperty({__proto__:null,default:KS},Symbol.toStringTag,{value:"Module"})),QS=mf(XS);function JS(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var hl={};Object.defineProperty(hl,"__esModule",{value:!0});var e4=function(e){switch(typeof e){case"object":return e;case"string":return JS("suneditor/src/lang/".concat(e,".js"));default:return}};hl.default=e4;var Un={};Object.defineProperty(Un,"__esModule",{value:!0});Un.uploadBeforeEvents=Un.events=void 0;Un.events=["onMouseDown","onScroll","onInput","onClick","onKeyUp","onKeyDown","onFocus","onImageUpload","onAudioUpload","onVideoUpload","onImageUploadError","onVideoUploadError","onAudioUploadError","onSave","onSetToolbarButtons","imageUploadHandler","toggleCodeView","toggleFullScreen","showInline","showController","onCopy","onCut","onDrop","onPaste"];Un.uploadBeforeEvents=["onImageUploadBefore","onVideoUploadBefore","onAudioUploadBefore"];var fi=Be&&Be.__assign||function(){return fi=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},fi.apply(this,arguments)},t4=Be&&Be.__createBinding||(Object.create?function(e,t,n,i){i===void 0&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]}),n4=Be&&Be.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i4=Be&&Be.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&t4(t,e,n);return n4(t,e),t},pl=Be&&Be.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ul,"__esModule",{value:!0});var dt=i4(K),s4=pl(US),r4=pl(QS),tc=pl(hl),nc=Un,o4=function(e){var t=e.name,n=e.lang,i=e.setOptions,s=i===void 0?{}:i,o=e.placeholder,l=e.width,a=l===void 0?"100%":l,r=e.height,f=e.defaultValue,d=e.setContents,h=e.setDefaultStyle,b=e.getSunEditorInstance,w=e.appendContents,C=e.setAllPlugins,S=C===void 0?!0:C,c=e.disable,u=c===void 0?!1:c,p=e.readOnly,v=p===void 0?!1:p,y=e.hide,_=y===void 0?!1:y,x=e.hideToolbar,E=x===void 0?!1:x,T=e.disableToolbar,N=T===void 0?!1:T,k=e.onChange,D=e.autoFocus,M=e.onBlur,A=e.onLoad,R=(0,dt.useRef)(null),z=(0,dt.useRef)(null),V=(0,dt.useRef)(!0);return(0,dt.useEffect)(function(){var H,F=fi(fi({},s),{lang:n?(0,tc.default)(n):s.lang,width:a??s.width,placeholder:o??s.placeholder,plugins:(H=s.plugins)!==null&&H!==void 0?H:S?s4.default:void 0,height:r??s.height,value:f??s.value,defaultStyle:h??s.defaultStyle});return t&&F.value&&(R.current.value=F.value),z.current=r4.default.create(R.current,F),b&&b(z.current),z.current.onload=function(L,O){return O||(d&&(z.current.setContents(d),z.current.core.focusEdge(null)),w&&z.current.appendContents(w),z.current.util.isIE&&z.current.core._createDefaultRange(),u&&z.current.disable(),v&&z.current.readOnly(!0),_&&z.current.hide(),E&&z.current.toolbar.hide(),N&&z.current.toolbar.disable(),D===!1?z.current.core.context.element.wysiwyg.blur():D&&z.current.core.context.element.wysiwyg.focus()),A==null?void 0:A(O)},z.current.onChange=function(L){t&&R.current&&(R.current.value=L),k&&k(L)},M&&(z.current.onBlur=function(L){return M(L,z.current.getContents(!0))}),nc.uploadBeforeEvents.forEach(function(L){var O=e[L];z.current&&O&&(z.current[L]=function(j,P,U,I){return O(j,P,I)})}),nc.events.forEach(function(L){var O=e[L];O&&z.current&&(z.current[L]=O)}),function(){z.current&&z.current.destroy(),z.current=null}},[]),(0,dt.useEffect)(function(){var H;V.current||(H=z.current)===null||H===void 0||H.setOptions({lang:(0,tc.default)(n)})},[n]),(0,dt.useEffect)(function(){var H;V.current||(H=z.current)===null||H===void 0||H.setOptions({placeholder:o,height:r,width:a})},[o,r,a]),(0,dt.useEffect)(function(){var H;h&&!V.current&&((H=z.current)===null||H===void 0||H.setDefaultStyle(h))},[h]),(0,dt.useEffect)(function(){var H,F;!V.current&&d!==void 0&&!(!((H=z.current)===null||H===void 0)&&H.core.hasFocus)&&((F=z.current)===null||F===void 0||F.setContents(d))},[d]),(0,dt.useEffect)(function(){var H,F,L;!V.current&&w!==void 0&&!(!((H=z.current)===null||H===void 0)&&H.core.hasFocus)&&((F=z.current)===null||F===void 0||F.appendContents(w),(L=z.current)===null||L===void 0||L.core.focusEdge(null))},[w]),(0,dt.useEffect)(function(){var H,F,L,O,j,P,U,I,$;V.current||((H=z.current)===null||H===void 0||H.readOnly(v),E?(F=z.current)===null||F===void 0||F.toolbar.hide():(L=z.current)===null||L===void 0||L.toolbar.show(),N?(O=z.current)===null||O===void 0||O.toolbar.disable():(j=z.current)===null||j===void 0||j.toolbar.enable(),u?(P=z.current)===null||P===void 0||P.disable():(U=z.current)===null||U===void 0||U.enable(),_?(I=z.current)===null||I===void 0||I.hide():($=z.current)===null||$===void 0||$.show())},[u,E,N,_,v]),(0,dt.useEffect)(function(){V.current=!1},[]),dt.default.createElement("textarea",fi({style:{visibility:"hidden"},ref:R},{name:t}))};ul.default=o4;var Jt={};Object.defineProperty(Jt,"__esModule",{value:!0});Jt.formatting=Jt.complex=Jt.basic=void 0;Jt.basic=[["font","fontSize"],["fontColor"],["horizontalRule"],["link","image"]];Jt.complex=[["undo","redo"],["font","fontSize","formatBlock"],["bold","underline","italic","strike","subscript","superscript"],["removeFormat"],"/",["fontColor","hiliteColor"],["outdent","indent"],["align","horizontalRule","list","table"],["link","image","video"],["fullScreen","showBlocks","codeView"],["preview","print"],["save","template"]];Jt.formatting=[["undo","redo"],["bold","underline","italic","strike","subscript","superscript"],["removeFormat"],["outdent","indent"],["fullScreen","showBlocks","codeView"],["preview","print"]];var l4=Be&&Be.__createBinding||(Object.create?function(e,t,n,i){i===void 0&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]}),a4=Be&&Be.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),c4=Be&&Be.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&l4(t,e,n);return a4(t,e),t},u4=Be&&Be.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(rr,"__esModule",{value:!0});rr.buttonList=void 0;var d4=u4(ul);rr.buttonList=c4(Jt);var f4=rr.default=d4.default;const ml=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(!1),d=b=>{a.current=b,f(!0)};m.useImperativeHandle(l,()=>({getContents:()=>{var b;return(b=a.current)==null?void 0:b.getContents()},setContents:b=>{var w;return(w=a.current)==null?void 0:w.setContents(b)},insertHTML:b=>{var w;return(w=a.current)==null?void 0:w.insertHTML(b)},focus:()=>{var b,w;return(w=(b=a.current)==null?void 0:b.core)==null?void 0:w.focus()},blur:()=>{var b,w;return(w=(b=a.current)==null?void 0:b.core)==null?void 0:w.blur()}}),[]),m.useEffect(()=>{r&&a.current&&a.current.getContents()!==e&&a.current.setContents(e)},[e,r]);const h=b=>{t==null||t(b)};return g.jsx("div",{className:J("sun-editor-wrapper",s),children:g.jsx(f4,{getSunEditorInstance:d,defaultValue:"",onChange:h,placeholder:n,height:i,setOptions:{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,resizingBar:!1,charCounter:!0,maxCharCount:1e4,width:"100%",mode:"classic",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}],...o}})})});ml.displayName="RichTextEditor";function h4(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:w,...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:w})};f.displayName=o+"Provider";function d(h,b){var S;const w=((S=b==null?void 0:b[e])==null?void 0:S[r])||a,C=m.useContext(w);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,p4(s,...t)]}function p4(...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 m4(e){const t=g4(e),n=m.forwardRef((i,s)=>{const{children:o,...l}=i,a=m.Children.toArray(o),r=a.find(b4);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 g4(e){const t=m.forwardRef((n,i)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const l=x4(s),a=y4(o,s.props);return s.type!==m.Fragment&&(a.ref=i?ze(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 v4=Symbol("radix.slottable");function b4(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===v4}function y4(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 x4(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 _4=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],w4=_4.reduce((e,t)=>{const n=m4(`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 C4(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:w,...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:w})};f.displayName=o+"Provider";function d(h,b){var S;const w=((S=b==null?void 0:b[e])==null?void 0:S[r])||a,C=m.useContext(w);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,S4(s,...t)]}function S4(...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 Jh(e){const t=E4(e),n=m.forwardRef((i,s)=>{const{children:o,...l}=i,a=m.Children.toArray(o),r=a.find(T4);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 E4(e){const t=m.forwardRef((n,i)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const l=M4(s),a=k4(o,s.props);return s.type!==m.Fragment&&(a.ref=i?ze(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 N4=Symbol("radix.slottable");function T4(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===N4}function k4(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 M4(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 A4=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ui=A4.reduce((e,t)=>{const n=Jh(`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 D4(e,t){e&&Ti.flushSync(()=>e.dispatchEvent(t))}var so=["Enter"," "],R4=["ArrowDown","PageUp","Home"],e0=["ArrowUp","PageDown","End"],L4=[...R4,...e0],O4={ltr:[...so,"ArrowRight"],rtl:[...so,"ArrowLeft"]},P4={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Yi="Menu",[wi,I4,B4]=yo(Yi),[bn,t0]=C4(Yi,[B4,nn,Zs]),qi=nn(),n0=Zs(),[i0,ln]=bn(Yi),[F4,Zi]=bn(Yi),s0=e=>{const{__scopeMenu:t,open:n=!1,children:i,dir:s,onOpenChange:o,modal:l=!0}=e,a=qi(t),[r,f]=m.useState(null),d=m.useRef(!1),h=Ze(o),b=Di(s);return m.useEffect(()=>{const w=()=>{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",w,{capture:!0}),()=>{document.removeEventListener("keydown",w,{capture:!0}),document.removeEventListener("pointerdown",C,{capture:!0}),document.removeEventListener("pointermove",C,{capture:!0})}},[]),g.jsx(Oi,{...a,children:g.jsx(i0,{scope:t,open:n,onOpenChange:h,content:r,onContentChange:f,children:g.jsx(F4,{scope:t,onClose:m.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:d,dir:b,modal:l,children:i})})})};s0.displayName=Yi;var j4="MenuAnchor",gl=m.forwardRef((e,t)=>{const{__scopeMenu:n,...i}=e,s=qi(n);return g.jsx(Pi,{...s,...i,ref:t})});gl.displayName=j4;var vl="MenuPortal",[z4,r0]=bn(vl,{forceMount:void 0}),o0=e=>{const{__scopeMenu:t,forceMount:n,children:i,container:s}=e,o=ln(vl,t);return g.jsx(z4,{scope:t,forceMount:n,children:g.jsx(Ke,{present:n||o.open,children:g.jsx(Ii,{asChild:!0,container:s,children:i})})})};o0.displayName=vl;var mt="MenuContent",[H4,bl]=bn(mt),l0=m.forwardRef((e,t)=>{const n=r0(mt,e.__scopeMenu),{forceMount:i=n.forceMount,...s}=e,o=ln(mt,e.__scopeMenu),l=Zi(mt,e.__scopeMenu);return g.jsx(wi.Provider,{scope:e.__scopeMenu,children:g.jsx(Ke,{present:i||o.open,children:g.jsx(wi.Slot,{scope:e.__scopeMenu,children:l.modal?g.jsx(V4,{...s,ref:t}):g.jsx(W4,{...s,ref:t})})})})}),V4=m.forwardRef((e,t)=>{const n=ln(mt,e.__scopeMenu),i=m.useRef(null),s=ve(t,i);return m.useEffect(()=>{const o=i.current;if(o)return Bs(o)},[]),g.jsx(yl,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:oe(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),W4=m.forwardRef((e,t)=>{const n=ln(mt,e.__scopeMenu);return g.jsx(yl,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),$4=Jh("MenuContent.ScrollLock"),yl=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:w,disableOutsideScroll:C,...S}=e,c=ln(mt,n),u=Zi(mt,n),p=qi(n),v=n0(n),y=I4(n),[_,x]=m.useState(null),E=m.useRef(null),T=ve(t,E,c.onContentChange),N=m.useRef(0),k=m.useRef(""),D=m.useRef(0),M=m.useRef(null),A=m.useRef("right"),R=m.useRef(0),z=C?Bi:m.Fragment,V=C?{as:$4,allowPinchZoom:!0}:void 0,H=L=>{var W,X;const O=k.current+L,j=y().filter(q=>!q.disabled),P=document.activeElement,U=(W=j.find(q=>q.ref.current===P))==null?void 0:W.textValue,I=j.map(q=>q.textValue),$=n3(I,O,U),Q=(X=j.find(q=>q.textValue===$))==null?void 0:X.ref.current;(function q(G){k.current=G,window.clearTimeout(N.current),G!==""&&(N.current=window.setTimeout(()=>q(""),1e3))})(O),Q&&setTimeout(()=>Q.focus())};m.useEffect(()=>()=>window.clearTimeout(N.current),[]),As();const F=m.useCallback(L=>{var j,P;return A.current===((j=M.current)==null?void 0:j.side)&&s3(L,(P=M.current)==null?void 0:P.area)},[]);return g.jsx(H4,{scope:n,searchRef:k,onItemEnter:m.useCallback(L=>{F(L)&&L.preventDefault()},[F]),onItemLeave:m.useCallback(L=>{var O;F(L)||((O=E.current)==null||O.focus(),x(null))},[F]),onTriggerLeave:m.useCallback(L=>{F(L)&&L.preventDefault()},[F]),pointerGraceTimerRef:D,onPointerGraceIntentChange:m.useCallback(L=>{M.current=L},[]),children:g.jsx(z,{...V,children:g.jsx(Ri,{asChild:!0,trapped:s,onMountAutoFocus:oe(o,L=>{var O;L.preventDefault(),(O=E.current)==null||O.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:g.jsx(Gn,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:f,onPointerDownOutside:d,onFocusOutside:h,onInteractOutside:b,onDismiss:w,children:g.jsx(Gd,{asChild:!0,...v,dir:u.dir,orientation:"vertical",loop:i,currentTabStopId:_,onCurrentTabStopIdChange:x,onEntryFocus:oe(r,L=>{u.isUsingKeyboardRef.current||L.preventDefault()}),preventScrollOnEntryFocus:!0,children:g.jsx(Ps,{role:"menu","aria-orientation":"vertical","data-state":S0(c.open),"data-radix-menu-content":"",dir:u.dir,...p,...S,ref:T,style:{outline:"none",...S.style},onKeyDown:oe(S.onKeyDown,L=>{const j=L.target.closest("[data-radix-menu-content]")===L.currentTarget,P=L.ctrlKey||L.altKey||L.metaKey,U=L.key.length===1;j&&(L.key==="Tab"&&L.preventDefault(),!P&&U&&H(L.key));const I=E.current;if(L.target!==I||!L4.includes(L.key))return;L.preventDefault();const Q=y().filter(W=>!W.disabled).map(W=>W.ref.current);e0.includes(L.key)&&Q.reverse(),e3(Q)}),onBlur:oe(e.onBlur,L=>{L.currentTarget.contains(L.target)||(window.clearTimeout(N.current),k.current="")}),onPointerMove:oe(e.onPointerMove,Ci(L=>{const O=L.target,j=R.current!==L.clientX;if(L.currentTarget.contains(O)&&j){const P=L.clientX>R.current?"right":"left";A.current=P,R.current=L.clientX}}))})})})})})})});l0.displayName=mt;var U4="MenuGroup",xl=m.forwardRef((e,t)=>{const{__scopeMenu:n,...i}=e;return g.jsx(Ui.div,{role:"group",...i,ref:t})});xl.displayName=U4;var Y4="MenuLabel",a0=m.forwardRef((e,t)=>{const{__scopeMenu:n,...i}=e;return g.jsx(Ui.div,{...i,ref:t})});a0.displayName=Y4;var bs="MenuItem",ic="menu.itemSelect",or=m.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:i,...s}=e,o=m.useRef(null),l=Zi(bs,e.__scopeMenu),a=bl(bs,e.__scopeMenu),r=ve(t,o),f=m.useRef(!1),d=()=>{const h=o.current;if(!n&&h){const b=new CustomEvent(ic,{bubbles:!0,cancelable:!0});h.addEventListener(ic,w=>i==null?void 0:i(w),{once:!0}),D4(h,b),b.defaultPrevented?f.current=!1:l.onClose()}};return g.jsx(c0,{...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===" "||so.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})});or.displayName=bs;var c0=m.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:i=!1,textValue:s,...o}=e,l=bl(bs,n),a=n0(n),r=m.useRef(null),f=ve(t,r),[d,h]=m.useState(!1),[b,w]=m.useState("");return m.useEffect(()=>{const C=r.current;C&&w((C.textContent??"").trim())},[o.children]),g.jsx(wi.ItemSlot,{scope:n,disabled:i,textValue:s??b,children:g.jsx(Kd,{asChild:!0,...a,focusable:!i,children:g.jsx(Ui.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,Ci(C=>{i?l.onItemLeave(C):(l.onItemEnter(C),C.defaultPrevented||C.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:oe(e.onPointerLeave,Ci(C=>l.onItemLeave(C))),onFocus:oe(e.onFocus,()=>h(!0)),onBlur:oe(e.onBlur,()=>h(!1))})})})}),q4="MenuCheckboxItem",u0=m.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:i,...s}=e;return g.jsx(m0,{scope:e.__scopeMenu,checked:n,children:g.jsx(or,{role:"menuitemcheckbox","aria-checked":ys(n)?"mixed":n,...s,ref:t,"data-state":Cl(n),onSelect:oe(s.onSelect,()=>i==null?void 0:i(ys(n)?!0:!n),{checkForDefaultPrevented:!1})})})});u0.displayName=q4;var d0="MenuRadioGroup",[Z4,G4]=bn(d0,{value:void 0,onValueChange:()=>{}}),f0=m.forwardRef((e,t)=>{const{value:n,onValueChange:i,...s}=e,o=Ze(i);return g.jsx(Z4,{scope:e.__scopeMenu,value:n,onValueChange:o,children:g.jsx(xl,{...s,ref:t})})});f0.displayName=d0;var h0="MenuRadioItem",p0=m.forwardRef((e,t)=>{const{value:n,...i}=e,s=G4(h0,e.__scopeMenu),o=n===s.value;return g.jsx(m0,{scope:e.__scopeMenu,checked:o,children:g.jsx(or,{role:"menuitemradio","aria-checked":o,...i,ref:t,"data-state":Cl(o),onSelect:oe(i.onSelect,()=>{var l;return(l=s.onValueChange)==null?void 0:l.call(s,n)},{checkForDefaultPrevented:!1})})})});p0.displayName=h0;var _l="MenuItemIndicator",[m0,K4]=bn(_l,{checked:!1}),g0=m.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:i,...s}=e,o=K4(_l,n);return g.jsx(Ke,{present:i||ys(o.checked)||o.checked===!0,children:g.jsx(Ui.span,{...s,ref:t,"data-state":Cl(o.checked)})})});g0.displayName=_l;var X4="MenuSeparator",v0=m.forwardRef((e,t)=>{const{__scopeMenu:n,...i}=e;return g.jsx(Ui.div,{role:"separator","aria-orientation":"horizontal",...i,ref:t})});v0.displayName=X4;var Q4="MenuArrow",b0=m.forwardRef((e,t)=>{const{__scopeMenu:n,...i}=e,s=qi(n);return g.jsx(Is,{...s,...i,ref:t})});b0.displayName=Q4;var wl="MenuSub",[J4,y0]=bn(wl),x0=e=>{const{__scopeMenu:t,children:n,open:i=!1,onOpenChange:s}=e,o=ln(wl,t),l=qi(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(Oi,{...l,children:g.jsx(i0,{scope:t,open:i,onOpenChange:h,content:f,onContentChange:d,children:g.jsx(J4,{scope:t,contentId:st(),triggerId:st(),trigger:a,onTriggerChange:r,children:n})})})};x0.displayName=wl;var di="MenuSubTrigger",_0=m.forwardRef((e,t)=>{const n=ln(di,e.__scopeMenu),i=Zi(di,e.__scopeMenu),s=y0(di,e.__scopeMenu),o=bl(di,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(gl,{asChild:!0,...f,children:g.jsx(c0,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":S0(n.open),...e,ref:ze(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,Ci(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,Ci(h=>{var w,C;d();const b=(w=n.content)==null?void 0:w.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 w;const b=o.searchRef.current!=="";e.disabled||b&&h.key===" "||O4[i.dir].includes(h.key)&&(n.onOpenChange(!0),(w=n.content)==null||w.focus(),h.preventDefault())})})})});_0.displayName=di;var w0="MenuSubContent",C0=m.forwardRef((e,t)=>{const n=r0(mt,e.__scopeMenu),{forceMount:i=n.forceMount,...s}=e,o=ln(mt,e.__scopeMenu),l=Zi(mt,e.__scopeMenu),a=y0(w0,e.__scopeMenu),r=m.useRef(null),f=ve(t,r);return g.jsx(wi.Provider,{scope:e.__scopeMenu,children:g.jsx(Ke,{present:i||o.open,children:g.jsx(wi.Slot,{scope:e.__scopeMenu,children:g.jsx(yl,{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 w;const h=d.currentTarget.contains(d.target),b=P4[l.dir].includes(d.key);h&&b&&(o.onOpenChange(!1),(w=a.trigger)==null||w.focus(),d.preventDefault())})})})})})});C0.displayName=w0;function S0(e){return e?"open":"closed"}function ys(e){return e==="indeterminate"}function Cl(e){return ys(e)?"indeterminate":e?"checked":"unchecked"}function e3(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function t3(e,t){return e.map((n,i)=>e[(t+i)%e.length])}function n3(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=t3(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 i3(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 s3(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return i3(n,t)}function Ci(e){return t=>t.pointerType==="mouse"?e(t):void 0}var r3=s0,o3=gl,l3=o0,a3=l0,c3=xl,u3=a0,d3=or,f3=u0,h3=f0,p3=p0,m3=g0,g3=v0,v3=b0,b3=x0,y3=_0,x3=C0,lr="DropdownMenu",[_3]=h4(lr,[t0]),et=t0(),[w3,E0]=_3(lr),N0=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:lr});return g.jsx(w3,{scope:t,triggerId:st(),triggerRef:f,contentId:st(),open:d,onOpenChange:h,onOpenToggle:m.useCallback(()=>h(b=>!b),[h]),modal:a,children:g.jsx(r3,{...r,open:d,onOpenChange:h,dir:i,modal:a,children:n})})};N0.displayName=lr;var T0="DropdownMenuTrigger",k0=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:i=!1,...s}=e,o=E0(T0,n),l=et(n);return g.jsx(o3,{asChild:!0,...l,children:g.jsx(w4.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:ze(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())})})})});k0.displayName=T0;var C3="DropdownMenuPortal",M0=e=>{const{__scopeDropdownMenu:t,...n}=e,i=et(t);return g.jsx(l3,{...i,...n})};M0.displayName=C3;var A0="DropdownMenuContent",D0=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...i}=e,s=E0(A0,n),o=et(n),l=m.useRef(!1);return g.jsx(a3,{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)"}})});D0.displayName=A0;var S3="DropdownMenuGroup",R0=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...i}=e,s=et(n);return g.jsx(c3,{...s,...i,ref:t})});R0.displayName=S3;var E3="DropdownMenuLabel",L0=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...i}=e,s=et(n);return g.jsx(u3,{...s,...i,ref:t})});L0.displayName=E3;var N3="DropdownMenuItem",O0=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...i}=e,s=et(n);return g.jsx(d3,{...s,...i,ref:t})});O0.displayName=N3;var T3="DropdownMenuCheckboxItem",P0=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...i}=e,s=et(n);return g.jsx(f3,{...s,...i,ref:t})});P0.displayName=T3;var k3="DropdownMenuRadioGroup",I0=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...i}=e,s=et(n);return g.jsx(h3,{...s,...i,ref:t})});I0.displayName=k3;var M3="DropdownMenuRadioItem",B0=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...i}=e,s=et(n);return g.jsx(p3,{...s,...i,ref:t})});B0.displayName=M3;var A3="DropdownMenuItemIndicator",F0=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...i}=e,s=et(n);return g.jsx(m3,{...s,...i,ref:t})});F0.displayName=A3;var D3="DropdownMenuSeparator",j0=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...i}=e,s=et(n);return g.jsx(g3,{...s,...i,ref:t})});j0.displayName=D3;var R3="DropdownMenuArrow",L3=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...i}=e,s=et(n);return g.jsx(v3,{...s,...i,ref:t})});L3.displayName=R3;var O3=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(b3,{...l,open:a,onOpenChange:r,children:n})},P3="DropdownMenuSubTrigger",z0=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...i}=e,s=et(n);return g.jsx(y3,{...s,...i,ref:t})});z0.displayName=P3;var I3="DropdownMenuSubContent",H0=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...i}=e,s=et(n);return g.jsx(x3,{...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)"}})});H0.displayName=I3;var B3=N0,F3=k0,V0=M0,W0=D0,j3=R0,$0=L0,U0=O0,Y0=P0,z3=I0,q0=B0,Z0=F0,G0=j0,H3=O3,K0=z0,X0=H0;const Sl=B3,El=F3,V3=j3,W3=V0,$3=H3,U3=z3,Q0=m.forwardRef(({className:e,inset:t,children:n,...i},s)=>g.jsxs(K0,{ref:s,className:J("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(ki,{className:"ml-auto h-4 w-4"})]}));Q0.displayName=K0.displayName;const J0=m.forwardRef(({className:e,...t},n)=>g.jsx(X0,{ref:n,className:J("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}));J0.displayName=X0.displayName;const ar=m.forwardRef(({className:e,sideOffset:t=4,...n},i)=>g.jsx(V0,{children:g.jsx(W0,{ref:i,sideOffset:t,className:J("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})}));ar.displayName=W0.displayName;const Si=m.forwardRef(({className:e,inset:t,...n},i)=>g.jsx(U0,{ref:i,className:J("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}));Si.displayName=U0.displayName;const ep=m.forwardRef(({className:e,children:t,checked:n,...i},s)=>g.jsxs(Y0,{ref:s,className:J("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(Z0,{children:g.jsx(gi,{className:"h-4 w-4"})})}),t]}));ep.displayName=Y0.displayName;const tp=m.forwardRef(({className:e,children:t,...n},i)=>g.jsxs(q0,{ref:i,className:J("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(Z0,{children:g.jsx(Rg,{className:"h-2 w-2 fill-current"})})}),t]}));tp.displayName=q0.displayName;const cr=m.forwardRef(({className:e,inset:t,...n},i)=>g.jsx($0,{ref:i,className:J("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));cr.displayName=$0.displayName;const Ei=m.forwardRef(({className:e,...t},n)=>g.jsx(G0,{ref:n,className:J("-mx-1 my-1 h-px bg-muted",e),...t}));Ei.displayName=G0.displayName;const np=({className:e,...t})=>g.jsx("span",{className:J("ml-auto text-xs tracking-widest opacity-60",e),...t});np.displayName="DropdownMenuShortcut";function Y3(e){const t=q3(e),n=m.forwardRef((i,s)=>{const{children:o,...l}=i,a=m.Children.toArray(o),r=a.find(G3);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 q3(e){const t=m.forwardRef((n,i)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const l=X3(s),a=K3(o,s.props);return s.type!==m.Fragment&&(a.ref=i?ze(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 Z3=Symbol("radix.slottable");function G3(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Z3}function K3(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 X3(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 Q3=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Gi=Q3.reduce((e,t)=>{const n=Y3(`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 J3(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:w,...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:w})};f.displayName=o+"Provider";function d(h,b){var S;const w=((S=b==null?void 0:b[e])==null?void 0:S[r])||a,C=m.useContext(w);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,eE(s,...t)]}function eE(...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 tE(e,t){return m.useReducer((n,i)=>t[n][i]??n,e)}var Nl="ScrollArea",[ip]=J3(Nl),[nE,gt]=ip(Nl),sp=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),[w,C]=m.useState(null),[S,c]=m.useState(null),[u,p]=m.useState(0),[v,y]=m.useState(0),[_,x]=m.useState(!1),[E,T]=m.useState(!1),N=ve(t,D=>r(D)),k=Di(s);return g.jsx(nE,{scope:n,type:i,dir:k,scrollHideDelay:o,scrollArea:a,viewport:f,onViewportChange:d,content:h,onContentChange:b,scrollbarX:w,onScrollbarXChange:C,scrollbarXEnabled:_,onScrollbarXEnabledChange:x,scrollbarY:S,onScrollbarYChange:c,scrollbarYEnabled:E,onScrollbarYEnabledChange:T,onCornerWidthChange:p,onCornerHeightChange:y,children:g.jsx(Gi.div,{dir:k,...l,ref:N,style:{position:"relative","--radix-scroll-area-corner-width":u+"px","--radix-scroll-area-corner-height":v+"px",...e.style}})})});sp.displayName=Nl;var rp="ScrollAreaViewport",op=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:i,nonce:s,...o}=e,l=gt(rp,n),a=m.useRef(null),r=ve(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(Gi.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})})]})});op.displayName=rp;var Pt="ScrollAreaScrollbar",Tl=m.forwardRef((e,t)=>{const{forceMount:n,...i}=e,s=gt(Pt,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(iE,{...i,ref:t,forceMount:n}):s.type==="scroll"?g.jsx(sE,{...i,ref:t,forceMount:n}):s.type==="auto"?g.jsx(lp,{...i,ref:t,forceMount:n}):s.type==="always"?g.jsx(kl,{...i,ref:t}):null});Tl.displayName=Pt;var iE=m.forwardRef((e,t)=>{const{forceMount:n,...i}=e,s=gt(Pt,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(lp,{"data-state":o?"visible":"hidden",...i,ref:t})})}),sE=m.forwardRef((e,t)=>{const{forceMount:n,...i}=e,s=gt(Pt,e.__scopeScrollArea),o=e.orientation==="horizontal",l=dr(()=>r("SCROLL_END"),100),[a,r]=tE("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 w=f[d];h!==w&&(r("SCROLL"),l()),h=w};return f.addEventListener("scroll",b),()=>f.removeEventListener("scroll",b)}},[s.viewport,o,r,l]),g.jsx(Ke,{present:n||a!=="hidden",children:g.jsx(kl,{"data-state":a==="hidden"?"hidden":"visible",...i,ref:t,onPointerEnter:oe(e.onPointerEnter,()=>r("POINTER_ENTER")),onPointerLeave:oe(e.onPointerLeave,()=>r("POINTER_LEAVE"))})})}),lp=m.forwardRef((e,t)=>{const n=gt(Pt,e.__scopeScrollArea),{forceMount:i,...s}=e,[o,l]=m.useState(!1),a=e.orientation==="horizontal",r=dr(()=>{if(n.viewport){const f=n.viewport.offsetWidth<n.viewport.scrollWidth,d=n.viewport.offsetHeight<n.viewport.scrollHeight;l(a?f:d)}},10);return Yn(n.viewport,r),Yn(n.content,r),g.jsx(Ke,{present:i||o,children:g.jsx(kl,{"data-state":o?"visible":"hidden",...s,ref:t})})}),kl=m.forwardRef((e,t)=>{const{orientation:n="vertical",...i}=e,s=gt(Pt,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=fp(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,w){return uE(b,l.current,a,w)}return n==="horizontal"?g.jsx(rE,{...d,ref:t,onThumbPositionChange:()=>{if(s.viewport&&o.current){const b=s.viewport.scrollLeft,w=sc(b,a,s.dir);o.current.style.transform=`translate3d(${w}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(oE,{...d,ref:t,onThumbPositionChange:()=>{if(s.viewport&&o.current){const b=s.viewport.scrollTop,w=sc(b,a);o.current.style.transform=`translate3d(0, ${w}px, 0)`}},onWheelScroll:b=>{s.viewport&&(s.viewport.scrollTop=b)},onDragScroll:b=>{s.viewport&&(s.viewport.scrollTop=h(b))}}):null}),rE=m.forwardRef((e,t)=>{const{sizes:n,onSizesChange:i,...s}=e,o=gt(Pt,e.__scopeScrollArea),[l,a]=m.useState(),r=m.useRef(null),f=ve(t,r,o.onScrollbarXChange);return m.useEffect(()=>{r.current&&a(getComputedStyle(r.current))},[r]),g.jsx(cp,{"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":ur(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),pp(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:_s(l.paddingLeft),paddingEnd:_s(l.paddingRight)}})}})}),oE=m.forwardRef((e,t)=>{const{sizes:n,onSizesChange:i,...s}=e,o=gt(Pt,e.__scopeScrollArea),[l,a]=m.useState(),r=m.useRef(null),f=ve(t,r,o.onScrollbarYChange);return m.useEffect(()=>{r.current&&a(getComputedStyle(r.current))},[r]),g.jsx(cp,{"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":ur(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),pp(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:_s(l.paddingTop),paddingEnd:_s(l.paddingBottom)}})}})}),[lE,ap]=ip(Pt),cp=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,w=gt(Pt,n),[C,S]=m.useState(null),c=ve(t,N=>S(N)),u=m.useRef(null),p=m.useRef(""),v=w.viewport,y=i.content-i.viewport,_=Ze(d),x=Ze(r),E=dr(h,10);function T(N){if(u.current){const k=N.clientX-u.current.left,D=N.clientY-u.current.top;f({x:k,y:D})}}return m.useEffect(()=>{const N=k=>{const D=k.target;(C==null?void 0:C.contains(D))&&_(k,y)};return document.addEventListener("wheel",N,{passive:!1}),()=>document.removeEventListener("wheel",N,{passive:!1})},[v,C,y,_]),m.useEffect(x,[i,x]),Yn(C,E),Yn(w.content,E),g.jsx(lE,{scope:n,scrollbar:C,hasThumb:s,onThumbChange:Ze(o),onThumbPointerUp:Ze(l),onThumbPositionChange:x,onThumbPointerDown:Ze(a),children:g.jsx(Gi.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",w.viewport&&(w.viewport.style.scrollBehavior="auto"),T(N))}),onPointerMove:oe(e.onPointerMove,T),onPointerUp:oe(e.onPointerUp,N=>{const k=N.target;k.hasPointerCapture(N.pointerId)&&k.releasePointerCapture(N.pointerId),document.body.style.webkitUserSelect=p.current,w.viewport&&(w.viewport.style.scrollBehavior=""),u.current=null})})})}),xs="ScrollAreaThumb",up=m.forwardRef((e,t)=>{const{forceMount:n,...i}=e,s=ap(xs,e.__scopeScrollArea);return g.jsx(Ke,{present:n||s.hasThumb,children:g.jsx(aE,{ref:t,...i})})}),aE=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:i,...s}=e,o=gt(xs,n),l=ap(xs,n),{onThumbPositionChange:a}=l,r=ve(t,h=>l.onThumbChange(h)),f=m.useRef(void 0),d=dr(()=>{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 w=dE(h,a);f.current=w,a()}};return a(),h.addEventListener("scroll",b),()=>h.removeEventListener("scroll",b)}},[o.viewport,d,a]),g.jsx(Gi.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 w=h.target.getBoundingClientRect(),C=h.clientX-w.left,S=h.clientY-w.top;l.onThumbPointerDown({x:C,y:S})}),onPointerUp:oe(e.onPointerUp,l.onThumbPointerUp)})});up.displayName=xs;var Ml="ScrollAreaCorner",dp=m.forwardRef((e,t)=>{const n=gt(Ml,e.__scopeScrollArea),i=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&i?g.jsx(cE,{...e,ref:t}):null});dp.displayName=Ml;var cE=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,...i}=e,s=gt(Ml,n),[o,l]=m.useState(0),[a,r]=m.useState(0),f=!!(o&&a);return Yn(s.scrollbarX,()=>{var h;const d=((h=s.scrollbarX)==null?void 0:h.offsetHeight)||0;s.onCornerHeightChange(d),r(d)}),Yn(s.scrollbarY,()=>{var h;const d=((h=s.scrollbarY)==null?void 0:h.offsetWidth)||0;s.onCornerWidthChange(d),l(d)}),f?g.jsx(Gi.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 _s(e){return e?parseInt(e,10):0}function fp(e,t){const n=e/t;return isNaN(n)?0:n}function ur(e){const t=fp(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,i=(e.scrollbar.size-n)*t;return Math.max(i,18)}function uE(e,t,n,i="ltr"){const s=ur(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 hp([r,f],h)(e)}function sc(e,t,n="ltr"){const i=ur(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=zr(e,r);return hp([0,l],[0,a])(f)}function hp(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 pp(e,t){return e>0&&e<t}var dE=(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 dr(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 Yn(e,t){const n=Ze(t);Ye(()=>{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 mp=sp,fE=op,hE=dp;const gp=m.forwardRef(({className:e,children:t,...n},i)=>g.jsxs(mp,{ref:i,className:J("relative overflow-hidden",e),...n,children:[g.jsx(fE,{className:"h-full w-full rounded-[inherit]",children:t}),g.jsx(Al,{}),g.jsx(hE,{})]}));gp.displayName=mp.displayName;const Al=m.forwardRef(({className:e,orientation:t="vertical",...n},i)=>g.jsx(Tl,{ref:i,orientation:t,className:J("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(up,{className:"relative flex-1 rounded-full bg-border"})}));Al.displayName=Tl.displayName;const vp=Es("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"}}),Dl=m.forwardRef(({className:e,variant:t,...n},i)=>g.jsx("div",{ref:i,role:"alert",className:J(vp({variant:t}),e),...n}));Dl.displayName="Alert";const Rl=m.forwardRef(({className:e,...t},n)=>g.jsx("h5",{ref:n,className:J("mb-1 font-medium leading-none tracking-tight",e),...t}));Rl.displayName="AlertTitle";const Ll=m.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:J("text-sm [&_p]:leading-relaxed",e),...t}));Ll.displayName="AlertDescription";const bp=m.forwardRef(({variant:e,title:t,children:n,className:i,...s},o)=>{const l={default:ca,destructive:Dg,success:Ag,warning:Mg,info:ca},a=l[e]||l.default;return g.jsxs(Dl,{ref:o,variant:e,className:i,...s,children:[g.jsx(a,{className:"h-4 w-4"}),t&&g.jsx(Rl,{children:t}),n&&g.jsx(Ll,{children:n})]})});bp.displayName="AlertWithIcon";function pE(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:w,...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:w})};f.displayName=o+"Provider";function d(h,b){var S;const w=((S=b==null?void 0:b[e])==null?void 0:S[r])||a,C=m.useContext(w);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,mE(s,...t)]}function mE(...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 gE=Symbol("radix.slottable");function vE(e){const t=({children:n})=>g.jsx(g.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=gE,t}var yp="AlertDialog",[bE]=pE(yp,[wd]),$t=wd(),xp=e=>{const{__scopeAlertDialog:t,...n}=e,i=$t(t);return g.jsx(Fd,{...i,...n,modal:!0})};xp.displayName=yp;var yE="AlertDialogTrigger",_p=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...i}=e,s=$t(n);return g.jsx(jd,{...s,...i,ref:t})});_p.displayName=yE;var xE="AlertDialogPortal",wp=e=>{const{__scopeAlertDialog:t,...n}=e,i=$t(t);return g.jsx(zd,{...i,...n})};wp.displayName=xE;var _E="AlertDialogOverlay",Cp=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...i}=e,s=$t(n);return g.jsx(Io,{...s,...i,ref:t})});Cp.displayName=_E;var On="AlertDialogContent",[wE,CE]=bE(On),SE=vE("AlertDialogContent"),Sp=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:i,...s}=e,o=$t(n),l=m.useRef(null),a=ve(t,l),r=m.useRef(null);return g.jsx(Gx,{contentName:On,titleName:Ep,docsSlug:"alert-dialog",children:g.jsx(wE,{scope:n,cancelRef:r,children:g.jsxs(Bo,{role:"alertdialog",...o,...s,ref:a,onOpenAutoFocus:oe(s.onOpenAutoFocus,f=>{var d;f.preventDefault(),(d=r.current)==null||d.focus({preventScroll:!0})}),onPointerDownOutside:f=>f.preventDefault(),onInteractOutside:f=>f.preventDefault(),children:[g.jsx(SE,{children:i}),g.jsx(NE,{contentRef:l})]})})})});Sp.displayName=On;var Ep="AlertDialogTitle",Np=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...i}=e,s=$t(n);return g.jsx(Fo,{...s,...i,ref:t})});Np.displayName=Ep;var Tp="AlertDialogDescription",kp=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...i}=e,s=$t(n);return g.jsx(jo,{...s,...i,ref:t})});kp.displayName=Tp;var EE="AlertDialogAction",Mp=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...i}=e,s=$t(n);return g.jsx(Ys,{...s,...i,ref:t})});Mp.displayName=EE;var Ap="AlertDialogCancel",Dp=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...i}=e,{cancelRef:s}=CE(Ap,n),o=$t(n),l=ve(t,s);return g.jsx(Ys,{...o,...i,ref:l})});Dp.displayName=Ap;var NE=({contentRef:e})=>{const t=`\`${On}\` requires a description for the component to be accessible for screen reader users.
|
|
252
|
+
`+d.convertHTMLForCodeView(u,!1));else{const p=r.createElement("DIV");p.innerHTML=u;const v=e.element.wysiwyg,y=p.children;for(let _=0,x=y.length;_<x;_++)y[_]&&v.appendChild(y[_])}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 C=e.element,w=C.originElement,S=C.topArea;return w.style.display="none",S.style.display="block",s.iframe&&C.wysiwygFrame.addEventListener("load",function(){r._setIframeDocument(this,s),d._editorInit(!1,s.value),s.value=null}),typeof w.nextElementSibling=="object"?w.parentNode.insertBefore(S,w.nextElementSibling):w.parentNode.appendChild(S),C.editorArea.appendChild(C.wysiwygFrame),C=w=S=null,s.iframe||(d._editorInit(!1,s.value),s.value=null),b}const KS={init:function(e){return{create:(function(t,n){return this.create(t,n,e)}).bind(this)}},create:function(e,t,n){me._propertiesInit(),typeof t!="object"&&(t={}),n&&(t=[n,t].reduce(function(o,l){for(let a in l)if(me.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=no.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 GS(io(i,s.constructed,s.options),s.pluginCallButtons,s.plugins,s.options.lang,t,s._responsiveButtons)}},XS=Object.freeze(Object.defineProperty({__proto__:null,default:KS},Symbol.toStringTag,{value:"Module"})),QS=mf(XS);function JS(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var hl={};Object.defineProperty(hl,"__esModule",{value:!0});var e4=function(e){switch(typeof e){case"object":return e;case"string":return JS("suneditor/src/lang/".concat(e,".js"));default:return}};hl.default=e4;var Un={};Object.defineProperty(Un,"__esModule",{value:!0});Un.uploadBeforeEvents=Un.events=void 0;Un.events=["onMouseDown","onScroll","onInput","onClick","onKeyUp","onKeyDown","onFocus","onImageUpload","onAudioUpload","onVideoUpload","onImageUploadError","onVideoUploadError","onAudioUploadError","onSave","onSetToolbarButtons","imageUploadHandler","toggleCodeView","toggleFullScreen","showInline","showController","onCopy","onCut","onDrop","onPaste"];Un.uploadBeforeEvents=["onImageUploadBefore","onVideoUploadBefore","onAudioUploadBefore"];var fi=Be&&Be.__assign||function(){return fi=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},fi.apply(this,arguments)},t4=Be&&Be.__createBinding||(Object.create?function(e,t,n,i){i===void 0&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]}),n4=Be&&Be.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i4=Be&&Be.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&t4(t,e,n);return n4(t,e),t},pl=Be&&Be.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ul,"__esModule",{value:!0});var dt=i4(K),s4=pl(US),r4=pl(QS),tc=pl(hl),nc=Un,o4=function(e){var t=e.name,n=e.lang,i=e.setOptions,s=i===void 0?{}:i,o=e.placeholder,l=e.width,a=l===void 0?"100%":l,r=e.height,f=e.defaultValue,d=e.setContents,h=e.setDefaultStyle,b=e.getSunEditorInstance,C=e.appendContents,w=e.setAllPlugins,S=w===void 0?!0:w,c=e.disable,u=c===void 0?!1:c,p=e.readOnly,v=p===void 0?!1:p,y=e.hide,_=y===void 0?!1:y,x=e.hideToolbar,E=x===void 0?!1:x,T=e.disableToolbar,N=T===void 0?!1:T,k=e.onChange,D=e.autoFocus,M=e.onBlur,A=e.onLoad,R=(0,dt.useRef)(null),z=(0,dt.useRef)(null),V=(0,dt.useRef)(!0);return(0,dt.useEffect)(function(){var H,F=fi(fi({},s),{lang:n?(0,tc.default)(n):s.lang,width:a??s.width,placeholder:o??s.placeholder,plugins:(H=s.plugins)!==null&&H!==void 0?H:S?s4.default:void 0,height:r??s.height,value:f??s.value,defaultStyle:h??s.defaultStyle});return t&&F.value&&(R.current.value=F.value),z.current=r4.default.create(R.current,F),b&&b(z.current),z.current.onload=function(L,O){return O||(d&&(z.current.setContents(d),z.current.core.focusEdge(null)),C&&z.current.appendContents(C),z.current.util.isIE&&z.current.core._createDefaultRange(),u&&z.current.disable(),v&&z.current.readOnly(!0),_&&z.current.hide(),E&&z.current.toolbar.hide(),N&&z.current.toolbar.disable(),D===!1?z.current.core.context.element.wysiwyg.blur():D&&z.current.core.context.element.wysiwyg.focus()),A==null?void 0:A(O)},z.current.onChange=function(L){t&&R.current&&(R.current.value=L),k&&k(L)},M&&(z.current.onBlur=function(L){return M(L,z.current.getContents(!0))}),nc.uploadBeforeEvents.forEach(function(L){var O=e[L];z.current&&O&&(z.current[L]=function(j,P,U,I){return O(j,P,I)})}),nc.events.forEach(function(L){var O=e[L];O&&z.current&&(z.current[L]=O)}),function(){z.current&&z.current.destroy(),z.current=null}},[]),(0,dt.useEffect)(function(){var H;V.current||(H=z.current)===null||H===void 0||H.setOptions({lang:(0,tc.default)(n)})},[n]),(0,dt.useEffect)(function(){var H;V.current||(H=z.current)===null||H===void 0||H.setOptions({placeholder:o,height:r,width:a})},[o,r,a]),(0,dt.useEffect)(function(){var H;h&&!V.current&&((H=z.current)===null||H===void 0||H.setDefaultStyle(h))},[h]),(0,dt.useEffect)(function(){var H,F;!V.current&&d!==void 0&&!(!((H=z.current)===null||H===void 0)&&H.core.hasFocus)&&((F=z.current)===null||F===void 0||F.setContents(d))},[d]),(0,dt.useEffect)(function(){var H,F,L;!V.current&&C!==void 0&&!(!((H=z.current)===null||H===void 0)&&H.core.hasFocus)&&((F=z.current)===null||F===void 0||F.appendContents(C),(L=z.current)===null||L===void 0||L.core.focusEdge(null))},[C]),(0,dt.useEffect)(function(){var H,F,L,O,j,P,U,I,$;V.current||((H=z.current)===null||H===void 0||H.readOnly(v),E?(F=z.current)===null||F===void 0||F.toolbar.hide():(L=z.current)===null||L===void 0||L.toolbar.show(),N?(O=z.current)===null||O===void 0||O.toolbar.disable():(j=z.current)===null||j===void 0||j.toolbar.enable(),u?(P=z.current)===null||P===void 0||P.disable():(U=z.current)===null||U===void 0||U.enable(),_?(I=z.current)===null||I===void 0||I.hide():($=z.current)===null||$===void 0||$.show())},[u,E,N,_,v]),(0,dt.useEffect)(function(){V.current=!1},[]),dt.default.createElement("textarea",fi({style:{visibility:"hidden"},ref:R},{name:t}))};ul.default=o4;var Jt={};Object.defineProperty(Jt,"__esModule",{value:!0});Jt.formatting=Jt.complex=Jt.basic=void 0;Jt.basic=[["font","fontSize"],["fontColor"],["horizontalRule"],["link","image"]];Jt.complex=[["undo","redo"],["font","fontSize","formatBlock"],["bold","underline","italic","strike","subscript","superscript"],["removeFormat"],"/",["fontColor","hiliteColor"],["outdent","indent"],["align","horizontalRule","list","table"],["link","image","video"],["fullScreen","showBlocks","codeView"],["preview","print"],["save","template"]];Jt.formatting=[["undo","redo"],["bold","underline","italic","strike","subscript","superscript"],["removeFormat"],["outdent","indent"],["fullScreen","showBlocks","codeView"],["preview","print"]];var l4=Be&&Be.__createBinding||(Object.create?function(e,t,n,i){i===void 0&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]}),a4=Be&&Be.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),c4=Be&&Be.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&l4(t,e,n);return a4(t,e),t},u4=Be&&Be.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(rr,"__esModule",{value:!0});rr.buttonList=void 0;var d4=u4(ul);rr.buttonList=c4(Jt);var f4=rr.default=d4.default;const ml=m.forwardRef(({id:e,name:t,value:n="",onChange:i,placeholder:s="Start writing...",height:o="200px",className:l,...a},r)=>{const f=m.useRef(null),d=m.useRef(n),h=m.useRef(!1),b=w=>{f.current=w,n&&w.setContents(n)};m.useImperativeHandle(r,()=>({getContents:()=>{var w;return(w=f.current)==null?void 0:w.getContents()},setContents:w=>{var S;return(S=f.current)==null?void 0:S.setContents(w)},insertHTML:w=>{var S;return(S=f.current)==null?void 0:S.insertHTML(w)},focus:()=>{var w,S;return(S=(w=f.current)==null?void 0:w.core)==null?void 0:S.focus()},blur:()=>{var w,S;return(S=(w=f.current)==null?void 0:w.core)==null?void 0:S.blur()}}),[]),m.useEffect(()=>{if(f.current&&!h.current){const w=f.current.getContents();n!==d.current&&n!==w&&f.current.setContents(n||"")}d.current=n,h.current=!1},[n]);const C=w=>{h.current=!0,d.current=w,i==null||i(w)};return g.jsx("div",{className:J("sun-editor-wrapper",l),children:g.jsx(f4,{id:e||t,name:t,getSunEditorInstance:b,defaultValue:"",onChange:C,placeholder:s,height:o,setOptions:{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:o,showPathLabel:!1,resizingBar:!1,charCounter:!0,maxCharCount:1e4,width:"100%",mode:"classic",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}],...a}})})});ml.displayName="RichTextEditor";function h4(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,...w}=h,S=((u=b==null?void 0:b[e])==null?void 0:u[r])||a,c=m.useMemo(()=>w,Object.values(w));return g.jsx(S.Provider,{value:c,children:C})};f.displayName=o+"Provider";function d(h,b){var S;const C=((S=b==null?void 0:b[e])==null?void 0:S[r])||a,w=m.useContext(C);if(w)return w;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,p4(s,...t)]}function p4(...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 m4(e){const t=g4(e),n=m.forwardRef((i,s)=>{const{children:o,...l}=i,a=m.Children.toArray(o),r=a.find(b4);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 g4(e){const t=m.forwardRef((n,i)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const l=x4(s),a=y4(o,s.props);return s.type!==m.Fragment&&(a.ref=i?ze(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 v4=Symbol("radix.slottable");function b4(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===v4}function y4(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 x4(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 _4=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],w4=_4.reduce((e,t)=>{const n=m4(`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 C4(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,...w}=h,S=((u=b==null?void 0:b[e])==null?void 0:u[r])||a,c=m.useMemo(()=>w,Object.values(w));return g.jsx(S.Provider,{value:c,children:C})};f.displayName=o+"Provider";function d(h,b){var S;const C=((S=b==null?void 0:b[e])==null?void 0:S[r])||a,w=m.useContext(C);if(w)return w;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,S4(s,...t)]}function S4(...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 Jh(e){const t=E4(e),n=m.forwardRef((i,s)=>{const{children:o,...l}=i,a=m.Children.toArray(o),r=a.find(T4);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 E4(e){const t=m.forwardRef((n,i)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const l=M4(s),a=k4(o,s.props);return s.type!==m.Fragment&&(a.ref=i?ze(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 N4=Symbol("radix.slottable");function T4(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===N4}function k4(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 M4(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 A4=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ui=A4.reduce((e,t)=>{const n=Jh(`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 D4(e,t){e&&Ti.flushSync(()=>e.dispatchEvent(t))}var so=["Enter"," "],R4=["ArrowDown","PageUp","Home"],e0=["ArrowUp","PageDown","End"],L4=[...R4,...e0],O4={ltr:[...so,"ArrowRight"],rtl:[...so,"ArrowLeft"]},P4={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Yi="Menu",[wi,I4,B4]=yo(Yi),[bn,t0]=C4(Yi,[B4,nn,Zs]),qi=nn(),n0=Zs(),[i0,ln]=bn(Yi),[F4,Zi]=bn(Yi),s0=e=>{const{__scopeMenu:t,open:n=!1,children:i,dir:s,onOpenChange:o,modal:l=!0}=e,a=qi(t),[r,f]=m.useState(null),d=m.useRef(!1),h=Ze(o),b=Di(s);return m.useEffect(()=>{const C=()=>{d.current=!0,document.addEventListener("pointerdown",w,{capture:!0,once:!0}),document.addEventListener("pointermove",w,{capture:!0,once:!0})},w=()=>d.current=!1;return document.addEventListener("keydown",C,{capture:!0}),()=>{document.removeEventListener("keydown",C,{capture:!0}),document.removeEventListener("pointerdown",w,{capture:!0}),document.removeEventListener("pointermove",w,{capture:!0})}},[]),g.jsx(Oi,{...a,children:g.jsx(i0,{scope:t,open:n,onOpenChange:h,content:r,onContentChange:f,children:g.jsx(F4,{scope:t,onClose:m.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:d,dir:b,modal:l,children:i})})})};s0.displayName=Yi;var j4="MenuAnchor",gl=m.forwardRef((e,t)=>{const{__scopeMenu:n,...i}=e,s=qi(n);return g.jsx(Pi,{...s,...i,ref:t})});gl.displayName=j4;var vl="MenuPortal",[z4,r0]=bn(vl,{forceMount:void 0}),o0=e=>{const{__scopeMenu:t,forceMount:n,children:i,container:s}=e,o=ln(vl,t);return g.jsx(z4,{scope:t,forceMount:n,children:g.jsx(Ke,{present:n||o.open,children:g.jsx(Ii,{asChild:!0,container:s,children:i})})})};o0.displayName=vl;var mt="MenuContent",[H4,bl]=bn(mt),l0=m.forwardRef((e,t)=>{const n=r0(mt,e.__scopeMenu),{forceMount:i=n.forceMount,...s}=e,o=ln(mt,e.__scopeMenu),l=Zi(mt,e.__scopeMenu);return g.jsx(wi.Provider,{scope:e.__scopeMenu,children:g.jsx(Ke,{present:i||o.open,children:g.jsx(wi.Slot,{scope:e.__scopeMenu,children:l.modal?g.jsx(V4,{...s,ref:t}):g.jsx(W4,{...s,ref:t})})})})}),V4=m.forwardRef((e,t)=>{const n=ln(mt,e.__scopeMenu),i=m.useRef(null),s=ve(t,i);return m.useEffect(()=>{const o=i.current;if(o)return Bs(o)},[]),g.jsx(yl,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:oe(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),W4=m.forwardRef((e,t)=>{const n=ln(mt,e.__scopeMenu);return g.jsx(yl,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),$4=Jh("MenuContent.ScrollLock"),yl=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:C,disableOutsideScroll:w,...S}=e,c=ln(mt,n),u=Zi(mt,n),p=qi(n),v=n0(n),y=I4(n),[_,x]=m.useState(null),E=m.useRef(null),T=ve(t,E,c.onContentChange),N=m.useRef(0),k=m.useRef(""),D=m.useRef(0),M=m.useRef(null),A=m.useRef("right"),R=m.useRef(0),z=w?Bi:m.Fragment,V=w?{as:$4,allowPinchZoom:!0}:void 0,H=L=>{var W,X;const O=k.current+L,j=y().filter(q=>!q.disabled),P=document.activeElement,U=(W=j.find(q=>q.ref.current===P))==null?void 0:W.textValue,I=j.map(q=>q.textValue),$=n3(I,O,U),Q=(X=j.find(q=>q.textValue===$))==null?void 0:X.ref.current;(function q(G){k.current=G,window.clearTimeout(N.current),G!==""&&(N.current=window.setTimeout(()=>q(""),1e3))})(O),Q&&setTimeout(()=>Q.focus())};m.useEffect(()=>()=>window.clearTimeout(N.current),[]),As();const F=m.useCallback(L=>{var j,P;return A.current===((j=M.current)==null?void 0:j.side)&&s3(L,(P=M.current)==null?void 0:P.area)},[]);return g.jsx(H4,{scope:n,searchRef:k,onItemEnter:m.useCallback(L=>{F(L)&&L.preventDefault()},[F]),onItemLeave:m.useCallback(L=>{var O;F(L)||((O=E.current)==null||O.focus(),x(null))},[F]),onTriggerLeave:m.useCallback(L=>{F(L)&&L.preventDefault()},[F]),pointerGraceTimerRef:D,onPointerGraceIntentChange:m.useCallback(L=>{M.current=L},[]),children:g.jsx(z,{...V,children:g.jsx(Ri,{asChild:!0,trapped:s,onMountAutoFocus:oe(o,L=>{var O;L.preventDefault(),(O=E.current)==null||O.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:g.jsx(Gn,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:f,onPointerDownOutside:d,onFocusOutside:h,onInteractOutside:b,onDismiss:C,children:g.jsx(Gd,{asChild:!0,...v,dir:u.dir,orientation:"vertical",loop:i,currentTabStopId:_,onCurrentTabStopIdChange:x,onEntryFocus:oe(r,L=>{u.isUsingKeyboardRef.current||L.preventDefault()}),preventScrollOnEntryFocus:!0,children:g.jsx(Ps,{role:"menu","aria-orientation":"vertical","data-state":S0(c.open),"data-radix-menu-content":"",dir:u.dir,...p,...S,ref:T,style:{outline:"none",...S.style},onKeyDown:oe(S.onKeyDown,L=>{const j=L.target.closest("[data-radix-menu-content]")===L.currentTarget,P=L.ctrlKey||L.altKey||L.metaKey,U=L.key.length===1;j&&(L.key==="Tab"&&L.preventDefault(),!P&&U&&H(L.key));const I=E.current;if(L.target!==I||!L4.includes(L.key))return;L.preventDefault();const Q=y().filter(W=>!W.disabled).map(W=>W.ref.current);e0.includes(L.key)&&Q.reverse(),e3(Q)}),onBlur:oe(e.onBlur,L=>{L.currentTarget.contains(L.target)||(window.clearTimeout(N.current),k.current="")}),onPointerMove:oe(e.onPointerMove,Ci(L=>{const O=L.target,j=R.current!==L.clientX;if(L.currentTarget.contains(O)&&j){const P=L.clientX>R.current?"right":"left";A.current=P,R.current=L.clientX}}))})})})})})})});l0.displayName=mt;var U4="MenuGroup",xl=m.forwardRef((e,t)=>{const{__scopeMenu:n,...i}=e;return g.jsx(Ui.div,{role:"group",...i,ref:t})});xl.displayName=U4;var Y4="MenuLabel",a0=m.forwardRef((e,t)=>{const{__scopeMenu:n,...i}=e;return g.jsx(Ui.div,{...i,ref:t})});a0.displayName=Y4;var bs="MenuItem",ic="menu.itemSelect",or=m.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:i,...s}=e,o=m.useRef(null),l=Zi(bs,e.__scopeMenu),a=bl(bs,e.__scopeMenu),r=ve(t,o),f=m.useRef(!1),d=()=>{const h=o.current;if(!n&&h){const b=new CustomEvent(ic,{bubbles:!0,cancelable:!0});h.addEventListener(ic,C=>i==null?void 0:i(C),{once:!0}),D4(h,b),b.defaultPrevented?f.current=!1:l.onClose()}};return g.jsx(c0,{...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===" "||so.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})});or.displayName=bs;var c0=m.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:i=!1,textValue:s,...o}=e,l=bl(bs,n),a=n0(n),r=m.useRef(null),f=ve(t,r),[d,h]=m.useState(!1),[b,C]=m.useState("");return m.useEffect(()=>{const w=r.current;w&&C((w.textContent??"").trim())},[o.children]),g.jsx(wi.ItemSlot,{scope:n,disabled:i,textValue:s??b,children:g.jsx(Kd,{asChild:!0,...a,focusable:!i,children:g.jsx(Ui.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,Ci(w=>{i?l.onItemLeave(w):(l.onItemEnter(w),w.defaultPrevented||w.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:oe(e.onPointerLeave,Ci(w=>l.onItemLeave(w))),onFocus:oe(e.onFocus,()=>h(!0)),onBlur:oe(e.onBlur,()=>h(!1))})})})}),q4="MenuCheckboxItem",u0=m.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:i,...s}=e;return g.jsx(m0,{scope:e.__scopeMenu,checked:n,children:g.jsx(or,{role:"menuitemcheckbox","aria-checked":ys(n)?"mixed":n,...s,ref:t,"data-state":Cl(n),onSelect:oe(s.onSelect,()=>i==null?void 0:i(ys(n)?!0:!n),{checkForDefaultPrevented:!1})})})});u0.displayName=q4;var d0="MenuRadioGroup",[Z4,G4]=bn(d0,{value:void 0,onValueChange:()=>{}}),f0=m.forwardRef((e,t)=>{const{value:n,onValueChange:i,...s}=e,o=Ze(i);return g.jsx(Z4,{scope:e.__scopeMenu,value:n,onValueChange:o,children:g.jsx(xl,{...s,ref:t})})});f0.displayName=d0;var h0="MenuRadioItem",p0=m.forwardRef((e,t)=>{const{value:n,...i}=e,s=G4(h0,e.__scopeMenu),o=n===s.value;return g.jsx(m0,{scope:e.__scopeMenu,checked:o,children:g.jsx(or,{role:"menuitemradio","aria-checked":o,...i,ref:t,"data-state":Cl(o),onSelect:oe(i.onSelect,()=>{var l;return(l=s.onValueChange)==null?void 0:l.call(s,n)},{checkForDefaultPrevented:!1})})})});p0.displayName=h0;var _l="MenuItemIndicator",[m0,K4]=bn(_l,{checked:!1}),g0=m.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:i,...s}=e,o=K4(_l,n);return g.jsx(Ke,{present:i||ys(o.checked)||o.checked===!0,children:g.jsx(Ui.span,{...s,ref:t,"data-state":Cl(o.checked)})})});g0.displayName=_l;var X4="MenuSeparator",v0=m.forwardRef((e,t)=>{const{__scopeMenu:n,...i}=e;return g.jsx(Ui.div,{role:"separator","aria-orientation":"horizontal",...i,ref:t})});v0.displayName=X4;var Q4="MenuArrow",b0=m.forwardRef((e,t)=>{const{__scopeMenu:n,...i}=e,s=qi(n);return g.jsx(Is,{...s,...i,ref:t})});b0.displayName=Q4;var wl="MenuSub",[J4,y0]=bn(wl),x0=e=>{const{__scopeMenu:t,children:n,open:i=!1,onOpenChange:s}=e,o=ln(wl,t),l=qi(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(Oi,{...l,children:g.jsx(i0,{scope:t,open:i,onOpenChange:h,content:f,onContentChange:d,children:g.jsx(J4,{scope:t,contentId:st(),triggerId:st(),trigger:a,onTriggerChange:r,children:n})})})};x0.displayName=wl;var di="MenuSubTrigger",_0=m.forwardRef((e,t)=>{const n=ln(di,e.__scopeMenu),i=Zi(di,e.__scopeMenu),s=y0(di,e.__scopeMenu),o=bl(di,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(gl,{asChild:!0,...f,children:g.jsx(c0,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":S0(n.open),...e,ref:ze(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,Ci(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,Ci(h=>{var C,w;d();const b=(C=n.content)==null?void 0:C.getBoundingClientRect();if(b){const S=(w=n.content)==null?void 0:w.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 C;const b=o.searchRef.current!=="";e.disabled||b&&h.key===" "||O4[i.dir].includes(h.key)&&(n.onOpenChange(!0),(C=n.content)==null||C.focus(),h.preventDefault())})})})});_0.displayName=di;var w0="MenuSubContent",C0=m.forwardRef((e,t)=>{const n=r0(mt,e.__scopeMenu),{forceMount:i=n.forceMount,...s}=e,o=ln(mt,e.__scopeMenu),l=Zi(mt,e.__scopeMenu),a=y0(w0,e.__scopeMenu),r=m.useRef(null),f=ve(t,r);return g.jsx(wi.Provider,{scope:e.__scopeMenu,children:g.jsx(Ke,{present:i||o.open,children:g.jsx(wi.Slot,{scope:e.__scopeMenu,children:g.jsx(yl,{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 C;const h=d.currentTarget.contains(d.target),b=P4[l.dir].includes(d.key);h&&b&&(o.onOpenChange(!1),(C=a.trigger)==null||C.focus(),d.preventDefault())})})})})})});C0.displayName=w0;function S0(e){return e?"open":"closed"}function ys(e){return e==="indeterminate"}function Cl(e){return ys(e)?"indeterminate":e?"checked":"unchecked"}function e3(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function t3(e,t){return e.map((n,i)=>e[(t+i)%e.length])}function n3(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=t3(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 i3(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 s3(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return i3(n,t)}function Ci(e){return t=>t.pointerType==="mouse"?e(t):void 0}var r3=s0,o3=gl,l3=o0,a3=l0,c3=xl,u3=a0,d3=or,f3=u0,h3=f0,p3=p0,m3=g0,g3=v0,v3=b0,b3=x0,y3=_0,x3=C0,lr="DropdownMenu",[_3]=h4(lr,[t0]),et=t0(),[w3,E0]=_3(lr),N0=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:lr});return g.jsx(w3,{scope:t,triggerId:st(),triggerRef:f,contentId:st(),open:d,onOpenChange:h,onOpenToggle:m.useCallback(()=>h(b=>!b),[h]),modal:a,children:g.jsx(r3,{...r,open:d,onOpenChange:h,dir:i,modal:a,children:n})})};N0.displayName=lr;var T0="DropdownMenuTrigger",k0=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:i=!1,...s}=e,o=E0(T0,n),l=et(n);return g.jsx(o3,{asChild:!0,...l,children:g.jsx(w4.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:ze(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())})})})});k0.displayName=T0;var C3="DropdownMenuPortal",M0=e=>{const{__scopeDropdownMenu:t,...n}=e,i=et(t);return g.jsx(l3,{...i,...n})};M0.displayName=C3;var A0="DropdownMenuContent",D0=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...i}=e,s=E0(A0,n),o=et(n),l=m.useRef(!1);return g.jsx(a3,{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)"}})});D0.displayName=A0;var S3="DropdownMenuGroup",R0=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...i}=e,s=et(n);return g.jsx(c3,{...s,...i,ref:t})});R0.displayName=S3;var E3="DropdownMenuLabel",L0=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...i}=e,s=et(n);return g.jsx(u3,{...s,...i,ref:t})});L0.displayName=E3;var N3="DropdownMenuItem",O0=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...i}=e,s=et(n);return g.jsx(d3,{...s,...i,ref:t})});O0.displayName=N3;var T3="DropdownMenuCheckboxItem",P0=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...i}=e,s=et(n);return g.jsx(f3,{...s,...i,ref:t})});P0.displayName=T3;var k3="DropdownMenuRadioGroup",I0=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...i}=e,s=et(n);return g.jsx(h3,{...s,...i,ref:t})});I0.displayName=k3;var M3="DropdownMenuRadioItem",B0=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...i}=e,s=et(n);return g.jsx(p3,{...s,...i,ref:t})});B0.displayName=M3;var A3="DropdownMenuItemIndicator",F0=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...i}=e,s=et(n);return g.jsx(m3,{...s,...i,ref:t})});F0.displayName=A3;var D3="DropdownMenuSeparator",j0=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...i}=e,s=et(n);return g.jsx(g3,{...s,...i,ref:t})});j0.displayName=D3;var R3="DropdownMenuArrow",L3=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...i}=e,s=et(n);return g.jsx(v3,{...s,...i,ref:t})});L3.displayName=R3;var O3=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(b3,{...l,open:a,onOpenChange:r,children:n})},P3="DropdownMenuSubTrigger",z0=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...i}=e,s=et(n);return g.jsx(y3,{...s,...i,ref:t})});z0.displayName=P3;var I3="DropdownMenuSubContent",H0=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...i}=e,s=et(n);return g.jsx(x3,{...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)"}})});H0.displayName=I3;var B3=N0,F3=k0,V0=M0,W0=D0,j3=R0,$0=L0,U0=O0,Y0=P0,z3=I0,q0=B0,Z0=F0,G0=j0,H3=O3,K0=z0,X0=H0;const Sl=B3,El=F3,V3=j3,W3=V0,$3=H3,U3=z3,Q0=m.forwardRef(({className:e,inset:t,children:n,...i},s)=>g.jsxs(K0,{ref:s,className:J("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(ki,{className:"ml-auto h-4 w-4"})]}));Q0.displayName=K0.displayName;const J0=m.forwardRef(({className:e,...t},n)=>g.jsx(X0,{ref:n,className:J("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}));J0.displayName=X0.displayName;const ar=m.forwardRef(({className:e,sideOffset:t=4,...n},i)=>g.jsx(V0,{children:g.jsx(W0,{ref:i,sideOffset:t,className:J("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})}));ar.displayName=W0.displayName;const Si=m.forwardRef(({className:e,inset:t,...n},i)=>g.jsx(U0,{ref:i,className:J("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}));Si.displayName=U0.displayName;const ep=m.forwardRef(({className:e,children:t,checked:n,...i},s)=>g.jsxs(Y0,{ref:s,className:J("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(Z0,{children:g.jsx(gi,{className:"h-4 w-4"})})}),t]}));ep.displayName=Y0.displayName;const tp=m.forwardRef(({className:e,children:t,...n},i)=>g.jsxs(q0,{ref:i,className:J("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(Z0,{children:g.jsx(Rg,{className:"h-2 w-2 fill-current"})})}),t]}));tp.displayName=q0.displayName;const cr=m.forwardRef(({className:e,inset:t,...n},i)=>g.jsx($0,{ref:i,className:J("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));cr.displayName=$0.displayName;const Ei=m.forwardRef(({className:e,...t},n)=>g.jsx(G0,{ref:n,className:J("-mx-1 my-1 h-px bg-muted",e),...t}));Ei.displayName=G0.displayName;const np=({className:e,...t})=>g.jsx("span",{className:J("ml-auto text-xs tracking-widest opacity-60",e),...t});np.displayName="DropdownMenuShortcut";function Y3(e){const t=q3(e),n=m.forwardRef((i,s)=>{const{children:o,...l}=i,a=m.Children.toArray(o),r=a.find(G3);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 q3(e){const t=m.forwardRef((n,i)=>{const{children:s,...o}=n;if(m.isValidElement(s)){const l=X3(s),a=K3(o,s.props);return s.type!==m.Fragment&&(a.ref=i?ze(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 Z3=Symbol("radix.slottable");function G3(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Z3}function K3(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 X3(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 Q3=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Gi=Q3.reduce((e,t)=>{const n=Y3(`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 J3(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,...w}=h,S=((u=b==null?void 0:b[e])==null?void 0:u[r])||a,c=m.useMemo(()=>w,Object.values(w));return g.jsx(S.Provider,{value:c,children:C})};f.displayName=o+"Provider";function d(h,b){var S;const C=((S=b==null?void 0:b[e])==null?void 0:S[r])||a,w=m.useContext(C);if(w)return w;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,eE(s,...t)]}function eE(...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 tE(e,t){return m.useReducer((n,i)=>t[n][i]??n,e)}var Nl="ScrollArea",[ip]=J3(Nl),[nE,gt]=ip(Nl),sp=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,w]=m.useState(null),[S,c]=m.useState(null),[u,p]=m.useState(0),[v,y]=m.useState(0),[_,x]=m.useState(!1),[E,T]=m.useState(!1),N=ve(t,D=>r(D)),k=Di(s);return g.jsx(nE,{scope:n,type:i,dir:k,scrollHideDelay:o,scrollArea:a,viewport:f,onViewportChange:d,content:h,onContentChange:b,scrollbarX:C,onScrollbarXChange:w,scrollbarXEnabled:_,onScrollbarXEnabledChange:x,scrollbarY:S,onScrollbarYChange:c,scrollbarYEnabled:E,onScrollbarYEnabledChange:T,onCornerWidthChange:p,onCornerHeightChange:y,children:g.jsx(Gi.div,{dir:k,...l,ref:N,style:{position:"relative","--radix-scroll-area-corner-width":u+"px","--radix-scroll-area-corner-height":v+"px",...e.style}})})});sp.displayName=Nl;var rp="ScrollAreaViewport",op=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:i,nonce:s,...o}=e,l=gt(rp,n),a=m.useRef(null),r=ve(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(Gi.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})})]})});op.displayName=rp;var Pt="ScrollAreaScrollbar",Tl=m.forwardRef((e,t)=>{const{forceMount:n,...i}=e,s=gt(Pt,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(iE,{...i,ref:t,forceMount:n}):s.type==="scroll"?g.jsx(sE,{...i,ref:t,forceMount:n}):s.type==="auto"?g.jsx(lp,{...i,ref:t,forceMount:n}):s.type==="always"?g.jsx(kl,{...i,ref:t}):null});Tl.displayName=Pt;var iE=m.forwardRef((e,t)=>{const{forceMount:n,...i}=e,s=gt(Pt,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(lp,{"data-state":o?"visible":"hidden",...i,ref:t})})}),sE=m.forwardRef((e,t)=>{const{forceMount:n,...i}=e,s=gt(Pt,e.__scopeScrollArea),o=e.orientation==="horizontal",l=dr(()=>r("SCROLL_END"),100),[a,r]=tE("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 C=f[d];h!==C&&(r("SCROLL"),l()),h=C};return f.addEventListener("scroll",b),()=>f.removeEventListener("scroll",b)}},[s.viewport,o,r,l]),g.jsx(Ke,{present:n||a!=="hidden",children:g.jsx(kl,{"data-state":a==="hidden"?"hidden":"visible",...i,ref:t,onPointerEnter:oe(e.onPointerEnter,()=>r("POINTER_ENTER")),onPointerLeave:oe(e.onPointerLeave,()=>r("POINTER_LEAVE"))})})}),lp=m.forwardRef((e,t)=>{const n=gt(Pt,e.__scopeScrollArea),{forceMount:i,...s}=e,[o,l]=m.useState(!1),a=e.orientation==="horizontal",r=dr(()=>{if(n.viewport){const f=n.viewport.offsetWidth<n.viewport.scrollWidth,d=n.viewport.offsetHeight<n.viewport.scrollHeight;l(a?f:d)}},10);return Yn(n.viewport,r),Yn(n.content,r),g.jsx(Ke,{present:i||o,children:g.jsx(kl,{"data-state":o?"visible":"hidden",...s,ref:t})})}),kl=m.forwardRef((e,t)=>{const{orientation:n="vertical",...i}=e,s=gt(Pt,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=fp(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,C){return uE(b,l.current,a,C)}return n==="horizontal"?g.jsx(rE,{...d,ref:t,onThumbPositionChange:()=>{if(s.viewport&&o.current){const b=s.viewport.scrollLeft,C=sc(b,a,s.dir);o.current.style.transform=`translate3d(${C}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(oE,{...d,ref:t,onThumbPositionChange:()=>{if(s.viewport&&o.current){const b=s.viewport.scrollTop,C=sc(b,a);o.current.style.transform=`translate3d(0, ${C}px, 0)`}},onWheelScroll:b=>{s.viewport&&(s.viewport.scrollTop=b)},onDragScroll:b=>{s.viewport&&(s.viewport.scrollTop=h(b))}}):null}),rE=m.forwardRef((e,t)=>{const{sizes:n,onSizesChange:i,...s}=e,o=gt(Pt,e.__scopeScrollArea),[l,a]=m.useState(),r=m.useRef(null),f=ve(t,r,o.onScrollbarXChange);return m.useEffect(()=>{r.current&&a(getComputedStyle(r.current))},[r]),g.jsx(cp,{"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":ur(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),pp(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:_s(l.paddingLeft),paddingEnd:_s(l.paddingRight)}})}})}),oE=m.forwardRef((e,t)=>{const{sizes:n,onSizesChange:i,...s}=e,o=gt(Pt,e.__scopeScrollArea),[l,a]=m.useState(),r=m.useRef(null),f=ve(t,r,o.onScrollbarYChange);return m.useEffect(()=>{r.current&&a(getComputedStyle(r.current))},[r]),g.jsx(cp,{"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":ur(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),pp(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:_s(l.paddingTop),paddingEnd:_s(l.paddingBottom)}})}})}),[lE,ap]=ip(Pt),cp=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,C=gt(Pt,n),[w,S]=m.useState(null),c=ve(t,N=>S(N)),u=m.useRef(null),p=m.useRef(""),v=C.viewport,y=i.content-i.viewport,_=Ze(d),x=Ze(r),E=dr(h,10);function T(N){if(u.current){const k=N.clientX-u.current.left,D=N.clientY-u.current.top;f({x:k,y:D})}}return m.useEffect(()=>{const N=k=>{const D=k.target;(w==null?void 0:w.contains(D))&&_(k,y)};return document.addEventListener("wheel",N,{passive:!1}),()=>document.removeEventListener("wheel",N,{passive:!1})},[v,w,y,_]),m.useEffect(x,[i,x]),Yn(w,E),Yn(C.content,E),g.jsx(lE,{scope:n,scrollbar:w,hasThumb:s,onThumbChange:Ze(o),onThumbPointerUp:Ze(l),onThumbPositionChange:x,onThumbPointerDown:Ze(a),children:g.jsx(Gi.div,{...b,ref:c,style:{position:"absolute",...b.style},onPointerDown:oe(e.onPointerDown,N=>{N.button===0&&(N.target.setPointerCapture(N.pointerId),u.current=w.getBoundingClientRect(),p.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",C.viewport&&(C.viewport.style.scrollBehavior="auto"),T(N))}),onPointerMove:oe(e.onPointerMove,T),onPointerUp:oe(e.onPointerUp,N=>{const k=N.target;k.hasPointerCapture(N.pointerId)&&k.releasePointerCapture(N.pointerId),document.body.style.webkitUserSelect=p.current,C.viewport&&(C.viewport.style.scrollBehavior=""),u.current=null})})})}),xs="ScrollAreaThumb",up=m.forwardRef((e,t)=>{const{forceMount:n,...i}=e,s=ap(xs,e.__scopeScrollArea);return g.jsx(Ke,{present:n||s.hasThumb,children:g.jsx(aE,{ref:t,...i})})}),aE=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:i,...s}=e,o=gt(xs,n),l=ap(xs,n),{onThumbPositionChange:a}=l,r=ve(t,h=>l.onThumbChange(h)),f=m.useRef(void 0),d=dr(()=>{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 C=dE(h,a);f.current=C,a()}};return a(),h.addEventListener("scroll",b),()=>h.removeEventListener("scroll",b)}},[o.viewport,d,a]),g.jsx(Gi.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 C=h.target.getBoundingClientRect(),w=h.clientX-C.left,S=h.clientY-C.top;l.onThumbPointerDown({x:w,y:S})}),onPointerUp:oe(e.onPointerUp,l.onThumbPointerUp)})});up.displayName=xs;var Ml="ScrollAreaCorner",dp=m.forwardRef((e,t)=>{const n=gt(Ml,e.__scopeScrollArea),i=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&i?g.jsx(cE,{...e,ref:t}):null});dp.displayName=Ml;var cE=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,...i}=e,s=gt(Ml,n),[o,l]=m.useState(0),[a,r]=m.useState(0),f=!!(o&&a);return Yn(s.scrollbarX,()=>{var h;const d=((h=s.scrollbarX)==null?void 0:h.offsetHeight)||0;s.onCornerHeightChange(d),r(d)}),Yn(s.scrollbarY,()=>{var h;const d=((h=s.scrollbarY)==null?void 0:h.offsetWidth)||0;s.onCornerWidthChange(d),l(d)}),f?g.jsx(Gi.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 _s(e){return e?parseInt(e,10):0}function fp(e,t){const n=e/t;return isNaN(n)?0:n}function ur(e){const t=fp(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,i=(e.scrollbar.size-n)*t;return Math.max(i,18)}function uE(e,t,n,i="ltr"){const s=ur(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 hp([r,f],h)(e)}function sc(e,t,n="ltr"){const i=ur(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=zr(e,r);return hp([0,l],[0,a])(f)}function hp(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 pp(e,t){return e>0&&e<t}var dE=(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 dr(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 Yn(e,t){const n=Ze(t);Ye(()=>{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 mp=sp,fE=op,hE=dp;const gp=m.forwardRef(({className:e,children:t,...n},i)=>g.jsxs(mp,{ref:i,className:J("relative overflow-hidden",e),...n,children:[g.jsx(fE,{className:"h-full w-full rounded-[inherit]",children:t}),g.jsx(Al,{}),g.jsx(hE,{})]}));gp.displayName=mp.displayName;const Al=m.forwardRef(({className:e,orientation:t="vertical",...n},i)=>g.jsx(Tl,{ref:i,orientation:t,className:J("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(up,{className:"relative flex-1 rounded-full bg-border"})}));Al.displayName=Tl.displayName;const vp=Es("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"}}),Dl=m.forwardRef(({className:e,variant:t,...n},i)=>g.jsx("div",{ref:i,role:"alert",className:J(vp({variant:t}),e),...n}));Dl.displayName="Alert";const Rl=m.forwardRef(({className:e,...t},n)=>g.jsx("h5",{ref:n,className:J("mb-1 font-medium leading-none tracking-tight",e),...t}));Rl.displayName="AlertTitle";const Ll=m.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:J("text-sm [&_p]:leading-relaxed",e),...t}));Ll.displayName="AlertDescription";const bp=m.forwardRef(({variant:e,title:t,children:n,className:i,...s},o)=>{const l={default:ca,destructive:Dg,success:Ag,warning:Mg,info:ca},a=l[e]||l.default;return g.jsxs(Dl,{ref:o,variant:e,className:i,...s,children:[g.jsx(a,{className:"h-4 w-4"}),t&&g.jsx(Rl,{children:t}),n&&g.jsx(Ll,{children:n})]})});bp.displayName="AlertWithIcon";function pE(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,...w}=h,S=((u=b==null?void 0:b[e])==null?void 0:u[r])||a,c=m.useMemo(()=>w,Object.values(w));return g.jsx(S.Provider,{value:c,children:C})};f.displayName=o+"Provider";function d(h,b){var S;const C=((S=b==null?void 0:b[e])==null?void 0:S[r])||a,w=m.useContext(C);if(w)return w;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,mE(s,...t)]}function mE(...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 gE=Symbol("radix.slottable");function vE(e){const t=({children:n})=>g.jsx(g.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=gE,t}var yp="AlertDialog",[bE]=pE(yp,[wd]),$t=wd(),xp=e=>{const{__scopeAlertDialog:t,...n}=e,i=$t(t);return g.jsx(Fd,{...i,...n,modal:!0})};xp.displayName=yp;var yE="AlertDialogTrigger",_p=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...i}=e,s=$t(n);return g.jsx(jd,{...s,...i,ref:t})});_p.displayName=yE;var xE="AlertDialogPortal",wp=e=>{const{__scopeAlertDialog:t,...n}=e,i=$t(t);return g.jsx(zd,{...i,...n})};wp.displayName=xE;var _E="AlertDialogOverlay",Cp=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...i}=e,s=$t(n);return g.jsx(Io,{...s,...i,ref:t})});Cp.displayName=_E;var On="AlertDialogContent",[wE,CE]=bE(On),SE=vE("AlertDialogContent"),Sp=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:i,...s}=e,o=$t(n),l=m.useRef(null),a=ve(t,l),r=m.useRef(null);return g.jsx(Gx,{contentName:On,titleName:Ep,docsSlug:"alert-dialog",children:g.jsx(wE,{scope:n,cancelRef:r,children:g.jsxs(Bo,{role:"alertdialog",...o,...s,ref:a,onOpenAutoFocus:oe(s.onOpenAutoFocus,f=>{var d;f.preventDefault(),(d=r.current)==null||d.focus({preventScroll:!0})}),onPointerDownOutside:f=>f.preventDefault(),onInteractOutside:f=>f.preventDefault(),children:[g.jsx(SE,{children:i}),g.jsx(NE,{contentRef:l})]})})})});Sp.displayName=On;var Ep="AlertDialogTitle",Np=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...i}=e,s=$t(n);return g.jsx(Fo,{...s,...i,ref:t})});Np.displayName=Ep;var Tp="AlertDialogDescription",kp=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...i}=e,s=$t(n);return g.jsx(jo,{...s,...i,ref:t})});kp.displayName=Tp;var EE="AlertDialogAction",Mp=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...i}=e,s=$t(n);return g.jsx(Ys,{...s,...i,ref:t})});Mp.displayName=EE;var Ap="AlertDialogCancel",Dp=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...i}=e,{cancelRef:s}=CE(Ap,n),o=$t(n),l=ve(t,s);return g.jsx(Ys,{...o,...i,ref:l})});Dp.displayName=Ap;var NE=({contentRef:e})=>{const t=`\`${On}\` requires a description for the component to be accessible for screen reader users.
|
|
253
253
|
|
|
254
254
|
You can add a description to the \`${On}\` by passing a \`${Tp}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
255
255
|
|
|
256
256
|
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${On}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
|
257
257
|
|
|
258
|
-
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return m.useEffect(()=>{var i;document.getElementById((i=e.current)==null?void 0:i.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},TE=xp,kE=_p,ME=wp,Rp=Cp,Lp=Sp,Op=Mp,Pp=Dp,Ip=Np,Bp=kp;const AE=TE,DE=kE,Fp=ME,Ol=m.forwardRef(({className:e,...t},n)=>g.jsx(Rp,{className:J("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,ref:n}));Ol.displayName=Rp.displayName;const jp=m.forwardRef(({className:e,...t},n)=>g.jsxs(Fp,{children:[g.jsx(Ol,{}),g.jsx(Lp,{ref:n,className:J("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 md:w-full",e),...t})]}));jp.displayName=Lp.displayName;const zp=({className:e,...t})=>g.jsx("div",{className:J("flex flex-col space-y-2 text-center sm:text-left",e),...t});zp.displayName="AlertDialogHeader";const Hp=({className:e,...t})=>g.jsx("div",{className:J("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Hp.displayName="AlertDialogFooter";const Vp=m.forwardRef(({className:e,...t},n)=>g.jsx(Ip,{ref:n,className:J("text-lg font-semibold",e),...t}));Vp.displayName=Ip.displayName;const Wp=m.forwardRef(({className:e,...t},n)=>g.jsx(Bp,{ref:n,className:J("text-sm text-muted-foreground",e),...t}));Wp.displayName=Bp.displayName;const $p=m.forwardRef(({className:e,...t},n)=>g.jsx(Op,{ref:n,className:J(Ts(),e),...t}));$p.displayName=Op.displayName;const Up=m.forwardRef(({className:e,...t},n)=>g.jsx(Pp,{ref:n,className:J(Ts({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));Up.displayName=Pp.displayName;const Pl=m.forwardRef(({className:e,...t},n)=>g.jsx("div",{className:"relative w-full overflow-auto",children:g.jsx("table",{ref:n,className:J("w-full caption-bottom text-sm",e),...t})}));Pl.displayName="Table";const Il=m.forwardRef(({className:e,...t},n)=>g.jsx("thead",{ref:n,className:J("[&_tr]:border-b",e),...t}));Il.displayName="TableHeader";const Bl=m.forwardRef(({className:e,...t},n)=>g.jsx("tbody",{ref:n,className:J("[&_tr:last-child]:border-0",e),...t}));Bl.displayName="TableBody";const Yp=m.forwardRef(({className:e,...t},n)=>g.jsx("tfoot",{ref:n,className:J("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));Yp.displayName="TableFooter";const An=m.forwardRef(({className:e,...t},n)=>g.jsx("tr",{ref:n,className:J("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));An.displayName="TableRow";const hi=m.forwardRef(({className:e,...t},n)=>g.jsx("th",{ref:n,className:J("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));hi.displayName="TableHead";const un=m.forwardRef(({className:e,...t},n)=>g.jsx("td",{ref:n,className:J("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));un.displayName="TableCell";const qp=m.forwardRef(({className:e,...t},n)=>g.jsx("caption",{ref:n,className:J("mt-4 text-sm text-muted-foreground",e),...t}));qp.displayName="TableCaption";const Fl=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:w=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,_]=m.useState(!1),[x,E]=m.useState(""),[T,N]=m.useState(0),k=m.useRef(null),D=m.useRef(null),M=m.useMemo(()=>x?S?e.filter(j=>S(j,x)):e.filter(j=>w(j).toLowerCase().includes(x.toLowerCase())):e,[e,x,S,w]),A=m.useMemo(()=>Mc(j=>{i==null||i(j)},300),[i]),R=j=>{const P=j.target.value;E(P),N(0),A(P)},z=j=>{if(r){const P=Array.isArray(t)?t:[],U=C(j);P.some($=>C($)===U)?n==null||n(P.filter($=>C($)!==U)):n==null||n([...P,j])}else n==null||n(j),_(!1),E("")},V=j=>{j.stopPropagation(),n==null||n(r?[]:null),E("")},H=j=>{if(!y){(j.key==="Enter"||j.key===" "||j.key==="ArrowDown")&&(j.preventDefault(),_(!0));return}switch(j.key){case"ArrowDown":j.preventDefault(),N(P=>Math.min(P+1,M.length-1));break;case"ArrowUp":j.preventDefault(),N(P=>Math.max(P-1,0));break;case"Enter":j.preventDefault(),M[T]&&z(M[T]);break;case"Escape":j.preventDefault(),_(!1),E("");break}};m.useEffect(()=>{const j=P=>{k.current&&!k.current.contains(P.target)&&(_(!1),E(""))};return document.addEventListener("mousedown",j),()=>document.removeEventListener("mousedown",j)},[]);const F=j=>r?(Array.isArray(t)?t:[]).some(I=>(typeof I=="object"&&I!==null?C(I):I)===C(j)):t?(typeof t=="object"&&t!==null?C(t):t)===C(j):!1,L=r?Array.isArray(t)&&t.length>0:!!t,O=()=>{if(!L)return g.jsx("span",{className:"text-muted-foreground",children:s});if(b)return b(t);if(r){const P=Array.isArray(t)?t:[];if(P.length===1){const U=P[0],I=e.find($=>{const Q=C($),W=typeof U=="object"&&U!==null?C(U):U;return Q===W});return I?w(I):String(U)}return`${P.length} selected`}const j=e.find(P=>{const U=C(P),I=typeof t=="object"&&t!==null?C(t):t;return U===I});return j?w(j):String(t)};return g.jsxs("div",{ref:k,className:J("relative w-full",d),...p,children:[g.jsxs("button",{ref:v,type:"button",role:"combobox","aria-expanded":y,"aria-haspopup":"listbox",disabled:a,onClick:()=>_(!y),onKeyDown:H,className:J("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&&L&&!a&&g.jsx(Pn,{className:"h-4 w-4 opacity-50 hover:opacity-100 cursor-pointer",onClick:V}),g.jsx(Ns,{className:J("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(uo,{className:"h-4 w-4 shrink-0 opacity-50"}),g.jsx("input",{ref:D,type:"text",value:x,onChange:R,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(hn,{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((j,P)=>g.jsxs("div",{role:"option","aria-selected":F(j),onClick:()=>z(j),onMouseEnter:()=>N(P),className:J("relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none",T===P&&"bg-accent text-accent-foreground",F(j)&&"bg-accent/50"),children:[r&&g.jsx("div",{className:J("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",F(j)&&"bg-primary text-primary-foreground"),children:F(j)&&g.jsx(gi,{className:"h-3 w-3"})}),h?h(j):g.jsx("span",{className:"flex-1",children:w(j)}),!r&&F(j)&&g.jsx(gi,{className:"ml-auto h-4 w-4"})]},C(j)))})]})]})});Fl.displayName="SearchSelect";const Ut=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:J("space-y-2",e),...l,children:[t&&g.jsxs(Xt,{htmlFor:r,className:J(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})]})});Ut.displayName="FormField";const ws=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(Ut,{label:e,description:t,error:n,required:i,className:s,children:g.jsx(jn,{ref:r,className:J(n&&"border-destructive",o),onChange:f,...a})})});ws.displayName="QInput";const jl=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(Ut,{label:e,description:t,error:n,required:i,className:s,children:g.jsx(fo,{ref:r,className:J(n&&"border-destructive",o),onChange:f,...a})})});jl.displayName="QTextarea";const zl=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,...w},C)=>{const S=f||(typeof h=="function"?h:h?u=>u==null?void 0:u[h]:u=>(u==null?void 0:u.label)||(u==null?void 0:u.name)||String(u)),c=d||(typeof b=="function"?b: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(Ut,{label:e,description:t,error:n,required:i,className:l,children:g.jsxs(Mo,{value:a,onValueChange:r,...w,children:[g.jsx(Vs,{ref:C,className:J(n&&"border-destructive"),children:g.jsx(Ao,{placeholder:o})}),g.jsx(Ws,{children:s.map(u=>g.jsx($s,{value:String(c(u)),children:S(u)},c(u)))})]})})});zl.displayName="QSelect";const Hl=m.forwardRef(({label:e,description:t,error:n,required:i,className:s,value:o,onChange:l,options:a=[],getOptionLabel:r,getOptionValue:f,optionLabel:d,optionValue:h,onSearch:b,...w},C)=>{const S=r||(typeof d=="function"?d:d?v=>v==null?void 0:v[d]:v=>(v==null?void 0:v.label)||(v==null?void 0:v.name)||String(v)),c=f||(typeof h=="function"?h:h?v=>v==null?void 0:v[h]:v=>(v==null?void 0:v.value)||(v==null?void 0:v.id)||v),u=v=>{if(v==null)l==null||l(null);else{const y=c(v);l==null||l(y)}},p=m.useCallback(v=>{if(!v)return null;if(typeof v=="object"&&v!==null)return S(v);const y=a.find(_=>c(_)===v);return y?S(y):String(v)},[a,S,c]);return g.jsx(Ut,{label:e,description:t,error:n,required:i,className:s,children:g.jsx(Fl,{ref:C,value:o,onChange:u,options:a,getOptionLabel:S,getOptionValue:c,renderValue:p,onSearch:b,...w})})});Hl.displayName="QSearchSelect";const Vl=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:J("flex items-center justify-between space-x-2",i),children:[g.jsxs("div",{className:"space-y-0.5",children:[e&&g.jsx(Xt,{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(bo,{ref:r,id:f,checked:s,onCheckedChange:d,...a})]})});Vl.displayName="QSwitch";const Wl=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:J("flex items-start space-x-2",i),children:[g.jsx(zn,{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(Xt,{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})]})]})});Wl.displayName="QCheckbox";const Zp=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:J("space-y-4",t),...i,children:n})});Zp.displayName="QForm";const Gp=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(Ut,{label:e,description:t,error:n,required:i,className:s,children:g.jsx(al,{ref:f,date:o,onDateChange:l,placeholder:a,...r})}));Gp.displayName="QDatePicker";const Kp=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(Ut,{label:e,description:t,error:n,required:i,className:s,children:g.jsx(cl,{ref:f,dateRange:o,onDateRangeChange:l,placeholder:a,...r})}));Kp.displayName="QDateRangePicker";const Xp=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(Ut,{label:e,description:t,error:n,required:i,className:s,children:g.jsx(ml,{ref:d,value:o,onChange:l,placeholder:a,height:r,...f})}));Xp.displayName="QRichTextEditor";const $l=({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,w=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:J("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(Mo,{value:String(i),onValueChange:S=>l==null?void 0:l(Number(S)),children:[g.jsx(Vs,{className:"h-8 w-[70px]",children:g.jsx(Ao,{placeholder:i})}),g.jsx(Ws,{side:"top",children:s.map(S=>g.jsx($s,{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(_e,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>o==null?void 0:o(1),disabled:!b,children:[g.jsx(Tg,{className:"h-4 w-4"}),g.jsx("span",{className:"sr-only",children:"First page"})]}),g.jsxs(_e,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>o==null?void 0:o(e-1),disabled:!b,children:[g.jsx(co,{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(_e,{variant:e===S?"default":"outline",size:"icon",className:"h-8 w-8",onClick:()=>o==null?void 0:o(S),children:S},S))}),g.jsxs(_e,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>o==null?void 0:o(e+1),disabled:!w,children:[g.jsx(ki,{className:"h-4 w-4"}),g.jsx("span",{className:"sr-only",children:"Next page"})]}),g.jsxs(_e,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>o==null?void 0:o(t),disabled:!w,children:[g.jsx(kg,{className:"h-4 w-4"}),g.jsx("span",{className:"sr-only",children:"Last page"})]})]})]})};$l.displayName="Pagination";const qn=({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=J("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(hn,{className:J("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:J("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:J("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(hn,{className:J("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})]})};qn.displayName="Loading";const Qp=({loading:e,children:t,text:n,className:i})=>g.jsxs("div",{className:J("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(qn,{text:n})})]});Qp.displayName="LoadingOverlay";const Jp=m.forwardRef(({loading:e,loadingText:t,children:n,disabled:i,className:s,...o},l)=>g.jsx(_e,{ref:l,disabled:i||e,className:s,...o,children:e?g.jsxs(g.Fragment,{children:[g.jsx(hn,{className:"mr-2 h-4 w-4 animate-spin"}),t||"Loading..."]}):n}));Jp.displayName="LoadingButton";const ti=({icon:e=aa,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:aa,title:"No data found",description:"There are no items to display."},search:{icon:uo,title:"No results found",description:"Try adjusting your search or filters to find what you're looking for."},empty:{icon:Dc,title:"Get started",description:"Create your first item to get started."},error:{icon:Rc,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,w=n||d.description;return g.jsxs("div",{className:J("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:w}),r,(i||o)&&g.jsx(_e,{onClick:o,children:s||"Take Action"})]})};ti.displayName="EmptyState";const Ul=({searchTerm:e,onClear:t,className:n})=>g.jsx(ti,{variant:"search",title:`No results for "${e}"`,description:"Try searching with different keywords or check your filters.",className:n,children:t&&g.jsx(_e,{variant:"outline",onClick:t,children:"Clear Search"})});Ul.displayName="SearchEmptyState";const em=({itemName:e="item",onCreate:t,className:n})=>g.jsx(ti,{variant:"empty",icon:Dc,title:`No ${e}s yet`,description:`Create your first ${e} to get started.`,onAction:t,actionLabel:`Create ${e}`,className:n});em.displayName="CreateEmptyState";const tm=({error:e,onRetry:t,className:n})=>g.jsx(ti,{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});tm.displayName="ErrorState";const fr=({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(Hd,{open:e,onOpenChange:t,...f,children:g.jsxs(Ho,{className:J(d[l],r),children:[(n||i)&&g.jsxs(Vo,{children:[n&&g.jsx(Wo,{children:n}),i&&g.jsx($o,{children:i})]}),s,o&&g.jsx(qs,{children:o})]})})};fr.displayName="Modal";const Yl=({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(fr,{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(_e,{variant:"outline",onClick:b,disabled:f,children:a}),g.jsx(_e,{variant:r==="destructive"?"destructive":"default",onClick:h,disabled:f,children:f?"Loading...":l})]})})};Yl.displayName="ConfirmModal";const Ni=({open:e,onOpenChange:t,onConfirm:n,itemName:i="item",loading:s=!1})=>g.jsx(Yl,{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});Ni.displayName="DeleteConfirmModal";const nm=({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(fr,{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(qs,{children:[g.jsx(_e,{type:"button",variant:"outline",onClick:()=>t==null?void 0:t(!1),disabled:r,children:a}),g.jsx(_e,{type:"submit",disabled:r,children:r?"Saving...":l})]})]})})};nm.displayName="FormModal";const ql=({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:w=null,onSort:C,searchable:S=!0,searchValue:c="",onSearchChange:u,searchPlaceholder:p="Search...",selectable:v=!1,selectedRows:y=[],onSelectionChange:_,actions:x=[],onRowClick:E,striped:T=!1,hover:N=!0,compact:k=!1,className:D,emptyTitle:M="No data found",emptyDescription:A="There are no items to display.",emptyAction:R,onEmptyAction:z,getRowKey:V=H=>H.id||H._id})=>{const[H,F]=m.useState(c);m.useEffect(()=>{const W=setTimeout(()=>{u&&H!==c&&u(H)},300);return()=>clearTimeout(W)},[H]);const L=W=>{if(!h||!W.sortable)return;const X=W.sortKey||W.accessor;let q="asc";b===X&&(q=w==="asc"?"desc":"asc"),C==null||C(X,q)},O=W=>{W?_==null||_(e.map(V)):_==null||_([])},j=(W,X)=>{X?_==null||_([...y,W]):_==null||_(y.filter(q=>q!==W))},P=e.length>0&&y.length===e.length,U=y.length>0&&y.length<e.length,I=(W,X,q)=>{const G=W.accessor||W.key,ee=G?typeof G=="function"?G(X):X[G]:void 0;return W.render?W.render(ee,X,q):W.format?W.format(ee,X):ee!==null&&typeof ee=="object"?"-":ee??"-"},$=W=>{if(!h||!W.sortable)return null;const X=W.sortKey||W.accessor;return b!==X?g.jsx(Sg,{className:"ml-2 h-4 w-4 opacity-50"}):w==="asc"?g.jsx(Eg,{className:"ml-2 h-4 w-4"}):g.jsx(Cg,{className:"ml-2 h-4 w-4"})},Q=W=>{if(!x||x.length===0)return null;const X=x.filter(q=>q.hidden?typeof q.hidden=="function"?!q.hidden(W):!q.hidden:!0);return X.length===0?null:g.jsxs(Sl,{children:[g.jsx(El,{asChild:!0,children:g.jsxs(_e,{variant:"ghost",size:"icon",className:"h-8 w-8",children:[g.jsx(Og,{className:"h-4 w-4"}),g.jsx("span",{className:"sr-only",children:"Open menu"})]})}),g.jsxs(ar,{align:"end",children:[g.jsx(cr,{children:"Actions"}),g.jsx(Ei,{}),X.map((q,G)=>g.jsxs(Si,{onClick:()=>{var ee;return(ee=q.onClick)==null?void 0:ee.call(q,W)},className:J(q.variant==="destructive"&&"text-destructive focus:text-destructive"),disabled:q.disabled,children:[q.icon&&g.jsx(q.icon,{className:"mr-2 h-4 w-4"}),q.label]},q.label||G))]})]})};return g.jsxs("div",{className:J("w-full",D),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(uo,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),g.jsx(jn,{placeholder:p,value:H,onChange:W=>F(W.target.value),className:"pl-9 pr-9"}),H&&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(Pn,{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(_e,{variant:"ghost",size:"sm",onClick:()=>_==null?void 0:_([]),children:"Clear selection"})]})]}),g.jsx("div",{className:"rounded-md border",children:g.jsxs(Pl,{children:[g.jsx(Il,{children:g.jsxs(An,{children:[v&&g.jsx(hi,{className:"w-12",children:g.jsx(zn,{checked:P,indeterminate:U,onCheckedChange:O})}),t.map((W,X)=>g.jsx(hi,{className:J(W.headerClassName,h&&W.sortable&&"cursor-pointer select-none"),style:{width:W.width},onClick:()=>L(W),children:g.jsxs("div",{className:"flex items-center",children:[W.header||W.label,$(W)]})},W.accessor||X)),x&&x.length>0&&g.jsx(hi,{className:"w-12",children:"Actions"})]})}),g.jsx(Bl,{children:n?g.jsx(An,{children:g.jsx(un,{colSpan:t.length+(v?1:0)+(x!=null&&x.length?1:0),className:"h-48",children:g.jsx(qn,{text:"Loading data..."})})}):e.length===0?g.jsx(An,{children:g.jsx(un,{colSpan:t.length+(v?1:0)+(x!=null&&x.length?1:0),className:"h-48",children:H?g.jsx(Ul,{searchTerm:H,onClear:()=>{F(""),u==null||u("")}}):g.jsx(ti,{title:M,description:A,onAction:z,actionLabel:R})})}):e.map((W,X)=>{const q=V(W),G=y.includes(q);return g.jsxs(An,{"data-state":G?"selected":void 0,className:J(T&&X%2===1&&"bg-muted/50",N&&"cursor-pointer",E&&"hover:bg-muted"),onClick:()=>E==null?void 0:E(W),children:[v&&g.jsx(un,{onClick:ee=>ee.stopPropagation(),children:g.jsx(zn,{checked:G,onCheckedChange:ee=>j(q,ee)})}),t.map((ee,re)=>g.jsx(un,{className:J(k&&"py-2",ee.cellClassName),children:I(ee,W,X)},ee.accessor||re)),x&&x.length>0&&g.jsx(un,{onClick:ee=>ee.stopPropagation(),children:Q(W)})]},q)})})]})}),!n&&e.length>0&&s!==!1&&g.jsx($l,{currentPage:o,totalPages:r,totalItems:a,pageSize:l,onPageChange:f,onPageSizeChange:d})]})};ql.displayName="DataTable";const im=({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:w,searchValue:C="",onSearchChange:S,searchPlaceholder:c="Search...",selectable:u=!1,selectedRows:p=[],onSelectionChange:v,onCreate:y,onView:_,onEdit:x,onDelete:E,onRefresh:T,onExport:N,createPath:k,detailPath:D,editPath:M,additionalActions:A=[],bulkActions:R=[],title:z,description:V,createLabel:H="Create",refreshLabel:F="Refresh",exportLabel:L="Export",viewLabel:O="View",editLabel:j="Edit",deleteLabel:P="Delete",itemName:U="item",getRowKey:I=Ce=>Ce.id||Ce._id,showHeader:$=!0,showToolbar:Q=!0,compact:W=!1,className:X,deleteConfirmTitle:q,deleteConfirmDescription:G,getDeleteItemName:ee,filters:re,headerActions:ce,searchable:ie=!0,showEditButton:le=!0,showDeleteButton:we=!0})=>{const Ce=Je.useNavigate(),[be,Ne]=m.useState(!1),[B,Y]=m.useState(null),[Z,se]=m.useState(!1),[ne,te]=m.useState(""),ae=m.useRef(!1),ge=m.useRef(ne),pe=m.useRef(null),xe=m.useRef(null),De=(e==null?void 0:e.items)??t??[],ke=(e==null?void 0:e.loading)??n,Xe=(e==null?void 0:e.error)??i,Fe=(e==null?void 0:e.pagination)??{page:o,pageSize:l,total:a,totalPages:r},Pe=Fe.page??o,He=Fe.pageSize??l,yn=Fe.total??a,xn=Fe.totalPages??r,Ve=e==null?void 0:e.fetchList,an=e==null?void 0:e.delete,he=e==null?void 0:e.setPage,Te=e==null?void 0:e.setPageSize,de=e==null?void 0:e.setFilters;m.useEffect(()=>{Ve&&!ae.current&&(ae.current=!0,pe.current=Pe,xe.current=He,Ve())},[Ve]),m.useEffect(()=>{if(!Ve||!ae.current)return;const Se=pe.current!==Pe,gr=xe.current!==He;(Se||gr)&&(pe.current=Pe,xe.current=He,Ve())},[Pe,He,Ve]),m.useEffect(()=>{if(!Ve||!ae.current||ge.current===ne)return;const Se=setTimeout(()=>{ie&&(ge.current=ne,de==null||de({search:ne}),Pe!==1?he==null||he(1):Ve())},300);return()=>clearTimeout(Se)},[ne,ie,Pe,de,he,Ve]);const Me=m.useCallback(Se=>{he?he(Se):f==null||f(Se)},[he,f]),tt=m.useCallback(Se=>{Te?Te(Se):d==null||d(Se)},[Te,d]),Ee=m.useCallback(Se=>{de?te(Se):S==null||S(Se)},[de,S]),Xi=m.useCallback(()=>{k?Ce(k):y==null||y()},[k,Ce,y]),Qi=m.useCallback(Se=>{D?Ce(`${D}/${I(Se)}`):_==null||_(Se)},[D,Ce,I,_]),Ji=m.useCallback(Se=>{M?Ce(`${M}/${I(Se)}/edit`):x==null||x(Se)},[M,Ce,I,x]),ni=m.useCallback(()=>{Ve?Ve():T==null||T()},[Ve,T]),_n=m.useCallback(Se=>{Y(Se),Ne(!0)},[]),xm=async()=>{if(B){se(!0);try{an?(await an(I(B)),Ve==null||Ve()):E&&await E(B),Ne(!1),Y(null)}catch(Se){console.error("Delete error:",Se)}finally{se(!1)}}},_m=m.useMemo(()=>{const Se=[];return(D||_)&&Se.push({label:O,icon:Pg,onClick:Qi}),(M||x)&&le&&Se.push({label:j,icon:Fr,onClick:Ji}),(an||E)&&we&&Se.push({label:P,icon:jr,variant:"destructive",onClick:_n}),[...Se,...A]},[D,M,_,x,an,E,O,j,P,Qi,Ji,_n,A]),mr=k||y,wm=Ve||T,Jl=m.useMemo(()=>B?ee?ee(B):B.name||B.title||U:U,[B,ee,U]),ea=()=>Q?g.jsxs("div",{className:"flex items-center gap-2",children:[ce,u&&p.length>0&&R.length>0&&g.jsx(g.Fragment,{children:R.map((Se,gr)=>g.jsxs(_e,{variant:Se.variant||"outline",size:"sm",onClick:()=>{var na;return(na=Se.onClick)==null?void 0:na.call(Se,p)},disabled:Se.disabled,children:[Se.icon&&g.jsx(Se.icon,{className:"mr-2 h-4 w-4"}),Se.label]},Se.label||gr))}),N&&g.jsxs(_e,{variant:"outline",size:"sm",onClick:N,children:[g.jsx(Lg,{className:"mr-2 h-4 w-4"}),L]}),wm&&g.jsxs(_e,{variant:"outline",size:"sm",onClick:ni,disabled:ke,children:[g.jsx(Rc,{className:J("mr-2 h-4 w-4",ke&&"animate-spin")}),F]}),mr&&g.jsxs(_e,{size:"sm",onClick:Xi,children:[g.jsx(Fg,{className:"mr-2 h-4 w-4"}),H]})]}):null,ta=g.jsxs(g.Fragment,{children:[re&&g.jsx("div",{className:"mb-4 flex items-center gap-2",children:re}),g.jsx(ql,{data:De,columns:s,loading:ke,error:Xe,currentPage:Pe,pageSize:He,totalItems:yn,totalPages:xn,onPageChange:Me,onPageSizeChange:tt,sortColumn:h,sortDirection:b,onSort:w,searchable:ie,searchValue:de?ne:C,onSearchChange:Ee,searchPlaceholder:c,selectable:u,selectedRows:p,onSelectionChange:v,actions:_m,getRowKey:I,compact:W,emptyTitle:`No ${U}s found`,emptyDescription:`Create your first ${U} to get started.`,emptyAction:mr?`Create ${U}`:void 0,onEmptyAction:mr?Xi:void 0}),g.jsx(Ni,{open:be,onOpenChange:Ne,onConfirm:xm,title:q||`Delete ${U}`,description:G||`Are you sure you want to delete "${Jl}"? This action cannot be undone.`,itemName:Jl,loading:Z})]});return $&&(z||V)?g.jsxs(ht,{className:X,children:[g.jsxs(In,{className:"flex flex-row items-center justify-between space-y-0 pb-4",children:[g.jsxs("div",{children:[z&&g.jsx(Bn,{children:z}),V&&g.jsx(Fn,{children:V})]}),ea()]}),g.jsx(pt,{children:ta})]}):g.jsxs("div",{className:X,children:[Q&&g.jsxs("div",{className:"flex items-center justify-between mb-4",children:[g.jsx("div",{}),ea()]}),ta]})};im.displayName="CrudList";var Ki=e=>e.type==="checkbox",fn=e=>e instanceof Date,it=e=>e==null;const sm=e=>typeof e=="object";var Ue=e=>!it(e)&&!Array.isArray(e)&&sm(e)&&!fn(e),RE=e=>Ue(e)&&e.target?Ki(e.target)?e.target.checked:e.target.value:e,LE=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,OE=(e,t)=>e.has(LE(t)),PE=e=>{const t=e.constructor&&e.constructor.prototype;return Ue(t)&&t.hasOwnProperty("isPrototypeOf")},Zl=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Ge(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(!(Zl&&(e instanceof Blob||i))&&(n||Ue(e)))if(t=n?[]:Object.create(Object.getPrototypeOf(e)),!n&&!PE(e))t=e;else for(const s in e)e.hasOwnProperty(s)&&(t[s]=Ge(e[s]));else return e;return t}var hr=e=>/^\w*$/.test(e),We=e=>e===void 0,Gl=e=>Array.isArray(e)?e.filter(Boolean):[],Kl=e=>Gl(e.replace(/["|']|\]/g,"").split(/\.|\[/)),ue=(e,t,n)=>{if(!t||!Ue(e))return n;const i=(hr(t)?[t]:Kl(t)).reduce((s,o)=>it(s)?s:s[o],e);return We(i)||i===e?We(e[t])?n:e[t]:i},Tt=e=>typeof e=="boolean",Oe=(e,t,n)=>{let i=-1;const s=hr(t)?[t]:Kl(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=Ue(f)||Array.isArray(f)?f:isNaN(+s[i+1])?{}:[]}if(a==="__proto__"||a==="constructor"||a==="prototype")return;e[a]=r,e=e[a]}};const rc={BLUR:"blur",FOCUS_OUT:"focusout"},yt={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"},IE=K.createContext(null);IE.displayName="HookFormContext";var BE=(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]!==yt.all&&(t._proxyFormState[l]=!i||yt.all),e[l]}});return s};const FE=typeof window<"u"?K.useLayoutEffect:K.useEffect;var lt=e=>typeof e=="string",jE=(e,t,n,i,s)=>lt(e)?(i&&t.watch.add(e),ue(n,e,s)):Array.isArray(e)?e.map(o=>(i&&t.watch.add(o),ue(n,o))):(i&&(t.watchAll=!0),n),ro=e=>it(e)||!sm(e);function Kt(e,t,n=new WeakSet){if(ro(e)||ro(t))return Object.is(e,t);if(fn(e)&&fn(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(fn(l)&&fn(a)||Ue(l)&&Ue(a)||Array.isArray(l)&&Array.isArray(a)?!Kt(l,a,n):!Object.is(l,a))return!1}}return!0}var rm=(e,t,n,i,s)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[i]:s||!0}}:{},pi=e=>Array.isArray(e)?e:[e],oc=()=>{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 om(e,t){const n={};for(const i in e)if(e.hasOwnProperty(i)){const s=e[i],o=t[i];if(s&&Ue(s)&&o){const l=om(s,o);Ue(l)&&(n[i]=l)}else e[i]&&(n[i]=o)}return n}var nt=e=>Ue(e)&&!Object.keys(e).length,Xl=e=>e.type==="file",xt=e=>typeof e=="function",Cs=e=>{if(!Zl)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},lm=e=>e.type==="select-multiple",Ql=e=>e.type==="radio",zE=e=>Ql(e)||Ki(e),Ir=e=>Cs(e)&&e.isConnected;function HE(e,t){const n=t.slice(0,-1).length;let i=0;for(;i<n;)e=We(e)?i++:e[t[i++]];return e}function VE(e){for(const t in e)if(e.hasOwnProperty(t)&&!We(e[t]))return!1;return!0}function $e(e,t){const n=Array.isArray(t)?t:hr(t)?[t]:Kl(t),i=n.length===1?e:HE(e,n),s=n.length-1,o=n[s];return i&&delete i[o],s!==0&&(Ue(i)&&nt(i)||Array.isArray(i)&&VE(i))&&$e(e,n.slice(0,-1)),e}var WE=e=>{for(const t in e)if(xt(e[t]))return!0;return!1};function am(e){return Array.isArray(e)||Ue(e)&&!WE(e)}function oo(e,t={}){for(const n in e){const i=e[n];am(i)?(t[n]=Array.isArray(i)?[]:{},oo(i,t[n])):We(i)||(t[n]=!0)}return t}function Mn(e,t,n){n||(n=oo(t));for(const i in e){const s=e[i];if(am(s))We(t)||ro(n[i])?n[i]=oo(s,Array.isArray(s)?[]:{}):Mn(s,it(t)?{}:t[i],n[i]);else{const o=t[i];n[i]=!Kt(s,o)}}return n}const lc={value:!1,isValid:!1},ac={value:!0,isValid:!0};var cm=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&&!We(e[0].attributes.value)?We(e[0].value)||e[0].value===""?ac:{value:e[0].value,isValid:!0}:ac:lc}return lc},um=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:i})=>We(e)?e:t?e===""?NaN:e&&+e:n&<(e)?new Date(e):i?i(e):e;const cc={isValid:!1,value:null};var dm=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,cc):cc;function uc(e){const t=e.ref;return Xl(t)?t.files:Ql(t)?dm(e.refs).value:lm(t)?[...t.selectedOptions].map(({value:n})=>n):Ki(t)?cm(e.refs).value:um(We(t.value)?e.ref.value:t.value,e)}var $E=(e,t,n,i)=>{const s={};for(const o of e){const l=ue(t,o);l&&Oe(s,o,l._f)}return{criteriaMode:n,names:[...e],fields:s,shouldUseNativeValidation:i}},Ss=e=>e instanceof RegExp,li=e=>We(e)?e:Ss(e)?e.source:Ue(e)?Ss(e.value)?e.value.source:e.value:e,dc=e=>({isOnSubmit:!e||e===yt.onSubmit,isOnBlur:e===yt.onBlur,isOnChange:e===yt.onChange,isOnAll:e===yt.all,isOnTouch:e===yt.onTouched});const fc="AsyncFunction";var UE=e=>!!e&&!!e.validate&&!!(xt(e.validate)&&e.validate.constructor.name===fc||Ue(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===fc)),YE=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),hc=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(i=>e.startsWith(i)&&/^\.\w+/.test(e.slice(i.length))));const mi=(e,t,n,i)=>{for(const s of n||Object.keys(e)){const o=ue(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(mi(a,t))break}else if(Ue(a)&&mi(a,t))break}}};function pc(e,t,n){const i=ue(e,n);if(i||hr(n))return{error:i,name:n};const s=n.split(".");for(;s.length;){const o=s.join("."),l=ue(t,o),a=ue(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 qE=(e,t,n,i)=>{n(e);const{name:s,...o}=e;return nt(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(l=>t[l]===(!i||yt.all))},ZE=(e,t,n)=>!e||!t||e===t||pi(e).some(i=>i&&(n?i===t:i.startsWith(t)||t.startsWith(i))),GE=(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,KE=(e,t)=>!Gl(ue(e,t)).length&&$e(e,t),XE=(e,t,n)=>{const i=pi(ue(e,n));return Oe(i,"root",t[n]),Oe(e,n,i),e};function mc(e,t,n="validate"){if(lt(e)||Array.isArray(e)&&e.every(lt)||Tt(e)&&!e)return{type:n,message:lt(e)?e:"",ref:t}}var Tn=e=>Ue(e)&&!Ss(e)?e:{value:e,message:""},gc=async(e,t,n,i,s,o)=>{const{ref:l,refs:a,required:r,maxLength:f,minLength:d,min:h,max:b,pattern:w,validate:C,name:S,valueAsNumber:c,mount:u}=e._f,p=ue(n,S);if(!u||t.has(S))return{};const v=a?a[0]:l,y=M=>{s&&v.reportValidity&&(v.setCustomValidity(Tt(M)?"":M||""),v.reportValidity())},_={},x=Ql(l),E=Ki(l),T=x||E,N=(c||Xl(l))&&We(l.value)&&We(p)||Cs(l)&&l.value===""||p===""||Array.isArray(p)&&!p.length,k=rm.bind(null,S,i,_),D=(M,A,R,z=Bt.maxLength,V=Bt.minLength)=>{const H=M?A:R;_[S]={type:M?z:V,message:H,ref:l,...k(M?z:V,H)}};if(o?!Array.isArray(p)||!p.length:r&&(!T&&(N||it(p))||Tt(p)&&!p||E&&!cm(a).isValid||x&&!dm(a).isValid)){const{value:M,message:A}=lt(r)?{value:!!r,message:r}:Tn(r);if(M&&(_[S]={type:Bt.required,message:A,ref:v,...k(Bt.required,A)},!i))return y(A),_}if(!N&&(!it(h)||!it(b))){let M,A;const R=Tn(b),z=Tn(h);if(!it(p)&&!isNaN(p)){const V=l.valueAsNumber||p&&+p;it(R.value)||(M=V>R.value),it(z.value)||(A=V<z.value)}else{const V=l.valueAsDate||new Date(p),H=O=>new Date(new Date().toDateString()+" "+O),F=l.type=="time",L=l.type=="week";lt(R.value)&&p&&(M=F?H(p)>H(R.value):L?p>R.value:V>new Date(R.value)),lt(z.value)&&p&&(A=F?H(p)<H(z.value):L?p<z.value:V<new Date(z.value))}if((M||A)&&(D(!!M,R.message,z.message,Bt.max,Bt.min),!i))return y(_[S].message),_}if((f||d)&&!N&&(lt(p)||o&&Array.isArray(p))){const M=Tn(f),A=Tn(d),R=!it(M.value)&&p.length>+M.value,z=!it(A.value)&&p.length<+A.value;if((R||z)&&(D(R,M.message,A.message),!i))return y(_[S].message),_}if(w&&!N&<(p)){const{value:M,message:A}=Tn(w);if(Ss(M)&&!p.match(M)&&(_[S]={type:Bt.pattern,message:A,ref:l,...k(Bt.pattern,A)},!i))return y(A),_}if(C){if(xt(C)){const M=await C(p,n),A=mc(M,v);if(A&&(_[S]={...A,...k(Bt.validate,A.message)},!i))return y(A.message),_}else if(Ue(C)){let M={};for(const A in C){if(!nt(M)&&!i)break;const R=mc(await C[A](p,n),v,A);R&&(M={...R,...k(A,R.message)},y(R.message),i&&(_[S]=M))}if(!nt(M)&&(_[S]={ref:v,...M},!i))return _}}return y(!0),_};const QE={mode:yt.onSubmit,reValidateMode:yt.onChange,shouldFocusError:!0};function JE(e={}){let t={...QE,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:xt(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},i={},s=Ue(t.defaultValues)||Ue(t.values)?Ge(t.defaultValues||t.values)||{}:{},o=t.shouldUnregister?{}:Ge(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:oc(),state:oc()},w=t.criteriaMode===yt.all,C=B=>Y=>{clearTimeout(f),f=setTimeout(B,Y)},S=async B=>{if(!t.disabled&&(d.isValid||h.isValid||B)){const Y=t.resolver?nt((await E()).errors):await N(i,!0);Y!==n.isValid&&b.state.next({isValid:Y})}},c=(B,Y)=>{!t.disabled&&(d.isValidating||d.validatingFields||h.isValidating||h.validatingFields)&&((B||Array.from(a.mount)).forEach(Z=>{Z&&(Y?Oe(n.validatingFields,Z,Y):$e(n.validatingFields,Z))}),b.state.next({validatingFields:n.validatingFields,isValidating:!nt(n.validatingFields)}))},u=(B,Y=[],Z,se,ne=!0,te=!0)=>{if(se&&Z&&!t.disabled){if(l.action=!0,te&&Array.isArray(ue(i,B))){const ae=Z(ue(i,B),se.argA,se.argB);ne&&Oe(i,B,ae)}if(te&&Array.isArray(ue(n.errors,B))){const ae=Z(ue(n.errors,B),se.argA,se.argB);ne&&Oe(n.errors,B,ae),KE(n.errors,B)}if((d.touchedFields||h.touchedFields)&&te&&Array.isArray(ue(n.touchedFields,B))){const ae=Z(ue(n.touchedFields,B),se.argA,se.argB);ne&&Oe(n.touchedFields,B,ae)}(d.dirtyFields||h.dirtyFields)&&(n.dirtyFields=Mn(s,o)),b.state.next({name:B,isDirty:D(B,Y),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Oe(o,B,Y)},p=(B,Y)=>{Oe(n.errors,B,Y),b.state.next({errors:n.errors})},v=B=>{n.errors=B,b.state.next({errors:n.errors,isValid:!1})},y=(B,Y,Z,se)=>{const ne=ue(i,B);if(ne){const te=ue(o,B,We(Z)?ue(s,B):Z);We(te)||se&&se.defaultChecked||Y?Oe(o,B,Y?te:uc(ne._f)):R(B,te),l.mount&&!l.action&&S()}},_=(B,Y,Z,se,ne)=>{let te=!1,ae=!1;const ge={name:B};if(!t.disabled){if(!Z||se){(d.isDirty||h.isDirty)&&(ae=n.isDirty,n.isDirty=ge.isDirty=D(),te=ae!==ge.isDirty);const pe=Kt(ue(s,B),Y);ae=!!ue(n.dirtyFields,B),pe?$e(n.dirtyFields,B):Oe(n.dirtyFields,B,!0),ge.dirtyFields=n.dirtyFields,te=te||(d.dirtyFields||h.dirtyFields)&&ae!==!pe}if(Z){const pe=ue(n.touchedFields,B);pe||(Oe(n.touchedFields,B,Z),ge.touchedFields=n.touchedFields,te=te||(d.touchedFields||h.touchedFields)&&pe!==Z)}te&&ne&&b.state.next(ge)}return te?ge:{}},x=(B,Y,Z,se)=>{const ne=ue(n.errors,B),te=(d.isValid||h.isValid)&&Tt(Y)&&n.isValid!==Y;if(t.delayError&&Z?(r=C(()=>p(B,Z)),r(t.delayError)):(clearTimeout(f),r=null,Z?Oe(n.errors,B,Z):$e(n.errors,B)),(Z?!Kt(ne,Z):ne)||!nt(se)||te){const ae={...se,...te&&Tt(Y)?{isValid:Y}:{},errors:n.errors,name:B};n={...n,...ae},b.state.next(ae)}},E=async B=>{c(B,!0);const Y=await t.resolver(o,t.context,$E(B||a.mount,i,t.criteriaMode,t.shouldUseNativeValidation));return c(B),Y},T=async B=>{const{errors:Y}=await E(B);if(B)for(const Z of B){const se=ue(Y,Z);se?Oe(n.errors,Z,se):$e(n.errors,Z)}else n.errors=Y;return Y},N=async(B,Y,Z={valid:!0})=>{for(const se in B){const ne=B[se];if(ne){const{_f:te,...ae}=ne;if(te){const ge=a.array.has(te.name),pe=ne._f&&UE(ne._f);pe&&d.validatingFields&&c([te.name],!0);const xe=await gc(ne,a.disabled,o,w,t.shouldUseNativeValidation&&!Y,ge);if(pe&&d.validatingFields&&c([te.name]),xe[te.name]&&(Z.valid=!1,Y))break;!Y&&(ue(xe,te.name)?ge?XE(n.errors,xe,te.name):Oe(n.errors,te.name,xe[te.name]):$e(n.errors,te.name))}!nt(ae)&&await N(ae,Y,Z)}}return Z.valid},k=()=>{for(const B of a.unMount){const Y=ue(i,B);Y&&(Y._f.refs?Y._f.refs.every(Z=>!Ir(Z)):!Ir(Y._f.ref))&&W(B)}a.unMount=new Set},D=(B,Y)=>!t.disabled&&(B&&Y&&Oe(o,B,Y),!Kt(O(),s)),M=(B,Y,Z)=>jE(B,a,{...l.mount?o:We(Y)?s:lt(B)?{[B]:Y}:Y},Z,Y),A=B=>Gl(ue(l.mount?o:s,B,t.shouldUnregister?ue(s,B,[]):[])),R=(B,Y,Z={})=>{const se=ue(i,B);let ne=Y;if(se){const te=se._f;te&&(!te.disabled&&Oe(o,B,um(Y,te)),ne=Cs(te.ref)&&it(Y)?"":Y,lm(te.ref)?[...te.ref.options].forEach(ae=>ae.selected=ne.includes(ae.value)):te.refs?Ki(te.ref)?te.refs.forEach(ae=>{(!ae.defaultChecked||!ae.disabled)&&(Array.isArray(ne)?ae.checked=!!ne.find(ge=>ge===ae.value):ae.checked=ne===ae.value||!!ne)}):te.refs.forEach(ae=>ae.checked=ae.value===ne):Xl(te.ref)?te.ref.value="":(te.ref.value=ne,te.ref.type||b.state.next({name:B,values:Ge(o)})))}(Z.shouldDirty||Z.shouldTouch)&&_(B,ne,Z.shouldTouch,Z.shouldDirty,!0),Z.shouldValidate&&L(B)},z=(B,Y,Z)=>{for(const se in Y){if(!Y.hasOwnProperty(se))return;const ne=Y[se],te=B+"."+se,ae=ue(i,te);(a.array.has(B)||Ue(ne)||ae&&!ae._f)&&!fn(ne)?z(te,ne,Z):R(te,ne,Z)}},V=(B,Y,Z={})=>{const se=ue(i,B),ne=a.array.has(B),te=Ge(Y);Oe(o,B,te),ne?(b.array.next({name:B,values:Ge(o)}),(d.isDirty||d.dirtyFields||h.isDirty||h.dirtyFields)&&Z.shouldDirty&&b.state.next({name:B,dirtyFields:Mn(s,o),isDirty:D(B,te)})):se&&!se._f&&!it(te)?z(B,te,Z):R(B,te,Z),hc(B,a)&&b.state.next({...n,name:B}),b.state.next({name:l.mount?B:void 0,values:Ge(o)})},H=async B=>{l.mount=!0;const Y=B.target;let Z=Y.name,se=!0;const ne=ue(i,Z),te=pe=>{se=Number.isNaN(pe)||fn(pe)&&isNaN(pe.getTime())||Kt(pe,ue(o,Z,pe))},ae=dc(t.mode),ge=dc(t.reValidateMode);if(ne){let pe,xe;const De=Y.type?uc(ne._f):RE(B),ke=B.type===rc.BLUR||B.type===rc.FOCUS_OUT,Xe=!YE(ne._f)&&!t.resolver&&!ue(n.errors,Z)&&!ne._f.deps||GE(ke,ue(n.touchedFields,Z),n.isSubmitted,ge,ae),Fe=hc(Z,a,ke);Oe(o,Z,De),ke?(!Y||!Y.readOnly)&&(ne._f.onBlur&&ne._f.onBlur(B),r&&r(0)):ne._f.onChange&&ne._f.onChange(B);const Pe=_(Z,De,ke),He=!nt(Pe)||Fe;if(!ke&&b.state.next({name:Z,type:B.type,values:Ge(o)}),Xe)return(d.isValid||h.isValid)&&(t.mode==="onBlur"?ke&&S():ke||S()),He&&b.state.next({name:Z,...Fe?{}:Pe});if(!ke&&Fe&&b.state.next({...n}),t.resolver){const{errors:yn}=await E([Z]);if(te(De),se){const xn=pc(n.errors,i,Z),Ve=pc(yn,i,xn.name||Z);pe=Ve.error,Z=Ve.name,xe=nt(yn)}}else c([Z],!0),pe=(await gc(ne,a.disabled,o,w,t.shouldUseNativeValidation))[Z],c([Z]),te(De),se&&(pe?xe=!1:(d.isValid||h.isValid)&&(xe=await N(i,!0)));se&&(ne._f.deps&&(!Array.isArray(ne._f.deps)||ne._f.deps.length>0)&&L(ne._f.deps),x(Z,xe,pe,Pe))}},F=(B,Y)=>{if(ue(n.errors,Y)&&B.focus)return B.focus(),1},L=async(B,Y={})=>{let Z,se;const ne=pi(B);if(t.resolver){const te=await T(We(B)?B:ne);Z=nt(te),se=B?!ne.some(ae=>ue(te,ae)):Z}else B?(se=(await Promise.all(ne.map(async te=>{const ae=ue(i,te);return await N(ae&&ae._f?{[te]:ae}:ae)}))).every(Boolean),!(!se&&!n.isValid)&&S()):se=Z=await N(i);return b.state.next({...!lt(B)||(d.isValid||h.isValid)&&Z!==n.isValid?{}:{name:B},...t.resolver||!B?{isValid:Z}:{},errors:n.errors}),Y.shouldFocus&&!se&&mi(i,F,B?ne:a.mount),se},O=(B,Y)=>{let Z={...l.mount?o:s};return Y&&(Z=om(Y.dirtyFields?n.dirtyFields:n.touchedFields,Z)),We(B)?Z:lt(B)?ue(Z,B):B.map(se=>ue(Z,se))},j=(B,Y)=>({invalid:!!ue((Y||n).errors,B),isDirty:!!ue((Y||n).dirtyFields,B),error:ue((Y||n).errors,B),isValidating:!!ue(n.validatingFields,B),isTouched:!!ue((Y||n).touchedFields,B)}),P=B=>{B&&pi(B).forEach(Y=>$e(n.errors,Y)),b.state.next({errors:B?n.errors:{}})},U=(B,Y,Z)=>{const se=(ue(i,B,{_f:{}})._f||{}).ref,ne=ue(n.errors,B)||{},{ref:te,message:ae,type:ge,...pe}=ne;Oe(n.errors,B,{...pe,...Y,ref:se}),b.state.next({name:B,errors:n.errors,isValid:!1}),Z&&Z.shouldFocus&&se&&se.focus&&se.focus()},I=(B,Y)=>xt(B)?b.state.subscribe({next:Z=>"values"in Z&&B(M(void 0,Y),Z)}):M(B,Y,!0),$=B=>b.state.subscribe({next:Y=>{ZE(B.name,Y.name,B.exact)&&qE(Y,B.formState||d,Ce,B.reRenderRoot)&&B.callback({values:{...o},...n,...Y,defaultValues:s})}}).unsubscribe,Q=B=>(l.mount=!0,h={...h,...B.formState},$({...B,formState:h})),W=(B,Y={})=>{for(const Z of B?pi(B):a.mount)a.mount.delete(Z),a.array.delete(Z),Y.keepValue||($e(i,Z),$e(o,Z)),!Y.keepError&&$e(n.errors,Z),!Y.keepDirty&&$e(n.dirtyFields,Z),!Y.keepTouched&&$e(n.touchedFields,Z),!Y.keepIsValidating&&$e(n.validatingFields,Z),!t.shouldUnregister&&!Y.keepDefaultValue&&$e(s,Z);b.state.next({values:Ge(o)}),b.state.next({...n,...Y.keepDirty?{isDirty:D()}:{}}),!Y.keepIsValid&&S()},X=({disabled:B,name:Y})=>{(Tt(B)&&l.mount||B||a.disabled.has(Y))&&(B?a.disabled.add(Y):a.disabled.delete(Y))},q=(B,Y={})=>{let Z=ue(i,B);const se=Tt(Y.disabled)||Tt(t.disabled);return Oe(i,B,{...Z||{},_f:{...Z&&Z._f?Z._f:{ref:{name:B}},name:B,mount:!0,...Y}}),a.mount.add(B),Z?X({disabled:Tt(Y.disabled)?Y.disabled:t.disabled,name:B}):y(B,!0,Y.value),{...se?{disabled:Y.disabled||t.disabled}:{},...t.progressive?{required:!!Y.required,min:li(Y.min),max:li(Y.max),minLength:li(Y.minLength),maxLength:li(Y.maxLength),pattern:li(Y.pattern)}:{},name:B,onChange:H,onBlur:H,ref:ne=>{if(ne){q(B,Y),Z=ue(i,B);const te=We(ne.value)&&ne.querySelectorAll&&ne.querySelectorAll("input,select,textarea")[0]||ne,ae=zE(te),ge=Z._f.refs||[];if(ae?ge.find(pe=>pe===te):te===Z._f.ref)return;Oe(i,B,{_f:{...Z._f,...ae?{refs:[...ge.filter(Ir),te,...Array.isArray(ue(s,B))?[{}]:[]],ref:{type:te.type,name:B}}:{ref:te}}}),y(B,!1,void 0,te)}else Z=ue(i,B,{}),Z._f&&(Z._f.mount=!1),(t.shouldUnregister||Y.shouldUnregister)&&!(OE(a.array,B)&&l.action)&&a.unMount.add(B)}}},G=()=>t.shouldFocusError&&mi(i,F,a.mount),ee=B=>{Tt(B)&&(b.state.next({disabled:B}),mi(i,(Y,Z)=>{const se=ue(i,Z);se&&(Y.disabled=se._f.disabled||B,Array.isArray(se._f.refs)&&se._f.refs.forEach(ne=>{ne.disabled=se._f.disabled||B}))},0,!1))},re=(B,Y)=>async Z=>{let se;Z&&(Z.preventDefault&&Z.preventDefault(),Z.persist&&Z.persist());let ne=Ge(o);if(b.state.next({isSubmitting:!0}),t.resolver){const{errors:te,values:ae}=await E();n.errors=te,ne=Ge(ae)}else await N(i);if(a.disabled.size)for(const te of a.disabled)$e(ne,te);if($e(n.errors,"root"),nt(n.errors)){b.state.next({errors:{}});try{await B(ne,Z)}catch(te){se=te}}else Y&&await Y({...n.errors},Z),G(),setTimeout(G);if(b.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:nt(n.errors)&&!se,submitCount:n.submitCount+1,errors:n.errors}),se)throw se},ce=(B,Y={})=>{ue(i,B)&&(We(Y.defaultValue)?V(B,Ge(ue(s,B))):(V(B,Y.defaultValue),Oe(s,B,Ge(Y.defaultValue))),Y.keepTouched||$e(n.touchedFields,B),Y.keepDirty||($e(n.dirtyFields,B),n.isDirty=Y.defaultValue?D(B,Ge(ue(s,B))):D()),Y.keepError||($e(n.errors,B),d.isValid&&S()),b.state.next({...n}))},ie=(B,Y={})=>{const Z=B?Ge(B):s,se=Ge(Z),ne=nt(B),te=ne?s:se;if(Y.keepDefaultValues||(s=Z),!Y.keepValues){if(Y.keepDirtyValues){const ae=new Set([...a.mount,...Object.keys(Mn(s,o))]);for(const ge of Array.from(ae))ue(n.dirtyFields,ge)?Oe(te,ge,ue(o,ge)):V(ge,ue(te,ge))}else{if(Zl&&We(B))for(const ae of a.mount){const ge=ue(i,ae);if(ge&&ge._f){const pe=Array.isArray(ge._f.refs)?ge._f.refs[0]:ge._f.ref;if(Cs(pe)){const xe=pe.closest("form");if(xe){xe.reset();break}}}}if(Y.keepFieldsRef)for(const ae of a.mount)V(ae,ue(te,ae));else i={}}o=t.shouldUnregister?Y.keepDefaultValues?Ge(s):{}:Ge(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&&!nt(te),l.watch=!!t.shouldUnregister,l.action=!1,Y.keepErrors||(n.errors={}),b.state.next({submitCount:Y.keepSubmitCount?n.submitCount:0,isDirty:ne?!1:Y.keepDirty?n.isDirty:!!(Y.keepDefaultValues&&!Kt(B,s)),isSubmitted:Y.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:ne?{}:Y.keepDirtyValues?Y.keepDefaultValues&&o?Mn(s,o):n.dirtyFields:Y.keepDefaultValues&&B?Mn(s,B):Y.keepDirty?n.dirtyFields:{},touchedFields:Y.keepTouched?n.touchedFields:{},errors:Y.keepErrors?n.errors:{},isSubmitSuccessful:Y.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:s})},le=(B,Y)=>ie(xt(B)?B(o):B,Y),we=(B,Y={})=>{const Z=ue(i,B),se=Z&&Z._f;if(se){const ne=se.refs?se.refs[0]:se.ref;ne.focus&&(ne.focus(),Y.shouldSelect&&xt(ne.select)&&ne.select())}},Ce=B=>{n={...n,...B}},Ne={control:{register:q,unregister:W,getFieldState:j,handleSubmit:re,setError:U,_subscribe:$,_runSchema:E,_focusError:G,_getWatch:M,_getDirty:D,_setValid:S,_setFieldArray:u,_setDisabledField:X,_setErrors:v,_getFieldArray:A,_reset:ie,_resetDefaultValues:()=>xt(t.defaultValues)&&t.defaultValues().then(B=>{le(B,t.resetOptions),b.state.next({isLoading:!1})}),_removeUnmounted:k,_disableForm:ee,_subjects:b,_proxyFormState:d,get _fields(){return i},get _formValues(){return o},get _state(){return l},set _state(B){l=B},get _defaultValues(){return s},get _names(){return a},set _names(B){a=B},get _formState(){return n},get _options(){return t},set _options(B){t={...t,...B}}},subscribe:Q,trigger:L,register:q,handleSubmit:re,watch:I,setValue:V,getValues:O,reset:le,resetField:ce,clearErrors:P,unregister:W,setError:U,setFocus:we,getFieldState:j};return{...Ne,formControl:Ne}}function e5(e={}){const t=K.useRef(void 0),n=K.useRef(void 0),[i,s]=K.useState({isDirty:!1,isValidating:!1,isLoading:xt(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:xt(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:i},e.defaultValues&&!xt(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:l,...a}=JE(e);t.current={...a,formState:i}}const o=t.current.control;return o._options=e,FE(()=>{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&&!Kt(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=BE(i,o),t.current}const vc=(e,t,n)=>{if(e&&"reportValidity"in e){const i=ue(n,t);e.setCustomValidity(i&&i.message||""),e.reportValidity()}},fm=(e,t)=>{for(const n in t.fields){const i=t.fields[n];i&&i.ref&&"reportValidity"in i.ref?vc(i.ref,n,e):i.refs&&i.refs.forEach(s=>vc(s,n,e))}},t5=(e,t)=>{t.shouldUseNativeValidation&&fm(e,t);const n={};for(const i in e){const s=ue(t.fields,i),o=Object.assign(e[i]||{},{ref:s&&s.ref});if(n5(t.names||Object.keys(e),i)){const l=Object.assign({},ue(n,i));Oe(l,"root",o),Oe(n,i,l)}else Oe(n,i,o)}return n},n5=(e,t)=>e.some(n=>n.startsWith(t+"."));var i5=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]=rm(l,t,n,s,f?[].concat(f,i.message):i.message)}e.shift()}return n},s5=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&&fm({},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:t5(i5(l.errors,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw l}))}catch(l){return Promise.reject(l)}}};const hm=({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:w,submitLabel:C="Save",cancelLabel:S="Cancel",backLabel:c="Back",columns:u=1,showHeader:p=!0,showFooter:v=!0,showBack:y=!0,showCard:_=!0,listPath:x,icon:E,className:T,...N})=>{var Ne;const k=Je.useNavigate(),{id:D}=Je.useParams(),M=!!D,A=e==null?void 0:e(),R=A==null?void 0:A.form,z=(A==null?void 0:A.loading)??!1,V=((Ne=A==null?void 0:A.form)==null?void 0:Ne.isSubmitting)??!1,H=(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,L=A==null?void 0:A.update,O=A==null?void 0:A.resetForm,j=d||z,P=h||V;m.useEffect(()=>(M&&D&&H&&H(D),()=>{O==null||O()}),[D,M]);const U=()=>{a?a():k(x||-1)},I=()=>{l?l():U()},$=async B=>{var Y;(Y=B==null?void 0:B.preventDefault)==null||Y.call(B);try{let Z=(R==null?void 0:R.values)||{};r&&(Z=r(Z)),M?await(L==null?void 0:L(D,Z)):await(F==null?void 0:F(Z)),U()}catch(Z){console.error("Form submission error:",Z)}};if(e&&s){const B=M?`Edit ${b}`:`Create ${b}`,Y=g.jsxs("form",{onSubmit:$,children:[s,v&&g.jsxs("div",{className:"flex items-center justify-end gap-2 mt-6 pt-4 border-t",children:[g.jsxs(_e,{type:"button",variant:"outline",onClick:I,disabled:P,children:[g.jsx(Pn,{className:"mr-2 h-4 w-4"}),S]}),g.jsx(_e,{type:"submit",disabled:P||j,children:P?g.jsxs(g.Fragment,{children:[g.jsx(hn,{className:"mr-2 h-4 w-4 animate-spin"}),"Saving..."]}):g.jsxs(g.Fragment,{children:[g.jsx(ua,{className:"mr-2 h-4 w-4"}),C]})})]})]});return _?g.jsxs(ht,{className:T,...N,children:[g.jsx(In,{children:g.jsxs("div",{className:"flex items-center gap-4",children:[y&&g.jsx(_e,{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(Bn,{children:B}),w&&g.jsx(Fn,{children:w})]})]})}),g.jsx(pt,{children:Y})]}):g.jsxs("div",{className:J("space-y-6",T),...N,children:[g.jsxs("div",{className:"flex items-center gap-4",children:[y&&g.jsx(_e,{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:B}),w&&g.jsx("p",{className:"text-muted-foreground",children:w})]})]}),Y]})}const Q=e5({defaultValues:f||n,resolver:i?s5(i):void 0,mode:"onBlur"}),{handleSubmit:W,formState:{errors:X,isDirty:q,isValid:G},reset:ee,watch:re,setValue:ce,control:ie}=Q;m.useEffect(()=>{f&&ee(f)},[f,ee]);const le=async B=>{try{await(o==null?void 0:o(B))}catch(Y){console.error("Form submission error:",Y)}},we=B=>{var Pe;const{name:Y,type:Z="text",label:se,placeholder:ne,description:te,required:ae,disabled:ge,options:pe=[],className:xe,...De}=B,ke=(Pe=X[Y])==null?void 0:Pe.message,Xe=re(Y),Fe={label:se,placeholder:ne,description:te,error:ke,required:ae,disabled:ge||j||P,className:xe};switch(Z){case"text":case"email":case"password":case"number":case"url":case"tel":return g.jsx(ws,{...Fe,type:Z,...Q.register(Y),...De});case"textarea":return g.jsx(jl,{...Fe,...Q.register(Y),...De});case"select":return g.jsx(zl,{...Fe,options:pe,value:Xe,onChange:He=>ce(Y,He,{shouldValidate:!0}),...De});case"search-select":return g.jsx(Hl,{...Fe,options:pe,value:Xe,onChange:He=>ce(Y,He,{shouldValidate:!0}),...De});case"switch":return g.jsx(Vl,{...Fe,checked:Xe,onCheckedChange:He=>ce(Y,He,{shouldValidate:!0}),...De});case"checkbox":return g.jsx(Wl,{...Fe,checked:Xe,onCheckedChange:He=>ce(Y,He,{shouldValidate:!0}),...De});case"custom":return B.render?B.render({form:Q,field:B,error:ke,value:Xe}):null;default:return g.jsx(ws,{...Fe,type:"text",...Q.register(Y),...De})}},Ce=J("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"),be=g.jsxs("form",{onSubmit:W(le),children:[g.jsx("div",{className:Ce,children:t.map(B=>{if(B.hidden&&(typeof B.hidden=="function"?B.hidden(re()):B.hidden))return null;const Y=B.colSpan||1,Z=J(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:Z,children:we(B)},B.name)})}),v&&g.jsxs("div",{className:"flex items-center justify-end gap-2 mt-6 pt-4 border-t",children:[l&&g.jsxs(_e,{type:"button",variant:"outline",onClick:l,disabled:P,children:[g.jsx(Pn,{className:"mr-2 h-4 w-4"}),S]}),g.jsx(_e,{type:"submit",disabled:P||j,children:P?g.jsxs(g.Fragment,{children:[g.jsx(hn,{className:"mr-2 h-4 w-4 animate-spin"}),"Saving..."]}):g.jsxs(g.Fragment,{children:[g.jsx(ua,{className:"mr-2 h-4 w-4"}),C]})})]})]});return p&&(b||w||y)?g.jsxs(ht,{className:T,...N,children:[g.jsx(In,{children:g.jsxs("div",{className:"flex items-center gap-4",children:[y&&a&&g.jsx(_e,{variant:"ghost",size:"icon",onClick:a,children:g.jsx(Ft,{className:"h-4 w-4"})}),g.jsxs("div",{children:[b&&g.jsx(Bn,{children:b}),w&&g.jsx(Fn,{children:w})]})]})}),g.jsx(pt,{children:be})]}):g.jsx("div",{className:T,...N,children:be})};hm.displayName="CrudForm";const pm=({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:w="Edit",deleteLabel:C="Delete",backLabel:S="Back",itemName:c="item",getItemName:u,showEditButton:p=!0,showDeleteButton:v=!0,showHeader:y=!0,showMeta:_=!0,showCard:x=!0,columns:E=2,icon:T,className:N,...k})=>{const D=Je.useNavigate(),{id:M}=Je.useParams(),A=e==null?void 0:e(),R=A==null?void 0:A.currentItem,z=(A==null?void 0:A.loading)??!1,V=A==null?void 0:A.error,H=(A==null?void 0:A.fetchById)||(A==null?void 0:A.fetchOne),F=A==null?void 0:A.delete,L=n||R,O=i||z,j=s||V,[P,U]=m.useState(!1),[I,$]=m.useState(!1);m.useEffect(()=>{M&&H&&H(M)},[M]);const Q=()=>{l?l():D(f||-1)},W=()=>{a?a(L):d&&M&&D(`${d}/${M}/edit`)},X=async()=>{$(!0);try{r?await r(L):F&&M&&(await F(M),Q()),U(!1)}catch(ie){console.error("Delete error:",ie)}finally{$(!1)}},q=L&&u?u(L):(L==null?void 0:L.name)||(L==null?void 0:L.title)||c,G=(ie,le)=>{if(ie.render)return L?ie.render(le,L):g.jsx("span",{className:"text-muted-foreground",children:"-"});if(le==null||le==="")return g.jsx("span",{className:"text-muted-foreground",children:"-"});switch(ie.type){case"badge":return g.jsx(ai,{variant:ie.variant||"default",children:ie.format?ie.format(le):String(le)});case"status":const we={active:"success",inactive:"secondary",pending:"warning",error:"destructive",...ie.statusColors};return g.jsx(ai,{variant:we[le==null?void 0:le.toLowerCase()]||"default",children:ie.format?ie.format(le):String(le)});case"boolean":const Ce=!!le;return g.jsx(ai,{variant:Ce?"success":"secondary",children:Ce?ie.trueLabel||"Yes":ie.falseLabel||"No"});case"date":return ao(le);case"datetime":return os(le);case"currency":return new Intl.NumberFormat("en-US",{style:"currency",currency:ie.currency||"USD"}).format(le);case"number":return ie.format?ie.format(le):new Intl.NumberFormat().format(le);case"list":return Array.isArray(le)?g.jsx("div",{className:"flex flex-wrap gap-1",children:le.map((be,Ne)=>g.jsx(ai,{variant:"outline",children:ie.getItemLabel?ie.getItemLabel(be):String(be)},Ne))}):String(le);case"link":return g.jsx("a",{href:le,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:ie.linkText||le});case"email":return g.jsx("a",{href:`mailto:${le}`,className:"text-primary hover:underline",children:le});case"phone":return g.jsx("a",{href:`tel:${le}`,className:"text-primary hover:underline",children:le});case"image":return g.jsx("img",{src:le,alt:ie.label||"Image",className:J("rounded-md object-cover",ie.imageClassName||"h-20 w-20")});case"html":return g.jsx("div",{className:"prose prose-sm max-w-none",dangerouslySetInnerHTML:{__html:le}});default:return ie.format?ie.format(le):String(le)}},ee=ie=>{if(L)return ie.accessor?typeof ie.accessor=="function"?ie.accessor(L):L[ie.accessor]:L[ie.name]},re=J("grid gap-6",E===1&&"grid-cols-1",E===2&&"grid-cols-1 md:grid-cols-2",E===3&&"grid-cols-1 md:grid-cols-2 lg:grid-cols-3"),ce=g.jsxs(g.Fragment,{children:[g.jsx("div",{className:re,children:o.map(ie=>{if(ie.hidden&&(typeof ie.hidden=="function"?L&&ie.hidden(L):ie.hidden))return null;const le=ee(ie),we=ie.colSpan||1,Ce=J(we===2&&"md:col-span-2",we===3&&"lg:col-span-3",we==="full"&&"col-span-full");return g.jsxs("div",{className:Ce,children:[g.jsxs("dt",{className:"text-sm font-medium text-muted-foreground mb-1",children:[ie.icon&&g.jsx(ie.icon,{className:"inline-block mr-2 h-4 w-4"}),ie.label]}),g.jsx("dd",{className:"text-sm",children:G(ie,le)})]},ie.name||ie.accessor)})}),_&&L&&(L.created_at||L.updated_at||L.createdAt||L.updatedAt)&&g.jsxs(g.Fragment,{children:[g.jsx(Ai,{className:"my-6"}),g.jsxs("div",{className:"flex flex-wrap gap-6 text-sm text-muted-foreground",children:[(L.created_at||L.createdAt)&&(L.created_at||L.createdAt)!==""&&g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(ds,{className:"h-4 w-4"}),g.jsxs("span",{children:["Created: ",os(L.created_at||L.createdAt)]})]}),(L.updated_at||L.updatedAt)&&(L.updated_at||L.updatedAt)!==""&&g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(ds,{className:"h-4 w-4"}),g.jsxs("span",{children:["Updated: ",os(L.updated_at||L.updatedAt)]})]}),(L.id||L._id)&&g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(Ig,{className:"h-4 w-4"}),g.jsxs("span",{children:["ID: ",L.id||L._id]})]})]})]})]});return e&&t&&typeof t=="function"?O?g.jsx("div",{className:J("space-y-6",N),children:g.jsx(ht,{children:g.jsx(pt,{className:"py-12",children:g.jsx(qn,{text:`Loading ${c}...`})})})}):j?g.jsx("div",{className:J("space-y-6",N),children:g.jsx(ht,{children:g.jsxs(pt,{className:"py-12 text-center",children:[g.jsx("p",{className:"text-destructive",children:(j==null?void 0:j.message)||"An error occurred"}),g.jsxs(_e,{variant:"outline",onClick:Q,className:"mt-4",children:[g.jsx(Ft,{className:"mr-2 h-4 w-4"}),S]})]})})}):L?g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:J("space-y-6",N),...k,children:[y&&g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsxs("div",{className:"flex items-center gap-4",children:[g.jsx(_e,{variant:"ghost",size:"icon",onClick:Q,children:g.jsx(Ft,{className:"h-4 w-4"})}),T&&g.jsx("div",{className:"h-10 w-10 rounded-full bg-primary/10 flex items-center justify-center",children:g.jsx(T,{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)&&p&&g.jsxs(_e,{variant:"outline",onClick:W,children:[g.jsx(Fr,{className:"mr-2 h-4 w-4"}),w]}),(r||F)&&v&&g.jsxs(_e,{variant:"destructive",onClick:()=>U(!0),children:[g.jsx(jr,{className:"mr-2 h-4 w-4"}),C]})]})]}),t(L)]}),g.jsx(Ni,{open:P,onOpenChange:U,onConfirm:X,itemName:q,loading:I})]}):g.jsx("div",{className:J("space-y-6",N),children:g.jsx(ht,{children:g.jsxs(pt,{className:"py-12 text-center",children:[g.jsxs("p",{className:"text-muted-foreground",children:["No ",c," found"]}),g.jsxs(_e,{variant:"outline",onClick:Q,className:"mt-4",children:[g.jsx(Ft,{className:"mr-2 h-4 w-4"}),S]})]})})}):O?g.jsx(ht,{className:N,children:g.jsx(pt,{className:"py-12",children:g.jsx(qn,{text:`Loading ${c}...`})})}):j?g.jsx(ht,{className:N,children:g.jsxs(pt,{className:"py-12 text-center",children:[g.jsx("p",{className:"text-destructive",children:(j==null?void 0:j.message)||"An error occurred"}),g.jsxs(_e,{variant:"outline",onClick:Q,className:"mt-4",children:[g.jsx(Ft,{className:"mr-2 h-4 w-4"}),S]})]})}):L?g.jsxs(g.Fragment,{children:[g.jsxs(ht,{className:N,...k,children:[y&&g.jsxs(In,{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(_e,{variant:"ghost",size:"icon",onClick:Q,children:g.jsx(Ft,{className:"h-4 w-4"})}),g.jsxs("div",{children:[h&&g.jsx(Bn,{children:h}),b&&g.jsx(Fn,{children:b})]})]}),g.jsxs("div",{className:"flex items-center gap-2",children:[(a||d)&&p&&g.jsxs(_e,{variant:"outline",onClick:W,children:[g.jsx(Fr,{className:"mr-2 h-4 w-4"}),w]}),(r||F)&&v&&g.jsxs(_e,{variant:"destructive",onClick:()=>U(!0),children:[g.jsx(jr,{className:"mr-2 h-4 w-4"}),C]})]})]}),g.jsx(pt,{children:ce})]}),g.jsx(Ni,{open:P,onOpenChange:U,onConfirm:X,itemName:q,loading:I})]}):g.jsx(ht,{className:N,children:g.jsxs(pt,{className:"py-12 text-center",children:[g.jsxs("p",{className:"text-muted-foreground",children:["No ",c," found"]}),g.jsxs(_e,{variant:"outline",onClick:Q,className:"mt-4",children:[g.jsx(Ft,{className:"mr-2 h-4 w-4"}),S]})]})})};pm.displayName="CrudDetail";const mm=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,w)=>({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=w();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(k=>{(y[k]===void 0||y[k]==="")&&delete y[k]});const x=(await n.get(i,{params:y})).data,E=x[f]||x.data||(Array.isArray(x)?x:[]),T=x[d]||x.total||E.length,N=Math.ceil(T/S.pageSize);return b({items:E.map(s),totalItems:T,totalPages:N,loading:!1}),{items:E,totalItems:T,totalPages:N}}catch(y){const _=((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:_,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),_=await n.post(`${i}/`,y),x=s(_.data);return b(E=>({items:[x,...E.items],totalItems:E.totalItems+1,submitting:!1})),x}catch(y){const _=((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:_,fieldErrors:x,original:y},submitting:!1}),y}},update:async(C,S)=>{var c,u,p,v,y;b({submitting:!0,error:null});try{const _=o(S),x=await n.patch(`${i}/${C}/`,_),E=s(x.data);return b(T=>{var N;return{items:T.items.map(k=>k[r]===C?E:k),item:((N=T.item)==null?void 0:N[r])===C?E:T.item,submitting:!1}}),E}catch(_){const x=((u=(c=_.response)==null?void 0:c.data)==null?void 0:u.message)||((v=(p=_.response)==null?void 0:p.data)==null?void 0:v.detail)||_.message||"Failed to update item",E=((y=_.response)==null?void 0:y.data)||{};throw b({error:{message:x,fieldErrors:E,original:_},submitting:!1}),_}},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(_=>_[r]!==C),totalItems:v.totalItems-1,item:((y=v.item)==null?void 0:y[r])===C?null:v.item,selectedIds:v.selectedIds.filter(_=>_!==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 _=o(S),x=await n.put(`${i}/${C}/`,_),E=s(x.data);return b(T=>{var N;return{items:T.items.map(k=>k[r]===C?E:k),item:((N=T.item)==null?void 0:N[r])===C?E:T.item,submitting:!1}}),E}catch(_){const x=((u=(c=_.response)==null?void 0:c.data)==null?void 0:u.message)||((v=(p=_.response)==null?void 0:p.data)==null?void 0:v.detail)||_.message||"Failed to update item",E=((y=_.response)==null?void 0:y.data)||{};throw b({error:{message:x,fieldErrors:E,original:_},submitting:!1}),_}},...a}))},r5=e=>{const{create:t}=require("zustand");return t(mm(e))};function o5({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(),w=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:w})]});return g.jsxs("div",{className:"min-h-screen flex",children:[d&&g.jsx("div",{className:J("hidden lg:flex lg:w-1/2 bg-gray-900",l),children:r||C}),g.jsx("div",{className:J("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 l5({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:w="Sign up",signUpPath:C="/register",showRememberMe:S=!0,showForgotPassword:c=!0,showSignUp:u=!0,logo:p,className:v,children:y}){const[_,x]=K.useState(""),[E,T]=K.useState(""),[N,k]=K.useState(!1),D=async M=>{M.preventDefault(),e&&await e({email:_,password:E,rememberMe:N})};return g.jsxs("div",{className:J("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:D,className:"space-y-4",children:[g.jsxs("div",{className:"space-y-2",children:[g.jsx(Xt,{htmlFor:"email",children:o}),g.jsx(jn,{id:"email",type:"email",placeholder:l,value:_,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(Xt,{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(jn,{id:"password",type:"password",value:E,onChange:M=>T(M.target.value),required:!0,autoComplete:"current-password"})]}),S&&g.jsxs("div",{className:"flex items-center space-x-2",children:[g.jsx(zn,{id:"remember",checked:N,onCheckedChange:k}),g.jsx(Xt,{htmlFor:"remember",className:"text-sm font-normal cursor-pointer",children:r})]}),y,g.jsx(_e,{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:w})]})]})}const gm=K.createContext(null);function pr(){const e=K.useContext(gm);if(!e)throw new Error("useSidebarContext must be used within a SidebarProvider");return e}function vm({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(gm.Provider,{value:h,children:n})}function bm({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:w}){var N,k;const{isOpen:C,isCollapsed:S,setOpen:c,toggleCollapse:u}=pr(),p=Je.useLocation(),[v,y]=K.useState([]),_=D=>{y(M=>M.includes(D)?M.filter(A=>A!==D):[...M,D])},x=(D,M=!1)=>{if(D.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:D.title}),S&&g.jsx(Ai,{className:"my-3 bg-sidebar-border"})]},D.title);if(h)return h(D,{isCollapsed:S,isSubItem:M,location:p});const A=D.icon,R=D.children&&D.children.length>0,z=v.includes(D.label),V=D.path&&(p.pathname===D.path||p.pathname.startsWith(D.path+"/")),H=R&&D.children.some(F=>p.pathname===F.path||p.pathname.startsWith(F.path+"/"));return R?g.jsxs("div",{children:[g.jsxs("button",{onClick:()=>_(D.label),className:J("w-full flex items-center gap-3 px-3 py-2 rounded-lg transition-colors text-sm",H?"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?D.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:D.label}),g.jsx(Ns,{className:J("h-4 w-4 transition-transform",z&&"rotate-180")})]})]}),!S&&z&&g.jsx("div",{className:"ml-4 mt-1 space-y-0.5",children:D.children.map(F=>x(F,!0))})]},D.label):g.jsxs(Je.Link,{to:D.path,className:J("flex items-center gap-3 px-3 py-2 rounded-lg transition-colors",V?"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?D.label:void 0,children:[A&&g.jsx(A,{className:"h-4 w-4 flex-shrink-0"}),!S&&g.jsx("span",{children:D.label})]},D.path||D.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(Pn,{className:"h-4 w-4 text-sidebar-foreground"})}),g.jsx("button",{onClick:u,className:J("hidden lg:block p-1.5 rounded-lg hover:bg-sidebar-accent",S&&"mx-auto"),children:S?g.jsx(ki,{className:"h-4 w-4 text-sidebar-foreground"}):g.jsx(co,{className:"h-4 w-4 text-sidebar-foreground"})})]}),T=s&&a&&g.jsx("div",{className:"px-3 py-3 border-t border-sidebar-border",children:g.jsxs(Sl,{children:[g.jsx(El,{asChild:!0,children:g.jsxs("button",{className:J("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(qo,{className:"h-8 w-8",children:[g.jsx(Zo,{src:s.avatar,alt:s.firstName||"User"}),g.jsxs(Go,{className:"bg-sidebar-primary text-sidebar-primary-foreground text-xs",children:[((N=s.firstName)==null?void 0:N[0])||"U",((k=s.lastName)==null?void 0:k[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(ar,{align:"end",className:"w-56",children:[g.jsx(cr,{children:"My Account"}),g.jsx(Ei,{}),l.map((D,M)=>g.jsx(Si,{asChild:!!D.path,onClick:D.onClick,children:D.path?g.jsx(Je.Link,{to:D.path,children:D.label}):D.label},M)),l.length>0&&g.jsx(Ei,{}),o&&g.jsx(Si,{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:J("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(D=>x(D))})}),w||T]})]})}function ym({pathNames:e={},showBreadcrumbs:t=!0,showMenuButton:n=!0,className:i,leftSlot:s,rightSlot:o,breadcrumbsSlot:l,children:a}){const{toggle:r}=pr(),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((w,C)=>{const S="/"+b.slice(0,C+1).join("/"),c=C===b.length-1,u=d[w]||w;return g.jsxs("div",{className:"flex items-center gap-1",children:[C>0&&g.jsx(ki,{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:J("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(Bg,{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(Ai,{})]})}function a5({sidebarProps:e,headerProps:t,showHeader:n=!0,showSidebar:i=!0,contentClassName:s,mainSlot:o,children:l}){const{isCollapsed:a}=pr();return g.jsxs("div",{className:"min-h-screen bg-background",children:[i&&g.jsx(bm,{...e}),g.jsxs("div",{className:J("transition-all duration-300 ease-in-out",i&&(a?"lg:ml-16":"lg:ml-60")),children:[n&&g.jsx(ym,{...t}),g.jsx("main",{className:J("p-4 md:p-6",s),children:o||l||g.jsx(Je.Outlet,{})})]})]})}function c5({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(vm,{defaultOpen:n,defaultCollapsed:i,children:g.jsx(a5,{sidebarProps:e,headerProps:t,showHeader:s,showSidebar:o,contentClassName:l,mainSlot:a,children:r})})}exports.Alert=Dl;exports.AlertDescription=Ll;exports.AlertDialog=AE;exports.AlertDialogAction=$p;exports.AlertDialogCancel=Up;exports.AlertDialogContent=jp;exports.AlertDialogDescription=Wp;exports.AlertDialogFooter=Hp;exports.AlertDialogHeader=zp;exports.AlertDialogOverlay=Ol;exports.AlertDialogPortal=Fp;exports.AlertDialogTitle=Vp;exports.AlertDialogTrigger=DE;exports.AlertTitle=Rl;exports.AlertWithIcon=bp;exports.AuthLayout=o5;exports.Avatar=qo;exports.AvatarFallback=Go;exports.AvatarImage=Zo;exports.Badge=ai;exports.Button=_e;exports.Calendar=sr;exports.Card=ht;exports.CardContent=pt;exports.CardDescription=Fn;exports.CardFooter=Lc;exports.CardHeader=In;exports.CardTitle=Bn;exports.Checkbox=zn;exports.ConfirmModal=Yl;exports.CreateEmptyState=em;exports.CrudDetail=pm;exports.CrudForm=hm;exports.CrudList=im;exports.DashboardLayout=c5;exports.DataTable=ql;exports.DatePicker=al;exports.DateRangePicker=cl;exports.DeleteConfirmModal=Ni;exports.Dialog=Hd;exports.DialogClose=e_;exports.DialogContent=Ho;exports.DialogDescription=$o;exports.DialogFooter=qs;exports.DialogHeader=Vo;exports.DialogOverlay=zo;exports.DialogPortal=Vd;exports.DialogTitle=Wo;exports.DialogTrigger=Jx;exports.DropdownMenu=Sl;exports.DropdownMenuCheckboxItem=ep;exports.DropdownMenuContent=ar;exports.DropdownMenuGroup=V3;exports.DropdownMenuItem=Si;exports.DropdownMenuLabel=cr;exports.DropdownMenuPortal=W3;exports.DropdownMenuRadioGroup=U3;exports.DropdownMenuRadioItem=tp;exports.DropdownMenuSeparator=Ei;exports.DropdownMenuShortcut=np;exports.DropdownMenuSub=$3;exports.DropdownMenuSubContent=J0;exports.DropdownMenuSubTrigger=Q0;exports.DropdownMenuTrigger=El;exports.EmptyState=ti;exports.ErrorState=tm;exports.FormField=Ut;exports.FormModal=nm;exports.Header=ym;exports.Input=jn;exports.Label=Xt;exports.Loading=qn;exports.LoadingButton=Jp;exports.LoadingOverlay=Qp;exports.LoginPage=l5;exports.Modal=fr;exports.Pagination=$l;exports.Popover=Qo;exports.PopoverContent=tr;exports.PopoverTrigger=Jo;exports.QCheckbox=Wl;exports.QDatePicker=Gp;exports.QDateRangePicker=Kp;exports.QForm=Zp;exports.QInput=ws;exports.QRichTextEditor=Xp;exports.QSearchSelect=Hl;exports.QSelect=zl;exports.QSwitch=Vl;exports.QTabs=pf;exports.QTextarea=jl;exports.RichTextEditor=ml;exports.ScrollArea=gp;exports.ScrollBar=Al;exports.SearchEmptyState=Ul;exports.SearchSelect=Fl;exports.Select=Mo;exports.SelectContent=Ws;exports.SelectGroup=Lx;exports.SelectItem=$s;exports.SelectLabel=bd;exports.SelectScrollDownButton=Ro;exports.SelectScrollUpButton=Do;exports.SelectSeparator=yd;exports.SelectTrigger=Vs;exports.SelectValue=Ao;exports.Separator=Ai;exports.Sidebar=bm;exports.SidebarProvider=vm;exports.Skeleton=_1;exports.Switch=bo;exports.Table=Pl;exports.TableBody=Bl;exports.TableCaption=qp;exports.TableCell=un;exports.TableFooter=Yp;exports.TableHead=hi;exports.TableHeader=Il;exports.TableRow=An;exports.Tabs=R_;exports.TabsContent=hf;exports.TabsList=df;exports.TabsTrigger=ff;exports.Textarea=fo;exports.Tooltip=yw;exports.TooltipContent=Of;exports.TooltipProvider=bw;exports.TooltipTrigger=xw;exports.alertVariants=vp;exports.badgeVariants=Oc;exports.buildQueryString=yg;exports.buttonVariants=Ts;exports.capitalize=fg;exports.cn=J;exports.createCrudStore=mm;exports.createStore=r5;exports.debounce=Mc;exports.deepClone=pg;exports.formatCurrency=cg;exports.formatDate=ao;exports.formatDateTime=os;exports.formatRelativeTime=ug;exports.generateId=vg;exports.getInitials=gg;exports.isEmpty=mg;exports.parseQueryString=bg;exports.slugify=hg;exports.truncate=dg;exports.useSidebarContext=pr;
|
|
258
|
+
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return m.useEffect(()=>{var i;document.getElementById((i=e.current)==null?void 0:i.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},TE=xp,kE=_p,ME=wp,Rp=Cp,Lp=Sp,Op=Mp,Pp=Dp,Ip=Np,Bp=kp;const AE=TE,DE=kE,Fp=ME,Ol=m.forwardRef(({className:e,...t},n)=>g.jsx(Rp,{className:J("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,ref:n}));Ol.displayName=Rp.displayName;const jp=m.forwardRef(({className:e,...t},n)=>g.jsxs(Fp,{children:[g.jsx(Ol,{}),g.jsx(Lp,{ref:n,className:J("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 md:w-full",e),...t})]}));jp.displayName=Lp.displayName;const zp=({className:e,...t})=>g.jsx("div",{className:J("flex flex-col space-y-2 text-center sm:text-left",e),...t});zp.displayName="AlertDialogHeader";const Hp=({className:e,...t})=>g.jsx("div",{className:J("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Hp.displayName="AlertDialogFooter";const Vp=m.forwardRef(({className:e,...t},n)=>g.jsx(Ip,{ref:n,className:J("text-lg font-semibold",e),...t}));Vp.displayName=Ip.displayName;const Wp=m.forwardRef(({className:e,...t},n)=>g.jsx(Bp,{ref:n,className:J("text-sm text-muted-foreground",e),...t}));Wp.displayName=Bp.displayName;const $p=m.forwardRef(({className:e,...t},n)=>g.jsx(Op,{ref:n,className:J(Ts(),e),...t}));$p.displayName=Op.displayName;const Up=m.forwardRef(({className:e,...t},n)=>g.jsx(Pp,{ref:n,className:J(Ts({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));Up.displayName=Pp.displayName;const Pl=m.forwardRef(({className:e,...t},n)=>g.jsx("div",{className:"relative w-full overflow-auto",children:g.jsx("table",{ref:n,className:J("w-full caption-bottom text-sm",e),...t})}));Pl.displayName="Table";const Il=m.forwardRef(({className:e,...t},n)=>g.jsx("thead",{ref:n,className:J("[&_tr]:border-b",e),...t}));Il.displayName="TableHeader";const Bl=m.forwardRef(({className:e,...t},n)=>g.jsx("tbody",{ref:n,className:J("[&_tr:last-child]:border-0",e),...t}));Bl.displayName="TableBody";const Yp=m.forwardRef(({className:e,...t},n)=>g.jsx("tfoot",{ref:n,className:J("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));Yp.displayName="TableFooter";const An=m.forwardRef(({className:e,...t},n)=>g.jsx("tr",{ref:n,className:J("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));An.displayName="TableRow";const hi=m.forwardRef(({className:e,...t},n)=>g.jsx("th",{ref:n,className:J("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));hi.displayName="TableHead";const un=m.forwardRef(({className:e,...t},n)=>g.jsx("td",{ref:n,className:J("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));un.displayName="TableCell";const qp=m.forwardRef(({className:e,...t},n)=>g.jsx("caption",{ref:n,className:J("mt-4 text-sm text-muted-foreground",e),...t}));qp.displayName="TableCaption";const Fl=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:C=y=>(y==null?void 0:y.label)||(y==null?void 0:y.name)||String(y),getOptionValue:w=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,_]=m.useState(!1),[x,E]=m.useState(""),[T,N]=m.useState(0),k=m.useRef(null),D=m.useRef(null),M=m.useMemo(()=>x?S?e.filter(j=>S(j,x)):e.filter(j=>C(j).toLowerCase().includes(x.toLowerCase())):e,[e,x,S,C]),A=m.useMemo(()=>Mc(j=>{i==null||i(j)},300),[i]),R=j=>{const P=j.target.value;E(P),N(0),A(P)},z=j=>{if(r){const P=Array.isArray(t)?t:[],U=w(j);P.some($=>w($)===U)?n==null||n(P.filter($=>w($)!==U)):n==null||n([...P,j])}else n==null||n(j),_(!1),E("")},V=j=>{j.stopPropagation(),n==null||n(r?[]:null),E("")},H=j=>{if(!y){(j.key==="Enter"||j.key===" "||j.key==="ArrowDown")&&(j.preventDefault(),_(!0));return}switch(j.key){case"ArrowDown":j.preventDefault(),N(P=>Math.min(P+1,M.length-1));break;case"ArrowUp":j.preventDefault(),N(P=>Math.max(P-1,0));break;case"Enter":j.preventDefault(),M[T]&&z(M[T]);break;case"Escape":j.preventDefault(),_(!1),E("");break}};m.useEffect(()=>{const j=P=>{k.current&&!k.current.contains(P.target)&&(_(!1),E(""))};return document.addEventListener("mousedown",j),()=>document.removeEventListener("mousedown",j)},[]);const F=j=>r?(Array.isArray(t)?t:[]).some(I=>(typeof I=="object"&&I!==null?w(I):I)===w(j)):t?(typeof t=="object"&&t!==null?w(t):t)===w(j):!1,L=r?Array.isArray(t)&&t.length>0:!!t,O=()=>{if(!L)return g.jsx("span",{className:"text-muted-foreground",children:s});if(b)return b(t);if(r){const P=Array.isArray(t)?t:[];if(P.length===1){const U=P[0],I=e.find($=>{const Q=w($),W=typeof U=="object"&&U!==null?w(U):U;return Q===W});return I?C(I):String(U)}return`${P.length} selected`}const j=e.find(P=>{const U=w(P),I=typeof t=="object"&&t!==null?w(t):t;return U===I});return j?C(j):String(t)};return g.jsxs("div",{ref:k,className:J("relative w-full",d),...p,children:[g.jsxs("button",{ref:v,type:"button",role:"combobox","aria-expanded":y,"aria-haspopup":"listbox",disabled:a,onClick:()=>_(!y),onKeyDown:H,className:J("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&&L&&!a&&g.jsx(Pn,{className:"h-4 w-4 opacity-50 hover:opacity-100 cursor-pointer",onClick:V}),g.jsx(Ns,{className:J("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(uo,{className:"h-4 w-4 shrink-0 opacity-50"}),g.jsx("input",{ref:D,type:"text",value:x,onChange:R,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(hn,{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((j,P)=>g.jsxs("div",{role:"option","aria-selected":F(j),onClick:()=>z(j),onMouseEnter:()=>N(P),className:J("relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none",T===P&&"bg-accent text-accent-foreground",F(j)&&"bg-accent/50"),children:[r&&g.jsx("div",{className:J("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",F(j)&&"bg-primary text-primary-foreground"),children:F(j)&&g.jsx(gi,{className:"h-3 w-3"})}),h?h(j):g.jsx("span",{className:"flex-1",children:C(j)}),!r&&F(j)&&g.jsx(gi,{className:"ml-auto h-4 w-4"})]},w(j)))})]})]})});Fl.displayName="SearchSelect";const Ut=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:J("space-y-2",e),...l,children:[t&&g.jsxs(Xt,{htmlFor:r,className:J(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})]})});Ut.displayName="FormField";const ws=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(Ut,{label:e,description:t,error:n,required:i,className:s,children:g.jsx(jn,{ref:r,className:J(n&&"border-destructive",o),onChange:f,...a})})});ws.displayName="QInput";const jl=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(Ut,{label:e,description:t,error:n,required:i,className:s,children:g.jsx(fo,{ref:r,className:J(n&&"border-destructive",o),onChange:f,...a})})});jl.displayName="QTextarea";const zl=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},w)=>{const S=f||(typeof h=="function"?h:h?u=>u==null?void 0:u[h]:u=>(u==null?void 0:u.label)||(u==null?void 0:u.name)||String(u)),c=d||(typeof b=="function"?b: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(Ut,{label:e,description:t,error:n,required:i,className:l,children:g.jsxs(Mo,{value:a,onValueChange:r,...C,children:[g.jsx(Vs,{ref:w,className:J(n&&"border-destructive"),children:g.jsx(Ao,{placeholder:o})}),g.jsx(Ws,{children:s.map(u=>g.jsx($s,{value:String(c(u)),children:S(u)},c(u)))})]})})});zl.displayName="QSelect";const Hl=m.forwardRef(({label:e,description:t,error:n,required:i,className:s,value:o,onChange:l,options:a=[],getOptionLabel:r,getOptionValue:f,optionLabel:d,optionValue:h,onSearch:b,...C},w)=>{const S=r||(typeof d=="function"?d:d?v=>v==null?void 0:v[d]:v=>(v==null?void 0:v.label)||(v==null?void 0:v.name)||String(v)),c=f||(typeof h=="function"?h:h?v=>v==null?void 0:v[h]:v=>(v==null?void 0:v.value)||(v==null?void 0:v.id)||v),u=v=>{if(v==null)l==null||l(null);else{const y=c(v);l==null||l(y)}},p=m.useCallback(v=>{if(!v)return null;if(typeof v=="object"&&v!==null)return S(v);const y=a.find(_=>c(_)===v);return y?S(y):String(v)},[a,S,c]);return g.jsx(Ut,{label:e,description:t,error:n,required:i,className:s,children:g.jsx(Fl,{ref:w,value:o,onChange:u,options:a,getOptionLabel:S,getOptionValue:c,renderValue:p,onSearch:b,...C})})});Hl.displayName="QSearchSelect";const Vl=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:J("flex items-center justify-between space-x-2",i),children:[g.jsxs("div",{className:"space-y-0.5",children:[e&&g.jsx(Xt,{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(bo,{ref:r,id:f,checked:s,onCheckedChange:d,...a})]})});Vl.displayName="QSwitch";const Wl=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:J("flex items-start space-x-2",i),children:[g.jsx(zn,{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(Xt,{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})]})]})});Wl.displayName="QCheckbox";const Zp=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:J("space-y-4",t),...i,children:n})});Zp.displayName="QForm";const Gp=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(Ut,{label:e,description:t,error:n,required:i,className:s,children:g.jsx(al,{ref:f,date:o,onDateChange:l,placeholder:a,...r})}));Gp.displayName="QDatePicker";const Kp=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(Ut,{label:e,description:t,error:n,required:i,className:s,children:g.jsx(cl,{ref:f,dateRange:o,onDateRangeChange:l,placeholder:a,...r})}));Kp.displayName="QDateRangePicker";const Xp=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(Ut,{label:e,description:t,error:n,required:i,className:s,children:g.jsx(ml,{ref:d,value:o,onChange:l,placeholder:a,height:r,...f})}));Xp.displayName="QRichTextEditor";const $l=({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,C=e<t,w=()=>{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:J("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(Mo,{value:String(i),onValueChange:S=>l==null?void 0:l(Number(S)),children:[g.jsx(Vs,{className:"h-8 w-[70px]",children:g.jsx(Ao,{placeholder:i})}),g.jsx(Ws,{side:"top",children:s.map(S=>g.jsx($s,{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(_e,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>o==null?void 0:o(1),disabled:!b,children:[g.jsx(Tg,{className:"h-4 w-4"}),g.jsx("span",{className:"sr-only",children:"First page"})]}),g.jsxs(_e,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>o==null?void 0:o(e-1),disabled:!b,children:[g.jsx(co,{className:"h-4 w-4"}),g.jsx("span",{className:"sr-only",children:"Previous page"})]}),g.jsx("div",{className:"flex items-center gap-1",children:w().map((S,c)=>S==="..."?g.jsx("span",{className:"px-2 text-muted-foreground",children:"..."},`ellipsis-${c}`):g.jsx(_e,{variant:e===S?"default":"outline",size:"icon",className:"h-8 w-8",onClick:()=>o==null?void 0:o(S),children:S},S))}),g.jsxs(_e,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>o==null?void 0:o(e+1),disabled:!C,children:[g.jsx(ki,{className:"h-4 w-4"}),g.jsx("span",{className:"sr-only",children:"Next page"})]}),g.jsxs(_e,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>o==null?void 0:o(t),disabled:!C,children:[g.jsx(kg,{className:"h-4 w-4"}),g.jsx("span",{className:"sr-only",children:"Last page"})]})]})]})};$l.displayName="Pagination";const qn=({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=J("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(hn,{className:J("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:J("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:J("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(hn,{className:J("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})]})};qn.displayName="Loading";const Qp=({loading:e,children:t,text:n,className:i})=>g.jsxs("div",{className:J("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(qn,{text:n})})]});Qp.displayName="LoadingOverlay";const Jp=m.forwardRef(({loading:e,loadingText:t,children:n,disabled:i,className:s,...o},l)=>g.jsx(_e,{ref:l,disabled:i||e,className:s,...o,children:e?g.jsxs(g.Fragment,{children:[g.jsx(hn,{className:"mr-2 h-4 w-4 animate-spin"}),t||"Loading..."]}):n}));Jp.displayName="LoadingButton";const ti=({icon:e=aa,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:aa,title:"No data found",description:"There are no items to display."},search:{icon:uo,title:"No results found",description:"Try adjusting your search or filters to find what you're looking for."},empty:{icon:Dc,title:"Get started",description:"Create your first item to get started."},error:{icon:Rc,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,C=n||d.description;return g.jsxs("div",{className:J("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:C}),r,(i||o)&&g.jsx(_e,{onClick:o,children:s||"Take Action"})]})};ti.displayName="EmptyState";const Ul=({searchTerm:e,onClear:t,className:n})=>g.jsx(ti,{variant:"search",title:`No results for "${e}"`,description:"Try searching with different keywords or check your filters.",className:n,children:t&&g.jsx(_e,{variant:"outline",onClick:t,children:"Clear Search"})});Ul.displayName="SearchEmptyState";const em=({itemName:e="item",onCreate:t,className:n})=>g.jsx(ti,{variant:"empty",icon:Dc,title:`No ${e}s yet`,description:`Create your first ${e} to get started.`,onAction:t,actionLabel:`Create ${e}`,className:n});em.displayName="CreateEmptyState";const tm=({error:e,onRetry:t,className:n})=>g.jsx(ti,{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});tm.displayName="ErrorState";const fr=({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(Hd,{open:e,onOpenChange:t,...f,children:g.jsxs(Ho,{className:J(d[l],r),children:[(n||i)&&g.jsxs(Vo,{children:[n&&g.jsx(Wo,{children:n}),i&&g.jsx($o,{children:i})]}),s,o&&g.jsx(qs,{children:o})]})})};fr.displayName="Modal";const Yl=({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(fr,{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(_e,{variant:"outline",onClick:b,disabled:f,children:a}),g.jsx(_e,{variant:r==="destructive"?"destructive":"default",onClick:h,disabled:f,children:f?"Loading...":l})]})})};Yl.displayName="ConfirmModal";const Ni=({open:e,onOpenChange:t,onConfirm:n,itemName:i="item",loading:s=!1})=>g.jsx(Yl,{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});Ni.displayName="DeleteConfirmModal";const nm=({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(fr,{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(qs,{children:[g.jsx(_e,{type:"button",variant:"outline",onClick:()=>t==null?void 0:t(!1),disabled:r,children:a}),g.jsx(_e,{type:"submit",disabled:r,children:r?"Saving...":l})]})]})})};nm.displayName="FormModal";const ql=({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:C=null,onSort:w,searchable:S=!0,searchValue:c="",onSearchChange:u,searchPlaceholder:p="Search...",selectable:v=!1,selectedRows:y=[],onSelectionChange:_,actions:x=[],onRowClick:E,striped:T=!1,hover:N=!0,compact:k=!1,className:D,emptyTitle:M="No data found",emptyDescription:A="There are no items to display.",emptyAction:R,onEmptyAction:z,getRowKey:V=H=>H.id||H._id})=>{const[H,F]=m.useState(c);m.useEffect(()=>{const W=setTimeout(()=>{u&&H!==c&&u(H)},300);return()=>clearTimeout(W)},[H]);const L=W=>{if(!h||!W.sortable)return;const X=W.sortKey||W.accessor;let q="asc";b===X&&(q=C==="asc"?"desc":"asc"),w==null||w(X,q)},O=W=>{W?_==null||_(e.map(V)):_==null||_([])},j=(W,X)=>{X?_==null||_([...y,W]):_==null||_(y.filter(q=>q!==W))},P=e.length>0&&y.length===e.length,U=y.length>0&&y.length<e.length,I=(W,X,q)=>{const G=W.accessor||W.key,ee=G?typeof G=="function"?G(X):X[G]:void 0;return W.render?W.render(ee,X,q):W.format?W.format(ee,X):ee!==null&&typeof ee=="object"?"-":ee??"-"},$=W=>{if(!h||!W.sortable)return null;const X=W.sortKey||W.accessor;return b!==X?g.jsx(Sg,{className:"ml-2 h-4 w-4 opacity-50"}):C==="asc"?g.jsx(Eg,{className:"ml-2 h-4 w-4"}):g.jsx(Cg,{className:"ml-2 h-4 w-4"})},Q=W=>{if(!x||x.length===0)return null;const X=x.filter(q=>q.hidden?typeof q.hidden=="function"?!q.hidden(W):!q.hidden:!0);return X.length===0?null:g.jsxs(Sl,{children:[g.jsx(El,{asChild:!0,children:g.jsxs(_e,{variant:"ghost",size:"icon",className:"h-8 w-8",children:[g.jsx(Og,{className:"h-4 w-4"}),g.jsx("span",{className:"sr-only",children:"Open menu"})]})}),g.jsxs(ar,{align:"end",children:[g.jsx(cr,{children:"Actions"}),g.jsx(Ei,{}),X.map((q,G)=>g.jsxs(Si,{onClick:()=>{var ee;return(ee=q.onClick)==null?void 0:ee.call(q,W)},className:J(q.variant==="destructive"&&"text-destructive focus:text-destructive"),disabled:q.disabled,children:[q.icon&&g.jsx(q.icon,{className:"mr-2 h-4 w-4"}),q.label]},q.label||G))]})]})};return g.jsxs("div",{className:J("w-full",D),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(uo,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),g.jsx(jn,{placeholder:p,value:H,onChange:W=>F(W.target.value),className:"pl-9 pr-9"}),H&&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(Pn,{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(_e,{variant:"ghost",size:"sm",onClick:()=>_==null?void 0:_([]),children:"Clear selection"})]})]}),g.jsx("div",{className:"rounded-md border",children:g.jsxs(Pl,{children:[g.jsx(Il,{children:g.jsxs(An,{children:[v&&g.jsx(hi,{className:"w-12",children:g.jsx(zn,{checked:P,indeterminate:U,onCheckedChange:O})}),t.map((W,X)=>g.jsx(hi,{className:J(W.headerClassName,h&&W.sortable&&"cursor-pointer select-none"),style:{width:W.width},onClick:()=>L(W),children:g.jsxs("div",{className:"flex items-center",children:[W.header||W.label,$(W)]})},W.accessor||X)),x&&x.length>0&&g.jsx(hi,{className:"w-12",children:"Actions"})]})}),g.jsx(Bl,{children:n?g.jsx(An,{children:g.jsx(un,{colSpan:t.length+(v?1:0)+(x!=null&&x.length?1:0),className:"h-48",children:g.jsx(qn,{text:"Loading data..."})})}):e.length===0?g.jsx(An,{children:g.jsx(un,{colSpan:t.length+(v?1:0)+(x!=null&&x.length?1:0),className:"h-48",children:H?g.jsx(Ul,{searchTerm:H,onClear:()=>{F(""),u==null||u("")}}):g.jsx(ti,{title:M,description:A,onAction:z,actionLabel:R})})}):e.map((W,X)=>{const q=V(W),G=y.includes(q);return g.jsxs(An,{"data-state":G?"selected":void 0,className:J(T&&X%2===1&&"bg-muted/50",N&&"cursor-pointer",E&&"hover:bg-muted"),onClick:()=>E==null?void 0:E(W),children:[v&&g.jsx(un,{onClick:ee=>ee.stopPropagation(),children:g.jsx(zn,{checked:G,onCheckedChange:ee=>j(q,ee)})}),t.map((ee,re)=>g.jsx(un,{className:J(k&&"py-2",ee.cellClassName),children:I(ee,W,X)},ee.accessor||re)),x&&x.length>0&&g.jsx(un,{onClick:ee=>ee.stopPropagation(),children:Q(W)})]},q)})})]})}),!n&&e.length>0&&s!==!1&&g.jsx($l,{currentPage:o,totalPages:r,totalItems:a,pageSize:l,onPageChange:f,onPageSizeChange:d})]})};ql.displayName="DataTable";const im=({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:C,searchValue:w="",onSearchChange:S,searchPlaceholder:c="Search...",selectable:u=!1,selectedRows:p=[],onSelectionChange:v,onCreate:y,onView:_,onEdit:x,onDelete:E,onRefresh:T,onExport:N,createPath:k,detailPath:D,editPath:M,additionalActions:A=[],bulkActions:R=[],title:z,description:V,createLabel:H="Create",refreshLabel:F="Refresh",exportLabel:L="Export",viewLabel:O="View",editLabel:j="Edit",deleteLabel:P="Delete",itemName:U="item",getRowKey:I=Ce=>Ce.id||Ce._id,showHeader:$=!0,showToolbar:Q=!0,compact:W=!1,className:X,deleteConfirmTitle:q,deleteConfirmDescription:G,getDeleteItemName:ee,filters:re,headerActions:ce,searchable:ie=!0,showEditButton:le=!0,showDeleteButton:we=!0})=>{const Ce=Je.useNavigate(),[be,Ne]=m.useState(!1),[B,Y]=m.useState(null),[Z,se]=m.useState(!1),[ne,te]=m.useState(""),ae=m.useRef(!1),ge=m.useRef(ne),pe=m.useRef(null),xe=m.useRef(null),De=(e==null?void 0:e.items)??t??[],ke=(e==null?void 0:e.loading)??n,Xe=(e==null?void 0:e.error)??i,Fe=(e==null?void 0:e.pagination)??{page:o,pageSize:l,total:a,totalPages:r},Pe=Fe.page??o,He=Fe.pageSize??l,yn=Fe.total??a,xn=Fe.totalPages??r,Ve=e==null?void 0:e.fetchList,an=e==null?void 0:e.delete,he=e==null?void 0:e.setPage,Te=e==null?void 0:e.setPageSize,de=e==null?void 0:e.setFilters;m.useEffect(()=>{Ve&&!ae.current&&(ae.current=!0,pe.current=Pe,xe.current=He,Ve())},[Ve]),m.useEffect(()=>{if(!Ve||!ae.current)return;const Se=pe.current!==Pe,gr=xe.current!==He;(Se||gr)&&(pe.current=Pe,xe.current=He,Ve())},[Pe,He,Ve]),m.useEffect(()=>{if(!Ve||!ae.current||ge.current===ne)return;const Se=setTimeout(()=>{ie&&(ge.current=ne,de==null||de({search:ne}),Pe!==1?he==null||he(1):Ve())},300);return()=>clearTimeout(Se)},[ne,ie,Pe,de,he,Ve]);const Me=m.useCallback(Se=>{he?he(Se):f==null||f(Se)},[he,f]),tt=m.useCallback(Se=>{Te?Te(Se):d==null||d(Se)},[Te,d]),Ee=m.useCallback(Se=>{de?te(Se):S==null||S(Se)},[de,S]),Xi=m.useCallback(()=>{k?Ce(k):y==null||y()},[k,Ce,y]),Qi=m.useCallback(Se=>{D?Ce(`${D}/${I(Se)}`):_==null||_(Se)},[D,Ce,I,_]),Ji=m.useCallback(Se=>{M?Ce(`${M}/${I(Se)}/edit`):x==null||x(Se)},[M,Ce,I,x]),ni=m.useCallback(()=>{Ve?Ve():T==null||T()},[Ve,T]),_n=m.useCallback(Se=>{Y(Se),Ne(!0)},[]),xm=async()=>{if(B){se(!0);try{an?(await an(I(B)),Ve==null||Ve()):E&&await E(B),Ne(!1),Y(null)}catch(Se){console.error("Delete error:",Se)}finally{se(!1)}}},_m=m.useMemo(()=>{const Se=[];return(D||_)&&Se.push({label:O,icon:Pg,onClick:Qi}),(M||x)&&le&&Se.push({label:j,icon:Fr,onClick:Ji}),(an||E)&&we&&Se.push({label:P,icon:jr,variant:"destructive",onClick:_n}),[...Se,...A]},[D,M,_,x,an,E,O,j,P,Qi,Ji,_n,A]),mr=k||y,wm=Ve||T,Jl=m.useMemo(()=>B?ee?ee(B):B.name||B.title||U:U,[B,ee,U]),ea=()=>Q?g.jsxs("div",{className:"flex items-center gap-2",children:[ce,u&&p.length>0&&R.length>0&&g.jsx(g.Fragment,{children:R.map((Se,gr)=>g.jsxs(_e,{variant:Se.variant||"outline",size:"sm",onClick:()=>{var na;return(na=Se.onClick)==null?void 0:na.call(Se,p)},disabled:Se.disabled,children:[Se.icon&&g.jsx(Se.icon,{className:"mr-2 h-4 w-4"}),Se.label]},Se.label||gr))}),N&&g.jsxs(_e,{variant:"outline",size:"sm",onClick:N,children:[g.jsx(Lg,{className:"mr-2 h-4 w-4"}),L]}),wm&&g.jsxs(_e,{variant:"outline",size:"sm",onClick:ni,disabled:ke,children:[g.jsx(Rc,{className:J("mr-2 h-4 w-4",ke&&"animate-spin")}),F]}),mr&&g.jsxs(_e,{size:"sm",onClick:Xi,children:[g.jsx(Fg,{className:"mr-2 h-4 w-4"}),H]})]}):null,ta=g.jsxs(g.Fragment,{children:[re&&g.jsx("div",{className:"mb-4 flex items-center gap-2",children:re}),g.jsx(ql,{data:De,columns:s,loading:ke,error:Xe,currentPage:Pe,pageSize:He,totalItems:yn,totalPages:xn,onPageChange:Me,onPageSizeChange:tt,sortColumn:h,sortDirection:b,onSort:C,searchable:ie,searchValue:de?ne:w,onSearchChange:Ee,searchPlaceholder:c,selectable:u,selectedRows:p,onSelectionChange:v,actions:_m,getRowKey:I,compact:W,emptyTitle:`No ${U}s found`,emptyDescription:`Create your first ${U} to get started.`,emptyAction:mr?`Create ${U}`:void 0,onEmptyAction:mr?Xi:void 0}),g.jsx(Ni,{open:be,onOpenChange:Ne,onConfirm:xm,title:q||`Delete ${U}`,description:G||`Are you sure you want to delete "${Jl}"? This action cannot be undone.`,itemName:Jl,loading:Z})]});return $&&(z||V)?g.jsxs(ht,{className:X,children:[g.jsxs(In,{className:"flex flex-row items-center justify-between space-y-0 pb-4",children:[g.jsxs("div",{children:[z&&g.jsx(Bn,{children:z}),V&&g.jsx(Fn,{children:V})]}),ea()]}),g.jsx(pt,{children:ta})]}):g.jsxs("div",{className:X,children:[Q&&g.jsxs("div",{className:"flex items-center justify-between mb-4",children:[g.jsx("div",{}),ea()]}),ta]})};im.displayName="CrudList";var Ki=e=>e.type==="checkbox",fn=e=>e instanceof Date,it=e=>e==null;const sm=e=>typeof e=="object";var Ue=e=>!it(e)&&!Array.isArray(e)&&sm(e)&&!fn(e),RE=e=>Ue(e)&&e.target?Ki(e.target)?e.target.checked:e.target.value:e,LE=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,OE=(e,t)=>e.has(LE(t)),PE=e=>{const t=e.constructor&&e.constructor.prototype;return Ue(t)&&t.hasOwnProperty("isPrototypeOf")},Zl=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Ge(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(!(Zl&&(e instanceof Blob||i))&&(n||Ue(e)))if(t=n?[]:Object.create(Object.getPrototypeOf(e)),!n&&!PE(e))t=e;else for(const s in e)e.hasOwnProperty(s)&&(t[s]=Ge(e[s]));else return e;return t}var hr=e=>/^\w*$/.test(e),We=e=>e===void 0,Gl=e=>Array.isArray(e)?e.filter(Boolean):[],Kl=e=>Gl(e.replace(/["|']|\]/g,"").split(/\.|\[/)),ue=(e,t,n)=>{if(!t||!Ue(e))return n;const i=(hr(t)?[t]:Kl(t)).reduce((s,o)=>it(s)?s:s[o],e);return We(i)||i===e?We(e[t])?n:e[t]:i},Tt=e=>typeof e=="boolean",Oe=(e,t,n)=>{let i=-1;const s=hr(t)?[t]:Kl(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=Ue(f)||Array.isArray(f)?f:isNaN(+s[i+1])?{}:[]}if(a==="__proto__"||a==="constructor"||a==="prototype")return;e[a]=r,e=e[a]}};const rc={BLUR:"blur",FOCUS_OUT:"focusout"},yt={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"},IE=K.createContext(null);IE.displayName="HookFormContext";var BE=(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]!==yt.all&&(t._proxyFormState[l]=!i||yt.all),e[l]}});return s};const FE=typeof window<"u"?K.useLayoutEffect:K.useEffect;var lt=e=>typeof e=="string",jE=(e,t,n,i,s)=>lt(e)?(i&&t.watch.add(e),ue(n,e,s)):Array.isArray(e)?e.map(o=>(i&&t.watch.add(o),ue(n,o))):(i&&(t.watchAll=!0),n),ro=e=>it(e)||!sm(e);function Kt(e,t,n=new WeakSet){if(ro(e)||ro(t))return Object.is(e,t);if(fn(e)&&fn(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(fn(l)&&fn(a)||Ue(l)&&Ue(a)||Array.isArray(l)&&Array.isArray(a)?!Kt(l,a,n):!Object.is(l,a))return!1}}return!0}var rm=(e,t,n,i,s)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[i]:s||!0}}:{},pi=e=>Array.isArray(e)?e:[e],oc=()=>{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 om(e,t){const n={};for(const i in e)if(e.hasOwnProperty(i)){const s=e[i],o=t[i];if(s&&Ue(s)&&o){const l=om(s,o);Ue(l)&&(n[i]=l)}else e[i]&&(n[i]=o)}return n}var nt=e=>Ue(e)&&!Object.keys(e).length,Xl=e=>e.type==="file",xt=e=>typeof e=="function",Cs=e=>{if(!Zl)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},lm=e=>e.type==="select-multiple",Ql=e=>e.type==="radio",zE=e=>Ql(e)||Ki(e),Ir=e=>Cs(e)&&e.isConnected;function HE(e,t){const n=t.slice(0,-1).length;let i=0;for(;i<n;)e=We(e)?i++:e[t[i++]];return e}function VE(e){for(const t in e)if(e.hasOwnProperty(t)&&!We(e[t]))return!1;return!0}function $e(e,t){const n=Array.isArray(t)?t:hr(t)?[t]:Kl(t),i=n.length===1?e:HE(e,n),s=n.length-1,o=n[s];return i&&delete i[o],s!==0&&(Ue(i)&&nt(i)||Array.isArray(i)&&VE(i))&&$e(e,n.slice(0,-1)),e}var WE=e=>{for(const t in e)if(xt(e[t]))return!0;return!1};function am(e){return Array.isArray(e)||Ue(e)&&!WE(e)}function oo(e,t={}){for(const n in e){const i=e[n];am(i)?(t[n]=Array.isArray(i)?[]:{},oo(i,t[n])):We(i)||(t[n]=!0)}return t}function Mn(e,t,n){n||(n=oo(t));for(const i in e){const s=e[i];if(am(s))We(t)||ro(n[i])?n[i]=oo(s,Array.isArray(s)?[]:{}):Mn(s,it(t)?{}:t[i],n[i]);else{const o=t[i];n[i]=!Kt(s,o)}}return n}const lc={value:!1,isValid:!1},ac={value:!0,isValid:!0};var cm=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&&!We(e[0].attributes.value)?We(e[0].value)||e[0].value===""?ac:{value:e[0].value,isValid:!0}:ac:lc}return lc},um=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:i})=>We(e)?e:t?e===""?NaN:e&&+e:n&<(e)?new Date(e):i?i(e):e;const cc={isValid:!1,value:null};var dm=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,cc):cc;function uc(e){const t=e.ref;return Xl(t)?t.files:Ql(t)?dm(e.refs).value:lm(t)?[...t.selectedOptions].map(({value:n})=>n):Ki(t)?cm(e.refs).value:um(We(t.value)?e.ref.value:t.value,e)}var $E=(e,t,n,i)=>{const s={};for(const o of e){const l=ue(t,o);l&&Oe(s,o,l._f)}return{criteriaMode:n,names:[...e],fields:s,shouldUseNativeValidation:i}},Ss=e=>e instanceof RegExp,li=e=>We(e)?e:Ss(e)?e.source:Ue(e)?Ss(e.value)?e.value.source:e.value:e,dc=e=>({isOnSubmit:!e||e===yt.onSubmit,isOnBlur:e===yt.onBlur,isOnChange:e===yt.onChange,isOnAll:e===yt.all,isOnTouch:e===yt.onTouched});const fc="AsyncFunction";var UE=e=>!!e&&!!e.validate&&!!(xt(e.validate)&&e.validate.constructor.name===fc||Ue(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===fc)),YE=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),hc=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(i=>e.startsWith(i)&&/^\.\w+/.test(e.slice(i.length))));const mi=(e,t,n,i)=>{for(const s of n||Object.keys(e)){const o=ue(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(mi(a,t))break}else if(Ue(a)&&mi(a,t))break}}};function pc(e,t,n){const i=ue(e,n);if(i||hr(n))return{error:i,name:n};const s=n.split(".");for(;s.length;){const o=s.join("."),l=ue(t,o),a=ue(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 qE=(e,t,n,i)=>{n(e);const{name:s,...o}=e;return nt(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(l=>t[l]===(!i||yt.all))},ZE=(e,t,n)=>!e||!t||e===t||pi(e).some(i=>i&&(n?i===t:i.startsWith(t)||t.startsWith(i))),GE=(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,KE=(e,t)=>!Gl(ue(e,t)).length&&$e(e,t),XE=(e,t,n)=>{const i=pi(ue(e,n));return Oe(i,"root",t[n]),Oe(e,n,i),e};function mc(e,t,n="validate"){if(lt(e)||Array.isArray(e)&&e.every(lt)||Tt(e)&&!e)return{type:n,message:lt(e)?e:"",ref:t}}var Tn=e=>Ue(e)&&!Ss(e)?e:{value:e,message:""},gc=async(e,t,n,i,s,o)=>{const{ref:l,refs:a,required:r,maxLength:f,minLength:d,min:h,max:b,pattern:C,validate:w,name:S,valueAsNumber:c,mount:u}=e._f,p=ue(n,S);if(!u||t.has(S))return{};const v=a?a[0]:l,y=M=>{s&&v.reportValidity&&(v.setCustomValidity(Tt(M)?"":M||""),v.reportValidity())},_={},x=Ql(l),E=Ki(l),T=x||E,N=(c||Xl(l))&&We(l.value)&&We(p)||Cs(l)&&l.value===""||p===""||Array.isArray(p)&&!p.length,k=rm.bind(null,S,i,_),D=(M,A,R,z=Bt.maxLength,V=Bt.minLength)=>{const H=M?A:R;_[S]={type:M?z:V,message:H,ref:l,...k(M?z:V,H)}};if(o?!Array.isArray(p)||!p.length:r&&(!T&&(N||it(p))||Tt(p)&&!p||E&&!cm(a).isValid||x&&!dm(a).isValid)){const{value:M,message:A}=lt(r)?{value:!!r,message:r}:Tn(r);if(M&&(_[S]={type:Bt.required,message:A,ref:v,...k(Bt.required,A)},!i))return y(A),_}if(!N&&(!it(h)||!it(b))){let M,A;const R=Tn(b),z=Tn(h);if(!it(p)&&!isNaN(p)){const V=l.valueAsNumber||p&&+p;it(R.value)||(M=V>R.value),it(z.value)||(A=V<z.value)}else{const V=l.valueAsDate||new Date(p),H=O=>new Date(new Date().toDateString()+" "+O),F=l.type=="time",L=l.type=="week";lt(R.value)&&p&&(M=F?H(p)>H(R.value):L?p>R.value:V>new Date(R.value)),lt(z.value)&&p&&(A=F?H(p)<H(z.value):L?p<z.value:V<new Date(z.value))}if((M||A)&&(D(!!M,R.message,z.message,Bt.max,Bt.min),!i))return y(_[S].message),_}if((f||d)&&!N&&(lt(p)||o&&Array.isArray(p))){const M=Tn(f),A=Tn(d),R=!it(M.value)&&p.length>+M.value,z=!it(A.value)&&p.length<+A.value;if((R||z)&&(D(R,M.message,A.message),!i))return y(_[S].message),_}if(C&&!N&<(p)){const{value:M,message:A}=Tn(C);if(Ss(M)&&!p.match(M)&&(_[S]={type:Bt.pattern,message:A,ref:l,...k(Bt.pattern,A)},!i))return y(A),_}if(w){if(xt(w)){const M=await w(p,n),A=mc(M,v);if(A&&(_[S]={...A,...k(Bt.validate,A.message)},!i))return y(A.message),_}else if(Ue(w)){let M={};for(const A in w){if(!nt(M)&&!i)break;const R=mc(await w[A](p,n),v,A);R&&(M={...R,...k(A,R.message)},y(R.message),i&&(_[S]=M))}if(!nt(M)&&(_[S]={ref:v,...M},!i))return _}}return y(!0),_};const QE={mode:yt.onSubmit,reValidateMode:yt.onChange,shouldFocusError:!0};function JE(e={}){let t={...QE,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:xt(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},i={},s=Ue(t.defaultValues)||Ue(t.values)?Ge(t.defaultValues||t.values)||{}:{},o=t.shouldUnregister?{}:Ge(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:oc(),state:oc()},C=t.criteriaMode===yt.all,w=B=>Y=>{clearTimeout(f),f=setTimeout(B,Y)},S=async B=>{if(!t.disabled&&(d.isValid||h.isValid||B)){const Y=t.resolver?nt((await E()).errors):await N(i,!0);Y!==n.isValid&&b.state.next({isValid:Y})}},c=(B,Y)=>{!t.disabled&&(d.isValidating||d.validatingFields||h.isValidating||h.validatingFields)&&((B||Array.from(a.mount)).forEach(Z=>{Z&&(Y?Oe(n.validatingFields,Z,Y):$e(n.validatingFields,Z))}),b.state.next({validatingFields:n.validatingFields,isValidating:!nt(n.validatingFields)}))},u=(B,Y=[],Z,se,ne=!0,te=!0)=>{if(se&&Z&&!t.disabled){if(l.action=!0,te&&Array.isArray(ue(i,B))){const ae=Z(ue(i,B),se.argA,se.argB);ne&&Oe(i,B,ae)}if(te&&Array.isArray(ue(n.errors,B))){const ae=Z(ue(n.errors,B),se.argA,se.argB);ne&&Oe(n.errors,B,ae),KE(n.errors,B)}if((d.touchedFields||h.touchedFields)&&te&&Array.isArray(ue(n.touchedFields,B))){const ae=Z(ue(n.touchedFields,B),se.argA,se.argB);ne&&Oe(n.touchedFields,B,ae)}(d.dirtyFields||h.dirtyFields)&&(n.dirtyFields=Mn(s,o)),b.state.next({name:B,isDirty:D(B,Y),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Oe(o,B,Y)},p=(B,Y)=>{Oe(n.errors,B,Y),b.state.next({errors:n.errors})},v=B=>{n.errors=B,b.state.next({errors:n.errors,isValid:!1})},y=(B,Y,Z,se)=>{const ne=ue(i,B);if(ne){const te=ue(o,B,We(Z)?ue(s,B):Z);We(te)||se&&se.defaultChecked||Y?Oe(o,B,Y?te:uc(ne._f)):R(B,te),l.mount&&!l.action&&S()}},_=(B,Y,Z,se,ne)=>{let te=!1,ae=!1;const ge={name:B};if(!t.disabled){if(!Z||se){(d.isDirty||h.isDirty)&&(ae=n.isDirty,n.isDirty=ge.isDirty=D(),te=ae!==ge.isDirty);const pe=Kt(ue(s,B),Y);ae=!!ue(n.dirtyFields,B),pe?$e(n.dirtyFields,B):Oe(n.dirtyFields,B,!0),ge.dirtyFields=n.dirtyFields,te=te||(d.dirtyFields||h.dirtyFields)&&ae!==!pe}if(Z){const pe=ue(n.touchedFields,B);pe||(Oe(n.touchedFields,B,Z),ge.touchedFields=n.touchedFields,te=te||(d.touchedFields||h.touchedFields)&&pe!==Z)}te&&ne&&b.state.next(ge)}return te?ge:{}},x=(B,Y,Z,se)=>{const ne=ue(n.errors,B),te=(d.isValid||h.isValid)&&Tt(Y)&&n.isValid!==Y;if(t.delayError&&Z?(r=w(()=>p(B,Z)),r(t.delayError)):(clearTimeout(f),r=null,Z?Oe(n.errors,B,Z):$e(n.errors,B)),(Z?!Kt(ne,Z):ne)||!nt(se)||te){const ae={...se,...te&&Tt(Y)?{isValid:Y}:{},errors:n.errors,name:B};n={...n,...ae},b.state.next(ae)}},E=async B=>{c(B,!0);const Y=await t.resolver(o,t.context,$E(B||a.mount,i,t.criteriaMode,t.shouldUseNativeValidation));return c(B),Y},T=async B=>{const{errors:Y}=await E(B);if(B)for(const Z of B){const se=ue(Y,Z);se?Oe(n.errors,Z,se):$e(n.errors,Z)}else n.errors=Y;return Y},N=async(B,Y,Z={valid:!0})=>{for(const se in B){const ne=B[se];if(ne){const{_f:te,...ae}=ne;if(te){const ge=a.array.has(te.name),pe=ne._f&&UE(ne._f);pe&&d.validatingFields&&c([te.name],!0);const xe=await gc(ne,a.disabled,o,C,t.shouldUseNativeValidation&&!Y,ge);if(pe&&d.validatingFields&&c([te.name]),xe[te.name]&&(Z.valid=!1,Y))break;!Y&&(ue(xe,te.name)?ge?XE(n.errors,xe,te.name):Oe(n.errors,te.name,xe[te.name]):$e(n.errors,te.name))}!nt(ae)&&await N(ae,Y,Z)}}return Z.valid},k=()=>{for(const B of a.unMount){const Y=ue(i,B);Y&&(Y._f.refs?Y._f.refs.every(Z=>!Ir(Z)):!Ir(Y._f.ref))&&W(B)}a.unMount=new Set},D=(B,Y)=>!t.disabled&&(B&&Y&&Oe(o,B,Y),!Kt(O(),s)),M=(B,Y,Z)=>jE(B,a,{...l.mount?o:We(Y)?s:lt(B)?{[B]:Y}:Y},Z,Y),A=B=>Gl(ue(l.mount?o:s,B,t.shouldUnregister?ue(s,B,[]):[])),R=(B,Y,Z={})=>{const se=ue(i,B);let ne=Y;if(se){const te=se._f;te&&(!te.disabled&&Oe(o,B,um(Y,te)),ne=Cs(te.ref)&&it(Y)?"":Y,lm(te.ref)?[...te.ref.options].forEach(ae=>ae.selected=ne.includes(ae.value)):te.refs?Ki(te.ref)?te.refs.forEach(ae=>{(!ae.defaultChecked||!ae.disabled)&&(Array.isArray(ne)?ae.checked=!!ne.find(ge=>ge===ae.value):ae.checked=ne===ae.value||!!ne)}):te.refs.forEach(ae=>ae.checked=ae.value===ne):Xl(te.ref)?te.ref.value="":(te.ref.value=ne,te.ref.type||b.state.next({name:B,values:Ge(o)})))}(Z.shouldDirty||Z.shouldTouch)&&_(B,ne,Z.shouldTouch,Z.shouldDirty,!0),Z.shouldValidate&&L(B)},z=(B,Y,Z)=>{for(const se in Y){if(!Y.hasOwnProperty(se))return;const ne=Y[se],te=B+"."+se,ae=ue(i,te);(a.array.has(B)||Ue(ne)||ae&&!ae._f)&&!fn(ne)?z(te,ne,Z):R(te,ne,Z)}},V=(B,Y,Z={})=>{const se=ue(i,B),ne=a.array.has(B),te=Ge(Y);Oe(o,B,te),ne?(b.array.next({name:B,values:Ge(o)}),(d.isDirty||d.dirtyFields||h.isDirty||h.dirtyFields)&&Z.shouldDirty&&b.state.next({name:B,dirtyFields:Mn(s,o),isDirty:D(B,te)})):se&&!se._f&&!it(te)?z(B,te,Z):R(B,te,Z),hc(B,a)&&b.state.next({...n,name:B}),b.state.next({name:l.mount?B:void 0,values:Ge(o)})},H=async B=>{l.mount=!0;const Y=B.target;let Z=Y.name,se=!0;const ne=ue(i,Z),te=pe=>{se=Number.isNaN(pe)||fn(pe)&&isNaN(pe.getTime())||Kt(pe,ue(o,Z,pe))},ae=dc(t.mode),ge=dc(t.reValidateMode);if(ne){let pe,xe;const De=Y.type?uc(ne._f):RE(B),ke=B.type===rc.BLUR||B.type===rc.FOCUS_OUT,Xe=!YE(ne._f)&&!t.resolver&&!ue(n.errors,Z)&&!ne._f.deps||GE(ke,ue(n.touchedFields,Z),n.isSubmitted,ge,ae),Fe=hc(Z,a,ke);Oe(o,Z,De),ke?(!Y||!Y.readOnly)&&(ne._f.onBlur&&ne._f.onBlur(B),r&&r(0)):ne._f.onChange&&ne._f.onChange(B);const Pe=_(Z,De,ke),He=!nt(Pe)||Fe;if(!ke&&b.state.next({name:Z,type:B.type,values:Ge(o)}),Xe)return(d.isValid||h.isValid)&&(t.mode==="onBlur"?ke&&S():ke||S()),He&&b.state.next({name:Z,...Fe?{}:Pe});if(!ke&&Fe&&b.state.next({...n}),t.resolver){const{errors:yn}=await E([Z]);if(te(De),se){const xn=pc(n.errors,i,Z),Ve=pc(yn,i,xn.name||Z);pe=Ve.error,Z=Ve.name,xe=nt(yn)}}else c([Z],!0),pe=(await gc(ne,a.disabled,o,C,t.shouldUseNativeValidation))[Z],c([Z]),te(De),se&&(pe?xe=!1:(d.isValid||h.isValid)&&(xe=await N(i,!0)));se&&(ne._f.deps&&(!Array.isArray(ne._f.deps)||ne._f.deps.length>0)&&L(ne._f.deps),x(Z,xe,pe,Pe))}},F=(B,Y)=>{if(ue(n.errors,Y)&&B.focus)return B.focus(),1},L=async(B,Y={})=>{let Z,se;const ne=pi(B);if(t.resolver){const te=await T(We(B)?B:ne);Z=nt(te),se=B?!ne.some(ae=>ue(te,ae)):Z}else B?(se=(await Promise.all(ne.map(async te=>{const ae=ue(i,te);return await N(ae&&ae._f?{[te]:ae}:ae)}))).every(Boolean),!(!se&&!n.isValid)&&S()):se=Z=await N(i);return b.state.next({...!lt(B)||(d.isValid||h.isValid)&&Z!==n.isValid?{}:{name:B},...t.resolver||!B?{isValid:Z}:{},errors:n.errors}),Y.shouldFocus&&!se&&mi(i,F,B?ne:a.mount),se},O=(B,Y)=>{let Z={...l.mount?o:s};return Y&&(Z=om(Y.dirtyFields?n.dirtyFields:n.touchedFields,Z)),We(B)?Z:lt(B)?ue(Z,B):B.map(se=>ue(Z,se))},j=(B,Y)=>({invalid:!!ue((Y||n).errors,B),isDirty:!!ue((Y||n).dirtyFields,B),error:ue((Y||n).errors,B),isValidating:!!ue(n.validatingFields,B),isTouched:!!ue((Y||n).touchedFields,B)}),P=B=>{B&&pi(B).forEach(Y=>$e(n.errors,Y)),b.state.next({errors:B?n.errors:{}})},U=(B,Y,Z)=>{const se=(ue(i,B,{_f:{}})._f||{}).ref,ne=ue(n.errors,B)||{},{ref:te,message:ae,type:ge,...pe}=ne;Oe(n.errors,B,{...pe,...Y,ref:se}),b.state.next({name:B,errors:n.errors,isValid:!1}),Z&&Z.shouldFocus&&se&&se.focus&&se.focus()},I=(B,Y)=>xt(B)?b.state.subscribe({next:Z=>"values"in Z&&B(M(void 0,Y),Z)}):M(B,Y,!0),$=B=>b.state.subscribe({next:Y=>{ZE(B.name,Y.name,B.exact)&&qE(Y,B.formState||d,Ce,B.reRenderRoot)&&B.callback({values:{...o},...n,...Y,defaultValues:s})}}).unsubscribe,Q=B=>(l.mount=!0,h={...h,...B.formState},$({...B,formState:h})),W=(B,Y={})=>{for(const Z of B?pi(B):a.mount)a.mount.delete(Z),a.array.delete(Z),Y.keepValue||($e(i,Z),$e(o,Z)),!Y.keepError&&$e(n.errors,Z),!Y.keepDirty&&$e(n.dirtyFields,Z),!Y.keepTouched&&$e(n.touchedFields,Z),!Y.keepIsValidating&&$e(n.validatingFields,Z),!t.shouldUnregister&&!Y.keepDefaultValue&&$e(s,Z);b.state.next({values:Ge(o)}),b.state.next({...n,...Y.keepDirty?{isDirty:D()}:{}}),!Y.keepIsValid&&S()},X=({disabled:B,name:Y})=>{(Tt(B)&&l.mount||B||a.disabled.has(Y))&&(B?a.disabled.add(Y):a.disabled.delete(Y))},q=(B,Y={})=>{let Z=ue(i,B);const se=Tt(Y.disabled)||Tt(t.disabled);return Oe(i,B,{...Z||{},_f:{...Z&&Z._f?Z._f:{ref:{name:B}},name:B,mount:!0,...Y}}),a.mount.add(B),Z?X({disabled:Tt(Y.disabled)?Y.disabled:t.disabled,name:B}):y(B,!0,Y.value),{...se?{disabled:Y.disabled||t.disabled}:{},...t.progressive?{required:!!Y.required,min:li(Y.min),max:li(Y.max),minLength:li(Y.minLength),maxLength:li(Y.maxLength),pattern:li(Y.pattern)}:{},name:B,onChange:H,onBlur:H,ref:ne=>{if(ne){q(B,Y),Z=ue(i,B);const te=We(ne.value)&&ne.querySelectorAll&&ne.querySelectorAll("input,select,textarea")[0]||ne,ae=zE(te),ge=Z._f.refs||[];if(ae?ge.find(pe=>pe===te):te===Z._f.ref)return;Oe(i,B,{_f:{...Z._f,...ae?{refs:[...ge.filter(Ir),te,...Array.isArray(ue(s,B))?[{}]:[]],ref:{type:te.type,name:B}}:{ref:te}}}),y(B,!1,void 0,te)}else Z=ue(i,B,{}),Z._f&&(Z._f.mount=!1),(t.shouldUnregister||Y.shouldUnregister)&&!(OE(a.array,B)&&l.action)&&a.unMount.add(B)}}},G=()=>t.shouldFocusError&&mi(i,F,a.mount),ee=B=>{Tt(B)&&(b.state.next({disabled:B}),mi(i,(Y,Z)=>{const se=ue(i,Z);se&&(Y.disabled=se._f.disabled||B,Array.isArray(se._f.refs)&&se._f.refs.forEach(ne=>{ne.disabled=se._f.disabled||B}))},0,!1))},re=(B,Y)=>async Z=>{let se;Z&&(Z.preventDefault&&Z.preventDefault(),Z.persist&&Z.persist());let ne=Ge(o);if(b.state.next({isSubmitting:!0}),t.resolver){const{errors:te,values:ae}=await E();n.errors=te,ne=Ge(ae)}else await N(i);if(a.disabled.size)for(const te of a.disabled)$e(ne,te);if($e(n.errors,"root"),nt(n.errors)){b.state.next({errors:{}});try{await B(ne,Z)}catch(te){se=te}}else Y&&await Y({...n.errors},Z),G(),setTimeout(G);if(b.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:nt(n.errors)&&!se,submitCount:n.submitCount+1,errors:n.errors}),se)throw se},ce=(B,Y={})=>{ue(i,B)&&(We(Y.defaultValue)?V(B,Ge(ue(s,B))):(V(B,Y.defaultValue),Oe(s,B,Ge(Y.defaultValue))),Y.keepTouched||$e(n.touchedFields,B),Y.keepDirty||($e(n.dirtyFields,B),n.isDirty=Y.defaultValue?D(B,Ge(ue(s,B))):D()),Y.keepError||($e(n.errors,B),d.isValid&&S()),b.state.next({...n}))},ie=(B,Y={})=>{const Z=B?Ge(B):s,se=Ge(Z),ne=nt(B),te=ne?s:se;if(Y.keepDefaultValues||(s=Z),!Y.keepValues){if(Y.keepDirtyValues){const ae=new Set([...a.mount,...Object.keys(Mn(s,o))]);for(const ge of Array.from(ae))ue(n.dirtyFields,ge)?Oe(te,ge,ue(o,ge)):V(ge,ue(te,ge))}else{if(Zl&&We(B))for(const ae of a.mount){const ge=ue(i,ae);if(ge&&ge._f){const pe=Array.isArray(ge._f.refs)?ge._f.refs[0]:ge._f.ref;if(Cs(pe)){const xe=pe.closest("form");if(xe){xe.reset();break}}}}if(Y.keepFieldsRef)for(const ae of a.mount)V(ae,ue(te,ae));else i={}}o=t.shouldUnregister?Y.keepDefaultValues?Ge(s):{}:Ge(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&&!nt(te),l.watch=!!t.shouldUnregister,l.action=!1,Y.keepErrors||(n.errors={}),b.state.next({submitCount:Y.keepSubmitCount?n.submitCount:0,isDirty:ne?!1:Y.keepDirty?n.isDirty:!!(Y.keepDefaultValues&&!Kt(B,s)),isSubmitted:Y.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:ne?{}:Y.keepDirtyValues?Y.keepDefaultValues&&o?Mn(s,o):n.dirtyFields:Y.keepDefaultValues&&B?Mn(s,B):Y.keepDirty?n.dirtyFields:{},touchedFields:Y.keepTouched?n.touchedFields:{},errors:Y.keepErrors?n.errors:{},isSubmitSuccessful:Y.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:s})},le=(B,Y)=>ie(xt(B)?B(o):B,Y),we=(B,Y={})=>{const Z=ue(i,B),se=Z&&Z._f;if(se){const ne=se.refs?se.refs[0]:se.ref;ne.focus&&(ne.focus(),Y.shouldSelect&&xt(ne.select)&&ne.select())}},Ce=B=>{n={...n,...B}},Ne={control:{register:q,unregister:W,getFieldState:j,handleSubmit:re,setError:U,_subscribe:$,_runSchema:E,_focusError:G,_getWatch:M,_getDirty:D,_setValid:S,_setFieldArray:u,_setDisabledField:X,_setErrors:v,_getFieldArray:A,_reset:ie,_resetDefaultValues:()=>xt(t.defaultValues)&&t.defaultValues().then(B=>{le(B,t.resetOptions),b.state.next({isLoading:!1})}),_removeUnmounted:k,_disableForm:ee,_subjects:b,_proxyFormState:d,get _fields(){return i},get _formValues(){return o},get _state(){return l},set _state(B){l=B},get _defaultValues(){return s},get _names(){return a},set _names(B){a=B},get _formState(){return n},get _options(){return t},set _options(B){t={...t,...B}}},subscribe:Q,trigger:L,register:q,handleSubmit:re,watch:I,setValue:V,getValues:O,reset:le,resetField:ce,clearErrors:P,unregister:W,setError:U,setFocus:we,getFieldState:j};return{...Ne,formControl:Ne}}function e5(e={}){const t=K.useRef(void 0),n=K.useRef(void 0),[i,s]=K.useState({isDirty:!1,isValidating:!1,isLoading:xt(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:xt(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:i},e.defaultValues&&!xt(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:l,...a}=JE(e);t.current={...a,formState:i}}const o=t.current.control;return o._options=e,FE(()=>{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&&!Kt(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=BE(i,o),t.current}const vc=(e,t,n)=>{if(e&&"reportValidity"in e){const i=ue(n,t);e.setCustomValidity(i&&i.message||""),e.reportValidity()}},fm=(e,t)=>{for(const n in t.fields){const i=t.fields[n];i&&i.ref&&"reportValidity"in i.ref?vc(i.ref,n,e):i.refs&&i.refs.forEach(s=>vc(s,n,e))}},t5=(e,t)=>{t.shouldUseNativeValidation&&fm(e,t);const n={};for(const i in e){const s=ue(t.fields,i),o=Object.assign(e[i]||{},{ref:s&&s.ref});if(n5(t.names||Object.keys(e),i)){const l=Object.assign({},ue(n,i));Oe(l,"root",o),Oe(n,i,l)}else Oe(n,i,o)}return n},n5=(e,t)=>e.some(n=>n.startsWith(t+"."));var i5=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]=rm(l,t,n,s,f?[].concat(f,i.message):i.message)}e.shift()}return n},s5=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&&fm({},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:t5(i5(l.errors,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw l}))}catch(l){return Promise.reject(l)}}};const hm=({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:C,submitLabel:w="Save",cancelLabel:S="Cancel",backLabel:c="Back",columns:u=1,showHeader:p=!0,showFooter:v=!0,showBack:y=!0,showCard:_=!0,listPath:x,icon:E,className:T,...N})=>{var Ne;const k=Je.useNavigate(),{id:D}=Je.useParams(),M=!!D,A=e==null?void 0:e(),R=A==null?void 0:A.form,z=(A==null?void 0:A.loading)??!1,V=((Ne=A==null?void 0:A.form)==null?void 0:Ne.isSubmitting)??!1,H=(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,L=A==null?void 0:A.update,O=A==null?void 0:A.resetForm,j=d||z,P=h||V;m.useEffect(()=>(M&&D&&H&&H(D),()=>{O==null||O()}),[D,M]);const U=()=>{a?a():k(x||-1)},I=()=>{l?l():U()},$=async B=>{var Y;(Y=B==null?void 0:B.preventDefault)==null||Y.call(B);try{let Z=(R==null?void 0:R.values)||{};r&&(Z=r(Z)),M?await(L==null?void 0:L(D,Z)):await(F==null?void 0:F(Z)),U()}catch(Z){console.error("Form submission error:",Z)}};if(e&&s){const B=M?`Edit ${b}`:`Create ${b}`,Y=g.jsxs("form",{onSubmit:$,children:[s,v&&g.jsxs("div",{className:"flex items-center justify-end gap-2 mt-6 pt-4 border-t",children:[g.jsxs(_e,{type:"button",variant:"outline",onClick:I,disabled:P,children:[g.jsx(Pn,{className:"mr-2 h-4 w-4"}),S]}),g.jsx(_e,{type:"submit",disabled:P||j,children:P?g.jsxs(g.Fragment,{children:[g.jsx(hn,{className:"mr-2 h-4 w-4 animate-spin"}),"Saving..."]}):g.jsxs(g.Fragment,{children:[g.jsx(ua,{className:"mr-2 h-4 w-4"}),w]})})]})]});return _?g.jsxs(ht,{className:T,...N,children:[g.jsx(In,{children:g.jsxs("div",{className:"flex items-center gap-4",children:[y&&g.jsx(_e,{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(Bn,{children:B}),C&&g.jsx(Fn,{children:C})]})]})}),g.jsx(pt,{children:Y})]}):g.jsxs("div",{className:J("space-y-6",T),...N,children:[g.jsxs("div",{className:"flex items-center gap-4",children:[y&&g.jsx(_e,{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:B}),C&&g.jsx("p",{className:"text-muted-foreground",children:C})]})]}),Y]})}const Q=e5({defaultValues:f||n,resolver:i?s5(i):void 0,mode:"onBlur"}),{handleSubmit:W,formState:{errors:X,isDirty:q,isValid:G},reset:ee,watch:re,setValue:ce,control:ie}=Q;m.useEffect(()=>{f&&ee(f)},[f,ee]);const le=async B=>{try{await(o==null?void 0:o(B))}catch(Y){console.error("Form submission error:",Y)}},we=B=>{var Pe;const{name:Y,type:Z="text",label:se,placeholder:ne,description:te,required:ae,disabled:ge,options:pe=[],className:xe,...De}=B,ke=(Pe=X[Y])==null?void 0:Pe.message,Xe=re(Y),Fe={label:se,placeholder:ne,description:te,error:ke,required:ae,disabled:ge||j||P,className:xe};switch(Z){case"text":case"email":case"password":case"number":case"url":case"tel":return g.jsx(ws,{...Fe,type:Z,...Q.register(Y),...De});case"textarea":return g.jsx(jl,{...Fe,...Q.register(Y),...De});case"select":return g.jsx(zl,{...Fe,options:pe,value:Xe,onChange:He=>ce(Y,He,{shouldValidate:!0}),...De});case"search-select":return g.jsx(Hl,{...Fe,options:pe,value:Xe,onChange:He=>ce(Y,He,{shouldValidate:!0}),...De});case"switch":return g.jsx(Vl,{...Fe,checked:Xe,onCheckedChange:He=>ce(Y,He,{shouldValidate:!0}),...De});case"checkbox":return g.jsx(Wl,{...Fe,checked:Xe,onCheckedChange:He=>ce(Y,He,{shouldValidate:!0}),...De});case"custom":return B.render?B.render({form:Q,field:B,error:ke,value:Xe}):null;default:return g.jsx(ws,{...Fe,type:"text",...Q.register(Y),...De})}},Ce=J("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"),be=g.jsxs("form",{onSubmit:W(le),children:[g.jsx("div",{className:Ce,children:t.map(B=>{if(B.hidden&&(typeof B.hidden=="function"?B.hidden(re()):B.hidden))return null;const Y=B.colSpan||1,Z=J(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:Z,children:we(B)},B.name)})}),v&&g.jsxs("div",{className:"flex items-center justify-end gap-2 mt-6 pt-4 border-t",children:[l&&g.jsxs(_e,{type:"button",variant:"outline",onClick:l,disabled:P,children:[g.jsx(Pn,{className:"mr-2 h-4 w-4"}),S]}),g.jsx(_e,{type:"submit",disabled:P||j,children:P?g.jsxs(g.Fragment,{children:[g.jsx(hn,{className:"mr-2 h-4 w-4 animate-spin"}),"Saving..."]}):g.jsxs(g.Fragment,{children:[g.jsx(ua,{className:"mr-2 h-4 w-4"}),w]})})]})]});return p&&(b||C||y)?g.jsxs(ht,{className:T,...N,children:[g.jsx(In,{children:g.jsxs("div",{className:"flex items-center gap-4",children:[y&&a&&g.jsx(_e,{variant:"ghost",size:"icon",onClick:a,children:g.jsx(Ft,{className:"h-4 w-4"})}),g.jsxs("div",{children:[b&&g.jsx(Bn,{children:b}),C&&g.jsx(Fn,{children:C})]})]})}),g.jsx(pt,{children:be})]}):g.jsx("div",{className:T,...N,children:be})};hm.displayName="CrudForm";const pm=({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:C="Edit",deleteLabel:w="Delete",backLabel:S="Back",itemName:c="item",getItemName:u,showEditButton:p=!0,showDeleteButton:v=!0,showHeader:y=!0,showMeta:_=!0,showCard:x=!0,columns:E=2,icon:T,className:N,...k})=>{const D=Je.useNavigate(),{id:M}=Je.useParams(),A=e==null?void 0:e(),R=A==null?void 0:A.currentItem,z=(A==null?void 0:A.loading)??!1,V=A==null?void 0:A.error,H=(A==null?void 0:A.fetchById)||(A==null?void 0:A.fetchOne),F=A==null?void 0:A.delete,L=n||R,O=i||z,j=s||V,[P,U]=m.useState(!1),[I,$]=m.useState(!1);m.useEffect(()=>{M&&H&&H(M)},[M]);const Q=()=>{l?l():D(f||-1)},W=()=>{a?a(L):d&&M&&D(`${d}/${M}/edit`)},X=async()=>{$(!0);try{r?await r(L):F&&M&&(await F(M),Q()),U(!1)}catch(ie){console.error("Delete error:",ie)}finally{$(!1)}},q=L&&u?u(L):(L==null?void 0:L.name)||(L==null?void 0:L.title)||c,G=(ie,le)=>{if(ie.render)return L?ie.render(le,L):g.jsx("span",{className:"text-muted-foreground",children:"-"});if(le==null||le==="")return g.jsx("span",{className:"text-muted-foreground",children:"-"});switch(ie.type){case"badge":return g.jsx(ai,{variant:ie.variant||"default",children:ie.format?ie.format(le):String(le)});case"status":const we={active:"success",inactive:"secondary",pending:"warning",error:"destructive",...ie.statusColors};return g.jsx(ai,{variant:we[le==null?void 0:le.toLowerCase()]||"default",children:ie.format?ie.format(le):String(le)});case"boolean":const Ce=!!le;return g.jsx(ai,{variant:Ce?"success":"secondary",children:Ce?ie.trueLabel||"Yes":ie.falseLabel||"No"});case"date":return ao(le);case"datetime":return os(le);case"currency":return new Intl.NumberFormat("en-US",{style:"currency",currency:ie.currency||"USD"}).format(le);case"number":return ie.format?ie.format(le):new Intl.NumberFormat().format(le);case"list":return Array.isArray(le)?g.jsx("div",{className:"flex flex-wrap gap-1",children:le.map((be,Ne)=>g.jsx(ai,{variant:"outline",children:ie.getItemLabel?ie.getItemLabel(be):String(be)},Ne))}):String(le);case"link":return g.jsx("a",{href:le,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:ie.linkText||le});case"email":return g.jsx("a",{href:`mailto:${le}`,className:"text-primary hover:underline",children:le});case"phone":return g.jsx("a",{href:`tel:${le}`,className:"text-primary hover:underline",children:le});case"image":return g.jsx("img",{src:le,alt:ie.label||"Image",className:J("rounded-md object-cover",ie.imageClassName||"h-20 w-20")});case"html":return g.jsx("div",{className:"prose prose-sm max-w-none",dangerouslySetInnerHTML:{__html:le}});default:return ie.format?ie.format(le):String(le)}},ee=ie=>{if(L)return ie.accessor?typeof ie.accessor=="function"?ie.accessor(L):L[ie.accessor]:L[ie.name]},re=J("grid gap-6",E===1&&"grid-cols-1",E===2&&"grid-cols-1 md:grid-cols-2",E===3&&"grid-cols-1 md:grid-cols-2 lg:grid-cols-3"),ce=g.jsxs(g.Fragment,{children:[g.jsx("div",{className:re,children:o.map(ie=>{if(ie.hidden&&(typeof ie.hidden=="function"?L&&ie.hidden(L):ie.hidden))return null;const le=ee(ie),we=ie.colSpan||1,Ce=J(we===2&&"md:col-span-2",we===3&&"lg:col-span-3",we==="full"&&"col-span-full");return g.jsxs("div",{className:Ce,children:[g.jsxs("dt",{className:"text-sm font-medium text-muted-foreground mb-1",children:[ie.icon&&g.jsx(ie.icon,{className:"inline-block mr-2 h-4 w-4"}),ie.label]}),g.jsx("dd",{className:"text-sm",children:G(ie,le)})]},ie.name||ie.accessor)})}),_&&L&&(L.created_at||L.updated_at||L.createdAt||L.updatedAt)&&g.jsxs(g.Fragment,{children:[g.jsx(Ai,{className:"my-6"}),g.jsxs("div",{className:"flex flex-wrap gap-6 text-sm text-muted-foreground",children:[(L.created_at||L.createdAt)&&(L.created_at||L.createdAt)!==""&&g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(ds,{className:"h-4 w-4"}),g.jsxs("span",{children:["Created: ",os(L.created_at||L.createdAt)]})]}),(L.updated_at||L.updatedAt)&&(L.updated_at||L.updatedAt)!==""&&g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(ds,{className:"h-4 w-4"}),g.jsxs("span",{children:["Updated: ",os(L.updated_at||L.updatedAt)]})]}),(L.id||L._id)&&g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(Ig,{className:"h-4 w-4"}),g.jsxs("span",{children:["ID: ",L.id||L._id]})]})]})]})]});return e&&t&&typeof t=="function"?O?g.jsx("div",{className:J("space-y-6",N),children:g.jsx(ht,{children:g.jsx(pt,{className:"py-12",children:g.jsx(qn,{text:`Loading ${c}...`})})})}):j?g.jsx("div",{className:J("space-y-6",N),children:g.jsx(ht,{children:g.jsxs(pt,{className:"py-12 text-center",children:[g.jsx("p",{className:"text-destructive",children:(j==null?void 0:j.message)||"An error occurred"}),g.jsxs(_e,{variant:"outline",onClick:Q,className:"mt-4",children:[g.jsx(Ft,{className:"mr-2 h-4 w-4"}),S]})]})})}):L?g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:J("space-y-6",N),...k,children:[y&&g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsxs("div",{className:"flex items-center gap-4",children:[g.jsx(_e,{variant:"ghost",size:"icon",onClick:Q,children:g.jsx(Ft,{className:"h-4 w-4"})}),T&&g.jsx("div",{className:"h-10 w-10 rounded-full bg-primary/10 flex items-center justify-center",children:g.jsx(T,{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)&&p&&g.jsxs(_e,{variant:"outline",onClick:W,children:[g.jsx(Fr,{className:"mr-2 h-4 w-4"}),C]}),(r||F)&&v&&g.jsxs(_e,{variant:"destructive",onClick:()=>U(!0),children:[g.jsx(jr,{className:"mr-2 h-4 w-4"}),w]})]})]}),t(L)]}),g.jsx(Ni,{open:P,onOpenChange:U,onConfirm:X,itemName:q,loading:I})]}):g.jsx("div",{className:J("space-y-6",N),children:g.jsx(ht,{children:g.jsxs(pt,{className:"py-12 text-center",children:[g.jsxs("p",{className:"text-muted-foreground",children:["No ",c," found"]}),g.jsxs(_e,{variant:"outline",onClick:Q,className:"mt-4",children:[g.jsx(Ft,{className:"mr-2 h-4 w-4"}),S]})]})})}):O?g.jsx(ht,{className:N,children:g.jsx(pt,{className:"py-12",children:g.jsx(qn,{text:`Loading ${c}...`})})}):j?g.jsx(ht,{className:N,children:g.jsxs(pt,{className:"py-12 text-center",children:[g.jsx("p",{className:"text-destructive",children:(j==null?void 0:j.message)||"An error occurred"}),g.jsxs(_e,{variant:"outline",onClick:Q,className:"mt-4",children:[g.jsx(Ft,{className:"mr-2 h-4 w-4"}),S]})]})}):L?g.jsxs(g.Fragment,{children:[g.jsxs(ht,{className:N,...k,children:[y&&g.jsxs(In,{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(_e,{variant:"ghost",size:"icon",onClick:Q,children:g.jsx(Ft,{className:"h-4 w-4"})}),g.jsxs("div",{children:[h&&g.jsx(Bn,{children:h}),b&&g.jsx(Fn,{children:b})]})]}),g.jsxs("div",{className:"flex items-center gap-2",children:[(a||d)&&p&&g.jsxs(_e,{variant:"outline",onClick:W,children:[g.jsx(Fr,{className:"mr-2 h-4 w-4"}),C]}),(r||F)&&v&&g.jsxs(_e,{variant:"destructive",onClick:()=>U(!0),children:[g.jsx(jr,{className:"mr-2 h-4 w-4"}),w]})]})]}),g.jsx(pt,{children:ce})]}),g.jsx(Ni,{open:P,onOpenChange:U,onConfirm:X,itemName:q,loading:I})]}):g.jsx(ht,{className:N,children:g.jsxs(pt,{className:"py-12 text-center",children:[g.jsxs("p",{className:"text-muted-foreground",children:["No ",c," found"]}),g.jsxs(_e,{variant:"outline",onClick:Q,className:"mt-4",children:[g.jsx(Ft,{className:"mr-2 h-4 w-4"}),S]})]})})};pm.displayName="CrudDetail";const mm=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,C)=>({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:w=>b({page:w}),setPageSize:w=>b({pageSize:w,page:1}),setSearch:w=>b({search:w,page:1}),setFilters:w=>b({filters:w,page:1}),setSort:(w,S)=>b({sortColumn:w,sortDirection:S}),setSelectedIds:w=>b({selectedIds:w}),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(w={})=>{var c,u,p,v;const S=C();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,...w};Object.keys(y).forEach(k=>{(y[k]===void 0||y[k]==="")&&delete y[k]});const x=(await n.get(i,{params:y})).data,E=x[f]||x.data||(Array.isArray(x)?x:[]),T=x[d]||x.total||E.length,N=Math.ceil(T/S.pageSize);return b({items:E.map(s),totalItems:T,totalPages:N,loading:!1}),{items:E,totalItems:T,totalPages:N}}catch(y){const _=((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:_,original:y},loading:!1}),y}},fetchOne:async w=>{var S,c,u,p;b({loading:!0,error:null,item:null});try{const v=await n.get(`${i}/${w}/`),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 w=>{var S,c,u,p,v;b({submitting:!0,error:null});try{const y=o(w),_=await n.post(`${i}/`,y),x=s(_.data);return b(E=>({items:[x,...E.items],totalItems:E.totalItems+1,submitting:!1})),x}catch(y){const _=((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:_,fieldErrors:x,original:y},submitting:!1}),y}},update:async(w,S)=>{var c,u,p,v,y;b({submitting:!0,error:null});try{const _=o(S),x=await n.patch(`${i}/${w}/`,_),E=s(x.data);return b(T=>{var N;return{items:T.items.map(k=>k[r]===w?E:k),item:((N=T.item)==null?void 0:N[r])===w?E:T.item,submitting:!1}}),E}catch(_){const x=((u=(c=_.response)==null?void 0:c.data)==null?void 0:u.message)||((v=(p=_.response)==null?void 0:p.data)==null?void 0:v.detail)||_.message||"Failed to update item",E=((y=_.response)==null?void 0:y.data)||{};throw b({error:{message:x,fieldErrors:E,original:_},submitting:!1}),_}},delete:async w=>{var S,c,u,p;b({submitting:!0,error:null});try{return await n.delete(`${i}/${w}/`),b(v=>{var y;return{items:v.items.filter(_=>_[r]!==w),totalItems:v.totalItems-1,item:((y=v.item)==null?void 0:y[r])===w?null:v.item,selectedIds:v.selectedIds.filter(_=>_!==w),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 w=>{var S,c,u,p;b({submitting:!0,error:null});try{return await Promise.all(w.map(v=>n.delete(`${i}/${v}/`))),b(v=>({items:v.items.filter(y=>!w.includes(y[r])),totalItems:v.totalItems-w.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(w,S)=>{var c,u,p,v,y;b({submitting:!0,error:null});try{const _=o(S),x=await n.put(`${i}/${w}/`,_),E=s(x.data);return b(T=>{var N;return{items:T.items.map(k=>k[r]===w?E:k),item:((N=T.item)==null?void 0:N[r])===w?E:T.item,submitting:!1}}),E}catch(_){const x=((u=(c=_.response)==null?void 0:c.data)==null?void 0:u.message)||((v=(p=_.response)==null?void 0:p.data)==null?void 0:v.detail)||_.message||"Failed to update item",E=((y=_.response)==null?void 0:y.data)||{};throw b({error:{message:x,fieldErrors:E,original:_},submitting:!1}),_}},...a}))},r5=e=>{const{create:t}=require("zustand");return t(mm(e))};function o5({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(),C=o||`© ${b} ${e}. All rights reserved.`,w=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:C})]});return g.jsxs("div",{className:"min-h-screen flex",children:[d&&g.jsx("div",{className:J("hidden lg:flex lg:w-1/2 bg-gray-900",l),children:r||w}),g.jsx("div",{className:J("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 l5({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:C="Sign up",signUpPath:w="/register",showRememberMe:S=!0,showForgotPassword:c=!0,showSignUp:u=!0,logo:p,className:v,children:y}){const[_,x]=K.useState(""),[E,T]=K.useState(""),[N,k]=K.useState(!1),D=async M=>{M.preventDefault(),e&&await e({email:_,password:E,rememberMe:N})};return g.jsxs("div",{className:J("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:D,className:"space-y-4",children:[g.jsxs("div",{className:"space-y-2",children:[g.jsx(Xt,{htmlFor:"email",children:o}),g.jsx(jn,{id:"email",type:"email",placeholder:l,value:_,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(Xt,{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(jn,{id:"password",type:"password",value:E,onChange:M=>T(M.target.value),required:!0,autoComplete:"current-password"})]}),S&&g.jsxs("div",{className:"flex items-center space-x-2",children:[g.jsx(zn,{id:"remember",checked:N,onCheckedChange:k}),g.jsx(Xt,{htmlFor:"remember",className:"text-sm font-normal cursor-pointer",children:r})]}),y,g.jsx(_e,{type:"submit",className:"w-full",disabled:t,children:t?"Signing in...":h})]}),u&&w&&g.jsxs("div",{className:"text-center text-sm text-muted-foreground",children:[b," ",g.jsx(Je.Link,{to:w,className:"text-primary underline-offset-4 hover:underline",children:C})]})]})}const gm=K.createContext(null);function pr(){const e=K.useContext(gm);if(!e)throw new Error("useSidebarContext must be used within a SidebarProvider");return e}function vm({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(gm.Provider,{value:h,children:n})}function bm({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:C}){var N,k;const{isOpen:w,isCollapsed:S,setOpen:c,toggleCollapse:u}=pr(),p=Je.useLocation(),[v,y]=K.useState([]),_=D=>{y(M=>M.includes(D)?M.filter(A=>A!==D):[...M,D])},x=(D,M=!1)=>{if(D.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:D.title}),S&&g.jsx(Ai,{className:"my-3 bg-sidebar-border"})]},D.title);if(h)return h(D,{isCollapsed:S,isSubItem:M,location:p});const A=D.icon,R=D.children&&D.children.length>0,z=v.includes(D.label),V=D.path&&(p.pathname===D.path||p.pathname.startsWith(D.path+"/")),H=R&&D.children.some(F=>p.pathname===F.path||p.pathname.startsWith(F.path+"/"));return R?g.jsxs("div",{children:[g.jsxs("button",{onClick:()=>_(D.label),className:J("w-full flex items-center gap-3 px-3 py-2 rounded-lg transition-colors text-sm",H?"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?D.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:D.label}),g.jsx(Ns,{className:J("h-4 w-4 transition-transform",z&&"rotate-180")})]})]}),!S&&z&&g.jsx("div",{className:"ml-4 mt-1 space-y-0.5",children:D.children.map(F=>x(F,!0))})]},D.label):g.jsxs(Je.Link,{to:D.path,className:J("flex items-center gap-3 px-3 py-2 rounded-lg transition-colors",V?"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?D.label:void 0,children:[A&&g.jsx(A,{className:"h-4 w-4 flex-shrink-0"}),!S&&g.jsx("span",{children:D.label})]},D.path||D.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(Pn,{className:"h-4 w-4 text-sidebar-foreground"})}),g.jsx("button",{onClick:u,className:J("hidden lg:block p-1.5 rounded-lg hover:bg-sidebar-accent",S&&"mx-auto"),children:S?g.jsx(ki,{className:"h-4 w-4 text-sidebar-foreground"}):g.jsx(co,{className:"h-4 w-4 text-sidebar-foreground"})})]}),T=s&&a&&g.jsx("div",{className:"px-3 py-3 border-t border-sidebar-border",children:g.jsxs(Sl,{children:[g.jsx(El,{asChild:!0,children:g.jsxs("button",{className:J("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(qo,{className:"h-8 w-8",children:[g.jsx(Zo,{src:s.avatar,alt:s.firstName||"User"}),g.jsxs(Go,{className:"bg-sidebar-primary text-sidebar-primary-foreground text-xs",children:[((N=s.firstName)==null?void 0:N[0])||"U",((k=s.lastName)==null?void 0:k[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(ar,{align:"end",className:"w-56",children:[g.jsx(cr,{children:"My Account"}),g.jsx(Ei,{}),l.map((D,M)=>g.jsx(Si,{asChild:!!D.path,onClick:D.onClick,children:D.path?g.jsx(Je.Link,{to:D.path,children:D.label}):D.label},M)),l.length>0&&g.jsx(Ei,{}),o&&g.jsx(Si,{onClick:o,className:"text-destructive",children:"Log out"})]})]})});return g.jsxs(g.Fragment,{children:[w&&g.jsx("div",{className:"fixed inset-0 bg-black/50 z-40 lg:hidden",onClick:()=>c(!1)}),g.jsxs("aside",{className:J("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",w?"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(D=>x(D))})}),C||T]})]})}function ym({pathNames:e={},showBreadcrumbs:t=!0,showMenuButton:n=!0,className:i,leftSlot:s,rightSlot:o,breadcrumbsSlot:l,children:a}){const{toggle:r}=pr(),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,w)=>{const S="/"+b.slice(0,w+1).join("/"),c=w===b.length-1,u=d[C]||C;return g.jsxs("div",{className:"flex items-center gap-1",children:[w>0&&g.jsx(ki,{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:J("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(Bg,{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(Ai,{})]})}function a5({sidebarProps:e,headerProps:t,showHeader:n=!0,showSidebar:i=!0,contentClassName:s,mainSlot:o,children:l}){const{isCollapsed:a}=pr();return g.jsxs("div",{className:"min-h-screen bg-background",children:[i&&g.jsx(bm,{...e}),g.jsxs("div",{className:J("transition-all duration-300 ease-in-out",i&&(a?"lg:ml-16":"lg:ml-60")),children:[n&&g.jsx(ym,{...t}),g.jsx("main",{className:J("p-4 md:p-6",s),children:o||l||g.jsx(Je.Outlet,{})})]})]})}function c5({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(vm,{defaultOpen:n,defaultCollapsed:i,children:g.jsx(a5,{sidebarProps:e,headerProps:t,showHeader:s,showSidebar:o,contentClassName:l,mainSlot:a,children:r})})}exports.Alert=Dl;exports.AlertDescription=Ll;exports.AlertDialog=AE;exports.AlertDialogAction=$p;exports.AlertDialogCancel=Up;exports.AlertDialogContent=jp;exports.AlertDialogDescription=Wp;exports.AlertDialogFooter=Hp;exports.AlertDialogHeader=zp;exports.AlertDialogOverlay=Ol;exports.AlertDialogPortal=Fp;exports.AlertDialogTitle=Vp;exports.AlertDialogTrigger=DE;exports.AlertTitle=Rl;exports.AlertWithIcon=bp;exports.AuthLayout=o5;exports.Avatar=qo;exports.AvatarFallback=Go;exports.AvatarImage=Zo;exports.Badge=ai;exports.Button=_e;exports.Calendar=sr;exports.Card=ht;exports.CardContent=pt;exports.CardDescription=Fn;exports.CardFooter=Lc;exports.CardHeader=In;exports.CardTitle=Bn;exports.Checkbox=zn;exports.ConfirmModal=Yl;exports.CreateEmptyState=em;exports.CrudDetail=pm;exports.CrudForm=hm;exports.CrudList=im;exports.DashboardLayout=c5;exports.DataTable=ql;exports.DatePicker=al;exports.DateRangePicker=cl;exports.DeleteConfirmModal=Ni;exports.Dialog=Hd;exports.DialogClose=e_;exports.DialogContent=Ho;exports.DialogDescription=$o;exports.DialogFooter=qs;exports.DialogHeader=Vo;exports.DialogOverlay=zo;exports.DialogPortal=Vd;exports.DialogTitle=Wo;exports.DialogTrigger=Jx;exports.DropdownMenu=Sl;exports.DropdownMenuCheckboxItem=ep;exports.DropdownMenuContent=ar;exports.DropdownMenuGroup=V3;exports.DropdownMenuItem=Si;exports.DropdownMenuLabel=cr;exports.DropdownMenuPortal=W3;exports.DropdownMenuRadioGroup=U3;exports.DropdownMenuRadioItem=tp;exports.DropdownMenuSeparator=Ei;exports.DropdownMenuShortcut=np;exports.DropdownMenuSub=$3;exports.DropdownMenuSubContent=J0;exports.DropdownMenuSubTrigger=Q0;exports.DropdownMenuTrigger=El;exports.EmptyState=ti;exports.ErrorState=tm;exports.FormField=Ut;exports.FormModal=nm;exports.Header=ym;exports.Input=jn;exports.Label=Xt;exports.Loading=qn;exports.LoadingButton=Jp;exports.LoadingOverlay=Qp;exports.LoginPage=l5;exports.Modal=fr;exports.Pagination=$l;exports.Popover=Qo;exports.PopoverContent=tr;exports.PopoverTrigger=Jo;exports.QCheckbox=Wl;exports.QDatePicker=Gp;exports.QDateRangePicker=Kp;exports.QForm=Zp;exports.QInput=ws;exports.QRichTextEditor=Xp;exports.QSearchSelect=Hl;exports.QSelect=zl;exports.QSwitch=Vl;exports.QTabs=pf;exports.QTextarea=jl;exports.RichTextEditor=ml;exports.ScrollArea=gp;exports.ScrollBar=Al;exports.SearchEmptyState=Ul;exports.SearchSelect=Fl;exports.Select=Mo;exports.SelectContent=Ws;exports.SelectGroup=Lx;exports.SelectItem=$s;exports.SelectLabel=bd;exports.SelectScrollDownButton=Ro;exports.SelectScrollUpButton=Do;exports.SelectSeparator=yd;exports.SelectTrigger=Vs;exports.SelectValue=Ao;exports.Separator=Ai;exports.Sidebar=bm;exports.SidebarProvider=vm;exports.Skeleton=_1;exports.Switch=bo;exports.Table=Pl;exports.TableBody=Bl;exports.TableCaption=qp;exports.TableCell=un;exports.TableFooter=Yp;exports.TableHead=hi;exports.TableHeader=Il;exports.TableRow=An;exports.Tabs=R_;exports.TabsContent=hf;exports.TabsList=df;exports.TabsTrigger=ff;exports.Textarea=fo;exports.Tooltip=yw;exports.TooltipContent=Of;exports.TooltipProvider=bw;exports.TooltipTrigger=xw;exports.alertVariants=vp;exports.badgeVariants=Oc;exports.buildQueryString=yg;exports.buttonVariants=Ts;exports.capitalize=fg;exports.cn=J;exports.createCrudStore=mm;exports.createStore=r5;exports.debounce=Mc;exports.deepClone=pg;exports.formatCurrency=cg;exports.formatDate=ao;exports.formatDateTime=os;exports.formatRelativeTime=ug;exports.generateId=vg;exports.getInitials=gg;exports.isEmpty=mg;exports.parseQueryString=bg;exports.slugify=hg;exports.truncate=dg;exports.useSidebarContext=pr;
|
|
259
259
|
//# sourceMappingURL=index.cjs.map
|